Commit e38c3d53 by 严立

LL - 影院问题修复

parent d897eff5
...@@ -238,17 +238,9 @@ Page({ ...@@ -238,17 +238,9 @@ Page({
this.setData({ this.setData({
appointmentComplete: false, appointmentComplete: false,
}) })
if (this.data.frompage=='appointment') { wx.redirectTo({
wx.redirectTo({ url: '/pages/mine/appointment/appointment?tab=' + this.data.optionsTab,
url: '/pages/mine/appointment/appointment?tab='+this.data.optionsTab, })
})
} else {
wx.navigateBack({
delta: 1,
})
}
}, },
getNextDay(d, t) { getNextDay(d, t) {
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
.appointment-complete-tip { .appointment-complete-tip {
position: relative; position: relative;
width: 606rpx; width: 606rpx;
height: 840rpx; height: 974rpx;
} }
.appointment-complete-tip image { .appointment-complete-tip image {
width: 606rpx; width: 606rpx;
height: 840rpx; height: 974rpx;
} }
.appointment-complete .button { .appointment-complete .button {
......
...@@ -265,16 +265,9 @@ Page({ ...@@ -265,16 +265,9 @@ Page({
this.setData({ this.setData({
appointmentComplete: false, appointmentComplete: false,
}) })
wx.redirectTo({
if (this.data.frompage == 'appointment') { url: '/pages/mine/appointment/appointment?tab=' + this.data.optionsTab,
wx.redirectTo({ })
url: '/pages/mine/appointment/appointment?tab=' + this.data.optionsTab,
})
} else {
wx.navigateBack({
delta: 1,
})
}
}, },
// 预约入园查询返回剩余名额 // 预约入园查询返回剩余名额
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
<view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}"> <view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}">
<view class="appointment-complete-tip"> <view class="appointment-complete-tip">
<image src="{{resourcesBase + 'home/night-appointment/tip.png'}}"></image> <image src="{{resourcesBase + 'home/night-appointment/tip.png'}}" bindtap="onAppointmentComplete"></image>
<l-button l-class="button" plain="{{true}}" bind:lintap="onAppointmentComplete">我知道了</l-button>
</view> </view>
</view> </view>
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
.appointment-complete-tip { .appointment-complete-tip {
position: relative; position: relative;
width: 606rpx; width: 606rpx;
height: 840rpx; height: 974rpx;
} }
.appointment-complete-tip image { .appointment-complete-tip image {
width: 606rpx; width: 606rpx;
height: 840rpx; height: 974rpx;
} }
.appointment-complete .button { .appointment-complete .button {
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</block> </block>
</block> </block>
<!-- 餐品 文创 门票--> <!-- 餐品 文创 门票-->
<block wx:if="{{orderInfo.commodityType === 5||orderInfo.commodityType === 4||orderInfo.commodityType === 3}}"> <block wx:if="{{orderInfo.commodityType === 5 || orderInfo.commodityType === 4 || orderInfo.commodityType === 3}}">
<view class="info-content col con-c {{ orderInfo.state!==2?'p-relative':'' }}"> <view class="info-content col con-c {{ orderInfo.state!==2?'p-relative':'' }}">
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">使用门店</text> <text class="info-content-item-label">使用门店</text>
...@@ -134,7 +134,6 @@ ...@@ -134,7 +134,6 @@
</block> </block>
<!-- 活动 --> <!-- 活动 -->
<block wx:if="{{orderInfo.commodityType === -1}}"> <block wx:if="{{orderInfo.commodityType === -1}}">
<view class="info-content col con-c"> <view class="info-content col con-c">
<view class="info-content-item row"> <view class="info-content-item row">
...@@ -176,7 +175,6 @@ ...@@ -176,7 +175,6 @@
</block> </block>
<!-- 观影 --> <!-- 观影 -->
<block wx:if="{{orderInfo.commodityType === -2}}"> <block wx:if="{{orderInfo.commodityType === -2}}">
<view class="info-content col con-c"> <view class="info-content col con-c">
<view class="info-content-item row"> <view class="info-content-item row">
...@@ -211,14 +209,16 @@ ...@@ -211,14 +209,16 @@
<text>{{orderInfo.expireTime}}</text> <text>{{orderInfo.expireTime}}</text>
</view> </view>
</block> </block>
</block> </block>
</view> </view>
<view wx:if="{{orderInfo.commodityType === 5}}" class="buy-content-art-tip row align-c">
<image src="{{imageBase + 'fail-icon-4.png'}}"></image>
<text>请在下单3天内取餐,逾期失效</text>
</view>
<view class="notice-wrapper row con-e" bindtap="handleNotice"> <view class="notice-wrapper row con-e" bindtap="handleNotice">
<view class="notice">使用须知</view> <view class="notice">使用须知</view>
<!-- <view class="notice">活动须知</view>
<view class="notice">观影须知</view> -->
<l-icon name="right" color="#959DAA" size="22" /> <l-icon name="right" color="#959DAA" size="22" />
</view> </view>
......
...@@ -845,3 +845,24 @@ image { ...@@ -845,3 +845,24 @@ image {
max-width: 100%; max-width: 100%;
max-height: 100%; max-height: 100%;
} }
/* 取餐提示 */
.buy-content-art-tip {
width: 670rpx;
height: 72rpx;
margin-top: 40rpx;
padding: 0 32rpx;
background: #F5EEDF;
font-size: 22rpx;
font-weight: 400;
line-height: 32rpx;
color: #837048;
}
.buy-content-art-tip image {
display: block;
width: 28rpx;
height: 28rpx;
margin-right: 14rpx;
}
\ No newline at end of file
...@@ -6,9 +6,11 @@ let logicData = { ...@@ -6,9 +6,11 @@ let logicData = {
'name': '', 'name': '',
'phone': '', 'phone': '',
'identity': '', 'identity': '',
'remarks': '',
'errorName': '', 'errorName': '',
'errorPhone': '', 'errorPhone': '',
'errorIdentity': '', 'errorIdentity': '',
'errorRemarks': '',
} }
} }
...@@ -141,7 +143,7 @@ Page({ ...@@ -141,7 +143,7 @@ Page({
case 2: case 2:
this.setData({ this.setData({
orderType: logicData.option.type, orderType: logicData.option.type,
buyContentTitle: this.data.shopInfo.name, buyContentTitle: this.data.shoppingCartList[0].name,
quantityTitle: '选择购买数量', quantityTitle: '选择购买数量',
quantityTipText: '剩余库存', quantityTipText: '剩余库存',
contactTitle: '填写购买人信息', contactTitle: '填写购买人信息',
...@@ -228,7 +230,8 @@ Page({ ...@@ -228,7 +230,8 @@ Page({
}) })
this.setData({ this.setData({
orderType: logicData.option.type, orderType: logicData.option.type,
buyContentTitle: this.data.shopInfo.name, buyContentCover: this.data.shoppingCartList[0].cover,
buyContentTitle: this.data.shoppingCartList[0].name,
noticeText: '报名须知', noticeText: '报名须知',
quantityTitle: '报名人数', quantityTitle: '报名人数',
quantityTipText: '剩余库存', quantityTipText: '剩余库存',
...@@ -251,7 +254,8 @@ Page({ ...@@ -251,7 +254,8 @@ Page({
case 7: case 7:
this.setData({ this.setData({
orderType: logicData.option.type, orderType: logicData.option.type,
buyContentTitle: this.data.shopInfo.name, buyContentCover: this.data.shoppingCartList[0].cover,
buyContentTitle: this.data.shoppingCartList[0].name,
noticeText: '预约须知', noticeText: '预约须知',
quantityTitle: '选择预约座位', quantityTitle: '选择预约座位',
quantityTipText: '剩余座位', quantityTipText: '剩余座位',
...@@ -375,6 +379,12 @@ Page({ ...@@ -375,6 +379,12 @@ Page({
funcRegisterInfo[funcIndex].identity = funcValue funcRegisterInfo[funcIndex].identity = funcValue
funcRegisterInfo[funcIndex].errorIdentity = funcMessage funcRegisterInfo[funcIndex].errorIdentity = funcMessage
break break
case 'remarks':
funcRegisterInfo[funcIndex].remarks = funcValue
funcRegisterInfo[funcIndex].errorRemarks = funcMessage
break
} }
this.setData({ this.setData({
...@@ -531,16 +541,9 @@ Page({ ...@@ -531,16 +541,9 @@ Page({
* @returns * @returns
*/ */
onEntryComplete: function () { onEntryComplete: function () {
// 一般活动跳转到我的预约,观影跳转到订单列表 wx.reLaunch({
if (logicData.option.type === 7) { url: '/pages/mine/appointment/appointment?fromPage=pay'
wx.reLaunch({ })
url: '/pages/mine/order/order?fromPage=pay'
})
} else {
wx.reLaunch({
url: '/pages/mine/appointment/appointment?fromPage=pay'
})
}
}, },
/** /**
...@@ -623,12 +626,18 @@ Page({ ...@@ -623,12 +626,18 @@ Page({
case 'name': case 'name':
this.setUserInfo(funcType, funcValue, funcIndex, App.modular.rule.item('name', funcValue)) this.setUserInfo(funcType, funcValue, funcIndex, App.modular.rule.item('name', funcValue))
break break
case 'phone': case 'phone':
this.setUserInfo(funcType, funcValue, funcIndex, App.modular.rule.item('phone', funcValue)) this.setUserInfo(funcType, funcValue, funcIndex, App.modular.rule.item('phone', funcValue))
break break
case 'identity': case 'identity':
this.setUserInfo(funcType, funcValue, funcIndex, App.modular.rule.item('identity', funcValue)) this.setUserInfo(funcType, funcValue, funcIndex, App.modular.rule.item('identity', funcValue))
break break
case 'remarks':
this.setUserInfo(funcType, funcValue, funcIndex, App.modular.rule.item('remarks', funcValue))
break
} }
}, },
...@@ -926,6 +935,7 @@ Page({ ...@@ -926,6 +935,7 @@ Page({
'name': funcRegisterInfo[i].name, 'name': funcRegisterInfo[i].name,
'cellphone': funcRegisterInfo[i].phone, 'cellphone': funcRegisterInfo[i].phone,
'identityCard': funcRegisterInfo[i].identity, 'identityCard': funcRegisterInfo[i].identity,
'remarks': funcRegisterInfo[i].remarks
} }
funcUserInfo.push(funcItem) funcUserInfo.push(funcItem)
} }
...@@ -1193,7 +1203,6 @@ Page({ ...@@ -1193,7 +1203,6 @@ Page({
if (funcPayResult) { if (funcPayResult) {
switch (logicData.option.type) { switch (logicData.option.type) {
case 6: case 6:
case 7:
this.setData({ this.setData({
winActivityResult: true winActivityResult: true
}) })
......
...@@ -94,7 +94,8 @@ ...@@ -94,7 +94,8 @@
<!-- 活动 --> <!-- 活动 -->
<view class="buy-content-activity row align-c" wx:if="{{orderType === 6}}"> <view class="buy-content-activity row align-c" wx:if="{{orderType === 6}}">
<image src="{{resourcesBase + shopInfo.cover}}"></image> <!-- <image src="{{resourcesBase + shopInfo.cover}}"></image> -->
<image src="{{buyContentCover}}"></image>
<view class="buy-content-activity-info col con-b"> <view class="buy-content-activity-info col con-b">
<view class="title"> <view class="title">
<text>{{buyContentTitle}}</text> <text>{{buyContentTitle}}</text>
...@@ -113,7 +114,7 @@ ...@@ -113,7 +114,7 @@
<image src="{{shoppingCartList[0].cover}}"></image> <image src="{{shoppingCartList[0].cover}}"></image>
<view class="buy-content-activity-info col con-b"> <view class="buy-content-activity-info col con-b">
<view class="title"> <view class="title">
<text>{{shoppingCartList[0].name}}</text> <text>{{buyContentTitle}}</text>
</view> </view>
<view class="time"> <view class="time">
<text>{{buyContentTime}}</text> <text>{{buyContentTime}}</text>
...@@ -233,14 +234,19 @@ ...@@ -233,14 +234,19 @@
</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="请输入姓名" value="{{registerInfo[0].name}}" 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="请输入手机号" value="{{registerInfo[0].phone}}" 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 class="contact-input col">
<text>备注</text>
<input placeholder="请填写备注" value="{{registerInfo[0].remarks}}" maxlength="50" data-type="remarks" data-index="{{0}}" bindblur="onInputBlur"></input>
<text>{{registerInfo[0].errorRemarks}}</text>
</view>
</view> </view>
<!-- winRegister --> <!-- winRegister -->
...@@ -259,17 +265,17 @@ ...@@ -259,17 +265,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="请输入姓名" value="{{item.name}}" 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="请输入手机号" value="{{item.phone}}" 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="请输入身份证号" value="{{item.identity}}" 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>
......
...@@ -85,7 +85,7 @@ Page({ ...@@ -85,7 +85,7 @@ Page({
clearTimeout(logicData.pageScrollTimer) clearTimeout(logicData.pageScrollTimer)
}, 10) }, 10)
}, },
setShowHeight: function () { setShowHeight: function() {
wx.getSystemInfo({ wx.getSystemInfo({
success: (result) => { success: (result) => {
this.setData({ this.setData({
...@@ -94,15 +94,19 @@ Page({ ...@@ -94,15 +94,19 @@ Page({
}, },
}) })
}, },
setFooterLocation: function () { setFooterLocation: function() {
let that = this let that = this
let { windowHeight, marginTop, footerFixed } = this.data let {
windowHeight,
marginTop,
footerFixed
} = this.data
let footerHeight = Math.floor(214 * wx.getStorageSync('unitProportion')) let footerHeight = Math.floor(214 * wx.getStorageSync('unitProportion'))
// 显示高度 // 显示高度
let showHeight = windowHeight - footerHeight - marginTop let showHeight = windowHeight - footerHeight - marginTop
let query = wx.createSelectorQuery() let query = wx.createSelectorQuery()
query.select('#page').boundingClientRect() query.select('#page').boundingClientRect()
query.exec(function(res){ query.exec(function(res) {
if (res[0].height > showHeight) { if (res[0].height > showHeight) {
footerFixed = false footerFixed = false
} }
...@@ -120,7 +124,11 @@ Page({ ...@@ -120,7 +124,11 @@ Page({
getTodayFilm: function() { getTodayFilm: function() {
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
success: () => {this.setData({loading: true})} success: () => {
this.setData({
loading: true
})
}
}) })
App.wxRequest({ App.wxRequest({
url: '/api/v1/film/getTodayFilm', url: '/api/v1/film/getTodayFilm',
...@@ -130,37 +138,57 @@ Page({ ...@@ -130,37 +138,57 @@ Page({
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
let movieToday = funcResponse.list let funcList = []
movieToday.forEach(v => { for (let i = 0, l = funcResponse.list.length; i < l; i++) {
v.endTime = v.endTime + ' 散场' let funcItem = {
v.filmType = v.filmType 'id': funcResponse.list[i].activityId,
v.filmDirector = v.filmDirector 'entryId': funcResponse.list[i].filmId,
v.filmLead = v.filmLead 'activityId': funcResponse.list[i].filmId,
v.priceSpecialText = App.modular.utils.formatAmount(v.ownerPrice), 'cover': funcResponse.list[i].cover,
v.priceText = App.modular.utils.formatAmount(v.visitorPrice), 'endTime': funcResponse.list[i].endTime + ' 散场',
v.tags = v.tags.replace(/( )?热映影片( )?/, ' ').split(' ') 'beginTime': funcResponse.list[i].beginTime,
'keyword': funcResponse.list[i].keyword,
'filmName': funcResponse.list[i].filmName,
'filmType': funcResponse.list[i].filmType,
'filmDirector': funcResponse.list[i].filmDirector,
'filmLead': funcResponse.list[i].filmLead,
'price': funcResponse.list[i].sightseerPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse.list[i].sightseerPrice),
'priceSpecial': funcResponse.list[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse.list[i].ownerPrice),
'priceDiscount': funcResponse.list[i].price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse.list[i].price),
'priceType': 1,
'tags': funcResponse.list[i].tags.replace(/( )?热映影片( )?/, ' ').split(' '),
}
let funcUserType = wx.getStorageSync('userInfo').userType let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型 // 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价 // 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (v.priceDiscount) { if (funcItem.priceDiscount || funcItem.priceDiscount === 0) {
v.priceType = 1 funcItem.priceType = 1
} else { } else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者 // 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (v.price !== v.ownerPrice && funcUserType) { if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
v.priceType = 2 funcItem.priceType = 2
} else { } else {
v.priceType = 3 funcItem.priceType = 3
} }
} }
})
funcList.push(funcItem)
}
this.setData({ this.setData({
movieToday movieToday: funcList,
}, function () { }, function() {
this.setFooterLocation() this.setFooterLocation()
}) })
wx.hideLoading({ wx.hideLoading({
success: () => {this.setData ({loading: false})}, success: () => {
this.setData({
loading: false
})
},
}) })
} }
}) })
...@@ -174,7 +202,11 @@ Page({ ...@@ -174,7 +202,11 @@ Page({
getAllFilm: function() { getAllFilm: function() {
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
success: () => {this.setData({loading: true})} success: () => {
this.setData({
loading: true
})
}
}) })
// weekType: 0本周热映 1下周 // weekType: 0本周热映 1下周
let movieWeek = [] let movieWeek = []
...@@ -189,38 +221,59 @@ Page({ ...@@ -189,38 +221,59 @@ Page({
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
movieWeek = funcResponse.list let funcList = []
movieWeek.forEach(v => { for (let i = 0, l = funcResponse.list.length; i < l; i++) {
v.filmType = v.filmType.replace(/\//g, ' / ') let funcItem = {
v.filmDirector = v.filmDirector.replace(/\//g, ' ') 'id': funcResponse.list[i].activityId,
v.filmLead = v.filmLead.replace(/\//g, ' ') 'entryId': funcResponse.list[i].filmId,
v.priceSpecialText = App.modular.utils.formatAmount(v.ownerPrice), 'activityId': funcResponse.list[i].filmId,
v.priceText = App.modular.utils.formatAmount(v.visitorPrice), 'cover': funcResponse.list[i].cover,
v.tags = v.tags.replace(/( )?热映影片( )?/, ' ').replace(/( )+$/, '').split(' ') 'endTime': funcResponse.list[i].endTime + ' 散场',
'beginTime': funcResponse.list[i].beginTime,
'keyword': funcResponse.list[i].keyword,
'filmName': funcResponse.list[i].filmName,
'filmType': funcResponse.list[i].filmType,
'filmDirector': funcResponse.list[i].filmDirector,
'filmLead': funcResponse.list[i].filmLead,
'price': funcResponse.list[i].sightseerPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse.list[i].sightseerPrice),
'priceSpecial': funcResponse.list[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse.list[i].ownerPrice),
'priceDiscount': funcResponse.list[i].price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse.list[i].price),
'priceType': 1,
'tags': funcResponse.list[i].tags.replace(/( )?热映影片( )?/, ' ').split(' '),
}
let funcUserType = wx.getStorageSync('userInfo').userType let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型 // 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价 // 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (v.priceDiscount) { if (funcItem.priceDiscount || funcItem.priceDiscount === 0) {
v.priceType = 1 funcItem.priceType = 1
} else { } else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者 // 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (v.price !== v.ownerPrice && funcUserType) { if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
v.priceType = 2 funcItem.priceType = 2
} else { } else {
v.priceType = 3 funcItem.priceType = 3
} }
} }
}) funcList.push(funcItem)
}
this.setData({ this.setData({
'movieAll.movieWeek': { 'movieAll.movieWeek': {
title: '本周热映', title: '本周热映',
list: movieWeek list: funcList
} }
}, function () { }, function() {
this.setFooterLocation() this.setFooterLocation()
}) })
wx.hideLoading({ wx.hideLoading({
success: () => {this.setData ({loading: false})}, success: () => {
this.setData({
loading: false
})
},
}) })
} }
}) })
...@@ -233,38 +286,59 @@ Page({ ...@@ -233,38 +286,59 @@ Page({
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
movieNextWeek = funcResponse.list let funcList = []
movieNextWeek.forEach(v => { for (let i = 0, l = funcResponse.list.length; i < l; i++) {
v.filmType = v.filmType.replace(/\//g, ' / ') let funcItem = {
v.filmDirector = v.filmDirector.replace(/\//g, ' ') 'id': funcResponse.list[i].activityId,
v.filmLead = v.filmLead.replace(/\//g, ' ') 'entryId': funcResponse.list[i].filmId,
v.priceSpecialText = App.modular.utils.formatAmount(v.ownerPrice), 'activityId': funcResponse.list[i].filmId,
v.priceText = App.modular.utils.formatAmount(v.visitorPrice), 'cover': funcResponse.list[i].cover,
v.tags = v.tags.replace(/( )?热映影片( )?/, ' ').split(' ') 'endTime': funcResponse.list[i].endTime + ' 散场',
'beginTime': funcResponse.list[i].beginTime,
'keyword': funcResponse.list[i].keyword,
'filmName': funcResponse.list[i].filmName,
'filmType': funcResponse.list[i].filmType,
'filmDirector': funcResponse.list[i].filmDirector,
'filmLead': funcResponse.list[i].filmLead,
'price': funcResponse.list[i].sightseerPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse.list[i].sightseerPrice),
'priceSpecial': funcResponse.list[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcResponse.list[i].ownerPrice),
'priceDiscount': funcResponse.list[i].price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse.list[i].price),
'priceType': 1,
'tags': funcResponse.list[i].tags.replace(/( )?热映影片( )?/, ' ').split(' '),
}
let funcUserType = wx.getStorageSync('userInfo').userType let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型 // 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价 // 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (v.priceDiscount) { if (funcItem.priceDiscount || funcItem.priceDiscount === 0) {
v.priceType = 1 funcItem.priceType = 1
} else { } else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者 // 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (v.price !== v.ownerPrice && funcUserType) { if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
v.priceType = 2 funcItem.priceType = 2
} else { } else {
v.priceType = 3 funcItem.priceType = 3
} }
} }
}) funcList.push(funcItem)
}
this.setData({ this.setData({
'movieAll.movieNextWeek': { 'movieAll.movieNextWeek': {
title: '下周热映', title: '下周热映',
list: movieNextWeek list: funcList
} }
}, function () { }, function() {
this.setFooterLocation() this.setFooterLocation()
}) })
wx.hideLoading({ wx.hideLoading({
success: () => {this.setData ({loading: false})}, success: () => {
this.setData({
loading: false
})
},
}) })
} }
}) })
...@@ -292,19 +366,21 @@ Page({ ...@@ -292,19 +366,21 @@ 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.id, // 活动 id
'name': funcItem.filmName, // 电影名称 'name': funcItem.filmName, // 电影名称
'cover': funcItem.cover, // 电影封面 'cover': funcItem.cover, // 电影封面
'entryId': funcItem.filmId, // 场次 id 'entryId': funcItem.filmId, // 场次 id
'price': funcItem.sightseerPrice, // 普通价 'price': funcItem.price, // 普通价
'priceText': App.modular.utils.formatAmount(funcItem.sightseerPrice), // 普通价文本格式 'priceText': funcItem.priceText,
'priceSpecial': funcItem.ownerPrice, // 业主价 'priceSpecial': funcItem.priceSpecial, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcItem.ownerPrice), // 业主价文本格式 'priceSpecialText': funcItem.priceSpecialText,
'priceDiscount': funcItem.price, // 活动价 'priceDiscount': funcItem.priceDiscount, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcItem.price), // 活动价文本格式 'priceDiscountText': funcItem.priceDiscountText,
'priceType': 1, 'priceType': funcItem.priceType,
'quantity': 1, 'quantity': 1,
'quantityMin': 1, 'quantityMin': 1,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</view> </view>
<view wx:if="{{statusActive === 0}}"> <view wx:if="{{statusActive === 0}}">
<block wx:for="{{movieToday}}" wx:key="id" wx:if="{{movieToday.length !== 0}}"> <block wx:for="{{movieToday}}" wx:key="{{index}}" wx:if="{{movieToday.length !== 0}}">
<view class="movie-wrapper row" bindtap="onToMovieDetail" data-movieId="{{item.activityId}}"> <view class="movie-wrapper row" bindtap="onToMovieDetail" data-movieId="{{item.activityId}}">
<view class="movie-time-wrapper row align-c"> <view class="movie-time-wrapper row align-c">
<view class="movie-time-start"> <view class="movie-time-start">
...@@ -64,13 +64,13 @@ ...@@ -64,13 +64,13 @@
<text wx:if="{{item.keyword}}">{{item.keyword}}</text> <text wx:if="{{item.keyword}}">{{item.keyword}}</text>
</view> </view>
<view class="movie-free" wx:if="{{item.priceType === 1}}"> <view class="movie-free" wx:if="{{item.priceType === 1}}">
<text>{{item.priceDiscount === 0 ? '免费' : '¥' + item.priceDiscount}}</text> <text>{{item.priceDiscount === 0 ? '免费' : '¥' + item.priceDiscountText}}</text>
</view> </view>
<view class="movie-free" wx:if="{{item.priceType === 2}}"> <view class="movie-free" wx:if="{{item.priceType === 2}}">
<text>{{item.ownerPrice === 0 ? '免费' : '¥' + item.priceSpecialText}}</text> <text>{{item.priceSpecial === 0 ? '免费' : '¥' + item.priceSpecialText}}</text>
</view> </view>
<view class="movie-free" wx:if="{{item.priceType === 3}}"> <view class="movie-free" wx:if="{{item.priceType === 3}}">
<text>{{item.visitorPrice === 0 ? '免费' : '¥' + item.priceText}}</text> <text>{{item.price === 0 ? '免费' : '¥' + item.priceText}}</text>
</view> </view>
<view class="movie-btn" catchtap="onReportMovie" data-item="{{item}}"> <view class="movie-btn" catchtap="onReportMovie" data-item="{{item}}">
<text>报名观影</text> <text>报名观影</text>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
</block> </block>
</view> </view>
<view wx:if="{{statusActive === 1}}"> <view wx:if="{{statusActive === 1}}">
<block wx:for="{{movieAll}}" wx:for-index="key" wx:for-item="movieList" wx:key="key" wx:if="{{movieAll.movieWeek.list.length > 0 || movieAll.movieNextWeek.list.length > 0}}"> <block wx:for="{{movieAll}}" wx:for-index="index" wx:for-item="movieList" wx:key="{{index}}" wx:if="{{movieAll.movieWeek.list.length > 0 || movieAll.movieNextWeek.list.length > 0}}">
<view class="movie-week row align-c con-c" wx:if="{{movieList.list.length > 0}}"> <view class="movie-week row align-c con-c" wx:if="{{movieList.list.length > 0}}">
<view class="line"></view> <view class="line"></view>
<view class="movie-week-title"> <view class="movie-week-title">
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</view> </view>
<view class="line"></view> <view class="line"></view>
</view> </view>
<block wx:for="{{movieList.list}}" wx:key="id"> <block wx:for="{{movieList.list}}" wx:key="{{index}}" wx:for-index="index">
<view class="all-movie-wrapper" bindtap="onToMovieDetail" data-movieId="{{item.activityId}}"> <view class="all-movie-wrapper" bindtap="onToMovieDetail" data-movieId="{{item.activityId}}">
<view class="all-movie-cover"> <view class="all-movie-cover">
<image src="{{item.cover}}"></image> <image src="{{item.cover}}"></image>
...@@ -140,13 +140,16 @@ ...@@ -140,13 +140,16 @@
<text wx:if="{{item.keyword}}">{{item.keyword}}</text> <text wx:if="{{item.keyword}}">{{item.keyword}}</text>
</view> </view>
<view class="movie-free" wx:if="{{item.priceType === 1}}"> <view class="movie-free" wx:if="{{item.priceType === 1}}">
<text>{{item.priceDiscount === 0 ? '免费' : '¥' + item.priceDiscount}}</text> <text>{{item.priceDiscount === 0 ? '免费' : '¥' + item.priceDiscountText}}</text>
</view> </view>
<view class="movie-free" wx:if="{{item.priceType === 2}}"> <view class="movie-free" wx:if="{{item.priceType === 2}}">
<text>{{item.ownerPrice === 0 ? '免费' : '¥' + item.priceSpecialText}}</text> <text>{{item.priceSpecial === 0 ? '免费' : '¥' + item.priceSpecialText}}</text>
</view> </view>
<view class="movie-free" wx:if="{{item.priceType === 3}}"> <view class="movie-free" wx:if="{{item.priceType === 3}}">
<text>{{item.visitorPrice === 0 ? '免费' : '¥' + item.priceText}}</text> <text>{{item.price === 0 ? '免费' : '¥' + item.priceText}}</text>
</view>
<view class="movie-btn" catchtap="onReportMovie" data-item="{{item}}">
<text>报名观影</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -520,6 +520,7 @@ Page({ ...@@ -520,6 +520,7 @@ Page({
'weekType': 0, 'weekType': 0,
'pageSize': 10, 'pageSize': 10,
'pageNo': 1, 'pageNo': 1,
'tagIds': '102'
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data.list let funcResponse = response.data.list
...@@ -544,9 +545,11 @@ Page({ ...@@ -544,9 +545,11 @@ Page({
'tagsId': funcResponse[i].tagIds, 'tagsId': funcResponse[i].tagIds,
'tags': funcResponse[i].tags.split(' '), 'tags': funcResponse[i].tags.split(' '),
} }
if (funcItem.tagsId.includes('102')) {
funcList.push(funcItem) funcList.push(funcItem)
} // if (funcItem.tagsId.includes('102')) {
// }
} }
this.setData({ this.setData({
detailCommodity: funcList detailCommodity: funcList
......
...@@ -13,4 +13,7 @@ ...@@ -13,4 +13,7 @@
* *
* 代码编写规范 - js - 函数命名 * 代码编写规范 - js - 函数命名
* query * query
*
* js - 列表相关
* 循环一定添加 key index
*/ */
\ No newline at end of file
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