|
@@ -7,10 +7,11 @@
|
|
|
<Image width="100%" height="160px" v-else />
|
|
<Image width="100%" height="160px" v-else />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="goods-info">
|
|
<div class="goods-info">
|
|
|
- <div class="goods-info__title">{{ item.goodscode }}</div>
|
|
|
|
|
|
|
+ <div class="goods-info__title">{{ goodsName(item) }}</div>
|
|
|
<div class="goods-info__price">
|
|
<div class="goods-info__price">
|
|
|
- <span class="integer">{{ handleNumberValue(formatDecimal(item.ask, item.decimalplace)) }}</span>
|
|
|
|
|
|
|
+ <span class="integer">{{ price(item) }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div>{{ collectionDesc(item) }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -22,25 +23,59 @@ import { PropType } from 'vue'
|
|
|
import { Image } from 'vant'
|
|
import { Image } from 'vant'
|
|
|
import { formatDecimal, getFileUrl, handleNumberValue } from '@/filters'
|
|
import { formatDecimal, getFileUrl, handleNumberValue } from '@/filters'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
-import { BuyOrSell, BuildType } from '@/constants/order'
|
|
|
|
|
|
|
+import { BuyOrSell, BuildType, getCurrencyName } from '@/constants/order'
|
|
|
import Waterfall from '@mobile/components/base/waterfall/index.vue'
|
|
import Waterfall from '@mobile/components/base/waterfall/index.vue'
|
|
|
|
|
+import { i18n, useFuturesStore } from '@/stores'
|
|
|
|
|
|
|
|
defineProps({
|
|
defineProps({
|
|
|
dataList: {
|
|
dataList: {
|
|
|
- type: Array as PropType<Model.GoodsQuote[]>,
|
|
|
|
|
|
|
+ type: Array as PropType<Model.TCEGoodsCollectionRsp[]>,
|
|
|
required: true
|
|
required: true
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const { router } = useNavigation()
|
|
const { router } = useNavigation()
|
|
|
|
|
+const futureStore = useFuturesStore()
|
|
|
|
|
|
|
|
-const rowClick = (row: Model.GoodsQuote) => {
|
|
|
|
|
- console.log(row)
|
|
|
|
|
|
|
+// 商品名称
|
|
|
|
|
+const goodsName = (item: Model.TCEGoodsCollectionRsp) => {
|
|
|
|
|
+ switch (i18n.global.locale) {
|
|
|
|
|
+ case 'zh-CN':
|
|
|
|
|
+ return item.collectionname
|
|
|
|
|
+ case 'en-US':
|
|
|
|
|
+ return item.collectionnameen
|
|
|
|
|
+ case 'zh-TW':
|
|
|
|
|
+ return item.collectionnametw
|
|
|
|
|
+ default:
|
|
|
|
|
+ return item.collectiondescth
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 商品价格
|
|
|
|
|
+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 collectionDesc = (item: Model.TCEGoodsCollectionRsp) => {
|
|
|
|
|
+ switch (i18n.global.locale) {
|
|
|
|
|
+ case 'zh-CN':
|
|
|
|
|
+ return item.collectiondesc
|
|
|
|
|
+ case 'en-US':
|
|
|
|
|
+ return item.collectiondescen
|
|
|
|
|
+ case 'zh-TW':
|
|
|
|
|
+ return item.collectiondesctw
|
|
|
|
|
+ default:
|
|
|
|
|
+ return item.collectiondescth
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const rowClick = (row: Model. TCEGoodsCollectionRsp) => {
|
|
|
router.push({
|
|
router.push({
|
|
|
name: 'pricing-trade',
|
|
name: 'pricing-trade',
|
|
|
query: {
|
|
query: {
|
|
|
- goodsid: row.goodsid,
|
|
|
|
|
- goodscode: row.goodscode,
|
|
|
|
|
|
|
+ collectionid: row.collectionid,
|
|
|
buyOrSell: BuyOrSell.Buy,
|
|
buyOrSell: BuyOrSell.Buy,
|
|
|
buildType: BuildType.Open
|
|
buildType: BuildType.Open
|
|
|
}
|
|
}
|