Commit db58af97 by 严立

LL - 活动预约

parent 2ad473a2
...@@ -160,6 +160,8 @@ Page({ ...@@ -160,6 +160,8 @@ Page({
'officeId': funcShopInfo[0].shopId, 'officeId': funcShopInfo[0].shopId,
'genre': 5, 'genre': 5,
'tag': '202', 'tag': '202',
'pageNo': 1,
'pageSize': 4
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
...@@ -187,6 +189,8 @@ Page({ ...@@ -187,6 +189,8 @@ Page({
'officeId': funcShopInfo[1].shopId, 'officeId': funcShopInfo[1].shopId,
'genre': 5, 'genre': 5,
'tag': '202', 'tag': '202',
'pageNo': 1,
'pageSize': 4
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
...@@ -214,6 +218,8 @@ Page({ ...@@ -214,6 +218,8 @@ Page({
'officeId': funcShopInfo[2].shopId, 'officeId': funcShopInfo[2].shopId,
'genre': 4, 'genre': 4,
'tag': '202', 'tag': '202',
'pageNo': 1,
'pageSize': 4
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
...@@ -241,6 +247,8 @@ Page({ ...@@ -241,6 +247,8 @@ Page({
'officeId': funcShopInfo[3].shopId, 'officeId': funcShopInfo[3].shopId,
'genre': 4, 'genre': 4,
'tag': '202', 'tag': '202',
'pageNo': 1,
'pageSize': 4
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
......
...@@ -219,7 +219,7 @@ Page({ ...@@ -219,7 +219,7 @@ Page({
'id': funcResponse[i].id, // 商品标识 'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].genre, // 商品分类标识 'typeId': funcResponse[i].genre, // 商品分类标识
'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识 'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识
'sideBarId': '', 'sideBarId': funcResponse[i].classifyId, // 商品标签
'name': funcResponse[i].name, 'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面 'cover': funcResponse[i].coverImg, // 商品封面
'price': funcResponse[i].sightseerPrice, // 普通价 'price': funcResponse[i].sightseerPrice, // 普通价
......
...@@ -42,10 +42,14 @@ Page({ ...@@ -42,10 +42,14 @@ Page({
noticeText: '购买须知', noticeText: '购买须知',
// 预约选择组件属性 // 预约时间选择组件
entryDate: '', entryId: '',
entryStartDate: '', entryDate: [], // 数据对象
entryEndDate: '', entrySelection: '', // 当前选择
entryDateList: [], // 日期数组
entryTimeList: [], // 时间数组
entryDateIndex: 0, // 时间选择索引
// 数量选择组件属性 // 数量选择组件属性
quantityTitle: '', quantityTitle: '',
...@@ -240,7 +244,6 @@ Page({ ...@@ -240,7 +244,6 @@ Page({
winButtonPay: true, // 立即支付 winButtonPay: true, // 立即支付
winButtonAppointment: false, // 确认预约 winButtonAppointment: false, // 确认预约
}) })
this.setStock()
this.setEntryTime() this.setEntryTime()
break break
...@@ -309,7 +312,6 @@ Page({ ...@@ -309,7 +312,6 @@ Page({
setShoppingCartData: function () { setShoppingCartData: function () {
// 读取上级页面的购物车数据,默认选中所有。 // 读取上级页面的购物车数据,默认选中所有。
let funcShoppingCart = wx.getStorageSync('shoppingCartBuffer') let funcShoppingCart = wx.getStorageSync('shoppingCartBuffer')
console.log(JSON.stringify(funcShoppingCart))
// 设置商品单位价格 // 设置商品单位价格
let funcPriceUnit = 0 let funcPriceUnit = 0
...@@ -379,36 +381,97 @@ Page({ ...@@ -379,36 +381,97 @@ Page({
}) })
}, },
/**
* 设置活动场次时间
* @function
* @param
* @returns
*/
setEntryTime: function () { setEntryTime: function () {
let funcItem = wx.getStorageSync('shoppingCartBuffer')[0]
App.wxRequest({ App.wxRequest({
url: '/api/v1/activity/getEnrollView', url: '/api/v1/activity/getEnrollView',
data: { data: {
id: this.data.shoppingCartList[0].id 'id': funcItem.id,
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
if (funcResponse.activityTimes.length > 0) { console.log(funcResponse)
var activityTimes = [] let funcTimetable = funcResponse.activityTimes
var pickerList = []
funcResponse.activityTimes.forEach(item => { let funcDate = []
var obj = item let funcDateList = []
obj.date = item.beginTime + ' - ' + item.endTime let funcTimeList = []
activityTimes.push(obj) let funcListIndex = -1
pickerList.push(obj.date) 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]]
}
}
this.setData({ this.setData({
activityTimes: activityTimes, entryDate: funcDate,
listData: [pickerList], entrySelection: funcDateList[0] + ' ' + funcTimeList[0][0],
entryDateList: [funcDateList, funcTimeList[0]],
entryTimeList: funcTimeList,
quantityTipNumber: funcDate[0][0].residue
}) })
} }
})
},
console.log(activityTimes) /**
* 选择数值事件
* @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({ this.setData({
buyContentTitle: funcResponse.name, entryDateList: funcDateList,
entryDateIndex: funcIndex,
}) })
} }
})
}, },
/** /**
...@@ -729,8 +792,8 @@ Page({ ...@@ -729,8 +792,8 @@ Page({
App.wxRequest({ App.wxRequest({
url: '/api/v1/order/doOrder', url: '/api/v1/order/doOrder',
data: { data: {
'isPayment': 2, 'isPayment': Number(this.data.payAmount) === 0 ? 0 : 2,
'totalMoney': Number(this.data.payAmount) + 100, 'totalMoney': Number(this.data.payAmount),
'office': { 'id': this.data.shopInfo.id }, 'office': { 'id': this.data.shopInfo.id },
'smOrderDetails': funcCommodity, 'smOrderDetails': funcCommodity,
'smPersonalDetails': funcUserInfo, 'smPersonalDetails': funcUserInfo,
......
...@@ -167,8 +167,8 @@ ...@@ -167,8 +167,8 @@
<text>报名时间</text> <text>报名时间</text>
</view> </view>
<view class="entry-input row con-b align-c"> <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="onSelectionDate"> <picker class="row con-b align-c" mode="multiSelector" value="{{entryDate}}" range="{{entryDateList}}" bindcolumnchange="onEntryTimeChange" bindchange="onEntryTime">
<text>{{'2020-20-20'}}</text> <text>{{entrySelection}}</text>
</picker> </picker>
<image class="input-icon" src="{{imageBase + 'more.png'}}"></image> <image class="input-icon" src="{{imageBase + 'more.png'}}"></image>
</view> </view>
......
...@@ -76,6 +76,8 @@ Page({ ...@@ -76,6 +76,8 @@ Page({
'quantityMin': 1, 'quantityMin': 1,
'quantityMax': 1, 'quantityMax': 1,
'isActive': true, 'isActive': true,
'activityTimetable': funcResponse.activityTimes, // 场次库存信息
} }
let funcUserType = wx.getStorageSync('userInfo').userType let funcUserType = wx.getStorageSync('userInfo').userType
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
} }
.container { .container {
min-height: 100%;
margin-top: 120rpx; margin-top: 120rpx;
background: linear-gradient(#ffffff, #F2F2F2); background: linear-gradient(#ffffff, #F2F2F2);
} }
......
const App = getApp()
let logicData = { let logicData = {
pageScrollLock: false, pageScrollLock: false,
pageScrollTimer: 0, pageScrollTimer: 0,
} }
const App = getApp()
Page({ Page({
data: { 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, isNavigationWhite: false,
banner: [], banner: [],
bannerIndex: 0, bannerIndex: 0,
title: '', title: '',
...@@ -133,6 +152,22 @@ Page({ ...@@ -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 变换事件 * banner 变换事件
* @function * @function
......
<!-- 首页 - 游客攻略 --> <navigation class="navigation" titleText="攻略详情" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<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>
<view class="container"> <view class="container">
<view id="banner" class="banner"> <view id="banner" class="banner">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment