用户信息:{{ user.name }}{{ user.tel }}
@@ -42,7 +60,7 @@
>
+
+ {{scope.row.catalogueName}}({{scope.row.expire == 0 ? '有效' : '已过期'}})
+
+
-
+
+ 延期
+ 设置过期
+
+
- (超级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 {
};