|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <app-view>
|
|
|
|
|
|
|
+ <app-view class="market">
|
|
|
<template #header>
|
|
<template #header>
|
|
|
- <app-navbar title="行情" />
|
|
|
|
|
|
|
+ <app-navbar title="行情" :show-back-button="false" />
|
|
|
</template>
|
|
</template>
|
|
|
<app-list :columns="columns" :data-list="touristTradeGoodsList" @row-click="rowClick">
|
|
<app-list :columns="columns" :data-list="touristTradeGoodsList" @row-click="rowClick">
|
|
|
<!-- 回购 -->
|
|
<!-- 回购 -->
|
|
@@ -18,8 +18,8 @@
|
|
|
<span :class="row.lowestColor">{{ handleNumberValue(row.lowest) }}</span>
|
|
<span :class="row.lowestColor">{{ handleNumberValue(row.lowest) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</app-list>
|
|
</app-list>
|
|
|
- <div>参考行情</div>
|
|
|
|
|
- <app-list :columns="columns" :data-list="touristRefGoodsList" @row-click="rowClick">
|
|
|
|
|
|
|
+ <div class="market-title" v-if="touristRefGoodsList.length">参考商品</div>
|
|
|
|
|
+ <app-list :show-header="false" :columns="columns" :data-list="touristRefGoodsList">
|
|
|
<!-- 回购 -->
|
|
<!-- 回购 -->
|
|
|
<template #ask="{ row }">
|
|
<template #ask="{ row }">
|
|
|
<span :class="row.bidColor">{{ handleNumberValue(row.bid) }}</span>
|
|
<span :class="row.bidColor">{{ handleNumberValue(row.bid) }}</span>
|
|
@@ -38,7 +38,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { computed, onActivated, onDeactivated ,nextTick} from 'vue'
|
|
|
|
|
|
|
+import { computed, onActivated, onDeactivated, nextTick } from 'vue'
|
|
|
import { handleNumberValue } from '@/filters'
|
|
import { handleNumberValue } from '@/filters'
|
|
|
import { useNavigation } from '@/packages/sbyj/router/navigation'
|
|
import { useNavigation } from '@/packages/sbyj/router/navigation'
|
|
|
import { useFuturesStore, useLoginStore } from '@/stores'
|
|
import { useFuturesStore, useLoginStore } from '@/stores'
|
|
@@ -58,7 +58,7 @@ const { dataList: touristGoodsList, run: getTouristGoods } = useRequest(queryTou
|
|
|
manual: true,
|
|
manual: true,
|
|
|
onSuccess: (res) => {
|
|
onSuccess: (res) => {
|
|
|
const goodsCodes = res.data.map((item) => item.goodscode)
|
|
const goodsCodes = res.data.map((item) => item.goodscode)
|
|
|
- getTouristQuoteDay({goodsCodes: goodsCodes.join(',')})
|
|
|
|
|
|
|
+ getTouristQuoteDay({ goodsCodes: goodsCodes.join(',') })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
// 获取游客商品盘面
|
|
// 获取游客商品盘面
|
|
@@ -67,7 +67,7 @@ const { dataList: srcTouristQuoteDayList, run: getTouristQuoteDay } = useRequest
|
|
|
onSuccess: () => {
|
|
onSuccess: () => {
|
|
|
const goodsCodes = touristGoodsList.value.map((item) => item.goodscode)
|
|
const goodsCodes = touristGoodsList.value.map((item) => item.goodscode)
|
|
|
// 每2秒轮训一次游客商品盘面(递归调用)
|
|
// 每2秒轮训一次游客商品盘面(递归调用)
|
|
|
- timerTask.setTimeout(() => getTouristQuoteDay({goodsCodes: goodsCodes.join(',')}), 2000, 'queryTouristQuoteDayKey')
|
|
|
|
|
|
|
+ timerTask.setTimeout(() => getTouristQuoteDay({ goodsCodes: goodsCodes.join(',') }), 2000, 'queryTouristQuoteDayKey')
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -77,7 +77,7 @@ const touristQuoteDayList = computed(() => {
|
|
|
touristGoodsList.value.forEach((item) => {
|
|
touristGoodsList.value.forEach((item) => {
|
|
|
const t = srcTouristQuoteDayList.value.find((r) => r.goodscode === item.goodscode)
|
|
const t = srcTouristQuoteDayList.value.find((r) => r.goodscode === item.goodscode)
|
|
|
if (t) {
|
|
if (t) {
|
|
|
- arr.push({
|
|
|
|
|
|
|
+ arr.push({
|
|
|
goodsid: item.goodsid,
|
|
goodsid: item.goodsid,
|
|
|
goodscode: item.goodscode,
|
|
goodscode: item.goodscode,
|
|
|
goodsname: item.goodsname,
|
|
goodsname: item.goodsname,
|
|
@@ -114,7 +114,7 @@ const touristRefGoodsList = computed(() => {
|
|
|
|
|
|
|
|
// *************** 已登录 ***************
|
|
// *************** 已登录 ***************
|
|
|
const dataList = computed(() => {
|
|
const dataList = computed(() => {
|
|
|
- const list = futuresStore.quoteList.filter((e) => e.trademode === 52 || e.trademode === 99 )
|
|
|
|
|
|
|
+ const list = futuresStore.quoteList.filter((e) => e.trademode === 52 || e.trademode === 99)
|
|
|
return list.map((e) => ({
|
|
return list.map((e) => ({
|
|
|
goodscode: e.goodscode,
|
|
goodscode: e.goodscode,
|
|
|
goodsname: e.goodsname,
|
|
goodsname: e.goodsname,
|
|
@@ -132,14 +132,14 @@ const dataList = computed(() => {
|
|
|
|
|
|
|
|
// 处理行情价格颜色
|
|
// 处理行情价格颜色
|
|
|
const handleColor = (value: number, presettle: number) => {
|
|
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'
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (value === 0 || value === presettle) {
|
|
|
|
|
+ return ''
|
|
|
|
|
+ } else if (value > presettle) {
|
|
|
|
|
+ return 'g-price-up'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return 'g-price-down'
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
const subscribe = quoteSocket.createSubscribe()
|
|
const subscribe = quoteSocket.createSubscribe()
|
|
@@ -174,4 +174,8 @@ onDeactivated(() => {
|
|
|
subscribe.stop()
|
|
subscribe.stop()
|
|
|
timerTask.clearTimeout('queryTouristQuoteDayKey')
|
|
timerTask.clearTimeout('queryTouristQuoteDayKey')
|
|
|
})
|
|
})
|
|
|
-</script>
|
|
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style lang="less">
|
|
|
|
|
+@import './index.less';
|
|
|
|
|
+</style>
|