Browse Source

订单扭转

dev_des
1054425342@qq.com 1 month ago
parent
commit
53264cb6e4
  1. 329
      subPackages/haveFeeling/detail.vue
  2. 33
      subPackages/haveFeeling/list.vue

329
subPackages/haveFeeling/detail.vue

@ -9,7 +9,7 @@
</view>
<!-- 收货地址 -->
<view class="address-section" v-if="orderDetail">
<view class="address-section" v-if="orderDetail.receiverArea">
<view class="section-title">收货地址</view>
<view class="address-card">
<view class="address-text">
@ -26,28 +26,29 @@
<!-- 商品列表 -->
<view class="goods-section">
<view class="section-title">商品信息</view>
<view
class="goods-item"
v-for="(goods, index) in orderDetail.orderItems"
:key="goods.id"
:class="{ 'last-item': index === orderDetail.orderItems.length - 1 }"
>
<view class="goods-image-container">
<image mode="aspectFill" :src="goods.specImage" class="goods-image" />
</view>
<view class="goods-content">
<view class="goods-info">
<view class="goods-name">{{ goods.goodsName || "-" }}</view>
<view class="goods-specs">
<view class="spec-tag">
{{ goods.specValueOne }}-{{ goods.specValueTwo }}
<view class="goods-list">
<view
class="goods-item"
v-for="goods in orderDetail.orderItems"
:key="goods.id"
>
<view class="goods-image-container">
<image mode="aspectFill" :src="goods.specImage" class="goods-image" />
</view>
<view class="goods-content">
<view class="goods-info">
<view class="goods-name">{{ goods.goodsName || "-" }}</view>
<view class="goods-specs">
<view class="spec-tag">
{{ goods.specValueOne }}-{{ goods.specValueTwo }}
</view>
</view>
<view class="goods-quantity-price">
<text class="goods-quantity"
>数量{{ goods.quantity || 1 }}</text
>
<text class="goods-price">¥{{ goods.price }}</text>
</view>
</view>
<view class="goods-quantity-price">
<text class="goods-quantity"
>数量{{ goods.quantity || 1 }}</text
>
<text class="goods-price">¥{{ goods.price }}</text>
</view>
</view>
</view>
@ -69,7 +70,7 @@
</view>
<view class="summary-row" v-if="orderDetail.usePoints == 0">
<text class="summary-label">积分抵扣</text>
<text class="summary-value points-deduct"
<text class="summary-value"
>-¥{{ orderDetail.pointsDeductAmount || "0.00" }}</text
>
</view>
@ -82,32 +83,6 @@
</view>
</view>
<!-- 物流信息 -->
<view
class="logistics-section"
v-if="[2, 3].includes(orderDetail.status)"
>
<view class="section-title">物流信息</view>
<view class="logistics-card" @click="showLogisticsDetail">
<view class="logistics-info">
<view class="logistics-company">
<text class="company-name">{{
orderDetail.expressCompany || "待发货"
}}</text>
<text class="express-no" v-if="orderDetail.expressNo">{{
orderDetail.expressNo
}}</text>
</view>
<view class="logistics-status">
{{ getLogisticsStatusText(orderDetail.logisticsStatus) }}
</view>
</view>
<view class="logistics-arrow">
<uni-icons type="right" size="16" color="#999" />
</view>
</view>
</view>
<!-- 订单信息 -->
<view class="order-info-section">
<view class="section-title">订单信息</view>
@ -143,6 +118,29 @@
<text class="info-label">订单备注</text>
<text class="info-value">{{ orderDetail.remark }}</text>
</view>
<view
class="info-row"
v-if="orderDetail.delivery && orderDetail.delivery.expressName"
>
<text class="info-label">快递公司</text>
<text class="info-value">{{ orderDetail.delivery.expressName }}</text>
</view>
<view
class="info-row"
v-if="orderDetail.delivery && orderDetail.delivery.expressCode"
>
<text class="info-label">快递单号</text>
<text class="info-value" @longpress="copyExpressCode">{{
orderDetail.delivery.expressCode
}}</text>
</view>
<view
class="info-row"
v-if="orderDetail.delivery && orderDetail.delivery.expressTime"
>
<text class="info-label">发货时间</text>
<text class="info-value">{{ orderDetail.delivery.expressTime }}</text>
</view>
</view>
<!-- 底部按钮占位div -->
@ -151,26 +149,19 @@
<!-- 底部操作 -->
<view class="bottom-actions" v-if="showBottomActions">
<button
class="action-btn-bottom cancel-btn"
@click="handleOrderAction('cancel')"
v-if="orderDetail.status === 0"
>
取消订单
</button>
<button
class="action-btn-bottom primary-btn"
class="action-btn-bottom"
@click="handleOrderAction('pay')"
v-if="orderDetail.status === 0"
>
去支付
</button>
<button
<!-- <button
class="action-btn-bottom"
@click="handleOrderAction('logistics')"
v-if="[2, 3].includes(orderDetail.status)"
>
查看物流
</button>
</button> -->
<button
class="action-btn-bottom confirm-btn"
@click="handleOrderAction('confirm')"
@ -178,13 +169,6 @@
>
确认收货
</button>
<button
class="action-btn-bottom contact-btn"
@click="handleOrderAction('contact')"
v-if="[1, 2].includes(orderDetail.status)"
>
联系供应商
</button>
<button
class="action-btn-bottom after-sale-btn"
@click="handleOrderAction('aftersale')"
@ -280,7 +264,7 @@ export default {
computed: {
//
showBottomActions() {
return [0, 1, 2, 3].includes(this.orderDetail.status);
return [0, 2, 3].includes(this.orderDetail.status);
},
},
onLoad(options) {
@ -370,9 +354,6 @@ export default {
case "pay":
this.goToPay();
break;
case "cancel":
this.cancelOrder();
break;
case "logistics":
this.showLogisticsDetail();
break;
@ -388,83 +369,10 @@ export default {
}
},
//
cancelOrder() {
uni.showModal({
title: "取消订单",
content: "确定要取消这个订单吗?",
success: (res) => {
if (res.confirm) {
this.cancelOrderApi();
}
},
});
},
// API
cancelOrderApi() {
uni.showLoading({
title: "取消中...",
});
this.Post(
{ orderId: this.orderId },
"/framework/ygOrder/cancel",
"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",
});
}
});
},
//
goToPay() {
this.Post(
{
method: "POST",
orderNo: this.orderDetail.orderNo,
fromType: 2,
payAmount: this.orderDetail.payAmount,
},
"/framework/wxPay/submitShopPurOrder",
"DES"
).then((res) => {
uni.requestPayment({
nonceStr: res.data.wxInfo.nonceStr,
package: res.data.wxInfo.package,
paySign: res.data.wxInfo.paySign,
signType: res.data.wxInfo.signType,
timeStamp: res.data.wxInfo.timeStamp,
success: () => {
uni.showToast({
title: "支付成功",
icon: "success",
});
//
setTimeout(() => {
this.loadOrderDetail();
}, 800);
},
fail() {
uni.showToast({
title: "支付失败",
icon: "none",
});
},
});
uni.navigateTo({
url: `/pages/payment/index?orderId=${this.orderId}`,
});
},
@ -521,29 +429,25 @@ export default {
title: "确认中...",
});
this.Post(
{
orderId: this.orderId,
},
"/framework/haveFeeling/order/confirm",
"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",
});
this.Post({}, `/framework/ygOrder/finish/${this.orderId}`, "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",
});
}
}
});
);
},
//
@ -557,8 +461,20 @@ export default {
//
applyAfterSale() {
uni.navigateTo({
url: `/subPackages/haveFeeling/aftersale?orderId=${this.orderId}`,
// iSoul
uni.showModal({
title: "申请售后",
content:
"客服电话:0515-69186109\n服务时间:周一至周五\n9:00-12:00,13:00-18:00\n\n是否联系客服申请售后?",
confirmText: "联系客服",
success: (res) => {
if (res.confirm) {
//
uni.makePhoneCall({
phoneNumber: "0515-69186109",
});
}
},
});
},
@ -575,6 +491,21 @@ export default {
});
},
//
copyExpressCode() {
if (this.orderDetail.delivery && this.orderDetail.delivery.expressCode) {
uni.setClipboardData({
data: this.orderDetail.delivery.expressCode,
success: () => {
uni.showToast({
title: "快递单号已复制",
icon: "success",
});
},
});
}
},
//
copyExpressNo() {
if (this.orderDetail.expressNo) {
@ -616,28 +547,23 @@ export default {
color: #fff;
&.status-pending {
background-color: #fff3cd;
color: #856404;
background-color: #ff9500;
}
&.status-paid {
background-color: #e6f3ff;
color: #0c5460;
background-color: #007aff;
}
&.status-cancelled {
background-color: #f8d7da;
color: #721c24;
background-color: #ff3b30;
}
&.status-shipping {
background-color: #d4edda;
color: #155724;
background-color: #34c759;
}
&.status-completed {
background-color: #d1ecf1;
color: #0c5460;
background-color: #48bb78;
}
}
@ -699,8 +625,7 @@ export default {
padding: 24rpx 0;
border-bottom: 1rpx solid #f0f0f0;
&:last-child,
&.last-item {
&:last-child {
border-bottom: none;
}
}
@ -809,10 +734,6 @@ export default {
font-size: 28rpx;
color: #f56565;
}
&.points-deduct {
color: #48bb78;
}
}
//
@ -909,46 +830,32 @@ export default {
.action-btn-bottom {
flex: 1;
padding: 20rpx 0;
border-radius: 10rpx;
font-size: 30rpx;
font-size: 26rpx;
font-weight: 600;
border: none;
text-align: center;
color: #333333;
transition: all 0.3s ease;
min-height: 48rpx;
line-height: 48rpx;
background-color: #f5f5f5;
color: #666;
&.primary-btn {
background-color: #007aff;
color: #fff;
}
&.cancel-btn {
background-color: #f5f5f5;
color: #666;
border: 1rpx solid #ddd;
}
text-align: center;
background-color: #77f3f9;
height: 88rpx;
align-items: center;
display: flex;
justify-content: center;
&.confirm-btn {
background-color: #48bb78;
color: #fff;
color: #ffffff;
}
&.contact-btn {
background-color: #77f3f9;
color: #333;
background-color: #007aff;
color: #ffffff;
}
&.after-sale-btn {
background-color: #ff4757;
color: #fff;
}
&:active {
transform: scale(0.98);
color: #ffffff;
}
}
}

33
subPackages/haveFeeling/list.vue

@ -94,13 +94,6 @@
>
去支付
</button>
<button
class="action-btn"
@click.stop="handleOrderAction(order, 'logistics')"
v-if="[2, 3].includes(order.status)"
>
查看物流
</button>
<button
class="action-btn confirm-btn"
@click.stop="handleOrderAction(order, 'confirm')"
@ -108,13 +101,6 @@
>
确认收货
</button>
<button
class="action-btn"
@click.stop="handleOrderAction(order, 'contact')"
v-if="[1, 2].includes(order.status)"
>
联系供应商
</button>
<button
class="action-btn secondary-btn"
@click.stop="handleOrderAction(order, 'aftersale')"
@ -189,6 +175,7 @@ export default {
hasMore: true,
currentPage: 1,
pageSize: 10,
currentOrder: null, //
};
},
onLoad(e) {
@ -418,8 +405,22 @@ export default {
//
applyAfterSale(order) {
uni.navigateTo({
url: `/subPackages/haveFeeling/aftersale?orderId=${order.id}`,
this.currentOrder = order;
// iSoul
uni.showModal({
title: "申请售后",
content:
"客服电话:0515-69186109\n服务时间:周一至周五\n9:00-12:00,13:00-18:00\n\n是否联系客服申请售后?",
confirmText: "联系客服",
success: (res) => {
if (res.confirm) {
//
uni.makePhoneCall({
phoneNumber: "0515-69186109",
});
}
},
});
},

Loading…
Cancel
Save