li.shaoyi 1 semana atrás
pai
commit
477ec19b64

+ 3 - 0
src/packages/digital/components/search/index.vue

@@ -3,6 +3,9 @@
         <template #left-icon>
             <img :src="'./img/icons/search.svg'" :title="t('digital.search')" />
         </template>
+        <template #right-icon>
+            <slot></slot>
+        </template>
     </Search>
 </template>
 

+ 27 - 5
src/packages/digital/views/search/index.vue

@@ -2,18 +2,40 @@
     <app-view>
         <app-navbar title="搜索">
             <template #footer>
-                <Form action="/">
-                    <app-search v-model="keyword" />
-                </Form>
+                <app-search v-model="keyword" autofocus @search="onSearch">
+                    <Button type="primary" size="small" @click="onSearch">搜索</Button>
+                </app-search>
             </template>
         </app-navbar>
+        <spot-account :params="searchParams" @click="navigateTo" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
-import { Form } from 'vant'
+import { reactive, shallowRef } from 'vue'
+import { Button } from 'vant'
+import { useNavigation } from '@mobile/router/navigation'
 import AppSearch from '@/packages/digital/components/search/index.vue'
+import SpotAccount from '../wallet/components/spot/index.vue'
+
+const { router } = useNavigation()
 
 const keyword = shallowRef('')
+
+const searchParams = reactive<Partial<Model.TaaccountDigitalsRsp>>({
+    currencycode: ''
+})
+
+const onSearch = () => {
+    searchParams.currencycode = keyword.value
+}
+
+const navigateTo = (currencyId: number) => {
+    router.push({
+        name: 'spot-detail',
+        query: {
+            id: currencyId
+        }
+    })
+}
 </script>

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

@@ -36,7 +36,7 @@
             </div>
         </app-block>
         <app-grid :items="gridItems" @click="() => navigateToSpotDetail()" />
-        <Tabs class="g-tabs" type="card" shrink>
+        <Tabs class="g-tabs" type="card" shrink v-if="digitalaccountid">
             <Tab :title="t('digital.wallet-deposit')">
                 <wallet-record :params="{ digitalaccountid, transfertypes: '1' }" />
             </Tab>
@@ -96,7 +96,7 @@ const isAmountVisible = shallowRef(true)
 
 const accountItem = computed(() => spotAccountStore.getAccountItem({ currencyid }))
 
-const digitalaccountid = computed(() => accountItem.value?.digitalaccountid || '0')
+const digitalaccountid = computed(() => accountItem.value?.digitalaccountid)
 
 const quotes = computed(() => futuresStore.quotationList.filter((e) => e.trademode === 80 && (e.goodscurrencyid === currencyid || e.currencyid === currencyid)))
 

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

@@ -31,11 +31,11 @@
                     <tr>
                         <td>
                             <span class="text-small">申请金额({{ getDigitalCurrencyName(item.currencyid) }})</span>
-                            <span>{{ item.applyamount }}</span>
+                            <span>{{ item.applyamount.toString() }}</span>
                         </td>
                         <td>
                             <span class="text-small">手续费({{ getDigitalCurrencyName(item.currencyid) }})</span>
-                            <span>{{ item.charge }}</span>
+                            <span>{{ item.charge.toString() }}</span>
                         </td>
                     </tr>
                 </tbody>

+ 22 - 5
src/packages/digital/views/wallet/components/spot/index.vue

@@ -1,7 +1,7 @@
 <!-- 现货-账户 -->
 <template>
     <app-block class="spot-account">
-        <template v-for="(item, index) in spotAccountStore.dataList" :key="index">
+        <template v-for="(item, index) in accountList" :key="index">
             <div class="card">
                 <div class="card-section">
                     <div class="card-section__image">
@@ -42,7 +42,7 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent } from 'vue'
+import { shallowRef, defineAsyncComponent, computed, PropType } from 'vue'
 import { Button, Icon } from 'vant'
 import { formatDecimal, getCurrencyIconUrl } from '@/filters'
 import { useComponent } from '@/hooks/component'
@@ -51,15 +51,32 @@ import { useSpotAccountStore } from './composables'
 import { i18n } from '@/stores'
 import AppImageIcon from '@mobile/components/base/image-icon/index.vue'
 
+const props = defineProps({
+    params: {
+        type: Object as PropType<Partial<Model.TaaccountDigitalsRsp>>
+    }
+})
+
+const componentMap = new Map<string, unknown>([
+    ['Activate', defineAsyncComponent(() => import('../../../spot/components/account/activate/index.vue'))], // 激活
+])
+
 const emit = defineEmits(['click'])
 
 const { t } = i18n.global
 const spotAccountStore = useSpotAccountStore()
 const selectedRow = shallowRef<Model.TaaccountDigitalsRsp>()
 
-const componentMap = new Map<string, unknown>([
-    ['Activate', defineAsyncComponent(() => import('../../../spot/components/account/activate/index.vue'))], // 激活
-])
+const accountList = computed(() => {
+    if (props.params) {
+        const { currencycode } = props.params
+        if (currencycode) {
+            return spotAccountStore.dataList.filter((e) => e.currencycode.toLowerCase().includes(currencycode.toLowerCase()))
+        }
+        return []
+    }
+    return spotAccountStore.dataList
+})
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent()