Commit e048950a by liimin

refactor(order): 重构订单页面

- 更新 Tab 组件用法,优化标签页切换逻辑
- 移除订单列表硬编码,使用动态数据渲染
- 新增 OrderCard 组件,用于渲染订单卡片
- 优化订单详情跳转逻辑
- 删除冗余代码,提升代码可读性和维护性
1 parent 93158a78
Showing 30 changed files with 1566 additions and 513 deletions
...@@ -35,13 +35,15 @@ Component({ ...@@ -35,13 +35,15 @@ Component({
methods: { methods: {
click(e) { click(e) {
let { let {
count count,
item
} = e.currentTarget.dataset } = e.currentTarget.dataset
this.setData({ this.setData({
count, count,
to: `to-${count}` to: `to-${count}`
}) })
this.triggerEvent('click', count) this.triggerEvent('click', count)
} this.triggerEvent('change', {count,item})
},
} }
}) })
\ No newline at end of file \ No newline at end of file
<block wx:if="{{openScroll}}"> <block wx:if="{{openScroll}}">
<scroll-view class="tab-box {{align}}" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}"> <scroll-view class="tab-box {{align}}" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}">
<block wx:for="{{tab}}" wx:key="index"> <block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}" id="to-{{index}}" > <view class="tab {{index==count||count==item.code?'active':''}}" bindtap="click" data-count="{{index}}" id="to-{{index}}" >
<view class="text" >{{item}}</view> <view class="text" >{{item.text||item}}</view>
<!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> --> <!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
<view class="line"></view> <view class="line"></view>
</view> </view>
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<block wx:else> <block wx:else>
<view class="tab-box flex"> <view class="tab-box flex">
<block wx:for="{{tab}}" wx:key="index"> <block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}"> <view class="tab {{index==count||count==item.code?'active':''}}" bindtap="click" data-count="{{index}}" data-item="{{item}}">
<view class="text text-center">{{item}}</view> <view class="text text-center">{{item.text||item}}</view>
<view class="line"></view> <view class="line"></view>
</view> </view>
</block> </block>
......
...@@ -38,11 +38,11 @@ Page({ ...@@ -38,11 +38,11 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options,'=======') wx.p.router.getRouterParams(options).then(({ orderCode } = {}) => {
if (options && options.orderCode) { if (orderCode) {
let orderCode = options.orderCode;
this.getOrderDetail(orderCode); this.getOrderDetail(orderCode);
} }
});
}, },
getOrderDetail(orderCode) { getOrderDetail(orderCode) {
let { orderObj } = this.data; let { orderObj } = this.data;
...@@ -129,33 +129,4 @@ Page({ ...@@ -129,33 +129,4 @@ Page({
qr: QR.createQrCodeImg(`t=1&c=${data}`), qr: QR.createQrCodeImg(`t=1&c=${data}`),
}); });
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
}); });
// packageMine/pages/order/index/components/bottom/bottom.js
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type: Object,
value: {}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"style": "v2",
"usingComponents": {
"order-action-buttons": "../OrderActionButtons/OrderActionButtons"
}
}
\ No newline at end of file \ No newline at end of file
<view class="bottom">
<view class="total">共{{item.goodsNumber}}件,实付款<text class="price">{{item.payPrice}}积分</text></view>
<order-action-buttons
item="{{item}}"
has-user-info="{{hasUserInfo}}"
/>
</view>
\ No newline at end of file \ No newline at end of file
.bottom {
margin-top: 36rpx;
height: 64rpx;
display: flex;
align-items: flex-start;
font-size: 24rpx;
color: #656566;
}
.bottom .total {
position: relative;
bottom: 16rpx;
}
.bottom .price {
color: var(--themeColor);
font-weight: 600;
margin-left: 10rpx;
}
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/index/components/content/content.js
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type: Object,
value: {}
},
hasUserInfo: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
// 查看评价
onLookEvaluate(e) {
this.triggerEvent('lookEvaluate', {
item: e.currentTarget.dataset.item
});
},
// 获取用户信息
onGetUserProfile(e) {
this.triggerEvent('getUserProfile', {
item: e.currentTarget.dataset.item
});
},
// 立即评价
onEvaluate(e) {
this.triggerEvent('evaluate', {
item: e.currentTarget.dataset.item
});
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"style": "v2",
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<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="number">
x{{item.orderSource == 5 ? 1: i.goodsNumber}}
</view>
</view>
<view class="info-bottom">
<block wx:if="{{i.specificationData}}">
<view class="specification">{{i.specificationData}}</view>
</block>
<view class="price">
{{item.orderSource == 5 ? item.payPrice: (i.activityPrice ||i.retailPrice)}}积分
</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="onLookEvaluate" data-item="{{item}}">查看评价</view>
</block>
<block wx:else>
<button catchtap="onGetUserProfile" wx:if="{{!hasUserInfo}}" class="btn confirm userProfile" data-item="{{item}}"> 立即评价 </button>
<view class="btn confirm" catchtap="onEvaluate" wx:else data-item="{{item}}">立即评价</view>
</block>
</block>
</view>
</view>
</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
.content-top {
/* 样式将在使用时通过类名动态添加 */
}
.content-bottom {
/* 样式将在使用时通过类名动态添加 */
}
.goods {
height: 208rpx;
padding: 24rpx 24rpx 24rpx 0;
box-sizing: border-box;
display: flex;
}
.addTo {
border-bottom: 2rpx solid #eff0f2;
}
.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;
}
.goods .confirm {
border-color: var(--btnColor);
color: var(--btnColor);
font-weight: 500;
}
.icon {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
border-radius: 8rpx;
overflow: hidden;
}
.background-X {
background-color: rgb(244, 244, 244);
}
.info {
width: calc(100% - 180rpx);
height: 160rpx;
display: flex;
flex-direction: column;
position: relative;
}
.info-top,
.info-bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.info-top .number {
color: #656566;
font-size: 24rpx;
}
.info-bottom {
margin-top: 4rpx;
font-size: 24rpx;
color: #707071;
display: flex;
flex-direction: column;
align-items:flex-start;
gap: 8rpx;
}
.info-bottom .price {
color: var(--themeColor);
font-size: 26rpx;
font-weight: 500;
}
.info-bottom .specification {
color: #b1b1b3;
}
.userProfile {
background-color: #fff;
font-size: 24rpx;
margin: 0;
padding: 0;
font-weight: 500;
line-height: 46rpx;
}
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/index/components/orderActionButtons.js
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type: Object,
value: {}
},
hasUserInfo: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
// 取消付款
onCancelPay(e) {
const orderCode = e.currentTarget.dataset.orderCode;
this.triggerEvent('cancelPay', { orderCode });
},
// 去支付
onPay(e) {
const orderCode = e.currentTarget.dataset.orderCode;
this.triggerEvent('pay', { orderCode });
},
// 查看详情
onToGoldDetail(e) {
const item = e.currentTarget.dataset.item;
this.triggerEvent('toGoldDetail', { item });
},
// 售后
onAfterSale(e) {
const item = e.currentTarget.dataset.item;
this.triggerEvent('afterSale', { item });
},
// 确认收货
onConfirmReceipt(e) {
const orderCode = e.currentTarget.dataset.orderCode;
this.triggerEvent('confirmReceipt', { orderCode });
},
// 查看评价
onLookEvaluate(e) {
const item = e.currentTarget.dataset.item;
this.triggerEvent('lookEvaluate', { item });
},
// 获取用户信息
onGetUserProfile(e) {
const item = e.currentTarget.dataset.item;
this.triggerEvent('getUserProfile', { item });
},
// 立即评价
onEvaluate(e) {
const item = e.currentTarget.dataset.item;
this.triggerEvent('evaluate', { item });
},
// 取消订单
onCancelOrder(e) {
const orderCode = e.currentTarget.dataset.orderCode;
this.triggerEvent('cancelOrder', { orderCode });
},
// 售后详情
onAfterSaleDetail(e) {
const item = e.currentTarget.dataset.item;
this.triggerEvent('afterSaleDetail', { item });
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"style": "v2",
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!-- 订单操作按钮组件 -->
<view class="btn-box">
<block wx:if="{{!item.afterSaleStatus}}">
<block wx:if="{{item.orderStatus == 1}}">
<view class="btn pay" catchtap="onCancelPay" data-order-code="{{item.orderCode}}">取消付款</view>
<block wx:if="{{item.orderSource != 4}}">
<view class="btn pay" catchtap="onPay" 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="onToGoldDetail">查看详情</view>
</block>
<block wx:elif="{{item.orderStatus > 2 && item.orderStatus < 9}}">
<!-- deliveryType 结算方式(1:到店核销,2:快递发货) -->
<block wx:if="{{item.payPrice > 0 && item.orderSource != 4}}">
<view class="btn" catchtap="onAfterSale" data-item="{{item}}" wx:if="{{!(item.relatedUserCouponStatus == 2 || item.relatedUserCouponStatus == 3)}}">售后</view>
</block>
<block wx:if="{{item.deliveryType == 2 && item.orderStatus == 4}}">
<view class="btn confirm" catchtap="onConfirmReceipt" data-order-code="{{item.orderCode}}">确认收货</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="onLookEvaluate" data-item="{{item}}">查看评价</view>
</block>
<block wx:else>
<button catchtap="onGetUserProfile" wx:if="{{!hasUserInfo}}" class="btn confirm userProfile" data-item="{{item}}"> 立即评价 </button>
<view class="btn confirm" catchtap="onEvaluate" wx:else data-item="{{item}}">立即评价</view>
</block>
</block>
</view>
</block>
<block wx:else>
<block wx:if="{{item.afterSaleStatus == 1}}">
<view class="btn pay" catchtap="onCancelOrder" data-order-code="{{item.orderCode}}">取消售后</view>
</block>
<view class="btn" data-item="{{item}}" catchtap="onAfterSaleDetail">售后详情</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
/* components/orderActionButtons.wxss */
.btn-box {
position: absolute;
right: 24rpx;
bottom: 16rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.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;
}
.btn-box .pay {
background-color: var(--btnColor);
color: #fff;
border-color: var(--btnColor);
}
.btn-box .empty {
color: var(--btnColor);
background-color: #fff;
}
.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;
}
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/index/components/ordercard/ordercard.js
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type: Object,
value: {},
},
afterSaleStatus: {
type: Object,
value: {},
},
statusEnum: {
type: Object,
value: {},
},
hasUserInfo: {
type: Boolean,
value: false,
},
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
// 跳转到订单详情
onJump(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,
});
},
// 取消付款
onCancelPay(e) {
this.triggerEvent("cancelPay", {
orderCode: e.detail.orderCode,
});
},
// 去支付
onPay(e) {
this.triggerEvent("pay", {
orderCode: e.detail.orderCode,
});
},
// 查看详情
onToGoldDetail(e) {
this.triggerEvent("toGoldDetail", {
item: e.detail.item,
});
},
// 售后
onAfterSale(e) {
this.triggerEvent("afterSale", {
item: e.detail.item,
});
},
// 确认收货
onConfirmReceipt(e) {
this.triggerEvent("confirmReceipt", {
orderCode: e.detail.orderCode,
});
},
// 查看评价
onLookEvaluate(e) {
this.triggerEvent("lookEvaluate", {
item: e.detail.item,
});
},
// 获取用户信息
onGetUserProfile(e) {
this.triggerEvent("getUserProfile", {
item: e.detail.item,
});
},
// 立即评价
onEvaluate(e) {
this.triggerEvent("evaluate", {
item: e.detail.item,
});
},
// 取消订单
onCancelOrder(e) {
this.triggerEvent("cancelOrder", {
orderCode: e.detail.orderCode,
});
},
// 售后详情
onAfterSaleDetail(e) {
this.triggerEvent("afterSaleDetail", {
item: e.detail.item,
});
},
},
});
{
"component": true,
"style": "v2",
"usingComponents": {
"top": "../Top/Top",
"content": "../Content/Content",
"bottom": "../Bottom/Bottom",
"order-action-buttons": "../OrderActionButtons/OrderActionButtons"
}
}
\ No newline at end of file \ No newline at end of file
<view class="item" catchtap="onJump" data-item="{{item}}">
<top item="{{item}}" after-sale-status="{{afterSaleStatus}}" status-enum="{{statusEnum}}"></top>
<content item="{{item}}" has-user-info="{{hasUserInfo}}" bind:lookEvaluate="onLookEvaluate" bind:getUserProfile="onGetUserProfile" bind:evaluate="onEvaluate"></content>
<bottom item="{{item}}" />
</view>
\ No newline at end of file \ No newline at end of file
.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;
}
.text-hide {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/index/components/top/top.js
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type: Object,
value: {}
},
afterSaleStatus: {
type: Object,
value: {}
},
statusEnum: {
type: Object,
value: {}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"style": "v2",
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="top">
<view class="name">订单编号:{{item.orderCode}}</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>
\ No newline at end of file \ No newline at end of file
.top {
height: 82rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 24rpx;
position: relative;
}
.top .name {
width: 410rpx;
height: 40rpx;
font-size: 28rpx;
color: #2D2D2E;
}
.top .status {
font-size: 28rpx;
color: #282829;
font-weight: 400;
}
\ 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();
}
}
});
/* 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
...@@ -20,7 +20,7 @@ Page({ ...@@ -20,7 +20,7 @@ Page({
*/ */
data: { data: {
pageNum: 1, pageNum: 1,
tab: Object.freeze(ORDER_LIST.map((item) => item.text)), tab: Object.freeze(ORDER_LIST),
// 硬编码的订单列表数据 // 硬编码的订单列表数据
list: [ list: [
{ {
...@@ -215,82 +215,11 @@ Page({ ...@@ -215,82 +215,11 @@ Page({
}, },
changeTab(e) { changeTab(e) {
this.setData({ this.setData({
tabIndex: e.detail, tabIndex: e.detail.item.code,
orderStatusPart: orderStatusPartEnum[e.detail], orderStatusPart: e.detail.item.code,
}); });
this.clearData(); 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);
}
});
}
});
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -387,44 +316,6 @@ Page({ ...@@ -387,44 +316,6 @@ Page({
}); });
*/ */
}, },
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() { requestSubscribeMessage() {
wx.p.router.go("/packageMine/pages/order/complete/complete", { wx.p.router.go("/packageMine/pages/order/complete/complete", {
success: true, success: true,
...@@ -450,44 +341,6 @@ Page({ ...@@ -450,44 +341,6 @@ Page({
}); });
}); });
}, },
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) { toCheckCard(e) {
const { item } = e.currentTarget.dataset; const { item } = e.currentTarget.dataset;
...@@ -495,13 +348,6 @@ Page({ ...@@ -495,13 +348,6 @@ Page({
orderCode: item.orderCode, orderCode: item.orderCode,
}); });
}, },
// 查看膨胀金详情
toGoldDetail(e) {
const { item } = e.currentTarget.dataset;
wx.p.router.go("/packageEquity/pages/kaqDetail/orderDetail", {
orderCode: item.orderCode,
});
},
// 卡卷 申请售后 // 卡卷 申请售后
toSaleApplyPage(e) { toSaleApplyPage(e) {
let { item } = e.currentTarget.dataset; let { item } = e.currentTarget.dataset;
...@@ -562,4 +408,14 @@ Page({ ...@@ -562,4 +408,14 @@ Page({
} }
); );
}, },
/**
* 刷新订单列表
*/
onRefresh() {
// 调用混入中的方法获取订单列表
if (this.getOrderList && typeof this.getOrderList === "function") {
this.getOrderList();
}
},
}); });
{ {
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"tab": "/components/Tab/Tab" "tab": "/components/Tab/Tab",
"OrderCard": "./components/OrderCard/OrderCard"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -78,178 +78,10 @@ ...@@ -78,178 +78,10 @@
padding: 24rpx var(--margin) 40rpx; 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-X {
background-color: rgb(244, 244, 244); 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 { .userProfile {
background-color: #fff; background-color: #fff;
font-size: 24rpx; font-size: 24rpx;
...@@ -258,49 +90,6 @@ ...@@ -258,49 +90,6 @@
font-weight: 500; font-weight: 500;
line-height: 46rpx; 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 { .imageHeight {
height: 99rpx !important; height: 99rpx !important;
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</view> </view>
</navigation-bar> </navigation-bar>
<view class="tab" style="top:{{padding_bottom }}px;"> <view class="tab" style="top:{{padding_bottom }}px;">
<tab tab="{{tab}}" bindclick="changeTab" index="{{tabIndex}}" ></tab> <tab tab="{{tab}}" bindchange="changeTab" index="{{tabIndex}}"></tab>
</view> </view>
</view> </view>
<block wx:if="{{margin_top}}"> <block wx:if="{{margin_top}}">
...@@ -26,116 +26,14 @@ ...@@ -26,116 +26,14 @@
<block wx:if="{{listFlag}}"> <block wx:if="{{listFlag}}">
<block wx:if="{{list.length}}"> <block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<block wx:if="{{item.orderClassify == 1}}"> <OrderCard item="{{item}}" after-sale-status="{{afterSaleStatus}}" status-enum="{{statusEnum}}" has-user-info="{{hasUserInfo}}"></OrderCard>
<view class="item" catchtap="jump" data-item="{{item}}">
<view class="top">
<view class="name">订单编号:{{item.orderCode}}</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="number">
x{{item.orderSource == 5 ? 1: i.goodsNumber}}
</view>
</view>
<view class="info-bottom">
<block wx:if="{{i.specificationData}}">
<view class="specification">{{i.specificationData}}</view>
</block>
<view class="price">
{{item.orderSource == 5 ? item.payPrice: (i.activityPrice ||i.retailPrice)}}积分
</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">
<view class="total">共{{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:退款失败 -->
<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.payPrice > 0 && item.orderSource != 4}}">
<view class="btn" catchtap="afterSale" data-item="{{item}}" wx:if="{{!(item.relatedUserCouponStatus == 2 || item.relatedUserCouponStatus == 3)}}">售后
</view>
</block>
<block wx:if="{{item.deliveryType == 2 && item.orderStatus == 4}}">
<view class="btn confirm" catchtap="confirmReceipt" data-order-code="{{item.orderCode}}">确认收货
</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>
</view>
</view>
</block>
</block> </block>
<block wx:if="{{nothing}}"> <block wx:if="{{nothing}}">
<view class="list-nothing to-bottom"></view> <view class="list-nothing to-bottom"></view>
</block> </block>
</block> </block>
<block wx:else> <block wx:else>
<view class="list-nothing"> <view class="list-nothing">暂无相关内容</view>
暂无相关内容
</view>
</block> </block>
</block> </block>
</view> </view>
......
...@@ -14,7 +14,8 @@ export const whiteList = [ ...@@ -14,7 +14,8 @@ export const whiteList = [
'/pages/Login/Login', '/pages/Login/Login',
'/pages/loading/loading', '/pages/loading/loading',
'/pages/webView/webView', '/pages/webView/webView',
'/packageMine/pages/order/index/index' '/packageMine/pages/order/index/index',
'/packageMine/pages/order/detail/detail'
]; ];
// tabBar页面路径配置 // tabBar页面路径配置
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!