Commit 63439086 by chenyu

update: 活动有效期提示方式更改

parent de1fbc00
...@@ -160,12 +160,8 @@ export default { ...@@ -160,12 +160,8 @@ export default {
callback(new Error('请选择开始日期')); callback(new Error('请选择开始日期'));
} else if(!value[1]) { } else if(!value[1]) {
callback(new Error('请选择结束日期')); callback(new Error('请选择结束日期'));
} else if(value[0]&&value[1]&&new Date(this.activeInfoData.endDate).getTime()> this.endDate){ } else if(value[1]&&new Date(this.activeInfoData.endDate).getTime()> this.endDate){
this.$message({ callback(new Error(`您的分享有礼功能${moment(this.endDate).format('YYYY年MM月DD日')}到期,活动结束时间无法超过该日期。`));
message: `您的分享有礼功能${moment(this.endDate).format('YYYY年MM月DD日')}到期,活动结束时间无法超过该日期。`,
type: 'warning'
});
callback(new Error(' '));
} else { } else {
callback(); callback();
} }
...@@ -195,7 +191,7 @@ export default { ...@@ -195,7 +191,7 @@ export default {
}, },
rules: { rules: {
activityName: [{ required: true, message: '请输入活动名称', trigger: 'blur' }], activityName: [{ required: true, message: '请输入活动名称', trigger: 'blur' }],
dateRange: [{ validator: checkDate, trigger: 'blur' }] dateRange: [{ validator: checkDate, trigger: 'change' }]
}, },
choiceDateCopy: [], choiceDateCopy: [],
pickerOptions: { pickerOptions: {
...@@ -228,10 +224,10 @@ export default { ...@@ -228,10 +224,10 @@ export default {
disabledDate: time => { disabledDate: time => {
let disabled = time.getTime() < Date.now() - 8.64e7; let disabled = time.getTime() < Date.now() - 8.64e7;
if(this.activeInfoData.startDate) { if(this.activeInfoData.startDate) {
disabled = disabled || time.getTime() > this.endDate||(time.getTime() < new Date(this.activeInfoData.startDate).getTime()); disabled = disabled || (time.getTime() < new Date(this.activeInfoData.startDate).getTime());
} }
if(!this.activeInfoData.startDate || (new Date(this.activeInfoData.startDate).toDateString() === new Date().toDateString())) { if(!this.activeInfoData.startDate || (new Date(this.activeInfoData.startDate).toDateString() === new Date().toDateString())) {
disabled = disabled || time.getTime() > this.endDate||(time.getTime() <= new Date().setHours(0,0,0)); disabled = disabled || (time.getTime() <= new Date().setHours(0,0,0));
} }
return disabled; return disabled;
} }
......
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