|
@@ -13,10 +13,10 @@
|
|
|
</app-navbar>
|
|
</app-navbar>
|
|
|
</template>
|
|
</template>
|
|
|
<app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
|
|
<app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
|
|
|
- :page-count="pageCount" @refresh="onTabChange">
|
|
|
|
|
- <Tabs v-model:active="tabIndex" @click="onChange">
|
|
|
|
|
- <Tab title="买大厅" />
|
|
|
|
|
- <Tab title="卖大厅" />
|
|
|
|
|
|
|
+ :page-count="pageCount" @refresh="onRefresh">
|
|
|
|
|
+ <Tabs v-model:active="tabIndex" @click="onTabChange">
|
|
|
|
|
+ <Tab title="买大厅" :name="BuyOrSell.Buy" />
|
|
|
|
|
+ <Tab title="卖大厅" :name="BuyOrSell.Sell" />
|
|
|
</Tabs>
|
|
</Tabs>
|
|
|
<div class="trade-section sell" v-if="dataList.length">
|
|
<div class="trade-section sell" v-if="dataList.length">
|
|
|
<app-list :columns="columns" :data-list="dataList">
|
|
<app-list :columns="columns" :data-list="dataList">
|
|
@@ -24,8 +24,9 @@
|
|
|
<span>{{ row.userid }}/{{ row.username }}</span>
|
|
<span>{{ row.userid }}/{{ row.username }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template #operate="{ row }">
|
|
<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 === BuyOrSell.Buy ? '卖出' : '买入' }}
|
|
|
|
|
+ </Button>
|
|
|
</template>
|
|
</template>
|
|
|
</app-list>
|
|
</app-list>
|
|
|
</div>
|
|
</div>
|
|
@@ -41,6 +42,7 @@ import { Tab, Tabs, Button, showToast } from 'vant'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
import { useComponent } from '@/hooks/component'
|
|
|
|
|
+import { BuyOrSell } from '@/constants/order'
|
|
|
import { queryWrTradeOrderDetail } from '@/services/api/transfer'
|
|
import { queryWrTradeOrderDetail } from '@/services/api/transfer'
|
|
|
import { useLoginStore, useFuturesStore } from '@/stores'
|
|
import { useLoginStore, useFuturesStore } from '@/stores'
|
|
|
import AppQuote from '@mobile/components/modules/quote/index.vue'
|
|
import AppQuote from '@mobile/components/modules/quote/index.vue'
|
|
@@ -56,14 +58,15 @@ const componentMap = new Map<string, unknown>([
|
|
|
const loginStore = useLoginStore()
|
|
const loginStore = useLoginStore()
|
|
|
|
|
|
|
|
const { getParamString } = useNavigation()
|
|
const { getParamString } = useNavigation()
|
|
|
-const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
|
|
const item: Model.QuoteGoodsListRsp = JSON.parse(getParamString('item')?.toString() || '{}')
|
|
const item: Model.QuoteGoodsListRsp = JSON.parse(getParamString('item')?.toString() || '{}')
|
|
|
-const tabIndex = shallowRef(0)
|
|
|
|
|
|
|
+const tabIndex = shallowRef(BuyOrSell.Buy)
|
|
|
const selectedRow = shallowRef<Model.WrTradeOrderDetailRsp>()
|
|
const selectedRow = shallowRef<Model.WrTradeOrderDetailRsp>()
|
|
|
const error = shallowRef(false)
|
|
const error = shallowRef(false)
|
|
|
const dataList = shallowRef<Model.WrTradeOrderDetailRsp[]>([])
|
|
const dataList = shallowRef<Model.WrTradeOrderDetailRsp[]>([])
|
|
|
const quote = futuresStore.getQuoteInfo(item.goodscode)
|
|
const quote = futuresStore.getQuoteInfo(item.goodscode)
|
|
|
|
|
|
|
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => onTabChange())
|
|
|
|
|
+
|
|
|
const { pageIndex, loading, run, pageCount } = useRequest(queryWrTradeOrderDetail, {
|
|
const { pageIndex, loading, run, pageCount } = useRequest(queryWrTradeOrderDetail, {
|
|
|
params: {
|
|
params: {
|
|
|
pagesize: 20,
|
|
pagesize: 20,
|
|
@@ -81,19 +84,16 @@ const { pageIndex, loading, run, pageCount } = useRequest(queryWrTradeOrderDetai
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const onTabChange = () => {
|
|
|
|
|
|
|
+const onRefresh = () => {
|
|
|
run({
|
|
run({
|
|
|
buyorsell: tabIndex.value,
|
|
buyorsell: tabIndex.value,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const onChange = () => {
|
|
|
|
|
|
|
+const onTabChange = () => {
|
|
|
/// 重置为1
|
|
/// 重置为1
|
|
|
pageIndex.value = 1
|
|
pageIndex.value = 1
|
|
|
- run({
|
|
|
|
|
- buyorsell: tabIndex.value,
|
|
|
|
|
- page: 1
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ onRefresh()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const columns: Model.TableColumn[] = [
|
|
const columns: Model.TableColumn[] = [
|