li.shaoyi 10 месяцев назад
Родитель
Сommit
1a39e99ca9

BIN
file/ios/CustomStoryborad.zip


+ 6 - 1
file/ios/config.txt

@@ -1,4 +1,9 @@
 1、实盘地址
    cfg:实盘地址: http://101.133.236.116:8280/cfg?key=mtp_20
    App Name: 铁合金掌上行
-   Bundle ID: com.dcloud.thjzsx
+   Bundle ID: com.dcloud.thjzsx
+
+1、实盘地址
+   cfg:实盘地址: http://47.128.190.111:8280/cfg?key=tss_sp
+   App Name: TCE
+   Bundle ID: com.dcloud.tce

BIN
file/ios/gstj_Profile.mobileprovision


BIN
file/ios/thjzsx_Aoc_Profile.mobileprovision


BIN
file/ios/ww.mobileprovision


BIN
file/ios/证书.p12


BIN
file/ios/证书_gstj.p12


+ 1 - 1
src/business/login/index.ts

@@ -2,7 +2,7 @@ import { shallowRef, reactive } from 'vue'
 import { v4 } from 'uuid'
 import { timerTask } from '@/utils/timer'
 import { wsLogin, httpLogin, queryLoginId } from '@/services/api/account'
-import { useGlobalStore, useLoginStore, useEnumStore, useErrorInfoStore, useUserStore, useFuturesStore, useAccountStore, useDeliveryRelationStore,useGoodsCollectionStore } from '@/stores'
+import { useGlobalStore, useLoginStore, useEnumStore, useErrorInfoStore, useUserStore, useFuturesStore, useAccountStore, useDeliveryRelationStore, useGoodsCollectionStore } from '@/stores'
 import service from '@/services'
 import quoteSocket from '@/services/websocket/quote'
 import tradeSocket from '@/services/websocket/trade'

+ 33 - 30
src/filters/index.ts

@@ -57,13 +57,16 @@ export function getNewsShareUrl(id: number | string = 0) {
  * @param text 
  * @returns 
  */
-export function formatHtmlString(text: string) {
-    const html = text.replace(/[\n\r]/g, '<br />')
-    return html.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, capture) => {
-        // 替换img标签src地址为绝对路径
-        const url = getUrl(capture)
-        return `<img src="${url.href}"  alt=""/>`
-    })
+export function formatHtmlString(text?: string) {
+    if (text) {
+        const html = text.toString().replace(/[\n\r]/g, '<br />')
+        return html.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, capture) => {
+            // 替换img标签src地址为绝对路径
+            const url = getUrl(capture)
+            return `<img src="${url.href}"  alt=""/>`
+        })
+    }
+    return ''
 }
 
 /**
@@ -173,12 +176,12 @@ export function round(value: number, precision = 2) {
  * @param exponent 
  * @returns 
  */
-export function pow(base:number, exponent:number) {  
-    let result = 1;  
-    for (let i = 0; i < Math.abs(exponent); i++) {  
+export function pow(base: number, exponent: number) {
+    let result = 1;
+    for (let i = 0; i < Math.abs(exponent); i++) {
         result *= base
-    }  
-    if (exponent < 0) {  
+    }
+    if (exponent < 0) {
         return 1 / result
     }
     return result
@@ -239,7 +242,7 @@ export function formatDate(value?: string, format = 'YYYY-MM-DD HH:mm:ss') {
  * @param format 
  * @returns 
  */
-export function displayname(item?: Model.Marketsectionconfignew ) {
+export function displayname(item?: Model.Marketsectionconfignew) {
     switch (i18n.global.locale) {
         case 'zh-CN':
             return item?.displayname ?? ''
@@ -269,10 +272,10 @@ export function diffDays(value?: string) {
  * @returns 
  */
 export function formatMsgDate(value?: string) {
-    if ( moment(value).isSame(moment(), "day") ) {
+    if (moment(value).isSame(moment(), "day")) {
         return formatDate(value, 'HH:mm:ss')
     } else if (moment(value).isSame(moment().subtract(1, 'day'), "day")) {
-        return formatDate(value, '昨日 '+'HH:mm:ss')
+        return formatDate(value, '昨日 ' + 'HH:mm:ss')
     } else {
         return formatDate(value, 'YYYY-MM-DDs')
     }
@@ -402,23 +405,23 @@ export function getIdCardAge(cardnum: string) {
 }
 
 // 金额转大写
-export function numberToChinese(num: undefined | string) {  
+export function numberToChinese(num: undefined | string) {
     /// 数据错误
-    if (num === null) { return ''  }
-    
+    if (num === null) { return '' }
+
     const chineseNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
     const unitSection = ['', '拾', '佰', '仟'];
     const bigSection = ['', '万', '亿'];
-  
+
     // 将金额转换为字符串并确保去除前导零
     let amountStr = String(num).replace(/^0*(\d+)/, '$1')
-  
+
     // 处理小数部分(可选)
     let decimalPart = ''
     if (amountStr.includes('.')) {
-      const parts = amountStr.split('.')
-      amountStr = parts[0]
-      decimalPart = '.' + parts[1].padEnd(2, '0') // 假设最多两位小数
+        const parts = amountStr.split('.')
+        amountStr = parts[0]
+        decimalPart = '.' + parts[1].padEnd(2, '0') // 假设最多两位小数
     }
 
     // 转换小数部分
@@ -431,17 +434,17 @@ export function numberToChinese(num: undefined | string) {
     // 遍历整数部分进行转换
     let result = '';
     for (let i = amountStr.length - 1; i >= 0; i--) {
-      result = chineseNums[parseInt(amountStr[i])] + unitSection[amountStr.length - 1 - i] + result
-      // 在万和亿的分隔处添加单位
-      if ((amountStr.length - i - 1) % 4 === 0 && i !== 0) {
-        result = bigSection[(amountStr.length - i - 1) / 4] + result
-      }
+        result = chineseNums[parseInt(amountStr[i])] + unitSection[amountStr.length - 1 - i] + result
+        // 在万和亿的分隔处添加单位
+        if ((amountStr.length - i - 1) % 4 === 0 && i !== 0) {
+            result = bigSection[(amountStr.length - i - 1) / 4] + result
+        }
     }
-  
+
     // 去除末尾的零
     result = result.replace(/零+$/, '零')
     // 添加分隔符“元”和小数部分的大写
     result = result.replace(/亿万/, '亿零') + '元' + decimalPart
 
     return result.trim()
-  }
+}

+ 4 - 3
src/packages/mobile/components/layouts/scroll-view/index.less

@@ -1,11 +1,12 @@
 .app-scroll-view {
-    height    : 100%;
+    height: 100%;
     overflow-y: auto;
+    overscroll-behavior: none;
 
     &__header {
         position: fixed;
-        top     : 0;
-        z-index : 1;
+        top: 0;
+        z-index: 1;
         width: 100%;
 
         &:empty {

+ 2 - 10
src/packages/tss/views/home/index.vue

@@ -14,10 +14,10 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, nextTick, watch, onMounted, onActivated, computed } from 'vue'
+import { shallowRef, nextTick, watch, onMounted, computed } from 'vue'
 import { Tabbar } from '@mobile/components/base/tabbar/types'
 import { useNavigation } from '@mobile/router/navigation'
-import { useLoginStore, useFuturesStore } from '@/stores'
+import { useLoginStore } from '@/stores'
 import { i18n } from '@/stores'
 import AppTabbar from '@mobile/components/base/tabbar/index.vue'
 import AppUpdater from '@mobile/components/base/updater/index.vue'
@@ -31,7 +31,6 @@ const { t } = i18n.global
 
 const { route, routerTo } = useNavigation()
 const loginStore = useLoginStore()
-const futuresStore = useFuturesStore()
 const cssTransition = shallowRef(true) // 是否使用css动画
 const currentTab = shallowRef(0)
 const marketSection = shallowRef() // 当前选中的板块
@@ -102,13 +101,6 @@ watch(() => route.name, () => {
 onMounted(() => {
   currentTab.value = tabIndex.value
 })
-
-onActivated(() => {
-  // 页面显示时刷新盘面(待优化)
-  if (loginStore.token && futuresStore.goodsList.length) {
-    futuresStore.getQuoteDay()
-  }
-})
 </script>
 
 <style lang="less">

+ 2 - 8
src/packages/tss/views/order/delivery/components/aftersale/Index.vue

@@ -1,18 +1,12 @@
 <!-- 交收提货-退换货 -->
 <template>
-    <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(documentcontent)" v-if="documentcontent" />
+    <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(commonStore.getDocumentById(104))" />
 </template>
 
 <script lang="ts" setup>
-import { useCommonStore } from '@/stores/modules/common';
-import { computed } from 'vue';
+import { useCommonStore } from '@/stores/modules/common'
 import HtmlContainer from '@mobile/components/base/html-container/index.vue'
 import { formatHtmlString } from '@/filters'
 
 const commonStore = useCommonStore()
-
-const documentcontent = computed(() => {
-    return commonStore.getDocumentById(104)?.documentcontent ?? ''
-})
-
 </script>

+ 2 - 8
src/packages/tss/views/rules/benefits/index.vue

@@ -4,20 +4,14 @@
         <template #header>
             <app-navbar :title="$t('tss.benefits')" />
         </template>
-        <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(documentcontent)" v-if="documentcontent" />
+        <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(commonStore.getDocumentById(101))" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { useCommonStore } from '@/stores/modules/common';
-import { computed } from 'vue';
+import { useCommonStore } from '@/stores/modules/common'
 import HtmlContainer from '@mobile/components/base/html-container/index.vue'
 import { formatHtmlString } from '@/filters'
 
 const commonStore = useCommonStore()
-
-const documentcontent = computed(() => {
-    return commonStore.getDocumentById(101)?.documentcontent ?? ''
-})
-
 </script>

+ 2 - 8
src/packages/tss/views/rules/fwrx/Index.vue

@@ -3,20 +3,14 @@
         <template #header>
             <app-navbar :title="$t('rules.fwrx')" />
         </template>
-        <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(documentcontent)" v-if="documentcontent" />
+        <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(commonStore.getDocumentById(1))" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { useCommonStore } from '@/stores/modules/common';
-import { computed } from 'vue';
+import { useCommonStore } from '@/stores/modules/common'
 import HtmlContainer from '@mobile/components/base/html-container/index.vue'
 import { formatHtmlString } from '@/filters'
 
 const commonStore = useCommonStore()
-
-const documentcontent = computed(() => {
-    return commonStore.getDocumentById(1)?.documentcontent ?? ''
-})
-
 </script>

+ 2 - 8
src/packages/tss/views/rules/gywm/Index.vue

@@ -3,20 +3,14 @@
         <template #header>
             <app-navbar :title="$t('routes.about')" />
         </template>
-        <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(documentcontent)" v-if="documentcontent" />
+        <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(commonStore.getDocumentById(2))" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { useCommonStore } from '@/stores/modules/common';
-import { computed } from 'vue';
+import { useCommonStore } from '@/stores/modules/common'
 import HtmlContainer from '@mobile/components/base/html-container/index.vue'
 import { formatHtmlString } from '@/filters'
 
 const commonStore = useCommonStore()
-
-const documentcontent = computed(() => {
-    return commonStore.getDocumentById(2)?.documentcontent ?? ''
-})
-
 </script>

+ 2 - 8
src/packages/tss/views/rules/logistics/index.vue

@@ -4,20 +4,14 @@
         <template #header>
             <app-navbar :title="$t('tss.logistics')" />
         </template>
-        <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(documentcontent)" v-if="documentcontent" />
+        <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(commonStore.getDocumentById(103))" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { useCommonStore } from '@/stores/modules/common';
-import { computed } from 'vue';
+import { useCommonStore } from '@/stores/modules/common'
 import HtmlContainer from '@mobile/components/base/html-container/index.vue'
 import { formatHtmlString } from '@/filters'
 
 const commonStore = useCommonStore()
-
-const documentcontent = computed(() => {
-    return commonStore.getDocumentById(103)?.documentcontent ?? ''
-})
-
 </script>

+ 2 - 8
src/packages/tss/views/rules/malls/index.vue

@@ -4,20 +4,14 @@
         <template #header>
             <app-navbar :title="$t('tss.malls')" />
         </template>
-        <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(documentcontent)" v-if="documentcontent" />
+        <HtmlContainer style="padding: 15px;" class="content" :context="formatHtmlString(commonStore.getDocumentById(102))" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { useCommonStore } from '@/stores/modules/common';
-import { computed } from 'vue';
+import { useCommonStore } from '@/stores/modules/common'
 import HtmlContainer from '@mobile/components/base/html-container/index.vue'
 import { formatHtmlString } from '@/filters'
 
 const commonStore = useCommonStore()
-
-const documentcontent = computed(() => {
-    return commonStore.getDocumentById(102)?.documentcontent ?? ''
-})
-
 </script>

+ 10 - 5
src/stores/modules/common.ts

@@ -29,14 +29,19 @@ export const useCommonStore = defineStore(() => {
     }))
 
     // 根据商品 ID 查找对应的商品信息
-    const getDocumentById = (id: number) => documents.value.find((e) => e.documenttype === id)
+    const getDocumentById = (id: number) => {
+        const documnet = documents.value.find((e) => e.documenttype === id)
+        return documnet?.documentcontent
+    }
 
     // 获取商品集合列表
     const fetcheDocuments = async () => {
         try {
-            state.loading = true
-            const res = await getClientDocumnetConfigs()
-            state.documents = res.data
+            if (!state.loading) {
+                state.loading = true
+                const res = await getClientDocumnetConfigs()
+                state.documents = res.data
+            }
         } finally {
             state.loading = false
         }
@@ -45,7 +50,7 @@ export const useCommonStore = defineStore(() => {
     return {
         ...toRefs(state),
         fetcheDocuments,
-        documents, 
+        documents,
         getDocumentById
     }
 })

+ 10 - 10
src/stores/modules/futures.ts

@@ -3,7 +3,6 @@ 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'
@@ -82,15 +81,16 @@ export const useFuturesStore = defineStore(() => {
         state.quotationList = []
         timerTask.clearTimeout('quoteDay')
 
-        const accountStore = useAccountStore()
-        // 任务 #5511
-        const { data: accountConfig } = await getTodayAccountConfigInfo()
+        const { currentAccountId, currentAccountConfig } = useAccountStore()
+        const { todayAccountMargins = [], todayAccountTradeRules = [], todayAccountTradefees = [] } = currentAccountConfig ?? {}
+
         // 任务 #5197
         const { data: limitConfig } = await queryMemberGoodsLimitConfig({
             data: {
                 roletype: 7
             }
         })
+        
         const { data: goodsList } = await queryErmcpGoods()
 
         for (let i = 0; i < goodsList.length; i++) {
@@ -102,8 +102,8 @@ export const useFuturesStore = defineStore(() => {
                 continue
             }
             // 更新商品配置
-            const findMargin = accountConfig.todayAccountMargins.find((e) => e.accountid === accountStore.currentAccountId && e.goodsid === item.goodsid)
-            const margin = findMargin ?? accountConfig.todayAccountMargins.find((e) => e.accountid === 0 && e.goodsid === item.goodsid)
+            const findMargin = todayAccountMargins.find((e) => e.accountid === currentAccountId && e.goodsid === item.goodsid)
+            const margin = findMargin ?? todayAccountMargins.find((e) => e.accountid === 0 && e.goodsid === item.goodsid)
             if (margin) {
                 const marginWordArray = CryptoJS.enc.Base64.parse(margin.infocontent) // 解析base64
                 const marginUint8Array = wordArrayToUint8Array(marginWordArray)
@@ -112,8 +112,8 @@ export const useFuturesStore = defineStore(() => {
                 item.marketmarginvalue = marginData.MarketMarginValue
             }
 
-            const findRule = accountConfig.todayAccountTradeRules.find((e) => e.accountid === accountStore.currentAccountId && e.goodsid === item.goodsid)
-            const rule = findRule ?? accountConfig.todayAccountTradeRules.find((e) => e.accountid === 0 && e.goodsid === item.goodsid)
+            const findRule = todayAccountTradeRules.find((e) => e.accountid === currentAccountId && e.goodsid === item.goodsid)
+            const rule = findRule ?? todayAccountTradeRules.find((e) => e.accountid === 0 && e.goodsid === item.goodsid)
             if (rule) {
                 const ruleWordArray = CryptoJS.enc.Base64.parse(rule.infocontent) // 解析base64
                 const ruleUint8Array = wordArrayToUint8Array(ruleWordArray)
@@ -124,8 +124,8 @@ export const useFuturesStore = defineStore(() => {
             }
 
             // 交易费用
-            const findfee = accountConfig.todayAccountTradefees.find((e) => e.accountid === accountStore.currentAccountId && e.goodsid === item.goodsid)
-            const fee = findfee ?? accountConfig.todayAccountTradefees.find((e) => e.accountid === 0 && e.goodsid === item.goodsid && e.tradetype === 1)
+            const findfee = todayAccountTradefees.find((e) => e.accountid === currentAccountId && e.goodsid === item.goodsid)
+            const fee = findfee ?? todayAccountTradefees.find((e) => e.accountid === 0 && e.goodsid === item.goodsid && e.tradetype === 1)
             if (fee) {
                 const ruleWordArray = CryptoJS.enc.Base64.parse(fee.infocontent) // 解析base64
                 const ruleUint8Array = wordArrayToUint8Array(ruleWordArray)

+ 5 - 3
src/stores/modules/goodscollection.ts

@@ -33,9 +33,11 @@ export const useGoodsCollectionStore = defineStore(() => {
     // 获取商品集合列表
     const fetchGoodsCollections = async () => {
         try {
-            state.loading = true
-            const res = await getTCEGoodsCollections()
-            state.goodsCollections = res.data.filter((e) => e.collectionstatus === 1 && e.configs.length != 0)
+            if (!state.loading) {
+                state.loading = true
+                const res = await getTCEGoodsCollections()
+                state.goodsCollections = res.data.filter((e) => e.collectionstatus === 1 && e.configs.length != 0)
+            }
         } finally {
             state.loading = false
         }

+ 1 - 1
src/types/model/user.d.ts

@@ -167,7 +167,7 @@ declare namespace Model {
 
     /** 获取资金账户今日配置信息 响应 */
     interface TodayAccountConfigInfoRsp {
-        riskRatioType: RiskRatioType;
+        riskRatioType: Partial<RiskRatioType>;
         todayAccountMargins: TodayAccountMargin[]; // 今日账户保证金表
         todayAccountTradeRules: TodayAccountTradeRule[]; // 今日账户交易规则信表
         todayAccountTradefees: TodayAccountTradefee[]; // 今日账户交易费用表