Commit 68933f16 by wjw

ww--电影价格,活动报名修改

parent 323a7ed7
......@@ -93,8 +93,9 @@ Page({
funcData.forEach(item => {
let tmpItem = {
id: item.id,
officeId: item.officeId,
cover: item.cover,
title: item.name,
name: item.name,
date: item.activeDate,//'6月30日-7月12日 10:00-12:00',
describe: item.summary,
beginDate: item.activeDate.split('-')[0],
......@@ -186,10 +187,24 @@ Page({
})
},
// 活动报名
onReport: function () {
onReport: function (event) {
let index = event.currentTarget.dataset.index
let selectedActivity = this.data.selectedActivity
selectedActivity[index].quantity = 1
this.setShopInfo(selectedActivity[index].officeId, 2)
wx.setStorageSync('shoppingCartBuffer', [selectedActivity[index]])
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=6'
})
}
},
setShopInfo: function (funcShopId, funcShopType) {
for (let i = 0, l = App.globalData.shopId.length; i < l; i++) {
if (funcShopId === App.globalData.shopId[i].id) {
let funcShopInfo = JSON.parse(JSON.stringify(App.globalData.shopId[i]))
console.log(funcShopInfo.name)
if (funcShopType) funcShopInfo.shopType = funcShopType
wx.setStorageSync('shopInfoBuffer', funcShopInfo)
}
}
},
})
\ No newline at end of file
......@@ -21,7 +21,7 @@
</view>
<view class="item-info col">
<view class="item-title row con-b align-c">
<text>{{item.title}}</text>
<text>{{item.name}}</text>
<text wx:if="{{item.tagNames[0]}}">{{item.tagNames[0]}}</text>
</view>
<view class="item-date row align-c">
......@@ -50,7 +50,7 @@
<text>{{item.price == '0' ? '免费' : item.priceText}}</text>
</view>
<view>
<button class="row con-c align-c" catchtap="onReport" data-id="{{item.id}}">报名</button>
<button class="row con-c align-c" catchtap="onReport" data-index="{{index}}">报名</button>
</view>
</view>
</view>
......
......@@ -120,12 +120,13 @@ Page({
day++
}
})
// console.log(showList)
movieInfo.priceSpecialText = movieInfo.ownerPrice.toFixed(2)
movieInfo.priceText = movieInfo.visitorPrice.toFixed(2)
movieInfo.priceSpecialText = App.modular.utils.formatAmount(movieInfo.ownerPrice), // 业主价文本格式
movieInfo.priceText = App.modular.utils.formatAmount(movieInfo.visitorPrice),
movieInfo.tags = movieInfo.tags.replace(/( )?热映影片( )?/, ' ').split(' ')
movieInfo.free = movieInfo.ownerPrice == '0' && movieInfo.visitorPrice == '0' ? '免费' : `¥${movieInfo.ownerPrice.toFixed(2)}`
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
......@@ -133,7 +134,7 @@ Page({
movieInfo.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (movieInfo.price !== movieInfo.ownerPrice && funcUserType) {
if (movieInfo.visitorPrice !== movieInfo.ownerPrice && funcUserType) {
movieInfo.priceType = 2
} else {
movieInfo.priceType = 3
......
......@@ -81,8 +81,14 @@
<view class="show-time-end">
<text>{{item.endTime + '散场'}}</text>
</view>
<view class="show-free">
<text>{{movieInfo.free}}</text>
<view class="show-free" wx:if="{{movieInfo.priceType === 1}}">
<text>{{movieInfo.priceDiscount === 0 ? '免费' : '¥' + movieInfo.priceDiscount}}</text>
</view>
<view class="show-free" wx:if="{{movieInfo.priceType === 2}}">
<text>{{movieInfo.ownerPrice === 0 ? '免费' : '¥' + movieInfo.priceSpecialText}}</text>
</view>
<view class="show-free" wx:if="{{movieInfo.priceType === 3}}">
<text>{{movieInfo.visitorPrice === 0 ? '免费' : '¥' + movieInfo.priceText}}</text>
</view>
<view class="show-btn" bindtap="onReportMovie" data-item="{{item}}">
<text>报名观影</text>
......
......@@ -90,9 +90,8 @@ Page({
v.filmType = v.filmType.replace(/\//g, ' / ')
v.filmDirector = v.filmDirector.replace(/\//g, ' ')
v.filmLead = v.filmLead.replace(/\//g, ' ')
v.priceSpecialText = v.ownerPrice.toFixed(2)
v.priceText = v.visitorPrice.toFixed(2)
v.free = v.ownerPrice == '0' ? '免费' : `¥${v.ownerPrice.toFixed(2)}`
v.priceSpecialText = App.modular.utils.formatAmount(v.ownerPrice),
v.priceText = App.modular.utils.formatAmount(v.visitorPrice),
v.tags = v.tags.replace(/( )?热映影片( )?/, ' ').split(' ')
let funcUserType = wx.getStorageSync('userInfo').userType
......@@ -140,10 +139,22 @@ Page({
v.filmType = v.filmType.replace(/\//g, ' / ')
v.filmDirector = v.filmDirector.replace(/\//g, ' ')
v.filmLead = v.filmLead.replace(/\//g, ' ')
v.priceSpecialText = v.ownerPrice.toFixed(2)
v.priceText = v.visitorPrice.toFixed(2)
v.free = v.ownerPrice == '0' ? '免费' : `¥${v.ownerPrice.toFixed(2)}`
v.priceSpecialText = App.modular.utils.formatAmount(v.ownerPrice),
v.priceText = App.modular.utils.formatAmount(v.visitorPrice),
v.tags = v.tags.replace(/( )?热映影片( )?/, ' ').replace(/( )+$/, '').split(' ')
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (v.priceDiscount) {
v.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (v.price !== v.ownerPrice && funcUserType) {
v.priceType = 2
} else {
v.priceType = 3
}
}
})
this.setData({
'movieAll.movieWeek': {
......@@ -167,10 +178,22 @@ Page({
v.filmType = v.filmType.replace(/\//g, ' / ')
v.filmDirector = v.filmDirector.replace(/\//g, ' ')
v.filmLead = v.filmLead.replace(/\//g, ' ')
v.priceSpecialText = v.ownerPrice.toFixed(2)
v.priceText = v.visitorPrice.toFixed(2)
v.free = v.ownerPrice == '0'? '免费' : `¥${v.ownerPrice.toFixed(2)}`
v.priceSpecialText = App.modular.utils.formatAmount(v.ownerPrice),
v.priceText = App.modular.utils.formatAmount(v.visitorPrice),
v.tags = v.tags.replace(/( )?热映影片( )?/, ' ').split(' ')
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (v.priceDiscount) {
v.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (v.price !== v.ownerPrice && funcUserType) {
v.priceType = 2
} else {
v.priceType = 3
}
}
})
this.setData({
'movieAll.movieNextWeek': {
......
......@@ -65,8 +65,14 @@
<view class="movie-label">
<text wx:if="{{item.keyword}}">{{item.keyword}}</text>
</view>
<view class="movie-free">
<text>{{item.free}}</text>
<view class="movie-free" wx:if="{{item.priceType === 1}}">
<text>{{item.priceDiscount === 0 ? '免费' : '¥' + item.priceDiscount}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 2}}">
<text>{{item.ownerPrice === 0 ? '免费' : '¥' + item.priceSpecialText}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 3}}">
<text>{{item.visitorPrice === 0 ? '免费' : '¥' + item.priceText}}</text>
</view>
<view class="movie-btn" catchtap="onReportMovie" data-item="{{item}}">
<text>报名观影</text>
......@@ -137,8 +143,14 @@
<view class="movie-label">
<text>{{item.keyword}}</text>
</view>
<view class="movie-free">
<text>{{item.free}}</text>
<view class="movie-free" wx:if="{{item.priceType === 1}}">
<text>{{item.priceDiscount === 0 ? '免费' : '¥' + item.priceDiscount}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 2}}">
<text>{{item.ownerPrice === 0 ? '免费' : '¥' + item.priceSpecialText}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 3}}">
<text>{{item.visitorPrice === 0 ? '免费' : '¥' + item.priceText}}</text>
</view>
</view>
</view>
......
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