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>
<!-- 收货地址 --> <!-- 收货地址 -->
<view class="address-section" v-if="orderDetail"> <view class="address-section" v-if="orderDetail.receiverArea">
<view class="section-title">收货地址</view> <view class="section-title">收货地址</view>
<view class="address-card"> <view class="address-card">
<view class="address-text"> <view class="address-text">
@ -26,28 +26,29 @@
<!-- 商品列表 --> <!-- 商品列表 -->
<view class="goods-section"> <view class="goods-section">
<view class="section-title">商品信息</view> <view class="section-title">商品信息</view>
<view <view class="goods-list">
class="goods-item" <view
v-for="(goods, index) in orderDetail.orderItems" class="goods-item"
:key="goods.id" v-for="goods in orderDetail.orderItems"
:class="{ 'last-item': index === orderDetail.orderItems.length - 1 }" :key="goods.id"
> >
<view class="goods-image-container"> <view class="goods-image-container">
<image mode="aspectFill" :src="goods.specImage" class="goods-image" /> <image mode="aspectFill" :src="goods.specImage" class="goods-image" />
</view> </view>
<view class="goods-content"> <view class="goods-content">
<view class="goods-info"> <view class="goods-info">
<view class="goods-name">{{ goods.goodsName || "-" }}</view> <view class="goods-name">{{ goods.goodsName || "-" }}</view>
<view class="goods-specs"> <view class="goods-specs">
<view class="spec-tag"> <view class="spec-tag">
{{ goods.specValueOne }}-{{ goods.specValueTwo }} {{ 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>
<view class="goods-quantity-price">
<text class="goods-quantity"
>数量{{ goods.quantity || 1 }}</text
>
<text class="goods-price">¥{{ goods.price }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -69,7 +70,7 @@
</view> </view>
<view class="summary-row" v-if="orderDetail.usePoints == 0"> <view class="summary-row" v-if="orderDetail.usePoints == 0">
<text class="summary-label">积分抵扣</text> <text class="summary-label">积分抵扣</text>
<text class="summary-value points-deduct" <text class="summary-value"
>-¥{{ orderDetail.pointsDeductAmount || "0.00" }}</text >-¥{{ orderDetail.pointsDeductAmount || "0.00" }}</text
> >
</view> </view>
@ -82,32 +83,6 @@
</view> </view>
</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="order-info-section">
<view class="section-title">订单信息</view> <view class="section-title">订单信息</view>
@ -143,6 +118,29 @@
<text class="info-label">订单备注</text> <text class="info-label">订单备注</text>
<text class="info-value">{{ orderDetail.remark }}</text> <text class="info-value">{{ orderDetail.remark }}</text>
</view> </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> </view>
<!-- 底部按钮占位div --> <!-- 底部按钮占位div -->
@ -151,26 +149,19 @@
<!-- 底部操作 --> <!-- 底部操作 -->
<view class="bottom-actions" v-if="showBottomActions"> <view class="bottom-actions" v-if="showBottomActions">
<button <button
class="action-btn-bottom cancel-btn" class="action-btn-bottom"
@click="handleOrderAction('cancel')"
v-if="orderDetail.status === 0"
>
取消订单
</button>
<button
class="action-btn-bottom primary-btn"
@click="handleOrderAction('pay')" @click="handleOrderAction('pay')"
v-if="orderDetail.status === 0" v-if="orderDetail.status === 0"
> >
去支付 去支付
</button> </button>
<button <!-- <button
class="action-btn-bottom" class="action-btn-bottom"
@click="handleOrderAction('logistics')" @click="handleOrderAction('logistics')"
v-if="[2, 3].includes(orderDetail.status)" v-if="[2, 3].includes(orderDetail.status)"
> >
查看物流 查看物流
</button> </button> -->
<button <button
class="action-btn-bottom confirm-btn" class="action-btn-bottom confirm-btn"
@click="handleOrderAction('confirm')" @click="handleOrderAction('confirm')"
@ -178,13 +169,6 @@
> >
确认收货 确认收货
</button> </button>
<button
class="action-btn-bottom contact-btn"
@click="handleOrderAction('contact')"
v-if="[1, 2].includes(orderDetail.status)"
>
联系供应商
</button>
<button <button
class="action-btn-bottom after-sale-btn" class="action-btn-bottom after-sale-btn"
@click="handleOrderAction('aftersale')" @click="handleOrderAction('aftersale')"
@ -280,7 +264,7 @@ export default {
computed: { computed: {
// //
showBottomActions() { showBottomActions() {
return [0, 1, 2, 3].includes(this.orderDetail.status); return [0, 2, 3].includes(this.orderDetail.status);
}, },
}, },
onLoad(options) { onLoad(options) {
@ -370,9 +354,6 @@ export default {
case "pay": case "pay":
this.goToPay(); this.goToPay();
break; break;
case "cancel":
this.cancelOrder();
break;
case "logistics": case "logistics":
this.showLogisticsDetail(); this.showLogisticsDetail();
break; 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() { goToPay() {
this.Post( uni.navigateTo({
{ url: `/pages/payment/index?orderId=${this.orderId}`,
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",
});
},
});
}); });
}, },
@ -521,29 +429,25 @@ export default {
title: "确认中...", title: "确认中...",
}); });
this.Post( this.Post({}, `/framework/ygOrder/finish/${this.orderId}`, "DES").then(
{ (res) => {
orderId: this.orderId, uni.hideLoading();
}, if (res.code == 200) {
"/framework/haveFeeling/order/confirm", uni.showToast({
"DES" title: "确认收货成功",
).then((res) => { icon: "success",
uni.hideLoading(); });
if (res.code == 200) { setTimeout(() => {
uni.showToast({ this.loadOrderDetail();
title: "确认收货成功", }, 800);
icon: "success", } else {
}); uni.showToast({
setTimeout(() => { title: res.msg || "确认收货失败",
this.loadOrderDetail(); icon: "none",
}, 800); });
} else { }
uni.showToast({
title: res.msg || "确认收货失败",
icon: "none",
});
} }
}); );
}, },
// //
@ -557,8 +461,20 @@ export default {
// //
applyAfterSale() { applyAfterSale() {
uni.navigateTo({ // iSoul
url: `/subPackages/haveFeeling/aftersale?orderId=${this.orderId}`, 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() { copyExpressNo() {
if (this.orderDetail.expressNo) { if (this.orderDetail.expressNo) {
@ -616,28 +547,23 @@ export default {
color: #fff; color: #fff;
&.status-pending { &.status-pending {
background-color: #fff3cd; background-color: #ff9500;
color: #856404;
} }
&.status-paid { &.status-paid {
background-color: #e6f3ff; background-color: #007aff;
color: #0c5460;
} }
&.status-cancelled { &.status-cancelled {
background-color: #f8d7da; background-color: #ff3b30;
color: #721c24;
} }
&.status-shipping { &.status-shipping {
background-color: #d4edda; background-color: #34c759;
color: #155724;
} }
&.status-completed { &.status-completed {
background-color: #d1ecf1; background-color: #48bb78;
color: #0c5460;
} }
} }
@ -699,8 +625,7 @@ export default {
padding: 24rpx 0; padding: 24rpx 0;
border-bottom: 1rpx solid #f0f0f0; border-bottom: 1rpx solid #f0f0f0;
&:last-child, &:last-child {
&.last-item {
border-bottom: none; border-bottom: none;
} }
} }
@ -809,10 +734,6 @@ export default {
font-size: 28rpx; font-size: 28rpx;
color: #f56565; color: #f56565;
} }
&.points-deduct {
color: #48bb78;
}
} }
// //
@ -909,46 +830,32 @@ export default {
.action-btn-bottom { .action-btn-bottom {
flex: 1; flex: 1;
padding: 20rpx 0;
border-radius: 10rpx; border-radius: 10rpx;
font-size: 30rpx; font-size: 26rpx;
font-weight: 600; font-weight: 600;
border: none; border: none;
text-align: center; color: #333333;
transition: all 0.3s ease; transition: all 0.3s ease;
min-height: 48rpx; text-align: center;
line-height: 48rpx; background-color: #77f3f9;
background-color: #f5f5f5; height: 88rpx;
color: #666; align-items: center;
display: flex;
&.primary-btn { justify-content: center;
background-color: #007aff;
color: #fff;
}
&.cancel-btn {
background-color: #f5f5f5;
color: #666;
border: 1rpx solid #ddd;
}
&.confirm-btn { &.confirm-btn {
background-color: #48bb78; background-color: #48bb78;
color: #fff; color: #ffffff;
} }
&.contact-btn { &.contact-btn {
background-color: #77f3f9; background-color: #007aff;
color: #333; color: #ffffff;
} }
&.after-sale-btn { &.after-sale-btn {
background-color: #ff4757; background-color: #ff4757;
color: #fff; color: #ffffff;
}
&:active {
transform: scale(0.98);
} }
} }
} }

33
subPackages/haveFeeling/list.vue

@ -94,13 +94,6 @@
> >
去支付 去支付
</button> </button>
<button
class="action-btn"
@click.stop="handleOrderAction(order, 'logistics')"
v-if="[2, 3].includes(order.status)"
>
查看物流
</button>
<button <button
class="action-btn confirm-btn" class="action-btn confirm-btn"
@click.stop="handleOrderAction(order, 'confirm')" @click.stop="handleOrderAction(order, 'confirm')"
@ -108,13 +101,6 @@
> >
确认收货 确认收货
</button> </button>
<button
class="action-btn"
@click.stop="handleOrderAction(order, 'contact')"
v-if="[1, 2].includes(order.status)"
>
联系供应商
</button>
<button <button
class="action-btn secondary-btn" class="action-btn secondary-btn"
@click.stop="handleOrderAction(order, 'aftersale')" @click.stop="handleOrderAction(order, 'aftersale')"
@ -189,6 +175,7 @@ export default {
hasMore: true, hasMore: true,
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
currentOrder: null, //
}; };
}, },
onLoad(e) { onLoad(e) {
@ -418,8 +405,22 @@ export default {
// //
applyAfterSale(order) { applyAfterSale(order) {
uni.navigateTo({ this.currentOrder = order;
url: `/subPackages/haveFeeling/aftersale?orderId=${order.id}`, // 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