Browse Source

订单逻辑判断

dev_des
1054425342@qq.com 2 months ago
parent
commit
56b77a075a
  1. 139
      subPackages/orderQy/detail.vue
  2. 10
      subPackages/orderQy/list.vue

139
subPackages/orderQy/detail.vue

@ -38,14 +38,27 @@
<view class="goods-content"> <view class="goods-content">
<view class="goods-info"> <view class="goods-info">
<view class="goods-name">{{ goods.goodsTitle || "-" }}</view> <view class="goods-name">{{ goods.goodsTitle || "-" }}</view>
<view class="goods-name" v-if="goods.skuName">{{ goods.skuName || "-" }}</view> <view class="goods-name" v-if="goods.skuName">{{
goods.skuName || "-"
}}</view>
<view class="goods-desc">{{ getGoodsTypeName(goods.type) }}</view> <view class="goods-desc">{{ getGoodsTypeName(goods.type) }}</view>
<view class="goods-quantity">数量{{ goods.num || 1 }}</view> <view class="goods-quantity">数量{{ goods.num || 1 }}</view>
<view class="goods-specs" v-if="goods.orderExchangeVo && goods.orderExchangeVo.orderExchangeDetailVos"> <view
<view class="spec-tag" v-for="(item, index) in goods.orderExchangeVo.orderExchangeDetailVos" :key="index"> class="goods-specs"
{{item.specValueOne}} / {{item.specValueTwo}} v-if="
</view> goods.orderExchangeVo &&
</view> goods.orderExchangeVo.orderExchangeDetailVos
"
>
<view
class="spec-tag"
v-for="(item, index) in goods.orderExchangeVo
.orderExchangeDetailVos"
:key="index"
>
{{ item.specValueOne }} / {{ item.specValueTwo }}
</view>
</view>
</view> </view>
<view class="goods-actions"> <view class="goods-actions">
<button <button
@ -55,9 +68,31 @@
> >
{{ getGoodsActionText(goods.type) }} {{ getGoodsActionText(goods.type) }}
</button> </button>
<button v-else class="action-btn" @click="handleGoodsAction(goods)"> <template v-else>
{{ getGoodsActionTexted(goods.type) }} <template v-if="goods.type == 2">
</button> <button
v-if="goods.type == 2 && goods.status == 3"
class="action-btn confirm-btn"
@click="confirmReceipt(goods)"
>
确认收货
</button>
<button
v-if="goods.type == 2 && goods.status != 1"
class="action-btn "
@click="showLogisticsInfo(goods)"
>
查看物流
</button>
</template>
<button
v-else
class="action-btn"
@click="handleGoodsAction(goods)"
>
{{ getGoodsActionTexted(goods.type) }}
</button>
</template>
</view> </view>
</view> </view>
</view> </view>
@ -88,7 +123,9 @@
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="info-label">权益码</text> <text class="info-label">权益码</text>
<text class="info-value" style="font-family: Courier New;">{{ orderDetail.activeCode }}</text> <text class="info-value" style="font-family: Courier New">{{
orderDetail.activeCode
}}</text>
</view> </view>
<!-- <view class="info-row"> <!-- <view class="info-row">
<text class="info-label">商品合计</text> <text class="info-label">商品合计</text>
@ -196,8 +233,8 @@
<view class="logistics-section" v-if="currentGoodsInfo"> <view class="logistics-section" v-if="currentGoodsInfo">
<view class="section-title">商品状态</view> <view class="section-title">商品状态</view>
<view class="status-info"> <view class="status-info">
<view <view
class="status-badge-popup" class="status-badge-popup"
:class="[getGoodsStatusClass(currentGoodsInfo.status)]" :class="[getGoodsStatusClass(currentGoodsInfo.status)]"
> >
{{ getGoodsStatusText(currentGoodsInfo.status) }} {{ getGoodsStatusText(currentGoodsInfo.status) }}
@ -226,7 +263,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="logistics-section"> <view class="logistics-section">
<view class="section-title">备注</view> <view class="section-title">备注</view>
<view class="info-item"> <view class="info-item">
<text class="info-value">{{ <text class="info-value">{{
@ -250,27 +287,34 @@
<view class="info-item"> <view class="info-item">
<text class="info-label">快递公司</text> <text class="info-label">快递公司</text>
<text class="info-value">{{ <text class="info-value">{{
currentLogisticsInfo.expressName || "--" currentGoodsInfo.expressCompany || "--"
}}</text> }}</text>
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="info-label">快递单号</text> <text class="info-label">快递单号</text>
<text class="info-value">{{ <text class="info-value">{{
currentLogisticsInfo.expressCode || "--" currentGoodsInfo.expressCode || "--"
}}</text> }}</text>
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="info-label">实际发货时间</text> <text class="info-label">实际发货时间</text>
<text class="info-value">{{ <text class="info-value">{{
currentLogisticsInfo.deliveryTime || "--" currentGoodsInfo.expressTime || "--"
}}</text> }}</text>
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="info-label">发货人</text> <text class="info-label">发货人</text>
<text class="info-value">{{ <text class="info-value">{{
currentLogisticsInfo.deliveryUserName || "--" currentGoodsInfo.deliveryUserName || "--"
}}</text> }}</text>
</view> </view>
<view class="info-item">
<text class="info-label">收货时间</text>
<text class="info-value">{{
currentGoodsInfo.completeTime || "--"
}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -505,7 +549,7 @@ export default {
icon: "none", icon: "none",
}); });
uni.navigateTo({ uni.navigateTo({
url: "/subPackages/memorialAlbum/detail?id="+goods.childId, url: "/subPackages/memorialAlbum/detail?id=" + goods.childId,
}); });
}, },
@ -648,6 +692,56 @@ export default {
}, 500); }, 500);
}); });
}, },
//
async confirmReceipt(goods) {
uni.showModal({
title: "确认收货",
content: "确认已收到商品吗?",
success: (res) => {
if (res.confirm) {
try {
uni.showLoading({
title: "确认中...",
});
// API
this.Post(
{
childOrderId: goods.childId,
},
"/framework/order/complete",
"DES"
).then((res) => {
uni.hideLoading();
if (res.code == 200) {
uni.showToast({
title: "确认收货成功",
icon: "success",
});
//
setTimeout(() =>{
this.loadOrderDetail();
},800)
} else {
uni.showToast({
title: res.msg || "确认收货失败",
icon: "none",
});
}
});
} catch (error) {
uni.hideLoading();
console.error("确认收货失败:", error);
uni.showToast({
title: "确认收货失败",
icon: "none",
});
}
}
},
});
},
}, },
}; };
</script> </script>
@ -890,7 +984,16 @@ export default {
height: 55rpx; height: 55rpx;
line-height: 55rpx; line-height: 55rpx;
} }
.confirm-btn {
background-color: #34c759;
color: #ffffff;
}
.logistics-btn {
background-color: #007aff;
color: #ffffff;
margin-top: 10rpx;
}
// //
.amount-summary { .amount-summary {
padding: 20rpx 30rpx; padding: 20rpx 30rpx;

10
subPackages/orderQy/list.vue

@ -18,10 +18,7 @@
class="order-scroll" class="order-scroll"
scroll-y scroll-y
@scrolltolower="loadMore" @scrolltolower="loadMore"
refresher-enabled
:show-scrollbar="false" :show-scrollbar="false"
:refresher-triggered="refresherTriggered"
@refresherrefresh="onRefresh"
enhanced enhanced
> >
<!-- 订单项 --> <!-- 订单项 -->
@ -85,6 +82,7 @@
{{ getActionBtnText(goods.type) }} {{ getActionBtnText(goods.type) }}
</button> </button>
<template v-else> <template v-else>
<button <button
v-if="!(goods.type==2&&goods.status==2)" v-if="!(goods.type==2&&goods.status==2)"
class="action-btn" class="action-btn"
@ -365,7 +363,7 @@ export default {
getActionBtnTexted(type) { getActionBtnTexted(type) {
const textMap = { const textMap = {
1: "查看", 1: "查看",
2: "已使用", 2: "查看物流",
3: "已使用", 3: "已使用",
}; };
return textMap[type] || "操作"; return textMap[type] || "操作";
@ -415,6 +413,10 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: `/subPackages/orderQy/confrim?goodsId=${goods.goodsId}&orderChildId=${goods.childId}`, url: `/subPackages/orderQy/confrim?goodsId=${goods.goodsId}&orderChildId=${goods.childId}`,
}); });
}else{
uni.navigateTo({
url: `/subPackages/orderQy/detail?id=${goods.orderId}`,
});
} }
}, },

Loading…
Cancel
Save