li.shaoyi 2 년 전
부모
커밋
10c5795deb

+ 1 - 2
src/packages/mobile/components/layouts/home/index.vue

@@ -55,6 +55,7 @@ const onTabClick = (index: number) => {
         currentTab.value = index
         routerTo(name, true)
       }).catch(() => {
+        cssTransition.value = true
         routerTo('user-login')
       }).finally(() => {
         hideLoading()
@@ -77,8 +78,6 @@ watch(() => route.name, () => {
   const params = getGlobalUrlParams()
   if (params.tabIndex > -1) {
     onTabClick(params.tabIndex)
-  } else if (tabIndex.value > -1) {
-    onTabClick(tabIndex.value)
   } else {
     // 如果参数不是 tabIndex ,需要保留到下一个路由
     setGlobalUrlParams(params)

+ 2 - 2
src/packages/mobile/router/animateRouter.ts

@@ -1,13 +1,13 @@
 import { ref, toRefs } from 'vue'
 import { createRouter, RouterOptions, RouteRecordRaw, RouteLocationNormalized } from 'vue-router'
 
-interface historyRoute {
+interface HistoryRoute {
     name: string;
     fullPath: string;
 }
 
 interface HistoryState {
-    historyRoutes: historyRoute[]; // 历史路由列表
+    historyRoutes: HistoryRoute[]; // 历史路由列表
     excludeViews: string[]; // 不缓存的视图
     actionName: '' | 'push' | 'replace' | 'forward' | 'back'; // 当前路由动作
     transitionName: '' | 'route-out' | 'route-in'; // 前进后退动画

+ 1 - 1
src/packages/mobile/router/navigation.ts

@@ -75,7 +75,7 @@ export function useNavigation() {
         const delta = state.historyRoutes.length - 1
         const params = { tabIndex: 0, isLogout }
 
-        if (delta) {
+        if (delta > 0) {
             setGlobalUrlParams(params)
             router.go(-delta)
         } else {

+ 1 - 1
src/packages/pc/views/footer/swap/position/close/index.vue

@@ -74,7 +74,7 @@ const error = shallowRef(false)
 const subscribe = quoteSocket.createSubscribe()
 const { holderCloseSubmit, formData } = useHolderClose()
 const futuresStore = useFuturesStore()
-const quote = futuresStore.getGoodsQuote(props.position.goodscode)
+const quote = futuresStore.getGoodsQuote(props.position.refgoodscode)
 const useStore = useUserStore()
 const { loading, pageIndex } = useRequest(queryTradeHolderDetail, {
     params: {

+ 13 - 9
src/stores/modules/account.ts

@@ -90,15 +90,19 @@ export const useAccountStore = defineStore(() => {
             // 计算风险率
             let hazardRatio = 0
 
-            // 根据系统参数“132 风险率计算公式”
-            const param132 = userStore.getSystemParamValue('132')
-
-            if (param132 === '1') {
-                // 风险率 = 占用 / 风险净值
-                hazardRatio = item.usedmargin / hazardValue
-            } else {
-                // 风险率 = (占用 - 授信金额) / (风险净值 - 授信金额)
-                hazardRatio = (item.usedmargin - item.mortgagecredit) / (hazardValue - item.mortgagecredit)
+            if (hazardValue < 0 || (hazardValue === 0 && item.usedmargin > 0)) {
+                hazardRatio = 100
+            }
+            if (hazardValue > 0 && item.usedmargin > 0) {
+                // 根据系统参数“132 风险率计算公式”
+                const param132 = userStore.getSystemParamValue('132')
+                if (param132 === '1') {
+                    // 风险率 = 占用 / 风险净值
+                    hazardRatio = item.usedmargin / hazardValue
+                } else {
+                    // 风险率 = (占用 - 授信金额) / (风险净值 - 授信金额)
+                    hazardRatio = (item.usedmargin - item.mortgagecredit) / (hazardValue - item.mortgagecredit)
+                }
             }
 
             // 风险率颜色