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
add05e5f
Commit
add05e5f
authored
Aug 20, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 订单不同的状态
parent
fab3a01b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
order.js
src/pages/order/order.js
+20
-5
order.wxml
src/pages/order/order.wxml
+1
-0
No files found.
src/pages/order/order.js
View file @
add05e5f
...
...
@@ -10,25 +10,31 @@ wxService.page({
* 页面的初始数据
*/
data
:
{
// 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
swiperItem
:
[
{
type
:
'1'
,
status
:
''
,
name
:
'全部'
},
{
type
:
'2'
,
name
:
'待付款'
status
:
'N'
,
name
:
'待付款'
// 新建
},
{
type
:
'3'
,
status
:
'P'
,
name
:
'待发货'
},
{
type
:
'4'
,
status
:
'D'
,
name
:
'待收货'
},
{
type
:
'5'
,
status
:
'RF'
,
name
:
'退款/售后'
}
],
...
...
@@ -68,9 +74,6 @@ wxService.page({
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
this
.
data
.
trade
)
},
initOrderList
(
pageNo
,
pageSize
,
trade
)
{
if
(
this
.
data
.
noMoreFlag
)
{
// 没有更多数据了,不调用接口
return
false
}
wx
.
showLoading
({
title
:
'加载中'
,
mask
:
true
...
...
@@ -91,8 +94,20 @@ wxService.page({
},
//点击切换tab
switchTab
(
e
)
{
const
{
type
,
status
}
=
e
.
currentTarget
.
dataset
const
{
currentIndex
}
=
this
.
data
if
(
currentIndex
==
type
)
return
false
this
.
setData
({
currentIndex
:
e
.
currentTarget
.
dataset
.
type
currentIndex
:
type
,
pageNo
:
1
,
orderList
:
[],
trade
:
''
},()
=>
{
if
(
type
==
5
&&
status
==
'RF'
){
console
.
log
(
"退款/售后"
)
}
else
{
this
.
initOrderList
(
this
.
data
.
pageNo
,
this
.
data
.
pageSize
,
status
)
}
})
},
...
...
src/pages/order/order.wxml
View file @
add05e5f
...
...
@@ -7,6 +7,7 @@
wx:key="{{index}}"
bindtap="switchTab"
data-type="{{item.type}}"
data-status="{{item.status}}"
>
{{item.name}}
</view>
...
...
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