Commit d9e99299 by 严立

LL - 活动报名问题

parent 2d31b335
......@@ -67,16 +67,15 @@ Page({
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].id,
'cover': funcResponse[i].img
'cover': funcResponse[i].img,
'targetId': funcResponse[i].jumpId, // 跳转目标 id
'targetType': funcResponse[i].jumpColumnId,
}
funcList.push(funcItem)
}
this.setData({
banner: funcList
})
console.log(this.data.banner)
}
})
},
......@@ -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) {
let funcIndex = event.currentTarget.dataset.index
let funcItemIndex = event.currentTarget.dataset.itemindex
......
......@@ -4,7 +4,7 @@
<view class="banner">
<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">
<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>
</swiper-item>
</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({
if (funcShoppingCart[i].isActive) funcPayAmount = funcPayAmount + funcShoppingCart[i].priceUnit * funcShoppingCart[i].quantity
}
this.setData({
shoppingCartList: funcShoppingCart,
payAmount: App.modular.utils.formatAmount(funcPayAmount),
......@@ -458,6 +460,13 @@ Page({
buyContentTime: funcDate + ' ' + funcTimeBegin + ' - ' + funcTimeEnd
})
}
// 活动时间显示取范围实现,观影时间显示取选择场次时间
if (this.data.orderType === 6) {
this.setData({
buyContentTime: funcResponse.activeDate + ' ' + funcResponse.activeTime
})
}
}
})
},
......@@ -628,13 +637,35 @@ Page({
clearTimeout(funcTimer)
}, 100)
switch (this.data.orderType) {
case 6:
case 7:
App.wxRequest({
url: '/api/v1/activity/getDetail',
data: { 'id': this.data.shoppingCartList[0].id },
success: (response) => {
let funcResponse = response.data
let funcRichText = funcResponse.notice
.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
default:
App.wxRequest({
url: '/api/v1/commodity/getNotification',
data: {
'notificationId': this.data.shoppingCartList[0].notificationId
},
success: (response) => {
let funcRichText = response.data.particulars
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>')
......@@ -644,6 +675,7 @@ Page({
})
}
})
}
},
/**
......@@ -703,10 +735,11 @@ Page({
if (this.data.quantity >= this.data.quantityMax) {
// 针对不同商品类型订制提示语
let funcErrorMessage = ''
console.log('logicData.option.type', logicData.option.type)
switch (logicData.option.type) {
case 6:
case 7:
if (this.data.quantity > 3) funcErrorMessage = '每个账号最多报名3人'
if (this.data.quantity >= 3) funcErrorMessage = '每个账号最多报名3人'
if (this.data.quantity < 3) funcErrorMessage = '没有更多报名名额了'
break
......@@ -820,6 +853,12 @@ Page({
}
},
/**
* 商品下单
* @function
* @param
* @returns
*/
paySubmitCommodity: function () {
// 整合商品数据
let funcCommodity = []
......@@ -972,6 +1011,12 @@ Page({
})
},
/**
* 活动下单
* @function
* @param
* @returns
*/
paySubmitActivity: function () {
App.wxRequest({
url: '/api/v1/activity/doActivityEnroll',
......@@ -1017,6 +1062,14 @@ Page({
return
}
if (/价格不一致/.test(response.data.msg)) {
wx.lin.showToast({
title: response.data.msg,
icon: 'error',
})
return
}
// 库存充足正常下单支付
let funcResponse = response.data
pagePayId = funcResponse.orderId
......
......@@ -119,7 +119,7 @@
<text>{{buyContentTime}}</text>
</view>
<view class="amount row align-e">
<text>免费</text>
<text>{{'¥' + buyContentAmount}}</text>
</view>
</view>
</view>
......@@ -178,11 +178,13 @@
</view>
<view class="entry-input row con-b align-c">
<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>
<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">
<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>
</view>
<view class="quantity-other row con-b align-c">
......@@ -209,7 +211,7 @@
<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">
<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>
</view>
<view class="quantity-other row con-b align-c">
......@@ -231,12 +233,12 @@
</view>
<view class="contact-input col">
<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>
</view>
<view class="contact-input col">
<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>
</view>
</view>
......@@ -257,17 +259,17 @@
</view>
<view class="contact-input col">
<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>
</view>
<view class="contact-input col">
<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>
</view>
<view class="contact-input col">
<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>
</view>
</block>
......
......@@ -151,8 +151,6 @@ Page({
},
// 跳转到报名页面
onReportMovie: function (event) {
console.log(event.currentTarget.dataset.item.filmId)
let funcMovieInfo = {
'id': this.data.movieInfo.activityId, // 活动 id
'name': this.data.movieInfo.filmName, // 电影名称
......@@ -169,7 +167,8 @@ Page({
'quantity': 1,
'quantityMin': 1,
'quantityMax': 3
'quantityMax': 3,
'isActive': true,
}
let funcUserType = wx.getStorageSync('userInfo').userType
......
......@@ -227,9 +227,6 @@ Page({
// 跳转到报名页面
onReportMovie: function (event) {
let funcItem = event.currentTarget.dataset.item
console.log(funcItem)
let funcMovieInfo = {
'id': funcItem.activityId, // 活动 id
'name': funcItem.filmName, // 电影名称
......@@ -246,7 +243,8 @@ Page({
'quantity': 1,
'quantityMin': 1,
'quantityMax': 3
'quantityMax': 3,
'isActive': true,
}
let funcUserType = wx.getStorageSync('userInfo').userType
......@@ -264,7 +262,6 @@ Page({
}
wx.setStorageSync('shoppingCartBuffer', [funcMovieInfo])
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=7',
})
......
......@@ -7,6 +7,7 @@ Page({
banner: [],
serviceInfo: {}
},
onLoad: function (options) {
this.queryCommodityDetail()
},
......@@ -34,10 +35,7 @@ Page({
},
queryCommodityDetail: function () {
let funcCommodity = wx.getStorageSync('shoppingCartBuffer')[0]
console.log('queryCommodityDetail', funcCommodity)
App.wxRequest({
url: '/api/v1/commodity/getCommodityParticulars',
data: {
......@@ -46,13 +44,14 @@ Page({
},
success: (response) => {
let funcResponse = response.data
let funcItem = {
'id': funcResponse.id, // 商品标识
'typeId': funcResponse.genre, // 商品分类标识
'inventoriesId': funcResponse.inventoriesId, // 仓库标识
'dateValid': '', // 有效时间
'dateInvalid': '', // 失效时间
'name': funcResponse.name,
'time': funcResponse.spaMins ? funcResponse.spaMins + 'mins' : '',
'address': '元养水韵SPA',
'content': funcResponse.particulars,
'cover': funcResponse.ticketsImg, // 商品封面
'price': funcResponse.sightseerPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse.sightseerPrice), // 普通价文本格式
'priceSpecial': funcResponse.ownerPrice, // 业主价
......@@ -60,6 +59,17 @@ Page({
'priceDiscount': funcResponse.price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse.price), // 活动价文本格式
'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
......
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