|
@@ -29,6 +29,7 @@ const paging = ref(null)
|
|
|
const id = ref<any>()
|
|
|
const orderNo = ref<string>()
|
|
|
const isPayOrder = ref<boolean>(false)
|
|
|
+const isPageLoading = ref(true) // 页面加载状态
|
|
|
const detail = ref<any>({})
|
|
|
const orderStatusEnumData = ref<any>([])
|
|
|
const openRedEnvelopeRate = ref<any>()
|
|
@@ -104,10 +105,8 @@ function startCountdown() {
|
|
|
}
|
|
|
|
|
|
async function getDetail() {
|
|
|
- uni.showLoading({
|
|
|
- title: t('orderDetail.loading'),
|
|
|
- })
|
|
|
try {
|
|
|
+ isPageLoading.value = true
|
|
|
// 根据参数类型构建请求参数
|
|
|
const params = orderNo.value ? { orderNo: orderNo.value } : { id: id.value }
|
|
|
const res = await orderDetail(params)
|
|
@@ -129,7 +128,7 @@ async function getDetail() {
|
|
|
}
|
|
|
}
|
|
|
finally {
|
|
|
- uni.hideLoading()
|
|
|
+ isPageLoading.value = false
|
|
|
}
|
|
|
}
|
|
|
const pinkList = ref<any>([])
|
|
@@ -310,141 +309,233 @@ onUnmounted(() => {
|
|
|
|
|
|
<template>
|
|
|
<z-paging ref="paging" refresher-only @refresh="getDetail">
|
|
|
- <view class="pt-20rpx">
|
|
|
- <!-- 状态显示 -->
|
|
|
- <template v-if="detail.status !== 4 && detail?.status !== 2">
|
|
|
- <!-- 已中奖 -->
|
|
|
- <view v-if="detail?.storePink?.status === 2 && detail?.storePink?.lId === 1" class="mb-20rpx bg-#17AA68/80 py-20rpx text-center text-28rpx text-white">
|
|
|
- {{ t('orderDetail.congrats') }}
|
|
|
- <br>
|
|
|
- {{ t('orderDetail.receiveReward') }}
|
|
|
- <text class="text-[var(--wot-color-theme)]">
|
|
|
- ৳{{ detail.brokerage }}
|
|
|
- </text>
|
|
|
- </view>
|
|
|
- <!-- 未中奖 -->
|
|
|
- <view v-else-if="detail?.storePink?.status === 2 && detail?.storePink?.lId === 0" class="mb-20rpx bg-#E61B28/80 py-20rpx text-center text-28rpx text-white">
|
|
|
- {{ t('orderDetail.sorry') }}
|
|
|
- <br>
|
|
|
- {{ t('orderDetail.receiveReward') }}
|
|
|
- <text class="text-#66C59B">
|
|
|
- ৳{{ detail.brokerage }}
|
|
|
- </text>
|
|
|
+ <!-- 页面加载时显示骨架屏 -->
|
|
|
+ <template v-if="isPageLoading">
|
|
|
+ <view class="pt-20rpx">
|
|
|
+ <!-- 状态卡片骨架屏(模拟状态显示区域) -->
|
|
|
+ <view class="mb-20rpx bg-white py-20rpx text-center">
|
|
|
+ <wd-skeleton
|
|
|
+ :row-col="[{ width: '180rpx', height: '28rpx', marginLeft: 'auto', marginRight: 'auto' }]"
|
|
|
+ animation="gradient"
|
|
|
+ />
|
|
|
</view>
|
|
|
- <!-- 未开奖||未支付 -->
|
|
|
- <view v-else-if="detail?.storePink?.status === 1 || detail?.status === 1" class="mb-20rpx bg-#fff py-20rpx text-center text-28rpx text-white">
|
|
|
- <text v-if="detail?.storePink?.status === 1 && detail?.status !== 1" class="text-[var(--wot-color-theme)]">
|
|
|
- {{ t('orderDetail.waiting') }}
|
|
|
- </text>
|
|
|
- <text v-else class="text-[var(--wot-color-theme)]">
|
|
|
- {{ t('orderDetail.paymentCountdown') }} {{ countdown }}
|
|
|
- </text>
|
|
|
+
|
|
|
+ <!-- 地址信息骨架屏(模拟地址选择区域) -->
|
|
|
+ <view class="mb-20rpx bg-white px-24rpx py-20rpx">
|
|
|
+ <wd-skeleton
|
|
|
+ :row-col="[
|
|
|
+ { width: '150rpx', height: '28rpx' }, // 地址标题或添加地址
|
|
|
+ { width: '200rpx', height: '24rpx', marginTop: '12rpx' }, // 收货人信息
|
|
|
+ { width: '100%', height: '22rpx', marginTop: '8rpx' }, // 详细地址
|
|
|
+ ]"
|
|
|
+ animation="gradient"
|
|
|
+ />
|
|
|
</view>
|
|
|
- <!-- 拼团头像 -->
|
|
|
- <view v-if="pinkList && pinkList.length" class="mb-20rpx bg-white px-20rpx py-20rpx text-center">
|
|
|
- <image v-for="i in pinkList" :key="i" class="mx-4rpx mb-8rpx h-80rpx w-80rpx rounded-full" :src="i.avatar" />
|
|
|
+
|
|
|
+ <!-- 商品信息骨架屏(使用实际的 wd-card 结构) -->
|
|
|
+ <wd-card type="rectangle" custom-class="px-24rpx! py-6rpx!" custom-content-class="py-18rpx!" custom-title-class="py-18rpx!">
|
|
|
+ <template #title>
|
|
|
+ <!-- 订单头部:订单号 + 状态 -->
|
|
|
+ <wd-skeleton
|
|
|
+ :row-col="[
|
|
|
+ [{ width: '250rpx', height: '28rpx' }, { width: '60rpx', height: '26rpx', marginLeft: 'auto' }],
|
|
|
+ ]"
|
|
|
+ animation="gradient"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <!-- 商品区域:图片 + 信息 -->
|
|
|
+ <wd-skeleton
|
|
|
+ :row-col="[
|
|
|
+ [
|
|
|
+ { width: '140rpx', height: '140rpx', type: 'rect' },
|
|
|
+ [
|
|
|
+ { width: '100%', height: '40rpx' }, // 商品标题第一行
|
|
|
+ { width: '80%', height: '40rpx', marginTop: '8rpx' }, // 商品标题第二行
|
|
|
+ { width: '120rpx', height: '24rpx', marginTop: '4rpx' }, // 颜色规格
|
|
|
+ [{ width: '100rpx', height: '24rpx' }, { width: '80rpx', height: '24rpx', marginLeft: 'auto' }], // 价格和数量
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ]"
|
|
|
+ animation="gradient"
|
|
|
+ />
|
|
|
+ </wd-card>
|
|
|
+
|
|
|
+ <!-- 订单信息骨架屏 -->
|
|
|
+ <view class="bg-white px-24rpx">
|
|
|
+ <!-- 订单摘要 -->
|
|
|
+ <view class="border-b-1 border-b-#e8e8e8 border-b-solid py-24rpx">
|
|
|
+ <wd-skeleton
|
|
|
+ :row-col="[
|
|
|
+ { width: '120rpx', height: '28rpx' }, // 摘要标题
|
|
|
+ [{ width: '80rpx', height: '24rpx' }, { width: '100rpx', height: '24rpx', marginLeft: 'auto' }], // SubTotal 行
|
|
|
+ ]"
|
|
|
+ animation="gradient"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 支付方式 -->
|
|
|
+ <view class="border-b-1 border-b-#e8e8e8 border-b-solid py-24rpx">
|
|
|
+ <wd-skeleton
|
|
|
+ :row-col="[
|
|
|
+ [{ width: '100rpx', height: '28rpx' }, { width: '140rpx', height: '24rpx', marginLeft: 'auto' }],
|
|
|
+ ]"
|
|
|
+ animation="gradient"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 订单状态记录 -->
|
|
|
+ <view class="py-24rpx">
|
|
|
+ <wd-skeleton
|
|
|
+ :row-col="[
|
|
|
+ [{ width: '90rpx', height: '24rpx' }, { width: '150rpx', height: '24rpx', marginLeft: 'auto' }],
|
|
|
+ [{ width: '80rpx', height: '24rpx' }, { width: '150rpx', height: '24rpx', marginLeft: 'auto' }],
|
|
|
+ ]"
|
|
|
+ animation="gradient"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </template>
|
|
|
- <!-- 地址 -->
|
|
|
- <view v-if="detail?.storePink?.status === 2 && detail?.storePink?.lId === 1" class="mb-20rpx bg-white px-24rpx py-20rpx">
|
|
|
- <!-- 无地址 -->
|
|
|
- <template v-if="!detail.orderAddressVO">
|
|
|
- <view class="flex items-center justify-between" @click="selectAddress">
|
|
|
- <view class="text-28rpx text-[var(--wot-color-theme)]">
|
|
|
- {{ t('orderDetail.address.add') }}
|
|
|
- </view>
|
|
|
- <wd-icon name="arrow-right" color="#7D7D7D" size="28rpx" />
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 实际内容 -->
|
|
|
+ <template v-else>
|
|
|
+ <view class="pt-20rpx">
|
|
|
+ <!-- 状态显示 -->
|
|
|
+ <template v-if="detail.status !== 4 && detail?.status !== 2">
|
|
|
+ <!-- 已中奖 -->
|
|
|
+ <view v-if="detail?.storePink?.status === 2 && detail?.storePink?.lId === 1" class="mb-20rpx bg-#17AA68/80 py-20rpx text-center text-28rpx text-white">
|
|
|
+ {{ t('orderDetail.congrats') }}
|
|
|
+ <br>
|
|
|
+ {{ t('orderDetail.receiveReward') }}
|
|
|
+ <text class="text-[var(--wot-color-theme)]">
|
|
|
+ ৳{{ detail.brokerage }}
|
|
|
+ </text>
|
|
|
</view>
|
|
|
- </template>
|
|
|
- <!-- 有地址 -->
|
|
|
- <template v-else>
|
|
|
- <view v-if="detail.deliveryCode" class="mb-18rpx flex justify-between border-b-1 border-b-#e8e8e8 border-b-solid pb-18rpx text-24rpx">
|
|
|
- <!-- 物流信息 -->
|
|
|
- <view>{{ detail.deliveryName }}</view>
|
|
|
- <view> DHL:{{ detail.deliveryCode || '-' }}</view>
|
|
|
+ <!-- 未中奖 -->
|
|
|
+ <view v-else-if="detail?.storePink?.status === 2 && detail?.storePink?.lId === 0" class="mb-20rpx bg-#E61B28/80 py-20rpx text-center text-28rpx text-white">
|
|
|
+ {{ t('orderDetail.sorry') }}
|
|
|
+ <br>
|
|
|
+ {{ t('orderDetail.receiveReward') }}
|
|
|
+ <text class="text-#66C59B">
|
|
|
+ ৳{{ detail.brokerage }}
|
|
|
+ </text>
|
|
|
</view>
|
|
|
- <view class="mb-20rpx text-24rpx">
|
|
|
- <text class="mr-20rpx">
|
|
|
- {{ detail?.orderAddressVO?.realName }}
|
|
|
+ <!-- 未开奖||未支付 -->
|
|
|
+ <view v-else-if="detail?.storePink?.status === 1 || detail?.status === 1" class="mb-20rpx bg-#fff py-20rpx text-center text-28rpx text-white">
|
|
|
+ <text v-if="detail?.storePink?.status === 1 && detail?.status !== 1" class="text-[var(--wot-color-theme)]">
|
|
|
+ {{ t('orderDetail.waiting') }}
|
|
|
+ </text>
|
|
|
+ <text v-else class="text-[var(--wot-color-theme)]">
|
|
|
+ {{ t('orderDetail.paymentCountdown') }} {{ countdown }}
|
|
|
</text>
|
|
|
- <text>{{ detail?.orderAddressVO?.phone }}</text>
|
|
|
</view>
|
|
|
- <view class="text-22rpx text-#3A444C">
|
|
|
- {{ detail?.orderAddressVO?.province }} {{ detail?.orderAddressVO?.city }} {{ detail?.orderAddressVO?.district }} {{ detail?.orderAddressVO?.detail }} {{ detail?.orderAddressVO?.postCode }}
|
|
|
+ <!-- 拼团头像 -->
|
|
|
+ <view v-if="pinkList && pinkList.length" class="mb-20rpx bg-white px-20rpx py-20rpx text-center">
|
|
|
+ <image v-for="i in pinkList" :key="i" class="mx-4rpx mb-8rpx h-80rpx w-80rpx rounded-full" :src="i.avatar" />
|
|
|
</view>
|
|
|
</template>
|
|
|
- </view>
|
|
|
- <!-- 商品信息 -->
|
|
|
- <wd-card type="rectangle" custom-class="px-24rpx! py-6rpx!" custom-content-class="py-18rpx!" custom-title-class="py-18rpx!" @click="toPage('/pages/productDetail/productDetail', { productId: detail?.orderInfoVO?.[0].productId })">
|
|
|
- <template #title>
|
|
|
- <view class="flex items-center justify-between">
|
|
|
- <view class="text-28rpx text-#000">
|
|
|
- {{ t('orderDetail.address.orderNo') }}:{{ detail?.orderInfoVO?.[0].orderNo }}
|
|
|
+ <!-- 地址 -->
|
|
|
+ <view v-if="detail?.storePink?.status === 2 && detail?.storePink?.lId === 1" class="mb-20rpx bg-white px-24rpx py-20rpx">
|
|
|
+ <!-- 无地址 -->
|
|
|
+ <template v-if="!detail.orderAddressVO">
|
|
|
+ <view class="flex items-center justify-between" @click="selectAddress">
|
|
|
+ <view class="text-28rpx text-[var(--wot-color-theme)]">
|
|
|
+ {{ t('orderDetail.address.add') }}
|
|
|
+ </view>
|
|
|
+ <wd-icon name="arrow-right" color="#7D7D7D" size="28rpx" />
|
|
|
</view>
|
|
|
- <wd-text size="26rpx" type="primary" :text="orderStatusEnumData.find((i:any) => i.code === detail?.status)?.name" />
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- <view class="flex items-center gap-24rpx">
|
|
|
- <view class="h-140rpx w-140rpx shrink-0">
|
|
|
- <image
|
|
|
- :src="detail?.orderInfoVO?.[0]?.image"
|
|
|
- class="h-full w-full"
|
|
|
- mode="aspectFit"
|
|
|
- />
|
|
|
- </view>
|
|
|
- <view class="flex-1">
|
|
|
- <view class="line-clamp-2 h-80rpx text-28rpx text-#000">
|
|
|
- {{ detail?.orderInfoVO?.[0].productName }}
|
|
|
+ </template>
|
|
|
+ <!-- 有地址 -->
|
|
|
+ <template v-else>
|
|
|
+ <view v-if="detail.deliveryCode" class="mb-18rpx flex justify-between border-b-1 border-b-#e8e8e8 border-b-solid pb-18rpx text-24rpx">
|
|
|
+ <!-- 物流信息 -->
|
|
|
+ <view>{{ detail.deliveryName }}</view>
|
|
|
+ <view> DHL:{{ detail.deliveryCode || '-' }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="mb-20rpx text-24rpx">
|
|
|
+ <text class="mr-20rpx">
|
|
|
+ {{ detail?.orderAddressVO?.realName }}
|
|
|
+ </text>
|
|
|
+ <text>{{ detail?.orderAddressVO?.phone }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="text-22rpx text-#3A444C">
|
|
|
+ {{ detail?.orderAddressVO?.province }} {{ detail?.orderAddressVO?.city }} {{ detail?.orderAddressVO?.district }} {{ detail?.orderAddressVO?.detail }} {{ detail?.orderAddressVO?.postCode }}
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </view>
|
|
|
+ <!-- 商品信息 -->
|
|
|
+ <wd-card type="rectangle" custom-class="px-24rpx! py-6rpx!" custom-content-class="py-18rpx!" custom-title-class="py-18rpx!" @click="toPage('/pages/productDetail/productDetail', { productId: detail?.orderInfoVO?.[0].productId })">
|
|
|
+ <template #title>
|
|
|
+ <view class="flex items-center justify-between">
|
|
|
+ <view class="text-28rpx text-#000">
|
|
|
+ {{ t('orderDetail.address.orderNo') }}:{{ detail?.orderInfoVO?.[0].orderNo }}
|
|
|
+ </view>
|
|
|
+ <wd-text size="26rpx" type="primary" :text="orderStatusEnumData.find((i:any) => i.code === detail?.status)?.name" />
|
|
|
</view>
|
|
|
- <view class="py-4rpx text-24rpx text-#3A444C">
|
|
|
- {{ t('orderDetail.address.color') }}:{{ detail?.orderInfoVO?.[0].sku }}
|
|
|
+ </template>
|
|
|
+ <view class="flex items-center gap-24rpx">
|
|
|
+ <view class="h-140rpx w-140rpx shrink-0">
|
|
|
+ <image
|
|
|
+ :src="detail?.orderInfoVO?.[0]?.image"
|
|
|
+ class="h-full w-full"
|
|
|
+ mode="aspectFit"
|
|
|
+ />
|
|
|
</view>
|
|
|
- <view class="flex items-center justify-between text-24rpx">
|
|
|
- <view class="text-[var(--wot-color-theme)]">
|
|
|
- ৳ {{ formatNumber(detail?.orderInfoVO?.[0].price) }}
|
|
|
+ <view class="flex-1">
|
|
|
+ <view class="line-clamp-2 h-80rpx text-28rpx text-#000">
|
|
|
+ {{ detail?.orderInfoVO?.[0].productName }}
|
|
|
+ </view>
|
|
|
+ <view class="py-4rpx text-24rpx text-#3A444C">
|
|
|
+ {{ t('orderDetail.address.color') }}:{{ detail?.orderInfoVO?.[0].sku }}
|
|
|
</view>
|
|
|
- <view class="text-#3A444C">
|
|
|
- {{ t('orderDetail.address.quantity') }}:{{ detail?.orderInfoVO?.[0].payNum }}
|
|
|
+ <view class="flex items-center justify-between text-24rpx">
|
|
|
+ <view class="text-[var(--wot-color-theme)]">
|
|
|
+ ৳ {{ formatNumber(detail?.orderInfoVO?.[0].price) }}
|
|
|
+ </view>
|
|
|
+ <view class="text-#3A444C">
|
|
|
+ {{ t('orderDetail.address.quantity') }}:{{ detail?.orderInfoVO?.[0].payNum }}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </wd-card>
|
|
|
- <!-- 订单信息 -->
|
|
|
- <view class="bg-white px-24rpx">
|
|
|
- <view class="border-b-1 border-b-#e8e8e8 border-b-solid py-24rpx">
|
|
|
- <view class="mb-12rpx text-28rpx">
|
|
|
- {{ t('orderDetail.summary.title') }}
|
|
|
- </view>
|
|
|
- <view class="flex flex-col gap-16rpx text-#3A444C">
|
|
|
- <view class="flex items-center justify-between text-24rpx">
|
|
|
- <text>SubTotal</text>
|
|
|
- <text>৳{{ formatNumber(detail.totalPrice) }}</text>
|
|
|
+ </wd-card>
|
|
|
+ <!-- 订单信息 -->
|
|
|
+ <view class="bg-white px-24rpx">
|
|
|
+ <view class="border-b-1 border-b-#e8e8e8 border-b-solid py-24rpx">
|
|
|
+ <view class="mb-12rpx text-28rpx">
|
|
|
+ {{ t('orderDetail.summary.title') }}
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view v-if="detail?.status !== 1" class="flex items-center justify-between border-b-1 border-b-#e8e8e8 border-b-solid py-24rpx">
|
|
|
- <view class="text-28rpx">
|
|
|
- {{ t('orderDetail.payment.title') }}
|
|
|
- </view>
|
|
|
- <view class="flex flex-col gap-16rpx text-#3A444C">
|
|
|
- <view class="flex items-center justify-between text-24rpx">
|
|
|
- <text>BandhuBuy Wallet</text>
|
|
|
+ <view class="flex flex-col gap-16rpx text-#3A444C">
|
|
|
+ <view class="flex items-center justify-between text-24rpx">
|
|
|
+ <text>SubTotal</text>
|
|
|
+ <text>৳{{ formatNumber(detail.totalPrice) }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view v-if="detail?.orderStatusVO?.length" class="py-24rpx">
|
|
|
- <template v-for="i in detail?.orderStatusVO" :key="i.id">
|
|
|
- <view v-if="timeMap[i.changeType]" class="mb-16rpx flex flex-col text-#3A444C">
|
|
|
+ <view v-if="detail?.status !== 1" class="flex items-center justify-between border-b-1 border-b-#e8e8e8 border-b-solid py-24rpx">
|
|
|
+ <view class="text-28rpx">
|
|
|
+ {{ t('orderDetail.payment.title') }}
|
|
|
+ </view>
|
|
|
+ <view class="flex flex-col gap-16rpx text-#3A444C">
|
|
|
<view class="flex items-center justify-between text-24rpx">
|
|
|
- <text>{{ timeMap[i.changeType] }}</text>
|
|
|
- <text>{{ i.createTime }}</text>
|
|
|
+ <text>BandhuBuy Wallet</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </template>
|
|
|
+ </view>
|
|
|
+ <view v-if="detail?.orderStatusVO?.length" class="py-24rpx">
|
|
|
+ <template v-for="i in detail?.orderStatusVO" :key="i.id">
|
|
|
+ <view v-if="timeMap[i.changeType]" class="mb-16rpx flex flex-col text-#3A444C">
|
|
|
+ <view class="flex items-center justify-between text-24rpx">
|
|
|
+ <text>{{ timeMap[i.changeType] }}</text>
|
|
|
+ <text>{{ i.createTime }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template #bottom>
|
|
|
<view v-if="detail?.status === 1" class="flex items-center justify-end bg-white/60 px-28rpx py-30rpx backdrop-blur-20">
|
|
|
<!-- 取消订单按钮 -->
|
|
@@ -461,6 +552,7 @@ onUnmounted(() => {
|
|
|
</wd-button>
|
|
|
</view>
|
|
|
</template>
|
|
|
+
|
|
|
<!-- DialogBox 函数式调用 -->
|
|
|
<DialogBox
|
|
|
v-bind="dialogConfig"
|