Browse Source

会员页 bug fix

xinfeng 6 years ago
parent
commit
f08b34789f
3 changed files with 8 additions and 30 deletions
  1. 3 11
      pages/type/vip/developer.vue
  2. 4 13
      pages/type/vip/enterprise.vue
  3. 1 6
      pages/type/vip/index.vue

+ 3 - 11
pages/type/vip/developer.vue

@@ -19,7 +19,7 @@
           <img src="@/assets/img/vip/ordinary_avatar.png" alt="">
         </div>
         <div class="ordinary-content">
-          <p>每月最多确认接单{{commonUser.limit1}}次</p>
+          <p>每月最多确认接单{{vipList[3].devAcceptTimes}}次</p>
           <p>仅1单</p>
           <p>普通权重</p>
           <p>无折扣</p>
@@ -79,8 +79,7 @@
                 type: "dev", // com: 企业会员, dev: 开发者会员
                 vipList: [],
                 vipDetail: {},
-                item: {},
-                commonUser:{}
+                item: {}
             };
         },
         async mounted() {
@@ -98,14 +97,7 @@
                     extraHeaders = this.getSign();
                 }
                 let res = await this.$axios.$post(`/api/vip/getList`, extraHeaders);
-                let params = {
-                    'id':'4'
-                };
-                let commonUser = await this.$axios.$post("/api/admin/vip/get_rights", params);
-                if (res) {
-                    this.vipList = res.data;
-                    this.commonUser = commonUser.data;
-                }
+                this.vipList = res.data;
             },
             /**
              * 点击支付

+ 4 - 13
pages/type/vip/enterprise.vue

@@ -21,9 +21,9 @@
           <img src="@/assets/img/vip/ordinary_avatar.png" alt="">
         </div>
         <div class="ordinary-content">
-          <p>{{commonUser.limit3}}次/天</p>
+          <p>{{vipList[3].userHire || 0}}次/天</p>
           <p>无</p>
-          <p>{{commonUser.limit2}}人次/天</p>
+          <p>{{vipList[3].userChat || 0}}人次/天</p>
           <p>无</p>
           <p>免费</p>
           <p>无</p>
@@ -96,8 +96,7 @@
                 type: "com", // com: 企业会员, dev: 开发者会员
                 vipList: [],
                 vipDetail: {},
-                item:{},
-                commonUser:{}
+                item:{}
             }
         },
         components: {
@@ -114,14 +113,7 @@
                     extraHeaders = this.getSign();
                 }
                 let res = await this.$axios.$post(`/api/vip/getList`, extraHeaders);
-                let params = {
-                    'id':'4'
-                };
-                let commonUser = await this.$axios.$post("/api/admin/vip/get_rights", params);
-                if (Number(res.status) === 1) {
-                    this.vipList = res.data;
-                    this.commonUser = commonUser.data;
-                }
+                this.vipList = res.data;
             },
             async getVipDetail() {
                 let res = await this.$axios.$post("/api/vip/getVipUserDetail");
@@ -139,7 +131,6 @@
                         break;
                 }
                 this.buyDialog = true;
-                // location.href = `/vip/pay?product_id=${item.id}&number=3&next=/type/vip/`;
             },
             handleClose() {
                 this.buyDialog = false;

+ 1 - 6
pages/type/vip/index.vue

@@ -4,17 +4,12 @@
 
 <script>
 import { mapState } from "vuex";
-// import http from '@/plugins/http'
 import pc from "@/components/type/vip/pc";
 import mobile from "@/components/type/vip/mobile";
 import getDeviceType from "@/mixins/getDeviceType";
 import qs from "qs";
 
 export default {
-  // async asyncData({ $axios, params }) {
-  //   let res = await $axios.$get(`/api/vip/getList`)
-  //   console.log('init', res)
-  // },
   head: {
     title: "会员中心页 - 程序员客栈"
   },
@@ -59,7 +54,7 @@ export default {
         extraHeaders = this.getSign();
       }
       let res = await this.$axios.$post(`/api/vip/getList`, extraHeaders);
-      if (res) {
+      if (Number(res.status) === 1) {
         this.vipList = res.data;
       }
     },