Commit 0d0bf5de authored by xhx's avatar xhx

发起活动限制

parent 775c2beb
......@@ -161,7 +161,6 @@ export default Vue.extend({
},
methods:{
checkName() {
console.log(this.form)
if (!this.form.name) return
service.checkName(this.form.name).then(res => {
if (res.data.result) {
......@@ -197,6 +196,14 @@ export default Vue.extend({
this.show = false
},
submit() {
if (!this.form.name || !this.form.startHeight || !this.form.endHeight) {
Toast('请先填写表单内容')
return
}
if (this.isExist) {
Toast('请确认表单名称正确')
return
}
const params = JSON.parse(JSON.stringify(this.form))
params.numType = this.times === '每天一次' ? 2 : 1
params.isOpen = this.checked
......@@ -215,18 +222,22 @@ export default Vue.extend({
let stamp = 0
const r = +this.form.endHeight - +this.blockHeight
stamp = +(this.blockTime + '000') + r * 5000
const hour = new Date(stamp).getHours()
const n = hour === 23 ? 1 : 0
this.dateEnd = new Date(stamp).getFullYear() + '-' +
(new Date(stamp).getMonth() + 1 < 10 ? '0' + (new Date(stamp).getMonth() + 1) : new Date(stamp).getMonth() + 1) + '-' +
(new Date(stamp).getDate() < 10 ? '0' + (new Date(stamp).getDate()) : new Date(stamp).getDate())
(new Date(stamp).getDate() < 10 ? '0' + (new Date(stamp).getDate()+n) : new Date(stamp).getDate()+n)
},
getDateStart() {
if (!this.form.startHeight) return
let stamp = 0
const r = +this.form.startHeight - +this.blockHeight
stamp = +(this.blockTime + '000') + r * 5000
const hour = new Date(stamp).getHours()
const n = hour === 23 ? 1 : 0
this.dateStart = new Date(stamp).getFullYear() + '-' +
(new Date(stamp).getMonth() + 1 < 10 ? '0' + (new Date(stamp).getMonth() + 1) : new Date(stamp).getMonth() + 1) + '-' +
(new Date(stamp).getDate() < 10 ? '0' + (new Date(stamp).getDate()) : new Date(stamp).getDate())
(new Date(stamp).getDate() < 10 ? '0' + (new Date(stamp).getDate() + n) : new Date(stamp).getDate() + n)
},
selectStart(v: Date) {
const r = new Date(v).getFullYear() + '-' +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment