|
|
@@ -79,7 +79,8 @@ export default {
|
|
|
chooseIds: [],
|
|
|
needChoose: 3,
|
|
|
search: '',
|
|
|
- activityId: 0
|
|
|
+ activityId: 0,
|
|
|
+ info: {}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -104,6 +105,7 @@ export default {
|
|
|
this.$http.get('/mintActivity/get/' + this.$route.query.activityId).then(res => {
|
|
|
this.needChoose = res.num;
|
|
|
this.search = res.collectionName;
|
|
|
+ this.info = res;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
@@ -136,7 +138,7 @@ export default {
|
|
|
if (chooseIds.includes(id)) {
|
|
|
let index = chooseIds.indexOf(id);
|
|
|
chooseIds.splice(index, 1);
|
|
|
- } else if (this.chooseIds.length < this.needChoose) {
|
|
|
+ } else if (this.chooseIds.length < this.needChoose || this.needChoose === 0) {
|
|
|
chooseIds.push(id);
|
|
|
} else if (this.chooseIds.length == this.needChoose) {
|
|
|
this.$toast(`只能选择${this.needChoose}个藏品`);
|
|
|
@@ -157,42 +159,27 @@ export default {
|
|
|
goHome() {
|
|
|
this.$router.push('/home');
|
|
|
},
|
|
|
- submit() {
|
|
|
- this.$dialog
|
|
|
- .confirm({
|
|
|
+ checkTips() {
|
|
|
+ if (this.info.consume) {
|
|
|
+ return this.$dialog.confirm({
|
|
|
title: '提示',
|
|
|
message: `兑换后选择的藏品将被销毁,确认将选择的藏品进行兑换吗?`,
|
|
|
allowHtml: true
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- if (this.activityId) {
|
|
|
- this.$router.push({
|
|
|
- path: '/activitySubmit',
|
|
|
- query: {
|
|
|
- assets: this.chooseIds.join(','),
|
|
|
- activityId: this.activityId
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$toast.loading({
|
|
|
- message: '加载中...',
|
|
|
- forbidClick: true
|
|
|
- });
|
|
|
- this.$http
|
|
|
- .post('/mintOrder/create', {
|
|
|
- assets: this.chooseIds.join(',')
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- this.$toast.clear();
|
|
|
- this.submitSuc();
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- if (e && e.error) {
|
|
|
- this.$toast(e.error);
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return Promise.resolve();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ this.checkTips().then(() => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/activitySubmit',
|
|
|
+ query: {
|
|
|
+ assets: this.chooseIds.join(','),
|
|
|
+ activityId: this.activityId
|
|
|
}
|
|
|
});
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|