mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-08-06 02:47:25 +08:00
feat: 添加电子卡券功能及相关逻辑
- 在 pages.json 中新增卡密详情页面路径 - 在多个组件中实现电子卡券(E_COUPON)逻辑,包括库存管理、结算页面处理、订单详情展示等 - 优化商品页面和订单页面以支持电子卡券的特性,隐藏不适用的功能 - 新增 utils/goodsType.js 文件,集中管理与电子卡券相关的类型和工具函数 - 更新样式以适应电子卡券的展示需求
This commit is contained in:
@@ -119,7 +119,7 @@
|
||||
<view class="btn-view">
|
||||
<!-- 售后申请 -->
|
||||
|
||||
<div class="sale" v-if="current === 0 && sku.afterSaleStatus">
|
||||
<div class="sale" v-if="current === 0 && sku.afterSaleStatus && !isECouponOrder(order.orderType)">
|
||||
<div
|
||||
v-if="
|
||||
order.flowPrice != 0 &&
|
||||
@@ -199,6 +199,8 @@ import { ref, reactive, computed } from 'vue'
|
||||
import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import { useStore } from '@/store'
|
||||
import { unitPrice, serviceStatusList, parseGoodsImageUrl } from '@/utils/filters.js'
|
||||
// E_COUPON 订单列表不展示「申请售后」入口(FR-B-04)
|
||||
import { isECouponOrder } from '@/utils/goodsType.js'
|
||||
import { getAfterSaleList, cancelAfterSale } from '@/api/after-sale.js'
|
||||
import { getOrderList } from '@/api/order.js'
|
||||
import storage from '@/utils/storage'
|
||||
|
||||
@@ -63,6 +63,8 @@ import { onLoad } from '@dcloudio/uni-app'
|
||||
import { unitPrice, parseGoodsImageUrl } from '@/utils/filters.js'
|
||||
import { getAfterSaleInfo } from '@/api/after-sale'
|
||||
import storage from '@/utils/storage'
|
||||
// 深链进入时拦截 E_COUPON,后端 apply/save 亦会拒绝
|
||||
import { isECouponOrder } from '@/utils/goodsType.js'
|
||||
|
||||
const sn = ref('')
|
||||
const sku = ref<any>({})
|
||||
@@ -71,6 +73,16 @@ const applyInfo = ref<any>({})
|
||||
onLoad((options) => {
|
||||
sn.value = options?.sn || ''
|
||||
sku.value = storage.getAfterSaleData()
|
||||
if (isECouponOrder(sku.value?.orderType)) {
|
||||
uni.showToast({
|
||||
title: '电子卡券订单不支持售后',
|
||||
icon: 'none',
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
return
|
||||
}
|
||||
init()
|
||||
})
|
||||
|
||||
|
||||
213
pages/order/cardKey/cardKeyDetail.vue
Normal file
213
pages/order/cardKey/cardKeyDetail.vue
Normal file
@@ -0,0 +1,213 @@
|
||||
<!--
|
||||
@Author Mike
|
||||
@Date 2026-07-31
|
||||
-->
|
||||
<template>
|
||||
<view class="card-key-page">
|
||||
<view v-if="loading" class="card-key-page__loading">加载中...</view>
|
||||
<view v-else-if="errorMessage" class="card-key-page__empty">{{ errorMessage }}</view>
|
||||
<view v-else-if="!cardKeyRows.length" class="card-key-page__empty">
|
||||
{{ emptyMessage }}
|
||||
</view>
|
||||
<view v-else>
|
||||
<view
|
||||
class="card-key-item"
|
||||
v-for="(row, index) in cardKeyRows"
|
||||
:key="`${row.cardNo || index}-${index}`"
|
||||
>
|
||||
<view class="card-key-item__title">卡密 {{ index + 1 }}</view>
|
||||
<view class="card-key-item__row">
|
||||
<text class="card-key-item__label">卡号:</text>
|
||||
<text class="card-key-item__value">{{ row.cardNo || '-' }}</text>
|
||||
</view>
|
||||
<view class="card-key-item__row">
|
||||
<text class="card-key-item__label">卡密:</text>
|
||||
<text class="card-key-item__value">{{ row.cardSecret || '-' }}</text>
|
||||
</view>
|
||||
<view class="card-key-item__actions">
|
||||
<view class="card-key-item__copy" @click="copyCardKey(row)">复制</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-key-page__footer">
|
||||
<view class="card-key-page__copy-all" @click="copyAllCardKeys">复制全部</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* @Author Mike
|
||||
* @Date 2026-07-31
|
||||
*
|
||||
* 电子卡券卡密二级页(原型 P-09)。
|
||||
* 数据来源:GET /buyer/order/order/{orderSn} → orderItems[].cardKeys;
|
||||
* 不展示过期时间;未发卡/非 E_COUPON 订单不泄露 cardSecret。
|
||||
*/
|
||||
import { ref, computed } from 'vue'
|
||||
import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import { getOrderDetail } from '@/api/order.js'
|
||||
import { setClipboard } from '@/utils/filters.js'
|
||||
import {
|
||||
isECouponOrder,
|
||||
flattenOrderCardKeys,
|
||||
isCardKeyDelivered,
|
||||
} from '@/utils/goodsType.js'
|
||||
|
||||
const orderSn = ref('')
|
||||
const loading = ref(true)
|
||||
const errorMessage = ref('')
|
||||
const orderItems = ref<any[]>([])
|
||||
const orderStatus = ref('')
|
||||
|
||||
const cardKeyRows = computed(() => flattenOrderCardKeys(orderItems.value))
|
||||
|
||||
const emptyMessage = computed(() => {
|
||||
if (orderStatus.value === 'CANCELLED') {
|
||||
return '订单已关闭,暂无卡密信息'
|
||||
}
|
||||
if (orderStatus.value === 'COMPLETED') {
|
||||
return '卡密尚未发放,请稍后刷新'
|
||||
}
|
||||
return '暂无卡密信息'
|
||||
})
|
||||
|
||||
onLoad((options) => {
|
||||
orderSn.value = options?.sn || ''
|
||||
loadData()
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
loadData(true)
|
||||
})
|
||||
|
||||
function loadData(fromPullDown = false) {
|
||||
if (!orderSn.value) {
|
||||
loading.value = false
|
||||
errorMessage.value = '订单编号无效'
|
||||
if (fromPullDown) uni.stopPullDownRefresh()
|
||||
return
|
||||
}
|
||||
if (!fromPullDown) {
|
||||
loading.value = true
|
||||
errorMessage.value = ''
|
||||
}
|
||||
getOrderDetail(orderSn.value)
|
||||
.then((res) => {
|
||||
if (!res.data.success) {
|
||||
errorMessage.value = res.data.message || '加载失败'
|
||||
return
|
||||
}
|
||||
const result = res.data.result
|
||||
if (!isECouponOrder(result?.order?.orderType)) {
|
||||
errorMessage.value = '该订单不是电子卡券订单'
|
||||
return
|
||||
}
|
||||
orderItems.value = result.orderItems || []
|
||||
orderStatus.value = result.order?.orderStatus || ''
|
||||
// 未 cardKeyDelivered 时不展示卡密(UNPAID/PAID 发卡中或发卡失败)
|
||||
if (!isCardKeyDelivered(orderItems.value)) {
|
||||
orderItems.value = []
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
errorMessage.value = '加载失败,请稍后重试'
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
if (fromPullDown) uni.stopPullDownRefresh()
|
||||
})
|
||||
}
|
||||
|
||||
function copyCardKey(row: any) {
|
||||
const text = `卡号:${row.cardNo || ''}\n卡密:${row.cardSecret || ''}`
|
||||
setClipboard(text)
|
||||
}
|
||||
|
||||
function copyAllCardKeys() {
|
||||
const text = cardKeyRows.value
|
||||
.map(
|
||||
(row, index) =>
|
||||
`${index + 1}. 卡号:${row.cardNo || ''} 卡密:${row.cardSecret || ''}`
|
||||
)
|
||||
.join('\n')
|
||||
if (!text) {
|
||||
uni.showToast({ title: '暂无可复制卡密', icon: 'none' })
|
||||
return
|
||||
}
|
||||
setClipboard(text)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.card-key-page {
|
||||
min-height: 100vh;
|
||||
padding: 24rpx;
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
.card-key-page__loading,
|
||||
.card-key-page__empty {
|
||||
padding: 120rpx 40rpx;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.card-key-item {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 28rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.card-key-item__title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.card-key-item__row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 16rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.card-key-item__label {
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.card-key-item__value {
|
||||
color: #333;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.card-key-item__actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.card-key-item__copy {
|
||||
color: $main-color;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.card-key-page__footer {
|
||||
padding: 20rpx 0 40rpx;
|
||||
}
|
||||
|
||||
.card-key-page__copy-all {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
text-align: center;
|
||||
background: $main-color;
|
||||
color: #fff;
|
||||
border-radius: 44rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -4,7 +4,7 @@
|
||||
<div
|
||||
class="address-box"
|
||||
@click="clickToAddress()"
|
||||
v-if="shippingText == 'LOGISTICS' && orderMessage.cartTypeEnum != 'VIRTUAL'"
|
||||
v-if="shippingText == 'LOGISTICS' && !hidePhysicalCheckout"
|
||||
>
|
||||
<div class="user-box flex">
|
||||
<div class="flex-8">
|
||||
@@ -45,7 +45,7 @@
|
||||
<div class="bar"></div>
|
||||
</div>
|
||||
<!-- 选择自提点 -->
|
||||
<div class="address-box" v-if="shippingText == 'SELF_PICK_UP'">
|
||||
<div class="address-box" v-if="shippingText == 'SELF_PICK_UP' && !isECouponCheckout">
|
||||
<div @click="clickToStoreAddress()">
|
||||
<div class="user-box flex">
|
||||
<div class="flex-8">
|
||||
@@ -201,14 +201,14 @@
|
||||
</u-row>
|
||||
<u-row>
|
||||
<u-col
|
||||
v-if="orderMessage.cartTypeEnum != 'VIRTUAL'"
|
||||
v-if="!hidePhysicalCheckout"
|
||||
:offset="0"
|
||||
:span="9"
|
||||
@click="shippingFlag = true"
|
||||
>配送
|
||||
</u-col>
|
||||
<u-col
|
||||
v-if="orderMessage.cartTypeEnum != 'VIRTUAL'"
|
||||
v-if="!hidePhysicalCheckout"
|
||||
:span="3"
|
||||
textAlign="right"
|
||||
@click="shippingFlag = true"
|
||||
@@ -262,11 +262,11 @@
|
||||
</div>
|
||||
<div>
|
||||
<u-row v-if="shippingText == 'LOGISTICS'">
|
||||
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7"
|
||||
<u-col v-if="!hidePhysicalCheckout" :span="7"
|
||||
>运费</u-col
|
||||
>
|
||||
<u-col
|
||||
v-if="orderMessage.cartTypeEnum != 'VIRTUAL'"
|
||||
v-if="!hidePhysicalCheckout"
|
||||
:span="5"
|
||||
class="tr tipsColor"
|
||||
textAlign="right"
|
||||
@@ -283,6 +283,7 @@
|
||||
</div>
|
||||
<u-row
|
||||
v-if="
|
||||
!isECouponCheckout &&
|
||||
orderMessage.priceDetailDTO.goodsPrice != 0 &&
|
||||
orderMessage.priceDetailDTO.goodsPrice != null
|
||||
"
|
||||
@@ -309,7 +310,7 @@
|
||||
</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<div>
|
||||
<div v-if="!isECouponCheckout">
|
||||
<u-row>
|
||||
<u-col :span="9">优惠金额</u-col>
|
||||
<u-col
|
||||
@@ -324,7 +325,7 @@
|
||||
<u-col :span="3" textAlign="right" v-else>0.00</u-col>
|
||||
</u-row>
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="!isECouponCheckout">
|
||||
<u-row>
|
||||
<u-col :span="6">活动优惠</u-col>
|
||||
<u-col :span="6" class="tr tipsColor" textAlign="right">
|
||||
@@ -400,6 +401,7 @@ import {
|
||||
secrecyMobile,
|
||||
isLogin,
|
||||
} from '@/utils/filters.js'
|
||||
import { hasECouponInCheckout } from '@/utils/goodsType.js'
|
||||
|
||||
const store = useStore()
|
||||
const { proxy } = getCurrentInstance()!
|
||||
@@ -424,8 +426,6 @@ const shippingText = ref('LOGISTICS')
|
||||
const shippingFlag = ref(false)
|
||||
const shippingMethod = ref<ShippingOption[]>([])
|
||||
const isAssemble = ref(false)
|
||||
const remarkFlag = ref(false)
|
||||
const selectAddressId = ref('')
|
||||
const routerVal = ref<Record<string, any>>({})
|
||||
const params = ref<Record<string, any>>({})
|
||||
const couponList = ref('')
|
||||
@@ -445,6 +445,13 @@ const notSupportFreightNoticeText = ref('')
|
||||
const storeAddress = ref<any>('')
|
||||
const originOrderData = ref<any>('')
|
||||
|
||||
// E_COUPON 结算:免地址、无运费/优惠券/促销(O-11);与 VIRTUAL 共用 hidePhysicalCheckout
|
||||
const isECouponCheckout = computed(() => hasECouponInCheckout(orderMessage.value))
|
||||
const isVirtualCheckout = computed(() => orderMessage.value?.cartTypeEnum === 'VIRTUAL')
|
||||
const hidePhysicalCheckout = computed(
|
||||
() => isVirtualCheckout.value || isECouponCheckout.value
|
||||
)
|
||||
|
||||
watch(
|
||||
remarkVal,
|
||||
(val) => {
|
||||
@@ -477,15 +484,15 @@ onBackPress((e) => {
|
||||
})
|
||||
|
||||
onShow(async () => {
|
||||
if (remark.value && remark.value.length > 0) {
|
||||
remarkFlag.value = true
|
||||
}
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
})
|
||||
try {
|
||||
await getOrderList()
|
||||
await getDistribution()
|
||||
// E_COUPON 不需要配送方式
|
||||
if (!isECouponCheckout.value) {
|
||||
await getDistribution()
|
||||
}
|
||||
if (routerVal.value.way == 'PINTUAN') {
|
||||
isAssemble.value = true
|
||||
routerVal.value.parentOrder = JSON.parse(
|
||||
@@ -507,17 +514,16 @@ function getShippingLabel() {
|
||||
|
||||
async function callbackInvoice(val: any) {
|
||||
invoiceFlag.value = false
|
||||
if (!val) return
|
||||
receiptList.value = val
|
||||
if (val) {
|
||||
const submit = {
|
||||
way: routerVal.value.way,
|
||||
...receiptList.value,
|
||||
}
|
||||
const receipt = await API_Order.getReceipt(submit)
|
||||
if (receipt.data.success) {
|
||||
shippingFlag.value = false
|
||||
getOrderList()
|
||||
}
|
||||
const submit = {
|
||||
way: routerVal.value.way,
|
||||
...receiptList.value,
|
||||
}
|
||||
const receipt = await API_Order.getReceipt(submit)
|
||||
if (receipt.data.success) {
|
||||
shippingFlag.value = false
|
||||
getOrderList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -614,7 +620,7 @@ function createTradeFun() {
|
||||
}
|
||||
} else if (
|
||||
shippingText.value === 'LOGISTICS' &&
|
||||
orderMessage.value.cartTypeEnum !== 'VIRTUAL'
|
||||
!hidePhysicalCheckout.value
|
||||
) {
|
||||
if (!address.value.id) {
|
||||
uni.showToast({
|
||||
@@ -737,6 +743,22 @@ async function confirmDistribution(val: any) {
|
||||
}
|
||||
}
|
||||
|
||||
function getSavedRemark(storeId: string, index: number, fallback = '') {
|
||||
const localAtIndex = remarkVal.value[index]
|
||||
if (localAtIndex?.storeId === storeId) {
|
||||
return localAtIndex.remark ?? ''
|
||||
}
|
||||
const localByStore = remarkVal.value.find((r) => r?.storeId === storeId)
|
||||
if (localByStore) {
|
||||
return localByStore.remark ?? ''
|
||||
}
|
||||
const fromStore = (remark.value || []).find((r: any) => r.storeId === storeId)
|
||||
if (fromStore) {
|
||||
return fromStore.remark ?? ''
|
||||
}
|
||||
return fallback ?? ''
|
||||
}
|
||||
|
||||
function getOrderList() {
|
||||
notSupportFreight.value = []
|
||||
notSupportFreightNoticeText.value = ''
|
||||
@@ -766,11 +788,7 @@ function getOrderList() {
|
||||
let repeatData
|
||||
res.data.result.cartList.forEach((item: any, index: number) => {
|
||||
repeatData = {
|
||||
remark: remarkFlag.value
|
||||
? remark.value[index].storeId == item.storeId
|
||||
? remark.value[index].remark
|
||||
: item.remark
|
||||
: item.remark,
|
||||
remark: getSavedRemark(item.storeId, index, item.remark),
|
||||
storeId: item.storeId,
|
||||
}
|
||||
|
||||
@@ -781,12 +799,15 @@ function getOrderList() {
|
||||
;(store.state as any).canUseCoupons = res.data.result.canUseCoupons
|
||||
;(store.state as any).cantUseCoupons = res.data.result.cantUseCoupons
|
||||
|
||||
if (!res.data.result.memberAddress) {
|
||||
getUserAddress()
|
||||
} else {
|
||||
address.value = res.data.result.memberAddress
|
||||
res.data.result.memberAddress.consigneeAddressPath =
|
||||
res.data.result.memberAddress.consigneeAddressPath.split(',')
|
||||
// E_COUPON 免地址,不自动回填 memberAddress
|
||||
if (!hasECouponInCheckout(res.data.result)) {
|
||||
if (!res.data.result.memberAddress) {
|
||||
getUserAddress()
|
||||
} else {
|
||||
address.value = res.data.result.memberAddress
|
||||
res.data.result.memberAddress.consigneeAddressPath =
|
||||
res.data.result.memberAddress.consigneeAddressPath.split(',')
|
||||
}
|
||||
}
|
||||
if (res.data.result.storeAddress) {
|
||||
storeAddress.value = res.data.result.storeAddress
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<u-popup closeable border-radius="28" @close="close" mode="bottom" height="80%" v-model:show="show">
|
||||
<u-popup closeable border-radius="28" @close="onPopupClose" mode="bottom" height="80%" v-model:show="show">
|
||||
|
||||
<div class="wrapper">
|
||||
<!-- 发票类型 -->
|
||||
@@ -143,6 +143,7 @@ const submitData = reactive<SubmitData>({
|
||||
receiptEmail: '',
|
||||
})
|
||||
const show = ref(true)
|
||||
const confirmed = ref(false)
|
||||
const title = ref('')
|
||||
const tips =
|
||||
'电子发票即电子增值税发票,是税局认可的有效凭证,其法律效力、基本用途及使用规定同纸质发票。'
|
||||
@@ -341,8 +342,10 @@ function handleClickHeader(
|
||||
val.active = true
|
||||
}
|
||||
|
||||
function close(val: SubmitData | boolean) {
|
||||
emit('callbackInvoice', val)
|
||||
function onPopupClose() {
|
||||
if (confirmed.value) return
|
||||
show.value = false
|
||||
emit('callbackInvoice', false)
|
||||
}
|
||||
|
||||
function submitInvoice() {
|
||||
@@ -438,8 +441,9 @@ function submitInvoice() {
|
||||
return false
|
||||
}
|
||||
|
||||
confirmed.value = true
|
||||
show.value = false
|
||||
close(submitData)
|
||||
emit('callbackInvoice', { ...submitData })
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -67,11 +67,11 @@
|
||||
</view>
|
||||
<!-- 等待收货 -->
|
||||
<view ripple shape="circle" class="pay-btn" size="mini"
|
||||
v-if="order.allowOperationVO.rog" @click="onRog(order.sn)">
|
||||
v-if="order.allowOperationVO.rog && !isECouponOrder(order.orderType)" @click="onRog(order.sn)">
|
||||
确认收货
|
||||
</view>
|
||||
<view ripple shape="circle" class="cancel-btn" size="mini"
|
||||
v-if="order.groupAfterSaleStatus && ( order.groupAfterSaleStatus.includes('NOT_APPLIED') || order.groupAfterSaleStatus.includes('PART_AFTER_SALE'))"
|
||||
v-if="!isECouponOrder(order.orderType) && order.groupAfterSaleStatus && ( order.groupAfterSaleStatus.includes('NOT_APPLIED') || order.groupAfterSaleStatus.includes('PART_AFTER_SALE'))"
|
||||
@click="applyService(order)">
|
||||
退款/售后
|
||||
</view>
|
||||
@@ -122,6 +122,8 @@ import {
|
||||
tipsToLogin,
|
||||
orderStatusList,
|
||||
} from '@/utils/filters.js'
|
||||
// E_COUPON 订单不展示确认收货、退款/售后(FR-B-04)
|
||||
import { isECouponOrder } from '@/utils/goodsType.js'
|
||||
|
||||
const store = useStore()
|
||||
const { proxy } = getCurrentInstance()!
|
||||
|
||||
@@ -8,11 +8,21 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 物流信息 -->
|
||||
<!-- 物流信息 / 卡密入口 -->
|
||||
<view class="info-view logistics-view">
|
||||
|
||||
<view class="logistics-List">
|
||||
<view class="verificationCode" v-if="order.verificationCode">
|
||||
<view v-if="isECouponOrder" class="card-key-entry">
|
||||
<view v-if="ecouponCardKeyDelivered" class="card-key-entry__btn" @click="goCardKeyDetail">
|
||||
查看卡密
|
||||
</view>
|
||||
<view v-else-if="order.orderStatus === 'COMPLETED'" class="card-key-entry__tip">
|
||||
卡密尚未发放,请稍后刷新
|
||||
</view>
|
||||
<view v-else-if="order.orderStatus === 'CANCELLED'" class="card-key-entry__tip">
|
||||
订单已关闭
|
||||
</view>
|
||||
</view>
|
||||
<view class="verificationCode" v-else-if="order.verificationCode">
|
||||
券码: {{ order.orderStatus == 'CANCELLED' ? '已失效' : order.verificationCode }}
|
||||
</view>
|
||||
<view @click="handleClickDeliver()" class="info-view logi-view" v-else-if="orderPackage && orderPackage.length">
|
||||
@@ -23,14 +33,13 @@
|
||||
点击此处查看
|
||||
</div>
|
||||
</view>
|
||||
<view v-else class="logistics-List-title">
|
||||
<view v-else-if="!isECouponOrder" class="logistics-List-title">
|
||||
{{ '暂无物流信息' }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 地址 -->
|
||||
<view class="info-view" v-if="order.deliveryMethod === 'LOGISTICS' && order.orderType !== 'VIRTUAL'">
|
||||
<view class="info-view" v-if="order.deliveryMethod === 'LOGISTICS' && !isNonPhysicalOrder">
|
||||
<view class="address-view">
|
||||
<view>
|
||||
<view class="address-title">
|
||||
@@ -83,7 +92,7 @@
|
||||
<view class="goods-price">
|
||||
¥{{unitPrice(sku.goodsPrice) }}
|
||||
<!-- <span v-if="sku.point">+{{ sku.point }}积分</span> -->
|
||||
<span style="font-size: 24rpx;margin-left: 14rpx;color: #ff9900;" v-if="sku.isRefund && sku.isRefund !== 'NO_REFUND'">
|
||||
<span style="font-size: 24rpx;margin-left: 14rpx;color: #ff9900;" v-if="!isECouponOrder && sku.isRefund && sku.isRefund !== 'NO_REFUND'">
|
||||
{{refundPriceList(sku.isRefund)}} ({{unitPrice(sku.refundPrice, "¥") }})
|
||||
</span>
|
||||
</view>
|
||||
@@ -103,15 +112,15 @@
|
||||
<view class="title">商品总价:</view>
|
||||
<view class="value">¥{{unitPrice(order.goodsPrice) }}</view>
|
||||
</view>
|
||||
<view class="order-info-view" v-if="order.freightPrice">
|
||||
<view class="order-info-view" v-if="order.freightPrice && !isECouponOrder">
|
||||
<view class="title">运费:</view>
|
||||
<view class="value">¥{{unitPrice(order.freightPrice) }}</view>
|
||||
</view>
|
||||
<view class="order-info-view" v-if="order.priceDetailDTO">
|
||||
<view class="order-info-view" v-if="!isECouponOrder && order.priceDetailDTO">
|
||||
<view class="title">优惠券:</view>
|
||||
<view class="value main-color">-¥{{unitPrice(order.priceDetailDTO.couponPrice) }}</view>
|
||||
</view>
|
||||
<view class="order-info-view">
|
||||
<view class="order-info-view" v-if="!isECouponOrder">
|
||||
<view class="title">活动优惠:</view>
|
||||
<view class="value main-color">-¥{{unitPrice(order.discountPrice) }}</view>
|
||||
</view>
|
||||
@@ -131,7 +140,7 @@
|
||||
<view class="customer-service"
|
||||
v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true"
|
||||
@click="onCancel(order.sn)">取消订单</view>
|
||||
<view class="customer-service" v-if="order.orderStatus == 'DELIVERED'" @click="onLogistics(order)">查看物流</view>
|
||||
<view class="customer-service" v-if="order.orderStatus == 'DELIVERED' && !isECouponOrder" @click="onLogistics(order)">查看物流</view>
|
||||
<view class="customer-service" v-if="order.orderStatus != 'UNPAID' && order.orderPromotionType == 'PINTUAN'"
|
||||
@click="ByUserMessage(order)">查看拼团信息</view>
|
||||
<view class="customer-service"
|
||||
@@ -206,7 +215,7 @@
|
||||
>立即付款</view>
|
||||
<view
|
||||
class="pay-btn"
|
||||
v-if="order.orderStatus == 'DELIVERED'"
|
||||
v-if="order.orderStatus == 'DELIVERED' && !isECouponOrder"
|
||||
@click="onRog(order.sn)"
|
||||
>确认收货</view>
|
||||
<view
|
||||
@@ -262,6 +271,11 @@ import {
|
||||
talkIm,
|
||||
callPhone,
|
||||
} from '@/utils/filters.js'
|
||||
import {
|
||||
isECouponOrder as checkECouponOrder,
|
||||
isNonPhysicalOrder as checkNonPhysicalOrder,
|
||||
isCardKeyDelivered,
|
||||
} from '@/utils/goodsType.js'
|
||||
|
||||
const store = useStore()
|
||||
const lightColor = computed(() => store.getters.lightColor)
|
||||
@@ -292,6 +306,11 @@ const rogShow = ref(false)
|
||||
const reason = ref('')
|
||||
const orderPackage = ref<any>('')
|
||||
|
||||
// orderType=E_COUPON:无物流/核销码,卡密见 cardKeyDetail(API-B-01 orderItems[].cardKeys)
|
||||
const isECouponOrder = computed(() => checkECouponOrder(order.value?.orderType))
|
||||
const isNonPhysicalOrder = computed(() => checkNonPhysicalOrder(order.value?.orderType))
|
||||
const ecouponCardKeyDelivered = computed(() => isCardKeyDelivered(orderGoodsList.value))
|
||||
|
||||
function hideLoadingIfNeeded() {
|
||||
if (store.state.isShowToast) uni.hideLoading()
|
||||
}
|
||||
@@ -376,7 +395,12 @@ function loadData(orderSnParam: string) {
|
||||
order.value = result.order
|
||||
orderGoodsList.value = result.orderItems
|
||||
orderDetail.value = result
|
||||
if (order.value.deliveryMethod === 'LOGISTICS') {
|
||||
if (
|
||||
result.order.deliveryMethod === 'LOGISTICS' &&
|
||||
!checkECouponOrder(result.order.orderType) &&
|
||||
result.order.orderType !== 'VIRTUAL'
|
||||
) {
|
||||
// E_COUPON 无物流信息
|
||||
loadLogistics(orderSnParam)
|
||||
getOrderPackage()
|
||||
}
|
||||
@@ -384,6 +408,14 @@ function loadData(orderSnParam: string) {
|
||||
})
|
||||
}
|
||||
|
||||
function goCardKeyDetail() {
|
||||
// 仅传 orderSn,卡密在二级页重新请求订单详情,不经路由/Vuex 传递明文
|
||||
if (!sn.value) return
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/cardKey/cardKeyDetail?sn=${sn.value}`,
|
||||
})
|
||||
}
|
||||
|
||||
function onReceipt(val: any) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/invoice/invoiceDetail?id=' + val.id,
|
||||
@@ -716,6 +748,26 @@ page,
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.card-key-entry {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.card-key-entry__btn {
|
||||
display: inline-block;
|
||||
padding: 20rpx 80rpx;
|
||||
border: 2rpx solid $main-color;
|
||||
border-radius: 12rpx;
|
||||
color: $main-color;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.card-key-entry__tip {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.bottom_view {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
|
||||
Reference in New Issue
Block a user