Handy_Cao 2 jaren geleden
bovenliggende
commit
fc9f6df493
1 gewijzigde bestanden met toevoegingen van 12 en 15 verwijderingen
  1. 12 15
      src/packages/tjmd/views/mine/Index.vue

+ 12 - 15
src/packages/tjmd/views/mine/Index.vue

@@ -133,8 +133,6 @@ import eventBus from '@/services/bus'
 import Iconfont from '@/components/base/iconfont/index.vue'
 import { getMemberUserId } from '@/services/methods/user'
 import { queryMdUserSwapProtocol } from '@/services/api/swap'
-import { getUserId } from '@/services/methods/user'
-import { useRequest } from '@/hooks/request'
 
 const { router, routerTo } = useNavigation()
 const loginStore = useLoginStore()
@@ -142,22 +140,11 @@ const userStore = useUserStore()
 const positionStore = usePositionStore()
 const accountStore = useAccountStore()
 const { currentAccount } = accountStore.$toRefs()
-
+/// 判断是否能签约
+const canBankSign = shallowRef(false) 
 const headerRef = shallowRef<HTMLDivElement>()
 const authStatus = computed(() => userStore.userAccount.hasauth) // 实名认证状态
 
-/// 查询用户掉期协议签署表
-const { dataList: protocolList} = useRequest(queryMdUserSwapProtocol, {
-    params: {
-        userId: getUserId()
-    }
-})
-
-/// 判断是否能签约
-const canBankSign = computed(() => {
-    return protocolList.value.some(e => { return e.protocolstatus === 4 })
-})
-
 const onReady = (el: HTMLDivElement) => {
     // 设置背景图位置
     headerRef.value?.style.setProperty('background-position', `0 -${el.clientHeight}px`)
@@ -223,6 +210,16 @@ onActivated(() => {
         userStore.getUserData()
     }
     accountStore.getAccountList()
+
+    /// 查询数据
+    queryMdUserSwapProtocol({
+        data: {
+            userId: loginStore.userId
+        }
+    }).then((res) => {
+        /// 判断是否能签约
+        canBankSign.value = res.data.some(e => e.protocolstatus === 4 )
+    })
 })
 
 onMounted(() => {