Commit d9e99299 by 严立

LL - 活动报名问题

parent 2d31b335
...@@ -67,16 +67,15 @@ Page({ ...@@ -67,16 +67,15 @@ Page({
for (let i = 0, l = funcResponse.length; i < l; i++) { for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = { let funcItem = {
'id': funcResponse[i].id, 'id': funcResponse[i].id,
'cover': funcResponse[i].img 'cover': funcResponse[i].img,
'targetId': funcResponse[i].jumpId, // 跳转目标 id
'targetType': funcResponse[i].jumpColumnId,
} }
funcList.push(funcItem) funcList.push(funcItem)
} }
this.setData({ this.setData({
banner: funcList banner: funcList
}) })
console.log(this.data.banner)
} }
}) })
}, },
...@@ -229,6 +228,54 @@ Page({ ...@@ -229,6 +228,54 @@ Page({
}) })
}, },
/**
* banner 点击
* @function
* @param {object} - event
* @returns
*/
onBanner: function (event) {
let funcItme = event.currentTarget.dataset.item
console.log(funcItme)
if (funcItme.targetId && funcItme.targetType) {
// 0 - 首页,1 - 所有服务,2 - 儿童营地,3 - 海错图,4 - 元养水韵,5 - 儿童营地接待,6 - 拾光花坊, 7 - 商品
switch (funcItme.targetType) {
case 0:
break
case 1:
break
case 2:
break
case 3:
break
case 4:
break
case 5:
break
case 6:
break
case 7:
break
}
}
},
onBuy: function (event) { onBuy: function (event) {
let funcIndex = event.currentTarget.dataset.index let funcIndex = event.currentTarget.dataset.index
let funcItemIndex = event.currentTarget.dataset.itemindex let funcItemIndex = event.currentTarget.dataset.itemindex
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="banner"> <view class="banner">
<swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="eventSwiperChange"> <swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="eventSwiperChange">
<block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{banner}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="bannerClick"> <swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="onBanner">
<image class="banner-swiper-image" src="{{item.cover}}"></image> <image class="banner-swiper-image" src="{{item.cover}}"></image>
</swiper-item> </swiper-item>
</block> </block>
......

1.79 KB | W: | H:

2.02 KB | W: | H:

pages/home/guide/image/icon/point-arrow-active.png
pages/home/guide/image/icon/point-arrow-active.png
pages/home/guide/image/icon/point-arrow-active.png
pages/home/guide/image/icon/point-arrow-active.png
  • 2-up
  • Swipe
  • Onion skin

1.76 KB | W: | H:

1.96 KB | W: | H:

pages/home/guide/image/icon/point-arrow-inactive.png
pages/home/guide/image/icon/point-arrow-inactive.png
pages/home/guide/image/icon/point-arrow-inactive.png
pages/home/guide/image/icon/point-arrow-inactive.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -343,6 +343,8 @@ Page({ ...@@ -343,6 +343,8 @@ Page({
if (funcShoppingCart[i].isActive) funcPayAmount = funcPayAmount + funcShoppingCart[i].priceUnit * funcShoppingCart[i].quantity if (funcShoppingCart[i].isActive) funcPayAmount = funcPayAmount + funcShoppingCart[i].priceUnit * funcShoppingCart[i].quantity
} }
this.setData({ this.setData({
shoppingCartList: funcShoppingCart, shoppingCartList: funcShoppingCart,
payAmount: App.modular.utils.formatAmount(funcPayAmount), payAmount: App.modular.utils.formatAmount(funcPayAmount),
...@@ -458,6 +460,13 @@ Page({ ...@@ -458,6 +460,13 @@ Page({
buyContentTime: funcDate + ' ' + funcTimeBegin + ' - ' + funcTimeEnd buyContentTime: funcDate + ' ' + funcTimeBegin + ' - ' + funcTimeEnd
}) })
} }
// 活动时间显示取范围实现,观影时间显示取选择场次时间
if (this.data.orderType === 6) {
this.setData({
buyContentTime: funcResponse.activeDate + ' ' + funcResponse.activeTime
})
}
} }
}) })
}, },
...@@ -628,22 +637,45 @@ Page({ ...@@ -628,22 +637,45 @@ Page({
clearTimeout(funcTimer) clearTimeout(funcTimer)
}, 100) }, 100)
App.wxRequest({ switch (this.data.orderType) {
url: '/api/v1/commodity/getNotification', case 6:
data: { case 7:
'notificationId': this.data.shoppingCartList[0].notificationId App.wxRequest({
}, url: '/api/v1/activity/getDetail',
success: (response) => { data: { 'id': this.data.shoppingCartList[0].id },
let funcRichText = response.data.particulars success: (response) => {
.replace(/<img/gi, '<img style="max-width:100%;height:auto;display:block" ') let funcResponse = response.data
.replace(/<section/g, '<div') let funcRichText = funcResponse.notice
.replace(/\/section>/g, '\div>') .replace(/<img/gi, '<img style="max-width:100%;height:auto;display:block" ')
.replace(/<section/g, '<div')
.replace(/\/section>/g, '\div>')
this.setData({
noticeDetail: funcRichText
})
}
})
break
this.setData({ default:
noticeDetail: funcRichText App.wxRequest({
}) url: '/api/v1/commodity/getNotification',
} data: {
}) 'notificationId': this.data.shoppingCartList[0].notificationId
},
success: (response) => {
let funcResponse = response.data
let funcRichText = funcResponse.particulars
.replace(/<img/gi, '<img style="max-width:100%;height:auto;display:block" ')
.replace(/<section/g, '<div')
.replace(/\/section>/g, '\div>')
this.setData({
noticeDetail: funcRichText
})
}
})
}
}, },
/** /**
...@@ -703,10 +735,11 @@ Page({ ...@@ -703,10 +735,11 @@ Page({
if (this.data.quantity >= this.data.quantityMax) { if (this.data.quantity >= this.data.quantityMax) {
// 针对不同商品类型订制提示语 // 针对不同商品类型订制提示语
let funcErrorMessage = '' let funcErrorMessage = ''
console.log('logicData.option.type', logicData.option.type)
switch (logicData.option.type) { switch (logicData.option.type) {
case 6: case 6:
case 7: case 7:
if (this.data.quantity > 3) funcErrorMessage = '每个账号最多报名3人' if (this.data.quantity >= 3) funcErrorMessage = '每个账号最多报名3人'
if (this.data.quantity < 3) funcErrorMessage = '没有更多报名名额了' if (this.data.quantity < 3) funcErrorMessage = '没有更多报名名额了'
break break
...@@ -820,6 +853,12 @@ Page({ ...@@ -820,6 +853,12 @@ Page({
} }
}, },
/**
* 商品下单
* @function
* @param
* @returns
*/
paySubmitCommodity: function () { paySubmitCommodity: function () {
// 整合商品数据 // 整合商品数据
let funcCommodity = [] let funcCommodity = []
...@@ -972,6 +1011,12 @@ Page({ ...@@ -972,6 +1011,12 @@ Page({
}) })
}, },
/**
* 活动下单
* @function
* @param
* @returns
*/
paySubmitActivity: function () { paySubmitActivity: function () {
App.wxRequest({ App.wxRequest({
url: '/api/v1/activity/doActivityEnroll', url: '/api/v1/activity/doActivityEnroll',
...@@ -1017,6 +1062,14 @@ Page({ ...@@ -1017,6 +1062,14 @@ Page({
return return
} }
if (/价格不一致/.test(response.data.msg)) {
wx.lin.showToast({
title: response.data.msg,
icon: 'error',
})
return
}
// 库存充足正常下单支付 // 库存充足正常下单支付
let funcResponse = response.data let funcResponse = response.data
pagePayId = funcResponse.orderId pagePayId = funcResponse.orderId
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<text>{{buyContentTime}}</text> <text>{{buyContentTime}}</text>
</view> </view>
<view class="amount row align-e"> <view class="amount row align-e">
<text>免费</text> <text>{{'¥' + buyContentAmount}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -178,11 +178,13 @@ ...@@ -178,11 +178,13 @@
</view> </view>
<view class="entry-input row con-b align-c"> <view class="entry-input row con-b align-c">
<l-button l-class="input-button input-cut" special="{{true}}" bind:lintap="onQuantityCut"> <l-button l-class="input-button input-cut" special="{{true}}" bind:lintap="onQuantityCut">
<image class="input-icon" src="{{imageBase + 'cut.png'}}"></image> <image wx:if="{{1 < quantity}}" class="input-icon" src="{{imageBase + 'icon/cut-1.png'}}"></image>
<image wx:if="{{1 === quantity}}" class="input-icon" src="{{imageBase + 'icon/cut-2.png'}}"></image>
</l-button> </l-button>
<text class="text" style="{{formQuantity === 0 ? 'color: #C2C7CF' : 'color: #15191F'}}">{{quantity}}</text> <text class="text" style="{{formQuantity === 0 ? 'color: #C2C7CF' : 'color: #15191F'}}">{{quantity}}</text>
<l-button l-class="input-button input-add" special="{{true}}" bind:lintap="onQuantityAdd"> <l-button l-class="input-button input-add" special="{{true}}" bind:lintap="onQuantityAdd">
<image class="input-icon" src="{{imageBase + 'add.png'}}"></image> <image wx:if="{{quantity < quantityMax}}" class="input-icon" src="{{imageBase + 'icon/add-1.png'}}"></image>
<image wx:if="{{quantity === quantityMax || quantityMax === 0}}" class="input-icon" src="{{imageBase + 'icon/add-2.png'}}"></image>
</l-button> </l-button>
</view> </view>
<view class="quantity-other row con-b align-c"> <view class="quantity-other row con-b align-c">
...@@ -209,7 +211,7 @@ ...@@ -209,7 +211,7 @@
<text class="text" style="{{formQuantity === 0 ? 'color: #C2C7CF' : 'color: #15191F'}}">{{quantity}}</text> <text class="text" style="{{formQuantity === 0 ? 'color: #C2C7CF' : 'color: #15191F'}}">{{quantity}}</text>
<l-button l-class="input-button input-add" special="{{true}}" bind:lintap="onQuantityAdd"> <l-button l-class="input-button input-add" special="{{true}}" bind:lintap="onQuantityAdd">
<image wx:if="{{quantity < quantityMax}}" class="input-icon" src="{{imageBase + 'icon/add-1.png'}}"></image> <image wx:if="{{quantity < quantityMax}}" class="input-icon" src="{{imageBase + 'icon/add-1.png'}}"></image>
<image wx:if="{{quantity === quantityMax}}" class="input-icon" src="{{imageBase + 'icon/add-2.png'}}"></image> <image wx:if="{{quantity === quantityMax || quantityMax === 0}}" class="input-icon" src="{{imageBase + 'icon/add-2.png'}}"></image>
</l-button> </l-button>
</view> </view>
<view class="quantity-other row con-b align-c"> <view class="quantity-other row con-b align-c">
...@@ -231,12 +233,12 @@ ...@@ -231,12 +233,12 @@
</view> </view>
<view class="contact-input col"> <view class="contact-input col">
<text class="contact-input-mark">姓名</text> <text class="contact-input-mark">姓名</text>
<input placeholder="请输入姓名" data-type="name" data-index="{{0}}" bindblur="onInputBlur"></input> <input placeholder="请输入姓名" value="{{registerInfo[0].name}}" data-type="name" data-index="{{0}}" bindblur="onInputBlur"></input>
<text>{{registerInfo[0].errorName}}</text> <text>{{registerInfo[0].errorName}}</text>
</view> </view>
<view class="contact-input col"> <view class="contact-input col">
<text>手机号</text> <text>手机号</text>
<input placeholder="请输入手机号" maxlength="11" type="number" data-type="phone" data-index="{{0}}" bindblur="onInputBlur"></input> <input placeholder="请输入手机号" value="{{registerInfo[0].phone}}" maxlength="11" type="number" data-type="phone" data-index="{{0}}" bindblur="onInputBlur"></input>
<text>{{registerInfo[0].errorPhone}}</text> <text>{{registerInfo[0].errorPhone}}</text>
</view> </view>
</view> </view>
...@@ -257,17 +259,17 @@ ...@@ -257,17 +259,17 @@
</view> </view>
<view class="contact-input col"> <view class="contact-input col">
<text class="contact-input-mark">姓名</text> <text class="contact-input-mark">姓名</text>
<input placeholder="请输入姓名" data-type="name" data-index="{{index}}" bindblur="onInputBlur"></input> <input placeholder="请输入姓名" value="{{item.name}}" data-type="name" data-index="{{index}}" bindblur="onInputBlur"></input>
<text>{{item.errorName}}</text> <text>{{item.errorName}}</text>
</view> </view>
<view class="contact-input col"> <view class="contact-input col">
<text>手机号</text> <text>手机号</text>
<input placeholder="请输入手机号" maxlength="11" type="number" data-type="phone" data-index="{{index}}" bindblur="onInputBlur"></input> <input placeholder="请输入手机号" value="{{item.phone}}" maxlength="11" type="number" data-type="phone" data-index="{{index}}" bindblur="onInputBlur"></input>
<text>{{item.errorPhone}}</text> <text>{{item.errorPhone}}</text>
</view> </view>
<view class="contact-input col"> <view class="contact-input col">
<text>身份证号</text> <text>身份证号</text>
<input placeholder="请输入身份证号" data-type="identity" data-index="{{index}}" bindblur="onInputBlur"></input> <input placeholder="请输入身份证号" value="{{item.identity}}" data-type="identity" data-index="{{index}}" bindblur="onInputBlur"></input>
<text>{{item.errorIdentity}}</text> <text>{{item.errorIdentity}}</text>
</view> </view>
</block> </block>
......
...@@ -151,8 +151,6 @@ Page({ ...@@ -151,8 +151,6 @@ Page({
}, },
// 跳转到报名页面 // 跳转到报名页面
onReportMovie: function (event) { onReportMovie: function (event) {
console.log(event.currentTarget.dataset.item.filmId)
let funcMovieInfo = { let funcMovieInfo = {
'id': this.data.movieInfo.activityId, // 活动 id 'id': this.data.movieInfo.activityId, // 活动 id
'name': this.data.movieInfo.filmName, // 电影名称 'name': this.data.movieInfo.filmName, // 电影名称
...@@ -169,7 +167,8 @@ Page({ ...@@ -169,7 +167,8 @@ Page({
'quantity': 1, 'quantity': 1,
'quantityMin': 1, 'quantityMin': 1,
'quantityMax': 3 'quantityMax': 3,
'isActive': true,
} }
let funcUserType = wx.getStorageSync('userInfo').userType let funcUserType = wx.getStorageSync('userInfo').userType
......
...@@ -227,9 +227,6 @@ Page({ ...@@ -227,9 +227,6 @@ Page({
// 跳转到报名页面 // 跳转到报名页面
onReportMovie: function (event) { onReportMovie: function (event) {
let funcItem = event.currentTarget.dataset.item let funcItem = event.currentTarget.dataset.item
console.log(funcItem)
let funcMovieInfo = { let funcMovieInfo = {
'id': funcItem.activityId, // 活动 id 'id': funcItem.activityId, // 活动 id
'name': funcItem.filmName, // 电影名称 'name': funcItem.filmName, // 电影名称
...@@ -246,7 +243,8 @@ Page({ ...@@ -246,7 +243,8 @@ Page({
'quantity': 1, 'quantity': 1,
'quantityMin': 1, 'quantityMin': 1,
'quantityMax': 3 'quantityMax': 3,
'isActive': true,
} }
let funcUserType = wx.getStorageSync('userInfo').userType let funcUserType = wx.getStorageSync('userInfo').userType
...@@ -264,7 +262,6 @@ Page({ ...@@ -264,7 +262,6 @@ Page({
} }
wx.setStorageSync('shoppingCartBuffer', [funcMovieInfo]) wx.setStorageSync('shoppingCartBuffer', [funcMovieInfo])
wx.navigateTo({ wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=7', url: '/pages/pay/order-input/order-input?type=7',
}) })
......
...@@ -7,6 +7,7 @@ Page({ ...@@ -7,6 +7,7 @@ Page({
banner: [], banner: [],
serviceInfo: {} serviceInfo: {}
}, },
onLoad: function (options) { onLoad: function (options) {
this.queryCommodityDetail() this.queryCommodityDetail()
}, },
...@@ -34,10 +35,7 @@ Page({ ...@@ -34,10 +35,7 @@ Page({
}, },
queryCommodityDetail: function () { queryCommodityDetail: function () {
let funcCommodity = wx.getStorageSync('shoppingCartBuffer')[0] let funcCommodity = wx.getStorageSync('shoppingCartBuffer')[0]
console.log('queryCommodityDetail', funcCommodity)
App.wxRequest({ App.wxRequest({
url: '/api/v1/commodity/getCommodityParticulars', url: '/api/v1/commodity/getCommodityParticulars',
data: { data: {
...@@ -46,13 +44,14 @@ Page({ ...@@ -46,13 +44,14 @@ Page({
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
let funcItem = { let funcItem = {
'id': funcResponse.id, // 商品标识
'typeId': funcResponse.genre, // 商品分类标识
'inventoriesId': funcResponse.inventoriesId, // 仓库标识
'dateValid': '', // 有效时间
'dateInvalid': '', // 失效时间
'name': funcResponse.name, 'name': funcResponse.name,
'time': funcResponse.spaMins ? funcResponse.spaMins + 'mins' : '', 'cover': funcResponse.ticketsImg, // 商品封面
'address': '元养水韵SPA',
'content': funcResponse.particulars,
'price': funcResponse.sightseerPrice, // 普通价 'price': funcResponse.sightseerPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse.sightseerPrice), // 普通价文本格式 'priceText': App.modular.utils.formatAmount(funcResponse.sightseerPrice), // 普通价文本格式
'priceSpecial': funcResponse.ownerPrice, // 业主价 'priceSpecial': funcResponse.ownerPrice, // 业主价
...@@ -60,6 +59,17 @@ Page({ ...@@ -60,6 +59,17 @@ Page({
'priceDiscount': funcResponse.price, // 活动价 'priceDiscount': funcResponse.price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse.price), // 活动价文本格式 'priceDiscountText': App.modular.utils.formatAmount(funcResponse.price), // 活动价文本格式
'priceType': 1, 'priceType': 1,
'quantity': 1,
'quantityMin': 1,
'quantityMax': funcResponse.number < 20 ? funcResponse.number : 20, // 最大上限 20 件
'isActive': true,
'notificationId': funcResponse.notificationId, // 下单须知
'time': funcResponse.spaMins ? funcResponse.spaMins + 'mins' : '',
'address': '元养水韵SPA',
'content': funcResponse.particulars,
} }
let funcUserType = wx.getStorageSync('userInfo').userType let funcUserType = wx.getStorageSync('userInfo').userType
......
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