From 5a1263bf5d4836fa31066c3cbc2cd5ab18d6ab10 Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Mon, 23 Sep 2024 16:12:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=BC=80=E8=AF=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/user/userCourse.vue | 184 +++++++++++++++++++++----- 1 file changed, 151 insertions(+), 33 deletions(-) diff --git a/src/views/modules/user/userCourse.vue b/src/views/modules/user/userCourse.vue index a951767..060ed50 100644 --- a/src/views/modules/user/userCourse.vue +++ b/src/views/modules/user/userCourse.vue @@ -4,14 +4,29 @@ :inline="true" :model="dataForm" @keyup.enter.native="getDataList()" - > - - 开通课程 - - + > + + + + + + + + 开通课程 +
用户信息:{{ user.name }}{{ user.tel }}
@@ -42,7 +60,7 @@ > + - + + - (超级VIP) (众妙之门VIP) -
+
- + - -
+ + + 取消 确认开通 +
@@ -180,8 +217,22 @@ export default { data() { return { dataForm: { - key: "" + key: "", + expire: "", + userInfo: "" }, + statusOptions: [ + { + value: "0", + label: "有效" + }, + { + value: "-1", + label: "已过期" + } + + ], + userId: this.$route.query.id, user: {}, pointFormRules: { @@ -205,35 +256,35 @@ export default { // 开通时长 { value: "30", - label: "一个月" + label: "30天" }, { value: "60", - label: "两个月" + label: "60天" }, { value: "90", - label: "三个月" + label: "90天" }, { value: "120", - label: "四个月" + label: "120天" }, { value: "150", - label: "五个月" + label: "150天" }, { value: "180", - label: "六个月" + label: "180天" }, { value: "365", - label: "一年" + label: "365天" }, { value: "730", - label: "两年" + label: "730天" } ], dataList: [], @@ -251,8 +302,10 @@ export default { courseId: null, cate: [], catalogueId: null, - days: "" - } + days: "", + come:"" //管理员开通(原因) + + } }; }, components: { @@ -268,6 +321,68 @@ export default { // this.getcourpeList() }, methods: { + delay(val){ + this.$prompt('请输入延期天数', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + // inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/, + // inputErrorMessage: '邮箱格式不正确' + }).then(({ value }) => { + console.log('value',value) + this.delaySubmit({ + id:val.id, + days:value + }) + }).catch(() => { + // this.$message({ + // type: 'info', + // message: '取消输入' + // }); + }); + }, + delaySubmit(data){ + this.$http({ + url: this.$http.adornUrl("/master/userCourseBuy/delayUserCourseBuy"), + method: "post", + data: this.$http.adornData(data) + }).then(({ data }) => { + if (data && data.code === 0) { + this.$message.success('操作成功!') + this.getDataList() + } else { + this.$message.error('操作失败!') + } + }).catch(err => { + this.$message.error(err.msg) + }) + }, + expired(val){ + this.$confirm(`是否确定将${val.courseName}->${val.catalogueName}设置为过期?`, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + this.$http({ + url: this.$http.adornUrl("/master/userCourseBuy/expireUserCourseBuy"), + method: "post", + data: this.$http.adornData({ + "id": val.id + }) + }).then(({ data }) => { + if (data && data.code === 0) { + this.$message.success('操作成功!') + this.getDataList() + } else { + this.$message.error('操作失败!') + } + }).catch(err => { + this.$message.error(err.msg) + }) + }).catch( () => { + + }) + }, submit() { console.log(this.youForm, "youForm"); this.$refs['youForm'].validate(valid => { @@ -279,7 +394,7 @@ export default { delete data.cate console.log('data',data) this.$http({ - url: this.$http.adornUrl("/master/userManage/addUserCourseBuy"), + url: this.$http.adornUrl("/master/userCourseBuy/insertUserCourseBuy"), method: "post", data: this.$http.adornData(data) }) @@ -375,13 +490,15 @@ export default { this.dataListLoading = true; this.$http({ // url: this.$http.adornUrl('/book/user/list'), - url: this.$http.adornUrl("/master/userManage/getUserCourseList"), + url: this.$http.adornUrl("/master/userCourseBuy/listByPage"), method: "post", data: this.$http.adornData({ - userId: this.userId, - page: this.pageIndex, - limit: this.pageSize, - title: this.dataForm.key + "current": this.pageIndex, + "limit": this.pageSize, + "userInfo": this.userId,//姓名 电话 邮箱 + "courseName": this.dataForm.key,//课程名 + "come":"", //开课来源 + "expire": this.dataForm.expire//状态 0有效 -1 过期 }) }) .then(({ data }) => { @@ -441,6 +558,7 @@ export default { };