Bladeren bron

铸造活动测试

panhui 3 jaren geleden
bovenliggende
commit
5f5e6130f3
2 gewijzigde bestanden met toevoegingen van 48 en 18 verwijderingen
  1. 10 5
      src/views/activity/ChooseProduct.vue
  2. 38 13
      src/views/activity/Submit.vue

+ 10 - 5
src/views/activity/ChooseProduct.vue

@@ -300,6 +300,7 @@ export default {
         if (this.$route.query.name) {
         if (this.$route.query.name) {
             this.search = this.$route.query.name;
             this.search = this.$route.query.name;
         }
         }
+
         this.$toast.loading({
         this.$toast.loading({
             message: '加载中...',
             message: '加载中...',
             forbidClick: true
             forbidClick: true
@@ -437,13 +438,17 @@ export default {
         },
         },
         submit() {
         submit() {
             this.checkTips().then(() => {
             this.checkTips().then(() => {
+                let query = {
+                    assets: this.chooseIds.join(','),
+                    activityId: this.activityId,
+                    numList: this.numList.join(',')
+                };
+                if (this.$route.query.test) {
+                    query.test = true;
+                }
                 this.$router.push({
                 this.$router.push({
                     path: '/activitySubmit',
                     path: '/activitySubmit',
-                    query: {
-                        assets: this.chooseIds.join(','),
-                        activityId: this.activityId,
-                        numList: this.numList.join(',')
-                    }
+                    query
                 });
                 });
             });
             });
         },
         },

+ 38 - 13
src/views/activity/Submit.vue

@@ -250,19 +250,44 @@ export default {
             }
             }
             this.$toast.loading('请不要离开当前页面');
             this.$toast.loading('请不要离开当前页面');
 
 
-            return this.$http
-                .post('/mintOrder/create', {
-                    assets: this.assets,
-                    mintActivityId: this.activityId,
-                    addressId: this.addressInfo.id,
-                    invitor: sessionStorage.getItem('invitor')
-                })
-                .then(res => {
-                    return Promise.resolve(res);
-                })
-                .catch(e => {
-                    return Promise.reject(e);
-                });
+            if (this.$route.query.test) {
+                return this.$http
+                    .post('/mintOrder/testCreate', {
+                        assets: this.assets,
+                        mintActivityId: this.activityId,
+                        addressId: this.addressInfo.id,
+                        invitor: sessionStorage.getItem('invitor')
+                    })
+                    .then(res => {
+                        this.$toast.clear();
+                        this.$dialog
+                            .alert({
+                                message: res
+                            })
+                            .then(() => {
+                                this.$router.back();
+                            });
+                        return Promise.reject();
+                    })
+                    .catch(e => {
+                        this.$toast.clear();
+                        return Promise.reject(e);
+                    });
+            } else {
+                return this.$http
+                    .post('/mintOrder/create', {
+                        assets: this.assets,
+                        mintActivityId: this.activityId,
+                        addressId: this.addressInfo.id,
+                        invitor: sessionStorage.getItem('invitor')
+                    })
+                    .then(res => {
+                        return Promise.resolve(res);
+                    })
+                    .catch(e => {
+                        return Promise.reject(e);
+                    });
+            }
         },
         },
         submit() {
         submit() {
             if (!this.payType) {
             if (!this.payType) {