li.shaoyi 3 hete
szülő
commit
c170debdf9

+ 46 - 28
src/packages/digital/router/index.ts

@@ -14,7 +14,7 @@ const routes: Array<RouteRecordRaw> = [
     component: () => import('@mobile/views/error/404.vue'),
     meta: {
       ignoreAuth: true,
-    },
+    }
   },
   {
     path: '/boot',
@@ -22,7 +22,7 @@ const routes: Array<RouteRecordRaw> = [
     component: () => import('../views/boot/index.vue'),
     meta: {
       ignoreAuth: true,
-    },
+    }
   },
   {
     path: '/privacy',
@@ -30,7 +30,7 @@ const routes: Array<RouteRecordRaw> = [
     component: () => import('@mobile/views/rules/yszc/home.vue'),
     meta: {
       ignoreAuth: true,
-    },
+    }
   },
   {
     path: '/register',
@@ -80,10 +80,10 @@ const routes: Array<RouteRecordRaw> = [
             path: 'wallet',
             name: 'home-wallet',
             component: () => import('../views/wallet/index.vue'),
-          },
+          }
         ]
       }
-    ],
+    ]
   },
   {
     path: '/spot',
@@ -103,7 +103,7 @@ const routes: Array<RouteRecordRaw> = [
         path: 'goods/chart',
         name: 'spot-goods-chart',
         component: () => import('../views/spot/goods/chart/index.vue'),
-      },
+      }
     ]
   },
   {
@@ -124,7 +124,7 @@ const routes: Array<RouteRecordRaw> = [
         path: 'goods/chart',
         name: 'contract-goods-chart',
         component: () => import('../views/contract/goods/chart/index.vue'),
-      },
+      }
     ]
   },
   {
@@ -132,9 +132,22 @@ const routes: Array<RouteRecordRaw> = [
     component: Page,
     children: [
       {
-        path: 'transfer',
-        name: 'wallet-transfer',
-        component: () => import('../views/wallet/transfer/index.vue'),
+        path: 'deposit/currency',
+        name: 'wallet-deposit-currency',
+        component: () => import('../views/wallet/currency/index.vue'),
+        props: {
+          title: '充值',
+          routeName: 'wallet-deposit'
+        }
+      },
+      {
+        path: 'withdraw/currency',
+        name: 'wallet-withdraw-currency',
+        component: () => import('../views/wallet/currency/index.vue'),
+        props: {
+          title: '提现',
+          routeName: 'wallet-withdraw'
+        }
       },
       {
         path: 'deposit',
@@ -142,10 +155,15 @@ const routes: Array<RouteRecordRaw> = [
         component: () => import('../views/wallet/deposit/index.vue'),
       },
       {
-        path: 'deposit',
+        path: 'withdraw',
         name: 'wallet-withdraw',
         component: () => import('../views/wallet/withdraw/index.vue'),
       },
+      {
+        path: 'transfer',
+        name: 'wallet-transfer',
+        component: () => import('../views/wallet/transfer/index.vue'),
+      }
     ]
   },
   {
@@ -204,8 +222,8 @@ const routes: Array<RouteRecordRaw> = [
         path: 'avatar',
         name: 'user-avatar',
         component: () => import('@mobile/views/user/avatar/Index.vue'),
-      },
-    ],
+      }
+    ]
   },
   {
     path: '/account',
@@ -226,7 +244,7 @@ const routes: Array<RouteRecordRaw> = [
         name: 'account-protocol',
         component: () => import('../../sbyj/views/account/protocol/Index.vue'),
       }
-    ],
+    ]
   },
   {
     path: '/news',
@@ -238,7 +256,7 @@ const routes: Array<RouteRecordRaw> = [
         component: () => import('@mobile/views/news/list/Index.vue'),
         meta: {
           ignoreAuth: true,
-        },
+        }
       },
       {
         path: 'detail',
@@ -246,9 +264,9 @@ const routes: Array<RouteRecordRaw> = [
         component: () => import('@mobile/views/news/detail/Index.vue'),
         meta: {
           ignoreAuth: true,
-        },
-      },
-    ],
+        }
+      }
+    ]
   },
   {
     path: '/bank',
@@ -269,7 +287,7 @@ const routes: Array<RouteRecordRaw> = [
         name: 'bank-capital',
         component: () => import('@mobile/views/bank/capital/index.vue'),
       }
-    ],
+    ]
   },
   {
     path: '/order',
@@ -340,7 +358,7 @@ const routes: Array<RouteRecordRaw> = [
         name: 'mine-email',
         component: () => import('@mobile/views/mine/email/Index.vue'),
       }
-    ],
+    ]
   },
   {
     path: '/notice',
@@ -350,8 +368,8 @@ const routes: Array<RouteRecordRaw> = [
         path: '',
         name: 'notice-list',
         component: () => import('@mobile/views/notice/list/index.vue'),
-      },
-    ],
+      }
+    ]
   },
   {
     path: '/rules',
@@ -363,7 +381,7 @@ const routes: Array<RouteRecordRaw> = [
         component: () => import("@mobile/views/rules/zcxy/Index.vue"),
         meta: {
           ignoreAuth: true,
-        },
+        }
       },
       {
         path: "yhkhfxgzs",
@@ -371,7 +389,7 @@ const routes: Array<RouteRecordRaw> = [
         component: () => import("@mobile/views/rules/fxgzs/Index.vue"),
         meta: {
           ignoreAuth: true,
-        },
+        }
       },
       {
         path: "yszc",
@@ -379,7 +397,7 @@ const routes: Array<RouteRecordRaw> = [
         component: () => import("@mobile/views/rules/yszc/Index.vue"),
         meta: {
           ignoreAuth: true,
-        },
+        }
       },
       {
         path: "gywm",
@@ -387,7 +405,7 @@ const routes: Array<RouteRecordRaw> = [
         component: () => import("@mobile/views/rules/gywm/Index.vue"),
         meta: {
           ignoreAuth: true,
-        },
+        }
       },
       {
         path: "fwrx",
@@ -395,8 +413,8 @@ const routes: Array<RouteRecordRaw> = [
         component: () => import("@mobile/views/rules/fwrx/Index.vue"),
         meta: {
           ignoreAuth: true,
-        },
-      },
+        }
+      }
     ]
   },
 ]

+ 1 - 2
src/packages/digital/views/wallet/components/spot/index.vue

@@ -1,7 +1,6 @@
 <!-- 现货-账户 -->
 <template>
     <div class="spot-account">
-        <Search shape="round" placeholder="搜索" />
         <template v-for="(item, index) in spotAccountStore.dataList" :key="index">
             <div class="card" @click="onClick(item)">
                 <div class="card-section">
@@ -36,7 +35,7 @@
 </template>
 
 <script lang="ts" setup>
-import { Search, Icon } from 'vant'
+import { Icon } from 'vant'
 import { formatDecimal } from '@/filters'
 import { getDigitalCurrencyName } from '@/constants/order'
 import { useSpotAccountStore } from './composables'

+ 40 - 0
src/packages/digital/views/wallet/currency/index.vue

@@ -0,0 +1,40 @@
+<template>
+    <app-view>
+        <template #header>
+            <app-navbar :title="title">
+                <template #footer>
+                    <Search shape="round" placeholder="搜索" />
+                </template>
+            </app-navbar>
+        </template>
+        <spot-account @click="navigateTo" />
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { Search } from 'vant'
+import { useNavigation } from '@mobile/router/navigation'
+import SpotAccount from '../components/spot/index.vue'
+
+const props = defineProps({
+    title: {
+        type: String,
+        required: true
+    },
+    routeName: {
+        type: String,
+        required: true
+    }
+})
+
+const { router } = useNavigation()
+
+const navigateTo = (currencyId: number) => {
+    router.push({
+        name: props.routeName,
+        query: {
+            id: currencyId
+        }
+    })
+}
+</script>

+ 4 - 3
src/packages/digital/views/wallet/index.vue

@@ -5,8 +5,8 @@
             <app-statusbar />
         </template>
         <Grid :border="false">
-            <GridItem icon="pending-payment" text="充值" :to="{ name: 'wallet-deposit' }" />
-            <GridItem icon="paid" text="提现" :to="{ name: 'wallet-withdraw' }" />
+            <GridItem icon="pending-payment" text="充值" :to="{ name: 'wallet-deposit-currency' }" />
+            <GridItem icon="paid" text="提现" :to="{ name: 'wallet-withdraw-currency' }" />
             <GridItem icon="peer-pay" text="划转" :to="{ name: 'wallet-transfer' }" />
             <GridItem icon="setting-o" text="设置" :to="{ name: 'setting' }" />
         </Grid>
@@ -15,6 +15,7 @@
                 <contract-account @click="navigateToContractDetail" />
             </Tab>
             <Tab title="现货">
+                <Search shape="round" placeholder="搜索" />
                 <spot-account @click="navigateToSpotDetail" />
             </Tab>
         </Tabs>
@@ -23,7 +24,7 @@
 
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
-import { Tab, Tabs, Grid, GridItem } from 'vant'
+import { Tab, Tabs, Grid, GridItem, Search } from 'vant'
 import { useNavigation } from '@mobile/router/navigation'
 import SpotAccount from './components/spot/index.vue'
 import ContractAccount from './components/contract/index.vue'

+ 3 - 5
src/packages/digital/views/wallet/transfer/index.vue

@@ -49,8 +49,8 @@ import { fullloading } from '@/utils/vant'
 import { formatDecimal } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
 import { getCurrencyList, getDigitalCurrencyList } from '@/constants/order'
-import { DigitalAccountTransferApply } from '@/services/api/bank'
-import { useAccountStore, useUserStore } from '@/stores'
+import { digitalAccountTransferApply } from '@/services/api/digital'
+import { useAccountStore } from '@/stores'
 import { useSpotAccountStore } from '../components/spot/composables'
 import AppSelect from '@mobile/components/base/select/index.vue'
 import AppStepper from '@mobile/components/base/stepper/index.vue'
@@ -59,7 +59,6 @@ const { routerBack } = useNavigation()
 
 const spotAccountStore = useSpotAccountStore()
 const accountStore = useAccountStore()
-const userStore = useUserStore()
 
 const currencyList = getCurrencyList()
 const digitalCurrentyList = getDigitalCurrencyList()
@@ -88,7 +87,6 @@ const currencyOptions = (() => {
 })()
 
 const formData = reactive<Partial<Proto.DigitalAccountTransferApplyReq>>({
-    UserID: userStore.userInfo.userid,
     DigitalTransferType: 3,
     Amount: 1,
 })
@@ -123,7 +121,7 @@ const formRules: { [key: string]: FieldRule[] } = {
 
 const onSubmit = () => {
     fullloading((hideLoading) => {
-        DigitalAccountTransferApply({
+        digitalAccountTransferApply({
             data: {
                 ...formData,
                 AccountID: contractAccount.value?.accountid

+ 5 - 0
src/packages/digital/views/wallet/withdraw/index.vue

@@ -8,4 +8,9 @@
 </template>
 
 <script lang="ts" setup>
+import { useNavigation } from '@mobile/router/navigation'
+
+const { getQueryStringToNumber } = useNavigation()
+
+const currencyId = getQueryStringToNumber('id')
 </script>

+ 0 - 16
src/services/api/bank/index.ts

@@ -117,22 +117,6 @@ export function YJF_GetWithholdSignInSMSVCode(config: RequestConfig<Partial<Prot
 }
 
 /**
- * 数字账户转入转出申请
- */
-export function DigitalAccountTransferApply(config: RequestConfig<Partial<Proto.DigitalAccountTransferApplyReq>>) {
-    return http.mqRequest<Proto.DigitalAccountTransferApplyRsp>({
-        data: {
-            OperateSrc: 2,
-            ClientTicket: v4(),
-            ...config.data
-        },
-        requestCode: 'DigitalAccountTransferApplyReq',
-        responseCode: 'DigitalAccountTransferApplyRsp',
-        marketId: 19
-    })
-}
-
-/**
  * 查询托管银行
  */
 export function queryCusBankSignBank(config: RequestConfig = {}) {

+ 42 - 5
src/services/api/digital/index.ts

@@ -12,7 +12,7 @@ export function queryTaaccountDigitals() {
     return http.commonRequest<Model.TaaccountDigitalsRsp[]>({
         url: '/Digital/QueryTaaccountDigitals',
         method: 'post',
-        params: {
+        data: {
             userid: getUserId()
         },
     })
@@ -25,7 +25,7 @@ export function queryDigitalTradeOrderDetails(config: RequestConfig<Model.Digita
     return http.commonRequest<Model.DigitalTradeOrderDetailsRsp[]>({
         url: '/Digital/QueryDigitalTradeOrderDetails',
         method: 'post',
-        params: {
+        data: {
             userid: getUserId(),
             ...config.data
         },
@@ -39,7 +39,7 @@ export function queryDigitalTradeTradeDetails(config: RequestConfig<Model.Digita
     return http.commonRequest<Model.DigitalTradeTradeDetailsRsp[]>({
         url: '/Digital/QueryDigitalTradeTradeDetails',
         method: 'post',
-        params: {
+        data: {
             userid: getUserId(),
             ...config.data
         },
@@ -53,7 +53,7 @@ export function queryTaaccountDigitalLogs(config: RequestConfig<Model.TaaccountD
     return http.commonRequest<Model.TaaccountDigitalLogsRsp[]>({
         url: '/Digital/QueryTaaccountDigitalLogs',
         method: 'post',
-        params: config.data,
+        data: config.data,
     })
 }
 
@@ -64,7 +64,7 @@ export function queryTaaccountDigitalChangeApplys(config: RequestConfig<Model.Ta
     return http.commonRequest<Model.TaaccountDigitalChangeApplysRsp[]>({
         url: '/Digital/QueryTaaccountDigitalChangeApplys',
         method: 'post',
-        params: config.data,
+        data: config.data,
     })
 }
 
@@ -106,6 +106,23 @@ export function digitalAccountActivate(config: RequestConfig<Partial<Proto.Digit
 }
 
 /**
+ * 数字账户转入转出申请
+ */
+export function digitalAccountTransferApply(config: RequestConfig<Partial<Proto.DigitalAccountTransferApplyReq>>) {
+    return http.mqRequest<Proto.DigitalAccountTransferApplyRsp>({
+        data: {
+            UserID: getUserId(),
+            ClientTicket: v4(),
+            OperateSrc: 2,
+            ...config.data
+        },
+        requestCode: 'DigitalAccountTransferApplyReq',
+        responseCode: 'DigitalAccountTransferApplyRsp',
+        marketId: 19
+    })
+}
+
+/**
  * 创建数字钱包地址请求
  */
 export function createDigitalWalletAddress(config: RequestConfig<Partial<Proto.CreateDigitalWalletAddressReq>>) {
@@ -152,4 +169,24 @@ export function digitalAccountWithdrawApplyCancel(config: RequestConfig<Partial<
         responseCode: 'DigitalAccountWithdrawApplyCancelRsp',
         marketId: 20
     })
+}
+
+/**
+ * 查询钱包地址
+ */
+export function queryWalletAddress(config: RequestConfig<Model.WalletAddressReq>) {
+    return http.commonRequest<Model.WalletAddressRsp[]>({
+        url: '/Wallet/QueryWalletAddress',
+        params: config.data,
+    })
+}
+
+/**
+ * 查询钱包链
+ */
+export function queryWalletChains(config: RequestConfig<Model.WalletChainsReq>) {
+    return http.commonRequest<Model.WalletChainsRsp[]>({
+        url: '/Wallet/QueryWalletChains',
+        params: config.data,
+    })
 }

+ 54 - 0
src/types/model/digital.d.ts

@@ -178,4 +178,58 @@ declare namespace Model {
         revoketime: string; // 撤销时间
         userid: number; // 用户ID
     }
+
+    /** 查询钱包地址 请求 */
+    interface WalletAddressReq {
+        digitalaccountid: string; // 数字账户ID
+    }
+
+    /** 查询钱包地址 响应 */
+    interface WalletAddressRsp {
+        address: string; // 区块链地址
+        addrtype: number; // 地址类型:1-充值;2-提现
+        chaincode: string; // 链代码(如BTC,ETH)
+        channelcode: string; // 渠道代码
+        digitalaccountid: number; // 数字账户ID
+        id: number; // 地址ID
+        memo: string; // 地址备注(某些链需要)
+    }
+
+    /** 查询钱包链 请求 */
+    interface WalletChainsReq {
+        channelCode: string; // 渠道代码
+    }
+
+    /** 查询钱包链 响应 */
+    interface WalletChainsRsp {
+        chain_id: string; // 链ID
+        chain_identifier: string; // 链标识符
+        channel_code: string; // 渠道代码
+        coinbase_maturity: number; // 在 Coinbase 交易被视为成熟并可以使用之前所需的确认次数,例如 BTC 需要 100 次确认。
+        confirming_threshold: number; // 确认阈值,链上交易所需的确认次数,例如以太坊为 64 次
+        enabled: number; // 是否启用,0-不启用;1-启用
+        explorer_address_url: string; // 区块链浏览器上的地址 URL 模式
+        explorer_tx_url: string; // 区块链浏览器上的交易 URL 模式
+        icon_url: string; // 链条图标的 URL
+        id: number; // sep
+        require_memo: number; // 该链条是否需要备注
+        tokens: {
+            asset_id: string; // 资产 ID,关联交易所账户中持有资产的唯一标识符
+            asset_model_type: string; // 模型类型
+            can_deposit: number; // 是否可以充值
+            can_withdraw: number; // 是否可以提现
+            chain_id: string; // 所属链ID
+            channel_code: string; // 渠道ID
+            deposit_threshold: string; // 最低充值金额
+            dust_threshold: string; // 最低提现金额
+            enabled: number; // 是否可用,0-不可用;1-可用
+            fee_token_id: string; // 手续费代币ID
+            icon_url: string; // 代币图标URL
+            id: number; // SEQ_WALLET_TOKENS
+            name: string; // 代币全名
+            symbol: string; // 代币符号
+            token_decimal: number; // 小数位
+            token_id: string; // 代币ID
+        }[];
+    }
 }