| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <template>
- <app-view class="g-detail">
- <template #header>
- <app-navbar title="转让详情" />
- </template>
- <Swipe class="g-detail__banner" :autoplay="5000" indicator-color="white" lazy-render>
- <SwipeItem v-for="(url, index) in detailBanners" :key="index">
- <img :src="url" />
- </SwipeItem>
- </Swipe>
- <div class="g-detail__info" v-if="detail">
- <div class="pricebar">
- <div class="pricebar-left">
- <span class="tag">最新价</span>
- <span class="unit">¥</span>
- <span class="price">{{ getQuotePrice(detail.goodscode) }}</span>
- </div>
- <div class="pricebar-right">
- <span>订货价:{{ detail.presaleprice.toFixed(2) }}</span>
- </div>
- </div>
- <div class="titlebar">
- <span>{{ detail.sellname }}</span>
- <span>{{ detail.goodsname }}</span>
- </div>
- </div>
- <Cell title="转让列表" />
- <app-list :columns="columns" :data-list="sellList" />
- <div class="g-detail__desc">
- <template v-for="(url, index) in detailImages" :key="index">
- <img :src="url" alt="" />
- </template>
- </div>
- <template #footer>
- <div class="g-detail__footer">
- <Button type="primary" block round @click="openComponent('listing')">我要转让</Button>
- </div>
- <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ detail }" @closed="closeComponent"
- v-if="componentId" />
- </template>
- </app-view>
- </template>
- <script lang="ts" setup>
- import { computed, defineAsyncComponent } from 'vue'
- import { Swipe, SwipeItem, Button, Cell } from 'vant'
- import { getFileUrl } from '@/filters'
- import { useRequest } from '@/hooks/request'
- import { BuyOrSell } from '@/constants/order'
- import { queryPresaleDefault } from '@/services/api/transfer'
- import { queryTjmdTradeOrderDetail } from '@/services/api/swap'
- import { useComponent } from '@/hooks/component'
- import { useNavigation } from '@/hooks/navigation'
- import { useFuturesStore } from '@/stores'
- import AppList from '@mobile/components/base/list/index.vue'
- const componentMap = new Map<string, unknown>([
- ['listing', defineAsyncComponent(() => import('./components/listing/index.vue'))], // 挂牌
- ['delisting', defineAsyncComponent(() => import('./components/delisting/index.vue'))], // 摘牌
- ])
- const { getQueryStringToNumber } = useNavigation()
- const { componentRef, componentId, openComponent, closeComponent } = useComponent()
- const { getQuotePrice } = useFuturesStore()
- const goodsid = getQueryStringToNumber('goodsid')
- const { data: detail } = useRequest(queryPresaleDefault, {
- params: {
- goodsid,
- }
- })
- const { dataList: sellList } = useRequest(queryTjmdTradeOrderDetail, {
- params: {
- pagesize: 3,
- goodsid,
- buyorsell: BuyOrSell.Sell,
- }
- })
- const columns: Model.TableColumn[] = [
- { prop: 'username', label: '挂牌方' },
- { prop: 'orderqty', label: '数量' },
- { prop: 'orderprice', label: '价格' },
- { prop: 'operate', label: '操作' },
- ]
- // 商品banner
- const detailBanners = computed(() => {
- const bannerpicurl = detail.value?.bannerpicurl ?? ''
- return bannerpicurl?.split(',').map((path) => getFileUrl(path))
- })
- // 商品图片列表
- const detailImages = computed(() => {
- const pictureurls = detail.value?.pictureurls ?? ''
- return pictureurls.split(',').map((path) => getFileUrl(path))
- })
- </script>
- <style lang="less">
- @import './index.less';
- </style>
|