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
db58af97
authored
Sep 21, 2020
by
严立
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
LL - 活动预约
parent
2ad473a2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
140 additions
and
39 deletions
pages/commodity/home/home.js
pages/commodity/menu-food/menu-food.js
pages/pay/order-input/order-input.js
pages/pay/order-input/order-input.wxml
pages/play/activity-detail/activity-detail.js
pages/play/activity/activity.wxss
pages/play/strategy-detail/strategy-detail.js
pages/play/strategy-detail/strategy-detail.wxml
pages/commodity/home/home.js
View file @
db58af97
...
...
@@ -160,6 +160,8 @@ Page({
'officeId'
:
funcShopInfo
[
0
].
shopId
,
'genre'
:
5
,
'tag'
:
'202'
,
'pageNo'
:
1
,
'pageSize'
:
4
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
...
...
@@ -187,6 +189,8 @@ Page({
'officeId'
:
funcShopInfo
[
1
].
shopId
,
'genre'
:
5
,
'tag'
:
'202'
,
'pageNo'
:
1
,
'pageSize'
:
4
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
...
...
@@ -214,6 +218,8 @@ Page({
'officeId'
:
funcShopInfo
[
2
].
shopId
,
'genre'
:
4
,
'tag'
:
'202'
,
'pageNo'
:
1
,
'pageSize'
:
4
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
...
...
@@ -241,6 +247,8 @@ Page({
'officeId'
:
funcShopInfo
[
3
].
shopId
,
'genre'
:
4
,
'tag'
:
'202'
,
'pageNo'
:
1
,
'pageSize'
:
4
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
...
...
pages/commodity/menu-food/menu-food.js
View file @
db58af97
...
...
@@ -219,7 +219,7 @@ Page({
'id'
:
funcResponse
[
i
].
id
,
// 商品标识
'typeId'
:
funcResponse
[
i
].
genre
,
// 商品分类标识
'inventoriesId'
:
funcResponse
[
i
].
inventoriesId
,
// 仓库标识
'sideBarId'
:
''
,
'sideBarId'
:
funcResponse
[
i
].
classifyId
,
// 商品标签
'name'
:
funcResponse
[
i
].
name
,
'cover'
:
funcResponse
[
i
].
coverImg
,
// 商品封面
'price'
:
funcResponse
[
i
].
sightseerPrice
,
// 普通价
...
...
pages/pay/order-input/order-input.js
View file @
db58af97
...
...
@@ -42,10 +42,14 @@ Page({
noticeText
:
'购买须知'
,
// 预约选择组件属性
entryDate
:
''
,
entryStartDate
:
''
,
entryEndDate
:
''
,
// 预约时间选择组件
entryId
:
''
,
entryDate
:
[],
// 数据对象
entrySelection
:
''
,
// 当前选择
entryDateList
:
[],
// 日期数组
entryTimeList
:
[],
// 时间数组
entryDateIndex
:
0
,
// 时间选择索引
// 数量选择组件属性
quantityTitle
:
''
,
...
...
@@ -240,7 +244,6 @@ Page({
winButtonPay
:
true
,
// 立即支付
winButtonAppointment
:
false
,
// 确认预约
})
this
.
setStock
()
this
.
setEntryTime
()
break
...
...
@@ -309,7 +312,6 @@ Page({
setShoppingCartData
:
function
()
{
// 读取上级页面的购物车数据,默认选中所有。
let
funcShoppingCart
=
wx
.
getStorageSync
(
'shoppingCartBuffer'
)
console
.
log
(
JSON
.
stringify
(
funcShoppingCart
))
// 设置商品单位价格
let
funcPriceUnit
=
0
...
...
@@ -379,39 +381,100 @@ Page({
})
},
/**
* 设置活动场次时间
* @function
* @param
* @returns
*/
setEntryTime
:
function
()
{
let
funcItem
=
wx
.
getStorageSync
(
'shoppingCartBuffer'
)[
0
]
App
.
wxRequest
({
url
:
'/api/v1/activity/getEnrollView'
,
data
:
{
id
:
this
.
data
.
shoppingCartList
[
0
].
id
'id'
:
funcItem
.
id
,
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
if
(
funcResponse
.
activityTimes
.
length
>
0
)
{
var
activityTimes
=
[]
var
pickerList
=
[]
funcResponse
.
activityTimes
.
forEach
(
item
=>
{
var
obj
=
item
obj
.
date
=
item
.
beginTime
+
' - '
+
item
.
endTime
activityTimes
.
push
(
obj
)
pickerList
.
push
(
obj
.
date
)
})
this
.
setData
({
activityTimes
:
activityTimes
,
listData
:
[
pickerList
],
})
console
.
log
(
funcResponse
)
let
funcTimetable
=
funcResponse
.
activityTimes
let
funcDate
=
[]
let
funcDateList
=
[]
let
funcTimeList
=
[]
let
funcListIndex
=
-
1
let
funcActiveTime
=
''
for
(
let
i
=
0
,
l
=
funcTimetable
.
length
;
i
<
l
;
i
++
)
{
let
funcDateString
=
App
.
modular
.
miment
(
funcTimetable
[
i
].
beginTime
).
format
(
'YYYY-MM-DD'
)
let
funcTimeString
=
App
.
modular
.
miment
(
funcTimetable
[
i
].
beginTime
).
format
(
'hh:mm:ss'
)
if
(
funcActiveTime
===
funcDateString
)
{
// 渲染数组
funcTimeList
[
funcListIndex
].
push
(
funcTimeString
)
// 映射数据
funcDate
[
funcListIndex
].
push
(
funcTimetable
[
i
])
}
else
{
// 渲染数据
funcActiveTime
=
funcDateString
funcListIndex
=
funcListIndex
+
1
funcDateList
.
push
(
funcDateString
)
funcTimeList
[
funcListIndex
]
=
[
funcTimeString
]
// 映射数据
funcDate
[
funcListIndex
]
=
[
funcTimetable
[
i
]]
}
}
console
.
log
(
activityTimes
)
this
.
setData
({
buyContentTitle
:
funcResponse
.
name
,
entryDate
:
funcDate
,
entrySelection
:
funcDateList
[
0
]
+
' '
+
funcTimeList
[
0
][
0
],
entryDateList
:
[
funcDateList
,
funcTimeList
[
0
]],
entryTimeList
:
funcTimeList
,
quantityTipNumber
:
funcDate
[
0
][
0
].
residue
})
}
})
},
/**
* 选择数值事件
* @function
* @param
* @returns
*/
onEntryTime
:
function
(
event
)
{
let
funcIndex
=
event
.
detail
.
value
this
.
setData
({
entrySelection
:
this
.
data
.
entryDateList
[
0
][
funcIndex
[
0
]]
+
' '
+
this
.
data
.
entryTimeList
[
this
.
data
.
entryDateIndex
][
funcIndex
[
1
]],
entryId
:
this
.
data
.
entryDate
[
funcIndex
[
0
]][
funcIndex
[
1
]].
id
,
quantityTipNumber
:
this
.
data
.
entryDate
[
funcIndex
[
0
]][
funcIndex
[
1
]].
residue
})
},
/**
* 选择滚动事件
* @function
* @param
* @returns
*/
onEntryTimeChange
:
function
(
event
)
{
console
.
log
(
event
.
detail
)
let
funcColumn
=
event
.
detail
.
column
let
funcIndex
=
event
.
detail
.
value
let
funcDateList
=
this
.
data
.
entryDateList
funcDateList
[
1
]
=
this
.
data
.
entryTimeList
[
funcIndex
]
if
(
funcColumn
===
0
)
{
this
.
setData
({
entryDateList
:
funcDateList
,
entryDateIndex
:
funcIndex
,
})
}
},
/**
* 同步库存信息
* @function
* @param
...
...
@@ -729,8 +792,8 @@ Page({
App
.
wxRequest
({
url
:
'/api/v1/order/doOrder'
,
data
:
{
'isPayment'
:
2
,
'totalMoney'
:
Number
(
this
.
data
.
payAmount
)
+
100
,
'isPayment'
:
Number
(
this
.
data
.
payAmount
)
===
0
?
0
:
2
,
'totalMoney'
:
Number
(
this
.
data
.
payAmount
),
'office'
:
{
'id'
:
this
.
data
.
shopInfo
.
id
},
'smOrderDetails'
:
funcCommodity
,
'smPersonalDetails'
:
funcUserInfo
,
...
...
pages/pay/order-input/order-input.wxml
View file @
db58af97
...
...
@@ -167,8 +167,8 @@
<text>报名时间</text>
</view>
<view class="entry-input row con-b align-c">
<picker class="row con-b align-c" mode="
date" value="{{entryDate}}" start="{{entryStartDate}}" end="{{entryEndDate}}" bindchange="onSelectionDat
e">
<text>{{
'2020-20-20'
}}</text>
<picker class="row con-b align-c" mode="
multiSelector" value="{{entryDate}}" range="{{entryDateList}}" bindcolumnchange="onEntryTimeChange" bindchange="onEntryTim
e">
<text>{{
entrySelection
}}</text>
</picker>
<image class="input-icon" src="{{imageBase + 'more.png'}}"></image>
</view>
...
...
pages/play/activity-detail/activity-detail.js
View file @
db58af97
...
...
@@ -76,6 +76,8 @@ Page({
'quantityMin'
:
1
,
'quantityMax'
:
1
,
'isActive'
:
true
,
'activityTimetable'
:
funcResponse
.
activityTimes
,
// 场次库存信息
}
let
funcUserType
=
wx
.
getStorageSync
(
'userInfo'
).
userType
...
...
pages/play/activity/activity.wxss
View file @
db58af97
...
...
@@ -5,6 +5,7 @@
}
.container {
min-height: 100%;
margin-top: 120rpx;
background: linear-gradient(#ffffff, #F2F2F2);
}
...
...
pages/play/strategy-detail/strategy-detail.js
View file @
db58af97
const
App
=
getApp
()
let
logicData
=
{
pageScrollLock
:
false
,
pageScrollTimer
:
0
,
}
const
App
=
getApp
()
Page
({
data
:
{
// 导航栏相关属性
navigationStyle
:
{
normal
:
{
backIcon
:
'/image/back-w.png'
,
color
:
'#FFFFFF'
,
background
:
'rgba(255, 255, 255, 0)'
},
change
:
{
backIcon
:
'/image/back.png'
,
color
:
'#000000'
,
background
:
'rgba(255, 255, 255, 1)'
},
scroll
:
'750rpx'
,
},
navigationScroll
:
0
,
isNavigationWhite
:
false
,
banner
:
[],
bannerIndex
:
0
,
title
:
''
,
...
...
@@ -133,6 +152,22 @@ Page({
}
},
onPageScroll
:
function
(
funcEvent
)
{
// 优化滚动事件触发频率
if
(
logicData
.
pageScrollLock
)
return
logicData
.
pageScrollLock
=
true
this
.
setData
({
navigationScroll
:
funcEvent
.
scrollTop
})
// 恢复滚动事件
logicData
.
pageScrollTimer
=
setTimeout
(
function
()
{
logicData
.
pageScrollLock
=
false
clearTimeout
(
logicData
.
pageScrollTimer
)
},
10
)
},
/**
* banner 变换事件
* @function
...
...
pages/play/strategy-detail/strategy-detail.wxml
View file @
db58af97
<!-- 首页 - 游客攻略 -->
<navigation
class="navigation"
titleText="攻略详情"
color="{{isNavigationWhite ? '#000000' : '#ffffff'}}"
background="{{isNavigationWhite ? '#ffffff' : 'rgba(0, 0, 0, 0)'}}"
backIcon="{{isNavigationWhite ? '/image/back.png' : '/image/back-w.png'}}"
>
</navigation>
<navigation class="navigation" titleText="攻略详情" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<view class="container">
<view id="banner" class="banner">
...
...
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