|
|
@@ -1,26 +1,19 @@
|
|
|
<template>
|
|
|
<app-view class="goods-detail">
|
|
|
<template #header>
|
|
|
- <app-navbar :title="item.goodscode+'/'+item.goodsname" >
|
|
|
+ <app-navbar :title="item.goodscode + '/' + item.goodsname">
|
|
|
<template #right>
|
|
|
<div class="button-more" @click="onListing">
|
|
|
<span>挂牌</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #footer>
|
|
|
+ <app-quote :goodscode="item.goodscode" style="margin-bottom: .2rem;" />
|
|
|
+ </template>
|
|
|
</app-navbar>
|
|
|
</template>
|
|
|
- <div class="goods-detail__quote" v-if="quote">
|
|
|
- <ul class="price">
|
|
|
- <li :class="quote.lastColor">{{ quote.last }}</li>
|
|
|
- <li :class="quote.lastColor">{{ handleNumberValue(quote.rise.toFixed(quote.decimalplace)) }}</li>
|
|
|
- <li :class="quote.lastColor">{{ parsePercent(quote.change) }}</li>
|
|
|
- </ul>
|
|
|
- <ul class="time">
|
|
|
- <li>{{ formatDate(quote.lasttime, 'MM-DD HH:mm:ss') }}</li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
<app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
|
|
|
- :page-count="pageCount" @refresh="onTabChange">
|
|
|
+ :page-count="pageCount" @refresh="onTabChange">
|
|
|
<Tabs v-model:active="tabIndex" @click="onChange">
|
|
|
<Tab title="买大厅" />
|
|
|
<Tab title="卖大厅" />
|
|
|
@@ -28,32 +21,31 @@
|
|
|
<div class="trade-section sell" v-if="dataList.length">
|
|
|
<app-list :columns="columns" :data-list="dataList">
|
|
|
<template #username="{ row }">
|
|
|
- <span >{{ row.userid }}/{{ row.username }}</span>
|
|
|
+ <span>{{ row.userid }}/{{ row.username }}</span>
|
|
|
</template>
|
|
|
<template #operate="{ row }">
|
|
|
- <Button size="small" type="primary" round @click="onDelisting(row)">{{ tabIndex === 0 ? '卖出' : '买入' }}</Button>
|
|
|
+ <Button size="small" type="primary" round @click="onDelisting(row)">{{ tabIndex === 0 ? '卖出' : '买入'
|
|
|
+ }}</Button>
|
|
|
</template>
|
|
|
</app-list>
|
|
|
</div>
|
|
|
</app-pull-refresh>
|
|
|
- <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ selectedRow, tabIndex, item, quote }" @closed="closeComponent"
|
|
|
- v-if="componentId" />
|
|
|
+ <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ selectedRow, tabIndex, item, quote }"
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, onMounted, onUnmounted,defineAsyncComponent } from 'vue'
|
|
|
+import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
import { Tab, Tabs, Button, showToast } from 'vant'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { queryWrTradeOrderDetail } from '@/services/api/transfer'
|
|
|
import { useLoginStore, useFuturesStore } from '@/stores'
|
|
|
-import { parsePercent, handleNumberValue, formatDate } from '@/filters'
|
|
|
-
|
|
|
+import AppQuote from '@mobile/components/modules/quote/index.vue'
|
|
|
import AppList from '@mobile/components/base/list/index.vue'
|
|
|
import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
-import quoteSocket from '@/services/websocket/quote'
|
|
|
|
|
|
const futuresStore = useFuturesStore()
|
|
|
const componentMap = new Map<string, unknown>([
|
|
|
@@ -70,7 +62,6 @@ const tabIndex = shallowRef(0)
|
|
|
const selectedRow = shallowRef<Model.WrTradeOrderDetailRsp>()
|
|
|
const error = shallowRef(false)
|
|
|
const dataList = shallowRef<Model.WrTradeOrderDetailRsp[]>([])
|
|
|
-const subscribe = quoteSocket.addSubscribe([item.goodscode])
|
|
|
const quote = futuresStore.getQuoteInfo(item.goodscode)
|
|
|
|
|
|
const { pageIndex, loading, run, pageCount } = useRequest(queryWrTradeOrderDetail, {
|
|
|
@@ -80,7 +71,6 @@ const { pageIndex, loading, run, pageCount } = useRequest(queryWrTradeOrderDetai
|
|
|
buyorsell: tabIndex.value
|
|
|
},
|
|
|
onSuccess: (res) => {
|
|
|
- console.log(pageIndex.value)
|
|
|
if (pageIndex.value === 1) {
|
|
|
dataList.value = []
|
|
|
}
|
|
|
@@ -126,13 +116,4 @@ const onDelisting = (row: Model.WrTradeOrderDetailRsp) => {
|
|
|
const onListing = () => {
|
|
|
openComponent('listing')
|
|
|
}
|
|
|
-
|
|
|
-onMounted(() => subscribe.start())
|
|
|
-
|
|
|
-onUnmounted(() => subscribe.stop())
|
|
|
-
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="less">
|
|
|
-@import './index.less';
|
|
|
-</style>
|
|
|
+</script>
|