|
|
@@ -9,8 +9,16 @@
|
|
|
<Tab title="买大厅">
|
|
|
</Tab>
|
|
|
</Tabs>
|
|
|
- <app-list :columns="columns" :data-list="[]" />
|
|
|
- <component ref="componentRef" :is="components.trade" v-bind="{ selectedRow }" @closed="closeComponent"
|
|
|
+ <div class="trade">
|
|
|
+ <div class="trade-section sell" v-if="dataList.length">
|
|
|
+ <app-list :columns="columns" :data-list="dataList">
|
|
|
+ <template #operate="{ row }">
|
|
|
+ <Button size="small" round @click="delisting(row)">摘牌</Button>
|
|
|
+ </template>
|
|
|
+ </app-list>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <component ref="componentRef" :is="components.delisting" v-bind="{ selectedRow }" @closed="closeComponent"
|
|
|
v-if="componentId" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
@@ -18,32 +26,55 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
import { Tab, Tabs, Button } from 'vant'
|
|
|
+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'
|
|
|
|
|
|
const components = {
|
|
|
- trade: defineAsyncComponent(() => import('./components/trade/Index.vue')),
|
|
|
+ delisting: defineAsyncComponent(() => import('./components/delisting/Index.vue')),
|
|
|
+ listing: defineAsyncComponent(() => import('./components/listing/Index.vue')),
|
|
|
}
|
|
|
|
|
|
const { getQueryStringToNumber } = useNavigation()
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
const goodsId = getQueryStringToNumber('id')
|
|
|
const tabIndex = shallowRef(0)
|
|
|
-const selectedRow = shallowRef()
|
|
|
+const selectedRow = shallowRef<Model.TjmdTradeOrderDetailRsp>()
|
|
|
+const error = shallowRef(false)
|
|
|
+const showModal = shallowRef(true)
|
|
|
+
|
|
|
+const dataList = shallowRef<Model.TjmdTradeOrderDetailRsp[]>([])
|
|
|
+
|
|
|
+const { pageIndex } = useRequest(queryTjmdTradeOrderDetail, {
|
|
|
+ params: {
|
|
|
+ goodsid: goodsId,
|
|
|
+ buyorsell: tabIndex.value
|
|
|
+ },
|
|
|
+ onSuccess: (res) => {
|
|
|
+ if (pageIndex.value === 1) {
|
|
|
+ dataList.value = []
|
|
|
+ }
|
|
|
+ dataList.value.push(...res.data)
|
|
|
+ },
|
|
|
+ onError: () => {
|
|
|
+ error.value = true
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
const columns: Model.TableColumn[] = [
|
|
|
- { prop: 'undefined', label: '价格' },
|
|
|
- { prop: 'undefined', label: '数量' },
|
|
|
- { prop: 'undefined', label: '挂牌方' },
|
|
|
+ { prop: 'fixedprice', label: '价格' },
|
|
|
+ { prop: 'orderqty', label: '数量' },
|
|
|
+ { prop: 'username', label: '挂牌方' },
|
|
|
]
|
|
|
|
|
|
const tabChange = (index: number) => {
|
|
|
console.log('切换列表', index)
|
|
|
}
|
|
|
|
|
|
-const openTrade = (item) => {
|
|
|
- selectedRow.value = item
|
|
|
- openComponent('trade')
|
|
|
+const delisting = (row: Model.TjmdTradeOrderDetailRsp) => {
|
|
|
+ selectedRow.value = row
|
|
|
+ openComponent('delisting')
|
|
|
}
|
|
|
</script>
|