diff --git a/pages/signOnlyUser/list.vue b/pages/signOnlyUser/list.vue
index ea26305..600725c 100644
--- a/pages/signOnlyUser/list.vue
+++ b/pages/signOnlyUser/list.vue
@@ -113,6 +113,23 @@
关闭
+
+
+
+ 用户:{{ giftDialog.user.nickname || '未设置' }}({{ giftDialog.user.mobile || '未绑定' }})
+
+ 请输入赠送次数
+
+
+
@@ -143,6 +160,12 @@ export default {
return {
showInviteList: false,
inviteList: [],
+ giftDialog: {
+ show: false,
+ loading: false,
+ giftNum: 1,
+ user: null
+ },
// 页面是否请求中或加载中
loading: false,
// init请求返回的数据
@@ -163,6 +186,14 @@ export default {
}
});
}
+ },
+ {
+ title: "赠送",
+ onClick: function (item) {
+ that.giftDialog.user = item;
+ that.giftDialog.giftNum = 1;
+ that.giftDialog.show = true;
+ }
}
],
// 表格数据请求地址
@@ -177,6 +208,7 @@ export default {
{key: "qybUsedNum", title: "已消费次数", type: "text", width: 120, defaultValue: 0},
{key: "qybNum", title: "剩余签约次数", type: "text", width: 120, defaultValue: 0},
{key: "qybGiftNum", title: "优惠政策赠送次数", type: "text", width: 150, defaultValue: 0},
+ {key: "qybTotalGiftNum", title: "累计赠送次数", type: "text", width: 120, defaultValue: 0},
{
key: "userLevel",
title: "用户等级",
@@ -604,6 +636,30 @@ export default {
dcloudAppidData
}
};
+ },
+ // 提交赠送签约次数
+ submitGiftQybNum() {
+ const user = that.giftDialog.user;
+ const giftNum = Number(that.giftDialog.giftNum);
+ if (!user || !user._id) return vk.toast('请选择用户');
+ if (!Number.isInteger(giftNum) || giftNum <= 0) return vk.toast('赠送次数必须为正整数');
+ that.giftDialog.loading = true;
+ vk.callFunction({
+ url: 'admin/system/user/sys/giftQybNum',
+ title: '赠送中...',
+ data: {
+ user_id: user._id,
+ giftNum
+ },
+ success: () => {
+ that.giftDialog.show = false;
+ that.$notify({ message: '赠送成功', type: 'success' });
+ that.refresh();
+ },
+ complete: () => {
+ that.giftDialog.loading = false;
+ }
+ });
}
},
// 监听属性
diff --git a/pages_plugs/system/user/list.vue b/pages_plugs/system/user/list.vue
index 89d0f73..bb4287d 100644
--- a/pages_plugs/system/user/list.vue
+++ b/pages_plugs/system/user/list.vue
@@ -173,6 +173,11 @@ export default {
// {key: "username", title: "用户名", type: "text", width: 180, defaultValue: '未设置'},
{key: "nickname", title: "昵称", type: "text", width: 180, defaultValue: '未设置'},
{key: "mobile", title: "手机号", type: "text", width: 120, defaultValue: "未绑定"},
+ {key: "qybBuyNum", title: "累计购买", type: "text", width: 100, defaultValue: 0},
+ {key: "qybUsedNum", title: "已消费", type: "text", width: 100, defaultValue: 0},
+ {key: "qybNum", title: "剩余签约", type: "text", width: 100, defaultValue: 0},
+ {key: "qybGiftNum", title: "赠送", type: "text", width: 100, defaultValue: 0},
+ {key: "qybTotalGiftNum", title: "总共赠送次数", type: "text", width: 120, defaultValue: 0},
{
key: "userLevel",
title: "用户等级",
diff --git a/uniCloud-tcb/cloudfunctions/router/service/admin/system/user/sys/getList.js b/uniCloud-tcb/cloudfunctions/router/service/admin/system/user/sys/getList.js
index fd98542..b50d08f 100644
--- a/uniCloud-tcb/cloudfunctions/router/service/admin/system/user/sys/getList.js
+++ b/uniCloud-tcb/cloudfunctions/router/service/admin/system/user/sys/getList.js
@@ -1,59 +1,230 @@
module.exports = {
- /**
- * 查询用户列表(可登录后台的)
- * @url admin/system/user/sys/getList 前端调用的url参数地址
- * data 请求参数 说明
- * @param {Number} pageIndex 当前页码
- * @param {Number} pageSize 每页显示数量
- * @param {Array