Commit a2dea110 by liimin

refactor(order): 重构订单模块

- 优化订单状态和请求方法的管理逻辑
- 改进订单列表的获取和更新机制
- 调整订单详情和售后流程的实现方式
- 统一订单相关组件的样式和交互
1 parent 2b5b91f2
Showing 29 changed files with 186 additions and 364 deletions
<block wx:if="{{openScroll}}">
<scroll-view class="tab-box {{align}}" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count||count==item.code?'active':''}}" bindtap="click" data-count="{{index}}" id="to-{{index}}" >
<view class="tab {{index==count||count==item.code?'active':''}}" bindtap="click" data-count="{{index}}" data-item="{{item}}" id="to-{{index}}" >
<view class="text" >{{item.text||item}}</view>
<!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
<view class="line"></view>
......
......@@ -76,6 +76,7 @@ export const ORDER_STATUS = {
status: OrderStatusEnum.ALL,
index: 0, // 查询订单列表TAB高亮的索引
requestType: 0, // 查询订单列表TAB查询参数
requestMethod:'getOrderList',
type: OrderStatusTypes.QUERY_TAB, // 查询订单列表显示的TAB项
},
[OrderStatusEnum.PAY_PENDING]: {
......@@ -84,6 +85,7 @@ export const ORDER_STATUS = {
status: OrderStatusEnum.PAY_PENDING,
index: 1, // 查询订单列表TAB高亮的索引
requestType: 2, // 查询订单列表TAB查询参数
requestMethod:'getOrderList',
buttons: null,
type: OrderStatusTypes.MY_ORDER, //我的 页面 我的订单 显示的项目
},
......@@ -93,6 +95,7 @@ export const ORDER_STATUS = {
status: OrderStatusEnum.WAIT_DELIVER,
index: 2, // 查询订单列表TAB高亮的索引
requestType: 6, // 查询订单列表TAB查询参数
requestMethod:'getOrderList',
type: OrderStatusTypes.MY_ORDER, //我的 页面 我的订单 显示的项目
buttons: {
[GoodsSource.SELF]: [
......@@ -107,6 +110,7 @@ export const ORDER_STATUS = {
status: 1008,
index: 3, // 查询订单列表TAB高亮的索引
requestType: 1, // 查询订单列表TAB查询参数
requestMethod:'getOrderList',
type: OrderStatusTypes.MY_ORDER, //我的 页面 我的订单 显示的项目
buttons: {
[GoodsSource.SELF]: [
......@@ -126,6 +130,7 @@ export const ORDER_STATUS = {
status: OrderStatusEnum.COMPLETED,
index: 4, // 查询订单列表TAB高亮的索引
requestType: 4, // 查询订单列表TAB查询参数
requestMethod:'getOrderList',
type: OrderStatusTypes.QUERY_TAB, // 查询订单列表显示的TAB项
buttons: {
[GoodsSource.SELF]: [
......@@ -147,6 +152,7 @@ export const ORDER_STATUS = {
status: OrderStatusEnum.AFTER_SALE,
index: 5, // 查询订单列表TAB高亮的索引
requestType: 0, // 查询订单列表TAB查询参数
requestMethod:'getSalesOrderList',
buttons: null,
type: OrderStatusTypes.MY_ORDER, //我的 页面 我的订单 显示的项目
},
......
......@@ -15,6 +15,7 @@ Page({
*/
onLoad: function (options) {
wx.p.router.getRouterParams(options).then((params) => {
console.log("🚀 ~ params:", params)
if (params) {
this.setData({
...params,
......@@ -46,7 +47,7 @@ Page({
const { returnOrderStatus } = res;
const status = getAfterSaleDetail({ returnOrderStatus });
const button = status.buttons?.[goodsSource][0]
// button.action = this[this.button.handler]
// button.action = this[button.handler]
let str = "";
if (res.sendbackAddressModel) {
const { sendbackAddressModel } = res;
......@@ -73,7 +74,8 @@ Page({
// );
// }
// this.cancelSaleApply()
this[this.button.handler]()
// console.log('this.button', this.data.button)
this[this.data.button.handler]()
},
toAfterSale(){
const { orderInfo } = this.data;
......
......@@ -4,10 +4,6 @@ Component({
status: {
type: Object,
value: {},
observer: function (status) {
console.log("🚀 ~ status:", status)
// this.updateStatus(status);
},
},
},
data: {
......
......@@ -16,7 +16,6 @@ Page({
]
},
choose(e) {
console.log(e)
let { index } = e.currentTarget.dataset
let { afterSaleList } = this.data,
returnType;
......@@ -28,51 +27,10 @@ Page({
})
this.triggerEvent('returnType',{returnType})
},
click() {
let {
orderObj,
data: { afterSaleList }
} = this
orderObj.refundType = 2
afterSaleList.map(e => {
if (e.active) orderObj.refundType = e.value
})
wx.p.router.go('/packageMine/pages/order/afterSale_step_two/afterSale_step_two', orderObj)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.orderObj = options
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
......@@ -4,7 +4,6 @@
<afterSale_step_one bindreturnType="changeReturnType"/>
<!-- </view> -->
<view class="title">申请退货退款</view>
<!-- 退款信息组件 -->
<refund-info-box
orderObj="{{orderObj}}"
......
......@@ -40,6 +40,7 @@ Component({
},
onShowRefundCount() {
return
this.setData({
showRefundCount: true,
});
......
......@@ -13,14 +13,14 @@
<view class="box-item-value">
<view class="value" bindtap="onShowRefundCount" wx:if="{{!showRefundCount}}">
<view class="price">{{refundCount}}件</view>
修改数量
<!-- 修改数量 -->
</view>
<!-- <Stepper wx:else count="{{refundCount}}" min="1" max="10" bindchange="onChangeRefundCount" data-index="{{index}}"></Stepper> -->
</view>
</view>
<view class="box-item">
<text class="box-item-title">退款金额</text>
<view class="refund">{{refundPrice}}积分</view>
<view class="refund">{{refundPrice * refundCount}}积分</view>
</view>
</view>
<popup show="{{showPopup}}" only="{{false}}" title="请选择退款原因" bindconfirm="onConfirmPopup">
......
......@@ -11,6 +11,7 @@ Component({
type: Object,
value: {},
observer: function (val) {
console.log("🚀 ~ val:", val)
this.setData({
logisticsData: this.processExpressInfo(val)
})
......@@ -20,10 +21,10 @@ Component({
type: Boolean,
value: false
},
height: {
type: String,
value: '256rpx'
}
// height: {
// type: String,
// value: '256rpx'
// }
},
data: {
logisticsData: {},
......
.popup-content {
padding: 0 32rpx;
max-height: calc(100% + 98rpx);
overflow: hidden;
overflow-y: scroll;
.express-info {
display: flex;
justify-content: space-between;
......
<popup show="{{showExpress}}" show-close-button="{{true}}" showFooter="{{false}}" headerColor="#F7F7F7" title="物流详情" bindconfirm="onConfirmPopup">
<popup show="{{showExpress}}" show-close-button="{{true}}" showFooter="{{false}}" headerColor="#F7F7F7" title="物流详情" bindconfirm="onConfirmPopup">
<view class="popup-content">
<Expressage expressInfo="{{expressInfo}}"></Expressage>
<view class="line"></view>
<Express expressInfo="{{expressInfo}}" showExpress="{{showExpress}} "height="980rpx" />
<Expressage expressInfo="{{expressInfo}}"></Expressage>
<view class="line"></view>
<Express expressInfo="{{expressInfo}}" showExpress="{{showExpress}}" />
</view>
</popup>
\ No newline at end of file
const { mockDeliveryInfoData } = require('./mock.js');
Component({
options: {
......@@ -14,11 +13,4 @@ Component({
value: {}
}
},
data: {
// Mock数据用于开发和测试
...mockDeliveryInfoData
},
methods: {
}
})
\ No newline at end of file
......@@ -4,5 +4,4 @@
<view class="value">{{orderInfo.receiveAddress || ''}}
<view class="value">{{orderInfo.receviveInfo || ''}}</view>
</view>
</view>
\ No newline at end of file
.title {
font-size: 32rpx;
padding-bottom: 24rpx;
padding-bottom: 16rpx;
font-weight: 500;
}
......@@ -15,9 +15,9 @@
}
.item .label {
width: 150rpx;
width: 128rpx;
}
.item .value {
width: calc(100% - 150rpx);
width: calc(100% - 128rpx);
}
const { mockOrderInfoData } = require('./mock.js');
Component({
options: {
addGlobalClass: true,
......@@ -8,21 +6,6 @@ Component({
orderInfo: {
type: Object,
value: {}
},
orderObj: {
type: Array,
value: []
},
statusEnum: {
type: Object,
value: {}
}
},
data: {
// Mock数据用于开发和测试
...mockOrderInfoData
},
methods: {
}
})
\ No newline at end of file
......@@ -5,7 +5,7 @@
<content item="{{orderInfo}}" />
</view>
<view class="order-content">
<block wx:for="{{orderObj}}" wx:key="index">
<!-- <block wx:for="{{orderObj}}" wx:key="index">
<view class="item {{item.alignItems}}">
<view class="label">{{item.label}}:</view>
<view class="value {{item.styleColor}}">
......@@ -14,7 +14,27 @@
<block wx:else>{{orderInfo[item.key] || '-'}}</block>
</view>
</view>
</block>
</block> -->
<view class="item">
<view class="label">实付款:</view>
<view class="value fontColor">{{orderInfo.redeemPoints * orderInfo.sellQty}}积分</view>
</view>
<view class="item">
<view class="label">运费:</view>
<view class="value">¥{{orderInfo.freightAmount||0}}</view>
</view>
<view class="item">
<view class="label">订单编号:</view>
<view class="value">{{orderInfo.orderCode}}</view>
</view>
<view class="item">
<view class="label">下单时间:</view>
<view class="value">{{orderInfo.orderCreatedDate}}</view>
</view>
<view class="item">
<view class="label">支付时间:</view>
<view class="value">{{orderInfo.orderCreatedDate}}</view>
</view>
</view>
<view class="order-bottom">
<order-action-buttons order="{{orderInfo}}" />
......
const mockOrderInfoData = {
orderInfo: {
time: '2023.05.15 14:30:22',
orderCode: '20230515143022001',
shipAddress: '北京市朝阳区某某街道某某小区1号楼101室',
orderStatus: 3
},
orderObj: [
{
label: "下单日期",
key: "time",
},
{
label: "订单编号",
key: "orderCode",
},
{
label: "收货地址",
key: "shipAddress",
alignItems: "flex-start",
},
{
label: "订单状态",
key: "orderStatus",
enum: true,
},
],
statusEnum: {
1: "待付款",
2: "待发货",
3: "已发货",
4: "已完成",
5: "已取消"
}
};
module.exports = {
mockOrderInfoData
};
\ No newline at end of file
import {
wxqrcode as QR
} from "~/lib/index";
import {
orderMixin
} from "~/mixins/index";
import {
iosTimeFormat
} from "~/utils/format";
import {
mockOrderDetailData
} from "./mock.js";
import {
OrderStatus
} from "~/constants/mine.js";
Page({
behaviors: [orderMixin],
/**
* 页面的初始数据
*/
data: {
// 使用mock数据用于开发和测试
...mockOrderDetailData,
OrderStatus,
expressInfo: {
"orderCode": "295057717192728657",
"expressCode": "yuantong",
......@@ -106,29 +91,6 @@ Page({
]
}, //物流信息
isShowExpressPop: false,
orderObj: [{
label: "实付款",
key: 'redeemPoints',
styleColor: 'fontColor'
},
{
label: "运费",
key: 'freightAmount',
sign: true
},
{
label: "订单编号",
key: "orderCode",
},
{
label: "下单时间",
key: "orderCreatedDate",
},
{
label: "支付时间",
key: "orderCreatedDate",
},
],
deliveryStatus: {
1: "待发货",
2: "已发货",
......@@ -194,50 +156,9 @@ Page({
receviveInfo: receiveName + receiveMobile
}
})
});
},
toDetail() {
let [temp] = this.data.orderInfo.relatedUserCoupon, {
discountType,
useChannel,
id
} = temp,
detailInfo = {
xx: "xx",
};
if (discountType == 2 || discountType == 4) {
wx.p.router.go("/packageMall/pages/coupon/coupon", {
userCouponId: id,
useMemberType: this.data.useMemberType,
detailInfo,
});
return;
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
if (this.data.useMemberType == 1) {
wx.p.wxApi.showToast("代金券已使用");
return;
}
wx.p.router.go("/packageMine/pages/coupon/recommend/recommend", {
couponInfo: temp,
});
return;
}
wx.p.router.go("/packageMine/pages/coupon/detail/detail", {
item: temp,
});
},
setQr(data) {
this.setData({
qr: QR.createQrCodeImg(`t=1&c=${data}`),
});
},
showExpressPop() {
console.log("🚀 ~ showExpressPop ~ showExpressPop:")
this.setData({
isShowExpressPop: true,
});
......
......@@ -6,7 +6,7 @@
.express-detail{
position: absolute;
right: 24rpx;
top:10rpx;
top:12rpx;
color: var(--btnColor);
font-weight: 400;
font-size: 24rpx;
......
......@@ -21,7 +21,7 @@
<DeliveryInfo orderInfo="{{orderInfo}}" deliveryStatus="{{deliveryStatus}}"></DeliveryInfo>
</BlockBox>
<BlockBox>
<OrderInfo orderInfo="{{orderInfo}}" orderObj="{{orderObj}}" statusEnum="{{statusEnum}}"></OrderInfo>
<OrderInfo orderInfo="{{orderInfo}}"></OrderInfo>
</BlockBox>
<!-- <BlockBox>
<content item="{{orderInfo}}" />
......
......@@ -6,7 +6,10 @@ Component({
properties: {
item: {
type: Object,
value: {}
value: {},
observer: function (v) {
this.compute(v);
}
}
},
......@@ -21,6 +24,14 @@ Component({
* 组件的方法列表
*/
methods: {
compute(item) {
let { applyQty, sellQty, redeemPoints } = item;
const total = sellQty || applyQty || 0;
let sum = redeemPoints * total;
this.setData({
sum,
total
})
}
}
})
\ No newline at end of file
<view class="bottom">
<view class="total">
共{{item.sellQty||item.applyQty}}件,实付款
<text class="price">{{item.redeemPoints||'--'}}积分</text>
共{{total}}件,实付款
<text class="price">{{sum||'--'}}积分</text>
</view>
<order-action-buttons order="{{item}}" has-user-info="{{hasUserInfo}}" />
</view>
\ No newline at end of file
// packageMine/pages/order/index/components/orderActionButtons.js
import { GoodsSource } from "~/constants/mine.js";
import { GoodsSource,ORDER_STATUS,OrderStatusEnum } from "~/constants/mine.js";
import { getOrder } from "~/packageMine/pages/order/utils";
Component({
/**
......@@ -10,17 +10,12 @@ Component({
type: Object,
value: {},
observer: function () {
// 当hasUserInfo变化时重新计算按钮
this.updateButtons();
}
},
hasUserInfo: {
type: Boolean,
value: false,
observer: function () {
// 当hasUserInfo变化时重新计算按钮
// this.updateButtons();
},
},
},
......@@ -57,7 +52,7 @@ Component({
: [];
// goodsSource ==null 默认云中鹤
this.setData({
buttons: orderButtons,
buttons: orderButtons||[],
});
},
......@@ -70,31 +65,31 @@ Component({
},
// 取消付款
onCancelPay(e) {
let { orderCode } = this.data.order;
wx.showModal({
title: "温馨提示",
content: "请问您是否要取消付款",
confirmText: "确认",
cancelText: "取消",
confirmColor: "#F13C3D",
}).then((res) => {
if (res.confirm) {
wx.p.api.shopmallApi
.cancelPay(orderCode)
.then(({ code, message }) => {
if (code == "0") {
wx.p.wxApi.showToast("操作成功");
setTimeout(() => {
this.clearData();
}, 1.5e3);
} else {
wx.p.wxApi.showToast(message);
}
});
}
});
},
// onCancelPay(e) {
// let { orderCode } = this.data.order;
// wx.showModal({
// title: "温馨提示",
// content: "请问您是否要取消付款",
// confirmText: "确认",
// cancelText: "取消",
// confirmColor: "#F13C3D",
// }).then((res) => {
// if (res.confirm) {
// wx.p.api.shopmallApi
// .cancelPay(orderCode)
// .then(({ code, message }) => {
// if (code == "0") {
// wx.p.wxApi.showToast("操作成功");
// setTimeout(() => {
// this.clearData();
// }, 1.5e3);
// } else {
// wx.p.wxApi.showToast(message);
// }
// });
// }
// });
// },
// 去支付
// onPay(e) {
......@@ -172,8 +167,8 @@ Component({
if (res.confirm) {
wx.p.api.shopmallApi.confirmReceipt(subOrderCode).then((data) => {
wx.p.wxApi.showToast("操作成功");
setTimeout(() => {
this.clearData();
setTimeout(() => {//跳转到订单完成列表
wx.p.router.go('/packageMine/pages/order/index/index',{tab:ORDER_STATUS[OrderStatusEnum.COMPLETED]})
}, 1.5e3);
});
}
......@@ -188,37 +183,10 @@ Component({
});
},
// 取消订单
onCancelOrder(e) {
let { orderCode } = this.data.order;
wx.showModal({
title: "温馨提示",
content: "请问您是否要取消售后",
confirmText: "确认",
cancelText: "取消",
confirmColor: "#F13C3D",
}).then((res) => {
if (res.confirm) {
wx.p.api.shopmallApi
.cancelOrder(orderCode)
.then(({ code, message }) => {
if (code == "0") {
wx.p.wxApi.showToast("操作成功");
setTimeout(() => {
this.clearData();
}, 1.5e3);
} else {
wx.p.wxApi.showToast(message);
}
});
}
});
},
// 售后详情
onAfterSaleDetail(e) {
let url = "/packageMine/pages/order/afterSaleDetail/afterSaleDetail";
let { subOrderCode, goodsSource, tparReturnOrderCode } = this.data.order;
let { subOrderCode, goodsSource, tparReturnOrderCode, } = this.data.order;
wx.p.router.go(url, {
subOrderCode,
goodsSource,
......@@ -226,11 +194,4 @@ Component({
});
},
},
lifetimes: {
attached() {
// 组件实例进入页面节点树时执行
this.updateButtons();
},
},
});
......@@ -11,15 +11,7 @@ Component({
observer: function (v) {
v && this.getStatus();
},
},
afterSaleStatus: {
type: Object,
value: {},
},
statusEnum: {
type: Object,
value: {},
},
}
},
/**
......@@ -48,7 +40,6 @@ Component({
refundStatus,
returnOrderStatus,
});
console.log(_order);
this.setData({
status: _order.text,
});
......
// packageMine/pages/order/index/index.js
import { orderMixin } from "~/mixins/index";
import { ORDER_STATUS, OrderStatusTypes } from "~/constants/mine.js";
import { ORDER_STATUS, OrderStatusTypes,OrderStatusEnum } from "~/constants/mine.js";
Page({
behaviors: [orderMixin],
/**
* 页面的初始数据
*/
data: {
pageNum: 1,
requestType: 0,
tab: Object.freeze(
Object.values(ORDER_STATUS)
.filter(
(item) =>
item.type === OrderStatusTypes.QUERY_TAB ||
item.type === OrderStatusTypes.MY_ORDER
)
.map((item) => item.text)
Object.values(ORDER_STATUS).filter(
(item) =>
item.type === OrderStatusTypes.QUERY_TAB ||
item.type === OrderStatusTypes.MY_ORDER
)
),
list: [],
listFlag: true,
hasUserInfo: true,
inputDebounceTimer: null,
curTab: { index: 0, requestType: "0", requestMethod: "getOrderList" },
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
// 清理防抖定时器,避免内存泄漏
if (this.data.inputDebounceTimer) {
clearTimeout(this.data.inputDebounceTimer);
}
},
navbarReady(e) {
wx.p.wxApi.getViewInfo(".tab", (res) => {
this.setData({
......@@ -33,9 +40,8 @@ Page({
},
jump(e) {
let {
item: { orderStatus, orderCode, orderSource },
item: { orderCode },
} = e.currentTarget.dataset;
if (orderSource == 5 && (orderStatus == 2 || orderStatus == 7)) return;
let url = "/packageMine/pages/order/detail/detail";
wx.p.router.go(url, {
orderCode,
......@@ -56,71 +62,81 @@ Page({
else wx.p.router.back();
},
changeTab(e) {
let index = e.detail.count,
requestType = this.getRequestType(index);
this.setData({
tabIndex: index,
requestType,
});
this.getOrderList();
},
getRequestType(index) {
// index = index ? index : 0
let item = Object.values(ORDER_STATUS).find(
(item) => item.index == (index || 0)
);
return item ? item.requestType : "0";
const tab = e.detail.item;
this.setIndexAndRequest(tab);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.p.router.getRouterParams(options).then((option) => {
let index = option.index,
requestType = this.getRequestType(index);
this.setData({
tabIndex: index,
requestType,
});
this.getOrderList();
// this.clearData(); // 注释掉实际的API调用,使用硬编码数据
let tab = option.tab;
if(!tab || !tab.index){
tab = ORDER_STATUS[OrderStatusEnum.ALL]
}
this.setIndexAndRequest(tab);
});
},
setIndexAndRequest(tab) {
this.setData(
{
curTab: tab,
},
() => this.clearAndGetList()
);
},
onShow() {
if (this.refresh) this.clearData();
if (this.refresh) this.getOrderList();
if (this.refresh) this.clearAndGetList();
},
onHide() {
this.refresh = true;
},
async clearData() {
async clearData(cb) {
const res = !wx.p.isLogin;
if (res) return;
this.setData({
listFlag: false,
list: [], // 注释掉清空列表,保持硬编码数据
nothing: false,
pageNum: 1,
});
// this.getOrderList(); // 注释掉实际的API调用,使用硬编码数据
// this.setData({
// listFlag: true,
// });
this.setData(
{
listFlag: false,
list: [],
nothing: false,
pageNum: 1,
},
cb
);
},
clearAndGetList() {
this.clearData(() => this.getOrderList());
},
search() {
this.clearData();
this.getOrderList();
this.clearAndGetList();
},
clear() {
this.setData({
keyword: "",
});
this.setData(
{
keyword: "",
},
() => this.clearAndGetList()
);
},
input(e) {
if (this.data.inputDebounceTimer) {
clearTimeout(this.data.inputDebounceTimer);
}
const timer = setTimeout(() => {
this.setData(
{
keyword: e.detail.value,
},
() => this.clearAndGetList()
);
}, 500);
this.setData({
keyword: e.detail.value,
inputDebounceTimer: timer,
});
},
blur() {
let { keyword } = this.data;
this.setData({
......@@ -129,7 +145,11 @@ Page({
},
getOrderList() {
wx.p.wxApi.showLoading("加载中...");
let { requestType, pageNum, keyword, tabIndex } = this.data;
let {
curTab: { requestType, requestMethod },
pageNum,
keyword,
} = this.data;
const userInfo = wx.p.storage.get("userInfo") || {};
let { merchantId } = userInfo;
let obj = {
......@@ -139,12 +159,10 @@ Page({
};
if (keyword) {
keyword = keyword.replace(/\ /g, "");
if (keyword.length) obj.keyword = keyword;
if (keyword.length) obj.goodsInfo = keyword;
}
let Method = tabIndex == 5 ? "getSalesOrderList" : "getOrderList";
let list = [];
wx.p.api.mineApi[Method](obj).then((data) => {
wx.p.api.mineApi[requestMethod](obj).then((data) => {
wx.hideLoading();
data?.list?.map((e) => {
// let {
......
......@@ -11,14 +11,14 @@
<input type="text" placeholder="搜索" value="{{keyword}}" class="input" confirm-type="search" bindconfirm="search" bindinput="input" bindblur="blur" />
<block wx:if="{{keyword}}">
<view class="clear-box" bindtap="clear">
<view class="sprite-icon icon-clear"></view>
<mp-icon type="field" icon="close2" color="#2C2C2C" size="{{14}}"></mp-icon>
</view>
</block>
</view>
</view>
</navigation-bar>
<view class="tab" style="top:{{padding_bottom }}px;">
<tab tab="{{tab}}" bindchange="changeTab" index="{{tabIndex}}"></tab>
<tab tab="{{tab}}" bindchange="changeTab" index="{{curTab.index}}"></tab>
</view>
</view>
<block wx:if="{{margin_top}}">
......@@ -26,7 +26,7 @@
<block wx:if="{{listFlag}}">
<block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index">
<OrderCard item="{{item}}" after-sale-status="{{afterSaleStatus}}" status-enum="{{statusEnum}}" has-user-info="{{hasUserInfo}}"></OrderCard>
<OrderCard item="{{item}}"></OrderCard>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing to-bottom"></view>
......
......@@ -23,7 +23,7 @@ export function getOrderStatus({
(!cancelStatus || cancelStatus == 1010)
) {
// 按钮:售后(去掉)
return OrderStatusEnum.WAIT_DELIVER //待发货 order_status属于(1002,1006,1007)且cancel_status不存在或者审核中(1010)
return OrderStatusEnum.WAIT_DELIVER; //待发货 order_status属于(1002,1006,1007)且cancel_status不存在或者审核中(1010)
} else if (
[1008].includes(orderStatus) &&
(!cancelStatus || cancelStatus == 1010)
......@@ -86,8 +86,8 @@ export function getAfterSaleStatus({ returnOrderStatus } = {}) {
return AfterSaleStatusEnum.SUCCESS; // 已退款 退款退货的订单return_order_status:1003:已退款且return_status退换货状态(1002:已收货,1003:已退款),仅退款订单 return_order_status:1003:已退款且refund_status 退款状态1002:已退款,
} else if (returnOrderStatus == 1006) {
return AfterSaleStatusEnum.FAILED; // 退款失败 退款退货的return_order_status:1003:已退款 return_status退换货状态(1006:退款异常 ,,仅退款的return_order_status:1003:已退款 且refund_status 退款状态,1004:退款异常
}else{
return AfterSaleStatusEnum.DEFAULT;
} else {
return AfterSaleStatusEnum.DEFAULT;
}
}
......
......@@ -35,9 +35,9 @@ Component({
methods: {
goOrder(e) {
// 直接使用 ORDER_LIST 中的索引作为 tabIndex
const index = e.currentTarget.dataset.index;
const item = e.currentTarget.dataset.item;
wx.p.router.go("/packageMine/pages/order/index/index", {
index,
tab:item,
});
},
......
......@@ -11,7 +11,7 @@
</view>
<view class="btnBox">
<view class="independentBox" wx:for="{{orderList}}" wx:key="index">
<view bindtap="goOrder" data-index="{{item.index}}">
<view bindtap="goOrder" data-item="{{item}}">
<view class="order-img">
<glsx-image webp src="/mine/{{item.image}}.png"></glsx-image>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!