Ver Fonte

个人中心:新增字段

panyong há 3 anos atrás
pai
commit
f5efbe7847

+ 1 - 1
htmldev/cps/src/api/request.js

@@ -55,7 +55,7 @@ request.interceptors.request.use(request => {
 
   // 因为微信开发者工具重复授权,本地开发时写死
   if (/^(0|192|10|localhost)/.test(domain)) {
-    request.headers.wechatToken = 'e9a85a94839cb6f8c1aed06625f6f6a4'
+    request.headers.wechatToken = 'e369797599f47e9cdbbcb100559f7d15'
   } else {
     request.headers.wechatToken = getCookieValue('fanbutingwechatToken')
   }

+ 3 - 1
htmldev/cps/src/store/modules/common.js

@@ -11,7 +11,9 @@ const state = {
     user_crash_balance: 0, // 累计提现(单位为分)
     user_unreceive_balance: 0, // 用户未结算金额(单位为分)
     created_at: '', // 注册时间
-    id: '' // 用户ID
+    id: '', // 用户ID
+    last_month_money: '', // 上月预估收益
+    month_money: '' // 本月预估收益
   },
   orderType: [], // 订单类型
   inviteId: '', // 邀请人ID,分享链接携带

+ 117 - 41
htmldev/cps/src/views/mine/index.vue

@@ -1,58 +1,92 @@
 <template>
-  <div class="mine-conatainer">
-    <div class="header">
-      <div class="avatar">
-        <img
-          :src="userInfo.user_head_img_url"
-          alt="">
+  <div
+    class="mine-conatainer"
+    ref="fbyMine">
+    <div>
+      <div class="header">
+        <div class="avatar">
+          <img
+            :src="userInfo.user_head_img_url"
+            alt="">
+        </div>
       </div>
+      <div class="income-wrap">
+        <div>
+          <p>上月预估收入(元)</p>
+          <p>¥{{ userInfo.last_month_money | fen2Yuan }}</p>
+        </div>
+        <div>
+          <p>本月预估收入(元)</p>
+          <p>¥{{ userInfo.month_money | fen2Yuan }}</p>
+        </div>
+      </div>
+      <ul>
+        <li @click="$router.push({name: 'Order'})">
+          <p class="left">
+            <i class="label icon-order"></i>
+            <span class="label">下单记录</span>
+          </p>
+          <p class="right">
+            <i class="arrow"></i>
+          </p>
+        </li>
+        <li @click="$router.push({name: 'Wallet'})">
+          <p class="left">
+            <i class="label icon-wallet"></i>
+            <span class="label">可提现余额</span>
+          </p>
+          <p class="right">
+            <span class="value">{{ userInfo.user_balance | fen2Yuan }}</span>
+            <i class="arrow"></i>
+          </p>
+        </li>
+        <li @click="$router.push({name: 'Fans'})">
+          <p class="left">
+            <i class="label icon-wallet"></i>
+            <span class="label">粉丝</span>
+          </p>
+          <p class="right">
+            <span class="value">{{ userInfo.user_fans_num }}</span>
+            <i class="arrow"></i>
+          </p>
+        </li>
+      </ul>
+      <router-link
+        class="jump-recommend"
+        :to="{name: 'Recommend'}"></router-link>
     </div>
-    <ul>
-      <li @click="$router.push({name: 'Order'})">
-        <p class="left">
-          <i class="label icon-order"></i>
-          <span class="label">下单记录</span>
-        </p>
-        <p class="right">
-          <i class="arrow"></i>
-        </p>
-      </li>
-      <li @click="$router.push({name: 'Wallet'})">
-        <p class="left">
-          <i class="label icon-wallet"></i>
-          <span class="label">钱包</span>
-        </p>
-        <p class="right">
-          <span class="value">{{ userInfo.user_balance | fen2Yuan }}</span>
-          <i class="arrow"></i>
-        </p>
-      </li>
-      <li @click="$router.push({name: 'Fans'})">
-        <p class="left">
-          <i class="label icon-wallet"></i>
-          <span class="label">粉丝</span>
-        </p>
-        <p class="right">
-          <span class="value">{{ userInfo.user_fans_num }}</span>
-          <i class="arrow"></i>
-        </p>
-      </li>
-    </ul>
-    <router-link
-      class="jump-recommend"
-      :to="{name: 'Recommend'}"></router-link>
   </div>
 </template>
 
 <script>
+import BScroll from 'better-scroll'
 import { mapGetters } from 'vuex'
 
 export default {
   name: 'index',
+  data () {
+    return {
+      scroll: null
+    }
+  },
   computed: {
     ...mapGetters({
       userInfo: 'common/userinfo'
     })
+  },
+  activated () {
+    if (!this.$route.meta.isUseCache) {
+      setTimeout(() => {
+        this.scroll = new BScroll(this.$refs.fbyMine, {
+          click: true,
+          scrollbar: true
+        })
+      }, 500)
+    } else {
+      if (this.scroll) {
+        this.scroll.refresh()
+      }
+    }
   }
 }
 </script>
@@ -63,8 +97,10 @@ export default {
   left: 0;
   top: 0;
   right: 0;
-  bottom: 0;
+  bottom: 50px;
   width: 100%;
+  padding-bottom: 20px;
+  overflow: hidden;
 }
 
 .header {
@@ -86,6 +122,46 @@ export default {
   }
 }
 
+.income-wrap {
+  display: flex;
+  align-items: center;
+  width: 335px;
+  margin: 17px auto;
+  padding: 16px 0;
+  border-radius: 10px;
+  background: #FFFFFF;
+  box-shadow: 0 2px 4px 0 rgba(31, 49, 74, 0.12);
+
+  & > div {
+    position: relative;
+    left: 0;
+    top: 0;
+    flex: 1;
+
+    &:nth-of-type(2) {
+      &:before {
+        @include vertical-center;
+        left: 0;
+        height: 86%;
+        content: '';
+        border-left: 1px solid #ccc;
+      }
+    }
+  }
+
+  p {
+    width: 100%;
+    font-size: 14px;
+    color: #333333;
+    line-height: 20px;
+    text-align: center;
+
+    &:nth-of-type(2) {
+      margin-top: 4px;
+    }
+  }
+}
+
 ul {
   width: 335px;
   margin: 0 auto;