|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<app-view>
|
|
|
<template #header>
|
|
|
- <app-navbar :title="titleName" :show-back-button="showBackButton" />
|
|
|
+ <app-navbar :title="groupInfo ? groupInfo.goodsgroupname : '价格'" :show-back-button="showBackButton" />
|
|
|
</template>
|
|
|
<div class="pricing-v2">
|
|
|
<div class="pricing-v2-item" v-for="(item, index) in dataList" :key="index">
|
|
|
@@ -12,11 +12,15 @@
|
|
|
<section @click="rowClick(item)">
|
|
|
<dl>
|
|
|
<dt>{{ t('quote.ask') }}</dt>
|
|
|
- <dd :class="item.bidColor">{{ item.bid }}</dd>
|
|
|
+ <dd :class="item.bidColor">
|
|
|
+ {{ handleNumberValue(formatDecimal(item.bid, item.decimalplace)) }}
|
|
|
+ </dd>
|
|
|
</dl>
|
|
|
<dl>
|
|
|
<dt>{{ t('quote.bid') }}</dt>
|
|
|
- <dd :class="item.askColor">{{ item.ask }}</dd>
|
|
|
+ <dd :class="item.askColor">
|
|
|
+ {{ handleNumberValue(formatDecimal(item.ask, item.decimalplace)) }}
|
|
|
+ </dd>
|
|
|
</dl>
|
|
|
</section>
|
|
|
</article>
|
|
|
@@ -26,56 +30,35 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { computed, onUnmounted, onActivated, PropType } from 'vue'
|
|
|
-import { parsePercent, handleNumberValue, formatDecimal } from '@/filters'
|
|
|
-import { useNavigation } from '@mobile/router/navigation'
|
|
|
-import { useFuturesStore, i18n } from '@/stores'
|
|
|
+import { computed, onUnmounted, onActivated } from 'vue'
|
|
|
+import { handleNumberValue, formatDecimal } from '@/filters'
|
|
|
import { ETradeMode } from '@/constants/client'
|
|
|
+import { useNavigation } from '@mobile/router/navigation'
|
|
|
+import { useUserStore, useFuturesStore, i18n } from '@/stores'
|
|
|
import quoteSocket from '@/services/websocket/quote'
|
|
|
import { BuyOrSell, BuildType } from '@/constants/order'
|
|
|
|
|
|
-const props = defineProps({
|
|
|
+defineProps({
|
|
|
showBackButton: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
- },
|
|
|
- marketSection: {
|
|
|
- type: Object as PropType<Model.Marketsectionconfignew>
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const { global: { t } } = i18n
|
|
|
-const { router, getQueryString } = useNavigation()
|
|
|
+const { router, getQueryStringToNumber } = useNavigation()
|
|
|
+const t = i18n.global.t
|
|
|
+const groupId = getQueryStringToNumber('groupId')
|
|
|
const futuresStore = useFuturesStore()
|
|
|
+const userStore = useUserStore()
|
|
|
|
|
|
-const title = getQueryString('title')
|
|
|
-const titleName = computed(() => title ? decodeURIComponent(title) : props.marketSection?.displayname ?? '订单点价')
|
|
|
+const groupInfo = computed(() => {
|
|
|
+ const list = userStore.getUserDataInfo('goodsgroups')
|
|
|
+ return list.find((e) => e.goodsgroupid === groupId)
|
|
|
+})
|
|
|
|
|
|
const dataList = computed(() => {
|
|
|
- const list = futuresStore.getGoodsListByTradeMode(ETradeMode.TRADEMODE_MARKETMAKE)
|
|
|
- return list.map((item) => {
|
|
|
- const quote = futuresStore.getGoodsQuote(item.goodscode)
|
|
|
- const { lastColor, openedColor, lowestColor, highestColor, last = 0, presettle = 0, rise = 0, change, amplitude, highest = 0, lowest = 0, opened = 0, ask = 0, bid = 0, bidColor, askColor, decimalplace } = quote.value ?? {}
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- lastColor,
|
|
|
- openedColor,
|
|
|
- lowestColor,
|
|
|
- highestColor,
|
|
|
- last: handleNumberValue(formatDecimal(last, decimalplace)),
|
|
|
- rise: handleNumberValue(formatDecimal(rise, decimalplace)),
|
|
|
- change: parsePercent(change),
|
|
|
- opened: handleNumberValue(formatDecimal(opened, decimalplace)),
|
|
|
- presettle: handleNumberValue(formatDecimal(presettle, decimalplace)),
|
|
|
- lowest: handleNumberValue(formatDecimal(lowest, decimalplace)),
|
|
|
- highest: handleNumberValue(formatDecimal(highest, decimalplace)),
|
|
|
- amplitude: parsePercent(amplitude),
|
|
|
- ask: handleNumberValue(formatDecimal(ask, decimalplace)),
|
|
|
- bid: handleNumberValue(formatDecimal(bid, decimalplace)),
|
|
|
- bidColor,
|
|
|
- askColor
|
|
|
- }
|
|
|
- })
|
|
|
+ const list = futuresStore.quotationList
|
|
|
+ return list.filter((e) => groupId ? e.goodsgroupid === groupId : e.trademode === ETradeMode.TRADEMODE_MARKETMAKE)
|
|
|
})
|
|
|
|
|
|
const goodsCodes = dataList.value.map((e) => e.goodscode.toUpperCase())
|