panyong 3 rokov pred
rodič
commit
8f603bf99a

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

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

+ 2 - 2
htmldev/cps/src/views/bill/api/api.js

@@ -1,10 +1,10 @@
 import request from '@/api/request'
 
 /**
- * 订单列表接口
+ * 收支明细
  */
 export const apiOrderList = (params) => request({
   method: 'GET',
-  url: '/api/v1/user/order/list',
+  url: '/api/user/fianance/list',
   params: params
 })

+ 2 - 2
htmldev/cps/src/views/mine/index.vue

@@ -23,7 +23,7 @@
           <span class="label">钱包</span>
         </p>
         <p class="right">
-          <span class="value">52.8</span>
+          <span class="value">{{ userInfo.user_balance | fen2Yuan }}</span>
           <i class="arrow"></i>
         </p>
       </li>
@@ -33,7 +33,7 @@
           <span class="label">粉丝</span>
         </p>
         <p class="right">
-          <span class="value">23</span>
+          <span class="value">{{ userInfo.user_fans_num }}</span>
           <i class="arrow"></i>
         </p>
       </li>

+ 12 - 0
htmldev/cps/src/views/order/api/api.js

@@ -8,3 +8,15 @@ export const apiOrderList = (obj) => request({
   url: '/api/order/list',
   params: obj
 })
+
+/**
+ * 订单详情
+ */
+export const apiOrderDetail = (id) => request({
+  method: 'GET',
+  url: '/api/order/detail',
+  params: {
+    order_id: id
+  },
+  showLoading: true
+})

+ 13 - 2
htmldev/cps/src/views/order/child/main.vue

@@ -21,7 +21,8 @@
       <li
         v-for="(item, index) in list"
         :key="index"
-        class="list-item border-bottom-1px">
+        class="list-item border-bottom-1px"
+        @click="getOrderDetail(item.order_number)">
         <div class="wrap">
           <p class="label">提现金额:</p>
           <p class="money">-¥3000,00</p>
@@ -47,7 +48,7 @@
 <script>
 import BScroll from 'better-scroll'
 import { Toast, Loading } from 'vant'
-import { apiOrderList } from '../api/api'
+import { apiOrderList, apiOrderDetail } from '../api/api'
 
 export default {
   components: {
@@ -169,6 +170,16 @@ export default {
       } catch (err) {
         this.isFetchLock = false
       }
+    },
+    async getOrderDetail (id) {
+      try {
+        const { status, data, msg } = await apiOrderDetail(id)
+        if (status) {
+          this.$emit('setOrderDetail', data)
+        } else {
+          Toast(msg)
+        }
+      } catch (err) {}
     }
   },
   beforeDestroy () {

+ 31 - 10
htmldev/cps/src/views/order/index.vue

@@ -6,15 +6,19 @@
       <van-dropdown-item
         :title="'类型'"
         v-model="orderPlatformSonType"
-        :options="ordertype"/>
+        :options="ordertype"
+        @change="handleTypeChange"/>
       <van-dropdown-item
         :title="'状态'"
         v-model="orderStatus"
-        :options="arrOrderStatus"/>
+        :options="arrOrderStatus"
+        @change="handleStatusChange"/>
     </van-dropdown-menu>
     <Main
       :orderPlatformSonType="orderPlatformSonType"
-      :orderStatus="orderStatus"/>
+      :orderStatus="orderStatus"
+      @setOrderDetail="setOrderDetail"
+      ref="myMain"/>
     <van-popup
       class="fbt-van-popup"
       v-model="showDetail"
@@ -22,29 +26,29 @@
       <div class="fbt-van-popup-body">
         <h3>订单详情</h3>
         <p>
-          <span class="label" style="color: #333333;">饿了么</span>
+          <span class="label" style="color: #333333;">{{ orderDetail.order_platform_son_type }}</span>
           <span class="value"></span>
         </p>
         <p>
           <span class="label">支付时间:</span>
-          <span class="value">2021-8-12  09:23:04</span>
+          <span class="value">{{ orderDetail.order_pay_at }}</span>
         </p>
         <p>
           <span class="label">订单号:</span>
           <span class="value">
-            <i>126452164518</i>
+            <i>{{ orderDetail.order_number }}</i>
             <a href="javascript:;">复制</a>
           </span>
         </p>
         <p>
           <span class="label">支付金额:</span>
-          <span class="value">¥23</span>
+          <span class="value">¥{{ orderDetail.order_price | fen2Yuan }}</span>
         </p>
         <p>
           <span class="label">预计收益:</span>
-          <span class="value" style="color: #FA4A4A;">¥1.2</span>
+          <span class="value" style="color: #FA4A4A;">¥{{ orderDetail.order_commission | fen2Yuan }}</span>
         </p>
-        <p class="status">未结算</p>
+        <p class="status">{{ ['支付', '已支付', '已收获', '已结算', '全部退款或风控', '部分退款', '已取消'][orderDetail.order_status] }}</p>
       </div>
     </van-popup>
   </div>
@@ -71,7 +75,8 @@ export default {
         { text: '未结算', value: 1 },
         { text: '已结算', value: 2 }
       ],
-      showDetail: false
+      showDetail: false,
+      orderDetail: {}
     }
   },
   computed: {
@@ -87,6 +92,22 @@ export default {
   },
   async mounted () {
     await this.$nextTick()
+  },
+  methods: {
+    handleTypeChange () {
+      this.$nextTick(() => {
+        this.$refs.myMain.onRefresh()
+      })
+    },
+    handleStatusChange () {
+      this.$nextTick(() => {
+        this.$refs.myMain.onRefresh()
+      })
+    },
+    setOrderDetail (obj) {
+      this.orderDetail = obj
+      this.showDetail = true
+    }
   }
 }
 </script>

+ 9 - 3
htmldev/cps/src/views/wallet/index.vue

@@ -5,7 +5,7 @@
       <li>
         <p class="left">
           <span class="label">钱包余额</span>
-          <span class="amount">52.8</span>
+          <span class="amount">{{ userInfo.user_balance | fen2Yuan }}</span>
         </p>
         <p class="right withdraw-cash-wrap">
           <van-button
@@ -18,11 +18,11 @@
       <li>
         <p class="left">
           <span class="label">累计提现(元)</span>
-          <span class="value">52.8</span>
+          <span class="value">todo</span>
         </p>
         <p class="right">
           <span class="label">待结算佣金(元)</span>
-          <span class="value">52.8</span>
+          <span class="value">{{ userInfo.user_unreceive_balance | fen2Yuan }}</span>
         </p>
       </li>
     </ul>
@@ -40,11 +40,17 @@
 
 <script>
 import { Button } from 'vant'
+import { mapGetters } from 'vuex'
 
 export default {
   name: 'index',
   components: {
     'van-button': Button
+  },
+  computed: {
+    ...mapGetters({
+      userInfo: 'common/userinfo'
+    })
   }
 }
 </script>