panhui 3 سال پیش
والد
کامیت
4965c2d624
8فایلهای تغییر یافته به همراه107 افزوده شده و 18 حذف شده
  1. 12 2
      src/components/TicketBuy.vue
  2. 8 0
      src/router/index.js
  3. 12 2
      src/views/Exchange.vue
  4. 5 1
      src/views/Mine.vue
  5. 33 1
      src/views/Room.vue
  6. 21 5
      src/views/RoomCreate.vue
  7. 14 4
      src/views/Shop.vue
  8. 2 3
      src/views/account/Introduction.vue

+ 12 - 2
src/components/TicketBuy.vue

@@ -44,6 +44,10 @@ export default {
             default: () => {
                 return {};
             }
+        },
+        buyType: {
+            type: Boolean,
+            default: false
         }
     },
     mixins: [room],
@@ -96,6 +100,9 @@ export default {
                                 })
                                 .then(res => {
                                     this.show = false;
+                                    if (this.buyType) {
+                                        this.$router.go(-1);
+                                    }
                                 });
                         })
                         .catch(e => {
@@ -119,13 +126,16 @@ export default {
                     this.$dialog
                         .alert({
                             title: '提示',
-                            message: res.status === 'CANCELLED' ? '订单支付失败,点击重新下单' : '订单已支付'
+                            message: res.status === 'CANCELLED' ? '订单支付失败,点击重新下单' : '通行证购买成功'
                         })
                         .then(() => {
                             if (res.status === 'CANCELLED') {
                                 this.show = false;
                             } else {
                                 this.show = false;
+                                if (this.buyType) {
+                                    this.$router.go(-1);
+                                }
                             }
                             // on close
                         });
@@ -167,8 +177,8 @@ export default {
                 .get(`/order/pay/${this.orderId}/${this.payType}`)
                 .then(res => {
                     if (this.payType === 'ALIPAY') {
-                        document.location.href = res;
                         this.getOrder(true);
+                        document.location.href = res;
                     }
                 })
                 .catch(e => {

+ 8 - 0
src/router/index.js

@@ -334,6 +334,14 @@ const routes = [
         meta: {
             title: '实名认证'
         }
+    },
+    {
+        path: '/introduction',
+        name: 'introduction',
+        component: () => import('../views/account/Introduction.vue'),
+        meta: {
+            title: '关于我们'
+        }
     }
 ];
 

+ 12 - 2
src/views/Exchange.vue

@@ -41,7 +41,8 @@ export default {
         return {
             qty: 1,
             ticketPrices: [],
-            ticket: ''
+            ticket: '',
+            buyType: false
         };
     },
     mixins: [room],
@@ -69,6 +70,11 @@ export default {
         if (this.$route.query.ticket) {
             this.ticket = this.$route.query.ticket;
         }
+        if (this.$route.query.buyType === true || this.$route.query.buyType === 'true') {
+            this.buyType = true;
+        } else {
+            this.buyType = false;
+        }
         this.$http
             .post('/ticketPrice/all', { size: 1000, query: { del: false } }, { body: 'json' })
             .then(res => {
@@ -99,7 +105,11 @@ export default {
                 .then(res => {
                     this.$toast.success('购买成功');
                     setTimeout(() => {
-                        this.$router.back();
+                        if (this.buyType) {
+                            this.$router.go(-2);
+                        } else {
+                            this.$router.back();
+                        }
                     }, 1000);
                 })
                 .catch(e => {

+ 5 - 1
src/views/Mine.vue

@@ -75,7 +75,11 @@
                     :icon="require('@assets/icon-shenbaojil.png')"
                     text="申报记录"
                 />
-                <van-grid-item :icon="require('@assets/icon_guanyuwomen.png')" text="关于我们" />
+                <van-grid-item
+                    :to="{ path: '/introduction' }"
+                    :icon="require('@assets/icon_guanyuwomen.png')"
+                    text="关于我们"
+                />
                 <van-grid-item
                     :to="{ path: '/security' }"
                     :icon="require('@assets/icon-xitongshezhi.png')"

+ 33 - 1
src/views/Room.vue

@@ -151,7 +151,11 @@
                         <img src="@assets/png-yicangshenbao.png" alt="" />
                         <span>异常申报</span>
                     </div>
-                    <div class="btn" v-if="isHost && info.status == 'WAITING'">
+                    <div
+                        class="btn"
+                        v-if="isHost && (info.status == 'WAITING' || info.status == 'GAMING')"
+                        @click="cancel"
+                    >
                         <img src="@assets/png-quxiaosaishi.png" alt="" />
                         <span>取消赛事</span>
                     </div>
@@ -360,6 +364,34 @@ export default {
                     }
                 });
         },
+        cancel() {
+            this.$dialog
+                .confirm({
+                    title: '提示',
+                    message: '确认要取消赛事吗?',
+                    confirmButtonText: '立即取消'
+                })
+                .then(() => {
+                    this.$toast.loading({
+                        message: '加载中...',
+                        forbidClick: true
+                    });
+                    return this.$http.post('/room/cancel', {
+                        roomId: this.roomId
+                    });
+                })
+                .then(() => {
+                    this.$toast.success('取消成功');
+                    setTimeout(() => {
+                        this.back();
+                    }, 1000);
+                })
+                .catch(e => {
+                    if (e && e.error) {
+                        this.$toast(e.error);
+                    }
+                });
+        },
         start() {
             this.$dialog
                 .confirm({

+ 21 - 5
src/views/RoomCreate.vue

@@ -6,9 +6,7 @@
                     <template #input>
                         <div class="tabs">
                             <div class="tab" :class="{ prim: form.zone === 'QQ' }" @click="form.zone = 'QQ'">QQ区</div>
-                            <!-- <div class="tab" :class="{ prim: form.zone === '微信' }" @click="form.zone = '微信'">
-                                微信区
-                            </div> -->
+                            <div class="tab" :class="{ prim: form.zone === '微信' }" @click="wait">微信区</div>
                         </div>
                     </template>
                 </van-field>
@@ -116,6 +114,8 @@
 <script>
 import room from '../mixins/room.js';
 export default {
+    name: 'roomCreate',
+    inject: ['setKeeps', 'scrollWrapper', 'changeScroll'],
     data() {
         return {
             form: {
@@ -137,7 +137,8 @@ export default {
             showPicker: false,
             pickerType: 'modeId',
             modeIdOptions: [],
-            gameMapIdOptions: []
+            gameMapIdOptions: [],
+            scrollTop: 0
         };
     },
     mixins: [room],
@@ -281,7 +282,7 @@ export default {
                                 confirmButtonText: '立即购买'
                             })
                             .then(res => {
-                                this.$router.push('/shop');
+                                this.$router.push('/shop?type=buy');
                                 return Promise.reject();
                             });
                     } else {
@@ -346,6 +347,21 @@ export default {
             }
             this.showPicker = false;
         }
+    },
+    activated() {
+        this.$nextTick(() => {
+            this.changeScroll(this.scrollTop || 0);
+        });
+    },
+    beforeRouteLeave(to, from, next) {
+        if (to.path === '/shop') {
+            this.scrollTop = this.scrollWrapper.scrollTop;
+            this.setKeeps(['roomCreate']);
+        } else {
+            this.scrollTop = 0;
+            this.setKeeps(['roomCreate'], false);
+        }
+        next();
     }
 };
 </script>

+ 14 - 4
src/views/Shop.vue

@@ -44,7 +44,7 @@
             <van-button type="primary" block v-else @click.stop="goExchange">确认兑换</van-button>
         </div>
 
-        <ticket-buy ref="buy" :info="ticketInfo" @click.stop=""></ticket-buy>
+        <ticket-buy ref="buy" :info="ticketInfo" :buyType="buyType" @click.stop=""></ticket-buy>
     </div>
 </template>
 
@@ -60,7 +60,8 @@ export default {
             ticketPrices: [],
             chooseTicket: '',
             list: [],
-            listKey: ''
+            listKey: '',
+            buyType: false
         };
     },
     mixins: [list],
@@ -108,13 +109,21 @@ export default {
                 this.getData(true);
             });
         });
+
+        if (this.$route.query.type) {
+            this.buyType = true;
+        } else {
+            this.buyType = false;
+        }
     },
     methods: {
         goExchange() {
             if (this.active === 1) {
-                this.$router.push('/exchange?ticket=' + this.chooseTicket);
+                this.$router.push('/exchange?ticket=' + this.chooseTicket + '&buyType=' + this.buyType);
             } else {
-                this.$router.push('/exchangeCollection?exchangeItemId=' + this.chooseTicket);
+                this.$router.push(
+                    '/exchangeCollection?exchangeItemId=' + this.chooseTicket + '&buyType=' + this.buyType
+                );
             }
         },
         beforeData() {
@@ -130,6 +139,7 @@ export default {
                 this.clear();
                 this.$router.replace({
                     query: {
+                        ...this.$route.query,
                         active: this.active
                     }
                 });

+ 2 - 3
src/views/account/Introduction.vue

@@ -2,12 +2,11 @@
     <div class="page">
         <div class="content">
             <div>
-                <div class="align-center">平台简介</div>
                 <p>
-                    RAEX宇宙是全球领先的专业艺术品生态簇运营商,重点打造“全球领先数字藏品生态簇”的产业闭环,持续塑造推出中国权威数字文创商品,参与全球数字藏品定价体系,加速“一带一路”的全球文化内容输出。在这里您可以创造、收集、售卖您的艺术品及数字手办潮玩,感受全球顽家为您带来的新奇别致体验,共同探索艺术宇宙的真实奥秘!欢迎您的加入!
+                    RAEX宇宙是全球领先的专业艺术品生态簇运营商,重点打造“全球领先数字藏品生态簇”的产业闭环,持续塑造推出中国权威数字文创商品,参与全球数字藏品定价体系,加速“一带一路”的全球文化内容输出。在这里您可以创造、收集、售卖您的艺术品及数字手办潮玩,感受全球顽家为您带来的新奇别致体验,共同探索艺术宇宙的真实奥秘!欢迎您的加入!
                 </p>
                 <p>
-                    RAEX宇宙,是元宇宙游戏《The Oasis
+                    RAEX宇宙,是元宇宙游戏《The Oasis
                     RAEX宇宙》旗下重要的艺术品生态簇底层架构及原生内容展示平台,是《The Oasis
                     RAEX宇宙》体系中的核心载体之一。
                 </p>