Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d937734e
authored
Sep 16, 2020
by
zqm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
MM-订单列表头部固定。请求动画。无数据不再请求
parent
862a7ead
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
152 additions
and
42 deletions
app.json
pages/mine/home/home.js
pages/mine/home/home.wxml
pages/mine/order/order.js
pages/mine/order/order.wxml
pages/mine/order/order.wxss
app.json
View file @
d937734e
...
@@ -56,7 +56,6 @@
...
@@ -56,7 +56,6 @@
"pages/pay/coupon-input/coupon-input"
,
"pages/pay/coupon-input/coupon-input"
,
"pages/pay/coupon-detail/coupon-detail"
,
"pages/pay/coupon-detail/coupon-detail"
,
"pages/login/login"
"pages/login/login"
],
],
"usingComponents"
:
{
"usingComponents"
:
{
"navigation"
:
"./component/navigation/navigation"
,
"navigation"
:
"./component/navigation/navigation"
,
...
...
pages/mine/home/home.js
View file @
d937734e
...
@@ -8,7 +8,7 @@ Page({
...
@@ -8,7 +8,7 @@ Page({
data
:
{
data
:
{
imageBase
:
App
.
globalData
.
appImageBase
,
imageBase
:
App
.
globalData
.
appImageBase
,
orderType
:
1
,
// 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
orderType
:
1
,
// 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
userInfo
:
{
userInfo
:
{
'openId'
:
''
,
'openId'
:
''
,
...
@@ -20,7 +20,7 @@ Page({
...
@@ -20,7 +20,7 @@ Page({
'sex'
:
''
,
'sex'
:
''
,
'userType'
:
0
'userType'
:
0
},
},
mobile
:
''
,
mobile
:
''
,
nickName
:
''
,
nickName
:
''
,
avatarUrl
:
'/pages/mine/home/image/avatar.png'
,
avatarUrl
:
'/pages/mine/home/image/avatar.png'
,
...
@@ -30,10 +30,10 @@ Page({
...
@@ -30,10 +30,10 @@ Page({
approveList
:
[
'园区门票优惠'
,
'餐厅价格优惠'
,
'SPA服务优惠'
,
'免费观看电影'
,
'无须预约入园'
,
'尽享多重特权'
],
approveList
:
[
'园区门票优惠'
,
'餐厅价格优惠'
,
'SPA服务优惠'
,
'免费观看电影'
,
'无须预约入园'
,
'尽享多重特权'
],
activityList
:
[],
activityList
:
[],
isRegister
:
false
,
// 是否注册,
isRegister
:
false
,
// 是否注册,
// 右上角消息
// 右上角消息
passBadge
:
0
,
passBadge
:
0
,
foodBadge
:
22
,
foodBadge
:
22
,
movieBadge
:
1
,
movieBadge
:
1
,
spaBadge
:
0
,
spaBadge
:
0
,
artBadge
:
101
,
artBadge
:
101
,
...
@@ -41,8 +41,7 @@ Page({
...
@@ -41,8 +41,7 @@ Page({
showMoreOrder
:
false
,
// 查看更多订单
showMoreOrder
:
false
,
// 查看更多订单
showMoreActivity
:
false
,
// 查看更多活动
showMoreActivity
:
false
,
// 查看更多活动
myOrder
:
{
myOrder
:
{
passOrder
:
[
passOrder
:
[{
{
id
:
0
,
id
:
0
,
logo
:
''
,
logo
:
''
,
store
:
'儿童营地'
,
store
:
'儿童营地'
,
...
@@ -63,26 +62,22 @@ Page({
...
@@ -63,26 +62,22 @@ Page({
],
],
artOrder
:
{
artOrder
:
{
logo
:
''
,
logo
:
''
,
orderList
:
[
orderList
:
[{
{
id
:
0
,
id
:
0
,
store
:
'海错图展馆'
,
store
:
'海错图展馆'
,
cover
:
'../../pay/order-detail/image/goods_item.png'
,
cover
:
'../../pay/order-detail/image/goods_item.png'
,
title
:
'《海错图》展览单人门票'
,
title
:
'《海错图》展览单人门票'
,
time
:
'有效期至 2020.09.30'
,
time
:
'有效期至 2020.09.30'
,
quantity
:
'共1张门票'
quantity
:
'共1张门票'
},
]
},
]
}
}
},
},
appointmentList
:
[
appointmentList
:
[{
{
time
:
'8月15日-7月15日 10:00-12:00'
,
time
:
'8月15日-7月15日 10:00-12:00'
,
img
:
''
,
img
:
''
,
title
:
'日落观光游船体验活动之船行碧波共赏美景'
,
title
:
'日落观光游船体验活动之船行碧波共赏美景'
,
num
:
3
num
:
3
}]
}
]
},
},
close
()
{
close
()
{
...
@@ -111,7 +106,12 @@ Page({
...
@@ -111,7 +106,12 @@ Page({
onShow
:
function
()
{
onShow
:
function
()
{
this
.
setUserInfo
()
this
.
setUserInfo
()
},
},
// 去核销
goCouponInput
(
event
)
{
wx
.
navigateTo
({
url
:
'/pages/pay/coupon-input/coupon-input'
,
})
},
setUserInfo
:
function
()
{
setUserInfo
:
function
()
{
let
funcUserInfo
=
wx
.
getStorageSync
(
'userInfo'
)
let
funcUserInfo
=
wx
.
getStorageSync
(
'userInfo'
)
...
@@ -214,7 +214,11 @@ Page({
...
@@ -214,7 +214,11 @@ Page({
var
that
=
this
var
that
=
this
App
.
wxRequest
({
App
.
wxRequest
({
url
:
'/api/v1/activity/getMyActivityList'
,
url
:
'/api/v1/activity/getMyActivityList'
,
data
:
{
activeState
:
'0,1'
,
pageSize
:
10
,
pageNo
:
1
},
data
:
{
activeState
:
'0,1'
,
pageSize
:
10
,
pageNo
:
1
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
let
list
=
res
.
data
.
list
let
list
=
res
.
data
.
list
let
tmpArr
=
[]
let
tmpArr
=
[]
...
@@ -222,12 +226,18 @@ Page({
...
@@ -222,12 +226,18 @@ Page({
let
state
=
item
.
activeState
*
1
let
state
=
item
.
activeState
*
1
let
type
=
0
let
type
=
0
switch
(
state
)
{
switch
(
state
)
{
case
0
:
type
=
1
;
break
;
case
0
:
case
1
:
type
=
0
;
break
;
type
=
1
;
case
2
:
type
=
2
;
break
;
break
;
case
1
:
type
=
0
;
break
;
case
2
:
type
=
2
;
break
;
}
}
let
obj
=
{
let
obj
=
{
time
:
item
.
enrollDate
,
//activeDate + ' ' + item.activeTime,
time
:
item
.
enrollDate
,
//activeDate + ' ' + item.activeTime,
type
:
type
,
type
:
type
,
content
:
item
.
address
,
content
:
item
.
address
,
title
:
item
.
name
,
title
:
item
.
name
,
...
@@ -249,7 +259,7 @@ Page({
...
@@ -249,7 +259,7 @@ Page({
url
:
'/api/v1/subscribe/getList'
,
url
:
'/api/v1/subscribe/getList'
,
data
:
{
data
:
{
state
:
'1'
,
state
:
'1'
,
type
:
''
//0 入园预约 1 看房预约 全部 空字符
type
:
''
//0 入园预约 1 看房预约 全部 空字符
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
let
tmpArr
=
[]
let
tmpArr
=
[]
...
...
pages/mine/home/home.wxml
View file @
d937734e
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
</view>
</view>
</view>
</view>
<view class="coupon row align-c">
<view class="coupon row align-c"
bindtap="goCouponInput"
>
<view class="cpopon-info col">
<view class="cpopon-info col">
<text>券码核销</text>
<text>券码核销</text>
<text>所属门店:拾光花坊</text>
<text>所属门店:拾光花坊</text>
...
...
pages/mine/order/order.js
View file @
d937734e
...
@@ -30,6 +30,8 @@ Page({
...
@@ -30,6 +30,8 @@ Page({
orderList
:
[],
orderList
:
[],
orderPages
:
1
,
orderPages
:
1
,
winOrderType
:
false
,
winOrderType
:
false
,
isLoading
:
false
,
isFinished
:
false
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
this
.
setOrderType
()
this
.
setOrderType
()
...
@@ -42,9 +44,21 @@ Page({
...
@@ -42,9 +44,21 @@ Page({
* @returns
* @returns
*/
*/
queryOrder
:
function
()
{
queryOrder
:
function
()
{
// 数据全部加载完成不再执行
console
.
log
(
this
.
data
.
isFinished
,
'-----------------------------------this.data.isFinished'
);
if
(
this
.
data
.
isFinished
)
return
let
that
=
this
;
let
funcName
=
this
.
data
.
orderType
[
this
.
data
.
orderTypeActive
].
value
let
funcName
=
this
.
data
.
orderType
[
this
.
data
.
orderTypeActive
].
value
let
funcValue
=
this
.
data
.
statusList
[
this
.
data
.
statusActive
].
value
let
funcValue
=
this
.
data
.
statusList
[
this
.
data
.
statusActive
].
value
this
.
setData
({
isLoading
:
true
})
wx
.
showLoading
({
title
:
'加载中'
,
})
App
.
wxRequest
({
App
.
wxRequest
({
url
:
'/api/v1/order/getOrderList'
,
url
:
'/api/v1/order/getOrderList'
,
data
:
{
data
:
{
...
@@ -54,7 +68,13 @@ Page({
...
@@ -54,7 +68,13 @@ Page({
'pageNo'
:
this
.
data
.
orderPages
,
'pageNo'
:
this
.
data
.
orderPages
,
},
},
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
wx
.
hideLoading
()
let
funcResponse
=
response
.
data
let
funcResponse
=
response
.
data
if
(
funcResponse
.
length
<
10
)
{
that
.
setData
({
isFinished
:
true
})
}
let
funcList
=
[]
let
funcList
=
[]
for
(
let
i
=
0
,
l
=
funcResponse
.
length
;
i
<
l
;
i
++
)
{
for
(
let
i
=
0
,
l
=
funcResponse
.
length
;
i
<
l
;
i
++
)
{
let
funcItem
=
{
let
funcItem
=
{
...
@@ -99,8 +119,11 @@ Page({
...
@@ -99,8 +119,11 @@ Page({
this
.
setData
({
this
.
setData
({
orderList
:
this
.
data
.
orderList
.
concat
(
funcList
)
orderList
:
this
.
data
.
orderList
.
concat
(
funcList
)
})
})
that
.
setData
({
isLoading
:
false
})
console
.
log
(
this
.
data
.
orderList
)
}
}
})
})
},
},
...
@@ -162,12 +185,23 @@ Page({
...
@@ -162,12 +185,23 @@ Page({
'orderTypeActive'
:
funcIndex
,
'orderTypeActive'
:
funcIndex
,
'orderPages'
:
1
,
'orderPages'
:
1
,
'orderList'
:
[],
'orderList'
:
[],
'isFinished'
:
false
})
})
this
.
queryOrder
()
this
.
queryOrder
()
},
},
/**
/**
* 去逛逛
* @function
* @param {object} - event
* @returns
*/
onToBuy
:
function
(
event
)
{
this
.
onOrderAgain
(
event
)
},
/**
* 订单状态
* 订单状态
* @function
* @function
* @param {object} - event
* @param {object} - event
...
@@ -175,6 +209,7 @@ Page({
...
@@ -175,6 +209,7 @@ Page({
*/
*/
onSelectionStatus
:
function
(
event
)
{
onSelectionStatus
:
function
(
event
)
{
this
.
setData
({
this
.
setData
({
'isFinished'
:
false
,
'statusActive'
:
Number
(
event
.
currentTarget
.
dataset
.
type
),
'statusActive'
:
Number
(
event
.
currentTarget
.
dataset
.
type
),
'orderPages'
:
1
,
'orderPages'
:
1
,
'orderList'
:
[],
'orderList'
:
[],
...
@@ -379,17 +414,44 @@ Page({
...
@@ -379,17 +414,44 @@ Page({
onOrderEvaluate
:
function
(
event
)
{
onOrderEvaluate
:
function
(
event
)
{
},
},
/**
* 缓存用户信息
* @function
* @param {object} - event
* @returns
*/
setShopInfo
:
function
(
funcShopAppId
,
funcShopType
)
{
// 获取门店基本信息
let
funcShopId
=
App
.
globalData
.
shopId
for
(
let
i
=
0
,
l
=
funcShopId
.
length
;
i
<
l
;
i
++
)
{
if
(
funcShopAppId
===
funcShopId
[
i
].
appId
)
{
let
funcShopInfo
=
{
'id'
:
funcShopId
[
i
].
id
,
'appId'
:
funcShopId
[
i
].
appId
,
'name'
:
funcShopId
[
i
].
title
[
funcShopType
],
'logo'
:
funcShopId
[
i
].
logo
,
'cover'
:
funcShopId
[
i
].
cover
,
'shopType'
:
funcShopType
,
}
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
break
}
}
},
/**
/**
* 订单再次下单
* 订单再次下单
、去逛逛
* @function
* @function
* @param
* @param
* @returns
* @returns
*/
*/
onOrderAgain
:
function
(
event
)
{
onOrderAgain
:
function
(
event
)
{
console
.
log
(
event
,
'onOrderAgain'
);
let
item
=
event
.
currentTarget
.
dataset
.
item
let
commodityType
=
item
.
goodType
let
shopAppId
=
wx
.
getStorageSync
(
'shopInfoBuffer'
)
?
wx
.
getStorageSync
(
'shopInfoBuffer'
).
appId
:
""
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'/pages/commodity/menu-food/menu-food'
,
url
:
`/pages/commodity/menu-food/menu-food?formPage=order&shopAppId=
${
shopAppId
}
&commodityType=
${
commodityType
}
`
,
})
})
},
},
...
@@ -401,6 +463,7 @@ Page({
...
@@ -401,6 +463,7 @@ Page({
* @returns
* @returns
*/
*/
onReachBottom
:
function
()
{
onReachBottom
:
function
()
{
this
.
setData
({
this
.
setData
({
orderPages
:
this
.
data
.
orderPages
+
1
orderPages
:
this
.
data
.
orderPages
+
1
})
})
...
...
pages/mine/order/order.wxml
View file @
d937734e
This diff is collapsed.
Click to expand it.
pages/mine/order/order.wxss
View file @
d937734e
...
@@ -2,6 +2,14 @@ page {
...
@@ -2,6 +2,14 @@ page {
height: 100%;
height: 100%;
}
}
.fixed-tab {
position: fixed;
background: #fff;
top: 176rpx;
z-index: 99;
}
.navigation-order {
.navigation-order {
z-index: 1700;
z-index: 1700;
position: fixed;
position: fixed;
...
@@ -45,7 +53,7 @@ page {
...
@@ -45,7 +53,7 @@ page {
background: rgba(0, 0, 0, .65);
background: rgba(0, 0, 0, .65);
}
}
.order-type-selection
>
view {
.order-type-selection
>
view {
width: 750rpx;
width: 750rpx;
min-height: 240rpx;
min-height: 240rpx;
padding-top: 10rpx;
padding-top: 10rpx;
...
@@ -77,7 +85,9 @@ page {
...
@@ -77,7 +85,9 @@ page {
}
}
.container-order {
.container-order {
margin-top: 170rpx;
/* margin-top: 170rpx; */
margin-top: 288rpx;
}
}
.container {
.container {
...
@@ -124,7 +134,7 @@ page {
...
@@ -124,7 +134,7 @@ page {
background: #FFFFFF;
background: #FFFFFF;
}
}
.order-list-item
>
view {
.order-list-item
>
view {
width: 610rpx;
width: 610rpx;
}
}
...
@@ -242,7 +252,7 @@ page {
...
@@ -242,7 +252,7 @@ page {
margin-top: 56rpx;
margin-top: 56rpx;
}
}
.code-info-qrcode
>
image {
.code-info-qrcode
>
image {
display: block;
display: block;
width: 296rpx;
width: 296rpx;
height: 296rpx;
height: 296rpx;
...
@@ -297,7 +307,34 @@ page {
...
@@ -297,7 +307,34 @@ page {
background: #A9A8A7;
background: #A9A8A7;
}
}
.code-close
>
image {
.code-close
>
image {
width: 48rpx;
width: 48rpx;
height: 48rpx;
height: 48rpx;
}
.empty-cart {
width: 176rpx;
height: 176rpx;
/* background-color: #ccc; */
}
.empty-title {
margin-top: 64rpx;
color: #959DA9;
font-size: 38rpx;
line-height: 52rpx;
}
.empty-btn {
width: 308rpx;
height: 96rpx;
margin-top: 68rpx;
color: #fff;
font-size: 30rpx;
line-height: 96rpx;
text-align: center;
background: #86C5E1;
border-radius: 4rpx;
}
}
\ No newline at end of file
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