Commit 3e16d9fd by zhangxw

Merge branch 'SAAS+V4.56.0-0908' of http://192.168.3.233:8090/saas/mini-program/…

…points-mall into SAAS+V4.56.0-0908
2 parents 6d7c01e5 70c9ca1f
...@@ -100,7 +100,11 @@ export const ORDER_STATUS = { ...@@ -100,7 +100,11 @@ export const ORDER_STATUS = {
buttons: { buttons: {
[GoodsSource.SELF]: [ [GoodsSource.SELF]: [
//自营商品 在商品列表对应的按钮 //自营商品 在商品列表对应的按钮
OrderActionButtons.CONFIRM_RECEIVE, // OrderActionButtons.CONFIRM_RECEIVE,
],
[GoodsSource.YZH]: [
//自营商品 在商品列表对应的按钮
// OrderActionButtons.CONFIRM_RECEIVE,
], ],
}, },
}, },
......
import { getAfterSaleDetail } from "~/packageMine/pages/order/utils"; import { getAfterSaleDetail,calcOrderProp } from "~/packageMine/pages/order/utils";
import { import {
ORDER_STATUS, ORDER_STATUS,
OrderStatusEnum, OrderStatusEnum,
...@@ -19,7 +19,6 @@ Page({ ...@@ -19,7 +19,6 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.p.router.getRouterParams(options).then((params) => { wx.p.router.getRouterParams(options).then((params) => {
console.log("🚀 ~ params:", params)
if (params) { if (params) {
this.setData({ this.setData({
...params, ...params,
...@@ -59,7 +58,8 @@ Page({ ...@@ -59,7 +58,8 @@ Page({
str = `${sendbackAddressModel.provinceName}${sendbackAddressModel.cityName}${sendbackAddressModel.countyName}${sendbackAddressModel.address}`; str = `${sendbackAddressModel.provinceName}${sendbackAddressModel.cityName}${sendbackAddressModel.countyName}${sendbackAddressModel.address}`;
} }
res.addressInfo = str; res.addressInfo = str;
const {___qty,___price,___totalPrice} =calcOrderProp(res.orderGoods)
Object.assign(res.orderGoods,{___qty,___price,___totalPrice})
this.setData({ this.setData({
orderInfo: res, orderInfo: res,
status, status,
...@@ -80,7 +80,17 @@ Page({ ...@@ -80,7 +80,17 @@ Page({
// } // }
// this.cancelSaleApply() // this.cancelSaleApply()
// console.log('this.button', this.data.button) // console.log('this.button', this.data.button)
this[this.data.button.handler]() // this[this.data.button.handler]()
this.toAfterSale()
},
toAfterSale(){
const { orderInfo } = this.data;
console.log("🚀 ~ toAfterSale ~ orderInfo:", orderInfo)
return
wx.p.router.go(
"/packageMine/pages/order/afterSale_step_two/afterSale_step_two",
orderInfo
);
}, },
/**撤销申请 */ /**撤销申请 */
cancelSaleApply() { cancelSaleApply() {
......
...@@ -17,6 +17,7 @@ Page({ ...@@ -17,6 +17,7 @@ Page({
data: { data: {
RefundReason: Object.freeze(RefundReason), RefundReason: Object.freeze(RefundReason),
method: null, method: null,
imagesMax:9
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -24,7 +25,10 @@ Page({ ...@@ -24,7 +25,10 @@ Page({
onLoad: function (options) { onLoad: function (options) {
wx.p.router.getRouterParams(options).then((orderObj) => { wx.p.router.getRouterParams(options).then((orderObj) => {
console.log("🚀 ~ orderObj:", orderObj) console.log("🚀 ~ orderObj:", orderObj)
orderObj.returnType = 1001; Object.assign(orderObj, {
returnType:orderObj.returnType||1001,
imgUrls:orderObj.imgUrls || []
})
this.setData({ this.setData({
orderObj, orderObj,
method: Methods[orderObj.goodsSource], method: Methods[orderObj.goodsSource],
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<!-- 退款信息组件 --> <!-- 退款信息组件 -->
<refund-info-box <refund-info-box
orderObj="{{orderObj}}" orderObj="{{orderObj}}"
refund-count="{{orderObj.applyQty||orderObj.sellQty}}" refund-count="{{orderObj.applyQty}}"
max-refund-count="{{maxRefundCount}}" max-refund-count="{{maxRefundCount}}"
refund-price="{{orderObj.refundPoints}}" refund-price="{{orderObj.refundPoints}}"
show-refund-count="{{showRefundCount}}" show-refund-count="{{showRefundCount}}"
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
<gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{orderObj.returnContent}}" bindinput="input" showWordLimit customMaxLength></gl-textarea> <gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{orderObj.returnContent}}" bindinput="input" showWordLimit customMaxLength></gl-textarea>
</view> </view>
<view class="title">上传图片</view> <view class="title">上传图片({{orderObj.imgUrls.length}}/{{imagesMax}})</view>
<!-- 图片上传组件 --> <!-- 图片上传组件 -->
<image-upload-box img-urls="{{orderObj.imgUrls}}" bindpreviewimage="previewImage" binddel="del" bindupload="upLoad"></image-upload-box> <image-upload-box img-urls="{{orderObj.imgUrls}}" imagesMax="{{imagesMax}}" bindpreviewimage="previewImage" binddel="del" bindupload="upLoad"></image-upload-box>
<view class="btn text-center" bindtap="submit">提交</view> <view class="btn text-center" bindtap="submit">提交</view>
</view> </view>
......
...@@ -3,9 +3,12 @@ Component({ ...@@ -3,9 +3,12 @@ Component({
imgUrls: { imgUrls: {
type: Array, type: Array,
value: [] value: []
},
imagesMax: {
type: Number,
value: 5
} }
}, },
methods: { methods: {
previewImage(e) { previewImage(e) {
let params = e.currentTarget.dataset; let params = e.currentTarget.dataset;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</block> --> </block> -->
<!-- <block wx:else> --> <!-- <block wx:else> -->
<!-- <block wx:if="{{imgUrls.length < 5}}"> --> <!-- <block wx:if="{{imgUrls.length < 5}}"> -->
<view wx:if="{{imgUrls.length<5}}" class="item camera-box text-center" bindtap="onUpload"> <view wx:if="{{imgUrls.length<imagesMax}}" class="item camera-box text-center" bindtap="onUpload">
<view class="icon"> <view class="icon">
<glsx-image webp src="/mine/camera.png"></glsx-image> <glsx-image webp src="/mine/camera.png"></glsx-image>
</view> </view>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<image webp src="{{item}}" mode="aspectFill" class="image"></image> <image webp src="{{item}}" mode="aspectFill" class="image"></image>
<view class="del" catchtap="onDel" data-index="{{index}}"> <view class="del" catchtap="onDel" data-index="{{index}}">
<view class="icon"> <view class="icon">
<mp-icon icon="close2" color="#D8D8D8" type="field" size="{{16}}"></mp-icon> <mp-icon icon="close2" color="#656566" type="field" size="{{16}}"></mp-icon>
</view> </view>
</view> </view>
</view> </view>
......
const { mockDeliveryInfoData } = require("./mock.js");
Component({ Component({
properties: { properties: {
showExpress: { showExpress: {
...@@ -11,6 +9,4 @@ Component({ ...@@ -11,6 +9,4 @@ Component({
value: {} value: {}
} }
}, },
data: {
},
}); });
\ No newline at end of file \ No newline at end of file
const mockDeliveryInfoData = {
orderInfo: {
deliveryCompany: '深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层深圳广联赛讯有限公司',
deliveryNumber: 'SF1234567890',
deliveryStatus: 2
},
deliveryStatus: {
1: "待发货",
2: "已发货",
3: "已收货",
}
};
module.exports = {
mockDeliveryInfoData
};
\ No newline at end of file \ No newline at end of file
...@@ -3,21 +3,21 @@ Component({ ...@@ -3,21 +3,21 @@ Component({
orderInfo: { orderInfo: {
type: Object, type: Object,
value: {}, value: {},
observer: function (v) { // observer: function (v) {
this.compute(v); // this.compute(v);
} // }
} }
}, },
methods: { methods: {
compute(info) { // compute(info) {
let { freightAmount = 0, sellQty,applyQty, redeemPoints } = info; // let { freightAmount = 0, sellQty,applyQty, redeemPoints } = info;
const total = +redeemPoints * +(sellQty||applyQty) + +freightAmount; // const total = +redeemPoints * +(sellQty||applyQty) + +freightAmount;
this.setData({ // this.setData({
total, // total,
freightAmount, // freightAmount,
info // info
}) // })
console.log(this.data.orderInfo) // console.log(this.data.orderInfo)
} // }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
</block> --> </block> -->
<view class="item"> <view class="item">
<view class="label">实付款:</view> <view class="label">实付款:</view>
<view class="value fontColor">{{total}}积分</view> <view class="value fontColor">{{orderInfo.___totalPrice}}积分</view>
</view> </view>
<view class="item"> <view class="item">
<view class="label">运费:</view> <view class="label">运费:</view>
<view class="value">{{freightAmount}}</view> <view class="value">{{orderInfo.freightAmount||0}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="label">订单编号:</view> <view class="label">订单编号:</view>
......
// 整合所有组件的mock数据,用于页面整体调试
const { mockDeliveryInfoData } = require('./components/DeliveryInfo/mock.js');
const { mockOrderInfoData } = require('./components/OrderInfo/mock.js');
const { mockOrderGoodsData } = require('./components/OrderGoods/mock.js');
const { mockOrderAmountData } = require('./components/OrderAmount/mock.js');
const mockOrderDetailData = {
orderInfo: {
...mockDeliveryInfoData.orderInfo,
...mockOrderInfoData.orderInfo,
...mockOrderGoodsData.orderInfo,
...mockOrderAmountData.orderInfo,
merchantName: '官方旗舰店',
orderSource: 1
},
orderObj: mockOrderInfoData.orderObj,
statusEnum: mockOrderInfoData.statusEnum,
deliveryStatus: mockDeliveryInfoData.deliveryStatus
};
module.exports = {
mockOrderDetailData
};
\ No newline at end of file \ No newline at end of file
...@@ -7,9 +7,9 @@ Component({ ...@@ -7,9 +7,9 @@ Component({
item: { item: {
type: Object, type: Object,
value: {}, value: {},
observer: function (v) { // observer: function (v) {
this.compute(v); // this.compute(v);
}, // },
}, },
}, },
...@@ -17,14 +17,14 @@ Component({ ...@@ -17,14 +17,14 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
compute(item) { // compute(item) {
let { applyQty, sellQty, redeemPoints, freightAmount = 0 } = item; // let { applyQty, sellQty, redeemPoints, freightAmount = 0 } = item;
const total = sellQty || applyQty || 0; // const total = sellQty || applyQty || 0;
let sum = redeemPoints * total + +freightAmount; // let sum = redeemPoints * total + +freightAmount;
this.setData({ // this.setData({
sum, // sum,
total, // total,
}); // });
}, // },
}, },
}); });
<view class="bottom"> <view class="bottom">
<view class="total"> <view class="total">
共{{total}}件,实付款 共{{item.___qty}}件,实付款
<text class="price">{{sum||'--'}}积分</text> <text class="price">{{item.___totalPrice||'--'}}积分</text>
</view> </view>
<order-action-buttons order="{{item}}" has-user-info="{{hasUserInfo}}" /> <order-action-buttons order="{{item}}" has-user-info="{{hasUserInfo}}" />
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class="info-top"> <view class="info-top">
<view class="name text-hide">{{item.goodsSkuName}}</view> <view class="name text-hide">{{item.goodsSkuName}}</view>
<view class="number"> <view class="number">
<mp-icon icon="close" color="#656566" size="{{12}}"></mp-icon>{{item.sellQty||item.applyQty}} <mp-icon icon="close" color="#656566" size="{{12}}"></mp-icon>{{item.___qty}}
</view> </view>
</view> </view>
<view class="info-bottom"> <view class="info-bottom">
......
...@@ -140,7 +140,7 @@ Component({ ...@@ -140,7 +140,7 @@ Component({
// 售后 // 售后
onAfterSale(e) { onAfterSale(e) {
let { subOrderCode, redeemPoints, goodsSource, sellQty,applyQty,goodsSkuCode } = let { subOrderCode, redeemPoints, goodsSource,goodsSkuCode,___qty } =
this.data.order; this.data.order;
console.log(this.data.order) console.log(this.data.order)
wx.p.router.go( wx.p.router.go(
...@@ -149,7 +149,7 @@ Component({ ...@@ -149,7 +149,7 @@ Component({
subOrderCode, subOrderCode,
refundPoints: redeemPoints, refundPoints: redeemPoints,
goodsSource, goodsSource,
applyQty: applyQty || sellQty, applyQty: ___qty,
goodsSkuCode goodsSkuCode
} }
); );
......
/* packageMine/pages/order/index/index.wxss */
.sticky-box {
background-color: #F9F7F7;
}
.tab {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #F9F7F7;
z-index: 2;
transition: all 0.4s;
}
.navigation {
width: 100%;
height: 100%;
position: relative;
}
.navigation .back {
width: 64rpx;
height: 64rpx;
background: rgba(255, 255, 255, 0.5);
border-radius: var(--margin);
position: absolute;
left: 20rpx;
}
.navigation .back .icon {
width: 36rpx;
height: 36rpx;
}
.search-box {
position: absolute;
left: 80rpx;
width: 420rpx;
height: 72rpx;
background: #F7F8FA;
border-radius: 36rpx;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 16rpx 0 var(--margin);
}
.search-box .icon {
width: 40rpx;
height: 100%;
margin-right: 10rpx;
}
.search-box .input {
width: calc(100% - 98rpx);
}
.search-box .clear-box {
width: 58rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.search-box .clear-box .clear {
width: 32rpx;
height: 32rpx;
opacity: 0.7;
}
.placeholder-class {
color: #C8C9CC;
}
.layout {
padding: 24rpx var(--margin) 40rpx;
}
.layout .item {
position: relative;
padding-left: 24rpx;
margin-bottom: 20rpx;
background-color: #fff;
box-sizing: border-box;
border-radius: var(--borderRadius);
display: flex;
flex-direction: column;
}
.layout .item .top {
height: 82rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 24rpx;
position: relative;
}
.layout .item .top .name {
width: 410rpx;
height: 40rpx;
font-size: 28rpx;
color: #2D2D2E;
}
.layout .item .goods {
height: 208rpx;
padding: 24rpx 24rpx 24rpx 0;
box-sizing: border-box;
display: flex;
}
.addTo {
border-bottom: 2rpx solid #eff0f2;
}
.layout .item .goods .btn {
display: flex;
align-items: center;
justify-content: center;
width: 124rpx;
height: 46rpx;
border-radius: 25rpx;
border: 2rpx solid #b1b1b3;
font-size: 24rpx;
margin-left: 12rpx;
color: #656566;
position: absolute;
bottom: 0;
right: 0;
}
.layout .item .goods .confirm {
border-color: var(--btnColor);
color: var(--btnColor);
font-weight: 500;
}
.layout .item .icon {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
border-radius: 8rpx;
overflow: hidden;
}
.background-X {
background-color: rgb(244, 244, 244);
}
.layout .item .info {
width: calc(100% - 180rpx);
height: 160rpx;
display: flex;
flex-direction: column;
position: relative;
}
.layout .item .info .info-top,
.layout .item .info .info-bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.layout .item .info .info-top .number {
color: #656566;
font-size: 24rpx;
}
.layout .item .info .info-bottom {
margin-top: 4rpx;
font-size: 24rpx;
color: #707071;
display: flex;
flex-direction: column;
align-items:flex-start;
gap: 8rpx;
}
.layout .item .info .info-bottom .price {
color: var(--themeColor);
font-size: 26rpx;
font-weight: 500;
}
.layout .item .info .info-bottom .specification {
color: #b1b1b3;
}
.layout .item .status {
font-size: 28rpx;
color: #282829;
font-weight: 400;
}
.layout .item .bottom {
margin-top: 36rpx;
height: 64rpx;
display: flex;
align-items: flex-start;
font-size: 24rpx;
color: #656566;
}
.layout .item .bottom .total {
position: relative;
bottom: 16rpx;
}
.layout .item .bottom .price {
color: var(--themeColor);
font-weight: 600;
margin-left: 10rpx;
}
.layout .item .btn-box {
position: absolute;
right: 24rpx;
bottom: 16rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.layout .item .btn-box .btn {
display: flex;
align-items: center;
justify-content: center;
width: 144rpx;
height: 64rpx;
border-radius: 16rpx;
border: 1rpx solid #DCDFE6;
font-size: 24rpx;
margin-left: 12rpx;
color: #1B233D;
}
.layout .item .btn-box .pay {
background-color: var(--btnColor);
color: #fff;
border-color: var(--btnColor);
}
.layout .item .btn-box .empty{
color: var(--btnColor);
background-color: #fff;
}
.layout .item .btn-box .confirm {
border-color: var(--btnColor);
color: var(--btnColor);
font-weight: 500;
}
.userProfile {
background-color: #fff;
font-size: 24rpx;
margin: 0;
padding: 0;
font-weight: 500;
line-height: 46rpx;
}
.layout .coupon-item {
height: 202rpx;
background: #fefffe;
border-radius: 8rpx;
margin-bottom: 36rpx;
padding: 20rpx;
box-sizing: border-box;
position: relative;
}
.layout .coupon-item .orderPrices {
position: absolute;
color: var(--btnColor);
font-size: 48rpx;
right: 32rpx;
}
.layout .coupon-item .orderPrices text {
font-size: 36rpx;
}
.layout .coupon-item .icon {
width: 162rpx;
height: 162rpx;
margin-right: 20rpx;
}
.layout .coupon-item .info {
width: 360rpx;
height: 100%;
color: #b1b1b3;
font-size: 24rpx;
}
.layout .coupon-item .info .name {
font-size: 28rpx;
font-weight: 500;
color: #282829;
}
.layout .coupon-item .info .order-btn {
width: 138rpx;
height: 48rpx;
background: var(--btnColor);
border-radius: 24rpx;
margin-top: 40rpx;
color: #ffffff;
font-size: 24rpx;
}
.imageHeight {
height: 99rpx !important;
}
.imageStraight {
width: 92rpx;
height: 92rpx;
border-radius: 50%;
}
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/index/index.js
import { orderMixin } from "~/mixins/index";
import NP from "number-precision";
import { ORDER_LIST } from "~/constants/mine.js";
/**查询订单
* '全部 ', '待付款 1', '待发货 3', '待收货 2', '评价 4', '退款/售后 5'
*/
const orderStatusPartEnum = {
0: "",
1: 1,
2: 3,
3: 2,
4: 5,
5: 6,
};
Page({
behaviors: [orderMixin],
/**
* 页面的初始数据
*/
data: {
pageNum: 1,
tab: Object.freeze(ORDER_LIST.map((item) => item.text)),
// 硬编码的订单列表数据
list: [
{
id: "1",
orderCode: "20230915001",
orderClassify: 1,
orderSource: 1,
orderStatus: 1,
afterSaleStatus: null,
merchantName: "精品商城",
deliveryType: 2,
payPrice: "199",
goodsNumber: 1,
createdDate: "2023-09-15 14:30:00",
evaluatedFlag: "N",
relatedUserCouponStatus: 1,
orderGoods: [
{
id: "101",
goodsImage:
"http://gips2.baidu.com/it/u=4231193786,3187314859&fm=3028&app=3028&f=JPEG&fmt=auto?w=1024&h=1024",
goodsName: "车载充电器",
specificationData: "白色 1个装",
retailPrice: "199",
activityPrice: null,
goodsNumber: 1,
warrantyDate: "2024-09-15 14:30:00",
},
],
},
{
id: "2",
orderCode: "20230914002",
orderClassify: 1,
orderSource: 2,
orderStatus: 6,
afterSaleStatus: null,
merchantName: "汽车用品店",
deliveryType: 2,
payPrice: "599",
goodsNumber: 2,
createdDate: "2023-09-14 10:15:00",
evaluatedFlag: "N",
relatedUserCouponStatus: 1,
orderGoods: [
{
id: "102",
goodsImage:
"http://gips2.baidu.com/it/u=4231193786,3187314859&fm=3028&app=3028&f=JPEG&fmt=auto?w=1024&h=1024",
goodsName: "汽车脚垫",
specificationData: "黑色 适配SUV",
retailPrice: "399",
activityPrice: "299",
goodsNumber: 1,
warrantyDate: "2024-09-14 10:15:00",
},
{
id: "103",
goodsImage:
"http://gips2.baidu.com/it/u=4231193786,3187314859&fm=3028&app=3028&f=JPEG&fmt=auto?w=1024&h=1024",
goodsName: "车载香水",
specificationData: "海洋香型",
retailPrice: "200",
activityPrice: null,
goodsNumber: 1,
warrantyDate: "2024-09-14 10:15:00",
},
],
},
{
id: "3",
orderCode: "20230910003",
orderClassify: 1,
orderSource: 3,
orderStatus: 4,
afterSaleStatus: null,
merchantName: "汽车配件专营店",
deliveryType: 2,
payPrice: "899",
goodsNumber: 1,
createdDate: "2023-09-10 16:45:00",
evaluatedFlag: "N",
relatedUserCouponStatus: 1,
orderGoods: [
{
id: "104",
goodsImage:
"http://gips2.baidu.com/it/u=4231193786,3187314859&fm=3028&app=3028&f=JPEG&fmt=auto?w=1024&h=1024",
goodsName: "行车记录仪",
specificationData: "1080P高清 夜视",
retailPrice: "899",
activityPrice: null,
goodsNumber: 1,
warrantyDate: "2024-09-10 16:45:00",
},
],
},
{
id: "4",
orderCode: "20230905004",
orderClassify: 1,
orderSource: 1,
orderStatus: 5,
afterSaleStatus: null,
merchantName: "精品商城",
deliveryType: 1,
payPrice: "1299",
goodsNumber: 1,
createdDate: "2023-09-05 09:20:00",
evaluatedFlag: "N",
relatedUserCouponStatus: 1,
orderGoods: [
{
id: "105",
goodsImage:
"http://gips2.baidu.com/it/u=4231193786,3187314859&fm=3028&app=3028&f=JPEG&fmt=auto?w=1024&h=1024",
goodsName: "车载导航",
specificationData: "10英寸 安卓系统",
retailPrice: "1299",
activityPrice: null,
goodsNumber: 1,
warrantyDate: "2024-09-05 09:20:00",
},
],
},
{
id: "5",
orderCode: "20230901005",
orderClassify: 1,
orderSource: 5,
orderStatus: 9,
afterSaleStatus: 2,
merchantName: "权益商城",
deliveryType: 2,
payPrice: "299",
goodsNumber: 1,
createdDate: "2023-09-01 11:30:00",
evaluatedFlag: "N",
relatedUserCouponStatus: 1,
activityBigImg:
"http://gips2.baidu.com/it/u=4231193786,3187314859&fm=3028&app=3028&f=JPEG&fmt=auto?w=1024&h=1024",
activityName: "洗车服务券",
orderGoods: [
{
id: "106",
goodsImage:
"http://gips2.baidu.com/it/u=4231193786,3187314859&fm=3028&app=3028&f=JPEG&fmt=auto?w=1024&h=1024",
goodsName: "洗车服务券",
specificationData: "1次洗车服务",
retailPrice: "299",
activityPrice: null,
goodsNumber: 1,
warrantyDate: "2024-09-01 11:30:00",
},
],
},
],
listFlag: true,
hasUserInfo: true,
},
navbarReady(e) {
wx.p.wxApi.getViewInfo(".tab", (res) => {
this.setData({
padding_bottom: e.detail.height,
margin_top: e.detail.height + res.height,
});
});
},
jump(e) {
let {
item: { orderStatus, orderCode, orderSource },
} = e.currentTarget.dataset;
if (orderSource == 5 && (orderStatus == 2 || orderStatus == 7)) return;
let url = "/packageMine/pages/order/detail/detail";
wx.p.router.go(url, {
orderCode,
});
},
afterSaleDetail(e) {
let url = "/packageMine/pages/order/afterSaleDetail/afterSaleDetail";
let {
item: { orderCode },
} = e.currentTarget.dataset;
wx.p.router.go(url, {
orderCode,
});
},
back() {
let { length } = getCurrentPages();
if (length == 1) wx.p.router.switchTab("/pages/tab/mine/index");
else wx.p.router.back();
},
changeTab(e) {
this.setData({
tabIndex: e.detail,
orderStatusPart: orderStatusPartEnum[e.detail],
});
this.clearData();
},
//立即评价
evaluate(e) {
let {
item: { orderCode },
} = e.currentTarget.dataset;
let { userInfo } = this.data;
wx.p.router.go("/packageMall/pages/addComment/addComment", {
orderCode,
userInfo,
});
},
//查看详情评价
lookevaluate(e) {
let {
item: { orderCode },
} = e.currentTarget.dataset;
wx.p.router.go(
"/packageMall/pages/commentDetails/commentDetails",
orderCode
);
},
//取消售后
cancelOrder(e) {
let { orderCode } = e.currentTarget.dataset;
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);
}
});
}
});
},
//取消付款
cancelPay(e) {
let { orderCode } = e.currentTarget.dataset;
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);
}
});
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.p.router.getRouterParams(options).then((option) => {
this.setData({
tabIndex: option.code,
orderStatusPart: option.code,
});
// this.clearData(); // 注释掉实际的API调用,使用硬编码数据
});
},
onShow() {
if (this.refresh) this.clearData();
},
onHide() {
this.refresh = true;
},
async clearData() {
const res = !wx.p.isLogin;
if (res) return;
this.setData({
listFlag: false,
// list: [], // 注释掉清空列表,保持硬编码数据
nothing: false,
pageNum: 1,
});
// this.getOrderList(); // 注释掉实际的API调用,使用硬编码数据
this.setData({
listFlag: true,
});
},
search() {
this.clearData();
},
clear() {
this.setData({
keyword: "",
});
},
input(e) {
this.setData({
keyword: e.detail.value,
});
},
blur() {
let { keyword } = this.data;
this.setData({
keyword,
});
},
getOrderList() {
// 使用硬编码数据,不需要实际调用API
/*
wx.p.wxApi.showLoading("加载中...");
let { orderStatusPart, pageNum, keyword } = this.data;
let obj = {
orderStatusPart,
currentPage: pageNum,
};
if (keyword) {
keyword = keyword.replace(/\ /g, "");
if (keyword.length) obj.keyword = keyword;
}
let list = [];
wx.p.api.mineApi.getOrderList(obj).then((data) => {
wx.hideLoading();
data?.list?.map((e) => {
let { orderGoods, createdDate, orderClassify } = e;
let goodsNumber = 0;
let expiredTime = 0;
orderGoods?.map((i) => {
i.retailPrice = Number(i.retailPrice).toFixed(2);
if (i.activityPrice)
i.activityPrice = Number(i.activityPrice).toFixed(2);
goodsNumber += i.goodsNumber;
expiredTime = new Date(i.warrantyDate).format("yyyy-MM-dd hh:mm:ss");
if (orderClassify == 5) {
e.payPrice = NP.times(i.retailPrice, i.goodsNumber);
}
});
list.push({
...e,
goodsNumber,
time: new Date(createdDate).format("yyyy-MM-dd hh:mm:ss"),
expiredTime,
});
});
this.setData({
list,
listFlag: true,
});
wx.hideLoading();
});
*/
},
pay(e) {
let _this = this;
wx.p.wxApi.showLoading("结算中...");
wx.p.api.shopmallApi
.payOrder(e.currentTarget.dataset)
.then(({ needPay, payParams }) => {
wx.hideLoading();
if (needPay) {
let params = {
nonceStr: payParams.nonceStr,
paySign: payParams.paySign,
signType: payParams.signType,
timeStamp: payParams.timeStamp,
package: payParams.packages,
};
wx.requestPayment({
...params,
success(res) {
setTimeout(() => {
_this.clearData();
}, 1.5e3);
_this.requestSubscribeMessage();
},
fail(res) {
if (res.errMsg == "requestPayment:fail cancel") {
wx.p.wxApi.showToast("取消支付");
} else {
wx.p.router.go("/packageMine/pages/order/complete/complete", {
params,
});
}
},
});
} else {
_this.requestSubscribeMessage();
}
});
},
requestSubscribeMessage() {
wx.p.router.go("/packageMine/pages/order/complete/complete", {
success: true,
});
return;
let systemInfo = wx.p.storage.get("system_info");
if (systemInfo && systemInfo.environment != "wxwork") {
wx.p.router.go("/packageMine/pages/order/complete/complete", {
success: true,
});
return;
}
let tmplIds;
wx.p.api.shopmallApi.requestSubscribeMessage().then((res) => {
tmplIds = res.data;
wx.requestSubscribeMessage({
tmplIds: tmplIds,
success(res) {
wx.p.router.go("/packageMine/pages/order/complete/complete", {
success: true,
});
},
});
});
},
confirmReceipt(e) {
let { orderCode } = e.currentTarget.dataset;
wx.showModal({
title: "温馨提示",
content: "是否确认收货",
confirmText: "确认",
cancelText: "取消",
confirmColor: "#F13C3D",
}).then((res) => {
if (res.confirm) {
wx.p.api.shopmallApi.confirmReceipt(orderCode).then((data) => {
wx.p.wxApi.showToast("操作成功");
setTimeout(() => {
this.clearData();
}, 1.5e3);
});
}
});
},
afterSale(e) {
let {
item: { orderCode, payPrice },
} = e.currentTarget.dataset;
wx.p.router.go(
"/packageMine/pages/order/afterSale_step_one/afterSale_step_one",
{
orderCode,
refundPrice: payPrice,
}
);
},
// 卡卷 售后详情
toSaleDetailPage(e) {
const { item } = e.currentTarget.dataset;
wx.p.router.go("/packageEquity/pages/saleDetail/saleDetail", {
orderCode: item.orderCode,
});
},
// 查看卡券
toCheckCard(e) {
const { item } = e.currentTarget.dataset;
wx.p.router.go("/packageEquity/pages/kaqDetail/kaqDetail", {
orderCode: item.orderCode,
});
},
// 查看膨胀金详情
toGoldDetail(e) {
const { item } = e.currentTarget.dataset;
wx.p.router.go("/packageEquity/pages/kaqDetail/orderDetail", {
orderCode: item.orderCode,
});
},
// 卡卷 申请售后
toSaleApplyPage(e) {
let { item } = e.currentTarget.dataset;
item.pageFrom = "coupons";
wx.p.router.go("/packageEquity/pages/saleApply/saleApply", item);
},
// 卡卷 确认收货
toComfirmPage(e) {
let { item } = e.currentTarget.dataset;
let para = {
orderCode: item.orderCode,
};
wx.showModal({
title: "提示",
content: "确认收货",
confirmText: "是",
cancelText: "否",
confirmColor: "#F13C3D",
}).then((res) => {
if (res.confirm) {
wx.p.api.equityApi.comfirmRevice(para).then((res) => {
wx.p.wxApi.showToast("确认收货成功");
setTimeout(() => {
this.clearData();
}, 1.5e3);
});
}
});
},
// 套餐申请售后
toSaleApplyPackage(e) {
let { item } = e.currentTarget.dataset;
item.pageFrom = "package";
wx.p.router.go("/packageEquity/pages/saleApply/saleApply", item);
},
// 套餐售后详情
toPackageDetail(e) {
const { item } = e.currentTarget.dataset;
wx.p.router.go("/packageEquity/pages/packageDetail/packageDetail", {
orderCode: item.orderCode,
});
},
// 套餐查看卡包
toCheckPackage(e) {
const { item } = e.currentTarget.dataset;
wx.p.router.go("/packageEquity/pages/packageDetail/packageDetail", {
orderCode: item.orderCode,
});
},
// 精品订单跳转页面
boutiqueJump(e) {
let { orderCode } = e.currentTarget.dataset;
wx.p.router.go(
"/packageMine/pages/boutiquePages/boutiqueOrder/boutiqueOrder",
{
orderCode,
type: 2,
}
);
},
/**
* 刷新订单列表
*/
onRefresh() {
// 调用混入中的方法获取订单列表
if (this.getOrderList && typeof this.getOrderList === 'function') {
this.getOrderList();
}
}
});
<view class="sticky-box">
<navigation-bar custom bindnavbarReady="navbarReady" page-title="我的订单">
<view class="navigation">
<view class="back text-center y-center" bindtap="back">
<glsx-image webp src="mall/back.png" class="icon"></glsx-image>
</view>
<view class="search-box y-center">
<view class="icon text-center">
<icon type="search" size="16"></icon>
</view>
<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>
</view>
</block>
</view>
</view>
</navigation-bar>
<view class="tab" style="top:{{padding_bottom }}px;">
<tab tab="{{tab}}" bindclick="changeTab" index="{{tabIndex}}"></tab>
</view>
</view>
<block wx:if="{{margin_top}}">
<view class="layout isFullSucreen" style="margin-top:{{margin_top}}px;">
<block wx:if="{{listFlag}}">
<block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index">
<!-- orderClassify 订单类型(1.订单;2:会员权益订单;3:门店服务订单;4:精品升级订单;5:平台商城订单) -->
<block wx:if="{{item.orderClassify == 1}}">
<view class="item" catchtap="jump" data-item="{{item}}">
<view class="top">
<view class="delivery-icon" wx:if="{{item.orderSource != 5}}">
<glsx-image webp src="mine/order/deliveryType-{{item.deliveryType}}.png">
</glsx-image>
</view>
<view class="name text-hide">{{item.merchantName}}</view>
<!-- 订单状态 orderStatus(1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待发货;7:待安装;8:已安装;9:售后中;10:售后完成)
售后订单状态 afterSaleStatus(1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败)
-->
<view class="status">{{item.afterSaleStatus ? afterSaleStatus[item.afterSaleStatus]
:statusEnum[item.orderStatus]}}</view>
</view>
<view class="content-top {{item.orderStatus == 5 || item.orderStatus == 8?'':'content-bottom'}}">
<block wx:for="{{item.orderGoods}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="goods {{item.orderStatus == 5 || item.orderStatus == 8?'addTo':''}}">
<view class="icon">
<image webp wx:if="{{item.orderSource == 5}}" src="{{item.activityBigImg}}"></image>
<image webp wx:else src="{{i.goodsImage}}"></image>
</view>
<view class="info">
<view class="info-top">
<view class="name text-hide">{{item.orderSource == 5 ? item.activityName: i.goodsName}}</view>
<view class="price">
<text class="unit">¥</text>
{{item.orderSource == 5 ? item.payPrice: (i.activityPrice ||i.retailPrice)}}
</view>
</view>
<view class="info-bottom">
<block wx:if="{{i.specificationData}}">
<view class="specification">{{i.specificationData}}</view>
</block>
<view class="number">
x{{item.orderSource == 5 ? 1: i.goodsNumber}}
</view>
</view>
<!-- !hasUserInfo -->
<view wx:if="{{item.orderGoods.length > 1 && !hasUserInfo}}">
<block wx:if="{{item.orderStatus == 5 || item.orderStatus == 8}}">
<block wx:if="{{item.evaluatedFlag == 'Y'}}">
<view class="btn confirm" catchtap="lookevaluate" data-item="{{item}}">查看评价</view>
</block>
<block wx:else>
<button catchtap="getUserProfile" wx:if="{{!hasUserInfo}}" class="btn confirm userProfile" data-item="{{item}}"> 立即评价 </button>
<view class="btn confirm" catchtap="evaluate" wx:else data-item="{{item}}">立即评价</view>
</block>
</block>
</view>
</view>
</view>
</block>
</view>
<view class="bottom" wx:if="{{item.orderSource == 5}}">
共1件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<view class="bottom" wx:else>
共{{item.goodsNumber}}件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<!-- 1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待发货;7:待安装;8:已安装;9:售后中;10:售后完成 -->
<!-- 售后状态 1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败 -->
<block wx:if="{{item.orderStatus != 3}}">
<view class="btn-box">
<block wx:if="{{!item.afterSaleStatus}}">
<block wx:if="{{item.orderStatus == 1}}">
<view class="btn pay" catchtap="cancelPay" data-order-code="{{item.orderCode}}">取消付款</view>
<block wx:if="{{item.orderSource != 4}}">
<view class="btn pay" catchtap="pay" data-order-code="{{item.orderCode}}">去支付</view>
</block>
</block>
<block wx:if="{{item.orderSource==5 && (item.orderStatus == 2 || item.orderStatus == 7)}}">
<view class="btn pay" data-item="{{item}}" bind:tap="toGoldDetail">查看详情</view>
</block>
<block wx:elif="{{item.orderStatus > 2 && item.orderStatus < 9}}">
<!-- deliveryType 结算方式(1:到店核销,2:快递发货) -->
<block wx:if="{{item.deliveryType == 2 && item.orderStatus == 4}}">
<view class="btn confirm" catchtap="confirmReceipt" data-order-code="{{item.orderCode}}">确认收货
</view>
</block>
<block wx:if="{{item.payPrice > 0 && item.orderSource != 4}}">
<view class="btn" catchtap="afterSale" data-item="{{item}}" wx:if="{{!(item.relatedUserCouponStatus == 2 || item.relatedUserCouponStatus == 3)}}">申请售后
</view>
</block>
</block>
<!-- !hasUserInfo -->
<view wx:if="{{item.orderGoods.length == 1 && !hasUserInfo}}">
<block wx:if="{{item.orderStatus == 5 || item.orderStatus == 8}}">
<block wx:if="{{item.evaluatedFlag == 'Y'}}">
<view class="btn confirm" catchtap="lookevaluate" data-item="{{item}}">查看评价</view>
</block>
<block wx:else>
<button catchtap="getUserProfile" wx:if="{{!hasUserInfo}}" class="btn confirm userProfile" data-item="{{item}}"> 立即评价 </button>
<view class="btn confirm" catchtap="evaluate" wx:else data-item="{{item}}">立即评价</view>
</block>
</block>
</view>
</block>
<block wx:else>
<block wx:if="{{item.afterSaleStatus == 1}}">
<view class="btn pay" catchtap="cancelOrder" data-order-code="{{item.orderCode}}">取消售后</view>
</block>
<view class="btn" data-item="{{item}}" catchtap="afterSaleDetail">售后详情</view>
</block>
</view>
</block>
</view>
</block>
<block wx:if="{{item.orderClassify == 2 || item.orderClassify == 3}}">
<view class="item" wx:for="{{item.orderGoods}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="top">
<!-- <view class="delivery-icon">
<image webp src="../../../images/{{item.orderType == 1?'exchange':'combo'}}.png"></image>
</view> -->
<view class="name text-hide" wx:if="{{item.orderClassify == 3}}">{{item.merchantName}}</view>
<view class="name text-hide" wx:if="{{item.orderClassify == 2}}">平台特供</view>
<!-- 套餐状态 -->
<view class="status" wx:if="{{item.orderClassify == 3 && item.equityOrderStatus !== 4}}">
{{cardStatus[item.equityOrderStatus]}}</view>
<view class="status" wx:if="{{item.orderClassify == 3 && item.equityOrderStatus == 4}}">
{{reStatus[item.equityOrderStatus]}}</view>
<!-- 直冲卡卷状态 -->
<view class="status" wx:if="{{i.appearance == 2}}">{{reStatus[item.equityOrderStatus]}}</view>
<view class="status" wx:if="{{i.appearance == 1 && item.equityOrderStatus !== 3}}">
{{cardStatus[item.equityOrderStatus]}}</view>
<view class="status" wx:if="{{i.appearance == 1 && item.equityOrderStatus == 3}}">已收货</view>
</view>
<view class="content">
<view class="goods">
<view class="icon background-X">
<!-- <image webp src="{{i.goodsImage}}"></image> -->
<glsx-image webp wx:if="{{item.orderClassify == 3}}" src="mine/order/combo.png"></glsx-image>
<image webp wx:else src="{{i.goodsImage}}" class="{{i.appearance == 1 ?'imageHeight':'imageStraight'}}"></image>
</view>
<view class="info">
<view class="info-top">
<view class="name text-hide">{{i.goodsName}}</view>
<view class="price">
<text class="unit">¥</text>
{{i.activityPrice ||i.retailPrice}}
</view>
</view>
<view class="info-bottom">
<view class="specification">
<view wx:if="{{i.appearance==1}}">质保期至 {{item.expiredTime}}</view>
<view wx:if="{{i.appearance == 2}}">充值账号:{{i.rechargeNumber || ''}}</view>
<view wx:if="{{i.appearance == 2}}">购买日期 {{item.time}}</view>
<view wx:if="{{item.orderClassify == 3&&i.appearance==null}}">{{i.specificationData}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="bottom">
<view wx:if="{{i.appearance==2}}">订单编号 {{item.orderCode}}</view>
</view>
<view class="btn-box" wx:if="{{item.orderClassify == 2&&i.appearance == 1}}">
<view wx:if="{{item.equityOrderStatus==4 || item.equityOrderStatus==6}}" class="btn" data-item="{{item}}" bind:tap="toSaleDetailPage">售后详情</view>
<block wx:if="{{item.payPrice > 0 && item.orderSource != 4}}">
<view wx:if="{{item.equityOrderStatus==2}}" data-item="{{item}}" bind:tap="toSaleApplyPage" class="btn">申请售后</view>
</block>
<view wx:if="{{item.equityOrderStatus==2 || item.equityOrderStatus==4}}" data-item="{{item}}" bind:tap="toComfirmPage" class="btn confirm">确认收货</view>
<view wx:if="{{item.equityOrderStatus!=6}}" class="btn pay" data-item="{{item}}" bind:tap="toCheckCard">
查看卡券</view>
</view>
<view class="btn-box" wx:if="{{item.orderClassify==3}}">
<block wx:if="{{item.payPrice > 0 && item.orderSource != 4}}">
<view wx:if="{{item.orderClassify==3&&item.equityOrderStatus==2}}" data-item="{{item}}" bind:tap="toSaleApplyPackage" class="btn">申请售后</view>
</block>
<view wx:if="{{item.orderClassify==3&&item.equityOrderStatus==4}}" data-item="{{item}}" bind:tap="toPackageDetail" class="btn">售后详情</view>
<view wx:if="{{item.orderClassify==3&&item.equityOrderStatus!==4}}" class="btn pay" data-item="{{item}}" bind:tap="toCheckPackage">查看套餐</view>
</view>
</view>
</block>
<block wx:if="{{item.orderClassify == 4}}">
<view class="item">
<view class="top">
<view class="delivery-icon">
<glsx-image webp src="mine/order/boutique.png"></glsx-image>
</view>
<view class="name text-hide">{{item.merchantName}}</view>
</view>
<view class="content">
<view class="goods" wx:for="{{item.orderGoods}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="icon">
<!-- <image webp src="{{i.goodsImage}}"></image> -->
<image webp src="{{i.goodsImage}}"></image>
</view>
<view class="info">
<view class="info-top">
<view class="name text-hide">{{i.goodsName}}</view>
<view class="price">
<text class="unit">¥</text>
{{i.activityPrice ||i.retailPrice}}
</view>
</view>
<view class="info-bottom">
<block wx:if="{{i.specificationData}}">
<view class="specification">{{i.specificationData}}</view>
</block>
<view class="number">
x{{i.goodsNumber}}
</view>
</view>
</view>
</view>
</view>
<view class="bottom">
共{{item.goodsNumber}}件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<!-- !hasUserInfo -->
<block wx:if="{{!hasUserInfo}}">
<view class="btn-box">
<view class="btn confirm" catchtap="boutiqueJump" data-order-code="{{item.orderCode}}">评价</view>
</view>
</block>
</view>
</block>
<block wx:if="{{item.orderClassify == 5}}">
<view class="item" catchtap="jumpPlatformShop" data-item="{{item}}" data-url="orderDetail/orderDetail">
<view class="top">
<view class="name text-hide">平台特供</view>
<!-- 订单状态 orderStatus(1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待发货;7:待安装;8:已安装;9:售后中;10:售后完成)
售后订单状态 afterSaleStatus(1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败)
-->
<view class="status">{{item.afterSaleStatus ? afterSaleStatus[item.afterSaleStatus]
:statusEnum[item.orderStatus]}}</view>
</view>
<view class="content-top {{item.orderStatus == 5 || item.orderStatus == 8?'':'content-bottom'}}">
<block wx:for="{{item.orderGoods}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="goods {{item.orderStatus == 5 || item.orderStatus == 8?'addTo':''}}">
<view class="icon">
<image webp src="{{i.goodsImage}}"></image>
</view>
<view class="info">
<view class="info-top">
<view class="name text-hide">
<text>{{i.goodsName}}</text>
</view>
<view class="price">
<text class="unit">¥</text>
{{i.retailPrice}}
</view>
</view>
<view class="info-bottom">
<block wx:if="{{i.specificationData}}">
<view class="specification">{{i.specificationData}}</view>
</block>
<view class="number">
x{{i.goodsNumber}}
</view>
</view>
</view>
</view>
</block>
</view>
<view class="bottom" wx:if="{{item.orderSource == 5}}">
共1件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<view class="bottom" wx:else>
共{{item.goodsNumber}}件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<!-- 1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待发货;7:待安装;8:已安装;9:售后中;10:售后完成 -->
<!-- 售后状态 1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败 -->
<block wx:if="{{item.orderStatus != 3}}">
<view class="btn-box">
<block wx:if="{{!item.afterSaleStatus}}">
<block wx:if="{{item.orderStatus == 1}}">
<view class="btn" catchtap="cancelPlatformOrder" data-order-code="{{item.orderCode}}">取消订单</view>
<view class="btn pay empty" catchtap="toPayOrder" data-order-code="{{item.mainOrderCode}}">立即支付</view>
</block>
<block wx:elif="{{item.orderStatus > 2 && item.orderStatus < 9}}">
<block wx:if="{{item.orderStatus != 6 }}">
<view class="btn confirm" catchtap="jumpPlatformShop" data-item="{{item}}" data-url="orderDetail/orderDetail">查看物流
</view>
</block>
<block wx:if="{{item.platformOrderStatus == 1008 || item.platformOrderStatus == 1009}}">
<view class="btn" catchtap="jumpPlatformShop" data-item="{{item}}" data-url="applySale/index">售后
</view>
</block>
</block>
</block>
<block wx:else>
<view class="btn" catchtap="jumpPlatformShop" data-item="{{item}}" data-url="afterSaleDetail/index">售后</view>
</block>
</view>
</block>
</view>
</block>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing to-bottom"></view>
</block>
</block>
<block wx:else>
<view class="list-nothing">
暂无相关内容
</view>
</block>
</block>
</view>
</block>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/index/index.js // packageMine/pages/order/index/index.js
import { ORDER_STATUS, OrderStatusTypes,OrderStatusEnum } from "~/constants/mine.js"; import { ORDER_STATUS, OrderStatusTypes,OrderStatusEnum } from "~/constants/mine.js";
import { calcOrderProp } from "~/packageMine/pages/order/utils";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -164,29 +165,13 @@ Page({ ...@@ -164,29 +165,13 @@ Page({
let list = []; let list = [];
wx.p.api.mineApi[requestMethod](obj).then((data) => { wx.p.api.mineApi[requestMethod](obj).then((data) => {
wx.hideLoading(); wx.hideLoading();
data?.list?.map((e) => { data?.list?.forEach((e) => {
// let { const {___qty,___price,___totalPrice} =calcOrderProp(e)
// orderGoods,
// createdDate,
// orderClassify
// } = e;
// let goodsNumber = 0;
// let expiredTime = 0;
// orderGoods?.map((i) => {
// i.retailPrice = Number(i.retailPrice).toFixed(2);
// if (i.activityPrice)
// i.activityPrice = Number(i.activityPrice).toFixed(2);
// goodsNumber += i.goodsNumber;
// expiredTime = new Date(i.warrantyDate).format("yyyy-MM-dd hh:mm:ss");
// if (orderClassify == 5) {
// e.payPrice = NP.times(i.retailPrice, i.goodsNumber);
// }
// });
list.push({ list.push({
...e, ...e,
// goodsNumber, ___price,
// time: new Date(createdDate).format("yyyy-MM-dd hh:mm:ss"), ___totalPrice,
// expiredTime, ___qty,
}); });
}); });
this.setData({ this.setData({
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<input type="text" placeholder="搜索" value="{{keyword}}" class="input" confirm-type="search" bindconfirm="search" bindinput="input" bindblur="blur" /> <input type="text" placeholder="搜索" value="{{keyword}}" class="input" confirm-type="search" bindconfirm="search" bindinput="input" bindblur="blur" />
<block wx:if="{{keyword}}"> <block wx:if="{{keyword}}">
<view class="clear-box" bindtap="clear"> <view class="clear-box" bindtap="clear">
<mp-icon type="field" icon="close2" color="#2C2C2C" size="{{14}}"></mp-icon> <mp-icon type="field" icon="close2" color="#656566" size="{{14}}"></mp-icon>
</view> </view>
</block> </block>
</view> </view>
......
...@@ -98,3 +98,11 @@ export function getAfterSaleDetail(status) { ...@@ -98,3 +98,11 @@ export function getAfterSaleDetail(status) {
} }
return AFTER_SALE_STATUS[_status_] || {}; return AFTER_SALE_STATUS[_status_] || {};
} }
export function calcOrderProp(order){
const { applyQty, sellQty, redeemPoints, freightAmount = 0 } = order;
const ___qty = sellQty || applyQty || 0;
const ___price = (redeemPoints || 0) * ___qty;
const ___totalPrice = (redeemPoints || 0) * ___qty + +freightAmount;
return {___qty, ___price, ___totalPrice};
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!