|
|
@@ -0,0 +1,74 @@
|
|
|
+<!-- 交易市场 - 积分商城 -->
|
|
|
+<template>
|
|
|
+ <el-scrollbar>
|
|
|
+ <div class="market-pricing-v2">
|
|
|
+ <article v-for="(item, index) in futuresStore.marketGoodsList" :key="index">
|
|
|
+ <h3 @click="openImageViewer(item.pictureurl)">
|
|
|
+ <span>{{ item.goodscode }}</span>
|
|
|
+ <app-icon icon="PictureFilled" v-if="item.pictureurl" />
|
|
|
+ </h3>
|
|
|
+ <section @click="onRowClick(item)">
|
|
|
+ <dl>
|
|
|
+ <dt>{{ t('quote.score') }}</dt>
|
|
|
+ <dd :class="item.askColor">{{ handleNumberValue(formatDecimal(item.ask, item.decimalplace)) }}
|
|
|
+ </dd>
|
|
|
+ </dl>
|
|
|
+ </section>
|
|
|
+ </article>
|
|
|
+ </div>
|
|
|
+ <el-image-viewer :url-list="viewerList" @close="showViewer = false" teleported v-if="showViewer" />
|
|
|
+ <component ref="componentRef" v-bind="{ goodsId: futuresStore.selectedGoodsId }"
|
|
|
+ :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
|
|
|
+ </el-scrollbar>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import { shallowRef, onMounted, onUnmounted, defineAsyncComponent } from 'vue'
|
|
|
+import { getFileUrl } from '@/filters'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
+import { handleNumberValue, formatDecimal } from '@/filters'
|
|
|
+import { useUserStore, useFuturesStore, useGlobalStore, i18n } from '@/stores'
|
|
|
+import AppIcon from '@pc/components/base/icon/index.vue'
|
|
|
+
|
|
|
+const t = i18n.global.t
|
|
|
+const futuresStore = useFuturesStore()
|
|
|
+const globalStore = useGlobalStore()
|
|
|
+const userStore = useUserStore()
|
|
|
+const showViewer = shallowRef(false)
|
|
|
+const viewerList = shallowRef<string[]>([])
|
|
|
+
|
|
|
+// 任务 #6289
|
|
|
+const param1012 = userStore.getSystemParamValue('1012')
|
|
|
+
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => true, false)
|
|
|
+
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['detail', defineAsyncComponent(() => import('@pc/components/modules/goods-detail/index.vue'))], // 详情
|
|
|
+])
|
|
|
+
|
|
|
+const onRowClick = (row: Model.GoodsQuote) => {
|
|
|
+ if (param1012 !== '0') {
|
|
|
+ openComponent('detail')
|
|
|
+ }
|
|
|
+ futuresStore.selectedGoodsId = row.goodsid
|
|
|
+}
|
|
|
+
|
|
|
+const openImageViewer = (url?: string) => {
|
|
|
+ if (url) {
|
|
|
+ viewerList.value = [getFileUrl(url)]
|
|
|
+ showViewer.value = true
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ globalStore.showPricingListing = true
|
|
|
+})
|
|
|
+
|
|
|
+onUnmounted(() => {
|
|
|
+ globalStore.showPricingListing = false
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less">
|
|
|
+@import './index.less';
|
|
|
+</style>
|