li.shaoyi 2 vuotta sitten
vanhempi
commit
a4758b8c6f
34 muutettua tiedostoa jossa 643 lisäystä ja 333 poistoa
  1. 27 7
      src/packages/gcszt/assets/themes/global/global.less
  2. 33 12
      src/packages/gcszt/views/mine/Index.vue
  3. 16 17
      src/packages/gcszt/views/mine/index.less
  4. 27 7
      src/packages/gstj/assets/themes/global/global.less
  5. 3 1
      src/packages/gstj/views/mine/Index.vue
  6. 27 7
      src/packages/mobile/assets/themes/global/global.less
  7. 6 4
      src/packages/mobile/views/goods/detail/components/listing/Index.vue
  8. 1 1
      src/packages/mobile/views/market/list/Index.vue
  9. 3 1
      src/packages/mobile/views/mine/Index.vue
  10. 2 2
      src/packages/pc/views/market/trade/goods/list/index.vue
  11. 6 4
      src/packages/pc/views/market/trade/goods/list/listing/index.vue
  12. 2 2
      src/packages/pc/views/market/trade/market/index.vue
  13. 2 2
      src/packages/pc/views/market/trade/presell/transfer/index.vue
  14. 1 1
      src/packages/pc/views/market/trade/presell/transfer/listing/index.vue
  15. 1 1
      src/packages/pc/views/market/trade/swap/index.vue
  16. 27 7
      src/packages/qdhs/assets/themes/global/global.less
  17. 33 12
      src/packages/qdhs/views/mine/Index.vue
  18. 16 17
      src/packages/qdhs/views/mine/index.less
  19. 27 7
      src/packages/qxst/assets/themes/global/global.less
  20. 33 12
      src/packages/qxst/views/mine/Index.vue
  21. 16 17
      src/packages/qxst/views/mine/index.less
  22. 28 4
      src/packages/sbyj/assets/themes/global/global.less
  23. 1 1
      src/packages/sbyj/views/market/list/index.vue
  24. 16 17
      src/packages/sbyj/views/mine/index.less
  25. 33 12
      src/packages/sbyj/views/mine/index.vue
  26. 27 7
      src/packages/tc/assets/themes/global/global.less
  27. 33 12
      src/packages/tc/views/mine/Index.vue
  28. 16 17
      src/packages/tc/views/mine/index.less
  29. 27 7
      src/packages/tjmd/assets/themes/global/global.less
  30. 3 1
      src/packages/tjmd/views/mine/Index.vue
  31. 27 7
      src/packages/zrwyt/assets/themes/global/global.less
  32. 3 1
      src/packages/zrwyt/views/mine/Index.vue
  33. 32 34
      src/stores/modules/account.ts
  34. 88 72
      src/stores/modules/futures.ts

+ 27 - 7
src/packages/gcszt/assets/themes/global/global.less

@@ -15,16 +15,36 @@
     }
 }
 
-.g-price-up {
-    color: #ff3333;
-}
+.g-price {
+    &-normal {
+        color: #333333;
+    }
+
+    &-up {
+        color: #ff3333;
+    }
 
-.g-price-normal {
-    color: #333333;
+    &-down {
+        color: #0baf1f;
+    }
 }
 
-.g-price-down {
-    color: #0baf1f;
+.g-risk {
+    &-green {
+        color: #0baf1f;
+    }
+
+    &-red {
+        color: #ff3333;
+    }
+
+    &-orange {
+        color: orange;
+    }
+
+    &-yellow {
+        color: yellow;
+    }
 }
 
 .g-form {

+ 33 - 12
src/packages/gcszt/views/mine/Index.vue

@@ -26,18 +26,38 @@
                     </div>
                 </div>
                 <div class="bank">
-                    <div class="bank-item">
-                        <span>余额</span>
-                        <span>{{ currentAccount.currentbalance?.toFixed(2) ?? '0.00' }}</span>
-                    </div>
-                    <div class="bank-item">
-                        <span>预扣</span>
-                        <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
-                    </div>
-                    <div class="bank-item">
-                        <span>可用</span>
-                        <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
-                    </div>
+                    <ul>
+                        <li>
+                            <span>余额</span>
+                            <span>{{ currentAccount.currentbalance?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>净值</span>
+                            <span>{{ currentAccount.hazardValue?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>预扣</span>
+                            <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>占用</span>
+                            <span>{{ currentAccount.usedmargin?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>可用</span>
+                            <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>风险率</span>
+                            <span :class="currentAccount.hazardRatioColor">
+                                {{ parsePercent(currentAccount.hazardRatio) }}
+                            </span>
+                        </li>
+                    </ul>
                 </div>
                 <div class="button">
                     <Button type="danger" size="small" round @click="doInOutMoney('0')">入金</Button>
@@ -114,6 +134,7 @@
 import { shallowRef, onMounted, onActivated, computed } from 'vue'
 import { Cell, CellGroup, Button, Icon } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
+import { parsePercent } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
 import { AuthStatus } from '@/constants/account'
 import { queryBankAccountSign } from '@/services/api/bank'

+ 16 - 17
src/packages/gcszt/views/mine/index.less

@@ -99,29 +99,28 @@
         .bank {
             display: flex;
             justify-content: space-around;
-            padding: .48rem 0;
+            padding: .36rem 0;
 
-            &-item {
-                display: flex;
-                flex-direction: column;
+            ul {
+                li {
+                    display: flex;
+                    flex-direction: column;
+                    padding-bottom: .1rem;
 
-                span {
-                    line-height: .4rem;
+                    span {
+                        line-height: .4rem;
 
-                    &:first-child {
-                        font-size: .24rem;
-                        color: #A1B1C5;
-                    }
+                        &:first-child {
+                            font-size: .24rem;
+                            color: #A1B1C5;
+                        }
 
-                    &:last-child {
-                        font-size: .3rem;
-                        font-weight: bold;
+                        &:last-child {
+                            font-size: .3rem;
+                            font-weight: bold;
+                        }
                     }
                 }
-
-                a {
-                    color: #00577C;
-                }
             }
         }
 

+ 27 - 7
src/packages/gstj/assets/themes/global/global.less

@@ -15,16 +15,36 @@
     }
 }
 
-.g-price-up {
-    color: #ff3333;
-}
+.g-price {
+    &-normal {
+        color: #333333;
+    }
+
+    &-up {
+        color: #ff3333;
+    }
 
-.g-price-normal {
-    color: #333333;
+    &-down {
+        color: #0baf1f;
+    }
 }
 
-.g-price-down {
-    color: #0baf1f;
+.g-risk {
+    &-green {
+        color: #0baf1f;
+    }
+
+    &-red {
+        color: #ff3333;
+    }
+
+    &-orange {
+        color: orange;
+    }
+
+    &-yellow {
+        color: yellow;
+    }
 }
 
 .g-form {

+ 3 - 1
src/packages/gstj/views/mine/Index.vue

@@ -53,7 +53,9 @@
                         </li>
                         <li>
                             <span>风险率</span>
-                            <span>{{ parsePercent(currentAccount.hazardRatio) }}</span>
+                            <span :class="currentAccount.hazardRatioColor">
+                                {{ parsePercent(currentAccount.hazardRatio) }}
+                            </span>
                         </li>
                     </ul>
                 </div>

+ 27 - 7
src/packages/mobile/assets/themes/global/global.less

@@ -15,16 +15,36 @@
     }
 }
 
-.g-price-up {
-    color: #ff3333;
-}
+.g-price {
+    &-normal {
+        color: #333333;
+    }
+
+    &-up {
+        color: #ff3333;
+    }
 
-.g-price-normal {
-    color: #333333;
+    &-down {
+        color: #0baf1f;
+    }
 }
 
-.g-price-down {
-    color: #0baf1f;
+.g-risk {
+    &-green {
+        color: #0baf1f;
+    }
+
+    &-red {
+        color: #ff3333;
+    }
+
+    &-orange {
+        color: orange;
+    }
+
+    &-yellow {
+        color: yellow;
+    }
 }
 
 .g-form {

+ 6 - 4
src/packages/mobile/views/goods/detail/components/listing/Index.vue

@@ -138,12 +138,14 @@ const total = computed(() => {
 
     if (fixed && ratio) {
         if (marketmarginalgorithm === 1) {
-            result.deposit = (formData.OrderQty ?? 0) * ratio || 0
-            result.enableQty = Math.trunc(avaiableMoney / ratio) || 0
+            const qty = Math.trunc(avaiableMoney / ratio)
+            result.deposit = (formData.OrderQty ?? 0) * ratio
+            result.enableQty = qty > 0 ? qty : 0
         }
         if (marketmarginalgorithm === 2) {
-            result.deposit = (formData.OrderQty ?? 0) * fixed || 0
-            result.enableQty = Math.trunc(avaiableMoney / fixed) || 0
+            const qty = Math.trunc(avaiableMoney / fixed)
+            result.deposit = (formData.OrderQty ?? 0) * fixed
+            result.enableQty = qty > 0 ? qty : 0
         }
     }
     return result

+ 1 - 1
src/packages/mobile/views/market/list/Index.vue

@@ -64,7 +64,7 @@ const { router } = useNavigation()
 const futuresStore = useFuturesStore()
 
 const dataList = computed(() => {
-    const list = futuresStore.goodsQuoteList.filter((e) => e.marketid === 99201)
+    const list = futuresStore.quotationList.filter((e) => e.marketid === 99201)
     return list.map((e) => ({
         goodsname: e.goodsname,
         goodscode: e.goodscode,

+ 3 - 1
src/packages/mobile/views/mine/Index.vue

@@ -53,7 +53,9 @@
                         </li>
                         <li>
                             <span>风险率</span>
-                            <span>{{ parsePercent(currentAccount.hazardRatio) }}</span>
+                            <span :class="currentAccount.hazardRatioColor">
+                                {{ parsePercent(currentAccount.hazardRatio) }}
+                            </span>
                         </li>
                     </ul>
                 </div>

+ 2 - 2
src/packages/pc/views/market/trade/goods/list/index.vue

@@ -83,7 +83,7 @@ const props = defineProps({
 
 const subscribe = quoteSocket.createSubscribe()
 const globalStore = useGlobalStore()
-const { setMarketId, onResponse, $toRefs } = useFuturesStore()
+const { setMarketId, onDataCompleted, $toRefs } = useFuturesStore()
 const { marketGoodsList, selectedGoodsId } = $toRefs()
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => true, false)
@@ -113,7 +113,7 @@ const onRowClick = (row: Model.GoodsQuote) => {
     openComponent('detail')
 }
 
-onResponse(() => {
+onDataCompleted(() => {
     const goodsCodes = marketGoodsList.value.map((e) => e.goodscode)
     subscribe.start(...goodsCodes)
 })

+ 6 - 4
src/packages/pc/views/market/trade/goods/list/listing/index.vue

@@ -133,12 +133,14 @@ const total = computed(() => {
 
     if (fixed && ratio) {
         if (marketmarginalgorithm === 1) {
-            result.deposit = (formData.OrderQty ?? 0) * ratio || 0
-            result.enableQty = Math.trunc(avaiableMoney / ratio) || 0
+            const qty = Math.trunc(avaiableMoney / ratio)
+            result.deposit = (formData.OrderQty ?? 0) * ratio
+            result.enableQty = qty > 0 ? qty : 0
         }
         if (marketmarginalgorithm === 2) {
-            result.deposit = (formData.OrderQty ?? 0) * fixed || 0
-            result.enableQty = Math.trunc(avaiableMoney / fixed) || 0
+            const qty = Math.trunc(avaiableMoney / fixed)
+            result.deposit = (formData.OrderQty ?? 0) * fixed
+            result.enableQty = qty > 0 ? qty : 0
         }
     }
     return result

+ 2 - 2
src/packages/pc/views/market/trade/market/index.vue

@@ -54,7 +54,7 @@ import AppTable from '@pc/components/base/table/index.vue'
 
 const subscribe = quoteSocket.createSubscribe()
 const globalStore = useGlobalStore()
-const { setMarketId, onResponse, $toRefs } = useFuturesStore()
+const { setMarketId, onDataCompleted, $toRefs } = useFuturesStore()
 const { marketGoodsList, selectedGoodsId } = $toRefs()
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => true, false)
@@ -83,7 +83,7 @@ const onRowClick = (row: Model.GoodsQuote) => {
     openComponent('detail')
 }
 
-onResponse(() => {
+onDataCompleted(() => {
     const goodsCodes = marketGoodsList.value.map((e) => e.goodscode)
     subscribe.start(...goodsCodes)
 })

+ 2 - 2
src/packages/pc/views/market/trade/presell/transfer/index.vue

@@ -83,7 +83,7 @@ const componentMap = new Map<string, unknown>([
 
 const subscribe = quoteSocket.createSubscribe()
 const globalStore = useGlobalStore()
-const { setMarketId, onResponse, $toRefs } = useFuturesStore()
+const { setMarketId, onDataCompleted, $toRefs } = useFuturesStore()
 const { marketGoodsList, selectedGoodsId } = $toRefs()
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => true, false)
@@ -113,7 +113,7 @@ const onRowClick = (row: Model.GoodsQuote) => {
     openComponent('detail')
 }
 
-onResponse(() => {
+onDataCompleted(() => {
     const goodsCodes = marketGoodsList.value.map((e) => e.goodscode)
     subscribe.start(...goodsCodes)
 })

+ 1 - 1
src/packages/pc/views/market/trade/presell/transfer/listing/index.vue

@@ -247,7 +247,7 @@ const getOrderPrice = () => {
 }
 
 // 商品初始化完成后执行
-futuresStore.onResponse(() => {
+futuresStore.onDataCompleted(() => {
     onGoodsChange()
 })
 

+ 1 - 1
src/packages/pc/views/market/trade/swap/index.vue

@@ -131,7 +131,7 @@ const onRowClick = (row: Model.QuoteGoodsListRsp) => {
     }
 }
 
-futuresStore.onResponse(() => run())
+futuresStore.onDataCompleted(() => run())
 
 onUnmounted(() => subscribe.stop())
 </script>

+ 27 - 7
src/packages/qdhs/assets/themes/global/global.less

@@ -15,16 +15,36 @@
     }
 }
 
-.g-price-up {
-    color: #ff3333;
-}
+.g-price {
+    &-normal {
+        color: #333333;
+    }
+
+    &-up {
+        color: #ff3333;
+    }
 
-.g-price-normal {
-    color: #333333;
+    &-down {
+        color: #0baf1f;
+    }
 }
 
-.g-price-down {
-    color: #0baf1f;
+.g-risk {
+    &-green {
+        color: #0baf1f;
+    }
+
+    &-red {
+        color: #ff3333;
+    }
+
+    &-orange {
+        color: orange;
+    }
+
+    &-yellow {
+        color: yellow;
+    }
 }
 
 .g-form {

+ 33 - 12
src/packages/qdhs/views/mine/Index.vue

@@ -26,18 +26,38 @@
                     </div>
                 </div>
                 <div class="bank">
-                    <div class="bank-item">
-                        <span>余额</span>
-                        <span>{{ currentAccount.currentbalance?.toFixed(2) ?? '0.00' }}</span>
-                    </div>
-                    <div class="bank-item">
-                        <span>预扣</span>
-                        <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
-                    </div>
-                    <div class="bank-item">
-                        <span>可用</span>
-                        <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
-                    </div>
+                    <ul>
+                        <li>
+                            <span>余额</span>
+                            <span>{{ currentAccount.currentbalance?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>净值</span>
+                            <span>{{ currentAccount.hazardValue?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>预扣</span>
+                            <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>占用</span>
+                            <span>{{ currentAccount.usedmargin?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>可用</span>
+                            <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>风险率</span>
+                            <span :class="currentAccount.hazardRatioColor">
+                                {{ parsePercent(currentAccount.hazardRatio) }}
+                            </span>
+                        </li>
+                    </ul>
                 </div>
                 <div class="button">
                     <Button type="danger" size="small" round @click="doInOutMoney('0')">入金</Button>
@@ -117,6 +137,7 @@
 import { shallowRef, onMounted, onActivated, computed } from 'vue'
 import { Cell, CellGroup, Button, Icon } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
+import { parsePercent } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
 import { AuthStatus } from '@/constants/account'
 import { queryBankAccountSign } from '@/services/api/bank'

+ 16 - 17
src/packages/qdhs/views/mine/index.less

@@ -99,29 +99,28 @@
         .bank {
             display: flex;
             justify-content: space-around;
-            padding: .48rem 0;
+            padding: .36rem 0;
 
-            &-item {
-                display: flex;
-                flex-direction: column;
+            ul {
+                li {
+                    display: flex;
+                    flex-direction: column;
+                    padding-bottom: .1rem;
 
-                span {
-                    line-height: .4rem;
+                    span {
+                        line-height: .4rem;
 
-                    &:first-child {
-                        font-size: .24rem;
-                        color: #A1B1C5;
-                    }
+                        &:first-child {
+                            font-size: .24rem;
+                            color: #A1B1C5;
+                        }
 
-                    &:last-child {
-                        font-size: .3rem;
-                        font-weight: bold;
+                        &:last-child {
+                            font-size: .3rem;
+                            font-weight: bold;
+                        }
                     }
                 }
-
-                a {
-                    color: #00577C;
-                }
             }
         }
 

+ 27 - 7
src/packages/qxst/assets/themes/global/global.less

@@ -15,16 +15,36 @@
     }
 }
 
-.g-price-up {
-    color: #ff3333;
-}
+.g-price {
+    &-normal {
+        color: #333333;
+    }
+
+    &-up {
+        color: #ff3333;
+    }
 
-.g-price-normal {
-    color: #333333;
+    &-down {
+        color: #0baf1f;
+    }
 }
 
-.g-price-down {
-    color: #0baf1f;
+.g-risk {
+    &-green {
+        color: #0baf1f;
+    }
+
+    &-red {
+        color: #ff3333;
+    }
+
+    &-orange {
+        color: orange;
+    }
+
+    &-yellow {
+        color: yellow;
+    }
 }
 
 .g-form {

+ 33 - 12
src/packages/qxst/views/mine/Index.vue

@@ -26,18 +26,38 @@
                     </div>
                 </div>
                 <div class="bank">
-                    <div class="bank-item">
-                        <span>余额</span>
-                        <span>{{ currentAccount.currentbalance?.toFixed(2) ?? '0.00' }}</span>
-                    </div>
-                    <div class="bank-item">
-                        <span>预扣</span>
-                        <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
-                    </div>
-                    <div class="bank-item">
-                        <span>可用</span>
-                        <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
-                    </div>
+                    <ul>
+                        <li>
+                            <span>余额</span>
+                            <span>{{ currentAccount.currentbalance?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>净值</span>
+                            <span>{{ currentAccount.hazardValue?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>预扣</span>
+                            <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>占用</span>
+                            <span>{{ currentAccount.usedmargin?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>可用</span>
+                            <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>风险率</span>
+                            <span :class="currentAccount.hazardRatioColor">
+                                {{ parsePercent(currentAccount.hazardRatio) }}
+                            </span>
+                        </li>
+                    </ul>
                 </div>
                 <div class="button">
                     <Button type="danger" size="small" round @click="doInOutMoney('0')">入金</Button>
@@ -114,6 +134,7 @@
 import { shallowRef, onMounted, onActivated, computed } from 'vue'
 import { Cell, CellGroup, Button, Icon } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
+import { parsePercent } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
 import { AuthStatus } from '@/constants/account'
 import { queryBankAccountSign } from '@/services/api/bank'

+ 16 - 17
src/packages/qxst/views/mine/index.less

@@ -99,29 +99,28 @@
         .bank {
             display: flex;
             justify-content: space-around;
-            padding: .48rem 0;
+            padding: .36rem 0;
 
-            &-item {
-                display: flex;
-                flex-direction: column;
+            ul {
+                li {
+                    display: flex;
+                    flex-direction: column;
+                    padding-bottom: .1rem;
 
-                span {
-                    line-height: .4rem;
+                    span {
+                        line-height: .4rem;
 
-                    &:first-child {
-                        font-size: .24rem;
-                        color: #A1B1C5;
-                    }
+                        &:first-child {
+                            font-size: .24rem;
+                            color: #A1B1C5;
+                        }
 
-                    &:last-child {
-                        font-size: .3rem;
-                        font-weight: bold;
+                        &:last-child {
+                            font-size: .3rem;
+                            font-weight: bold;
+                        }
                     }
                 }
-
-                a {
-                    color: #00577C;
-                }
             }
         }
 

+ 28 - 4
src/packages/sbyj/assets/themes/global/global.less

@@ -15,12 +15,36 @@
     }
 }
 
-.g-price-up {
-    color: #ff3333;
+.g-price {
+    &-normal {
+        color: #333333;
+    }
+
+    &-up {
+        color: #ff3333;
+    }
+
+    &-down {
+        color: #0baf1f;
+    }
 }
 
-.g-price-down {
-    color: #0baf1f;
+.g-risk {
+    &-green {
+        color: #0baf1f;
+    }
+
+    &-red {
+        color: #ff3333;
+    }
+
+    &-orange {
+        color: orange;
+    }
+
+    &-yellow {
+        color: yellow;
+    }
 }
 
 .g-form {

+ 1 - 1
src/packages/sbyj/views/market/list/index.vue

@@ -80,7 +80,7 @@ const { run: getTouristQuoteDay } = useRequest(queryTouristQuoteDay, {
     onSuccess: (res) => {
         res.data.forEach((item) => {
             subscribeData.push(item.goodscode)
-            futuresStore.updateGoodsQuote(item)
+            futuresStore.updateQuotation(item)
         })
         subscribe.start(...subscribeData)
     }

+ 16 - 17
src/packages/sbyj/views/mine/index.less

@@ -99,29 +99,28 @@
         .bank {
             display: flex;
             justify-content: space-around;
-            padding: .48rem 0;
+            padding: .36rem 0;
 
-            &-item {
-                display: flex;
-                flex-direction: column;
+            ul {
+                li {
+                    display: flex;
+                    flex-direction: column;
+                    padding-bottom: .1rem;
 
-                span {
-                    line-height: .4rem;
+                    span {
+                        line-height: .4rem;
 
-                    &:first-child {
-                        font-size: .24rem;
-                        color: #A1B1C5;
-                    }
+                        &:first-child {
+                            font-size: .24rem;
+                            color: #A1B1C5;
+                        }
 
-                    &:last-child {
-                        font-size: .3rem;
-                        font-weight: bold;
+                        &:last-child {
+                            font-size: .3rem;
+                            font-weight: bold;
+                        }
                     }
                 }
-
-                a {
-                    color: #00577C;
-                }
             }
         }
 

+ 33 - 12
src/packages/sbyj/views/mine/index.vue

@@ -26,18 +26,38 @@
                     </div>
                 </div>
                 <div class="bank">
-                    <div class="bank-item">
-                        <span>余额</span>
-                        <span>{{ currentAccount.currentbalance?.toFixed(2) ?? '0.00' }}</span>
-                    </div>
-                    <div class="bank-item">
-                        <span>预扣</span>
-                        <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
-                    </div>
-                    <div class="bank-item">
-                        <span>可用</span>
-                        <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
-                    </div>
+                    <ul>
+                        <li>
+                            <span>余额</span>
+                            <span>{{ currentAccount.currentbalance?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>净值</span>
+                            <span>{{ currentAccount.hazardValue?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>预扣</span>
+                            <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>占用</span>
+                            <span>{{ currentAccount.usedmargin?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>可用</span>
+                            <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>风险率</span>
+                            <span :class="currentAccount.hazardRatioColor">
+                                {{ parsePercent(currentAccount.hazardRatio) }}
+                            </span>
+                        </li>
+                    </ul>
                 </div>
                 <div class="button">
                     <Button type="danger" size="small" round @click="doInOutMoney('0')">入金</Button>
@@ -122,6 +142,7 @@
 import { shallowRef, onActivated, computed } from 'vue'
 import { Cell, CellGroup, Button, Icon } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
+import { parsePercent } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
 import { AuthStatus } from '@/constants/account'
 import { queryBankAccountSign } from '@/services/api/bank'

+ 27 - 7
src/packages/tc/assets/themes/global/global.less

@@ -15,16 +15,36 @@
     }
 }
 
-.g-price-up {
-    color: #ff3333;
-}
+.g-price {
+    &-normal {
+        color: #333333;
+    }
+
+    &-up {
+        color: #ff3333;
+    }
 
-.g-price-normal {
-    color: #333333;
+    &-down {
+        color: #0baf1f;
+    }
 }
 
-.g-price-down {
-    color: #0baf1f;
+.g-risk {
+    &-green {
+        color: #0baf1f;
+    }
+
+    &-red {
+        color: #ff3333;
+    }
+
+    &-orange {
+        color: orange;
+    }
+
+    &-yellow {
+        color: yellow;
+    }
 }
 
 .g-form {

+ 33 - 12
src/packages/tc/views/mine/Index.vue

@@ -26,18 +26,38 @@
                     </div>
                 </div>
                 <div class="bank">
-                    <div class="bank-item">
-                        <span>余额</span>
-                        <span>{{ currentAccount.currentbalance?.toFixed(2) ?? '0.00' }}</span>
-                    </div>
-                    <div class="bank-item">
-                        <span>预扣</span>
-                        <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
-                    </div>
-                    <div class="bank-item">
-                        <span>可用</span>
-                        <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
-                    </div>
+                    <ul>
+                        <li>
+                            <span>余额</span>
+                            <span>{{ currentAccount.currentbalance?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>净值</span>
+                            <span>{{ currentAccount.hazardValue?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>预扣</span>
+                            <span>{{ currentAccount.freezeMargin?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>占用</span>
+                            <span>{{ currentAccount.usedmargin?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>可用</span>
+                            <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>风险率</span>
+                            <span :class="currentAccount.hazardRatioColor">
+                                {{ parsePercent(currentAccount.hazardRatio) }}
+                            </span>
+                        </li>
+                    </ul>
                 </div>
                 <div class="button">
                     <Button type="danger" size="small" round @click="doInOutMoney('0')">入金</Button>
@@ -120,6 +140,7 @@
 import { shallowRef, onMounted, onActivated, computed } from 'vue'
 import { Cell, CellGroup, Button, Icon } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
+import { parsePercent } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
 import { AuthStatus } from '@/constants/account'
 import { queryBankAccountSign } from '@/services/api/bank'

+ 16 - 17
src/packages/tc/views/mine/index.less

@@ -99,29 +99,28 @@
         .bank {
             display: flex;
             justify-content: space-around;
-            padding: .48rem 0;
+            padding: .36rem 0;
 
-            &-item {
-                display: flex;
-                flex-direction: column;
+            ul {
+                li {
+                    display: flex;
+                    flex-direction: column;
+                    padding-bottom: .1rem;
 
-                span {
-                    line-height: .4rem;
+                    span {
+                        line-height: .4rem;
 
-                    &:first-child {
-                        font-size: .24rem;
-                        color: #A1B1C5;
-                    }
+                        &:first-child {
+                            font-size: .24rem;
+                            color: #A1B1C5;
+                        }
 
-                    &:last-child {
-                        font-size: .3rem;
-                        font-weight: bold;
+                        &:last-child {
+                            font-size: .3rem;
+                            font-weight: bold;
+                        }
                     }
                 }
-
-                a {
-                    color: #00577C;
-                }
             }
         }
 

+ 27 - 7
src/packages/tjmd/assets/themes/global/global.less

@@ -15,16 +15,36 @@
     }
 }
 
-.g-price-up {
-    color: #ff3333;
-}
+.g-price {
+    &-normal {
+        color: #333333;
+    }
+
+    &-up {
+        color: #ff3333;
+    }
 
-.g-price-normal {
-    color: #333333;
+    &-down {
+        color: #0baf1f;
+    }
 }
 
-.g-price-down {
-    color: #0baf1f;
+.g-risk {
+    &-green {
+        color: #0baf1f;
+    }
+
+    &-red {
+        color: #ff3333;
+    }
+
+    &-orange {
+        color: orange;
+    }
+
+    &-yellow {
+        color: yellow;
+    }
 }
 
 .g-form {

+ 3 - 1
src/packages/tjmd/views/mine/Index.vue

@@ -53,7 +53,9 @@
                         </li>
                         <li>
                             <span>风险率</span>
-                            <span>{{ parsePercent(currentAccount.hazardRatio) }}</span>
+                            <span :class="currentAccount.hazardRatioColor">
+                                {{ parsePercent(currentAccount.hazardRatio) }}
+                            </span>
                         </li>
                     </ul>
                 </div>

+ 27 - 7
src/packages/zrwyt/assets/themes/global/global.less

@@ -15,16 +15,36 @@
     }
 }
 
-.g-price-up {
-    color: #ff3333;
-}
+.g-price {
+    &-normal {
+        color: #333333;
+    }
+
+    &-up {
+        color: #ff3333;
+    }
 
-.g-price-normal {
-    color: #333333;
+    &-down {
+        color: #0baf1f;
+    }
 }
 
-.g-price-down {
-    color: #0baf1f;
+.g-risk {
+    &-green {
+        color: #0baf1f;
+    }
+
+    &-red {
+        color: #ff3333;
+    }
+
+    &-orange {
+        color: orange;
+    }
+
+    &-yellow {
+        color: yellow;
+    }
 }
 
 .g-form {

+ 3 - 1
src/packages/zrwyt/views/mine/Index.vue

@@ -53,7 +53,9 @@
                         </li>
                         <li>
                             <span>风险率</span>
-                            <span>{{ parsePercent(currentAccount.hazardRatio) }}</span>
+                            <span :class="currentAccount.hazardRatioColor">
+                                {{ parsePercent(currentAccount.hazardRatio) }}
+                            </span>
                         </li>
                     </ul>
                 </div>

+ 32 - 34
src/stores/modules/account.ts

@@ -1,13 +1,10 @@
-import { toRefs, computed, reactive, shallowRef } from 'vue'
+import { toRefs, computed, reactive } from 'vue'
 import { queryTaAccounts, getTodayAccountConfigInfo } from '@/services/api/account'
 import { defineStore } from '../store'
 import { useLoginStore } from './login'
 import { useUserStore } from './user'
 import { usePositionStore } from './position'
-import { wordArrayToUint8Array } from '@/services/websocket/package/crypto'
-import { decodeProto } from '@/services/websocket/package/package50/proto'
 import eventBus from '@/services/bus'
-import CryptoJS from 'crypto-js'
 
 /**
  * 账号存储对象
@@ -18,18 +15,20 @@ export const useAccountStore = defineStore(() => {
     const userStore = useUserStore()
     const positionStore = usePositionStore()
 
-    const state = reactive({
+    const state = reactive<{
+        loading: boolean;
+        accountList: Model.TaAccountsRsp[];
+        currentAccountId: number;
+        currentAccountConfig?: Model.TodayAccountConfigInfoRsp;
+    }>({
         loading: false,
-        accountList: <Model.TaAccountsRsp[]>[],
+        accountList: [],
         currentAccountId: 0
     })
 
-    // 资金账户今日配置信息
-    const accountConfig = shallowRef<Model.TodayAccountConfigInfoRsp>()
-
     // 资金账户计算列表
     const accountComputedList = computed(() => {
-        const { riskRatioType } = accountConfig.value ?? {}
+        const { riskRatioType } = state.currentAccountConfig ?? {}
         const { addmarginriskratio = 0, notemarginriskratio = 0, cutriskratio = 0 } = riskRatioType ?? {}
 
         const result: (Model.TaAccountsRsp & {
@@ -156,10 +155,10 @@ export const useAccountStore = defineStore(() => {
                 state.currentAccountId = data[0]?.accountid ?? 0
             }
 
-            // 获取资金账户今日配置信息
-            if (!accountConfig.value) {
+            // 任务 #5511
+            if (!state.currentAccountConfig) {
                 getTodayAccountConfigInfo().then((res) => {
-                    accountConfig.value = res.data
+                    state.currentAccountConfig = res.data
                 })
             }
         } finally {
@@ -168,25 +167,25 @@ export const useAccountStore = defineStore(() => {
     }
 
     // 获取账户商品配置
-    const getAccountGoodsConfig = (goodsId: number) => {
-        const config = accountConfig.value?.todayAccountMargins.find((item, index, self) => {
-            // 优先返回账户的商品配置
-            if (item.accountid === state.currentAccountId && item.goodsid === goodsId) {
-                return true
-            }
-            // 返回通用的商品配置
-            if (!self.some((e) => e.accountid === state.currentAccountId) && item.goodsid === goodsId) {
-                return true
-            }
-            return false
-        })
-        if (config) {
-            const wordArray = CryptoJS.enc.Base64.parse(config.infocontent) // 解析base64
-            const uint8Array = wordArrayToUint8Array(wordArray)
-            return decodeProto<Proto.MarginInfoStruct>('MarginInfoStruct', uint8Array) // proto数据解析
-        }
-        return Promise.reject('商品配置不存在')
-    }
+    // const getAccountGoodsConfig = (goodsId: number) => {
+    //     const config = state.currentAccountConfig?.todayAccountMargins.find((item, index, self) => {
+    //         // 优先返回账户的商品配置
+    //         if (item.accountid === state.currentAccountId && item.goodsid === goodsId) {
+    //             return true
+    //         }
+    //         // 返回通用的商品配置
+    //         if (!self.some((e) => e.accountid === state.currentAccountId) && item.goodsid === goodsId) {
+    //             return true
+    //         }
+    //         return false
+    //     })
+    //     if (config) {
+    //         const wordArray = CryptoJS.enc.Base64.parse(config.infocontent) // 解析base64
+    //         const uint8Array = wordArrayToUint8Array(wordArray)
+    //         return decodeProto<Proto.MarginInfoStruct>('MarginInfoStruct', uint8Array) // proto数据解析
+    //     }
+    //     return Promise.reject('商品配置不存在')
+    // }
 
     // 接收资金变动通知
     const moneyChangedNotify = eventBus.$on('MoneyChangedNotify', () => getAccountList())
@@ -196,7 +195,6 @@ export const useAccountStore = defineStore(() => {
         accountComputedList,
         currentAccount,
         moneyChangedNotify,
-        getAccountList,
-        getAccountGoodsConfig,
+        getAccountList
     }
 })

+ 88 - 72
src/stores/modules/futures.ts

@@ -1,10 +1,14 @@
 import { shallowRef, reactive, computed, toRefs, onUnmounted } from 'vue'
 import { v4 } from 'uuid'
+import { timerTask } from '@/utils/timer'
 import { handlePriceColor } from '@/filters'
 import { queryMemberGoodsLimitConfig } from '@/services/api/common'
+import { getTodayAccountConfigInfo } from '@/services/api/account'
 import { queryErmcpGoods, queryQuoteDay } from '@/services/api/goods'
+import { wordArrayToUint8Array } from '@/services/websocket/package/crypto'
+import { decodeProto } from '@/services/websocket/package/package50/proto'
 import { defineStore } from '../store'
-import { timerTask } from '@/utils/timer'
+import CryptoJS from 'crypto-js'
 import eventBus from '@/services/bus'
 import moment from 'moment'
 
@@ -21,31 +25,31 @@ export const useFuturesStore = defineStore(() => {
     // 请求商品列表成功后的回调集合
     // 由于异步请求原因,页面发起行情订阅时商品数据可能还不存在
     // 将回调事件收集到合集中,待请求成功后再执行
-    const rsponseTask = new Set<() => void>()
+    const dataCompletedCallback = new Set<() => void>()
 
     const state = reactive({
         loading: false,
         goodsList: <(Model.GoodsRsp & Partial<Model.MemberGoodsLimitConfigRsp>)[]>[], // 商品列表
-        goodsQuoteList: <Model.GoodsQuote[]>[], // 商品行情列表
+        quotationList: <Model.GoodsQuote[]>[], // 行情列表
         selectedGoodsId: <number | undefined>undefined, // 当前选中的商品ID
     })
 
     // 指定市场ID的商品列表
     const marketGoodsList = computed(() => {
-        const list = state.goodsQuoteList.filter((e) => marketIds.value.includes(e.marketid))
+        const list = state.quotationList.filter((e) => marketIds.value.includes(e.marketid))
         return list.sort((a, b) => a.goodscode.localeCompare(b.goodscode)) // 根据 goodscode 字母升序排序
     })
 
     // 当前选中的商品
-    const selectedGoods = computed(() => state.goodsQuoteList.find((e) => e.goodsid === state.selectedGoodsId))
+    const selectedGoods = computed(() => state.quotationList.find((e) => e.goodsid === state.selectedGoodsId))
 
-    // 请求响应成功后触发
-    const onResponse = (callback: () => void) => {
-        if (state.goodsQuoteList.length) {
+    // 商品数据加载完成后触发
+    const onDataCompleted = (callback: () => void) => {
+        if (state.quotationList.length) {
             setTimeout(() => callback(), 0)
         } else {
-            rsponseTask.add(callback)
-            onUnmounted(() => rsponseTask.delete(callback))
+            dataCompletedCallback.add(callback)
+            onUnmounted(() => dataCompletedCallback.delete(callback))
         }
     }
 
@@ -64,81 +68,93 @@ export const useFuturesStore = defineStore(() => {
     }
 
     const getGoodsListByMarketId = (...marketId: number[]) => {
-        const list = state.goodsQuoteList.filter((e) => marketId.includes(e.marketid))
+        const list = state.quotationList.filter((e) => marketId.includes(e.marketid))
         return list.sort((a, b) => a.goodscode.localeCompare(b.goodscode)) // 根据 goodscode 字母升序排序
     }
 
     const getGoodsListByTradeMode = (...tradeMode: number[]) => {
-        const list = state.goodsQuoteList.filter((e) => tradeMode.includes(e.trademode))
+        const list = state.quotationList.filter((e) => tradeMode.includes(e.trademode))
         return list.sort((a, b) => a.goodscode.localeCompare(b.goodscode)) // 根据 goodscode 字母升序排序
     }
 
     // 获取商品列表
-    const getGoodsList = () => {
+    const getGoodsList = async () => {
         state.loading = true
         state.goodsList = []
-        state.goodsQuoteList = []
+        state.quotationList = []
         timerTask.clearTimeout('quoteDay')
+
+        // 任务 #5511
+        const { data: accountConfig } = await getTodayAccountConfigInfo()
         // 任务 #5197
-        queryMemberGoodsLimitConfig({
+        const { data: limitConfig } = await queryMemberGoodsLimitConfig({
             data: {
                 roletype: 7
             }
-        }).then((cfg) => {
-            queryErmcpGoods().then((res) => {
-                state.goodsList = res.data.reduce<(Model.GoodsRsp & Partial<Model.MemberGoodsLimitConfigRsp>)[]>((pre, cur) => {
-                    const item = cfg.data.find((e) => e.goodsid === cur.goodsid)
-                    // 跳过不显示的商品
-                    if (item && item.isnodisplay) {
-                        return pre
-                    }
-                    // 组合商品属性
-                    pre.push({
-                        ...cur,
-                        iscannotbuy: item?.iscannotbuy ?? 0,
-                        iscannotsell: item?.iscannotsell ?? 0
-                    })
-                    return pre
-                }, [])
-
-                const codes = res.data.map((e) => e.goodscode)
-                if (codes.length) {
-                    getQuoteDay(codes)
-                }
-            })
         })
-        // 获取商品盘面信息
-        const getQuoteDay = (codes: string[]) => {
-            queryQuoteDay({
-                data: {
-                    goodsCodes: codes.join(',')
-                }
-            }).then((res) => {
-                // 只遍历有盘面的商品
-                // res.data.forEach((item) => {
-                //     updateGoodsQuote(item)
-                // })
-                // 遍历所有商品
-                codes.forEach((goodscode) => {
-                    const item = res.data.find((e) => e.goodscode === goodscode)
-                    updateGoodsQuote(item ?? { goodscode })
-                })
-                rsponseTask.forEach((fn) => fn())
-                rsponseTask.clear()
-            }).finally(() => {
-                state.loading = false
-                if (!state.selectedGoodsId) {
-                    state.selectedGoodsId = marketGoodsList.value[0]?.goodsid
-                }
-                // 每5分钟获取一次盘面
-                timerTask.setTimeout(() => getQuoteDay(codes), 5 * 60 * 1000, 'quoteDay')
+        const { data: goodsList } = await queryErmcpGoods()
+
+        for (let i = 0; i < goodsList.length; i++) {
+            const item = goodsList[i]
+            const limit = limitConfig.find((e) => e.goodsid === item.goodsid)
+            // 跳过不显示的商品
+            if (limit?.isnodisplay) {
+                continue
+            }
+            // 更新商品配置
+            const config = accountConfig.todayAccountMargins.find((e) => e.accountid === 0 && e.goodsid === item.goodsid)
+            if (config) {
+                const wordArray = CryptoJS.enc.Base64.parse(config.infocontent) // 解析base64
+                const uint8Array = wordArrayToUint8Array(wordArray)
+                const res = await decodeProto<Proto.MarginInfoStruct>('MarginInfoStruct', uint8Array) // proto数据解析
+                item.marketmarginalgorithm = res.MarginAlgorithm
+                item.marketmarginvalue = res.MarketMarginValue
+            }
+            // 组合商品属性
+            state.goodsList.push({
+                ...item,
+                iscannotbuy: limit?.iscannotbuy ?? 0,
+                iscannotsell: limit?.iscannotsell ?? 0
             })
         }
+
+        getQuoteDay()
+    }
+
+    // 获取商品盘面信息
+    const getQuoteDay = () => {
+        const values = state.goodsList.map((e) => e.goodscode.toString())
+        queryQuoteDay({
+            data: {
+                goodsCodes: values.join(',')
+            }
+        }).then((res) => {
+            // 只遍历有盘面的商品
+            // res.data.forEach((item) => {
+            //     updateQuotation(item)
+            // })
+
+            // 遍历所有商品
+            values.forEach((goodscode) => {
+                const item = res.data.find((e) => e.goodscode === goodscode)
+                updateQuotation(item ?? { goodscode })
+            })
+
+            dataCompletedCallback.forEach((callback) => callback())
+            dataCompletedCallback.clear()
+        }).finally(() => {
+            state.loading = false
+            if (!state.selectedGoodsId) {
+                state.selectedGoodsId = marketGoodsList.value[0]?.goodsid
+            }
+            // 每5分钟获取一次盘面
+            timerTask.setTimeout(() => getQuoteDay(), 5 * 60 * 1000, 'quoteDay')
+        })
     }
 
     // 通过 goodscode 获取实时盘面
     const getGoodsQuote = (code: string | number) => {
-        return computed(() => state.goodsQuoteList.find((e) => e.goodscode === code || e.goodsid === code))
+        return computed(() => state.quotationList.find((e) => e.goodscode === code || e.goodsid === code))
     }
 
     // 通过 goodscode 获取实时行情报价
@@ -204,10 +220,10 @@ export const useFuturesStore = defineStore(() => {
         }
     }
 
-    // 更新商品行情数据
-    const updateGoodsQuote = (quote: Partial<Model.QuoteDayRsp>) => {
+    // 更新行情数据
+    const updateQuotation = (quote: Partial<Model.QuoteDayRsp>) => {
         // 查找对应的商品行情
-        const item: Model.GoodsQuote = state.goodsQuoteList.find((e) => e.goodscode === quote.goodscode) ?? {
+        const item: Model.GoodsQuote = state.quotationList.find((e) => e.goodscode === quote.goodscode) ?? {
             goodsid: 0,
             goodscode: quote.goodscode ?? '',
             goodsname: '',
@@ -319,7 +335,7 @@ export const useFuturesStore = defineStore(() => {
                 item.iscannotsell = goods.iscannotsell ?? 0
 
                 // 向列表添加新数据
-                state.goodsQuoteList.push(item)
+                state.quotationList.push(item)
             }
         }
 
@@ -363,7 +379,7 @@ export const useFuturesStore = defineStore(() => {
     }
 
     // 处理行情数据
-    const handleQuote = (quote: Proto.Quote): Partial<Model.QuoteDayRsp> => {
+    const handleQuotation = (quote: Proto.Quote): Partial<Model.QuoteDayRsp> => {
         const goods = state.goodsList.find((e) => e.goodscode.toUpperCase() === quote.goodscode?.toUpperCase())
         // 处理报价小数位
         const handleDeimalplace = (value?: number) => {
@@ -430,9 +446,9 @@ export const useFuturesStore = defineStore(() => {
     const quotePushNotify = eventBus.$on('QuotePushNotify', (res) => {
         const data = res as Proto.Quote[]
         data.forEach((item) => {
-            const quote = handleQuote(item)
+            const quote = handleQuotation(item)
             if (!state.loading) {
-                updateGoodsQuote(quote)
+                updateQuotation(quote)
             }
             // 触发行情监听事件
             for (const e of quoteWatchMap.values()) {
@@ -447,7 +463,7 @@ export const useFuturesStore = defineStore(() => {
         ...toRefs(state),
         marketGoodsList,
         selectedGoods,
-        onResponse,
+        onDataCompleted,
         setMarketId,
         getQuotePrice,
         getGoodsList,
@@ -456,7 +472,7 @@ export const useFuturesStore = defineStore(() => {
         getGoodsMarket,
         getGoodsListByMarketId,
         getGoodsListByTradeMode,
-        updateGoodsQuote,
+        updateQuotation,
         quoteWatch,
         quotePushNotify,
         getGoods