diff --git a/.env.development b/.env.development index e800df6..22f06e3 100644 --- a/.env.development +++ b/.env.development @@ -2,4 +2,4 @@ ENV = 'development' # base api -VUE_APP_BASE_API = '' +VUE_APP_BASE_API = 'http://leyitest.ali251.langye.net' diff --git a/.env.production b/.env.production index 517e699..7e7fab3 100644 --- a/.env.production +++ b/.env.production @@ -2,4 +2,4 @@ ENV = 'production' # base api -VUE_APP_BASE_API = '' +VUE_APP_BASE_API = 'https://leyiyuyue.szgmbwg.org.cn' diff --git a/src/api/active/activity.js b/src/api/active/activity.js index 906efc3..e62df93 100644 --- a/src/api/active/activity.js +++ b/src/api/active/activity.js @@ -39,8 +39,17 @@ export function del(id) { id } }) +} + +export function delNum(id) { + return request({ + url: '/api/admin/activity/activity-number-destroy', + method: 'get', + params: { + id + } + }) } - export function get(id) { return request({ url: '/api/admin/activity/show', diff --git a/src/views/active/activity.vue b/src/views/active/activity.vue index 19bd16e..4835c08 100644 --- a/src/views/active/activity.vue +++ b/src/views/active/activity.vue @@ -55,16 +55,149 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + +
+
+
活动场次
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
- + - + - + + + + + + + + @@ -91,17 +231,6 @@ - - - - - - - - - - - @@ -112,18 +241,23 @@ + + + + + - + + - + - + @@ -142,25 +276,6 @@ - - - - - - - - - - - - - - - -
{ + that.$Message.success('删除成功'); + that.form.numbers_list.splice(index, 1); + }).catch(error => { + console.log(error) + reject(error) + }) + } else { + this.form.rules_list.splice(index, 1); + } + }, + // 打开预约时段 + openVisit(index){ + this.showRules=true + this.currentVisit.index = index + }, + // 获取预约时段规则 + changeVisit(val) { + console.log("visit", val) + this.specialVisitid = "" + getVisit(val).then(res => { + this.visitInfo = res.rules + }) + }, + // 获取特殊预约时段规则 + changeSpecialVisit(val) { + console.log("Specialvisit", val) + this.visitid = "" + getSpecialVisit(val).then(res => { + this.visitInfo = res.rules + }) + }, + // 选择 预约时段 + chooseVisit(val){ + this.form.numbers_list[this.currentVisit.index]['rule_id'] = val.id + this.form.numbers_list[this.currentVisit.index]['time'] = val.start_time + "-" + val.end_time + this.showRules = false + console.log("this.form.numbers_list",this.form.numbers_list) + }, initLoad() { var that = this; var clientHeight = document.documentElement.clientHeight @@ -483,6 +686,22 @@ this.paginations.total = res.total }).catch(error => { + }) + listvisit({ + page: 1, + page_size: 999, + }).then(res => { + this.visitList = res.data; + }).catch(error => { + + }) + listvisitspecial({ + page: 1, + page_size: 999, + }).then(res => { + this.specialVisitList = res.data; + }).catch(error => { + }) }, info(obj) { @@ -493,7 +712,13 @@ that.form = result; that.dateRange = [result.start_time, result.end_time]; that.mapform = [result.longitude, result.latitude, result.address] - console.log(that.dateRange); + console.log(that.dateRange); + let numArr = [] + for(var k of result.numbers){ + k.dateRange = [k.start_time,k.end_time] + numArr.push(k) + } + that.form.numbers_list = numArr // that.showTime = result.start_time.substring(11, result.start_time.length); // that.form.end_time = result.end_time.substring(11, result.end_time.length); result.cover_upload.coverType = "cover"; @@ -533,19 +758,43 @@ }, submitForm(formName) { - var that = this; - that.form.start_time = this.dateRange[0]; - that.form.end_time = this.dateRange[1]; - if (!that.form.start_time || !that.form.end_time) { - that.$message.error('请选择活动时间'); - return false; - } - //比较预约截止不能大于活动开始时间 - let checktime = that.compareDate(that.form.start_time, that.form.end_plan); - if (!checktime) { - that.$message.error('截止时间不能晚于开始时间'); - return false; - } + var that = this; + + + this.form.start_time = this.dateRange[0]; + this.form.end_time = this.dateRange[1]; + if (!this.form.start_time || !this.form.end_time) { + that.$message.error('请选择活动时间'); + return false; + } + //比较预约截止不能大于活动开始时间 + let checktime = that.compareDate(that.form.start_time, that.form.end_plan); + if (!checktime) { + that.$message.error('截止时间不能晚于开始时间'); + return false; + } + let upTotal = 0 + for(var k of that.form.numbers_list){ + if(!k.name){ + that.$message.error('请填写活动名称'); + return false; + } + k.start_time = k.dateRange[0]; + k.end_time = k.dateRange[1]; + if (!k.start_time || !k.end_time) { + that.$message.error('请选择活动时间'); + return false; + } + let checktime = that.compareDate(k.start_time, k.end_plan); + if (!checktime) { + that.$message.error('截止时间不能晚于开始时间'); + return false; + } + upTotal += parseInt(k.total) + } + that.form.total = upTotal + + // console.log(a) // that.form.end_time = that.form.start_time.substring(0, 10) + " " + that.form.end_time; @@ -560,7 +809,9 @@ "upload_id": m.upload_id }); } - that.form.banners_list = listUrl; + that.form.banners_list = listUrl; + console.log("this.form",this.form) + // return this.$refs[formName].validate((valid) => { if (valid) { if (that.form.id) { @@ -619,8 +870,8 @@ id: para.id, status: para.status, cancel_all: para.cancel_all - }).then(response => { - that.dialogConfirmVisible=false; + }).then(response => { + that.dialogConfirmVisible = false; this.$Message.success('操作成功'); that.load(); }).catch(error => {}) diff --git a/src/views/active/activitybefore.vue b/src/views/active/activitybefore.vue new file mode 100644 index 0000000..19bd16e --- /dev/null +++ b/src/views/active/activitybefore.vue @@ -0,0 +1,734 @@ + + +