Commit 26fcbda6 by chenyu

update: dist

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