Ver código fonte

用户支付提现回显

jiayubo 3 meses atrás
pai
commit
fedb5c047a
2 arquivos alterados com 56 adições e 5 exclusões
  1. 10 1
      api/mine.js
  2. 46 4
      pages_mine/pages/withdrawal/index.vue

+ 10 - 1
api/mine.js

@@ -85,4 +85,13 @@ export function getIncomeDetails(volunteerTakeRecordId) {
         url: `/core/volunteer/take/${volunteerTakeRecordId}`,
         method: 'get',
     })
-}
+}
+
+
+// 他人账户提现回显
+export function vonTtAlipayAccountHistory() {
+  return request({
+    url: `/core/volunteer/take/getAlipayAccountHistory`,
+    method: 'get',
+  })
+}

+ 46 - 4
pages_mine/pages/withdrawal/index.vue

@@ -101,6 +101,8 @@ import {
   getVolunteerAccountInfo,
   getAccountInfo,
   submitAmountApply,
+  vonTtAlipayAccountHistory,
+  getWithdrawStatus
 } from '@/api/mine'
 import { onShow } from '@dcloudio/uni-app'
 import row from 'uview-plus/components/u-row/row'
@@ -163,10 +165,10 @@ const select = (row) => {
   console.log('select', row)
 }
 
-const selectNumber = (row) => {
-  s_key.value = row.name
-  console.log('selectNumber', row)
-}
+// const selectNumber = (row) => {
+//   s_key.value = row.name
+//   console.log('selectNumber', row)
+// }
 
 const errors = (e) => {
   uni.showToast({
@@ -246,6 +248,46 @@ const init = async () => {
   }
 }
 
+const selectNumber = async (row) => {
+  s_key.value = row.name
+  console.log('selectNumber', row)
+  if (row.name === '他人支付宝账号提现') {
+    try {
+      uni.showLoading({
+        title: '加载历史数据...',
+        mask: true
+      })
+      
+      // 首先尝试获取历史支付宝账户信息
+      const res = await vonTtAlipayAccountHistory()
+      
+      if (res.data === null ) {
+         // 获取当前提现状态的数据
+        const statusRes = await getWithdrawStatus()
+        if (statusRes.code === 200 && statusRes.data) {
+          priceData.value.name = statusRes.data.alipayName || ''
+          priceData.value.code = statusRes.data.alipayAccountNo || ''
+          priceData.value.idCard = statusRes.data.takeIdCard || ''
+          
+        }
+      } 
+    } catch (error) {
+      console.error('获取账户信息失败:', error)
+      uni.showToast({
+        title: '获取账户信息失败',
+        icon: 'none'
+      })
+    } finally {
+      uni.hideLoading()
+    }
+  } else {
+    // 切回本人时清空第三方账号信息
+    priceData.value.name = ''
+    priceData.value.code = ''
+    priceData.value.idCard = ''
+  }
+}
+
 onShow(() => {
   init()
 })