Browse Source

cps:流水明细

panyong 3 years ago
parent
commit
5ee39efb35

+ 16 - 1
htmldev/cps/src/views/bill/api/api.js

@@ -2,9 +2,24 @@ import request from '@/api/request'
 
 /**
  * 收支明细
+ * @param params
+ * @returns {AxiosPromise}
  */
-export const apiOrderList = (params) => request({
+export const apiBillList = (params) => request({
   method: 'GET',
   url: '/api/user/fianance/list',
   params: params
 })
+
+/**
+ * 流水详情
+ * @param id
+ * @returns {AxiosPromise}
+ */
+export const apiBillDetail = (id) => request({
+  method: 'GET',
+  url: '/api/user/fianance/detail',
+  params: {
+    id
+  }
+})

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

@@ -47,7 +47,7 @@
 <script>
 import BScroll from 'better-scroll'
 import { Toast, Loading } from 'vant'
-import { apiOrderList } from '../api/api'
+import { apiBillList } from '../api/api'
 
 export default {
   components: {
@@ -104,7 +104,7 @@ export default {
       this.isFetchLock = true
       this.pagenum++
       try {
-        const { status, data, msg } = await apiOrderList({
+        const { status, data, msg } = await apiBillList({
           page: this.pagenum,
           page_size: this.pagesize,
           finance_type: this.financeType // 流水类型 0全部 1收入 2支出

+ 20 - 7
htmldev/cps/src/views/bill/index.vue

@@ -37,29 +37,30 @@
         </p>
         <p>
           <span class="label">支付时间:</span>
-          <span class="value">2021-8-12  09:23:04</span>
+          <span class="value">{{ objBillDetail.created_at }}</span>
         </p>
         <p>
           <span class="label">订单号:</span>
-          <span class="value">126452164518</span>
+          <span class="value">todo</span>
         </p>
         <p>
           <span class="label">交易单号:</span>
-          <span class="value">1274554794</span>
+          <span class="value">{{ objBillDetail.finance_number }}</span>
         </p>
         <p>
           <span class="label">备注:</span>
-          <span class="value">备注备注备注备注备注</span>
+          <span class="value">{{ objBillDetail.finance_remark }}</span>
         </p>
-        <p class="amont">+¥736.23</p>
+        <p class="amont">+¥{{ objBillDetail.finance_balance }}</p>
       </div>
     </van-popup>
   </div>
 </template>
 
 <script>
-import { Tabs, Tab, Popup } from 'vant'
+import { Tabs, Tab, Popup, Toast } from 'vant'
 import Main from './child/main'
+import { apiBillDetail } from './api/api'
 
 export default {
   name: 'index',
@@ -72,7 +73,8 @@ export default {
   data () {
     return {
       numActiveTab: 0,
-      showDetail: false
+      showDetail: false,
+      objBillDetail: {}
     }
   },
   async mounted () {
@@ -89,6 +91,17 @@ export default {
         const scroll = this.$refs[allScrolls[val]].scroll
         scroll && scroll.refresh()
       })
+    },
+    async fetchBillDetail (id) {
+      try {
+        this.showDetail = true
+        const { status, data, msg } = apiBillDetail(id)
+        if (status) {
+          this.objBillDetail = data
+        } else {
+          Toast(msg)
+        }
+      } catch (err) {}
     }
   }
 }