|
|
@@ -1,49 +1,55 @@
|
|
|
<template>
|
|
|
<app-view>
|
|
|
<template #header>
|
|
|
- <app-navbar title="掉期挂牌大厅" >
|
|
|
+ <app-navbar :title="`${item.goodscode}/${item.goodsname}`">
|
|
|
<template #right>
|
|
|
<div class="button-more" @click="onListing">
|
|
|
<span>挂牌</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
</app-navbar>
|
|
|
- <div>
|
|
|
- <span>{{ item.goodsgroupname }}/{{ item.goodscode }}</span>
|
|
|
- <span>--</span>
|
|
|
- </div>
|
|
|
</template>
|
|
|
+ <Cell :title="`${item.goodscode}/${item.goodsname}`" is-link style="margin-bottom: .2rem;">
|
|
|
+ <template #title v-if="quote">
|
|
|
+ <span :class="quote.lastColor" style="font-size: .32rem;">{{ handleNumberValue(quote.last) }}</span>
|
|
|
+ <span :class="quote.lastColor" style="margin-left: .2rem;">{{
|
|
|
+ handleNumberValue(quote.rise.toFixed(quote.decimalplace)) }}</span>
|
|
|
+ <span :class="quote.lastColor" style="margin-left: .2rem;">{{ parsePercent(quote.change) }}</span>
|
|
|
+ </template>
|
|
|
+ </Cell>
|
|
|
<Tabs v-model:active="tabIndex" @click="onTabChange">
|
|
|
<Tab title="买大厅" />
|
|
|
<Tab title="卖大厅" />
|
|
|
</Tabs>
|
|
|
<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">
|
|
|
<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 }" @closed="closeComponent"
|
|
|
- v-if="componentId" />
|
|
|
+ <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ selectedRow, tabIndex, item }"
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
-import { Tab, Tabs, Button, showToast } from 'vant'
|
|
|
+import { Tab, Tabs, Button, showToast, Cell } from 'vant'
|
|
|
+import { parsePercent, handleNumberValue } from '@/filters'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import AppList from '@mobile/components/base/list/index.vue'
|
|
|
import { queryTjmdTradeOrderDetail } from '@/services/api/swap'
|
|
|
-import { useLoginStore } from '@/stores'
|
|
|
+import { useLoginStore, useFuturesStore } from '@/stores'
|
|
|
import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
|
@@ -55,11 +61,13 @@ const loginStore = useLoginStore()
|
|
|
|
|
|
const { getParamString } = useNavigation()
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
+const futuresStore = useFuturesStore()
|
|
|
const item: Model.QuoteGoodsListRsp = JSON.parse(getParamString('item')?.toString() || '{}')
|
|
|
const tabIndex = shallowRef(0)
|
|
|
const selectedRow = shallowRef<Model.TjmdTradeOrderDetailRsp>()
|
|
|
const error = shallowRef(false)
|
|
|
const dataList = shallowRef<Model.TjmdTradeOrderDetailRsp[]>([])
|
|
|
+const quote = futuresStore.getQuoteInfo(item.refgoodscode)
|
|
|
|
|
|
const { pageIndex, loading, run, pageCount } = useRequest(queryTjmdTradeOrderDetail, {
|
|
|
params: {
|