zhb 1 неделя назад
Родитель
Сommit
f2a10f1116
1 измененных файлов с 35 добавлено и 28 удалено
  1. 35 28
      pages/customer/components/AccountCard.vue

+ 35 - 28
pages/customer/components/AccountCard.vue

@@ -1,5 +1,5 @@
 <template>
-    <view class="col-lg-4 col-md-6" :class="noCtrl?'w100':''">
+    <view class="col-lg-4 col-md-6" :class="noCtrl ? 'w100' : ''">
         <view class="card">
             <view class="card-header d-flex align-items-center justify-content-between border-0 pb-2 p-3">
                 <uni-tooltip v-if="account.del == 1" placement="right">
@@ -12,7 +12,7 @@
                     </template>
                 </uni-tooltip>
                 <template v-if="account.del != 1">
-                    <view v-if="!isDel" class="badge bg-success-subtle text-success d-flex align-items-center" >
+                    <view v-if="!isDel" class="badge bg-success-subtle text-success d-flex align-items-center">
                         <!-- <cwg-icon name="crm-check" :size="13" :color="'#22B07E'" /> -->
                         <text v-t="'Blockchain.enabled'" />
                     </view>
@@ -85,20 +85,20 @@
                                 </view>
                             </view>
                         </view>
-                      <template v-if="!noCtrl">
-                        <view class="d-flex flex-wrap gap-2" v-if="isReal" >
-                          <button v-for="btn in actionButtons" :key="btn.key" type="submit" value="Submit"
-                                  class="btn btn-dark btn-sm waves-effect waves-light"
-                                  :class="{ 'disabled': btn.disabled, 'btn-outline-dark1': btn.key !== 'deposit' }"
-                                  @click="handleAction(btn.action)">
-                            <view class="d-flex align-items-center justify-content-center gap-1">
-                              <cwg-icon :name="btn.icon" :size="14"
-                                        :color="btn.key === 'deposit' ? '#fff' : ''" />
-                              {{ t(btn.label) }}
+                        <template v-if="!noCtrl">
+                            <view class="d-flex flex-wrap gap-2" v-if="isReal">
+                                <button v-for="btn in actionButtons" :key="btn.key" type="submit" value="Submit"
+                                    class="btn btn-dark btn-sm waves-effect waves-light"
+                                    :class="{ 'disabled': btn.disabled, 'btn-outline-dark1': btn.key !== 'deposit' }"
+                                    @click="handleAction(btn.action)">
+                                    <view class="d-flex align-items-center justify-content-center gap-1">
+                                        <cwg-icon :name="btn.icon" :size="14"
+                                            :color="btn.key === 'deposit' ? '#fff' : ''" />
+                                        {{ t(btn.label) }}
+                                    </view>
+                                </button>
                             </view>
-                          </button>
-                        </view>
-                      </template>
+                        </template>
                     </view>
                 </view>
             </view>
@@ -127,13 +127,15 @@ const globalStore = useGlobalStore()
 const isDark = computed(() => globalStore.theme === 'dark')
 const props = defineProps({
     account: {
-      type: Object,
+        type: Object,
     },
-  noCtrl: {
-      type: Boolean,
-    default: false,
-  }
+    noCtrl: {
+        type: Boolean,
+        default: false,
+    }
 });
+// console.log(props.account, 12121);
+
 const accountInfo = ref(props.account)
 export interface Account {
     labels: string[];          // 标签数组,如 ['真实', 'MT4', 'Standard']
@@ -163,6 +165,8 @@ const closeFunctionOpen = (code) => {
     if (closeFunctions == null || closeFunctions === "") {
         return true;
     }
+    console.log(closeFunctions, 12121,String(closeFunctions).indexOf(String(code)) === -1);
+
     return String(closeFunctions).indexOf(String(code)) === -1;
 }
 const circleButtons = ref([
@@ -170,7 +174,7 @@ const circleButtons = ref([
     { key: 'withdraw', label: 'Home.page_customer.item3', icon: 'crm-withdraw', action: 'withdraw', needDemo: isDemo.value, disabled: !closeFunctionOpen('2'), color: '#6c8595' },
     { key: 'transfer', label: 'Custom.Index.Transfer', icon: 'crm-transfer', action: 'transfer', needDemo: isDemo.value, disabled: !(closeFunctionOpen('5') && closeFunctionOpen('6') && closeFunctionOpen('3')), color: '#6c8595' }
 ])
-const fieldList = computed(()=>([
+const fieldList = computed(() => ([
     { label: t('Custom.PaymentHistory.AccountType'), key: 'nickname', copyable: false },
     { label: t('Label.Leverage'), key: 'actualLeverage', copyable: false },
     { label: t('Label.FloatingPL'), key: 'floatingPL', copyable: false },
@@ -182,10 +186,10 @@ const fieldList = computed(()=>([
 ]))
 const nickName = ref(accountInfo.value.nickName);
 
-const actionButtons = computed(()=>([
-    { key: 'deposit', label: 'Home.page_customer.item2', icon: 'crm-deposit', action: 'deposit', disabled: computed(() => !closeFunctionOpen('1')) },
-    { key: 'withdraw', label: 'Home.page_customer.item3', icon: 'crm-withdraw', action: 'withdraw', disabled: computed(() => !closeFunctionOpen('2')) },
-    { key: 'transfer', label: 'Custom.Index.Transfer', icon: 'crm-transfer', action: 'transfer', disabled: computed(() => !(closeFunctionOpen('5') && closeFunctionOpen('6') && closeFunctionOpen('3'))) }
+const actionButtons = computed(() => ([
+    { key: 'deposit', label: 'Home.page_customer.item2', icon: 'crm-deposit', action: 'deposit', disabled: !closeFunctionOpen('1') },
+    { key: 'withdraw', label: 'Home.page_customer.item3', icon: 'crm-withdraw', action: 'withdraw', disabled: !closeFunctionOpen('2') },
+    { key: 'transfer', label: 'Custom.Index.Transfer', icon: 'crm-transfer', action: 'transfer', disabled: !(closeFunctionOpen('5') && closeFunctionOpen('6') && closeFunctionOpen('3')) }
 ]))
 
 const terminalDialogVisible = ref(false)
@@ -317,7 +321,8 @@ onBeforeUnmount(() => {
 
 <style scoped lang="scss">
 @import '@/uni.scss';
-.cwg-close{
+
+.cwg-close {
     width: px2rpx(20);
     height: px2rpx(20);
     display: flex;
@@ -326,6 +331,7 @@ onBeforeUnmount(() => {
     border-radius: 50%;
     background-color: #F56C6C;
 }
+
 .btn.disabled {
     opacity: 0.5;
     cursor: not-allowed;
@@ -345,7 +351,8 @@ onBeforeUnmount(() => {
     color: var(--bs-emphasis-color) !important;
     border-color: var(--btn-color) !important;
 }
-.w100{
-  width: 100% !important;
+
+.w100 {
+    width: 100% !important;
 }
 </style>