li.shaoyi 2 hafta önce
ebeveyn
işleme
1baf0e1f74

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

@@ -35,11 +35,11 @@
                     <td>{{ item.holderprice }}</td>
                 </tr>
                 <tr v-if="item.tpsl_tpflag">
-                    <td class="text-small">止盈价格</td>
+                    <td class="text-small">{{ `止盈价格(${currency(item.currencyid)})` }}</td>
                     <td>{{ formatDecimal(item.tpsl_tpprice, item.decimalplace) }}</td>
                 </tr>
                 <tr v-if="item.tpsl_slflag">
-                    <td class="text-small">止损价格</td>
+                    <td class="text-small">{{ `止损价格(${currency(item.currencyid)})` }}</td>
                     <td>{{ formatDecimal(item.tpsl_slprice, item.decimalplace) }}</td>
                 </tr>
                 <tr>

+ 29 - 7
src/packages/digital/views/wallet/components/spot/index.vue

@@ -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">