From adeac5fbbb35ba5e5d360946047d8812d9326d9d Mon Sep 17 00:00:00 2001 From: "AERWEN\\26795" <123456789a> Date: Wed, 25 Oct 2023 01:39:10 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E8=B7=B3=E8=BD=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/config.js | 10 +++---- pages/order/delivery-detail/index.js | 1 + pages/order/order-detail/index.js | 40 +++++++++++++--------------- pages/order/order-detail/index.wxml | 12 ++++----- pages/order/order-list/index.js | 9 +++---- pages/usercenter/index.js | 24 ++++++++--------- 6 files changed, 47 insertions(+), 49 deletions(-) diff --git a/pages/order/config.js b/pages/order/config.js index 14c0dc0..8dfdd25 100644 --- a/pages/order/config.js +++ b/pages/order/config.js @@ -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, // 已取消,拒收 diff --git a/pages/order/delivery-detail/index.js b/pages/order/delivery-detail/index.js index f10ff02..24b3f65 100644 --- a/pages/order/delivery-detail/index.js +++ b/pages/order/delivery-detail/index.js @@ -16,6 +16,7 @@ Page({ } catch (e) { console.warn('物流节点数据解析失败', e); } + console.log(data.nodes,'查看节点'); if (Number(query.source) === 2) { const service = { company: data.logisticsCompanyName, diff --git a/pages/order/order-detail/index.js b/pages/order/order-detail/index.js index 5915910..817a7ec 100644 --- a/pages/order/order-detail/index.js +++ b/pages/order/order-detail/index.js @@ -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( diff --git a/pages/order/order-detail/index.wxml b/pages/order/order-detail/index.wxml index 8414f60..7403717 100644 --- a/pages/order/order-detail/index.wxml +++ b/pages/order/order-detail/index.wxml @@ -39,7 +39,7 @@ {{order.logisticsVO.receiverName + ' '}}{{order.logisticsVO.receiverPhone}} {{_order.receiverAddress}} - 修改 + @@ -50,14 +50,14 @@ 商品总额 - + 运费 + - + 免运费 @@ -66,7 +66,7 @@ 活动优惠 - - + @@ -74,7 +74,7 @@ - - + 无可用 @@ -82,7 +82,7 @@ {{isPaid ? '实付' : '应付'}} - + diff --git a/pages/order/order-list/index.js b/pages/order/order-list/index.js index 8dda75a..122588b 100644 --- a/pages/order/order-list/index.js +++ b/pages/order/order-list/index.js @@ -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); }, diff --git a/pages/usercenter/index.js b/pages/usercenter/index.js index 80bae1f..c5f4e19 100644 --- a/pages/usercenter/index.js +++ b/pages/usercenter/index.js @@ -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'