fixed 修改订单状态跳转问题
This commit is contained in:
parent
573f8800bb
commit
adeac5fbbb
@ -1,9 +1,9 @@
|
||||
export const OrderStatus = {
|
||||
PENDING_PAYMENT: 5, // 待支付
|
||||
PENDING_DELIVERY: 10, // 待发货
|
||||
PENDING_RECEIPT: 40, // 待收货
|
||||
COMPLETE: 50, // 已完成/待评价
|
||||
PAYMENT_TIMEOUT: 80, // 已取消,支付超时
|
||||
PENDING_PAYMENT: 1, // 待支付
|
||||
PENDING_DELIVERY: 2, // 待发货
|
||||
PENDING_RECEIPT: 3, // 待收货
|
||||
COMPLETE: 4, // 已完成/待评价
|
||||
PAYMENT_TIMEOUT: 5, // 已取消,支付超时
|
||||
CANCELED_NOT_PAYMENT: 80, // 已取消,未支付主动取消
|
||||
CANCELED_PAYMENT: 80, // 已取消,已支付主动取消
|
||||
CANCELED_REJECTION: 80, // 已取消,拒收
|
||||
|
@ -16,6 +16,7 @@ Page({
|
||||
} catch (e) {
|
||||
console.warn('物流节点数据解析失败', e);
|
||||
}
|
||||
console.log(data.nodes,'查看节点');
|
||||
if (Number(query.source) === 2) {
|
||||
const service = {
|
||||
company: data.logisticsCompanyName,
|
||||
|
@ -123,11 +123,12 @@ Page({
|
||||
skuId: goods.skuId,
|
||||
spuId: goods.spuId,
|
||||
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,
|
||||
titlePrefixTags: goods.tagText ? [{
|
||||
text: goods.tagText
|
||||
}] : [],
|
||||
// titlePrefixTags: goods.tagText ? [{
|
||||
// text: goods.tagText
|
||||
// }] : [],
|
||||
buttons: goods.buttonVOs || [],
|
||||
}),
|
||||
),
|
||||
@ -140,19 +141,16 @@ Page({
|
||||
this.setData({
|
||||
order,
|
||||
_order,
|
||||
formatCreateTime: formatTime(
|
||||
parseFloat(`${order.createTime}`),
|
||||
'YYYY-MM-DD HH:mm',
|
||||
), // 格式化订单创建时间
|
||||
formatCreateTime: order.createTime, // 格式化订单创建时间
|
||||
countDownTime: this.computeCountDownTime(order),
|
||||
addressEditable: [OrderStatus.PENDING_PAYMENT, OrderStatus.PENDING_DELIVERY].includes(
|
||||
order.orderStatus,
|
||||
) && order.orderSubStatus !== -1, // 订单正在取消审核时不允许修改地址(但是返回的状态码与待发货一致)
|
||||
isPaid: !!order.paymentVO.paySuccessTime,
|
||||
invoiceStatus: this.datermineInvoiceStatus(order),
|
||||
invoiceDesc: order.invoiceDesc,
|
||||
invoiceType: order.invoiceVO?.invoiceType === 5 ? '电子普通发票' : '不开发票', //是否开票 0-不开 5-电子发票
|
||||
logisticsNodes: this.flattenNodes(order.trajectoryVos || []),
|
||||
), // 订单正在取消审核时不允许修改地址(但是返回的状态码与待发货一致)
|
||||
isPaid: order.orderStatus != 1,
|
||||
// invoiceStatus: this.datermineInvoiceStatus(order),
|
||||
// invoiceDesc: order.invoiceDesc,
|
||||
// invoiceType: order.invoiceVO?.invoiceType === 5 ? '电子普通发票' : '不开发票', //是否开票 0-不开 5-电子发票
|
||||
logisticsNodes: this.flattenNodes(order.trajectoryVos.trajectorys || []),
|
||||
});
|
||||
});
|
||||
},
|
||||
@ -164,8 +162,8 @@ Page({
|
||||
res1.push({
|
||||
title: index === 0 ? node.title : '', // 子节点中仅第一个显示title
|
||||
desc: subNode.status,
|
||||
date: formatTime(+subNode.timestamp, 'YYYY-MM-DD HH:mm:ss'),
|
||||
icon: index === 0 ? LogisticsIconMap[node.code] || '' : '', // 子节点中仅第一个显示icon
|
||||
date: subNode.timestamp,
|
||||
icon: index === 0 ? node.icon : "", // 子节点中仅第一个显示icon
|
||||
});
|
||||
return res1;
|
||||
}, res);
|
||||
@ -183,7 +181,7 @@ Page({
|
||||
// 拼接省市区
|
||||
composeAddress(order) {
|
||||
return [
|
||||
//order.logisticsVO.receiverProvince,
|
||||
order.logisticsVO.receiverProvince,
|
||||
order.logisticsVO.receiverCity,
|
||||
order.logisticsVO.receiverCountry,
|
||||
order.logisticsVO.receiverArea,
|
||||
@ -209,7 +207,7 @@ Page({
|
||||
// 返回时间若是大于2020.01.01,说明返回的是关闭时间,否则说明返回的直接就是剩余时间
|
||||
computeCountDownTime(order) {
|
||||
if (order.orderStatus !== OrderStatus.PENDING_PAYMENT) return null;
|
||||
return order.autoCancelTime > 1577808000000 ?
|
||||
return order.autoCancelTime > order.createTime ?
|
||||
order.autoCancelTime - Date.now() :
|
||||
order.autoCancelTime;
|
||||
},
|
||||
@ -281,9 +279,9 @@ Page({
|
||||
onDeliveryClick() {
|
||||
const logisticsData = {
|
||||
nodes: this.data.logisticsNodes,
|
||||
company: this.data.order.logisticsVO.logisticsCompanyName,
|
||||
logisticsNo: this.data.order.logisticsVO.logisticsNo,
|
||||
phoneNumber: this.data.order.logisticsVO.logisticsCompanyTel,
|
||||
company: this.data.order.trajectoryVos.logisticsCompanyName,
|
||||
logisticsNo: this.data.order.trajectoryVos.logisticsCompanyCode,
|
||||
// phoneNumber: this.data.order.logisticsVO.logisticsCompanyTel,
|
||||
};
|
||||
wx.navigateTo({
|
||||
url: `/pages/order/delivery-detail/index?data=${encodeURIComponent(
|
||||
|
@ -39,7 +39,7 @@
|
||||
<view>{{order.logisticsVO.receiverName + ' '}}{{order.logisticsVO.receiverPhone}}</view>
|
||||
<view class="logistics-time">{{_order.receiverAddress}}</view>
|
||||
</view>
|
||||
<view wx:if="{{addressEditable}}" class="edit-text" bindtap="onEditAddressTap"> 修改 </view>
|
||||
<!-- <view wx:if="{{addressEditable}}" class="edit-text" bindtap="onEditAddressTap"> 修改 </view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 店铺及商品 -->
|
||||
@ -50,14 +50,14 @@
|
||||
<view class="pay-detail">
|
||||
<view class="pay-item">
|
||||
<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 class="pay-item">
|
||||
<text>运费</text>
|
||||
<view class="pay-item__right font-bold">
|
||||
<block wx:if="{{order.freightFee}}">
|
||||
+
|
||||
<price fill decimalSmaller price="{{order.freightFee}}" />
|
||||
<price priceUnit="yuan" fill decimalSmaller price="{{order.freightFee}}" />
|
||||
</block>
|
||||
<text wx:else>免运费</text>
|
||||
</view>
|
||||
@ -66,7 +66,7 @@
|
||||
<text>活动优惠</text>
|
||||
<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 class="pay-item">
|
||||
@ -74,7 +74,7 @@
|
||||
<view class="pay-item__right" catchtap="onOpenCoupons">
|
||||
<block wx:if="{{order.couponAmount}}">
|
||||
-
|
||||
<price fill decimalSmaller price="{{order.couponAmount}}" />
|
||||
<price priceUnit="yuan" fill decimalSmaller price="{{order.couponAmount}}" />
|
||||
</block>
|
||||
<text wx:else>无可用</text>
|
||||
<!-- <t-icon name="chevron-right" size="32rpx" color="#BBBBBB" /> -->
|
||||
@ -82,7 +82,7 @@
|
||||
</view>
|
||||
<view class="pay-item">
|
||||
<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>
|
||||
</order-card>
|
||||
|
@ -114,16 +114,16 @@ Page({
|
||||
case -1:
|
||||
_status = 0
|
||||
break;
|
||||
case 5:
|
||||
case 1:
|
||||
_status = 1
|
||||
break;
|
||||
case 10:
|
||||
case 2:
|
||||
_status = 2
|
||||
break;
|
||||
case 40:
|
||||
case 3:
|
||||
_status = 3
|
||||
break;
|
||||
case 50:
|
||||
case 4:
|
||||
_status = 4
|
||||
break;
|
||||
default:
|
||||
@ -253,7 +253,6 @@ Page({
|
||||
},
|
||||
|
||||
onRefresh() {
|
||||
console.log(1111);
|
||||
this.refreshList(this.data.curTab);
|
||||
},
|
||||
|
||||
|
@ -10,13 +10,14 @@ import {
|
||||
import Toast from 'tdesign-miniprogram/toast/index';
|
||||
|
||||
const menuData = [
|
||||
[{
|
||||
title: '申请开店',
|
||||
tit: '',
|
||||
url: '',
|
||||
status: 0,
|
||||
type: 'apply-shop',
|
||||
},
|
||||
[
|
||||
// {
|
||||
// title: '申请开店',
|
||||
// tit: '',
|
||||
// url: '',
|
||||
// status: 0,
|
||||
// type: 'apply-shop',
|
||||
// },
|
||||
{
|
||||
title: '收货地址',
|
||||
tit: '',
|
||||
@ -63,28 +64,28 @@ const orderTagInfos = [{
|
||||
title: '待付款',
|
||||
iconName: 'wallet',
|
||||
orderNum: 0,
|
||||
tabType: 5,
|
||||
tabType: 1,
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
title: '待发货',
|
||||
iconName: 'deliver',
|
||||
orderNum: 0,
|
||||
tabType: 10,
|
||||
tabType: 2,
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
title: '待收货',
|
||||
iconName: 'package',
|
||||
orderNum: 0,
|
||||
tabType: 40,
|
||||
tabType: 3,
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
title: '待评价',
|
||||
iconName: 'comment',
|
||||
orderNum: 0,
|
||||
tabType: 60,
|
||||
tabType: 4,
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
@ -254,7 +255,6 @@ Page({
|
||||
|
||||
jumpNav(e) {
|
||||
const status = e.detail.tabType;
|
||||
|
||||
if (status === 0) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/order/after-service-list/index'
|
||||
|
Loading…
Reference in New Issue
Block a user