Sfoglia il codice sorgente

Merge branch 'feature-ios-buy-hidden' into dev

ArvinQi 6 anni fa
parent
commit
afadf7809d
2 ha cambiato i file con 36 aggiunte e 26 eliminazioni
  1. 35 25
      components/type/vip/mobile.vue
  2. 1 1
      plugins/axios.js

+ 35 - 25
components/type/vip/mobile.vue

@@ -7,11 +7,7 @@
           <section class="header">
             <section style="position: relative;">
               <img :src="userInfo.icon_url" class="avator">
-              <img
-                v-if="vipNow && !isCom"
-                src="~@/assets/img/vip/vip_icon.png"
-                class="diamond"
-              >
+              <img v-if="vipNow && !isCom" src="~@/assets/img/vip/vip_icon.png" class="diamond">
             </section>
             <section>
               <span class="name">{{userInfo.nickname}}</span>
@@ -20,20 +16,18 @@
               <span v-else class="date">{{endTimeCalc}}</span>
             </section>
           </section>
-          <button v-if="!vipNow" class="renewal-fee" @click="clickPay(dev)">开通</button>
-          <button v-else-if="isCom" disabled class="renewal-fee disabled">开通</button>
-          <button v-else class="renewal-fee" @click="clickPay(dev)">{{vipNow ? '续费' : '开通'}}</button>
+          <section v-if="deviceType !== 'ios'">
+            <button v-if="!vipNow" class="renewal-fee" @click="clickPay(dev)">开通</button>
+            <button v-else-if="isCom" disabled class="renewal-fee disabled">开通</button>
+            <button v-else class="renewal-fee" @click="clickPay(dev)">{{vipNow ? '续费' : '开通'}}</button>
+          </section>
         </section>
         <section class="banner">
           <img src="~@/assets/img/vip/vip_com.png" class="card">
           <section class="header">
             <section style="position: relative;">
               <img :src="userInfo.icon_url" class="avator avator-com">
-              <img
-                v-if="vipNow && isCom"
-                src="~@/assets/img/vip/vip_icon_com.png"
-                class="diamond"
-              >
+              <img v-if="vipNow && isCom" src="~@/assets/img/vip/vip_icon_com.png" class="diamond">
             </section>
             <section>
               <span class="name">{{userInfo.nickname}}</span>
@@ -42,12 +36,14 @@
               <span v-else class="date">暂未开通</span>
             </section>
           </section>
-          <button v-if="!vipNow" class="renewal-fee renewal-fee-com" @click="clickPay(com)">开通</button>
-          <button v-else-if="isCom" class="renewal-fee renewal-fee-com" @click="clickPay(com)">
-            {{vipNow ? '续费' :
-            '开通'}}
-          </button>
-          <button v-else disabled class="renewal-fee disabled">开通</button>
+          <section v-if="deviceType !== 'ios'">
+            <button v-if="!vipNow" class="renewal-fee renewal-fee-com" @click="clickPay(com)">开通</button>
+            <button v-else-if="isCom" class="renewal-fee renewal-fee-com" @click="clickPay(com)">
+              {{vipNow ? '续费' :
+              '开通'}}
+            </button>
+            <button v-else disabled class="renewal-fee disabled">开通</button>
+          </section>
         </section>
       </section>
       <section class="anli-radios">
@@ -131,6 +127,8 @@ export default {
       currentCom: false,
       // 会员详情
       vipDetail: null,
+      // 设备类型pc,ios,android
+      deviceType: 'pc'
     }
   },
   computed: {
@@ -150,15 +148,27 @@ export default {
       return this.vipDetail.user_info
     },
     isCom() {
-      if(this.$route.query.isCom) return true
+      if (this.$route.query.isCom) return true
       return this.vipDetail.vip_type_id !== '2'
     },
   },
   mounted() {
-    this.getVipDetail()
+    this.getVipDetail();
+    this.getDeviceType();
   },
   methods: {
     /**
+     * 设备判断
+     */
+    getDeviceType() {
+      if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
+        this.deviceType = 'ios';
+      } else if (/(Android)/i.test(navigator.userAgent)) {  //判断Android
+        this.deviceType = 'android';
+      } else { //pc
+      };
+    },
+    /**
      * 点击开通
      */
     clickPay(item) {
@@ -181,8 +191,8 @@ export default {
     },
     touchEnd(e) {
       var offsetX = e.changedTouches[0].clientX - touchX
-      if(offsetX < -50) this.swipeLeft()
-      else if(offsetX > 50) this.swipeRight()
+      if (offsetX < -50) this.swipeLeft()
+      else if (offsetX > 50) this.swipeRight()
     },
     /**
      * 点击会员计划
@@ -196,9 +206,9 @@ export default {
      */
     async getVipDetail() {
       let res = await this.$post('/api/vip/getVipUserDetail')
-      if(!res.data) return
+      if (!res.data) return
       this.vipDetail = res.data
-      if(this.isCom) this.currentCom = true
+      if (this.isCom) this.currentCom = true
     }
   },
 }

+ 1 - 1
plugins/axios.js

@@ -1,5 +1,5 @@
 import axios from 'axios'
 
 export default axios.create({
-  baseURL: process.env.BASE_URL || 'http://local-rooter.proginn.com:3000'
+  baseURL: process.env.BASE_URL || ''
 })