Commit 62f3a351 authored by 王苓芝's avatar 王苓芝

用户管理

parent 08bf3fd8
......@@ -7,7 +7,7 @@ const home = r => require.ensure([], () => r(require('../view/common/Home.vue'))
const micro = r => require.ensure([], () => r(require('../view/common/Micro.vue')), 'microLayout');
// const adList = r => require.ensure([], () => r(require('../view/operation/AdList.vue')), 'adList');
const newAdList = r => require.ensure([], () => r(require('../view/operation/newAdList.vue')), 'newAdList');
const userManage = r => require.ensure([], () => r(require('../view/userManaga/index.vue')), 'userManage');
const userManage = r => require.ensure([], () => r(require('../view/userManage/index.vue')), 'userManage');
// const loanHomePage = r => require.ensure([], () => r(require('../view/operation/LoanHomePage.vue')), 'loanHomePage');
const templateManage = r => require.ensure([], () => r(require('../view/sendManagement/templateManage.vue')), 'templateManage');
......
<template>
<div>
<Modal width="750" v-model="visible" title="查看订单" @on-cancel="cancel">
<Table ref="currentRowTable" border :columns="columns" :data="data" />
<div slot="footer" class="foot">
<Button size="large" @click="cancel">取消</Button>
</div>
</Modal>
</div>
</template>
<script>
export default {
props: {
visible: {
type: Boolean,
default: false,
},
data: {
type: Array,
default: () => [],
},
},
data() {
return {
columns: [
{
key: 'billNo',
title: '订单编号',
align: 'center',
},
{
key: 'payStatus',
title: '支付状态',
align: 'center',
render: (h, params) => (+params.row.payStatus ? '未支付' : '已支付'),
},
{
key: 'balance',
title: '余额支付金额',
align: 'center',
},
{
key: 'weixinCount',
title: '微信支付金额',
align: 'center',
},
{
key: 'time',
title: '下单时间',
align: 'center',
},
{
key: 'goodsName',
title: '商品名称',
align: 'center',
},
],
};
},
methods: {
cancel() {
this.$emit('cancle');
},
},
};
</script>
// 余额状态
const bstaus = {
0: '未到期',
1: '已到期',
};
//用户状态
const userStatus = {
0: '未启用',
1: '启用',
};
export const columns = [
{
key: 'userId',
title: '用户Id',
align: 'center',
},
{
key: 'phone',
title: '用户手机号',
align: 'center',
},
{
key: 'bstatus',
title: '余额状态',
align: 'center',
render: (h, params) => bstaus[params.row.bstatus],
},
{
key: 'count',
title: '初始金额',
align: 'center',
},
{
key: 'balance',
title: '当前余额',
align: 'center',
},
{
key: 'joinDate',
title: '注册时间',
align: 'center',
},
{
key: 'date',
title: '余额到期日期',
align: 'center',
},
{
key: 'totalPrice',
title: '微信支付累计金额',
align: 'center',
},
{
key: 'status',
title: '用户状态',
align: 'center',
render: (h, params) => userStatus[params.row.status],
},
];
<template>
<div>
<Form ref="form" :label-width="90" inline :model="form" :rules="ruleValidate" style="margin-top:20px;">
<FormItem label="邀请人userId">
<Input v-model="form.inviterId" placeholder="请输入用户userId" clearable style="width: 150px" />
<Form ref="form" :label-width="90" inline :model="form" style="margin-top:20px;">
<FormItem label="用户id:" prop="userId">
<Input v-model="form.userId" placeholder="请输入用户userId" clearable style="width: 180px" />
</FormItem>
<FormItem label="起始日期:">
<DatePicker
v-model="usedTime"
type="daterange"
confirm
placement="bottom-end"
placeholder="请选择开始时间 - 请选择结束时间"
style="width: 220px"
clearable
@on-change="
e => {
onDateRangeChange(e, 'startDate', 'endDate');
}
"
/>
<FormItem label="用户手机号:" prop="phoneNo">
<Input v-model="form.phoneNo" placeholder="请输入用户userId" clearable style="width: 180px" />
</FormItem>
</Form>
<FormItem label="余额状态:" prop="status">
<Select v-model="form.status" style="width:180px" filterable>
<Option :value="0">已到期</Option>
<Option :value="1">未到期</Option>
</Select>
</FormItem>
<FormItem>
<Button type="primary" @click="getList()">查询</Button>
<Button type="" @click="reset()">重置</Button>
</FormItem>
</Form>
<Table ref="currentRowTable" border :columns="columns" :data="dataList" />
<Page style="margin:20px" :total="count" :current="form.pageNo" :page-size="form.pageSize" size="small" show-total show-elevator @on-change="changePage" />
<bill-modal :visible="showBillModal" :data="billInfoList" @cancle="showBillModal = false" />
</div>
</template>
<script>
import sendMessageApi from '../../services/apis/appUrl.service';
import appConfig from '../../services/appConfig.js';
// import sendMessageApi from '../../services/apis/appUrl.service';
import { columns } from './constData.js';
import BillModal from './components/billModal.vue';
export default {
data() {
return {
ruleValidate: {},
usedTime: [],
width: '80',
form: {
pageNo: 1,
pageSize: 10,
inviterId: '',
startDate: '',
endDate: '',
userId: '',
phoneNo: '',
status: '',
},
count: 0,
columns: appConfig.FRIEND_COLUMNS,
columns: [
...columns,
{
key: 'option',
title: '操作',
align: 'center',
width: '200px',
render: (h, params) => {
return h('div', [
h(
'Button',
{
props: {
type: 'primary',
size: 'small',
},
style: {
margin: '5px',
},
on: {
click: () => {
console.log('点击停用&启用');
},
},
},
params.row.status ? '停用' : '启用'
),
h(
'Button',
{
props: {
type: 'primary',
size: 'small',
},
style: {
margin: '0 5px',
},
on: {
click: () => {
console.log('查看订单');
this.showBillModal = true;
},
},
},
'查看订单'
),
]);
},
},
],
dataList: [],
showBillModal: false,
billInfoList: [
{
billNo: 123456,
payStatus: 0,
balance: 1000,
weixinCount: 893,
time: '2012-09-23',
goodsName: '商品名称',
},
],
};
},
components: {
BillModal,
},
mounted() {
this.getList();
},
methods: {
onDateRangeChange(e, start, end) {
this.form[start] = e[0] || '';
this.form[end] = e[1] || '';
reset() {
this.$refs['form'].resetFields();
this.getList(); // 接口好了以后调用
},
getList(page = 1) {
const reg = /^[0-9]+.?[0-9]*$/;
if (this.form.inviterId !== '' && !reg.test(this.form.inviterId)) {
this.$Notice.error({
title: '请输入数字类型的userId',
});
return;
}
if ((this.form.startDate !== '' && this.form.endDate === '') || (this.form.startDate === '' && this.form.endDate !== '')) {
this.$Notice.error({
title: '请检查起始时间是否填写完整',
});
return;
}
// const reg = /^[0-9]+.?[0-9]*$/;
// if (this.form.inviterId !== '' && !reg.test(this.form.inviterId)) {
// this.$Notice.error({
// title: '请输入数字类型的userId',
// });
// return;
// }
this.form.pageNo = page;
sendMessageApi.inviteList(this.form).then(res => {
this.dataList = res.dataList || [];
this.count = res.totalCount;
});
this.dataList = [
{
userId: 123,
phone: 18809090987,
bstatus: 1,
count: 1000,
balance: 100,
joinDate: '2021-09-08',
date: '2021-09-43',
totalPrice: 10000,
status: 1,
},
{
userId: 321,
phone: 18809090987,
bstatus: 0,
count: 1000,
balance: 100,
joinDate: '2021-09-08',
date: '2021-09-43',
totalPrice: 10000,
status: 0,
},
];
// sendMessageApi.inviteList(this.form).then(res => {
// this.dataList = res.dataList || [];
// this.count = res.totalCount;
// });
},
changePage(page) {
this.getList(page);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment