Pārlūkot izejas kodu

TBtools-会员购买

panyong 4 gadi atpakaļ
vecāks
revīzija
c95ade4e0e

+ 2 - 2
htmldev/TBTools/src/views/main-navbar.vue

@@ -64,7 +64,7 @@
             </el-dropdown-menu>
           </el-dropdown>
         </li>
-        <li v-if="false">
+        <li>
           <router-link :to="{name: 'mall'}">礼品商城</router-link>
         </li>
       </ul>
@@ -169,7 +169,7 @@ export default {
     li {
       display: flex;
       justify-content: center;
-      width: 12.5%;
+      width: 12%;
     }
 
     .logo {

+ 9 - 4
htmldev/TBTools/src/views/modules/mine/user.vue

@@ -21,14 +21,14 @@
         <p class="TT-title">
           <span>Hi,用户{{ userPhone }}</span>
           <span>您正在开通</span>
-          <span>金币会员</span>
+          <span>{{ vipList[activeVipIndex].vipName }}</span>
         </p>
         <p class="TT-price">
           <span>应付金额:</span>
           <span>{{ vipList[activeVipIndex].vipPrice }}</span>
           <span>金币</span>
         </p>
-        <p class="TT-desc">{{ vipList[activeVipIndex].vipDesc }}</p>
+        <p class="TT-desc">权益:{{ vipList[activeVipIndex].vipDesc }}</p>
         <p slot="footer" class="dialog-footer">
           <el-button class="TT-btn-group" type="primary" @click="buyVip">确认购买</el-button>
         </p>
@@ -78,11 +78,12 @@ export default {
       })
     },
     buyVip () {
-      const { vipType } = this.vipList[this.activeVipIndex]
+      const { id, vipType } = this.vipList[this.activeVipIndex]
       this.$http({
         url: this.$http.adornUrl('/user/buyvip'),
         method: 'post',
         data: this.$http.adornData({
+          'id': id,
           'vipType': vipType // vip类型(1普通会员2包月会员3包年会员)
         })
       }).then(({ data }) => {
@@ -94,7 +95,11 @@ export default {
           })
           this.dialogTableVisible = false
         } else {
-          this.$message.error(data.msg)
+          if (data.msg === '点券不足请充值') {
+            this.$router.replace({ name: 'payCheck' })
+          } else {
+            this.$message.error(data.msg)
+          }
         }
       })
     }