li.shaoyi 1 year ago
parent
commit
c5e5aee6e4

+ 19 - 1
src/constants/order.ts

@@ -1,6 +1,6 @@
 import { useEnumStore, i18n } from '@/stores'
 
-const { getEnumTypeList, getEnumTypeName, getEnumTypeBankMappedValue} = useEnumStore()
+const { getEnumTypeList, getEnumTypeName, getEnumTypeBankMappedValue } = useEnumStore()
 
 /**
  * 买卖方向
@@ -603,4 +603,22 @@ export function getCurrencyList() {
 export function getCurrencyName(value: number) {
     const enums = getCurrencyList()
     return getEnumTypeBankMappedValue(enums, value)
+}
+
+/**
+ * 获取币种符号列表
+ * @returns 
+ */
+export function getGoodsCurrencyList() {
+    return getEnumTypeList('goodscurrency', ['param2'])
+}
+
+/**
+ * 获取币种符号名称
+ * @returns 
+ */
+export function getGoodsCurrencyName(value: number) {
+    const enums = getGoodsCurrencyList()
+    console.log(enums)
+    return getEnumTypeName(enums, value)
 }

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

@@ -103,8 +103,7 @@ onMounted(() => {
     // 获取游客商品列表
     queryTouristGoods({
       data: {
-        trademodes: '53',
-        marketids: '53201'
+        trademodes: '10,53'
       }
     }).then((res) => {
       if (res.data.length) {

+ 3 - 3
src/packages/tss/views/product/list/components/waterfall-list/index.vue

@@ -22,7 +22,7 @@ import { PropType } from 'vue'
 import { Image } from 'vant'
 import { formatDecimal, getFileUrl, handleNumberValue } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
-import { BuyOrSell, BuildType, getCurrencyName } from '@/constants/order'
+import { BuyOrSell, BuildType, getGoodsCurrencyName } from '@/constants/order'
 import Waterfall from '@mobile/components/base/waterfall/index.vue'
 import { useFuturesStore } from '@/stores'
 
@@ -38,8 +38,8 @@ const futureStore = useFuturesStore()
 
 // 商品价格
 const price = (item: Model.TCEGoodsCollectionRsp) => {
-    const { ask = 0, decimalplace = 2, currencyid = 1 } = futureStore.getGoodsQuote(item.defaultgoodsid).value ?? {}
-    return getCurrencyName(currencyid) + handleNumberValue(formatDecimal(ask, decimalplace))
+    const { ask = 0, decimalplace = 2, currencyid = 0 } = futureStore.getGoodsQuote(item.defaultgoodsid).value ?? {}
+    return getGoodsCurrencyName(currencyid) + handleNumberValue(formatDecimal(ask, decimalplace))
 }
 
 const rowClick = (row: Model.TCEGoodsCollectionRsp) => {

+ 6 - 6
src/packages/tss/views/search/index.vue

@@ -2,8 +2,8 @@
     <app-view class="search">
         <template #header>
             <app-navbar>
-                <Search v-model="keyword" shape="round" background="transparent" :placeholder="$t('tss.tips1')" autofocus
-                    @search="onSearch" />
+                <Search v-model="keyword" shape="round" background="transparent" :placeholder="$t('tss.tips1')"
+                    autofocus @search="onSearch" />
             </app-navbar>
             <ProductList :data-list="searchList" v-if="searchList.length" />
             <Empty :description="$t('common.nodatas')" v-else />
@@ -14,17 +14,17 @@
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
 import { Search, Empty } from 'vant'
-import { useFuturesStore } from '@/stores'
+import { useGoodsCollectionStore } from '@/stores'
 import ProductList from '../product/list/components/waterfall-list/index.vue'
 
-const futuresStore = useFuturesStore()
+const goodsCollectionStore = useGoodsCollectionStore()
 const keyword = shallowRef('')
 
-const searchList = shallowRef<Model.GoodsQuote[]>([])
+const searchList = shallowRef<Model.TCEGoodsCollectionRsp[]>([])
 
 const onSearch = () => {
     if (keyword.value) {
-        const result = futuresStore.quotationList.filter((e) => [53201, 10101].includes(e.marketid) && e.goodscode.toLowerCase().includes(keyword.value.toLowerCase()))
+        const result = goodsCollectionStore.collections.filter((e) => e.collectionname.toLowerCase().includes(keyword.value.toLowerCase()))
         searchList.value = result.map((e) => ({ ...e }))
     } else {
         searchList.value = []

+ 1 - 1
src/stores/modules/enum.ts

@@ -14,7 +14,7 @@ export interface EnumType {
     bankmappedvalue?: string
 }
 
-const enumKeys = ['confirmStatus', 'countrycode', 'executetype', 'currency', 'deliveryOrderStatus', 'operatetypesearch', 'deliveryPayMode', 'applystatus', 'deliveryStatus', 'operateType', 'WRPresaleStatus', 'clientType', 'stepStatus', 'scoreConfigType', 'GZBSCPayStatus', 'gt_kksjdw', 'performanceStatus', 'handlestatus', 'performanceType', 'accountBusinessCode', 'certificatetype', 'signstatus', 'thjOrderStatus', 'THJDeliveryMode', 'goodsunit', 'WROutInApplyStatus2', 'THJTransferStatus', 'WRTradeOrderStatus', 'THJMarket', 'THJProfitRoleType', 'appointmentModelOut', 'orderstatus', 'Pricemode2', 'buildtype', 'listingselecttype', 'certypeperson', 'runstatus', 'traderstatus', 'transferapplystatus', 'ePayFlag'] as const
+const enumKeys = ['confirmStatus', 'countrycode', 'executetype', 'currency', 'deliveryOrderStatus', 'operatetypesearch', 'deliveryPayMode', 'applystatus', 'deliveryStatus', 'operateType', 'WRPresaleStatus', 'clientType', 'stepStatus', 'scoreConfigType', 'GZBSCPayStatus', 'gt_kksjdw', 'performanceStatus', 'handlestatus', 'performanceType', 'accountBusinessCode', 'certificatetype', 'signstatus', 'thjOrderStatus', 'THJDeliveryMode', 'goodsunit', 'WROutInApplyStatus2', 'THJTransferStatus', 'WRTradeOrderStatus', 'THJMarket', 'THJProfitRoleType', 'appointmentModelOut', 'orderstatus', 'Pricemode2', 'buildtype', 'listingselecttype', 'certypeperson', 'runstatus', 'traderstatus', 'transferapplystatus', 'ePayFlag','goodscurrency'] as const
 
 const enumMap = new Map<typeof enumKeys[number], ShallowRef<Model.EnumRsp[]>>()