Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
points-mall
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2a12ba4b
authored
Aug 26, 2025
by
wangzhihui
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
订单列表
1 parent
292944b2
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
289 additions
and
835 deletions
api/module/mine.js
constants/mine.js
mixins/orderMixin.js
packageMine/pages/order/index/components/Bottom/Bottom.wxml
packageMine/pages/order/index/components/Content/Content.wxml
packageMine/pages/order/index/components/OrderActionButtons/OrderActionButtons.js
packageMine/pages/order/index/components/Top/Top.wxml
packageMine/pages/order/index/components/Top/Top.wxss
packageMine/pages/order/index/index.js
pages/tab/mine/index.js
api/module/mine.js
View file @
2a12ba4
...
@@ -58,7 +58,15 @@ module.exports = {
...
@@ -58,7 +58,15 @@ module.exports = {
/**. 分页查询订单 */
/**. 分页查询订单 */
getOrderList
(
data
)
{
getOrderList
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
`scrm.api.shopmall.weapp.order.page`
,
method
:
`scrm.api.shopmall.platform.order.page`
,
pageSize
:
99999
,
...
data
})
},
/**. 分页查询订单 */
getSalesOrderList
(
data
)
{
return
api
.
post
({
method
:
`scrm.api.shopmall.platform.after.sales.order.page`
,
pageSize
:
99999
,
pageSize
:
99999
,
...
data
...
data
})
})
...
...
constants/mine.js
View file @
2a12ba4
export
const
ToolList
=
Object
.
freeze
([
export
const
ToolList
=
Object
.
freeze
([{
{
text
:
"我的地址"
,
text
:
"我的地址"
,
icon
:
"myAddress"
,
icon
:
"myAddress"
,
url
:
"/packageMine/pages/address/index/index"
,
url
:
"/packageMine/pages/address/index/index"
,
},
},
]);
]);
export
const
OrderStatusEnum
=
{
export
const
OrderStatusEnum
=
{
ALL
:
"0"
,
ALL
:
"0"
,
...
@@ -18,11 +16,12 @@ export const OrderStatusEnum = {
...
@@ -18,11 +16,12 @@ export const OrderStatusEnum = {
AFTER_SALE_REJECTED
:
"10007"
,
//售后审核不通过
AFTER_SALE_REJECTED
:
"10007"
,
//售后审核不通过
AFTER_SALE_REFUNDED
:
"10008"
,
//已退款
AFTER_SALE_REFUNDED
:
"10008"
,
//已退款
AFTER_SALE_REFUNDED_FAILED
:
"10009"
,
//退款失败
AFTER_SALE_REFUNDED_FAILED
:
"10009"
,
//退款失败
AFTER_SALE_REVEAL
:
"10010"
//所有其他状态
};
};
export
const
OrderStatusTypes
=
{
export
const
OrderStatusTypes
=
{
QUERY_TAB
:
"QUERY_TAB"
,
// 查询订单列表TAB项
QUERY_TAB
:
"QUERY_TAB"
,
// 查询订单列表TAB项
MY_ORDER
:
"MY_ORDER"
,
// 我的 页面 我的订单 显示的项目
MY_ORDER
:
"MY_ORDER"
,
// 我的 页面 我的订单 显示的项目
};
};
export
const
GoodsSource
=
{
export
const
GoodsSource
=
{
...
@@ -75,37 +74,32 @@ export const ORDER_STATUS = {
...
@@ -75,37 +74,32 @@ export const ORDER_STATUS = {
image
:
"noPay"
,
image
:
"noPay"
,
status
:
OrderStatusEnum
.
PAY_PENDING
,
status
:
OrderStatusEnum
.
PAY_PENDING
,
index
:
1
,
// 查询订单列表TAB高亮的索引
index
:
1
,
// 查询订单列表TAB高亮的索引
requestType
:
2
,
// 查询订单列表TAB查询参数
requestType
:
2
,
// 查询订单列表TAB查询参数
buttons
:
null
,
buttons
:
null
,
type
:
OrderStatusTypes
.
MY_ORDER
,
//我的 页面 我的订单 显示的项目
type
:
OrderStatusTypes
.
MY_ORDER
,
//我的 页面 我的订单 显示的项目
},
},
[
OrderStatusEnum
.
WAIT_DELIVER
]:
{
[
OrderStatusEnum
.
WAIT_DELIVER
]:
{
text
:
"待发货"
,
text
:
"待发货"
,
image
:
"noTakeCommodity"
,
image
:
"noTakeCommodity"
,
status
:
OrderStatusEnum
.
WAIT_DELIVER
,
status
:
OrderStatusEnum
.
WAIT_DELIVER
,
index
:
2
,
// 查询订单列表TAB高亮的索引
index
:
2
,
// 查询订单列表TAB高亮的索引
requestType
:
6
,
// 查询订单列表TAB查询参数
requestType
:
6
,
// 查询订单列表TAB查询参数
type
:
OrderStatusTypes
.
MY_ORDER
,
//我的 页面 我的订单 显示的项目
type
:
OrderStatusTypes
.
MY_ORDER
,
//我的 页面 我的订单 显示的项目
buttons
:
{
buttons
:
null
,
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE
],
//云中鹤商品 在商品列表对应的按钮
},
},
},
[
OrderStatusEnum
.
WAIT_RECEIVE
]:
{
[
OrderStatusEnum
.
WAIT_RECEIVE
]:
{
text
:
"待收货"
,
text
:
"待收货"
,
image
:
"takeCommodity"
,
image
:
"takeCommodity"
,
status
:
1008
,
status
:
1008
,
index
:
3
,
// 查询订单列表TAB高亮的索引
index
:
3
,
// 查询订单列表TAB高亮的索引
requestType
:
1
,
// 查询订单列表TAB查询参数
requestType
:
1
,
// 查询订单列表TAB查询参数
type
:
OrderStatusTypes
.
MY_ORDER
,
//我的 页面 我的订单 显示的项目
type
:
OrderStatusTypes
.
MY_ORDER
,
//我的 页面 我的订单 显示的项目
buttons
:
{
buttons
:
{
[
GoodsSource
.
SELF
]:
[
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
SELF
]:
[
//自营商品 在商品列表对应的按钮
OrderActionButtons
.
AFTER_SALE
,
OrderActionButtons
.
CONFIRM_RECEIVE
,
OrderActionButtons
.
CONFIRM_RECEIVE
,
OrderActionButtons
.
SHOW_EXPRESS
,
OrderActionButtons
.
SHOW_EXPRESS
,
],
],
[
GoodsSource
.
YZH
]:
[
//云中鹤商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
//云中鹤商品 在商品列表对应的按钮
OrderActionButtons
.
AFTER_SALE
,
OrderActionButtons
.
CONFIRM_RECEIVE
,
OrderActionButtons
.
CONFIRM_RECEIVE
,
OrderActionButtons
.
SHOW_EXPRESS
,
OrderActionButtons
.
SHOW_EXPRESS
,
],
],
...
@@ -114,15 +108,15 @@ export const ORDER_STATUS = {
...
@@ -114,15 +108,15 @@ export const ORDER_STATUS = {
[
OrderStatusEnum
.
COMPLETED
]:
{
[
OrderStatusEnum
.
COMPLETED
]:
{
text
:
"已完成"
,
text
:
"已完成"
,
status
:
OrderStatusEnum
.
COMPLETED
,
status
:
OrderStatusEnum
.
COMPLETED
,
index
:
4
,
// 查询订单列表TAB高亮的索引
index
:
4
,
// 查询订单列表TAB高亮的索引
requestType
:
4
,
// 查询订单列表TAB查询参数
requestType
:
4
,
// 查询订单列表TAB查询参数
type
:
OrderStatusTypes
.
QUERY_TAB
,
// 查询订单列表显示的TAB项
type
:
OrderStatusTypes
.
QUERY_TAB
,
// 查询订单列表显示的TAB项
buttons
:
{
buttons
:
{
[
GoodsSource
.
SELF
]:
[
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
SELF
]:
[
//自营商品 在商品列表对应的按钮
OrderActionButtons
.
SHOW_EXPRESS
,
OrderActionButtons
.
SHOW_EXPRESS
,
OrderActionButtons
.
AFTER_SALE
,
OrderActionButtons
.
AFTER_SALE
,
],
],
[
GoodsSource
.
YZH
]:
[
//云中鹤商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
//云中鹤商品 在商品列表对应的按钮
OrderActionButtons
.
SHOW_EXPRESS
,
OrderActionButtons
.
SHOW_EXPRESS
,
OrderActionButtons
.
AFTER_SALE
,
OrderActionButtons
.
AFTER_SALE
,
],
],
...
@@ -133,65 +127,74 @@ export const ORDER_STATUS = {
...
@@ -133,65 +127,74 @@ export const ORDER_STATUS = {
my_order_text
:
"售后"
,
my_order_text
:
"售后"
,
image
:
"aftermarket"
,
image
:
"aftermarket"
,
status
:
OrderStatusEnum
.
AFTER_SALE
,
status
:
OrderStatusEnum
.
AFTER_SALE
,
index
:
5
,
// 查询订单列表TAB高亮的索引
index
:
5
,
// 查询订单列表TAB高亮的索引
requestType
:
3
,
// 查询订单列表TAB查询参数
requestType
:
3
,
// 查询订单列表TAB查询参数
buttons
:
null
,
buttons
:
null
,
type
:
OrderStatusTypes
.
MY_ORDER
,
//我的 页面 我的订单 显示的项目
type
:
OrderStatusTypes
.
MY_ORDER
,
//我的 页面 我的订单 显示的项目
},
},
[
OrderStatusEnum
.
AFTER_SALE_PENDING_REVIEW
]:
{
[
OrderStatusEnum
.
AFTER_SALE_PENDING_REVIEW
]:
{
text
:
"售后中"
,
text
:
"售后中"
,
status
:
OrderStatusEnum
.
AFTER_SALE_PENDING_REVIEW
,
status
:
OrderStatusEnum
.
AFTER_SALE_PENDING_REVIEW
,
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
buttons
:
{
buttons
:
{
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//云中鹤商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//云中鹤商品 在商品列表对应的按钮
},
},
},
},
[
OrderStatusEnum
.
AFTER_SALE_WAIT_RECEIVE
]:
{
[
OrderStatusEnum
.
AFTER_SALE_WAIT_RECEIVE
]:
{
text
:
"售后中"
,
text
:
"售后中"
,
status
:
OrderStatusEnum
.
AFTER_SALE_WAIT_RECEIVE
,
status
:
OrderStatusEnum
.
AFTER_SALE_WAIT_RECEIVE
,
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
buttons
:
{
buttons
:
{
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//云中鹤商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//云中鹤商品 在商品列表对应的按钮
},
},
},
},
[
OrderStatusEnum
.
AFTER_SALE_REJECTED
]:
{
[
OrderStatusEnum
.
AFTER_SALE_REJECTED
]:
{
text
:
"审核不通过"
,
text
:
"审核不通过"
,
status
:
OrderStatusEnum
.
AFTER_SALE_REJECTED
,
status
:
OrderStatusEnum
.
AFTER_SALE_REJECTED
,
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
buttons
:
{
buttons
:
{
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE
_REJECTED
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE
,
OrderActionButtons
.
AFTER_SALE_REJECTED
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE
_REJECTED
],
//云中鹤商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE
,
OrderActionButtons
.
AFTER_SALE_REJECTED
],
//云中鹤商品 在商品列表对应的按钮
},
},
},
},
[
OrderStatusEnum
.
AFTER_SALE_REFUNDED
]:
{
[
OrderStatusEnum
.
AFTER_SALE_REFUNDED
]:
{
text
:
"已退款"
,
text
:
"已退款"
,
status
:
OrderStatusEnum
.
AFTER_SALE_REFUNDED
,
status
:
OrderStatusEnum
.
AFTER_SALE_REFUNDED
,
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
buttons
:
{
buttons
:
{
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//云中鹤商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//云中鹤商品 在商品列表对应的按钮
},
},
},
},
[
OrderStatusEnum
.
AFTER_SALE_REFUNDED_FAILED
]:
{
[
OrderStatusEnum
.
AFTER_SALE_REFUNDED_FAILED
]:
{
text
:
"退款失败"
,
text
:
"退款失败"
,
status
:
OrderStatusEnum
.
AFTER_SALE_REFUNDED_FAILED
,
status
:
OrderStatusEnum
.
AFTER_SALE_REFUNDED_FAILED
,
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
buttons
:
{
buttons
:
{
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//云中鹤商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//云中鹤商品 在商品列表对应的按钮
},
},
[
OrderStatusEnum
.
AFTER_SALE_REVEAL
]:
{
text
:
"售后处理中"
,
status
:
OrderStatusEnum
.
AFTER_SALE_REVEAL
,
tips
:
"您可以尝试再次提交退款申请"
,
//售后详情提示语
image
:
"mine/order/error.png"
,
//售后详情页面显示的状态图标
buttons
:
{
[
GoodsSource
.
SELF
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//自营商品 在商品列表对应的按钮
[
GoodsSource
.
YZH
]:
[
OrderActionButtons
.
AFTER_SALE_DETAIL
],
//云中鹤商品 在商品列表对应的按钮
},
},
},
},
};
};
export
const
RefundReason
=
[
export
const
RefundReason
=
[{
{
text
:
"商品无货"
,
text
:
"商品无货"
,
value
:
1
,
value
:
1
,
},
},
...
@@ -241,8 +244,7 @@ export const RefundReason = [
...
@@ -241,8 +244,7 @@ export const RefundReason = [
},
},
];
];
export
const
RefundStatus
=
[
export
const
RefundStatus
=
[{
{
status
:
1
,
status
:
1
,
title
:
"待处理"
,
title
:
"待处理"
,
tips
:
"等待平台处理"
,
tips
:
"等待平台处理"
,
...
@@ -286,8 +288,7 @@ export const RefundStatus = [
...
@@ -286,8 +288,7 @@ export const RefundStatus = [
},
},
];
];
export
const
ExpressList
=
[
export
const
ExpressList
=
[{
{
value
:
0
,
value
:
0
,
text
:
"圆通快递"
,
text
:
"圆通快递"
,
},
},
...
@@ -321,8 +322,7 @@ export const ExpressList = [
...
@@ -321,8 +322,7 @@ export const ExpressList = [
},
},
];
];
export
const
AfterSaleObj
=
[
export
const
AfterSaleObj
=
[{
{
title
:
"退款原因"
,
title
:
"退款原因"
,
key
:
"refundPrice"
,
key
:
"refundPrice"
,
},
},
...
@@ -348,8 +348,7 @@ export const AfterSaleObj = [
...
@@ -348,8 +348,7 @@ export const AfterSaleObj = [
},
},
];
];
export
const
AddressInfo
=
[
export
const
AddressInfo
=
[{
{
title
:
"地址"
,
title
:
"地址"
,
key
:
"address"
,
key
:
"address"
,
},
},
...
@@ -362,8 +361,7 @@ export const AddressInfo = [
...
@@ -362,8 +361,7 @@ export const AddressInfo = [
key
:
"phone"
,
key
:
"phone"
,
},
},
];
];
export
const
OrderStatus
=
[
export
const
OrderStatus
=
[{
{
title
:
"待付款"
,
title
:
"待付款"
,
value
:
"1"
,
value
:
"1"
,
image
:
"mine/order-wait.png"
,
image
:
"mine/order-wait.png"
,
...
...
mixins/orderMixin.js
View file @
2a12ba4
module
.
exports
=
Behavior
({
module
.
exports
=
Behavior
({
data
:
{
data
:
{
//1
:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待发货;7:待安装;8:已安装;9:售后中;10:售后完成
//1
001:待支付 1002:待审核,1003:审核不通过,1004:已取消(交易失败) ,1005:订单异常,1006:待处理,1007: 待发货,1008:已发货,1009:已完成(交易成功),1010:售后处理中,1012 订单关闭
statusEnum
:
{
statusEnum
:
{
1
:
'待付款
'
,
1
001
:
'待支付
'
,
2
:
'已支付
'
,
1002
:
'待审核
'
,
3
:
'已关闭
'
,
1003
:
'审核不通过
'
,
4
:
'已发货
'
,
1004
:
'已取消
'
,
5
:
'已收货
'
,
1005
:
'订单异常
'
,
6
:
'待发货
'
,
1006
:
'待处理
'
,
7
:
'待安装
'
,
1007
:
'待发货
'
,
8
:
'已安装
'
,
1008
:
'已发货
'
,
9
:
'售后中
'
,
1009
:
'已完成
'
,
10
:
'售后完成
'
10
10
:
'售后处理中
'
},
},
/**售后状态
1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败;8已取消
*/
/**售后状态
(1000:待审核,1001:审核通过,1002:已收货,1003:已退款,1004:已生成新订单,1005:审核不通过,1006:已取消)
*/
afterSaleStatus
:
{
afterSaleStatus
:
{
1
:
'待审核'
,
1000
:
'待审核'
,
2
:
'审核通过'
,
1001
:
'审核通过'
,
3
:
'审核不通过'
,
1002
:
'已收货'
,
4
:
'待确认收到退货'
,
1003
:
'已退款'
,
5
:
'退款中'
,
1005
:
'审核不通过'
,
6
:
'已退款'
,
1006
:
'已取消'
7
:
'退款失败'
,
8
:
'已取消'
},
},
/**权益&套餐 */
/**权益&套餐 */
...
...
packageMine/pages/order/index/components/Bottom/Bottom.wxml
View file @
2a12ba4
<view class="bottom">
<view class="bottom">
<view class="total">
<view class="total">
共{{item.
goodsNumber
}}件,实付款
共{{item.
sellQty||item.applyQty
}}件,实付款
<text class="price">{{item.
payPrice
}}积分</text>
<text class="price">{{item.
redeemPoints||'--'
}}积分</text>
</view>
</view>
<order-action-buttons item="{{item}}" has-user-info="{{hasUserInfo}}" />
<order-action-buttons item="{{item}}" has-user-info="{{hasUserInfo}}" />
</view>
</view>
\ No newline at end of file
\ No newline at end of file
packageMine/pages/order/index/components/Content/Content.wxml
View file @
2a12ba4
<view class="content-top
{{item.orderStatus == 5 || item.orderStatus == 8?'':'content-bottom'}}
">
<view class="content-top ">
<block
wx:for="{{item.orderGoods}}" wx:for-item="i" wx:for-index="ind" wx:key="ind"
>
<block>
<view class="goods
{{item.orderStatus == 5 || item.orderStatus == 8?'addTo':''}}
">
<view class="goods">
<view class="icon">
<view class="icon">
<image webp wx:if="{{item.orderSource == 5}}" src="{{item.activityBigImg}}"></image>
<image webp src="{{item.goodsImageUrl}}"></image>
<image webp wx:else src="{{i.goodsImage}}"></image>
</view>
</view>
<view class="info">
<view class="info">
<view class="info-top">
<view class="info-top">
<view
class="name text-hide">{{item.orderSource == 5 ? item.activityName: i.goods
Name}}</view>
<view
class="name text-hide">{{item.goodsSku
Name}}</view>
<view class="number">
<view class="number">
<mp-icon icon="close" color="#656566" size="{{12}}"></mp-icon>{{item.
orderSource == 5 ? 1: i.goodsNumber
}}
<mp-icon icon="close" color="#656566" size="{{12}}"></mp-icon>{{item.
sellQty||item.applyQty
}}
</view>
</view>
</view>
</view>
<view class="info-bottom">
<view class="info-bottom">
<block wx:if="{{i.specificationData}}">
<block wx:if="{{i
tem
.specificationData}}">
<view class="specification">{{i.specificationData}}</view>
<view class="specification">{{i
tem
.specificationData}}</view>
</block>
</block>
<view class="price">
<view class="price">
{{item.
orderSource == 5 ? item.payPrice: (i.activityPrice ||i.retailPrice)
}}积分
{{item.
redeemPoints||'--'
}}积分
</view>
</view>
</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>
</view>
</view>
</block>
</block>
...
...
packageMine/pages/order/index/components/OrderActionButtons/OrderActionButtons.js
View file @
2a12ba4
// packageMine/pages/order/index/components/orderActionButtons.js
// packageMine/pages/order/index/components/orderActionButtons.js
import
{
// 定义枚举常量
ORDER_STATUS
,
const
OrderStatus
=
{
OrderStatusEnum
PENDING_PAYMENT
:
1
,
// 待付款
}
from
"~/constants/mine.js"
;
PROCESSING
:
2
,
// 处理中
SHIPPED
:
3
,
// 已发货
DELIVERED
:
4
,
// 已送达
COMPLETED
:
5
,
// 已完成
CANCELLED
:
6
,
// 已取消
REFUNDED
:
7
,
// 已退款
CLOSED
:
8
,
// 已关闭
AFTER_SALE
:
9
,
// 售后中
};
const
OrderSource
=
{
SPECIAL
:
5
,
// 特殊订单(如金币兑换)
};
const
AfterSaleStatus
=
{
PROCESSING
:
1
,
// 售后处理中
};
const
DeliveryType
=
{
EXPRESS
:
2
,
// 快递发货
};
const
CouponStatus
=
{
USED
:
2
,
// 已使用
EXPIRED
:
3
,
// 已过期
};
const
GoodsSource
=
{
'YZH'
:
1
,
'SELF'
:
2
};
const
ActionMaps
=
{
[
GoodsSource
.
SELF
]:{
},
[
GoodsSource
.
YZH
]:{
}
};
import
{
ORDER_STATUS
,
OrderStatusEnum
}
from
"~/constants/mine.js"
;
Component
({
Component
({
/**
/**
* 组件的属性列表
* 组件的属性列表
...
@@ -81,227 +39,70 @@ Component({
...
@@ -81,227 +39,70 @@ Component({
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{
methods
:
{
orderStatus
(){
orderStatus
()
{
//订单状态 orderStatus (1001:待支付 1002:待审核,1003:审核不通过,1004:已取消(交易失败) ,1005:订单异常,1006:待处理,1007: 待发货,1008:已发货,1009:已完成(交易成功),1010:售后处理中,1012 订单关闭
//订单状态 orderStatus (1001:待支付 1002:待审核,1003:审核不通过,1004:已取消(交易失败) ,1005:订单异常,1006:待处理,1007: 待发货,1008:已发货,1009:已完成(交易成功),1010:售后处理中,1012 订单关闭
//退换货状态 returnStatus (1000:待审核,1001:待收货,1002:已收货,1003:已退款,1004:已生成新订单,1005:已取消,1006:退款异常,1007:商品退回,1008:审核不通过,1010:换货新订单待收货,1011:换货新订单已签收)
//退换货状态 returnStatus (1000:待审核,1001:待收货,1002:已收货,1003:已退款,1004:已生成新订单,1005:已取消,1006:退款异常,1007:商品退回,1008:审核不通过,1010:换货新订单待收货,1011:换货新订单已签收)
//退款状态 refundStatus (1000:待审核,1001:待退款,1002:已退款,1003:已取消,1004:退款异常,1005:审核不通过)
//退款状态 refundStatus (1000:待审核,1001:待退款,1002:已退款,1003:已取消,1004:退款异常,1005:审核不通过)
//订单取消状态 cancelStatus(1000:取消成功,1010:取消审核中)
//订单取消状态 cancelStatus(1000:取消成功,1010:取消审核中)
//退款状态 returnOrderStatus(1000:待审核,1001:审核通过,1002:已收货,1003:已退款,1004:已生成新订单,1005:审核不通过)
//退款状态 returnOrderStatus(1000:待审核,1001:审核通过,1002:已收货,1003:已退款,1004:已生成新订单,1005:审核不通过)
//goodsSource 1.云中鹤 2.平台商品
//goodsSource 1.云中鹤 2.平台商品
console
.
log
(
this
.
data
.
item
)
const
{
const
{
orderStatus
,
goodsSource
,
cancelStatus
,
returnStatus
,
refundStatus
,
returnOrderStatus
}
=
this
.
data
.
item
orderStatus
,
if
([
1002
,
1006
,
1007
].
includes
(
orderStatus
)
&&
(
!
cancelStatus
||
cancelStatus
==
1010
))
{
goodsSource
,
cancelStatus
,
returnStatus
,
refundStatus
,
returnOrderStatus
}
=
this
.
data
.
item
if
([
1007
].
includes
(
orderStatus
)
&&
(
!
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
(
orderStatus
==
1008
&&
(
!
cancelStatus
||
cancelStatus
==
1010
)){
}
else
if
([
1002
,
1006
,
1007
,
1008
].
includes
(
orderStatus
)
&&
(
!
cancelStatus
||
cancelStatus
==
1010
))
{
// 确认收货,查看物流
return
OrderStatusEnum
.
WAIT_RECEIVE
//待收货 order_status属于(1008)且cancel_status不存在或者审核中(1010)
return
OrderStatusEnum
.
WAIT_RECEIVE
//待收货 order_status属于(1008)且cancel_status不存在或者审核中(1010)
}
else
if
(
orderStatus
==
1009
&&
(
!
cancelStatus
||
cancelStatus
==
1010
)){
}
else
if
(
orderStatus
==
1009
&&
(
!
cancelStatus
||
cancelStatus
==
1010
))
{
//按钮:查看物流、售后
return
OrderStatusEnum
.
COMPLETED
//已完成 order_status属于(1009)且cancel_status不存在或者审核中(1010)
return
OrderStatusEnum
.
COMPLETED
//已完成 order_status属于(1009)且cancel_status不存在或者审核中(1010)
}
else
if
((
returnOrderStatus
==
1000
&&
returnStatus
==
1000
)
||
(
returnOrderStatus
==
1000
&&
refundStatus
==
1000
)){
}
else
if
((
returnOrderStatus
==
1000
&&
returnStatus
==
1000
)
||
(
returnOrderStatus
==
1000
&&
refundStatus
==
1000
))
{
// 按钮:售后详情
return
OrderStatusEnum
.
AFTER_SALE_PENDING_REVIEW
//售后---待审核 退款退货的return_order_status:1000:待审批且return_status退换货状态(1000:待审核) 仅退款的return_order_status:1000:待审批且refund_status 退款状态(1000:待审核
return
OrderStatusEnum
.
AFTER_SALE_PENDING_REVIEW
//售后---待审核 退款退货的return_order_status:1000:待审批且return_status退换货状态(1000:待审核) 仅退款的return_order_status:1000:待审批且refund_status 退款状态(1000:待审核
}
else
if
(
returnOrderStatus
==
1001
&&
returnStatus
==
1001
){
}
else
if
(
returnOrderStatus
==
1001
&&
returnStatus
==
1001
)
{
return
OrderStatusEnum
.
AFTER_SALE_WAIT_RECEIVE
//售后---待收货(审核通过) 退款退货的return_order_status:1001:审核通过 且return_status退换货状态(1001:待收货),仅退款的直接到退款完成/退款失败
// 按钮:售后详情
}
else
if
((
returnOrderStatus
==
1005
&&
returnStatus
==
1008
)
||
(
returnOrderStatus
==
1005
&&
refundStatus
==
1008
)){
return
OrderStatusEnum
.
AFTER_SALE_WAIT_RECEIVE
//售后---待收货(审核通过) 退款退货的return_order_status:1001:审核通过 且return_status退换货状态(1001:待收货),仅退款的直接到退款完成/退款失败
}
else
if
((
returnOrderStatus
==
1005
&&
returnStatus
==
1008
)
||
(
returnOrderStatus
==
1005
&&
refundStatus
==
1008
))
{
// 状态:售后前的状态(云中鹤不同意售后申请)按钮:售后、售后详情
return
OrderStatusEnum
.
AFTER_SALE_REJECTED
//售后 -- 审核不通过 退款退货的return_order_status:1005:审核不通过且return_status退换货状态(1008:审核不通过), 仅退款的return_order_status:1005 且refund_status 退款状态(1008:审核不通过
return
OrderStatusEnum
.
AFTER_SALE_REJECTED
//售后 -- 审核不通过 退款退货的return_order_status:1005:审核不通过且return_status退换货状态(1008:审核不通过), 仅退款的return_order_status:1005 且refund_status 退款状态(1008:审核不通过
}
else
if
((
returnOrderStatus
==
1003
&&
[
1002
,
1003
].
includes
(
returnStatus
))
||
(
returnOrderStatus
==
1003
&&
refundStatus
==
1002
))
{
}
else
if
((
returnOrderStatus
==
1003
&&
[
1002
,
1003
].
includes
(
returnStatus
))
||
(
returnOrderStatus
==
1003
&&
refundStatus
==
1002
))
{
return
OrderStatusEnum
.
AFTER_SALE_REFUNDED
// 已退款 退款退货的订单return_order_status:1003:已退款且return_status退换货状态(1002:已收货,1003:已退款),仅退款订单 return_order_status:1003:已退款且refund_status 退款状态1002:已退款,
return
OrderStatusEnum
.
AFTER_SALE_REFUNDED
// 已退款 退款退货的订单return_order_status:1003:已退款且return_status退换货状态(1002:已收货,1003:已退款),仅退款订单 return_order_status:1003:已退款且refund_status 退款状态1002:已退款,
}
else
if
((
returnOrderStatus
==
1003
&&
returnStatus
==
1006
)
||
(
returnOrderStatus
==
1003
&&
refundStatus
==
1004
))
{
}
else
if
((
returnOrderStatus
==
1003
&&
returnStatus
==
1006
)
||
(
returnOrderStatus
==
1003
&&
refundStatus
==
1004
))
{
return
OrderStatusEnum
.
AFTER_SALE_REFUNDED_FAILED
// 退款失败 退款退货的return_order_status:1003:已退款 return_status退换货状态(1006:退款异常 ,,仅退款的return_order_status:1003:已退款 且refund_status 退款状态,1004:退款异常
return
OrderStatusEnum
.
AFTER_SALE_REFUNDED_FAILED
// 退款失败 退款退货的return_order_status:1003:已退款 return_status退换货状态(1006:退款异常 ,,仅退款的return_order_status:1003:已退款 且refund_status 退款状态,1004:退款异常
}
else
{
return
OrderStatusEnum
.
AFTER_SALE_REVEAL
//其他兜底的状态
}
}
},
},
// 获取当前订单应该显示的按钮
getButtons
()
{
const
{
item
,
hasUserInfo
}
=
this
.
data
;
// 待付款状态按钮策略
if
(
item
.
orderStatus
==
OrderStatus
.
PENDING_PAYMENT
)
{
const
buttons
=
[
{
text
:
"取消付款"
,
type
:
"cancelPay"
,
class
:
"btn pay"
,
handler
:
this
.
onCancelPay
.
bind
(
this
),
},
];
if
(
item
.
orderSource
!=
4
)
{
buttons
.
push
({
text
:
"去支付"
,
type
:
"pay"
,
class
:
"btn pay"
,
handler
:
this
.
onPay
.
bind
(
this
),
});
}
return
buttons
;
}
// 特殊订单查看详情策略
if
(
item
.
orderSource
==
OrderSource
.
SPECIAL
&&
(
item
.
orderStatus
==
OrderStatus
.
PROCESSING
||
item
.
orderStatus
==
OrderStatus
.
REFUNDED
)
)
{
return
[
{
text
:
"查看详情"
,
type
:
"viewDetail"
,
class
:
"btn pay"
,
handler
:
this
.
onToGoldDetail
.
bind
(
this
),
},
];
}
// 售后中订单按钮策略
if
(
item
.
afterSaleStatus
)
{
const
buttons
=
[];
if
(
item
.
afterSaleStatus
==
AfterSaleStatus
.
PROCESSING
)
{
buttons
.
push
({
text
:
"取消售后"
,
type
:
"cancelOrder"
,
class
:
"btn pay"
,
handler
:
this
.
onCancelOrder
.
bind
(
this
),
});
}
buttons
.
push
({
text
:
"售后详情"
,
type
:
"afterSaleDetail"
,
class
:
"btn"
,
handler
:
this
.
onAfterSaleDetail
.
bind
(
this
),
});
return
buttons
;
}
// 进行中订单按钮策略
if
(
item
.
orderStatus
>
OrderStatus
.
PENDING_PAYMENT
&&
item
.
orderStatus
<
OrderStatus
.
AFTER_SALE
)
{
const
buttons
=
[];
// 售后按钮
if
(
item
.
payPrice
>
0
&&
item
.
orderSource
!=
4
&&
!
(
item
.
relatedUserCouponStatus
==
CouponStatus
.
USED
||
item
.
relatedUserCouponStatus
==
CouponStatus
.
EXPIRED
)
)
{
buttons
.
push
({
text
:
"售后"
,
type
:
"afterSale"
,
class
:
"btn"
,
handler
:
this
.
onAfterSale
.
bind
(
this
),
});
}
// 确认收货按钮
if
(
item
.
deliveryType
==
DeliveryType
.
EXPRESS
&&
item
.
orderStatus
==
OrderStatus
.
SHIPPED
)
{
buttons
.
push
({
text
:
"确认收货"
,
type
:
"confirmReceive"
,
class
:
"btn confirm"
,
handler
:
this
.
onConfirmReceive
.
bind
(
this
),
});
}
// 待评价订单
if
(
item
.
orderGoods
?.
length
==
1
&&
!
hasUserInfo
&&
(
item
.
orderStatus
==
OrderStatus
.
COMPLETED
||
item
.
orderStatus
==
OrderStatus
.
CLOSED
)
)
{
if
(
item
.
evaluatedFlag
==
"Y"
)
{
buttons
.
push
({
text
:
"查看评价"
,
type
:
"viewEvaluate"
,
class
:
"btn confirm"
,
handler
:
this
.
onLookEvaluate
.
bind
(
this
),
});
}
else
{
if
(
!
hasUserInfo
)
{
buttons
.
push
({
text
:
"立即评价"
,
type
:
"getUserProfile"
,
class
:
"btn confirm userProfile"
,
handler
:
this
.
onGetUserProfile
.
bind
(
this
),
});
}
else
{
buttons
.
push
({
text
:
"立即评价"
,
type
:
"evaluate"
,
class
:
"btn confirm"
,
handler
:
this
.
onEvaluate
.
bind
(
this
),
});
}
}
}
return
buttons
;
}
// 待评价订单(独立情况)
if
(
item
.
orderGoods
?.
length
==
1
&&
!
hasUserInfo
&&
(
item
.
orderStatus
==
OrderStatus
.
COMPLETED
||
item
.
orderStatus
==
OrderStatus
.
CLOSED
)
)
{
if
(
item
.
evaluatedFlag
==
"Y"
)
{
return
[
{
text
:
"查看评价"
,
type
:
"viewEvaluate"
,
class
:
"btn confirm"
,
handler
:
this
.
onLookEvaluate
.
bind
(
this
),
},
];
}
else
{
if
(
!
hasUserInfo
)
{
return
[
{
text
:
"立即评价"
,
type
:
"getUserProfile"
,
class
:
"btn confirm userProfile"
,
handler
:
this
.
onGetUserProfile
.
bind
(
this
),
},
];
}
else
{
return
[
{
text
:
"立即评价"
,
type
:
"evaluate"
,
class
:
"btn confirm"
,
handler
:
this
.
onEvaluate
.
bind
(
this
),
},
];
}
}
}
// 默认返回空数组
return
[];
},
// 更新按钮
// 更新按钮
updateButtons
()
{
updateButtons
()
{
const
buttons
=
ORDER_STATUS
[
this
.
orderStatus
()].
buttons
[
2
]
//this.getButtons();
console
.
log
(
this
.
orderStatus
(),
this
.
data
.
item
,
99999888
)
let
{
goodsSource
}
=
this
.
data
.
item
,
orderButtons
=
ORDER_STATUS
[
this
.
orderStatus
()].
buttons
;
// goodsSource ==null 默认云中鹤
this
.
setData
({
this
.
setData
({
buttons
,
buttons
:
orderButtons
?
orderButtons
[
goodsSource
?
goodsSource
:
1
]
:
[]
,
orderItem
:
this
.
data
.
item
,
orderItem
:
this
.
data
.
item
,
});
});
},
},
// 按钮点击事件处理
// 按钮点击事件处理
onButtonClick
(
e
)
{
onButtonClick
(
e
)
{
const
{
index
}
=
e
.
currentTarget
.
dataset
;
const
{
index
}
=
e
.
currentTarget
.
dataset
;
const
button
=
this
.
data
.
buttons
[
index
];
const
button
=
this
.
data
.
buttons
[
index
];
if
(
button
&&
button
.
handler
)
{
if
(
button
&&
button
.
handler
)
{
button
.
handler
(
e
);
button
.
handler
(
e
);
...
@@ -310,7 +111,9 @@ Component({
...
@@ -310,7 +111,9 @@ Component({
// 取消付款
// 取消付款
onCancelPay
(
e
)
{
onCancelPay
(
e
)
{
let
{
orderCode
}
=
let
{
orderCode
}
=
e
.
currentTarget
.
dataset
.
item
||
e
.
currentTarget
.
dataset
;
e
.
currentTarget
.
dataset
.
item
||
e
.
currentTarget
.
dataset
;
wx
.
showModal
({
wx
.
showModal
({
title
:
"温馨提示"
,
title
:
"温馨提示"
,
...
@@ -322,7 +125,10 @@ Component({
...
@@ -322,7 +125,10 @@ Component({
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
wx
.
p
.
api
.
shopmallApi
wx
.
p
.
api
.
shopmallApi
.
cancelPay
(
orderCode
)
.
cancelPay
(
orderCode
)
.
then
(({
code
,
message
})
=>
{
.
then
(({
code
,
message
})
=>
{
if
(
code
==
"0"
)
{
if
(
code
==
"0"
)
{
wx
.
p
.
wxApi
.
showToast
(
"操作成功"
);
wx
.
p
.
wxApi
.
showToast
(
"操作成功"
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -342,7 +148,10 @@ Component({
...
@@ -342,7 +148,10 @@ Component({
wx
.
p
.
wxApi
.
showLoading
(
"结算中..."
);
wx
.
p
.
wxApi
.
showLoading
(
"结算中..."
);
wx
.
p
.
api
.
shopmallApi
wx
.
p
.
api
.
shopmallApi
.
payOrder
(
e
.
currentTarget
.
dataset
.
item
||
e
.
currentTarget
.
dataset
)
.
payOrder
(
e
.
currentTarget
.
dataset
.
item
||
e
.
currentTarget
.
dataset
)
.
then
(({
needPay
,
payParams
})
=>
{
.
then
(({
needPay
,
payParams
})
=>
{
wx
.
hideLoading
();
wx
.
hideLoading
();
if
(
needPay
)
{
if
(
needPay
)
{
let
params
=
{
let
params
=
{
...
@@ -378,7 +187,9 @@ Component({
...
@@ -378,7 +187,9 @@ Component({
// 查看详情
// 查看详情
onToGoldDetail
(
e
)
{
onToGoldDetail
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
;
const
{
item
}
=
e
.
currentTarget
.
dataset
;
wx
.
p
.
router
.
go
(
"/packageEquity/pages/kaqDetail/orderDetail"
,
{
wx
.
p
.
router
.
go
(
"/packageEquity/pages/kaqDetail/orderDetail"
,
{
orderCode
:
item
.
orderCode
,
orderCode
:
item
.
orderCode
,
});
});
...
@@ -387,11 +198,14 @@ Component({
...
@@ -387,11 +198,14 @@ Component({
// 售后
// 售后
onAfterSale
(
e
)
{
onAfterSale
(
e
)
{
let
{
let
{
item
:
{
orderCode
,
payPrice
,
goodsNumber
},
item
:
{
orderCode
,
payPrice
,
goodsNumber
},
}
=
e
.
currentTarget
.
dataset
;
}
=
e
.
currentTarget
.
dataset
;
wx
.
p
.
router
.
go
(
wx
.
p
.
router
.
go
(
"/packageMine/pages/order/afterSale_step_two/afterSale_step_two"
,
"/packageMine/pages/order/afterSale_step_two/afterSale_step_two"
,
{
{
orderCode
,
orderCode
,
refundPrice
:
payPrice
,
refundPrice
:
payPrice
,
refundCount
:
goodsNumber
,
refundCount
:
goodsNumber
,
...
@@ -401,7 +215,9 @@ Component({
...
@@ -401,7 +215,9 @@ Component({
// 确认收货
// 确认收货
onConfirmReceive
(
e
)
{
onConfirmReceive
(
e
)
{
let
{
orderCode
}
=
let
{
orderCode
}
=
e
.
currentTarget
.
dataset
.
item
||
e
.
currentTarget
.
dataset
;
e
.
currentTarget
.
dataset
.
item
||
e
.
currentTarget
.
dataset
;
wx
.
showModal
({
wx
.
showModal
({
title
:
"温馨提示"
,
title
:
"温馨提示"
,
...
@@ -424,7 +240,9 @@ Component({
...
@@ -424,7 +240,9 @@ Component({
// 查看评价
// 查看评价
onLookEvaluate
(
e
)
{
onLookEvaluate
(
e
)
{
let
{
let
{
item
:
{
orderCode
},
item
:
{
orderCode
},
}
=
e
.
currentTarget
.
dataset
;
}
=
e
.
currentTarget
.
dataset
;
wx
.
p
.
router
.
go
(
wx
.
p
.
router
.
go
(
"/packageMall/pages/commentDetails/commentDetails"
,
"/packageMall/pages/commentDetails/commentDetails"
,
...
@@ -435,15 +253,21 @@ Component({
...
@@ -435,15 +253,21 @@ Component({
// 获取用户信息
// 获取用户信息
onGetUserProfile
(
e
)
{
onGetUserProfile
(
e
)
{
const
item
=
e
.
currentTarget
.
dataset
.
item
;
const
item
=
e
.
currentTarget
.
dataset
.
item
;
this
.
triggerEvent
(
"getUserProfile"
,
{
item
});
this
.
triggerEvent
(
"getUserProfile"
,
{
item
});
},
},
// 立即评价
// 立即评价
onEvaluate
(
e
)
{
onEvaluate
(
e
)
{
let
{
let
{
item
:
{
orderCode
},
item
:
{
orderCode
},
}
=
e
.
currentTarget
.
dataset
;
}
=
e
.
currentTarget
.
dataset
;
let
{
userInfo
}
=
this
.
data
;
let
{
userInfo
}
=
this
.
data
;
wx
.
p
.
router
.
go
(
"/packageMall/pages/addComment/addComment"
,
{
wx
.
p
.
router
.
go
(
"/packageMall/pages/addComment/addComment"
,
{
orderCode
,
orderCode
,
userInfo
,
userInfo
,
...
@@ -452,7 +276,9 @@ Component({
...
@@ -452,7 +276,9 @@ Component({
// 取消订单
// 取消订单
onCancelOrder
(
e
)
{
onCancelOrder
(
e
)
{
let
{
orderCode
}
=
let
{
orderCode
}
=
e
.
currentTarget
.
dataset
.
item
||
e
.
currentTarget
.
dataset
;
e
.
currentTarget
.
dataset
.
item
||
e
.
currentTarget
.
dataset
;
wx
.
showModal
({
wx
.
showModal
({
title
:
"温馨提示"
,
title
:
"温馨提示"
,
...
@@ -464,7 +290,10 @@ Component({
...
@@ -464,7 +290,10 @@ Component({
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
wx
.
p
.
api
.
shopmallApi
wx
.
p
.
api
.
shopmallApi
.
cancelOrder
(
orderCode
)
.
cancelOrder
(
orderCode
)
.
then
(({
code
,
message
})
=>
{
.
then
(({
code
,
message
})
=>
{
if
(
code
==
"0"
)
{
if
(
code
==
"0"
)
{
wx
.
p
.
wxApi
.
showToast
(
"操作成功"
);
wx
.
p
.
wxApi
.
showToast
(
"操作成功"
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -482,7 +311,9 @@ Component({
...
@@ -482,7 +311,9 @@ Component({
onAfterSaleDetail
(
e
)
{
onAfterSaleDetail
(
e
)
{
let
url
=
"/packageMine/pages/order/afterSaleDetail/afterSaleDetail"
;
let
url
=
"/packageMine/pages/order/afterSaleDetail/afterSaleDetail"
;
let
{
let
{
item
:
{
orderCode
},
item
:
{
orderCode
},
}
=
e
.
currentTarget
.
dataset
;
}
=
e
.
currentTarget
.
dataset
;
wx
.
p
.
router
.
go
(
url
,
{
wx
.
p
.
router
.
go
(
url
,
{
orderCode
,
orderCode
,
...
...
packageMine/pages/order/index/components/Top/Top.wxml
View file @
2a12ba4
<view class="top">
<view class="top">
<view class="name">订单编号:{{item.
o
rderCode}}</view>
<view class="name">订单编号:{{item.
subO
rderCode}}</view>
<!-- 订单状态 orderStatus(
1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待发货;7:待安装;8:已安装;9:售后中;10:售后完成
)
<!-- 订单状态 orderStatus(
订单状态(1001:待支付 1002:待审核,1003:审核不通过,1004:已取消(交易失败) ,1005:订单异常,1006:待处理,1007: 待发货,1008:已发货,1009:已完成(交易成功),1010:售后处理中,1012 订单关闭
)
售后订单状态 afterSaleStatus(1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败)
售后订单状态 afterSaleStatus(1:待审核;2:审核通过;3:审核不通过;4:待确认收到退货;5:退款中;6:已退款;7:退款失败)
-->
-->
<view class="status">{{item.
afterSaleStatus ? afterSaleStatus[item.afterSale
Status]
<view class="status">{{item.
orderStatus ?statusEnum[item.orderStatus]: afterSaleStatus[item.returnOrder
Status]
:statusEnum[item.orderStatus]
}}</view>
}}</view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
packageMine/pages/order/index/components/Top/Top.wxss
View file @
2a12ba4
...
@@ -8,10 +8,11 @@
...
@@ -8,10 +8,11 @@
}
}
.top .name {
.top .name {
width: 4
1
0rpx;
width: 4
5
0rpx;
height: 40rpx;
height: 40rpx;
font-size: 28rpx;
font-size: 28rpx;
color: #2D2D2E;
color: #2D2D2E;
white-space: nowrap;
}
}
.top .status {
.top .status {
...
...
packageMine/pages/order/index/index.js
View file @
2a12ba4
// packageMine/pages/order/index/index.js
// packageMine/pages/order/index/index.js
import
{
orderMixin
}
from
"~/mixins/index"
;
import
{
import
{
ORDER_STATUS
,
OrderStatusTypes
}
from
"~/constants/mine.js"
;
orderMixin
}
from
"~/mixins/index"
;
import
{
ORDER_STATUS
,
OrderStatusTypes
}
from
"~/constants/mine.js"
;
Page
({
Page
({
behaviors
:
[
orderMixin
],
behaviors
:
[
orderMixin
],
/**
/**
...
@@ -8,397 +13,12 @@ Page({
...
@@ -8,397 +13,12 @@ Page({
*/
*/
data
:
{
data
:
{
pageNum
:
1
,
pageNum
:
1
,
requestType
:
0
,
tab
:
Object
.
freeze
(
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
).
map
(
item
=>
item
.
text
)
),
),
// 硬编码的订单列表数据
list
:
[],
list
:
[
{
id
:
"1"
,
orderCode
:
"20230915001"
,
orderClassify
:
1
,
orderSource
:
1
,
orderStatus
:
1007
,
// 待发货
afterSaleStatus
:
null
,
merchantName
:
"精品商城"
,
deliveryType
:
2
,
payPrice
:
"199"
,
goodsNumber
:
1
,
createdDate
:
"2023-09-15 14:30:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
cancelStatus
:
null
,
// 添加取消状态
returnStatus
:
null
,
// 添加退换货状态
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
null
,
// 添加退货订单状态
orderGoods
:
[
{
id
:
"101"
,
goodsImage
:
"https://picsum.photos/200/200"
,
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
:
1008
,
// 待收货
afterSaleStatus
:
null
,
merchantName
:
"汽车用品店"
,
deliveryType
:
2
,
payPrice
:
"599"
,
goodsNumber
:
2
,
createdDate
:
"2023-09-14 10:15:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
cancelStatus
:
null
,
// 添加取消状态
returnStatus
:
null
,
// 添加退换货状态
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
null
,
// 添加退货订单状态
orderGoods
:
[
{
id
:
"102"
,
goodsImage
:
"https://picsum.photos/200/200"
,
goodsName
:
"汽车脚垫"
,
specificationData
:
"黑色 适配SUV"
,
retailPrice
:
"399"
,
activityPrice
:
"299"
,
goodsNumber
:
1
,
warrantyDate
:
"2024-09-14 10:15:00"
,
},
{
id
:
"103"
,
goodsImage
:
"https://picsum.photos/200/200"
,
goodsName
:
"车载香水"
,
specificationData
:
"海洋香型"
,
retailPrice
:
"200"
,
activityPrice
:
null
,
goodsNumber
:
1
,
warrantyDate
:
"2024-09-14 10:15:00"
,
},
],
},
{
id
:
"3"
,
orderCode
:
"20230910003"
,
orderClassify
:
1
,
orderSource
:
3
,
orderStatus
:
1009
,
// 已完成
afterSaleStatus
:
null
,
merchantName
:
"汽车配件专营店"
,
deliveryType
:
2
,
payPrice
:
"899"
,
goodsNumber
:
1
,
createdDate
:
"2023-09-10 16:45:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
cancelStatus
:
null
,
// 添加取消状态
returnStatus
:
null
,
// 添加退换货状态
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
null
,
// 添加退货订单状态
orderGoods
:
[
{
id
:
"104"
,
goodsImage
:
"https://picsum.photos/200/200"
,
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
:
1009
,
// 已完成
afterSaleStatus
:
null
,
merchantName
:
"精品商城"
,
deliveryType
:
1
,
payPrice
:
"1299"
,
goodsNumber
:
1
,
createdDate
:
"2023-09-05 09:20:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
cancelStatus
:
1010
,
// 添加取消状态,审核中
returnStatus
:
null
,
// 添加退换货状态
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
null
,
// 添加退货订单状态
orderGoods
:
[
{
id
:
"105"
,
goodsImage
:
"https://picsum.photos/200/200"
,
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
:
1009
,
// 已完成
afterSaleStatus
:
2
,
merchantName
:
"权益商城"
,
deliveryType
:
2
,
payPrice
:
"299"
,
goodsNumber
:
1
,
createdDate
:
"2023-09-01 11:30:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
activityBigImg
:
"https://picsum.photos/200/200"
,
activityName
:
"洗车服务券"
,
cancelStatus
:
null
,
// 添加取消状态
returnStatus
:
1000
,
// 添加退换货状态,待审核
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
1000
,
// 添加退货订单状态,待审核
orderGoods
:
[
{
id
:
"106"
,
goodsImage
:
"https://picsum.photos/200/200"
,
goodsName
:
"洗车服务券"
,
specificationData
:
"1次洗车服务"
,
retailPrice
:
"299"
,
activityPrice
:
null
,
goodsNumber
:
1
,
warrantyDate
:
"2024-09-01 11:30:00"
,
},
],
},
// 添加新的订单数据以展示更多状态
{
id
:
"6"
,
orderCode
:
"20230825006"
,
orderClassify
:
1
,
orderSource
:
2
,
orderStatus
:
1007
,
// 待发货
afterSaleStatus
:
null
,
merchantName
:
"汽车用品店"
,
deliveryType
:
2
,
payPrice
:
"499"
,
goodsNumber
:
1
,
createdDate
:
"2023-08-25 13:45:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
cancelStatus
:
1010
,
// 取消审核中
returnStatus
:
null
,
// 添加退换货状态
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
null
,
// 添加退货订单状态
orderGoods
:
[
{
id
:
"107"
,
goodsImage
:
"https://picsum.photos/200/200"
,
goodsName
:
"汽车座套"
,
specificationData
:
"真皮 适配轿车"
,
retailPrice
:
"499"
,
activityPrice
:
null
,
goodsNumber
:
1
,
warrantyDate
:
"2024-08-25 13:45:00"
,
},
],
},
{
id
:
"7"
,
orderCode
:
"20230820007"
,
orderClassify
:
1
,
orderSource
:
1
,
orderStatus
:
1008
,
// 待收货
afterSaleStatus
:
null
,
merchantName
:
"精品商城"
,
deliveryType
:
1
,
payPrice
:
"799"
,
goodsNumber
:
1
,
createdDate
:
"2023-08-20 16:30:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
cancelStatus
:
null
,
// 添加取消状态
returnStatus
:
null
,
// 添加退换货状态
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
null
,
// 添加退货订单状态
orderGoods
:
[
{
id
:
"108"
,
goodsImage
:
"https://picsum.photos/200/200"
,
goodsName
:
"车载空气净化器"
,
specificationData
:
"负离子型"
,
retailPrice
:
"799"
,
activityPrice
:
null
,
goodsNumber
:
1
,
warrantyDate
:
"2024-08-20 16:30:00"
,
},
],
},
{
id
:
"8"
,
orderCode
:
"20230815008"
,
orderClassify
:
1
,
orderSource
:
2
,
orderStatus
:
1009
,
// 已完成
afterSaleStatus
:
null
,
merchantName
:
"汽车用品店"
,
deliveryType
:
2
,
payPrice
:
"399"
,
goodsNumber
:
1
,
createdDate
:
"2023-08-15 11:20:00"
,
evaluatedFlag
:
"Y"
,
// 已评价
relatedUserCouponStatus
:
1
,
cancelStatus
:
null
,
// 添加取消状态
returnStatus
:
1001
,
// 添加退换货状态,待收货
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
1001
,
// 添加退货订单状态,审核通过
orderGoods
:
[
{
id
:
"109"
,
goodsImage
:
"https://picsum.photos/200/200"
,
goodsName
:
"汽车蜡"
,
specificationData
:
"进口配方 500ml"
,
retailPrice
:
"399"
,
activityPrice
:
null
,
goodsNumber
:
1
,
warrantyDate
:
"2024-08-15 11:20:00"
,
},
],
},
{
id
:
"9"
,
orderCode
:
"20230810009"
,
orderClassify
:
1
,
orderSource
:
1
,
orderStatus
:
1009
,
// 已完成
afterSaleStatus
:
null
,
merchantName
:
"精品商城"
,
deliveryType
:
1
,
payPrice
:
"599"
,
goodsNumber
:
1
,
createdDate
:
"2023-08-10 09:15:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
cancelStatus
:
null
,
// 添加取消状态
returnStatus
:
1008
,
// 添加退换货状态,审核不通过
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
1005
,
// 添加退货订单状态,审核不通过
orderGoods
:
[
{
id
:
"110"
,
goodsImage
:
"https://picsum.photos/200/200"
,
goodsName
:
"车载冰箱"
,
specificationData
:
"12V 20L"
,
retailPrice
:
"599"
,
activityPrice
:
null
,
goodsNumber
:
1
,
warrantyDate
:
"2024-08-10 09:15:00"
,
},
],
},
{
id
:
"10"
,
orderCode
:
"20230805010"
,
orderClassify
:
1
,
orderSource
:
2
,
orderStatus
:
1009
,
// 已完成
afterSaleStatus
:
null
,
merchantName
:
"汽车用品店"
,
deliveryType
:
2
,
payPrice
:
"999"
,
goodsNumber
:
1
,
createdDate
:
"2023-08-05 14:10:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
cancelStatus
:
null
,
// 添加取消状态
returnStatus
:
1002
,
// 添加退换货状态,已收货
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
1003
,
// 添加退货订单状态,已退款
orderGoods
:
[
{
id
:
"111"
,
goodsImage
:
"https://picsum.photos/200/200"
,
goodsName
:
"汽车应急启动电源"
,
specificationData
:
"20000mAh 锂电池"
,
retailPrice
:
"999"
,
activityPrice
:
null
,
goodsNumber
:
1
,
warrantyDate
:
"2024-08-05 14:10:00"
,
},
],
},
{
id
:
"11"
,
orderCode
:
"20230730011"
,
orderClassify
:
1
,
orderSource
:
1
,
orderStatus
:
1009
,
// 已完成
afterSaleStatus
:
null
,
merchantName
:
"精品商城"
,
deliveryType
:
1
,
payPrice
:
"299"
,
goodsNumber
:
1
,
createdDate
:
"2023-07-30 17:25:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
cancelStatus
:
null
,
// 添加取消状态
returnStatus
:
null
,
// 添加退换货状态
refundStatus
:
1002
,
// 添加退款状态,已退款
returnOrderStatus
:
1003
,
// 添加退货订单状态,已退款
orderGoods
:
[
{
id
:
"112"
,
goodsImage
:
"https://picsum.photos/200/200"
,
goodsName
:
"汽车轮胎压力监测器"
,
specificationData
:
"无线 4个装"
,
retailPrice
:
"299"
,
activityPrice
:
null
,
goodsNumber
:
1
,
warrantyDate
:
"2024-07-30 17:25:00"
,
},
],
},
{
id
:
"12"
,
orderCode
:
"20230725012"
,
orderClassify
:
1
,
orderSource
:
2
,
// orderStatus: 1009, // 已完成
afterSaleStatus
:
null
,
merchantName
:
"汽车用品店"
,
deliveryType
:
2
,
payPrice
:
"199"
,
goodsNumber
:
1
,
createdDate
:
"2023-07-25 12:40:00"
,
evaluatedFlag
:
"N"
,
relatedUserCouponStatus
:
1
,
cancelStatus
:
null
,
// 添加取消状态
returnStatus
:
1006
,
// 添加退换货状态,退款异常
refundStatus
:
null
,
// 添加退款状态
returnOrderStatus
:
1003
,
// 添加退货订单状态,已退款
orderGoods
:
[
{
id
:
"113"
,
goodsImage
:
"https://picsum.photos/200/200"
,
goodsName
:
"汽车玻璃水"
,
specificationData
:
"防冻型 5L"
,
retailPrice
:
"199"
,
activityPrice
:
null
,
goodsNumber
:
1
,
warrantyDate
:
"2024-07-25 12:40:00"
,
},
],
},
],
listFlag
:
true
,
listFlag
:
true
,
hasUserInfo
:
true
,
hasUserInfo
:
true
,
},
},
...
@@ -412,7 +32,11 @@ Page({
...
@@ -412,7 +32,11 @@ Page({
},
},
jump
(
e
)
{
jump
(
e
)
{
let
{
let
{
item
:
{
orderStatus
,
orderCode
,
orderSource
},
item
:
{
orderStatus
,
orderCode
,
orderSource
},
}
=
e
.
currentTarget
.
dataset
;
}
=
e
.
currentTarget
.
dataset
;
if
(
orderSource
==
5
&&
(
orderStatus
==
2
||
orderStatus
==
7
))
return
;
if
(
orderSource
==
5
&&
(
orderStatus
==
2
||
orderStatus
==
7
))
return
;
let
url
=
"/packageMine/pages/order/detail/detail"
;
let
url
=
"/packageMine/pages/order/detail/detail"
;
...
@@ -423,38 +47,55 @@ Page({
...
@@ -423,38 +47,55 @@ Page({
afterSaleDetail
(
e
)
{
afterSaleDetail
(
e
)
{
let
url
=
"/packageMine/pages/order/afterSaleDetail/afterSaleDetail"
;
let
url
=
"/packageMine/pages/order/afterSaleDetail/afterSaleDetail"
;
let
{
let
{
item
:
{
orderCode
},
item
:
{
orderCode
},
}
=
e
.
currentTarget
.
dataset
;
}
=
e
.
currentTarget
.
dataset
;
wx
.
p
.
router
.
go
(
url
,
{
wx
.
p
.
router
.
go
(
url
,
{
orderCode
,
orderCode
,
});
});
},
},
back
()
{
back
()
{
let
{
length
}
=
getCurrentPages
();
let
{
length
}
=
getCurrentPages
();
if
(
length
==
1
)
wx
.
p
.
router
.
switchTab
(
"/pages/tab/mine/index"
);
if
(
length
==
1
)
wx
.
p
.
router
.
switchTab
(
"/pages/tab/mine/index"
);
else
wx
.
p
.
router
.
back
();
else
wx
.
p
.
router
.
back
();
},
},
changeTab
(
e
)
{
changeTab
(
e
)
{
let
index
=
e
.
detail
.
count
,
requestType
=
this
.
getRequestType
(
index
);
console
.
log
(
index
,
e
)
this
.
setData
({
this
.
setData
({
tabIndex
:
e
.
detail
.
item
.
code
,
tabIndex
:
index
,
orderStatusPart
:
e
.
detail
.
item
.
code
,
requestType
});
});
this
.
clearData
();
this
.
getOrderList
()
},
getRequestType
(
index
)
{
// index = index ? index : 0
let
item
=
Object
.
values
(
ORDER_STATUS
).
find
(
item
=>
item
.
index
==
(
index
||
0
))
console
.
log
(
item
)
return
item
?
item
.
requestType
:
'0'
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
wx
.
p
.
router
.
getRouterParams
(
options
).
then
((
option
)
=>
{
wx
.
p
.
router
.
getRouterParams
(
options
).
then
((
option
)
=>
{
let
index
=
option
.
index
,
requestType
=
this
.
getRequestType
(
index
);
this
.
setData
({
this
.
setData
({
tabIndex
:
option
.
index
,
tabIndex
:
index
,
orderStatusPart
:
option
.
index
,
requestType
});
});
this
.
getOrderList
()
// this.clearData(); // 注释掉实际的API调用,使用硬编码数据
// this.clearData(); // 注释掉实际的API调用,使用硬编码数据
});
});
},
},
onShow
()
{
onShow
()
{
if
(
this
.
refresh
)
this
.
clearData
();
// if (this.refresh) this.clearData();
if
(
this
.
refresh
)
this
.
getOrderList
();
},
},
onHide
()
{
onHide
()
{
this
.
refresh
=
true
;
this
.
refresh
=
true
;
...
@@ -474,7 +115,8 @@ Page({
...
@@ -474,7 +115,8 @@ Page({
});
});
},
},
search
()
{
search
()
{
this
.
clearData
();
this
.
getOrderList
()
// this.clearData();
},
},
clear
()
{
clear
()
{
this
.
setData
({
this
.
setData
({
...
@@ -487,46 +129,56 @@ Page({
...
@@ -487,46 +129,56 @@ Page({
});
});
},
},
blur
()
{
blur
()
{
let
{
keyword
}
=
this
.
data
;
let
{
keyword
}
=
this
.
data
;
this
.
setData
({
this
.
setData
({
keyword
,
keyword
,
});
});
},
},
getOrderList
()
{
getOrderList
()
{
// 使用硬编码数据,不需要实际调用API
/*
wx
.
p
.
wxApi
.
showLoading
(
"加载中..."
);
wx
.
p
.
wxApi
.
showLoading
(
"加载中..."
);
let { orderStatusPart, pageNum, keyword } = this.data;
let
{
requestType
,
pageNum
,
keyword
}
=
this
.
data
;
let
obj
=
{
let
obj
=
{
orderStatusPart
,
requestType
,
currentPage: pageNum
,
currentPage
:
pageNum
};
};
if
(
keyword
)
{
if
(
keyword
)
{
keyword
=
keyword
.
replace
(
/
\
/g
,
""
);
keyword
=
keyword
.
replace
(
/
\
/g
,
""
);
if
(
keyword
.
length
)
obj
.
keyword
=
keyword
;
if
(
keyword
.
length
)
obj
.
keyword
=
keyword
;
}
}
// requestType==3:退货/售后
let
Method
=
requestType
==
3
?
'getSalesOrderList'
:
'getOrderList'
;
let
list
=
[];
let
list
=
[];
wx.p.api.mineApi
.getOrderList
(obj).then((data) => {
wx
.
p
.
api
.
mineApi
[
Method
]
(
obj
).
then
((
data
)
=>
{
wx
.
hideLoading
();
wx
.
hideLoading
();
data
?.
list
?.
map
((
e
)
=>
{
data
?.
list
?.
map
((
e
)
=>
{
let { orderGoods, createdDate, orderClassify } = e;
// let {
let goodsNumber = 0;
// orderGoods,
let expiredTime = 0;
// createdDate,
orderGoods?.map((i) => {
// orderClassify
i.retailPrice = Number(i.retailPrice).toFixed(2);
// } = e;
if (i.activityPrice)
// let goodsNumber = 0;
i.activityPrice = Number(i.activityPrice).toFixed(2);
// let expiredTime = 0;
goodsNumber += i.goodsNumber;
// orderGoods?.map((i) => {
expiredTime = new Date(i.warrantyDate).format("yyyy-MM-dd hh:mm:ss");
// i.retailPrice = Number(i.retailPrice).toFixed(2);
if (orderClassify == 5) {
// if (i.activityPrice)
e.payPrice = NP.times(i.retailPrice, i.goodsNumber);
// 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,
//
goodsNumber,
time: new Date(createdDate).format("yyyy-MM-dd hh:mm:ss"),
//
time: new Date(createdDate).format("yyyy-MM-dd hh:mm:ss"),
expiredTime,
//
expiredTime,
});
});
});
});
this
.
setData
({
this
.
setData
({
...
@@ -535,7 +187,7 @@ Page({
...
@@ -535,7 +187,7 @@ Page({
});
});
wx
.
hideLoading
();
wx
.
hideLoading
();
});
});
*/
},
},
requestSubscribeMessage
()
{
requestSubscribeMessage
()
{
wx
.
p
.
router
.
go
(
"/packageMine/pages/order/complete/complete"
,
{
wx
.
p
.
router
.
go
(
"/packageMine/pages/order/complete/complete"
,
{
...
@@ -564,20 +216,26 @@ Page({
...
@@ -564,20 +216,26 @@ Page({
},
},
// 查看卡券
// 查看卡券
toCheckCard
(
e
)
{
toCheckCard
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
;
const
{
item
}
=
e
.
currentTarget
.
dataset
;
wx
.
p
.
router
.
go
(
"/packageEquity/pages/kaqDetail/kaqDetail"
,
{
wx
.
p
.
router
.
go
(
"/packageEquity/pages/kaqDetail/kaqDetail"
,
{
orderCode
:
item
.
orderCode
,
orderCode
:
item
.
orderCode
,
});
});
},
},
// 卡卷 申请售后
// 卡卷 申请售后
toSaleApplyPage
(
e
)
{
toSaleApplyPage
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
;
let
{
item
}
=
e
.
currentTarget
.
dataset
;
item
.
pageFrom
=
"coupons"
;
item
.
pageFrom
=
"coupons"
;
wx
.
p
.
router
.
go
(
"/packageEquity/pages/saleApply/saleApply"
,
item
);
wx
.
p
.
router
.
go
(
"/packageEquity/pages/saleApply/saleApply"
,
item
);
},
},
// 卡卷 确认收货
// 卡卷 确认收货
toComfirmPage
(
e
)
{
toComfirmPage
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
;
let
{
item
}
=
e
.
currentTarget
.
dataset
;
let
para
=
{
let
para
=
{
orderCode
:
item
.
orderCode
,
orderCode
:
item
.
orderCode
,
};
};
...
@@ -592,7 +250,8 @@ Page({
...
@@ -592,7 +250,8 @@ Page({
wx
.
p
.
api
.
equityApi
.
comfirmRevice
(
para
).
then
((
res
)
=>
{
wx
.
p
.
api
.
equityApi
.
comfirmRevice
(
para
).
then
((
res
)
=>
{
wx
.
p
.
wxApi
.
showToast
(
"确认收货成功"
);
wx
.
p
.
wxApi
.
showToast
(
"确认收货成功"
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
clearData
();
// this.clearData();
this
.
getOrderList
()
},
1.5e3
);
},
1.5e3
);
});
});
}
}
...
@@ -600,30 +259,37 @@ Page({
...
@@ -600,30 +259,37 @@ Page({
},
},
// 套餐申请售后
// 套餐申请售后
toSaleApplyPackage
(
e
)
{
toSaleApplyPackage
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
;
let
{
item
}
=
e
.
currentTarget
.
dataset
;
item
.
pageFrom
=
"package"
;
item
.
pageFrom
=
"package"
;
wx
.
p
.
router
.
go
(
"/packageEquity/pages/saleApply/saleApply"
,
item
);
wx
.
p
.
router
.
go
(
"/packageEquity/pages/saleApply/saleApply"
,
item
);
},
},
// 套餐售后详情
// 套餐售后详情
toPackageDetail
(
e
)
{
toPackageDetail
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
;
const
{
item
}
=
e
.
currentTarget
.
dataset
;
wx
.
p
.
router
.
go
(
"/packageEquity/pages/packageDetail/packageDetail"
,
{
wx
.
p
.
router
.
go
(
"/packageEquity/pages/packageDetail/packageDetail"
,
{
orderCode
:
item
.
orderCode
,
orderCode
:
item
.
orderCode
,
});
});
},
},
// 套餐查看卡包
// 套餐查看卡包
toCheckPackage
(
e
)
{
toCheckPackage
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
;
const
{
item
}
=
e
.
currentTarget
.
dataset
;
wx
.
p
.
router
.
go
(
"/packageEquity/pages/packageDetail/packageDetail"
,
{
wx
.
p
.
router
.
go
(
"/packageEquity/pages/packageDetail/packageDetail"
,
{
orderCode
:
item
.
orderCode
,
orderCode
:
item
.
orderCode
,
});
});
},
},
// 精品订单跳转页面
// 精品订单跳转页面
boutiqueJump
(
e
)
{
boutiqueJump
(
e
)
{
let
{
orderCode
}
=
e
.
currentTarget
.
dataset
;
let
{
orderCode
}
=
e
.
currentTarget
.
dataset
;
wx
.
p
.
router
.
go
(
wx
.
p
.
router
.
go
(
"/packageMine/pages/boutiquePages/boutiqueOrder/boutiqueOrder"
,
"/packageMine/pages/boutiquePages/boutiqueOrder/boutiqueOrder"
,
{
{
orderCode
,
orderCode
,
type
:
2
,
type
:
2
,
}
}
...
...
pages/tab/mine/index.js
View file @
2a12ba4
...
@@ -123,41 +123,6 @@ Page({
...
@@ -123,41 +123,6 @@ Page({
}
}
})
})
},
},
// 获取用户会员信息
toCheckMember
()
{
// wx.p.router.intercept(false).then((sid) => {
// if (sid) {
// this.setData({
// isMember: false,
// memberFlag: true,
// });
// } else {
// wx.p.api.equityApi.checkOpenMember().then((res) => {
// let flag = false,
// identity = 0; // 普通会员3 银卡2 金卡1 非会员 0
// if (res.data && res.data.validitDate) {
// res.data.time = new Date(res.data.validitDate).format("yyyy.MM.dd");
// }
// if (res.data && res.data.endTime) {
// res.data.endTime = new Date(res.data.endTime).format("yyyy.MM.dd");
// }
// if (res.code == 0 && res.data) {
// flag = true;
// identity = 3;
// if (res.data && res.data.cardTypeSpecial)
// identity = res.data.cardTypeSpecial;
// }
// wx.p.storage.set("isVIP", flag);
// this.setData({
// isMember: flag,
// vipInfo: res.data,
// identity,
// memberFlag: true,
// });
// });
// }
// });
},
/**
/**
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment