li.shaoyi 3 週間 前
コミット
f7ad30ab35

+ 3 - 0
src/packages/digital/assets/themes/default/default.less

@@ -42,6 +42,9 @@
     /* Vant-Checkbox */
     --van-checkbox-checked-icon-color: var(--color-primary);
 
+    /* Vant-Radio */
+    --van-radio-checked-icon-color: var(--color-primary);
+
     /* Vant-Tabs */
     --van-tabs-bottom-bar-color: var(--color-primary);
 }

+ 3 - 0
src/packages/digital/assets/themes/global/global.less

@@ -60,6 +60,9 @@
     }
 
     &__footer {
+        display: flex;
+        align-items: center;
+        gap: 10px;
         padding: var(--van-padding-md);
     }
 }

+ 2 - 0
src/packages/digital/main.ts

@@ -4,6 +4,7 @@ import { createApp } from 'vue'
 import { createPinia } from 'pinia'
 import App from './App.vue'
 import router from './router'
+import directives from '@/directives' // 自定义指令集
 //import 'default-passive-events'
 import '@/utils/h5plus' // 加载html5+
 import 'hqchart/src/jscommon/umychart.resource/font/iconfont.css'
@@ -20,6 +21,7 @@ const app = createApp(App)
 app.use(pinia)
 app.use(i18n)
 app.use(router)
+app.use(directives)
 app.use(layouts)
 app.mount('#app')
 

+ 4 - 0
src/packages/digital/views/contract/components/position/detail/index.vue

@@ -99,6 +99,7 @@ const componentMap = new Map<string, unknown>([
 ])
 
 const futuresStore = useFuturesStore()
+const pullRefreshRef = shallowRef()
 const showModal = shallowRef(true) // 是否刷新父组件数据
 const refresh = shallowRef(false)
 const rowIndex = shallowRef(-1)
@@ -140,5 +141,8 @@ const closed = (isRefresh = false) => {
 // 暴露组件属性给父组件调用
 defineExpose({
     closed,
+    refresh: () => {
+        pullRefreshRef.value?.refresh()
+    }
 })
 </script>

+ 14 - 14
src/packages/digital/views/contract/components/position/detail/tpsl/index.vue

@@ -36,31 +36,33 @@
                 </CellGroup>
                 <CellGroup :title="t('digital.spsl')" inset>
                     <Cell
-                        :value="`${t('mine.setting.price')} (>=${pricePoints.takeProfit.toFixed(selectedRow.decimalplace)})`">
+                        :value="`${t('mine.setting.price')} (${selectedRow.buyorsell === BuyOrSell.Buy ? '>' : '<'}=${pricePoints.takeProfit.toFixed(selectedRow.decimalplace)})`">
                         <template #title>
                             <Checkbox v-model="formData.TPFlag">{{ $t('digital.sp') }}</Checkbox>
                         </template>
                     </Cell>
                     <Field name="TPPrice" :rules="formRules.TPPrice">
                         <template #input>
-                            <app-stepper v-model="formData.TPPrice" :decimal-length="quote?.decimalplace"
-                                :step="quote?.decimalvalue" :button-size="32" :disabled="!formData.TPFlag"
-                                :auto-fixed="false" />
+                            <app-stepper v-model="formData.TPPrice"
+                                :min="selectedRow.buyorsell === BuyOrSell.Sell && quote?.decimalvalue"
+                                :decimal-length="quote?.decimalplace" :step="quote?.decimalvalue"
+                                :disabled="!formData.TPFlag" />
                         </template>
                     </Field>
                 </CellGroup>
                 <CellGroup inset>
                     <Cell
-                        :value="`${t('mine.setting.price')} (<=${pricePoints.stopLoss.toFixed(selectedRow.decimalplace)})`">
+                        :value="`${t('mine.setting.price')} (${selectedRow.buyorsell === BuyOrSell.Buy ? '<' : '>'}=${pricePoints.stopLoss.toFixed(selectedRow.decimalplace)})`">
                         <template #title>
                             <Checkbox v-model="formData.SLFlag">{{ $t('digital.sl') }}</Checkbox>
                         </template>
                     </Cell>
                     <Field name="SLPrice" :rules="formRules.SLPrice">
                         <template #input>
-                            <app-stepper v-model="formData.SLPrice" :decimal-length="quote?.decimalplace"
-                                :step="quote?.decimalvalue" :button-size="32" :disabled="!formData.SLFlag"
-                                :auto-fixed="false" />
+                            <app-stepper v-model="formData.SLPrice"
+                                :min="selectedRow.buyorsell === BuyOrSell.Buy && quote?.decimalvalue"
+                                :decimal-length="quote?.decimalplace" :step="quote?.decimalvalue"
+                                :disabled="!formData.SLFlag" />
                         </template>
                     </Field>
                 </CellGroup>
@@ -157,9 +159,8 @@ const formRules: { [key: string]: FieldRule[] } = {
         validator: () => {
             if (formData.TPFlag) {
                 const value = Number(formData.TPPrice)
-                if (value < pricePoints.value.takeProfit) {
-                    return '价格不在有效范围内'
-                }
+                const isInvalid = props.selectedRow.buyorsell === BuyOrSell.Buy ? value < pricePoints.value.takeProfit : value > pricePoints.value.takeProfit
+                return isInvalid ? '价格不在有效范围内' : true
             }
             return true
         }
@@ -169,9 +170,8 @@ const formRules: { [key: string]: FieldRule[] } = {
         validator: () => {
             if (formData.SLFlag) {
                 const value = Number(formData.SLFlag)
-                if (value > pricePoints.value.stopLoss) {
-                    return '价格不在有效范围内'
-                }
+                const isInvalid = props.selectedRow.buyorsell === BuyOrSell.Buy ? value > pricePoints.value.stopLoss : value < pricePoints.value.stopLoss
+                return isInvalid ? '价格不在有效范围内' : true
             }
             return true
         }

+ 5 - 4
src/packages/digital/views/contract/detail/index.vue

@@ -35,17 +35,18 @@
                         <td>
                             <span class="text-small">{{
                                 $t('mine.availableFunds') + `(${currency(accountItem.currencyid)})`
-                                }}</span>
+                            }}</span>
                             <span>{{ accountItem.avaiableBalance.toFixed(accountItem.currencydecimalplace) }}</span>
                         </td>
                         <td>
-                            <span class="text-small">{{ $t('account.usedMargin') + `(${currency(accountItem.currencyid)})`
+                            <span class="text-small">{{ $t('account.usedMargin') +
+                                `(${currency(accountItem.currencyid)})`
                                 }}</span>
                             <span>{{ accountItem.usedmargin.toFixed(accountItem.currencydecimalplace) }}</span>
                         </td>
                         <td>
                             <span class="text-small">{{ $t('account.freeze') + `(${currency(accountItem.currencyid)})`
-                                }}</span>
+                            }}</span>
                             <span>{{ accountItem.freezeMargin.toFixed(accountItem.currencydecimalplace) }}</span>
                         </td>
                     </tr>
@@ -69,7 +70,7 @@
         <ActionSheet v-model:show="showSheet" :title="t('common.choice')">
             <CellGroup style="min-height: 200px;">
                 <template v-for="(item, index) in quotes" :key="index">
-                    <Cell :title="item.goodsname" :value="item.goodscode" :border="false" is-link
+                    <Cell :title="item.goodsname" :value="item.goodscode" :border="false" is-link clickable
                         @click="navigateToContractDetail(item.goodsid)" />
                 </template>
             </CellGroup>

+ 13 - 13
src/packages/digital/views/contract/goods/detail/index.vue

@@ -39,8 +39,8 @@
                         <app-select v-model="formData.PriceMode" :options="options" />
                     </template>
                 </Field>
-                <Field v-if="formData.PriceMode === PriceMode.Limit" name="OrderPrice"
-                    :rules="formRules.OrderPrice" :label="t('digital.orderprice') + enumName">
+                <Field v-if="formData.PriceMode === PriceMode.Limit" name="OrderPrice" :rules="formRules.OrderPrice"
+                    :label="t('digital.orderprice') + enumName">
                     <template #input>
                         <app-stepper v-model="formData.OrderPrice" :min="0" :decimal-length="quote?.decimalplace"
                             :step="quote?.decimalvalue" />
@@ -56,7 +56,8 @@
             </CellGroup>
             <CellGroup inset>
                 <Cell :title="t('digital.maxBalance')" :value="formatDecimal(calculations.maxBalance)" />
-                <Cell :title="t('digital.maxBuyQty')" :value="handleNoneValue(formatDecimal(calculations.maxBuyQty, 0))" />
+                <Cell :title="t('digital.maxBuyQty')"
+                    :value="handleNoneValue(formatDecimal(calculations.maxBuyQty, 0))" />
                 <Cell :title="t('digital.buyEstimatedFee')" :value="formatDecimal(calculations.buyEstimatedFee)" />
             </CellGroup>
         </Form>
@@ -64,12 +65,13 @@
             <Col span="24">
             <Button :type="formData.BuyOrSell === BuyOrSell.Buy ? 'success' : 'danger'" block
                 @click="formRef?.submit">{{
-                    formData.BuyOrSell === BuyOrSell.Buy ? $t('digital.buy') : $t('digital.sell') }}{{ goods?.goodscode }}</Button>
+                    formData.BuyOrSell === BuyOrSell.Buy ? $t('digital.buy') : $t('digital.sell') }}{{ quote?.goodscode
+                }}</Button>
             </Col>
         </Row>
         <Tabs v-model:active="tabIndex">
             <Tab :title="t('digital.position')">
-                <contract-position :params="{ goodsid: goodsId }" />
+                <contract-position ref="positionRef" :params="{ goodsid: goodsId }" />
             </Tab>
             <Tab :title="t('digital.order')">
                 <contract-order :params="{ goodsID: goodsId, orderStatus: '3,7' }" />
@@ -87,7 +89,7 @@ import { Form, FormInstance, Button, CellGroup, Field, Cell, Tab, Tabs, FieldRul
 import { EValidType, EOrderOperateType, EBuildType } from '@/constants/client'
 import { formatDecimal, handleNoneValue, handleNumberValue, parsePercent } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
-import { useFuturesStore, useSBYJOrderStore, useUserStore, useAccountStore, i18n } from '@/stores'
+import { useFuturesStore, useUserStore, useAccountStore, i18n } from '@/stores'
 import { fullloading, dialog } from '@/utils/vant'
 import { useOrder } from '@/business/trade'
 import { BuyOrSell, getGoodsCurrencyItemName, PriceMode } from '@/constants/order'
@@ -105,14 +107,12 @@ const tabIndex = shallowRef(0)
 const { global: { t } } = i18n
 
 const formRef = shallowRef<FormInstance>()
+const positionRef = shallowRef()
 const showModal = shallowRef(true)
 
 const userStore = useUserStore()
 const { formData, formSubmit } = useOrder()
 
-const { getSBYJMyOrders } = useSBYJOrderStore()
-const goods = computed(() => futuresStore.getGoods(goodsId ?? 0)) ?? {}
-
 const quote = computed(() => futuresStore.getQuoteItem({ goodsid: goodsId }))
 
 const options = computed(() => {
@@ -145,19 +145,19 @@ const calculations = computed(() => {
     const accountStore = useAccountStore()
     const { avaiableBalance = 0 } = computed(() => accountStore.filterAccountsByCurrencyId(currencyid, goodscurrencyid)).value[0] ?? {}
 
-    const openAmount = price*OrderQty*agreeunit
+    const openAmount = price * OrderQty * agreeunit
 
     // 可用余额
     const maxBalance = avaiableBalance
     // 预估手续费 1 比率 2 固定 预估手续费(小数位根据币种小数位格式化):
     // 手续费设置(固定) 时:预估手续费 = 数量 * 合约乘数 * 固定值
     // 手续费设置(比率) 时:预估手续费 = 价格 * 数量 * 合约乘数 * 比率值
-    const buyEstimatedFee = (feeValue.FeeAlgorithm === 2 ? 1 : price)*OrderQty*agreeunit*feeValue.feeValue
+    const buyEstimatedFee = (feeValue.FeeAlgorithm === 2 ? 1 : price) * OrderQty * agreeunit * feeValue.feeValue
     // 可开数量 1 比率 2 固定
     // 可开数量(整数,向下取整):
     // 保证金设置(固定) 时:可开数量 = 可用余额 / (合约乘数 * 固定值)
     // 保证金设置(比率) 时:可开数量 = 可用余额 / (价格 * 合约乘数 * 比率值)
-    const maxBuyQty = marketmarginalgorithm === 2 ? maxBalance/(agreeunit*marketmarginvalue) : maxBalance/(price*agreeunit*marketmarginvalue)
+    const maxBuyQty = marketmarginalgorithm === 2 ? maxBalance / (agreeunit * marketmarginvalue) : maxBalance / (price * agreeunit * marketmarginvalue)
     return {
         estimatedAmount,
         maxBalance,
@@ -224,7 +224,7 @@ const onSubmit = () => {
             formSubmit().then(() => {
                 hideLoading(t('quote.goods.tips3'), 'success')
                 // 刷新订单列表
-                getSBYJMyOrders()
+                positionRef.value?.refresh()
             }).catch((err) => {
                 hideLoading(err, 'fail')
             })

+ 12 - 8
src/packages/digital/views/spot/components/account/index.vue

@@ -27,9 +27,15 @@
             <tfoot>
                 <tr>
                     <td colspan="2">
-                        <Button type="primary" size="small" @click="activate(item)" v-if="!item.digitalaccountid">{{ $t('digital.activation') }}</Button>
-                        <Button size="small" @click="navigateTo('wallet-deposit', item.digitalaccountid)">{{ $t('digital.wallet-deposit') }}</Button>
-                        <Button size="small" @click="navigateTo('wallet-withdraw', item.digitalaccountid)">{{ $t('digital.wallet-withdraw') }}</Button>
+                        <Button type="primary" size="small" @click="activate(item)" v-if="!item.digitalaccountid">
+                            {{ $t('digital.activation') }}
+                        </Button>
+                        <Button size="small" @click="navigateTo('wallet-deposit', item.currencyid)">
+                            {{ $t('digital.wallet-deposit') }}
+                        </Button>
+                        <Button size="small" @click="navigateTo('wallet-withdraw', item.currencyid)">
+                            {{ $t('digital.wallet-withdraw') }}
+                        </Button>
                     </td>
                 </tr>
             </tfoot>
@@ -40,7 +46,7 @@
 </template>
 
 <script lang="ts" setup>
-import {shallowRef, computed, defineAsyncComponent } from 'vue'
+import { shallowRef, computed, defineAsyncComponent } from 'vue'
 import { Button } from 'vant'
 import { useComponent } from '@/hooks/component'
 import { useNavigation } from '@mobile/router/navigation'
@@ -76,12 +82,10 @@ const activate = (item: Model.TaaccountDigitalsRsp) => {
     openComponent('Activate')
 }
 
-const navigateTo = (name: string, accountId: string) => {
+const navigateTo = (name: string, id: string | number) => {
     router.push({
         name,
-        query: {
-            id: accountId
-        }
+        query: { id }
     })
 }
 </script>

+ 12 - 8
src/packages/digital/views/spot/detail/index.vue

@@ -5,16 +5,18 @@
         </template>
         <Grid :border="false" :column-num="quotes.length ? 3 : 2">
             <GridItem icon="pending-payment" :text="t('digital.wallet-deposit')"
-                :to="{ name: 'wallet-deposit', query: { id: digitalaccountid } }" />
-            <GridItem icon="paid" :text="t('digital.wallet-withdraw')" :to="{ name: 'wallet-withdraw', query: { id: digitalaccountid } }" />
-            <GridItem icon="chart-trending-o" :text="t('spot-goods-detail')" @click="navigateToSpotDetail()" v-if="quotes.length" />
+                :to="{ name: 'wallet-deposit', query: { id: currencyid } }" />
+            <GridItem icon="paid" :text="t('digital.wallet-withdraw')"
+                :to="{ name: 'wallet-withdraw', query: { id: currencyid } }" />
+            <GridItem icon="chart-trending-o" :text="t('spot-goods-detail')" @click="navigateToSpotDetail()"
+                v-if="quotes.length" />
         </Grid>
         <div class="g-detail-table" v-if="accountItem">
             <table cellspacing="0" cellpadding="0">
                 <tbody>
                     <tr>
                         <td colspan="2">
-                            <span class="text-small">{{ t('account.balance')+`(${accountItem.currencycode})`}}</span>
+                            <span class="text-small">{{ t('account.balance') + `(${accountItem.currencycode})` }}</span>
                             <span>
                                 {{ formatDecimal(accountItem.currentbalance, accountItem.currencydecimalplace) }}
                             </span>
@@ -22,13 +24,15 @@
                     </tr>
                     <tr>
                         <td>
-                            <span class="text-small">{{ t('account.availableFunds')+`(${accountItem.currencycode})`}}</span>
+                            <span class="text-small">{{
+                                t('account.availableFunds') + `(${accountItem.currencycode})` }}</span>
                             <span>
-                                {{ formatDecimal(spotAccountStore.getAvailableBalance(accountItem), accountItem.currencydecimalplace) }}
+                                {{ formatDecimal(spotAccountStore.getAvailableBalance(accountItem),
+                                    accountItem.currencydecimalplace) }}
                             </span>
                         </td>
                         <td>
-                            <span class="text-small">{{ t('account.freeze')+`(${accountItem.currencycode})`}}</span>
+                            <span class="text-small">{{ t('account.freeze') + `(${accountItem.currencycode})` }}</span>
                             <span>
                                 {{ formatDecimal(accountItem.freezemargin, accountItem.currencydecimalplace) }}
                             </span>
@@ -63,7 +67,7 @@
         <ActionSheet v-model:show="showSheet" title="请选择">
             <CellGroup style="min-height: 200px;">
                 <template v-for="(item, index) in quotes" :key="index">
-                    <Cell :title="item.goodsname" :value="item.goodscode" :border="false" is-link
+                    <Cell :title="item.goodsname" :value="item.goodscode" :border="false" is-link clickable
                         @click="navigateToSpotDetail(item.goodsid)" />
                 </template>
             </CellGroup>

+ 40 - 0
src/packages/digital/views/wallet/deposit/index.less

@@ -0,0 +1,40 @@
+.wallet-deposit {
+    &__address {
+        dl {
+            dt {
+                line-height: 1.5;
+
+                span {
+                    font-size: 12px;
+                    color: #666;
+                    margin-top: 10px;
+                }
+            }
+
+            dd {
+                display: flex;
+                align-items: center;
+                border: 1px solid #333;
+                border-radius: 8px;
+                padding: 10px;
+                margin-top: 15px;
+
+                span {
+                    flex: 1;
+                    word-break: break-all;
+                }
+
+                .van-icon {
+                    color: #999;
+                    font-size: 20px;
+                    margin-left: 20px;
+                }
+            }
+        }
+    }
+
+    &__qrcode {
+        text-align: center;
+        padding: 20px 0;
+    }
+}

+ 101 - 37
src/packages/digital/views/wallet/deposit/index.vue

@@ -6,38 +6,80 @@
         </template>
         <Form ref="formRef" class="g-form__container g-layout-block" @submit="onSubmit">
             <CellGroup inset>
-                <Field name="currenty" label="币种" :rules="formRules.currenty" is-link>
+                <Field name="currenty" label="币种" label-align="top" :rules="formRules.currenty" arrow-direction="down"
+                    is-link>
                     <template #input>
                         <app-select v-model="state.currentyId" :options="digitalCurrentyList"
                             @confirm="onCurrentyChange" />
                     </template>
                 </Field>
-                <Field name="token" label="网络" :rules="formRules.token" is-link>
-                    <template #input>
-                        <app-select v-model="state.tokenId" :options="walletTokens"
-                            :optionProps="{ label: 'chain_id', value: 'id' }" />
+            </CellGroup>
+            <CellGroup inset>
+                <Field name="token" label="存款网络" label-align="top" placeholder="请选择" :rules="formRules.token"
+                    arrow-direction="down" is-link readonly @click="state.showSheet = true">
+                    <template #input v-if="tokenItem">
+                        {{ tokenItem.name }} ({{ tokenItem.chain_id }})
                     </template>
                 </Field>
-                <Cell title="余额" :value="balance" />
             </CellGroup>
         </Form>
-        <div class="g-form__footer inset">
-            <Button type="primary" @click="formRef?.submit" block>创建新地址</Button>
-        </div>
-        {{ addressList }}
+        <CellGroup inset v-if="tokenItem">
+            <Cell title="余额" :value="balance" />
+            <div class="wallet-deposit__address">
+                <dl class="g-layout-block g-layout-block--inset">
+                    <dt>
+                        <h3>存款地址</h3>
+                        <span>*仅将 {{ currentyItem?.label }} 存入此地址</span>
+                    </dt>
+                    <dd v-for="(item, index) in addressList" :key="index">
+                        <span>{{ item.address }}</span>
+                        <Icon name="qr" @click="openQRcode(item.address)" />
+                        <Icon name="link-o" :data-clipboard-text="item.address" v-copy="onCopy" />
+                    </dd>
+                </dl>
+                <div class="g-layout-block g-layout-block--inset">
+                    <Button type="primary" size="small" block @click="formRef?.submit">创建新地址</Button>
+                </div>
+            </div>
+        </CellGroup>
+        <ActionSheet v-model:show="state.showSheet" title="选择存款网络">
+            <CellGroup style="min-height: 200px;">
+                <RadioGroup v-model="state.tokenId" v-if="walletTokens.length">
+                    <template v-for="(item, index) in walletTokens" :key="index">
+                        <Cell :title="item.name" :label="item.chain_id" :border="false" clickable center
+                            @click="onRadioClick(item.id)">
+                            <!-- <template #icon>
+                                <Image fit="contain" :src="item.icon_url" width="28" height="28" round style="margin-right: 10px;" />
+                            </template> -->
+                            <template #right-icon>
+                                <Radio :name="item.id" />
+                            </template>
+                        </Cell>
+                    </template>
+                </RadioGroup>
+                <Empty description="暂无数据" v-else />
+            </CellGroup>
+        </ActionSheet>
+        <Dialog v-model:show="state.showDialog" :show-confirm-button="false" cancel-button-text="关闭" show-cancel-button
+            destroy-on-close>
+            <div class="wallet-deposit__qrcode">
+                <app-qrcode :text="state.qrContent" :width="240" />
+            </div>
+        </Dialog>
     </app-view>
 </template>
 
 <script lang="ts" setup>
 import { shallowRef, computed, reactive, onMounted } from 'vue'
-import { FormInstance,FieldRule, Form, Button, CellGroup, Field, Cell } from 'vant'
-import { fullloading } from '@/utils/vant'
+import { FormInstance, FieldRule, Form, Button, CellGroup, Field, Cell, ActionSheet, RadioGroup, Radio, Icon, showSuccessToast, showFailToast, Dialog, Empty } from 'vant'
+import { dialog, fullloading } from '@/utils/vant'
 import { formatDecimal } from '@/filters'
 import { getDigitalCurrencyList } from '@/constants/order'
 import { useRequest } from '@/hooks/request'
 import { queryWalletAddress, queryWalletTokens, createDigitalWalletAddress } from '@/services/api/digital'
 import { useNavigation } from '@mobile/router/navigation'
 import { useSpotAccountStore } from '../components/spot/composables'
+import AppQrcode from '@/components/base/qrcode/index.vue'
 import AppSelect from '@mobile/components/base/select/index.vue'
 
 const { getQueryStringToNumber } = useNavigation()
@@ -49,11 +91,14 @@ const spotAccountStore = useSpotAccountStore()
 const digitalCurrentyList = getDigitalCurrencyList()
 
 const state = reactive({
+    showSheet: false,
+    showDialog: false,
+    qrContent: '',
     currentyId: currencyId,
     tokenId: 0
 })
 
-const addressList = computed(() => walletAddress.value.filter((e) => e.token_id === tokenItem.value?.token_id))
+const addressList = computed(() => walletAddress.value.filter((e) => e.chain_id === tokenItem.value?.chain_id))
 
 const currentyItem = computed(() => digitalCurrentyList.find((e) => e.enumitemname === state.currentyId))
 
@@ -69,9 +114,7 @@ const balance = computed(() => {
     return formatDecimal(balance, accountItem.value?.currencydecimalplace)
 })
 
-const { dataList: walletAddress, run: getWalletAddress } = useRequest(queryWalletAddress, {
-    manual: true
-})
+const { dataList: walletAddress, run: getWalletAddress } = useRequest(queryWalletAddress)
 
 const { dataList: walletTokens, run: getWalletTokens } = useRequest(queryWalletTokens, {
     manual: true
@@ -101,32 +144,53 @@ const onCurrentyChange = () => {
     }
 }
 
+const onRadioClick = (value: number) => {
+    state.tokenId = value
+    state.showSheet = false
+}
+
+const openQRcode = (address: string) => {
+    state.qrContent = address
+    state.showDialog = true
+}
+
+const onCopy = (status: boolean) => {
+    if (status) {
+        showSuccessToast({ message: '已复制,快去粘贴吧~' })
+    } else {
+        showFailToast('复制失败')
+    }
+}
+
 const onSubmit = () => {
-    const { channel_code, chain_id, token_id } = tokenItem.value ?? {}
-
-    fullloading((hideLoading) => {
-        createDigitalWalletAddress({
-            data: {
-                DigitalAccountID: Number(accountItem.value?.digitalaccountid),
-                ChannelCode: channel_code,
-                ChainID: chain_id,
-                TokenID: token_id,
-                AddrType: 1
-            }
-        }).then(() => {
-            hideLoading('创建成功', 'success')
-        }).catch((err) => {
-            hideLoading(err, 'fail')
+    dialog({
+        message: '确认创建新地址吗?',
+        showCancelButton: true,
+    }).then(() => {
+        const { channel_code, chain_id } = tokenItem.value ?? {}
+
+        fullloading((hideLoading) => {
+            createDigitalWalletAddress({
+                data: {
+                    ChannelCode: channel_code,
+                    ChainID: chain_id,
+                    AddrType: 1
+                }
+            }).then(() => {
+                hideLoading('创建成功', 'success')
+                getWalletAddress()
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
         })
     })
 }
 
 onMounted(() => {
-    const digitalaccountid = accountItem.value?.digitalaccountid
-    if (digitalaccountid) {
-        getWalletAddress({ digitalaccountid })
-    }
-
     onCurrentyChange()
 })
-</script>
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 13 - 14
src/packages/digital/views/wallet/transfer/index.vue

@@ -1,6 +1,6 @@
 <!-- 钱包-划转 -->
 <template>
-    <app-view class="wallet-transfer g-layout g-form">
+    <app-view class="wallet-transfer g-form">
         <template #header>
             <app-navbar title="划转" />
         </template>
@@ -14,36 +14,35 @@
         </div>
         <Form ref="formRef" class="g-form__container" @submit="onSubmit">
             <CellGroup inset>
-                <Field name="CurrencyID" label="币种" :rules="formRules.CurrencyID" is-link>
+                <Field name="CurrencyID" label="币种" label-align="top" :rules="formRules.CurrencyID"
+                    arrow-direction="down" is-link>
                     <template #input>
                         <app-select v-model="formData.CurrencyID" :options="currencyOptions" />
                     </template>
                 </Field>
-                <Field name="Amount" label="数量" :rules="formRules.Amount">
+            </CellGroup>
+            <CellGroup inset>
+                <Cell title="数量"
+                    :value="`可用 (${formatDecimal(contractAccount?.avaiableBalance ?? 0, contractAccount?.currencydecimalplace)})`"
+                    v-if="formData.DigitalTransferType === 3" />
+                <Cell title="数量" :value="`可用 (${spotBalance})`" v-if="formData.DigitalTransferType === 4" />
+                <Field name="Amount" label-align="top" :rules="formRules.Amount">
                     <template #input>
                         <app-stepper v-model="formData.Amount" :min="0" />
                     </template>
                 </Field>
-                <Cell title="可用"
-                    :value="formatDecimal(contractAccount?.avaiableBalance ?? 0, contractAccount?.currencydecimalplace)"
-                    v-if="formData.DigitalTransferType === 3" />
-                <Cell title="可用" :value="spotBalance" v-if="formData.DigitalTransferType === 4" />
             </CellGroup>
         </Form>
-        <Row class="g-layout-block g-layout-block--inset" gutter="10">
-            <Col span="12">
+        <div class="g-form__footer inset">
             <Button block @click="routerBack">取消</Button>
-            </Col>
-            <Col span="12">
             <Button type="primary" block @click="formRef?.submit">划转</Button>
-            </Col>
-        </Row>
+        </div>
     </app-view>
 </template>
 
 <script lang="ts" setup>
 import { shallowRef, reactive, computed, onMounted } from 'vue'
-import { FormInstance, Form, Col, Row, Button, CellGroup, Field, Cell, FieldRule } from 'vant'
+import { FormInstance, Form, Button, CellGroup, Field, Cell, FieldRule } from 'vant'
 import { fullloading } from '@/utils/vant'
 import { formatDecimal } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'

+ 1 - 1
src/packages/mobile/components/base/stepper/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <Stepper :max="max" />
+    <Stepper :max="max" :button-size="32" />
 </template>
 
 <script lang="ts" setup>

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

@@ -128,6 +128,7 @@ export function digitalAccountTransferApply(config: RequestConfig<Partial<Proto.
 export function createDigitalWalletAddress(config: RequestConfig<Partial<Proto.CreateDigitalWalletAddressReq>>) {
     return http.mqRequest<Proto.CreateDigitalWalletAddressRsp>({
         data: {
+            UserID: getUserId(),
             SerialNumber: 0,
             ...config.data
         },
@@ -177,7 +178,10 @@ export function digitalAccountWithdrawApplyCancel(config: RequestConfig<Partial<
 export function queryWalletAddress(config: RequestConfig<Model.WalletAddressReq>) {
     return http.commonRequest<Model.WalletAddressRsp[]>({
         url: '/Wallet/QueryWalletAddress',
-        params: config.data,
+        params: {
+            userid: getUserId(),
+            ...config.data
+        }
     })
 }
 

+ 6 - 4
src/types/model/digital.d.ts

@@ -181,7 +181,10 @@ declare namespace Model {
 
     /** 查询钱包地址 请求 */
     interface WalletAddressReq {
-        digitalaccountid: string; // 数字账户ID
+        userid?: number; // 用户ID
+        channel_code?: string; // 渠道代码
+        addr_type?: number; // 地址类型:1-充值;2-提现
+        chain_id?: string; // 链代码
     }
 
     /** 查询钱包地址 响应 */
@@ -191,12 +194,11 @@ declare namespace Model {
         chain_id: string; // 链代码(如BTC,ETH)
         channel_code: string; // 渠道代码
         create_time: string; // 创建时间
-        digitalaccountid: number; // 数字账户ID
         id: number; // 地址ID
         memo: string; // 地址备注(某些链需要)
         status: number; // 状态:0-禁用;1-启用
-        token_id: string; // 代币ID(充值类型必填)
-        update_time: string; // 修改时间
+        tag: string; // 标签
+        userid: number; // 用户ID
     }
 
     /** 查询钱包链 请求 */

+ 4 - 4
src/types/proto/digital.d.ts

@@ -112,10 +112,10 @@ declare global {
         /** 创建数字钱包地址请求 */
         interface CreateDigitalWalletAddressReq {
             Header?: IMessageHead;
-            DigitalAccountID: number | Long; // 数字账户ID
+            UserID: number; // 用户ID
             ChannelCode: string; // 渠道代码
             ChainID: string; // 链ID
-            TokenID: string; // 代币ID(充值类型必填)
+            Tag?: string; // 标示
             AddrType?: number; // 地址类型:1-充值;2-提现
             Address?: string; // 地址(提现类型必填)
             Memo?: string; // 地址备注(某些链需要)
@@ -127,10 +127,10 @@ declare global {
             Header: IMessageHead;
             RetCode: number; // 返回码
             RetDesc: string; // 描述信息
-            DigitalAccountID: number; // 数字账户ID
+            UserID: number; // 用户ID
             ChannelCode: string; // 渠道代码
             ChainID: string; // 链ID
-            TokenID: string; // 代币ID(充值类型必填)
+            Tag: string; // 标示
             AddrType: number; // 地址类型:1-充值;2-提现
             Address: string; // 地址
             Memo: string; // 地址备注(某些链需要)