|
|
@@ -1,37 +1,37 @@
|
|
|
<template>
|
|
|
<app-view class="market">
|
|
|
<template #header>
|
|
|
- <app-navbar title="行情" :show-back-button="false" />
|
|
|
+ <app-navbar class="market-header" title="行情" :show-back-button="false" />
|
|
|
</template>
|
|
|
<app-list :columns="columns" :data-list="touristTradeGoodsList" @row-click="rowClick">
|
|
|
<!-- 回购 -->
|
|
|
<template #ask="{ row }">
|
|
|
- <span :class="row.bidColor">{{ handleNumberValue(row.bid) }}</span>
|
|
|
+ <span :class="row.bidColor">{{ handleNumberValue(formatDecimal(row.bid, row.decimalplace)) }}</span>
|
|
|
</template>
|
|
|
<!-- 销售 -->
|
|
|
<template #bid="{ row }">
|
|
|
- <span :class="row.askColor">{{ handleNumberValue(row.ask) }}</span>
|
|
|
+ <span :class="row.askColor">{{ handleNumberValue(formatDecimal(row.ask, row.decimalplace)) }}</span>
|
|
|
</template>
|
|
|
<!-- 高/低 -->
|
|
|
<template #hl="{ row }">
|
|
|
- <span :class="row.highestColor">{{ handleNumberValue(row.highest) }}</span>
|
|
|
- <span :class="row.lowestColor">{{ handleNumberValue(row.lowest) }}</span>
|
|
|
+ <span :class="row.highestColor">{{ handleNumberValue(formatDecimal(row.highest, row.decimalplace)) }}</span>
|
|
|
+ <span :class="row.lowestColor">{{ handleNumberValue(formatDecimal(row.lowest, row.decimalplace)) }}</span>
|
|
|
</template>
|
|
|
</app-list>
|
|
|
<div class="market-title" v-if="touristRefGoodsList.length">参考商品</div>
|
|
|
<app-list :show-header="false" :columns="columns" :data-list="touristRefGoodsList">
|
|
|
<!-- 回购 -->
|
|
|
<template #ask="{ row }">
|
|
|
- <span :class="row.bidColor">{{ handleNumberValue(row.bid) }}</span>
|
|
|
+ <span :class="row.bidColor">{{ handleNumberValue(formatDecimal(row.bid, row.decimalplace)) }}</span>
|
|
|
</template>
|
|
|
<!-- 销售 -->
|
|
|
<template #bid="{ row }">
|
|
|
- <span :class="row.askColor">{{ handleNumberValue(row.ask) }}</span>
|
|
|
+ <span :class="row.askColor">{{ handleNumberValue(formatDecimal(row.ask, row.decimalplace)) }}</span>
|
|
|
</template>
|
|
|
<!-- 高/低 -->
|
|
|
<template #hl="{ row }">
|
|
|
- <span :class="row.highestColor">{{ handleNumberValue(row.highest) }}</span>
|
|
|
- <span :class="row.lowestColor">{{ handleNumberValue(row.lowest) }}</span>
|
|
|
+ <span :class="row.highestColor">{{ handleNumberValue(formatDecimal(row.highest, row.decimalplace)) }}</span>
|
|
|
+ <span :class="row.lowestColor">{{ handleNumberValue(formatDecimal(row.lowest, row.decimalplace)) }}</span>
|
|
|
</template>
|
|
|
</app-list>
|
|
|
</app-view>
|
|
|
@@ -39,7 +39,7 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { computed, onActivated, onDeactivated, nextTick } from 'vue'
|
|
|
-import { handleNumberValue } from '@/filters'
|
|
|
+import { handleNumberValue, formatDecimal, handlePriceColor } from '@/filters'
|
|
|
import { useNavigation } from '@/packages/sbyj/router/navigation'
|
|
|
import { useFuturesStore, useLoginStore } from '@/stores'
|
|
|
import quoteSocket from '@/services/websocket/quote'
|
|
|
@@ -81,14 +81,15 @@ const touristQuoteDayList = computed(() => {
|
|
|
goodsid: item.goodsid,
|
|
|
goodscode: item.goodscode,
|
|
|
goodsname: item.goodsname,
|
|
|
+ decimalplace: item.decimalplace,
|
|
|
ask: t.ask,
|
|
|
bid: t.bid,
|
|
|
highest: t.highest,
|
|
|
lowest: t.lowest,
|
|
|
- askColor: handleColor(t.ask, t.presettle),
|
|
|
- bidColor: handleColor(t.bid, t.presettle),
|
|
|
- highestColor: handleColor(t.highest, t.presettle),
|
|
|
- lowestColor: handleColor(t.lowest, t.presettle),
|
|
|
+ askColor: handlePriceColor(t.ask, t.presettle),
|
|
|
+ bidColor: handlePriceColor(t.bid, t.presettle),
|
|
|
+ highestColor: handlePriceColor(t.highest, t.presettle),
|
|
|
+ lowestColor: handlePriceColor(t.lowest, t.presettle),
|
|
|
trademode: item.trademode,
|
|
|
})
|
|
|
}
|
|
|
@@ -118,6 +119,7 @@ const dataList = computed(() => {
|
|
|
return list.map((e) => ({
|
|
|
goodscode: e.goodscode,
|
|
|
goodsname: e.goodsname,
|
|
|
+ decimalplace: e.decimalplace,
|
|
|
askColor: e.askColor,
|
|
|
bidColor: e.bidColor,
|
|
|
lowestColor: e.lowestColor,
|
|
|
@@ -130,18 +132,6 @@ const dataList = computed(() => {
|
|
|
}))
|
|
|
})
|
|
|
|
|
|
-// 处理行情价格颜色
|
|
|
-const handleColor = (value: number, presettle: number) => {
|
|
|
- if (value === 0 || value === presettle) {
|
|
|
- return ''
|
|
|
- } else if (value > presettle) {
|
|
|
- return 'g-price-up'
|
|
|
- } else {
|
|
|
- return 'g-price-down'
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
const subscribe = quoteSocket.createSubscribe()
|
|
|
|
|
|
const columns: Model.TableColumn[] = [
|