This commit is contained in:
faiz 2024-06-28 14:41:45 +08:00
parent f374238e56
commit 0f12de1586
4 changed files with 230 additions and 2 deletions

View File

@ -3,11 +3,11 @@ ENV = 'development'
# http://192.168.1.43:8324/admin # http://192.168.1.43:8324/admin
# http://mer.crmeb.net/admin # http://mer.crmeb.net/admin
# base api # base api
VUE_APP_BASE_API = 'http://192.168.1.3:8080' VUE_APP_BASE_API = 'http://192.168.1.24:8080'
# VUE_APP_BASE_API = 'https://api.tropjoin.com/' # VUE_APP_BASE_API = 'https://api.tropjoin.com/'
# socket 连接地址 # socket 连接地址
VUE_APP_WS_URL = 'ws://http://192.168.1.3:8080' VUE_APP_WS_URL = 'ws://http://192.168.1.24:8080'
# VUE_APP_WS_URL = 'ws://https://api.tropjoin.com/' # VUE_APP_WS_URL = 'ws://https://api.tropjoin.com/'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

View File

@ -7,6 +7,13 @@ import request from './request'
export function orderListApi(data) { export function orderListApi(data) {
return request.get('order/lst', data) return request.get('order/lst', data)
} }
/**
/**
* @description 用户消费统计 -- 列表
*/
export function orderStatApi(data) {
return request.get('order/stat', data)
}
/** /**
* @description 退款订单 -- 详情 * @description 退款订单 -- 详情
*/ */

View File

@ -66,6 +66,12 @@ export const constantRoutes = [
component: () => import("@/views/dashboard/index"), component: () => import("@/views/dashboard/index"),
name: "Dashboard", name: "Dashboard",
meta: { title: "控制台", icon: "dashboard", affix: true } meta: { title: "控制台", icon: "dashboard", affix: true }
},
{
path: `${roterPre}/user-consumption`,
component: () => import("@/views/user-consumption/index"),
name: "user-consumption",
meta: { title: "用户消费统计" }
} }
] ]
}, },

View File

@ -0,0 +1,215 @@
<template>
<div class="divBox">
<div class="selCard mb14">
<el-form size="small" inline :model="tableFrom" ref="searchForm" label-width="85px">
<el-form-item label="订单状态:" class="width100" prop="status">
<el-radio-group v-model="tableFrom.status" type="button" @change="getList(1)">
<el-radio-button label="">全部 {{ '(' +orderChartType.all?orderChartType.all:0 + ')' }}</el-radio-button>
<el-radio-button
label="1"
>待付款 {{ '(' +orderChartType.unpaid?orderChartType.unpaid:0+ ')' }}</el-radio-button>
<el-radio-button
label="2"
>待发货 {{ '(' +orderChartType.unshipped?orderChartType.unshipped:0+ ')' }}</el-radio-button>
<el-radio-button
label="3"
>待收货 {{ '(' +orderChartType.untake?orderChartType.untake:0+ ')' }}</el-radio-button>
<el-radio-button
label="4"
>待评价 {{ '(' +orderChartType.unevaluate?orderChartType.unevaluate:0+ ')' }}</el-radio-button>
<el-radio-button
label="5"
>交易完成 {{ '(' +orderChartType.complete?orderChartType.complete:0+ ')' }}</el-radio-button>
<el-radio-button
label="6"
>已退款 {{ '(' +orderChartType.refund?orderChartType.refund:0+ ')' }}</el-radio-button>
<el-radio-button
label="7"
>已删除 {{ '(' +orderChartType.del?orderChartType.del:0+ ')' }}</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="时间选择:">
<el-date-picker
v-model="timeVal"
value-format="yyyy/MM/dd HH:mm:ss"
format="yyyy/MM/dd HH:mm:ss"
size="small"
type="datetimerange"
placement="bottom-end"
placeholder="自定义时间"
style="width: 280px;"
:picker-options="pickerOptions"
@change="onchangeTime"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)">搜索</el-button>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
</div>
<el-card>
<el-table
v-loading="listLoading"
:data="tableData.data"
size="small"
class="table"
align="center"
>
<el-table-column label="用户名称" min-width="130" prop="real_name"></el-table-column>
<el-table-column label="手机号码" min-width="130" prop="phone"></el-table-column>
<el-table-column label="注册日期" min-width="130" prop="create_time"></el-table-column>
<el-table-column label="消费金额" min-width="130" prop="price"></el-table-column>
</el-table>
<div class="block">
<el-pagination
background
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
</div>
</template>
<script>
import { orderListApi, chartApi, cardListApi,orderStatApi } from "@/api/order";
import { fromList } from "@/libs/constants.js";
import timeOptions from '@/utils/timeOptions';
export default {
data() {
return {
pickerOptions: timeOptions,
orderId: 0,
tableData: {
data: [],
total: 0,
},
listLoading: true,
tableFrom: {
status: this.$route.query.status || '',
date: "",
page: 1,
limit: 20,
},
orderChartType: {},
timeVal: [],
fromList: fromList,
selectionList: [],
ids: "",
uid: "",
visibleDetail: false,
tableFromLog: {
page: 1,
limit: 10,
},
tableDataLog: {
data: [],
total: 0,
},
LogLoading: false,
dialogVisible: false,
cardLists: [],
orderDatalist: null,
drawer: false,
userDawer: false,
};
},
mounted() {
this.headerList();
this.getList('');
},
//
activated() {
this.headerList();
this.getList('');
},
methods: {
/**重置 */
searchReset(){
this.timeVal = []
this.tableFrom.date = ""
this.$refs.searchForm.resetFields()
this.getList(1)
},
pageChangeLog(page) {
this.tableFromLog.page = page;
this.getList('');
},
handleSizeChangeLog(val) {
this.tableFromLog.limit = val;
this.getList('');
},
//
onchangeTime(e) {
this.timeVal = e;
console.log(e);
this.tableFrom.date = e ? this.timeVal.join("-") : "";
this.tableFrom.page = 1;
this.getList(1);
},
//
getList(num) {
this.listLoading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
orderStatApi(this.tableFrom)
.then((res) => {
this.tableData.data = res.data.list;
this.tableData.total = res.data.count;
this.listLoading = false;
})
.catch((res) => {
this.$message.error(res.message);
this.listLoading = false;
});
},
pageChange(page) {
this.tableFrom.page = page;
this.getList('');
},
handleSizeChange(val) {
this.tableFrom.limit = val;
this.getList('');
},
headerList() {
chartApi()
.then((res) => {
this.orderChartType = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
},
},
};
</script>
<style lang="scss" scoped>
.demo-table-expand ::v-deep label {
width: 83px !important;
}
.el-dropdown-link {
cursor: pointer;
color: var(--prev-color-primary);
font-size: 12px;
}
.el-icon-arrow-down {
font-size: 12px;
}
.tabBox_tit {
max-width: 60%;
font-size: 12px !important;
margin: 0 2px 0 10px;
letter-spacing: 1px;
padding: 5px 0;
box-sizing: border-box;
}
::v-deep .row-bg .cell {
color: red !important;
}
</style>