feat: 后台新增积分明细页面,查看所有用户积分消耗/充值流水
- 新增云函数 admin/points/sys/getList(jjx-points-log 联表 uni-id-users) - 新增页面 pages/points/log/list(vk-data-table,支持类型/业务类型/时间筛选) - 菜单注册在资金管理下「积分明细」
This commit is contained in:
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<view class="page-body">
|
||||
<vk-data-table-query v-model="queryForm1.formData" :columns="queryForm1.columns"
|
||||
@search="search"></vk-data-table-query>
|
||||
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns" :query-form-param="queryForm1"
|
||||
:pagination="true"
|
||||
@current-change="currentChange"
|
||||
@selection-change="selectionChange"></vk-data-table>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var that;
|
||||
var vk = uni.vk;
|
||||
|
||||
const typeData = [
|
||||
{ value: "spend", label: "消耗" },
|
||||
{ value: "earn", label: "充值/收入" }
|
||||
];
|
||||
|
||||
const bizTypeData = [
|
||||
{ value: "contract_review", label: "合同审查" },
|
||||
{ value: "recharge", label: "积分充值" },
|
||||
{ value: "other", label: "其他" }
|
||||
];
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
table1: {
|
||||
action: "admin/points/sys/getList",
|
||||
columns: [
|
||||
{
|
||||
key: "userInfo",
|
||||
title: "用户",
|
||||
type: "html",
|
||||
align: "left",
|
||||
width: 200,
|
||||
formatter: (val, row) => {
|
||||
const user = row.userInfo && row.userInfo[0] ? row.userInfo[0] : {};
|
||||
const name = user.nickname || "未设置昵称";
|
||||
const mobile = user.mobile || "-";
|
||||
return `<div>${name}</div><div style="color:#999;font-size:12px;">${mobile}</div>`;
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "type",
|
||||
title: "类型",
|
||||
type: "select",
|
||||
align: "center",
|
||||
width: 110,
|
||||
data: typeData
|
||||
},
|
||||
{
|
||||
key: "amount",
|
||||
title: "变动积分",
|
||||
type: "html",
|
||||
align: "center",
|
||||
width: 120,
|
||||
formatter: (val) => {
|
||||
const num = Number(val || 0);
|
||||
const color = num >= 0 ? "#67c23a" : "#f56c6c";
|
||||
return `<span style="color:${color};font-weight:bold;">${num >= 0 ? "+" : ""}${num}</span>`;
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "balance_after",
|
||||
title: "变动后余额",
|
||||
type: "text",
|
||||
align: "center",
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
key: "reason",
|
||||
title: "事由",
|
||||
type: "text",
|
||||
align: "left",
|
||||
minWidth: 260
|
||||
},
|
||||
{
|
||||
key: "biz_type",
|
||||
title: "业务类型",
|
||||
type: "select",
|
||||
align: "center",
|
||||
width: 120,
|
||||
data: bizTypeData
|
||||
},
|
||||
{
|
||||
key: "_add_time",
|
||||
title: "时间",
|
||||
type: "time",
|
||||
width: 180,
|
||||
sortable: "custom"
|
||||
}
|
||||
],
|
||||
multipleSelection: [],
|
||||
selectItem: ""
|
||||
},
|
||||
queryForm1: {
|
||||
formData: {},
|
||||
columns: [
|
||||
{
|
||||
key: "type",
|
||||
title: "类型",
|
||||
type: "select",
|
||||
mode: "=",
|
||||
data: typeData
|
||||
},
|
||||
{
|
||||
key: "biz_type",
|
||||
title: "业务类型",
|
||||
type: "select",
|
||||
mode: "=",
|
||||
data: bizTypeData
|
||||
},
|
||||
{
|
||||
key: "_add_time",
|
||||
title: "时间",
|
||||
type: "datetimerange",
|
||||
width: 380,
|
||||
mode: "[]"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad(options = {}) {
|
||||
that = this;
|
||||
vk = that.vk;
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
that.$refs.table1.search();
|
||||
},
|
||||
currentChange(val) {
|
||||
that.table1.selectItem = val;
|
||||
},
|
||||
selectionChange(list) {
|
||||
that.table1.multipleSelection = list;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-body {
|
||||
padding: 15px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user