From b0d0c653527d44ac81191987d9275f04e9fd73e0 Mon Sep 17 00:00:00 2001 From: liuyuan <582976274@qq.com> Date: Wed, 2 Apr 2025 09:52:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=BC=80=E9=80=9A=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 1 + src/views/modules/user/user-add-course.vue | 330 ++++++++++++++++++ src/views/modules/user/user-add-or-update.vue | 2 +- src/views/modules/user/user-open-vip.vue | 192 ++++++++++ src/views/modules/user/user.vue | 201 ++++------- static/config/index-prod.js | 1 + static/config/index.js | 3 +- 7 files changed, 601 insertions(+), 129 deletions(-) create mode 100644 src/views/modules/user/user-add-course.vue create mode 100644 src/views/modules/user/user-open-vip.vue diff --git a/src/router/index.js b/src/router/index.js index 82b0806..ba85d2b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -46,6 +46,7 @@ const mainRoutes = { { path: '/buyorder-print', component: _import('modules/order/buyorder-print'), name: 'buyorder-print', meta: { title: '打印面单', isTab: true } }, { path: '/activity-list', component: _import('modules/activity/activityList'), name: 'activity-list', meta: { title: '活动列表', isTab: true } }, { path: '/user-point-memery', component: _import('modules/user/user-point-memery'), name: 'user-point-memery', meta: { title: '充/扣记录', isTab: true } }, + { path: '/user-add-course', component: _import('modules/user/user-add-course'), name: 'user-add-course', meta: { title: '开通课程', isTab: true } }, { path: '/order-epay', component: _import('modules/order/order-errorpay'), name: 'order-epay', meta: { title: '充值异常列表', isTab: true } }, { path: '/xieyi_list', component: _import('modules/xieyi/xieyi'), name: 'xieyi_list', meta: { title: '协议管理', isTab: true } }, { path: '/book-comments', component: _import('modules/book/bookComments'), name: 'book-comments', meta: { title: '书评管理', isTab: true } }, diff --git a/src/views/modules/user/user-add-course.vue b/src/views/modules/user/user-add-course.vue new file mode 100644 index 0000000..585f5ef --- /dev/null +++ b/src/views/modules/user/user-add-course.vue @@ -0,0 +1,330 @@ + + + + + + + + {{ v.title }} + + + + + + {{ v.title }} + + + + +   天 + + + + 选择文件 + + + + + 解析成功{{resultData.has.length}}个, + 解析失败{{resultData.no.length}}个 + 查看 + + + + + 上传成功{{ resultData2.successList.length }}个, + 上传失败{{failList.length}}个 + 查看 + + + + + + 解析失败数据: + + + + + + + + + 上传失败数据: + + + + + + + + + + + + + + diff --git a/src/views/modules/user/user-add-or-update.vue b/src/views/modules/user/user-add-or-update.vue index 8be1e74..a26ff61 100644 --- a/src/views/modules/user/user-add-or-update.vue +++ b/src/views/modules/user/user-add-or-update.vue @@ -1,5 +1,5 @@ - diff --git a/src/views/modules/user/user-open-vip.vue b/src/views/modules/user/user-open-vip.vue new file mode 100644 index 0000000..28e51f2 --- /dev/null +++ b/src/views/modules/user/user-open-vip.vue @@ -0,0 +1,192 @@ + + + + + {{dataForm.tel }}({{ dataForm.name }}) + + + 天医币 {{ dataForm.peanutCoin }} +    积分 {{ dataForm.peanutCoin }} + + + + + {{ option.label }} + + + + + + + {{ option.label }} + + + 其他:  天 + + + {{ dataForm.price }}元 + + + + + + + + + + + + + + 取消 + 确定 + + + + + + + diff --git a/src/views/modules/user/user.vue b/src/views/modules/user/user.vue index 61365c6..703b41a 100644 --- a/src/views/modules/user/user.vue +++ b/src/views/modules/user/user.vue @@ -18,10 +18,6 @@ - - - - @@ -36,10 +32,13 @@ v-if="isAuth('book:user:save')" type="primary" @click="addOrUpdateHandle()" - >新增新增用户 - 合并账号 --> + 批量开通课程 @@ -80,10 +79,10 @@ - - - + + - + - - - - - - - - + @@ -312,6 +250,10 @@ ref="addOrUpdate" @refreshDataList="getDataList" > + + + + import userCouponList from "../coupon/userCouponList"; +import OpenVip from "./user-open-vip" import AddOrUpdate from "./user-add-or-update"; export default { data() { @@ -434,84 +377,88 @@ export default { youVisible: false, youForm: {}, courperList: [], - courperHistList: [] + courperHistList: [], + //开通vip + openVipVisible: false, }; }, components: { AddOrUpdate, - userCouponList + userCouponList, + OpenVip }, activated() { this.getDataList(); }, methods: { + //批量开通课程 + addOpenCourse(){ + this.$router.push('/user-add-course'); + }, + //开通vip + openVip(row){ + this.openVipVisible = true; + this.$nextTick(()=>{ + this.$refs.openVip.init(row); + }) + }, + computedVipType(userVips) { - if (!userVips || userVips.length === 0) return ''; + if (!userVips || userVips.length === 0) return ''; - const vipMap = { - 4: '中医VIP', - 5: '针灸VIP', - 6: '肿瘤VIP', - 7: '国学VIP', - 8: '心理学VIP' - }; + const vipMap = { + 4: '中医VIP', + 5: '针灸VIP', + 6: '肿瘤VIP', + 7: '国学VIP', + 8: '心理学VIP' + }; - // 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组) - let vipTypes = []; - if (typeof userVips === 'number') { - vipTypes = String(userVips).split('').map(Number); // 数字转为数组 - } else { - vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 type - } + // 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组) + let vipTypes = []; + if (typeof userVips === 'number') { + vipTypes = String(userVips).split('').map(Number); // 数字转为数组 + } else { + vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 type + } - // 判断是否同时包含 4、5、6(医学SVIP) - const hasMedicalSVip = [4, 5, 6].every(type => vipTypes.includes(type)); - // 判断是否同时包含 7、8(心理学SVIP) - const hasPsychologySVip = [7, 8].every(type => vipTypes.includes(type)); + // 判断是否同时包含 4、5、6(医学SVIP) + const hasMedicalSVip = [4, 5, 6].every(type => vipTypes.includes(type)); + // 判断是否同时包含 7、8(心理学SVIP) + const hasPsychologySVip = [7, 8].every(type => vipTypes.includes(type)); - const tags = []; + const tags = []; - // 1. 医学SVIP(只显示一次) - if (hasMedicalSVip) { - tags.push(`医学SVIP`); - } + // 1. 医学SVIP(只显示一次) + if (hasMedicalSVip) { + tags.push(`医学SVIP`); + } - // 2. 心理学SVIP(只显示一次) - if (hasPsychologySVip) { - tags.push(`心理学SVIP`); - } + // 2. 心理学SVIP(只显示一次) + if (hasPsychologySVip) { + tags.push(`心理学SVIP`); + } - // 3. 普通VIP标签(确保不重复显示SVIP相关的类型) - vipTypes - .filter(type => vipMap[type] && !( - (hasMedicalSVip && [4, 5, 6].includes(type)) || // 医学SVIP已显示,排除 4、5、6 - (hasPsychologySVip && [7, 8].includes(type)) // 心理学SVIP已显示,排除 7、8 - )) - .forEach(type => { - tags.push(`${vipMap[type]}`); - }); + // 3. 普通VIP标签(确保不重复显示SVIP相关的类型) + vipTypes + .filter(type => vipMap[type] && !( + (hasMedicalSVip && [4, 5, 6].includes(type)) || // 医学SVIP已显示,排除 4、5、6 + (hasPsychologySVip && [7, 8].includes(type)) // 心理学SVIP已显示,排除 7、8 + )) + .forEach(type => { + tags.push(`${vipMap[type]}`); + }); - return tags.join(' '); -} - - -, + return tags.join(' '); + }, getVipMoney(data) { - console.log("data at line 420:", data.id); - this.$http({ - // url: this.$http.adornUrl('/book/user/list'), url: this.$http.adornUrl("/master/userVip/getVipProductForUser"), method: "post", data: this.$http.adornData({ uid: data.id }) - // params: this.$http.adornParams({ - // 'page': 1, - // 'limit': this.pageSize, - // 'key': this.dataForm.key - // }) }).then(({ data }) => { if (data && data.code === 0) { var list=[] diff --git a/static/config/index-prod.js b/static/config/index-prod.js index f03d811..d9d3633 100644 --- a/static/config/index-prod.js +++ b/static/config/index-prod.js @@ -7,6 +7,7 @@ // api接口请求地址 window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; //window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; + //window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb'; // cdn地址 = 域名 + 版本号 window.SITE_CONFIG['domain'] = './'; // 域名 diff --git a/static/config/index.js b/static/config/index.js index aba39c5..208c35b 100644 --- a/static/config/index.js +++ b/static/config/index.js @@ -6,7 +6,8 @@ // api接口请求地址 window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境 - //window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; //本地 + //window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; //川 + //window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb'; //本地 // cdn地址 = 域名 + 版本号 window.SITE_CONFIG['domain'] = './'; // 域名
解析失败数据:
上传失败数据: