Commit 8629b68f by caoyanzhi

update: 修复创建活动bug

parent 6c07598d
......@@ -118,6 +118,7 @@ import baseConfig from '@/components/active-config/base-config.vue';
<el-button
type="primary"
@click="submitForm('baseForm')"
:loading="loading"
>下一步</el-button>
</el-form-item>
</el-form>
......@@ -126,7 +127,6 @@ import baseConfig from '@/components/active-config/base-config.vue';
<script>
import limitInput from '@/components/limit-input.vue';
import { getRequest, postRequest } from '@/api/api';
import { _debounce } from '@/common/js/public';
// import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import timeFormat from '@/common/js/timeFormat';
......@@ -161,6 +161,7 @@ export default {
}
};
return {
loading: false,
activeInfoData: {
activityId: '',
parentGoalId: '',
......@@ -279,7 +280,7 @@ export default {
/**
* 下一步
*/
submitForm: _debounce(function(formName) {
submitForm(formName) {
const that = this;
that.$refs[formName].validate(valid => {
if (valid) {
......@@ -294,7 +295,7 @@ export default {
return false;
}
});
},500),
},
postSave() {
const that = this;
if (!that.activeInfoData.dateRange) {
......@@ -317,6 +318,7 @@ export default {
cardCoupName: that.activeInfoData.cardCoupName,
router: that.activeInfoData.router&&that.activeInfoData.router.length?JSON.stringify(that.activeInfoData.router):null
};
this.loading = true;
postRequest('/sharing-core-web/edit-activity-base-info', para)
.then(res => {
let resData = res.data;
......@@ -333,6 +335,10 @@ export default {
duration: 2500,
message: error.message
});
}).finally(() => {
setTimeout(() => {
this.loading = false;
}, 500)
});
},
/**
......
......@@ -65,6 +65,7 @@ import cardConfig from '@/components/active-config/card-config.vue';
<el-button
type="primary"
@click="submitForm('cardForm')"
:loading="loading"
>下一步</el-button>
</el-form-item>
</el-form>
......@@ -90,7 +91,6 @@ import limitInput from '@/components/limit-input.vue';
import singleUpload from '@/components/single-upload.vue';
// import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { _debounce } from '@/common/js/public';
import { getRequest, postRequest } from '@/api/api';
export default {
name: 'card-config',
......@@ -101,6 +101,7 @@ export default {
},
data() {
return {
loading: false,
activeInfoData: {
appletTitle: '',
playBillUrl: '',
......@@ -132,7 +133,7 @@ export default {
/**
* 下一步
*/
submitForm: _debounce(function(formName) {
submitForm(formName) {
const that = this;
that.$refs[formName].validate(valid => {
if (valid) {
......@@ -146,7 +147,7 @@ export default {
return false;
}
});
},500),
},
postSave() {
const that = this;
let para = {
......@@ -155,6 +156,7 @@ export default {
appletTitle: that.activeInfoData.appletTitle,
fileName: !!that.activeInfoData.fileName? that.activeInfoData.fileName: ''
};
this.loading = true;
postRequest('/sharing-core-web/edit-activity-applet', para)
.then(res => {
let resData = res.data;
......@@ -170,6 +172,10 @@ export default {
duration: 2500,
message: error.message
});
}).finally(() => {
setTimeout(() => {
this.loading = false;
}, 500)
});
},
/**
......
......@@ -123,6 +123,7 @@ import centerConfig from '@/components/active-config/center-config.vue';
<el-button
type="primary"
@click="submitForm('centerForm')"
:loading="loading"
>下一步</el-button>
</el-form-item>
</el-form>
......@@ -173,9 +174,6 @@ import appTemplate from '@/components/active-config/app-template.vue';
// import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import {
_debounce
} from '@/common/js/public';
import {
getRequest,
postRequest
} from '@/api/api';
......@@ -197,6 +195,7 @@ export default {
}
};
return {
loading: false,
activeInfoData: {
headUrl: '',
shareBackColor: '#2F54EB',
......@@ -312,7 +311,7 @@ export default {
/**
* 下一步
*/
submitForm: _debounce(function(formName) {
submitForm(formName) {
const that = this;
that.$refs[formName].validate(valid => {
if (valid) {
......@@ -326,7 +325,7 @@ export default {
return false;
}
});
}, 500),
},
postSave() {
const that = this;
let para = {
......@@ -339,6 +338,7 @@ export default {
activityIntroduceDetail: that.activeInfoData.activityIntroduceMode == 2 ? JSON.stringify(that.activeInfoData.activityIntroduceDetail) : that.activeInfoData.activityIntroduceDetail,
activityIntroduceId: that.activeInfoData.activityIntroduceId
};
this.loading = true;
postRequest('/sharing-core-web/edit-activity-center', para)
.then(res => {
let resData = res.data;
......@@ -354,6 +354,10 @@ export default {
duration: 2500,
message: error.message
});
}).finally(() => {
setTimeout(() => {
this.loading = false;
}, 500)
});
},
/**
......
......@@ -155,6 +155,7 @@ import posterConfig from '@/components/active-config/poster-config.vue';
<el-button
type="primary"
@click="submitForm('posterForm')"
:loading="loading"
>下一步</el-button>
</el-form-item>
</el-form>
......@@ -194,7 +195,6 @@ import postUpload from '@/components/post-upload.vue';
import VueQrcode from '@chenfengyuan/vue-qrcode';
// import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { _debounce } from '@/common/js/public';
import { getRequest, postRequest } from '@/api/api';
export default {
name: 'poster-config',
......@@ -206,6 +206,7 @@ export default {
},
data() {
return {
loading: false,
activeInfoData: {
playBillUrl: '',
templateType: '1',
......@@ -269,7 +270,7 @@ export default {
/**
* 下一步
*/
submitForm: _debounce(function(formName) {
submitForm(formName) {
const that = this;
that.$refs[formName].validate(valid => {
......@@ -284,7 +285,7 @@ export default {
return false;
}
});
},500),
},
postSave() {
const that = this;
let para = {
......@@ -295,6 +296,7 @@ export default {
qrcodeFrontColor: that.activeInfoData.qrcodeFrontColor,
qrcodePadding: that.activeInfoData.qrcodePadding
};
this.loading = true;
postRequest('/sharing-core-web/edit-activity-share', para)
.then(res => {
let resData = res.data;
......@@ -310,6 +312,10 @@ export default {
duration: 2500,
message: error.message
});
}).finally(() => {
setTimeout(() => {
this.loading = false;
}, 500)
});
},
/**
......
......@@ -322,6 +322,7 @@ import rewardConfig from '@/components/active-config/reward-config.vue';
v-if="!$route.query.hasOwnProperty('editFlag')"
type="primary"
@click="submitForm('rewardForm')"
:loading="loading"
> {{$route.query.hasOwnProperty('activityId') ?'确认编辑':'确认新建'}}</el-button>
<el-button
v-if="$route.query.hasOwnProperty('editFlag')"
......@@ -340,7 +341,6 @@ import entryAward from '@/components/active-config/configs/entry-award.vue';
import competitionAward from '@/components/active-config/configs/competition-award.vue';
import inviteeReward from '@/components/active-config/configs/invitee-reward.vue';
import fraudControl from '@/components/active-config/configs/fraud-control.vue';
import { _debounce } from '@/common/js/public';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
......@@ -358,6 +358,7 @@ export default {
},
data() {
return {
loading: false,
basePath: [],
stepObj: {
'服务号关注': 1 ,// 1服务号关注,2活动营销页访问奖励,3会员认证奖励,4游戏参与奖励,5卡券领取奖励6,消费奖励
......@@ -1390,7 +1391,7 @@ export default {
/**
* 下一步
*/
submitForm: _debounce(function(formName) {
submitForm(formName) {
const that = this;
that.$refs[formName].validate(valid => {
if (valid) {
......@@ -1399,6 +1400,7 @@ export default {
that.$router.push(`/shareIndex`);
return false
}
this.loading = true;
if (that.activeInfoData.awardMode == 1) {
that.singleCheck(); // 判断单次
} else {
......@@ -1408,37 +1410,43 @@ export default {
return false;
}
});
}, 500),
},
async singleCheck() {
const that = this;
const flag = that.basePath.map(ele => ele.transName).includes('消费') ? await that.$refs.singleConsume.submitForm() : true;
if (flag.hasOwnProperty('flag')&& !flag.flag) {
showMsg.showmsg(flag.msg, 'warning');
this.loading = false;
return false;
}
const spot = that.activeInfoData.instantAwardFlag == 1 ? await that.$refs.singleSpot.submitForm() : true;
if (spot.hasOwnProperty('flag')&& !spot.flag) {
showMsg.showmsg(spot.msg, 'warning');
this.loading = false;
return false;
}
const entry = that.activeInfoData.passAwardFlag == 1 ? await that.$refs.singleEntry.submitForm() : true;
if (entry.hasOwnProperty('flag')&& !entry.flag) {
showMsg.showmsg(entry.msg, 'warning');
this.loading = false;
return false;
}
const competition = that.activeInfoData.competitionAwardFlag == 1 ? await that.$refs.singleCompetition.submitForm() : true;
if (competition.hasOwnProperty('flag')&& !competition.flag) {
showMsg.showmsg(competition.msg, 'warning');
this.loading = false;
return false;
}
const invitee = await that.$refs.singleInvitee.submitForm();
if (invitee.hasOwnProperty('flag')&& !invitee.flag) {
showMsg.showmsg(invitee.msg, 'warning');
this.loading = false;
return false;
}
const freeze = that.basePath.map(ele => ele.transName).includes('消费') ? await that.$refs.singleFreeze.submitForm() : true;
if (freeze.hasOwnProperty('flag')&& !freeze.flag) {
showMsg.showmsg(freeze.msg, 'warning');
this.loading = false;
return false;
}
// console.log('单次数据', that.activeInfoData);
......@@ -1626,6 +1634,7 @@ export default {
}
if (flag.hasOwnProperty('flag')&& !flag.flag) {
showMsg.showmsg(flag.msg, 'warning');
this.loading = false;
return false;
}
let spot = true;
......@@ -1640,6 +1649,7 @@ export default {
}
if (spot.hasOwnProperty('flag')&& !spot.flag) {
showMsg.showmsg(spot.msg, 'warning');
this.loading = false;
return false;
}
let entry = true;
......@@ -1653,6 +1663,7 @@ export default {
}
if (entry.hasOwnProperty('flag')&& !entry.flag) {
showMsg.showmsg(entry.msg, 'warning');
this.loading = false;
return false;
}
let competition = true;
......@@ -1666,6 +1677,7 @@ export default {
}
if (competition.hasOwnProperty('flag')&& !competition.flag) {
showMsg.showmsg(competition.msg, 'warning');
this.loading = false;
return false;
}
let invitee = true;
......@@ -1679,6 +1691,7 @@ export default {
}
if (invitee.hasOwnProperty('flag')&& !invitee.flag) {
showMsg.showmsg(invitee.msg, 'warning');
this.loading = false;
return false;
}
let freeze = true;
......@@ -1692,6 +1705,7 @@ export default {
}
if (freeze.hasOwnProperty('flag')&& !freeze.flag) {
showMsg.showmsg(freeze.msg, 'warning');
this.loading = false;
return false;
}
// true--->1; false--->0
......@@ -1759,6 +1773,10 @@ export default {
duration: 2500,
message: error.message
});
}).finally(() => {
setTimeout(() => {
this.loading = false;
}, 500)
});
},
/**
......
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