Browse Source

feat: 提现记录接口调试

liangan 2 weeks ago
parent
commit
937efe3636
1 changed files with 12 additions and 4 deletions
  1. 12 4
      src/pages/wallet/withdrawRecord.vue

+ 12 - 4
src/pages/wallet/withdrawRecord.vue

@@ -13,7 +13,9 @@
 // eslint-disable-next-line unused-imports/no-unused-imports
 import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
 import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging.js'
+import { getEnum as _getEnum } from '@/api/common'
 import { withdrawRecordList } from '@/api/wallet'
+import { formatNumber } from '@/utils'
 import { getPageParams } from '@/utils/page'
 
 defineOptions({
@@ -24,8 +26,13 @@ const paging = ref(null)
 // 类似mixins,如果是页面滚动务必要写这一行,并传入当前ref绑定的paging,注意此处是paging,而非paging.value
 useZPaging(paging)
 const queryParams = ref<any>({})
+const statusEnum = ref<any[]>([])
 // 搜索结果
 const dataList = ref([])
+async function getEnum() {
+  const res = await _getEnum({ id: 3 })
+  statusEnum.value = res.data
+}
 async function queryList(pageNo: number, pageSize: number) {
   try {
     const res = await withdrawRecordList({
@@ -42,6 +49,7 @@ async function queryList(pageNo: number, pageSize: number) {
 }
 onLoad((options) => {
   queryParams.value = getPageParams(options)
+  getEnum()
 })
 </script>
 
@@ -50,12 +58,12 @@ onLoad((options) => {
     <view class="py-20rpx">
       <view v-for="item in dataList" :key="item.id" class="bg-white px-22rpx py-18rpx">
         <view class="mb-8rpx flex items-center justify-between">
-          <view>ID:20250505123030120</view>
-          <wd-text type="primary" bold text="Processing" />
+          <view>ID:{{ item.orderNo }}</view>
+          <wd-text :type="item.status === 4 ? 'success' : 'primary'" bold :text="statusEnum.find(i => i.code === item.status)?.name" />
         </view>
         <view class="flex items-center justify-between text-22rpx text-#3A444C">
-          <view>Wallet Balance:+300.00</view>
-          <view>05.05 12:30</view>
+          <view>Wallet Balance:-{{ formatNumber(item.amount) }}</view>
+          <view>{{ item.createTime }}</view>
         </view>
       </view>
     </view>