fixed 修改订单状态跳转问题

This commit is contained in:
AERWEN\26795 2023-10-25 01:39:10 +08:00
parent 573f8800bb
commit adeac5fbbb
6 changed files with 47 additions and 49 deletions

View File

@ -1,9 +1,9 @@
export const OrderStatus = { export const OrderStatus = {
PENDING_PAYMENT: 5, // 待支付 PENDING_PAYMENT: 1, // 待支付
PENDING_DELIVERY: 10, // 待发货 PENDING_DELIVERY: 2, // 待发货
PENDING_RECEIPT: 40, // 待收货 PENDING_RECEIPT: 3, // 待收货
COMPLETE: 50, // 已完成/待评价 COMPLETE: 4, // 已完成/待评价
PAYMENT_TIMEOUT: 80, // 已取消,支付超时 PAYMENT_TIMEOUT: 5, // 已取消,支付超时
CANCELED_NOT_PAYMENT: 80, // 已取消,未支付主动取消 CANCELED_NOT_PAYMENT: 80, // 已取消,未支付主动取消
CANCELED_PAYMENT: 80, // 已取消,已支付主动取消 CANCELED_PAYMENT: 80, // 已取消,已支付主动取消
CANCELED_REJECTION: 80, // 已取消,拒收 CANCELED_REJECTION: 80, // 已取消,拒收

View File

@ -16,6 +16,7 @@ Page({
} catch (e) { } catch (e) {
console.warn('物流节点数据解析失败', e); console.warn('物流节点数据解析失败', e);
} }
console.log(data.nodes,'查看节点');
if (Number(query.source) === 2) { if (Number(query.source) === 2) {
const service = { const service = {
company: data.logisticsCompanyName, company: data.logisticsCompanyName,

View File

@ -123,11 +123,12 @@ Page({
skuId: goods.skuId, skuId: goods.skuId,
spuId: goods.spuId, spuId: goods.spuId,
specs: (goods.specifications || []).map((s) => s.specValue), specs: (goods.specifications || []).map((s) => s.specValue),
price: goods.tagPrice ? goods.tagPrice : goods.actualPrice, // 商品销售单价, 优先取限时活动价 // price: goods.tagPrice ? goods.tagPrice : goods.actualPrice, // 商品销售单价, 优先取限时活动价
price: goods.price, // 商品销售单价, 优先取限时活动价
num: goods.buyQuantity, num: goods.buyQuantity,
titlePrefixTags: goods.tagText ? [{ // titlePrefixTags: goods.tagText ? [{
text: goods.tagText // text: goods.tagText
}] : [], // }] : [],
buttons: goods.buttonVOs || [], buttons: goods.buttonVOs || [],
}), }),
), ),
@ -140,19 +141,16 @@ Page({
this.setData({ this.setData({
order, order,
_order, _order,
formatCreateTime: formatTime( formatCreateTime: order.createTime, // 格式化订单创建时间
parseFloat(`${order.createTime}`),
'YYYY-MM-DD HH:mm',
), // 格式化订单创建时间
countDownTime: this.computeCountDownTime(order), countDownTime: this.computeCountDownTime(order),
addressEditable: [OrderStatus.PENDING_PAYMENT, OrderStatus.PENDING_DELIVERY].includes( addressEditable: [OrderStatus.PENDING_PAYMENT, OrderStatus.PENDING_DELIVERY].includes(
order.orderStatus, order.orderStatus,
) && order.orderSubStatus !== -1, // 订单正在取消审核时不允许修改地址(但是返回的状态码与待发货一致) ), // 订单正在取消审核时不允许修改地址(但是返回的状态码与待发货一致)
isPaid: !!order.paymentVO.paySuccessTime, isPaid: order.orderStatus != 1,
invoiceStatus: this.datermineInvoiceStatus(order), // invoiceStatus: this.datermineInvoiceStatus(order),
invoiceDesc: order.invoiceDesc, // invoiceDesc: order.invoiceDesc,
invoiceType: order.invoiceVO?.invoiceType === 5 ? '电子普通发票' : '不开发票', //是否开票 0-不开 5-电子发票 // invoiceType: order.invoiceVO?.invoiceType === 5 ? '电子普通发票' : '不开发票', //是否开票 0-不开 5-电子发票
logisticsNodes: this.flattenNodes(order.trajectoryVos || []), logisticsNodes: this.flattenNodes(order.trajectoryVos.trajectorys || []),
}); });
}); });
}, },
@ -164,8 +162,8 @@ Page({
res1.push({ res1.push({
title: index === 0 ? node.title : '', // 子节点中仅第一个显示title title: index === 0 ? node.title : '', // 子节点中仅第一个显示title
desc: subNode.status, desc: subNode.status,
date: formatTime(+subNode.timestamp, 'YYYY-MM-DD HH:mm:ss'), date: subNode.timestamp,
icon: index === 0 ? LogisticsIconMap[node.code] || '' : '', // 子节点中仅第一个显示icon icon: index === 0 ? node.icon : "", // 子节点中仅第一个显示icon
}); });
return res1; return res1;
}, res); }, res);
@ -183,7 +181,7 @@ Page({
// 拼接省市区 // 拼接省市区
composeAddress(order) { composeAddress(order) {
return [ return [
//order.logisticsVO.receiverProvince, order.logisticsVO.receiverProvince,
order.logisticsVO.receiverCity, order.logisticsVO.receiverCity,
order.logisticsVO.receiverCountry, order.logisticsVO.receiverCountry,
order.logisticsVO.receiverArea, order.logisticsVO.receiverArea,
@ -209,7 +207,7 @@ Page({
// 返回时间若是大于2020.01.01,说明返回的是关闭时间,否则说明返回的直接就是剩余时间 // 返回时间若是大于2020.01.01,说明返回的是关闭时间,否则说明返回的直接就是剩余时间
computeCountDownTime(order) { computeCountDownTime(order) {
if (order.orderStatus !== OrderStatus.PENDING_PAYMENT) return null; if (order.orderStatus !== OrderStatus.PENDING_PAYMENT) return null;
return order.autoCancelTime > 1577808000000 ? return order.autoCancelTime > order.createTime ?
order.autoCancelTime - Date.now() : order.autoCancelTime - Date.now() :
order.autoCancelTime; order.autoCancelTime;
}, },
@ -281,9 +279,9 @@ Page({
onDeliveryClick() { onDeliveryClick() {
const logisticsData = { const logisticsData = {
nodes: this.data.logisticsNodes, nodes: this.data.logisticsNodes,
company: this.data.order.logisticsVO.logisticsCompanyName, company: this.data.order.trajectoryVos.logisticsCompanyName,
logisticsNo: this.data.order.logisticsVO.logisticsNo, logisticsNo: this.data.order.trajectoryVos.logisticsCompanyCode,
phoneNumber: this.data.order.logisticsVO.logisticsCompanyTel, // phoneNumber: this.data.order.logisticsVO.logisticsCompanyTel,
}; };
wx.navigateTo({ wx.navigateTo({
url: `/pages/order/delivery-detail/index?data=${encodeURIComponent( url: `/pages/order/delivery-detail/index?data=${encodeURIComponent(

View File

@ -39,7 +39,7 @@
<view>{{order.logisticsVO.receiverName + ' '}}{{order.logisticsVO.receiverPhone}}</view> <view>{{order.logisticsVO.receiverName + ' '}}{{order.logisticsVO.receiverPhone}}</view>
<view class="logistics-time">{{_order.receiverAddress}}</view> <view class="logistics-time">{{_order.receiverAddress}}</view>
</view> </view>
<view wx:if="{{addressEditable}}" class="edit-text" bindtap="onEditAddressTap"> 修改 </view> <!-- <view wx:if="{{addressEditable}}" class="edit-text" bindtap="onEditAddressTap"> 修改 </view> -->
</view> </view>
</view> </view>
<!-- 店铺及商品 --> <!-- 店铺及商品 -->
@ -50,14 +50,14 @@
<view class="pay-detail"> <view class="pay-detail">
<view class="pay-item"> <view class="pay-item">
<text>商品总额</text> <text>商品总额</text>
<price fill decimalSmaller wr-class="pay-item__right font-bold" price="{{order.totalAmount || '0'}}" /> <price priceUnit="yuan" fill decimalSmaller wr-class="pay-item__right font-bold" price="{{order.totalAmount || '0'}}" />
</view> </view>
<view class="pay-item"> <view class="pay-item">
<text>运费</text> <text>运费</text>
<view class="pay-item__right font-bold"> <view class="pay-item__right font-bold">
<block wx:if="{{order.freightFee}}"> <block wx:if="{{order.freightFee}}">
+ +
<price fill decimalSmaller price="{{order.freightFee}}" /> <price priceUnit="yuan" fill decimalSmaller price="{{order.freightFee}}" />
</block> </block>
<text wx:else>免运费</text> <text wx:else>免运费</text>
</view> </view>
@ -66,7 +66,7 @@
<text>活动优惠</text> <text>活动优惠</text>
<view class="pay-item__right primary font-bold"> <view class="pay-item__right primary font-bold">
- -
<price fill price="{{order.discountAmount || 0}}" /> <price priceUnit="yuan" fill price="{{order.discountAmount || 0}}" />
</view> </view>
</view> </view>
<view class="pay-item"> <view class="pay-item">
@ -74,7 +74,7 @@
<view class="pay-item__right" catchtap="onOpenCoupons"> <view class="pay-item__right" catchtap="onOpenCoupons">
<block wx:if="{{order.couponAmount}}"> <block wx:if="{{order.couponAmount}}">
- -
<price fill decimalSmaller price="{{order.couponAmount}}" /> <price priceUnit="yuan" fill decimalSmaller price="{{order.couponAmount}}" />
</block> </block>
<text wx:else>无可用</text> <text wx:else>无可用</text>
<!-- <t-icon name="chevron-right" size="32rpx" color="#BBBBBB" /> --> <!-- <t-icon name="chevron-right" size="32rpx" color="#BBBBBB" /> -->
@ -82,7 +82,7 @@
</view> </view>
<view class="pay-item"> <view class="pay-item">
<text>{{isPaid ? '实付' : '应付'}}</text> <text>{{isPaid ? '实付' : '应付'}}</text>
<price fill decimalSmaller wr-class="pay-item__right font-bold primary max-size" price="{{order.paymentAmount || '0'}}" /> <price priceUnit="yuan" fill decimalSmaller wr-class="pay-item__right font-bold primary max-size" price="{{order.paymentAmount || '0'}}" />
</view> </view>
</view> </view>
</order-card> </order-card>

View File

@ -114,16 +114,16 @@ Page({
case -1: case -1:
_status = 0 _status = 0
break; break;
case 5: case 1:
_status = 1 _status = 1
break; break;
case 10: case 2:
_status = 2 _status = 2
break; break;
case 40: case 3:
_status = 3 _status = 3
break; break;
case 50: case 4:
_status = 4 _status = 4
break; break;
default: default:
@ -253,7 +253,6 @@ Page({
}, },
onRefresh() { onRefresh() {
console.log(1111);
this.refreshList(this.data.curTab); this.refreshList(this.data.curTab);
}, },

View File

@ -10,13 +10,14 @@ import {
import Toast from 'tdesign-miniprogram/toast/index'; import Toast from 'tdesign-miniprogram/toast/index';
const menuData = [ const menuData = [
[{ [
title: '申请开店', // {
tit: '', // title: '申请开店',
url: '', // tit: '',
status: 0, // url: '',
type: 'apply-shop', // status: 0,
}, // type: 'apply-shop',
// },
{ {
title: '收货地址', title: '收货地址',
tit: '', tit: '',
@ -63,28 +64,28 @@ const orderTagInfos = [{
title: '待付款', title: '待付款',
iconName: 'wallet', iconName: 'wallet',
orderNum: 0, orderNum: 0,
tabType: 5, tabType: 1,
status: 1, status: 1,
}, },
{ {
title: '待发货', title: '待发货',
iconName: 'deliver', iconName: 'deliver',
orderNum: 0, orderNum: 0,
tabType: 10, tabType: 2,
status: 1, status: 1,
}, },
{ {
title: '待收货', title: '待收货',
iconName: 'package', iconName: 'package',
orderNum: 0, orderNum: 0,
tabType: 40, tabType: 3,
status: 1, status: 1,
}, },
{ {
title: '待评价', title: '待评价',
iconName: 'comment', iconName: 'comment',
orderNum: 0, orderNum: 0,
tabType: 60, tabType: 4,
status: 1, status: 1,
}, },
{ {
@ -254,7 +255,6 @@ Page({
jumpNav(e) { jumpNav(e) {
const status = e.detail.tabType; const status = e.detail.tabType;
if (status === 0) { if (status === 0) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/order/after-service-list/index' url: '/pages/order/after-service-list/index'