Commit 26fcbda6 by chenyu

update: dist

parent 29873252
...@@ -133,12 +133,6 @@ import timeFormat from '@/common/js/timeFormat'; ...@@ -133,12 +133,6 @@ import timeFormat from '@/common/js/timeFormat';
import moment from 'moment' import moment from 'moment'
export default { export default {
name: 'base-config', name: 'base-config',
props: {
dueDate: {
type: Number,
default: new Date().getTime()
}
},
components: { components: {
limitInput limitInput
}, },
...@@ -160,8 +154,8 @@ export default { ...@@ -160,8 +154,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[1]&&new Date(this.activeInfoData.endDate).getTime()> this.dueDate){ } else if(value[1]&&this.dueData.endDate&&new Date(this.activeInfoData.endDate).getTime()> this.dueData.endDate){
callback(new Error(`您的分享有礼功能${moment(this.dueDate).format('YYYY年MM月DD日')}到期,活动结束时间无法超过该日期。`)); callback(new Error(`您的分享有礼功能${moment(this.dueData.endDate).format('YYYY年MM月DD日')}到期,活动结束时间无法超过该日期。`));
} else { } else {
callback(); callback();
} }
...@@ -194,6 +188,12 @@ export default { ...@@ -194,6 +188,12 @@ export default {
dateRange: [{ validator: checkDate, trigger: 'change' }] dateRange: [{ validator: checkDate, trigger: 'change' }]
}, },
choiceDateCopy: [], choiceDateCopy: [],
dueData: {
dueDay: 0, // 即将到期天数
endDate: null, // 到期时间
isOverdue: 0, // 是否过期,0:未过期,1:已过期
overdueDay: 0 // 过期天数
},
pickerOptions: { pickerOptions: {
onPick: ({ maxDate, minDate }) => { onPick: ({ maxDate, minDate }) => {
this.choiceDateCopy = [minDate.getTime()]; this.choiceDateCopy = [minDate.getTime()];
...@@ -233,6 +233,29 @@ export default { ...@@ -233,6 +233,29 @@ export default {
}, },
methods: { methods: {
/** /**
* 是否过期
*/
judgeDue() {
console.log(1);
const that = this;
let para = {};
getRequest('/sharing-core-web/isOverdue', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.dueData=Object.assign({},that.dueData,resData.result)
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 日期 * 日期
*/ */
changeDate(e, isStartDate) { changeDate(e, isStartDate) {
...@@ -351,6 +374,7 @@ export default { ...@@ -351,6 +374,7 @@ export default {
}, },
mounted() { mounted() {
const that = this; const that = this;
that.judgeDue();
if (that.$route.query.hasOwnProperty('activityId')) { if (that.$route.query.hasOwnProperty('activityId')) {
that.getBaseData(); that.getBaseData();
} }
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
<div class="step-body"> <div class="step-body">
<base-config <base-config
v-if="activeStep == '1'" v-if="activeStep == '1'"
:dueDate="dueData.endDate"
@submitNext="submitNext" @submitNext="submitNext"
></base-config> ></base-config>
<center-config <center-config
...@@ -58,8 +57,6 @@ import centerConfig from '@/components/active-config/center-config.vue'; ...@@ -58,8 +57,6 @@ import centerConfig from '@/components/active-config/center-config.vue';
import cardConfig from '@/components/active-config/card-config.vue'; import cardConfig from '@/components/active-config/card-config.vue';
import posterConfig from '@/components/active-config/poster-config.vue'; import posterConfig from '@/components/active-config/poster-config.vue';
import rewardConfig from '@/components/active-config/reward-config.vue'; import rewardConfig from '@/components/active-config/reward-config.vue';
import { getRequest } from '@/api/api';
import errMsg from '@/common/js/error';
export default { export default {
name: 'createCompletion', name: 'createCompletion',
components: { components: {
...@@ -108,12 +105,6 @@ export default { ...@@ -108,12 +105,6 @@ export default {
hasSet: false hasSet: false
} }
], ],
dueData: {
dueDay: 0, // 即将到期天数
endDate: new Date().getTime(), // 到期时间
isOverdue: 0, // 是否过期,0:未过期,1:已过期
overdueDay: 0 // 过期天数
}
} }
}, },
watch: { watch: {
...@@ -125,28 +116,6 @@ export default { ...@@ -125,28 +116,6 @@ export default {
}, },
methods: { methods: {
/** /**
* 是否过期
*/
judgeDue() {
const that = this;
let para = {};
getRequest('/sharing-core-web/isOverdue', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.dueData=Object.assign({},that.dueData,resData.result)
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 下一步 * 下一步
*/ */
submitNext() { submitNext() {
......
...@@ -107,12 +107,9 @@ export default { ...@@ -107,12 +107,9 @@ export default {
}); });
} }
}, },
beforeMount() {
const that = this;
that.judgeDue();
},
mounted() { mounted() {
const that = this; const that = this;
that.judgeDue();
that.judgeCreate(); that.judgeCreate();
}, },
filters: { filters: {
......
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