|
|
@@ -2,7 +2,7 @@
|
|
|
<template>
|
|
|
<div class="spot-account">
|
|
|
<template v-for="(item, index) in spotAccountStore.dataList" :key="index">
|
|
|
- <div class="card" @click="onClick(item)">
|
|
|
+ <div class="card">
|
|
|
<div class="card-section">
|
|
|
<div class="card-section__image">
|
|
|
<app-image-icon :url="getCurrencyIconUrl(item.currencycode)" />
|
|
|
@@ -16,7 +16,7 @@
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="card-section">
|
|
|
+ <div class="card-section" @click="onClick(item)" v-if="item.digitalaccountid">
|
|
|
<div class="card-section__balance">
|
|
|
<span>
|
|
|
{{ t('digital.balance') + `(${item.currencycode})` }}
|
|
|
@@ -29,27 +29,49 @@
|
|
|
<Icon name="arrow" />
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="card-section" v-else>
|
|
|
+ <Button size="small" @click="activate(item)">
|
|
|
+ {{ t('digital.activation') }}
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { Icon } from 'vant'
|
|
|
-import { formatDecimal,getCurrencyIconUrl } from '@/filters'
|
|
|
+import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
+import { Button, Icon } from 'vant'
|
|
|
+import { formatDecimal, getCurrencyIconUrl } from '@/filters'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
import { getDigitalCurrencyName } from '@/constants/order'
|
|
|
import { useSpotAccountStore } from './composables'
|
|
|
import { i18n } from '@/stores'
|
|
|
import AppImageIcon from '@mobile/components/base/image-icon/index.vue'
|
|
|
|
|
|
const emit = defineEmits(['click'])
|
|
|
-const { global: { t } } = i18n
|
|
|
+
|
|
|
+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 { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
+
|
|
|
+// 激活
|
|
|
+const activate = (item: Model.TaaccountDigitalsRsp) => {
|
|
|
+ selectedRow.value = item
|
|
|
+ openComponent('Activate')
|
|
|
+}
|
|
|
|
|
|
const onClick = (item: Model.TaaccountDigitalsRsp) => {
|
|
|
emit('click', item.currencyid)
|
|
|
}
|
|
|
-
|
|
|
-const spotAccountStore = useSpotAccountStore()
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|