From e21ff23fa03b93e536422d05a000e85b72337788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com> Date: Mon, 15 Sep 2025 14:47:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=20VIP=E5=8A=9E=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/miniClass/miniClassList.vue | 92 +- src/views/modules/user/user.vue | 2 +- src/views/modules/vipList/user-open-vip.vue | 208 +- src/views/modules/vipList/userList.vue | 310 ++- src/views/modules/vipList/vipDetail.vue | 1904 ++++++++++------- 5 files changed, 1601 insertions(+), 915 deletions(-) diff --git a/src/views/modules/miniClass/miniClassList.vue b/src/views/modules/miniClass/miniClassList.vue index cda78a5..0bb348a 100644 --- a/src/views/modules/miniClass/miniClassList.vue +++ b/src/views/modules/miniClass/miniClassList.vue @@ -154,7 +154,30 @@ width="800px" :close="setStudentClose" > -
+
+
+ + + + + 添加学员 +
+

已添加的成员列表

@@ -194,6 +217,7 @@ import miniClass from "./miniClass.vue"; export default { data() { return { + addForm:{}, setStudentVisible: false, setStudentVisible: false, studentList: [], // 学员列表 @@ -333,6 +357,70 @@ export default { }else{ this.$message.error("获取学员列表失败"); } + }, + handleSelect(data) { + console.log("data at line 161:", data); + this.addForm.userKey = data.tel || data.email; + this.addForm.userId = data.id; + this.addForm.name = data.name; + this.addForm.tel = data.tel; + this.addForm.email = data.email; + }, + loadAll(queryString, cb) { + this.addForm.userId = ""; + this.addForm.userName = ""; + if (queryString == "") { + return false; + } + this.$http({ + // url: this.$http.adornUrl('/book/user/list'), + url: this.$http.adornUrl("/book/user/getUserList"), + method: "post", + data: this.$http.adornData({ + page: 1, + limit: 9999, + key: queryString + }) + }).then(({ data }) => { + if (data && data.code === 0) { + var arr = data.user.records; + console.log("arr at line 467:", arr); + cb(arr); + } else { + cb([]); + } + }); + }, + addClass(row){ + console.log('row at line 340:', this.miniClass.id,this.addForm) + if(this.addForm&&this.addForm.userId){ + this.$http({ + // url: this.$http.adornUrl('/book/user/list'), + url: this.$http.adornUrl("/common/class/addClassUser"), + method: "post", + data: this.$http.adornData({ + classId: this.miniClass.id, + userId: this.addForm.userId + }) + }).then(async ({ data }) => { + if (data && data.code === 0) { + this.$message({ + type: "success", + message: "添加成功!" + }); + var jieguo = await this.getCLassInfo(this.miniClass.id) + if(jieguo.data.code == 0){ + this.studentList = jieguo.data.result.students; + this.addForm={} + }else{ + this.$message.error("获取学员列表失败"); + } + } + }); + }else{ + this.$message.error("请输入手机号/邮箱"); + } + }, // 踢出班级 async outClass(row) { diff --git a/src/views/modules/user/user.vue b/src/views/modules/user/user.vue index bfc7c28..ddb2816 100644 --- a/src/views/modules/user/user.vue +++ b/src/views/modules/user/user.vue @@ -120,7 +120,7 @@ v-else-if="scope.row.nickname == scope.row.name" > - 未设置 + {{ scope.row.nickname }}
diff --git a/src/views/modules/vipList/user-open-vip.vue b/src/views/modules/vipList/user-open-vip.vue index d7a8980..59fac66 100644 --- a/src/views/modules/vipList/user-open-vip.vue +++ b/src/views/modules/vipList/user-open-vip.vue @@ -1,7 +1,8 @@ @@ -135,12 +156,14 @@ export default { name: "", tel: "", email: "", - peanutCoin: "", + + pageType: "", //vip类型 type: "", //vip类型 year: "", - day: "", + remark: "", - price: "0" + fee: 0, //金额 + jf: 0 //积分 }, peanutCoin: 0, //天医币和积分总和判断是否为0 dataRule: { @@ -160,12 +183,15 @@ export default { ] }, typeList: [ + { value: "11", label: "超v" }, + { value: "12", label: "简易超v" }, { value: "1", label: "医学超v" }, + { value: "2", label: "国学与心理学超v" }, { value: "4", label: "中医学" }, - { value: "9", label: "中西汇通学" }, { value: "5", label: "针灸学" }, { value: "6", label: "肿瘤学" }, - { value: "2", label: "国学与心理学超v" }, + + { value: "9", label: "中西汇通学" }, { value: "7", label: "国学" }, { value: "8", label: "心理学" } ], @@ -178,14 +204,41 @@ export default { }, methods: { init(data) { + this.dataForm = { + id: 0, + name: "", + tel: "", + email: "", + + pageType: "", //vip类型 + type: "", //vip类型 + year: "", + + remark: "", + fee: 0, //金额 + jf: 0 //积分 + } this.visible = true; - this.dataForm.userKey = data.tel || data.email; - this.dataForm.userId = data.id; - this.dataForm.name = data.name; - this.dataForm.tel = data.tel; - this.dataForm.email = data.email; - this.dataForm.peanutCoin = data.peanutCoin; - this.dataForm.jf = data.jf; + this.$http({ + url: this.$http.adornUrl("/master/userVip/getUserVipInfoByUserId"), + method: "post", + data: this.$http.adornData({ + userId: data.id + }) + }).then(({ data }) => { + if (data && data.code === 0) { + this.dataForm = data.userVipInfo; + } else { + cb([]); + } + }); + // this.dataForm.userKey = data.tel || data.email; + // this.dataForm.userId = data.id; + // this.dataForm.name = data.name; + // this.dataForm.tel = data.tel; + // this.dataForm.email = data.email; + // this.dataForm.peanutCoin = data.peanutCoin; + // this.dataForm.jf = data.jf; }, handleSelect(data) { console.log("data at line 161:", data); @@ -194,8 +247,6 @@ export default { this.dataForm.name = data.name; this.dataForm.tel = data.tel; this.dataForm.email = data.email; - this.dataForm.peanutCoin = data.peanutCoin; - this.dataForm.jf = data.jf; }, loadAll(queryString, cb) { this.dataForm.userId = ""; @@ -222,9 +273,74 @@ export default { } }); }, - + payTypeChange(e){ + console.log('e at line 261:', e) + if (this.dataForm.payType == "海外支付") { + this.dataForm.fee=0; + this.dataForm.jf=0; + } + }, + //表单提交 - dataFormSubmit() {}, + dataFormSubmit() { + this.$refs["dataForm"].validate(valid => { + if (valid) { + if (!this.dataForm.userId) { + this.$message.error("请选择用户"); + return; + } + if (!this.dataForm.payType) { + this.$message.error("请输入支付方式"); + return; + } + // if (this.dataForm.jf == 0 && this.dataForm.fee == 0) { + // this.$message.error("请重新填写金额或者积分,不能都为0"); + // return; + // } + if (this.dataForm.payType == "海外支付") { + this.dataForm.fee=0; + this.dataForm.jf=0; + } + if (this.dataForm.payType == "其他") { + if (!this.dataForm.remark) { + this.$message.error("请输入备注"); + return; + } + } + var data = { + ...this.dataForm, + + jf: this.dataForm.jf || 0, + fee: this.dataForm.fee || 0 + }; + + data.adminId = 1; + console.log("...this.dataForm at line 273:", this.dataForm); + + this.$http({ + url: this.$http.adornUrl("/master/userVip/addUserVipByAdmin"), + method: "post", + data: this.$http.adornData({ + ...data + }) + }).then(({ data }) => { + if (data && data.code === 0) { + this.$message({ + message: "操作成功", + type: "success", + duration: 1500, + onClose: () => { + this.visible = false; + this.$emit("refreshDataList"); + } + }); + } else { + this.$message.error(data.msg); + } + }); + } + }); + }, //取消 handlereset() { this.visible = false; @@ -286,7 +402,7 @@ export default { } /deep/.el-radio__label { padding-left: 3px; - padding-right: 25px; + padding-right: 10px; } } diff --git a/src/views/modules/vipList/userList.vue b/src/views/modules/vipList/userList.vue index 95d4601..03131ac 100644 --- a/src/views/modules/vipList/userList.vue +++ b/src/views/modules/vipList/userList.vue @@ -7,8 +7,26 @@ > + + + + + + + + @@ -17,7 +35,7 @@ @@ -28,17 +46,24 @@ + - - + + + @@ -183,20 +173,25 @@ prop="nickname" header-align="center" align="center" - label="VIP信息 ( 时间 )" + label="VIP信息 / 摊销金额 / 时间" > - - - + --> + - - @@ -244,12 +249,12 @@ @click="handleDetail(scope.row.id)" >管理 - 操作VIP + >升级VIP --> - + + 0) { + const now = new Date(); // 当前时间 + const matchedData = data.userVipLogs.filter(item => { + // 转换日期为 Date 对象,直接比较 + const start = new Date(item.startTime); + const end = new Date(item.endTime); + return now >= start && now <= end; // 核心判断条件 + }); + console.log("matchedData at line 508:", matchedData); + if (matchedData && matchedData.length > 0) { + return matchedData[0].dayAmount; + } + } else { + return null; + } + }, + handleDetail(id) { + this.$router.push({ name: "vipList-vipDetail", query: { id: id } - }) + }); }, detailHandle(row) { console.log("row at line 447:", row); @@ -523,7 +560,8 @@ this.$router.push({ 5: "针灸VIP", 6: "肿瘤VIP", 7: "国学VIP", - 8: "心理学VIP" + 8: "心理学VIP", + 9: "中西汇通VIP" }; // 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组) @@ -533,7 +571,7 @@ this.$router.push({ .split("") .map(Number); // 数字转为数组 } else { - vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 type + vipTypes = userVips.map(vip => vip); // 如果是对象数组,获取每个对象的 type } // 判断是否同时包含 4、5、6(医学SVIP) @@ -542,18 +580,69 @@ this.$router.push({ const hasPsychologySVip = [7, 8].every(type => vipTypes.includes(type)); const tags = []; - vipTypes.forEach(type => { - if (type == 4 || type == 5 || type == 6) { + vipTypes.forEach(e => { + if (e.type == 4 || e.type == 5 || e.type == 6 || e.type == 9) { tags.push( - `${vipMap[type]}` + `${vipMap[e.type]} + + ${ + this.getVipPrice(e) != null + ? "¥" + this.getVipPrice(e) + : '' + } + 有效期:${ + e.startTime ? e.startTime : "" + } + ~ + ${e.endTime ? e.endTime : ""} + + ` ); - } else if (type == 7 ) { + } else if (e.type == 7) { tags.push( - `${vipMap[type]}` + `${vipMap[e.type]} + ${ + this.getVipPrice(e) != null + ? "¥" + this.getVipPrice(e) + : '' + } + 有效期:${ + e.startTime ? e.startTime : "" + } + ~ + ${e.endTime ? e.endTime : ""} + + ` ); - } else if (type == 8 ) { + } else if (e.type == 8) { tags.push( - `${vipMap[type]}` + `${ + vipMap[e.type] + } + ${ + this.getVipPrice(e) != null + ? "¥" + this.getVipPrice(e) + : '' + } + 有效期:${ + e.startTime ? e.startTime : "" + } + ~ + ${e.endTime ? e.endTime : ""} + + ` ); } }); @@ -626,15 +715,22 @@ this.$router.push({ // 获取数据列表 getDataList() { this.dataListLoading = true; + var data = { + current: this.pageIndex, + limit: this.pageSize, + userName: this.dataForm.userName, + tel: this.dataForm.tel, + email: this.dataForm.email, + type: this.dataForm.type, + state: this.dataForm.state + }; + this.$http({ // url: this.$http.adornUrl('/book/user/list'), - url: this.$http.adornUrl("/book/user/getUserList"), + url: this.$http.adornUrl("/master/userVip/getUserVipList"), method: "post", data: this.$http.adornData({ - page: this.pageIndex, - limit: this.pageSize, - key: this.dataForm.key, - vipType: this.dataForm.vipType + ...data }) // params: this.$http.adornParams({ // 'page': 1, @@ -643,9 +739,9 @@ this.$router.push({ // }) }).then(({ data }) => { if (data && data.code === 0) { - this.dataList = data.user.records; - this.totalPage = data.user.pages; - this.total = data.user.total; + this.dataList = data.result.records; + this.totalPage = data.result.pages; + this.total = data.result.total; this.dataListLoading = false; } }); diff --git a/src/views/modules/vipList/vipDetail.vue b/src/views/modules/vipList/vipDetail.vue index 3d28f34..2fdcb01 100644 --- a/src/views/modules/vipList/vipDetail.vue +++ b/src/views/modules/vipList/vipDetail.vue @@ -1,7 +1,7 @@ - - - - - \ No newline at end of file +} + +.el-timeline { + li { + float: none; + } +} + +.flexbox { + display: flex; +} + +.deliver_info { + border-radius: 10px; +} + +.infoTitle { + display: inline; +} + +ul.list { + overflow: hidden; + color: #515a6e; + padding-left: 0; + + li { + list-style: none; + width: 50%; + line-height: 26px; + float: left; + font-size: 12px; + } + + .hightLight { + color: #f56c6c; + } + + .line { + width: 100%; + border-bottom: 1px solid #eee; + margin: 10px 0; + } +} + +.liName { + font-size: 14px; + margin-bottom: 10px; + font-weight: bold; +} + +.text_button { + padding: 0; +} + +.el-icon-truck:before { + content: "\e740"; +} + +.el-timeline-item:first-child { + .el-timeline-item__node { + background-color: rgb(11, 189, 135); + } + + color: rgb(11, 189, 135) !important; +} + +.el-timeline-item { + width: 100%; + position: relative; + padding-bottom: 20px; +} + +.el-timeline-item__node--large { + left: -2px; + width: 14px; + height: 14px; +} + +.el-timeline-item__node { + position: absolute; + background-color: #e4e7ed; + border-radius: 50%; + display: flex; + justify-content: center; + align-items: center; +} + +.el-timeline-item__node--normal { + left: -1px; + width: 12px; + height: 12px; +} + +.el-timeline-item__wrapper { + position: relative; + padding-left: 28px; + top: -3px; +} + +.el-timeline li { + list-style: none; +} + +.el-timeline-item__tail { + position: absolute; + left: 4px; + height: 100%; + border-left: 2px solid #e4e7ed; +} + +.el-timeline .el-timeline-item:last-child .el-timeline-item__tail { + display: none; +} + +.el-timeline-item__timestamp { + color: #c3c3c3; + font-size: 14px; +} + +/deep/ .el-select-dropdown { + width: 200px !important; +} + +:deep(.el-select-dropdown__list) { + width: 200px !important; +} + +/deep/ .el-select-dropdown__list { + width: 200px !important; +} +.DiscountColor { + color: #f94f04; +} +.coin_block{ + margin-bottom: 10px; +} +.year_block{ + span{ + padding: 2px 10px; + border: 1px solid #006699; + color: #006699; + border-radius: 5px; + margin-right: 10px; + cursor: pointer; + } +} +