Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
28aeaecc
Commit
28aeaecc
authored
Apr 08, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拆单优化
parent
db6ece49
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
23 deletions
+84
-23
order.js
src/pages/order/order.js
+82
-22
order.wxml
src/pages/order/order.wxml
+1
-0
order.wxss
src/pages/order/order.wxss
+1
-1
No files found.
src/pages/order/order.js
View file @
28aeaecc
...
...
@@ -137,9 +137,18 @@ wxService.page({
})
let
id
=
e
.
currentTarget
.
dataset
.
id
;
let
packageInfo
=
e
.
currentTarget
.
dataset
.
package
;
let
packageInfo
=
e
.
currentTarget
.
dataset
.
package
;
let
parcelId
=
packageInfo
.
id
;
if
(
parcelId
){
this
.
packageConfirmReceive
(
id
,
parcelId
);
}
else
{
this
.
oldVersionConfirmReceive
(
id
);
}
},
//包裹的确认收货
packageConfirmReceive
(
findId
,
parcelId
){
wxService
.
post
(
`/sale/trade/buyer/parcelConfirm?findId=
${
id
}
&parcelId=
${
parcelId
}
`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
...
...
@@ -164,6 +173,33 @@ wxService.page({
}
})
},
//兼容以前老数据进行确认收货
oldVersionConfirmReceive
(
id
){
wxService
.
post
(
`/sale/trade/buyer/confirm/
${
id
}
`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
wx
.
showToast
({
title
:
`您已确认收货!`
,
icon
:
'none'
})
setTimeout
(()
=>
{
this
.
onShow
()
},
200
)
}
else
{
wx
.
showToast
({
title
:
`确认收货失败!`
,
icon
:
'none'
})
setTimeout
(()
=>
{
this
.
onShow
()
},
200
)
}
}
})
},
// 取消订单
handelCancelOrder
(
e
)
{
let
_this
=
this
;
...
...
@@ -214,7 +250,7 @@ wxService.page({
let
detail
=
{
id
:
orderId
,
skuVOList
:
packageInfo
.
sendOutList
,
skuVOList
:
packageInfo
.
sendOutList
,
}
let
copyOrderInfo
=
JSON
.
parse
(
JSON
.
stringify
(
detail
));
...
...
@@ -312,14 +348,30 @@ wxService.page({
// 查看物流
checkLogistics
(
e
)
{
let
{
detail
}
=
e
.
currentTarget
.
dataset
;
let
obj
=
{
id
:
this
.
data
.
id
,
logistic
:
{
supplierName
:
detail
.
supplierName
,
code
:
detail
.
code
,
supplierCode
:
detail
.
supplierCode
,
},
status
:
detail
.
status
,
let
{
id
}
=
e
.
currentTarget
.
dataset
;
let
item
=
e
.
currentTarget
.
dataset
.
item
;
let
obj
=
{};
if
(
detail
.
code
){
obj
=
{
id
:
id
,
logistic
:
{
supplierName
:
detail
.
supplierName
,
code
:
detail
.
code
,
supplierCode
:
detail
.
supplierCode
,
},
status
:
detail
.
status
,
}
}
else
{
obj
=
{
id
:
id
,
logistic
:
{
supplierName
:
item
.
logistic
.
supplierName
,
code
:
item
.
logistic
.
code
,
supplierCode
:
item
.
logistic
.
supplierCode
,
},
status
:
detail
.
status
,
}
}
let
params
=
JSON
.
stringify
(
obj
);
...
...
@@ -394,12 +446,13 @@ wxService.page({
}
})
},
//获取订单列表
initOrderList
(
pageNo
,
pageSize
,
status
)
{
wx
.
showLoading
({
title
:
'加载中'
,
mask
:
true
})
const
params
=
{
status
:
status
,
orderType
:
1
}
wxService
.
post
(
`/sale/trade/buyer/history?pageNum=
${
pageNo
}
&pageSize=
${
pageSize
}
`
,
params
).
then
(
res
=>
{
if
(
res
)
{
...
...
@@ -411,13 +464,12 @@ wxService.page({
orderList
.
forEach
(
item
=>
{
item
.
statusText
=
ORDER_STATUS_TEXT
[
item
.
status
];
let
parcelList
=
item
.
parcelList
?
item
.
parcelList
:
[];
let
skuVOList
=
item
.
skuVOList
?
item
.
skuVOList
:
[];
skuVOList
.
forEach
(
sku
=>
{
sku
.
refundCount
=
sku
.
refundCount
?
sku
.
refundCount
:
0
;
sku
.
canRefundNum
=
(
sku
.
count
-
sku
.
refundCount
)
>=
0
?
(
sku
.
count
-
sku
.
refundCount
)
:
0
;
});
if
(
parcelList
.
length
==
0
){
let
skuVOList
=
item
.
skuVOList
?
item
.
skuVOList
:
[];
skuVOList
.
forEach
(
sku
=>
{
sku
.
refundCount
=
sku
.
refundCount
?
sku
.
refundCount
:
0
;
sku
.
canRefundNum
=
(
sku
.
count
-
sku
.
refundCount
)
>=
0
?
(
sku
.
count
-
sku
.
refundCount
)
:
0
;
});
if
(
item
.
status
==
'N'
||
item
.
status
==
'C'
){
parcelList
=
[{
code
:
''
,
...
...
@@ -475,11 +527,19 @@ wxService.page({
p
.
sendOutList
=
sendOutList
;
});
}
item
.
parcelList
=
parcelList
;
})
console
.
log
(
orderList
)
//这里需要处理移除非选中tab状态下的包裹(待收货中包含了待收货和已完成状态的包裹)
if
(
!
status
){
item
.
parcelList
=
parcelList
;
}
else
if
(
status
!=
'D'
){
parcelList
=
parcelList
.
filter
(
pa
=>
pa
.
status
==
status
);
item
.
parcelList
=
parcelList
;
}
else
{
parcelList
=
parcelList
.
filter
(
pa
=>
pa
.
status
!=
'P'
);
item
.
parcelList
=
parcelList
;
}
});
if
(
this
.
data
.
pageNo
==
1
){
this
.
data
.
orderList
=
orderList
;
...
...
src/pages/order/order.wxml
View file @
28aeaecc
...
...
@@ -79,6 +79,7 @@
<view class="btns normal-btn"
wx:if="{{packageInfo.status == 'D' || packageInfo.status == 'R'}}"
data-id="{{item.id}}"
data-item="{{item}}"
data-detail="{{packageInfo}}"
data-code="{{packageInfo.supplierCode}}"
data-logisticsNo="{{packageInfo.code}}"
...
...
src/pages/order/order.wxss
View file @
28aeaecc
...
...
@@ -260,7 +260,7 @@ scroll-view{
}
.package-status-color-R{
color: #
67C23A
;
color: #
999999
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment