Commit 2cf686cc by 严立

LL - 客户审查初版

parent 38d785c8
......@@ -11,6 +11,7 @@ Page({
bannerImage: App.globalData.appResourcesBase + 'campsite/campsite-header.png',
campsiteDescribe: [],
average: 0,
},
onLoad: function (options) {
......@@ -22,6 +23,7 @@ Page({
this.setShopInfo(3, 1)
this.queryCampsiteDescribe()
this.queryActivity()
this.queryEvaluate()
},
setSideHeight: function () {
......@@ -86,6 +88,24 @@ Page({
})
},
queryEvaluate: function () {
let that = this
let shopInfo = wx.getStorageSync('shopInfoBuffer')
App.request({
url: 'v1/appraise/getOfficeAppraise',
params: {
'officeId': shopInfo.id
}
}).then((response) => {
let funcData = response.data
let funcAverage = Math.floor(funcData.environmentalEvaluation + funcData.productEvaluatio + funcData.serviceEvaluation) / 3
console.log(funcAverage)
this.setData({
average: funcAverage
})
})
},
onEvaluateMore: function () {
wx.navigateTo({ url: '/pages/campsite/evaluate/evaluate' })
},
......
......@@ -13,7 +13,7 @@
<view class="row cb ac">
<view class="other_evaluate row ac">
<image class="other_evaluate_title" src="../home/image/evaluate-title.png"></image>
<block wx:for="{{5}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<block wx:for="{{average}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image class="other_evaluate_start" src="{{imageBase + 'icon/star-1.png'}}"></image>
</block>
<image class="other_evaluate_more" src="../home/image/evaluate.png" bindtap="onEvaluateMore"></image>
......
......@@ -11,6 +11,7 @@ Page({
bannerImage: App.globalData.appResourcesBase + 'campsite/campsite-header.png',
campsiteDescribe: [],
average: 0,
},
onLoad: function (options) {
......@@ -22,6 +23,7 @@ Page({
this.setShopInfo(3, 1)
this.queryCampsiteDescribe()
this.queryActivity()
this.queryEvaluate()
},
setSideHeight: function () {
......@@ -86,6 +88,24 @@ Page({
})
},
queryEvaluate: function () {
let that = this
let shopInfo = wx.getStorageSync('shopInfoBuffer')
App.request({
url: 'v1/appraise/getOfficeAppraise',
params: {
'officeId': shopInfo.id
}
}).then((response) => {
let funcData = response.data
let funcAverage = Math.floor(funcData.environmentalEvaluation + funcData.productEvaluatio + funcData.serviceEvaluation) / 3
console.log(funcAverage)
this.setData({
average: funcAverage
})
})
},
onEvaluateMore: function () {
wx.navigateTo({ url: '/pages/campsite/evaluate/evaluate' })
},
......
......@@ -13,7 +13,7 @@
<view class="row cb ac">
<view class="other_evaluate row ac">
<image class="other_evaluate_title" src="./image/evaluate-title.png"></image>
<block wx:for="{{5}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<block wx:for="{{average}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image class="other_evaluate_start" src="{{imageBase + 'icon/star-1.png'}}"></image>
</block>
<image class="other_evaluate_more" src="./image/evaluate.png" bindtap="onEvaluateMore"></image>
......
......@@ -148,10 +148,7 @@ Page({
onEnter: function () {
if (!App.userIsRegister()) return
if (!this.inspectForm()) return
App.ui.showToast({
iconType: 'loading',
title: '正在提交',
})
App.ui.showToast({ iconType: 'loading', title: '正在提交', })
let funcEnterInfo = this.data.enterInfo
let funcEnterInfoCustom = this.data.enterInfoCustom
......@@ -176,12 +173,14 @@ Page({
'smClub': { id: this.data.clubInfo.id }
}
}).then((response) => {
console.log('then')
App.ui.hideToast()
wx.setStorageSync('tempBackInfo', 'winEnter')
wx.navigateBack()
wx.navigateBack({
event: {
'type': 'onReload',
}
})
}).catch((response) => {
console.log('catch')
App.ui.showToast({
'iconType': 'error',
'title': response.message
......
......@@ -11,7 +11,9 @@ Page({
],
tabIndex: 0,
clubList: [],
clubInfoList: [],
enterClubIdList: [],
enterClubStateList: [],
pageIndex: 1,
pageSize: 5,
......@@ -28,7 +30,6 @@ Page({
onShow: function () {
let funcBackInfo = wx.getStorageSync('tempBackInfo')
console.log('show', funcBackInfo)
switch (funcBackInfo) {
case 'winEstablish':
this.setData({
......@@ -46,6 +47,14 @@ Page({
}
},
onReload: function () {
console.log('onReload')
this.setData({
pageIndex: 1
})
this.queryEnterClubList()
},
/**
* 设置俱乐部分类 tab
* @function
......@@ -72,20 +81,48 @@ Page({
tabItem: this.data.tabItem.concat(funcList)
})
this.queryClub(0)
console.log(this.data.tabItem)
this.queryEnterClubList()
}).catch((response) => {
console.log(response)
})
},
/**
* 查询我加入的
* @function
* @param
* @returns
*/
queryEnterClubList: function () {
App.request({
url: 'v3/club/getMyJoinClubs',
params: {
'pageNo': 1,
'pageSize': -1,
}
}).then((response) => {
let funcData = response.data.list
let funcEnterClubIdList = []
let funcEnterClubStateList = []
for (let i = 0, l = funcData.length; i < l; i++) {
funcEnterClubIdList.push(funcData[i].clubId)
funcEnterClubStateList.push(Number(funcData[i].state))
}
this.setData({
enterClubIdList: funcEnterClubIdList,
enterClubStateList: funcEnterClubStateList,
})
this.queryClubInfoList()
})
},
/**
* 查询俱乐部列表
* @function
* @param {object} - funcEvent
* @param
* @returns
*/
queryClub: function () {
queryClubInfoList: function () {
App.request({
url: 'v3/club/getClubList',
params: {
......@@ -104,19 +141,23 @@ Page({
'name': funcData[i].name,
'describe': funcData[i].summary,
'member': funcData[i].memberNum,
'state': 2,
'isOwner': Number(funcData[i].owner) === 0 ? false : true
}
let funcEnterClubListIndex = this.data.enterClubIdList.indexOf(funcItem.id)
if (0 <= funcEnterClubListIndex) {
funcItem.state = this.data.enterClubStateList[funcEnterClubListIndex]
}
funcList.push(funcItem)
}
console.log(funcList)
this.setData({
clubList: this.data.clubList.concat(funcList)
clubInfoList: this.data.pageIndex === 1 ? funcList : this.data.clubInfoList.concat(funcList)
})
}).catch((response) => {})
},
/**
* 创建俱乐部
* @function
......@@ -197,10 +238,10 @@ Page({
let funcItem = funcEvent.detail
this.setData({
tabIndex: funcItem.index,
clubList: [],
clubInfoList: [],
pageIndex: 1,
})
this.queryClub()
this.queryClubInfoList()
},
/**
......@@ -220,16 +261,14 @@ Page({
* @returns
*/
onReachBottom: function () {
console.log('onReachBottom')
this.setData({
pageIndex: this.data.pageIndex + 1
})
this.queryClub()
this.queryClubInfoList()
},
eventNavChangeHeight: function (funcEvent) {
console.log(funcEvent)
let funcNavHeight = funcEvent.detail.navHeight
this.setData({
bannerCreatTop: funcNavHeight + 30 * wx.getStorageSync('unitProportion')
......
......@@ -41,7 +41,7 @@
</view>
<view class="club-list">
<block wx:for="{{clubList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<block wx:for="{{clubInfoList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="club-item row" data-item="{{item}}" bindtap="onClubDetail">
<view class="club-logo">
<image src="{{item.logo}}"></image>
......@@ -56,7 +56,9 @@
</view>
<view class="club-info-other row cb ac">
<text>{{item.member + '成员'}}</text>
<button data-item="{{item}}" catchtap="onEnterClub">申请加入</button>
<button class="club_info_other_apply" wx:if="{{item.state === 0}}" data-item="{{item}}">已申请</button>
<button class="club_info_other_enter" wx:if="{{item.state === 1}}" data-item="{{item}}">已加入</button>
<button class="club_info_other_submit" wx:if="{{item.state === 2}}" data-item="{{item}}" catchtap="onEnterClub">申请加入</button>
</view>
</view>
</view>
......
......@@ -153,7 +153,20 @@
color: #959DA9;
}
.club-info-other > button {
.club_info_other_apply,
.club_info_other_enter {
width: 120rpx;
height: 56rpx;
border-radius: 2px;
background: #C8E1EC;
font-size: 22rpx;
font-weight: 500;
line-height: 56rpx;
color: #FFFFFF;
}
.club_info_other_submit {
width: 120rpx;
height: 56rpx;
border-radius: 2px;
......
......@@ -6,6 +6,8 @@ Page({
clubInfo: {},
clubActivity: [],
enterClubIdList: [],
enterClubStateList: [],
examineRemark: '',
winEnter: false, // 加入提交提示
......@@ -29,7 +31,7 @@ Page({
'isOwner': false
},
})
this.queryClubInfo()
this.queryEnterClubList()
this.queryActivity()
},
......@@ -49,6 +51,40 @@ Page({
}
},
onReload: function () {
console.log('onReload')
this.queryEnterClubList()
},
/**
* 查询我加入的
* @function
* @param
* @returns
*/
queryEnterClubList: function () {
App.request({
url: 'v3/club/getMyJoinClubs',
params: {
'pageNo': 1,
'pageSize': -1,
}
}).then((response) => {
let funcData = response.data.list
let funcEnterClubIdList = []
let funcEnterClubStateList = []
for (let i = 0, l = funcData.length; i < l; i++) {
funcEnterClubIdList.push(funcData[i].clubId)
funcEnterClubStateList.push(Number(funcData[i].state))
}
this.setData({
enterClubIdList: funcEnterClubIdList,
enterClubStateList: funcEnterClubStateList,
})
this.queryClubInfo()
})
},
/**
* 查询俱乐部信息
* @function
......@@ -63,8 +99,7 @@ Page({
}
}).then((response) => {
let funcData = response.data
this.setData({
clubInfo: {
let funcItem = {
'id': funcData.clubId,
'logo': funcData.logo,
'cover': funcData.cover,
......@@ -72,8 +107,15 @@ Page({
'describe': funcData.summary,
'member': funcData.memberNum,
'content': funcData.content,
'state': 2,
'isOwner': Number(funcData.owner) === 0 ? false : true
}
let funcEnterClubListIndex = this.data.enterClubIdList.indexOf(funcItem.id)
if (0 <= funcEnterClubListIndex) {
funcItem.state = this.data.enterClubStateList[funcEnterClubListIndex]
}
this.setData({
clubInfo: funcItem
})
}).catch((response) => {})
},
......
......@@ -94,7 +94,15 @@
<image mode="widthFix" src="./image/enter-rule.png"></image>
</view>
<block wx:if="{{clubInfo.state === 0}}">
<m-button-bottom text="已申请" isEnable="{{false}}"></m-button-bottom>
</block>
<block wx:if="{{clubInfo.state === 1}}">
<m-button-bottom text="已加入" isEnable="{{false}}"></m-button-bottom>
</block>
<block wx:if="{{clubInfo.state === 2}}">
<m-button-bottom text="申请加入" bindclick="onEnterClub"></m-button-bottom>
</block>
</view>
<!-- 俱乐部加入权限提醒 -->
......
......@@ -152,9 +152,6 @@
<!-- 商店 -->
<view class="shop">
<view class="shop-name">
<image src="{{resourcesBase + 'commodity/home/shop-title-2.png'}}"></image>
</view>
<view class="shop-title col">
<text>累计消费</text>
<text>兑换特色产品</text>
......
......@@ -66,8 +66,13 @@ Page({
'address': funcData[i].address,
'isDefault': Boolean(Number(funcData[i].defaultFlag)),
}
if (funcItem.isDefault) {
funcList.unshift(funcItem)
} else {
funcList.push(funcItem)
}
}
// 在积分商城下单时,通过比对新增地址的信息,来获取新增地址的 id。
if (wx.getStorageSync('tempOptions') === 'address') {
......
......@@ -3,7 +3,6 @@ let App = getApp()
Page({
data: {
options: {},
isDoing: false,
instructions: false,
swiperCurrent: 0,
showCodePopup: false,
......@@ -36,6 +35,7 @@ Page({
},
onLoad: function (options) {
console.log(options)
this.setData({
options: options,
activityId: options.activityId,
......@@ -89,7 +89,7 @@ Page({
'integral': funcResponse.integral,
'instructions': funcResponse.particulars,
'expireTime': funcResponse.expireTime.replace(/-/g, '.').replace('~', '-'), //订单有效期
// 'wxRequest': funcResponse.wxRequest,
'wxRequest': funcResponse.wxRequest,
}
// 电影
......@@ -127,8 +127,6 @@ Page({
goodsList: funcGoodsList,
})
// 等待支付时间计时
if (funcOrderInfo.state == 0) this.setPayCouponInfo(funcOrderInfo.submitTime)
this.setData({
orderInfo: funcOrderInfo,
shopInfo: funcShopInfo,
......@@ -165,6 +163,16 @@ Page({
// 再次下单
onOrderAgain: function () {
let funcShopInfoBuffer = App.getShopInfo(this.data.shopInfo.id)
if (funcShopInfoBuffer.appId === 0) {
wx.navigateTo({ url: '/pages/club/home/home' })
} else {
wx.navigateTo({ url: '/pages/play/activity/activity' })
}
return
let funcUrl = ''
let funcGoodsType = this.data.orderInfo.goodsType
let funcShopAppId = App.getShopInfo(this.data.shopInfo.id).appId
......@@ -220,6 +228,7 @@ Page({
},
// 去支付
onOrderPay: function (event) {
let funcThis = this
// 数据校验不通过
let wxRequest = this.data.orderInfo.wxRequest
// 待支付返回的wx支付参数
......@@ -231,7 +240,13 @@ Page({
signType: wxRequest.signType,
paySign: wxRequest.paySign,
success(res) {
this.queryOrderDetail()
funcThis.queryOrderDetail()
wx.emit({
event: {
type: 'onReload',
receivePage: 'pages/mine/appointment/appointment',
}
})
},
fail(res) { }
})
......@@ -260,10 +275,6 @@ Page({
App.ui.showToast({
'iconType': 'loading',
'title': '处理中',
'duration': 60000
})
this.setData({
isDoing: true,
})
App.request({
url: 'v1/activity/doCancel',
......@@ -273,31 +284,18 @@ Page({
}
}).then((response) => {
App.ui.hideToast()
this.setData({
isDoing: false,
})
App.ui.showToast({
'iconType': 'success',
'title': type == 1 ? '订单删除成功' : '订单取消成功'
})
setTimeout(function () {
if (type == 1) {
// 删除操作
'title': type == 1 ? '订单删除成功' : '订单取消成功',
ending: () => {
wx.navigateBack({
delta: 1
})
wx.setStorageSync('option-appointment', 'refresh')
} else {
// 取消操作
let state = `orderInfo.state`
this.setData({
isDoing: false,
[state]: -1
event: {
type: 'onReload'
}
})
}
}, 2000)
})
}).catch((response) => {
App.ui.showToast({
'iconType': 'error',
......
......@@ -71,6 +71,22 @@ Page({
}
},
onReload: function () {
this.setData({
pageNo: 1,
pageSize: 10,
data: [],
activityList: [],
})
let type = this.data.option.tab ? 1 * this.data.option.tab : 0
if (type === 0) {
this.queryActivityList()
} else {
this.getList(type)
}
},
queryActivityList: function () {
wx.setStorageSync('option-appointment', '')
App.ui.showToast({
......
<m-toast></m-toast>
<m-dialog></m-dialog>
<m-nav titleText="我的俱乐部" styleIndex="{{1}}"></m-nav>
<m-nav titleText="入会审核" styleIndex="{{1}}"></m-nav>
<view class="tab">
<m-tab item="{{tabItem}}" classTabList="row cb tab_list" bindtabChange="eventTabChange"></m-tab>
......
......@@ -103,6 +103,11 @@
width: 750rpx;
height: 146rpx;
padding: 0 40rpx;
background: #FFFFFF;
}
.pass_item_line:last-child {
display: none;
}
.pass_item_avatar {
......
......@@ -190,6 +190,7 @@ Page({
},
// 去支付
onOrderPay: function (event) {
let funcThis = this
// 数据校验不通过
let wxRequest = this.data.orderInfo.wxRequest
// 待支付返回的wx支付参数
......@@ -201,7 +202,13 @@ Page({
signType: wxRequest.signType,
paySign: wxRequest.paySign,
success(res) {
this.queryOrderDetail()
funcThis.queryOrderDetail()
wx.emit({
event: {
type: 'onReload',
receivePage: 'pages/mine/order/order',
}
})
},
fail(res) {}
})
......
......@@ -72,7 +72,6 @@ Page({
'shopId': funcData[i].officeId,
}
funcList.push(funcItem)
funcList.push(funcItem)
}
this.setData({
recentActivitiesList: funcList
......
......@@ -97,7 +97,7 @@ Page({
movieInfo.priceSpecialText = App.modular.utils.formatAmount(movieInfo.ownerPrice), // 业主价文本格式
movieInfo.priceText = App.modular.utils.formatAmount(movieInfo.visitorPrice),
movieInfo.tags = movieInfo.tags.replace(/( )?热映影片( )?/, ' ').split(' ')
movieInfo.tags = movieInfo.tags
......
......@@ -2,46 +2,36 @@ let App = getApp()
Page({
data: {
navHeight: 0,
classHeight: 0,
movieTypeTag: [],
// 请求参数
queryParams: {
pageNo: '1',
pageSize: '-1'
},
loading: true,
statusTop: '',
statusFixed: false,
marginTop: '',
// 屏幕显示高度
windowHeight: 0,
// 底部图片是否固定
footerFixed: true,
statusActive: 0,
statusList: [
tabList: [
{ 'id': 0, 'name': '今日放映' },
{ 'id': 1, 'name': '全部热映' },
],
tabActiveIndex: 0,
pageIndex: 1,
pageSize: -1,
movieTypeTag: [],
movieToday: [],
movieAll: {}
allHitMovie: [
{ 'tagId': '', 'title': '本周热映', 'list': [], },
{ 'tagId': '', 'title': '下周热映', 'list': [], },
{ 'tagId': '110', 'title': '', 'list': [], },
{ 'tagId': '111', 'title': '', 'list': [], },
{ 'tagId': '112', 'title': '', 'list': [], },
],
},
onLoad: function() {
this.setData({
navHeight: wx.getStorageSync('navStatusHeight') + wx.getStorageSync('navTitleHeight'),
classHeight: 60 * wx.getStorageSync('unitProportion')
})
onLoad: function() {
this.setMovieTypeTag()
this.setShowHeight()
this.setFooterLocation()
},
/**
* 设置电影类型标签
* @function
* @param {object} - funcEvent
* @returns
*/
setMovieTypeTag: function () {
App.request({
url: 'v1/common/getSmTags',
......@@ -51,296 +41,179 @@ Page({
}).then((response) => {
let funcData = response.data
let funcList = []
let funcMovieAll = []
for (let i = 0, l = funcData.length; i < l; i++) {
let funcItem = {
funcList.push({
'text': funcData[i].name,
'value': funcData[i].tagId,
}
funcList.push(funcItem)
if (['102', '110', '111','112' ].includes(funcItem.value)) {
funcMovieAll.push({
'text': funcData[i].name,
'value': funcData[i].tagId,
'movieList': []
})
}
}
this.setData({
movieTypeTag: funcList,
movieAll: funcMovieAll,
})
this.getTodayFilm()
this.queryMovieToday()
this.setAllHitMovieDataFormat()
})
},
/**
* 页面滚动事件
* 设置所有热映渲染数据格式
* @function
* @param {object} - funcEvent
* @param
* @returns
*/
onPageScroll: function (funcEvent) {
App.pageScroll(funcEvent, this)
},
setShowHeight: function() {
wx.getSystemInfo({
success: (result) => {
setAllHitMovieDataFormat: function () {
let funcAllHitMovie = this.data.allHitMovie
let funcMovieTypeTag = this.data.movieTypeTag
for (let i = 0, l = funcMovieTypeTag.length; i < l; i++) {
if (funcMovieTypeTag[i].value === '110') funcAllHitMovie[2].title = funcMovieTypeTag[i].text
if (funcMovieTypeTag[i].value === '111') funcAllHitMovie[3].title = funcMovieTypeTag[i].text
if (funcMovieTypeTag[i].value === '112') funcAllHitMovie[4].title = funcMovieTypeTag[i].text
}
this.setData({
windowHeight: result.windowHeight
})
},
allHitMovie: funcAllHitMovie
})
console.log(this.data.allHitMovie)
},
setFooterLocation: function() {
let that = this
let {
windowHeight,
marginTop,
footerFixed
} = this.data
let footerHeight = Math.floor(214 * wx.getStorageSync('unitProportion'))
// 显示高度
let showHeight = windowHeight - footerHeight - marginTop
let query = wx.createSelectorQuery()
query.select('#page').boundingClientRect()
query.exec(function(res) {
if (res[0].height > showHeight) {
footerFixed = false
}
that.setData({
footerFixed
})
})
},
/**
* 查询今日放映
* @function
* @param
* @returns
*/
getTodayFilm: function() {
App.ui.showToast({
iconType: 'loading',
title: '正在获取',
})
queryMovieToday: function() {
App.ui.showToast({ iconType: 'loading', title: '正在获取', })
App.request({
url: 'v1/film/getTodayFilm',
params: {
'pageNo': this.data.queryParams.pageNo,
'pageSize': this.data.queryParams.pageSize,
'pageNo': this.data.pageIndex,
'pageSize': this.data.pageSize,
}
}).then((response) => {
let funcResponse = response.data
let funcList = []
for (let i = 0, l = funcResponse.list.length; i < l; i++) {
let funcItem = {
'id': funcResponse.list[i].activityId,
'entryId': funcResponse.list[i].filmId,
'activityId': funcResponse.list[i].activityId,
'cover': funcResponse.list[i].cover,
'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].visitorPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse.list[i].visitorPrice),
'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': this.ignoreMovieTypeTag(['102', '110', '111','112' ]),
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount || funcItem.priceDiscount === 0) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
funcList.push(funcItem)
}
let funcData = response.data.list
let funcList = this.movieDataFormat(funcData)
console.log('queryMovieToday')
console.log(JSON.stringify(funcList))
App.ui.hideToast()
this.setData({
movieToday: funcList,
}, function() {
this.setFooterLocation()
})
})
},
/**
* 查询全部热映
* 查询所有热映
* @function
* @param
* @returns
*/
getAllFilm: function() {
App.ui.showToast({
iconType: 'loading',
title: '正在获取',
})
// weekType: 0本周热映 1下周
let movieWeek = []
let movieNextWeek = []
//本周热映
queryAllHitMovie: function () {
this.queryMovieThisWeek()
this.queryMovieNextWeek()
this.queryMovieSpecial()
},
/**
* 查询本周热映
* @function
* @param
* @returns
*/
queryMovieThisWeek: function () {
App.ui.showToast({ iconType: 'loading', title: '正在获取', })
App.request({
url: 'v1/film/getAllFilm',
params: {
'pageNo': this.data.queryParams.pageNo,
'pageSize': this.data.queryParams.pageSize,
'pageNo': this.data.pageIndex,
'pageSize': this.data.pageSize,
'weekType': '0'
}
}).then((response) => {
let funcResponse = response.data
let funcList = []
for (let i = 0, l = funcResponse.list.length; i < l; i++) {
let funcItem = {
'id': funcResponse.list[i].activityId,
'entryId': funcResponse.list[i].filmId,
'activityId': funcResponse.list[i].activityId,
'cover': funcResponse.list[i].cover,
'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].visitorPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse.list[i].visitorPrice),
'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': this.ignoreMovieTypeTag(['102', '110', '111','112' ]),
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount || funcItem.priceDiscount === 0) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
funcList.push(funcItem)
}
let funcData = response.data.list
let funcList = this.movieDataFormat(funcData)
App.ui.hideToast()
console.log('queryMovieThisWeek')
console.log(JSON.stringify(funcList))
let funcAllHitMovie = this.data.allHitMovie
funcAllHitMovie[0].list = funcList
this.setData({
'movieAll.movieWeek': {
title: '本周热映',
list: funcList
}
}, function() {
this.setFooterLocation()
allHitMovie: funcAllHitMovie
})
})
},
/**
* 查询下周热映
* @function
* @param
* @returns
*/
queryMovieNextWeek: function() {
App.request({
url: 'v1/film/getAllFilm',
params: {
'pageNo': this.data.queryParams.pageNo,
'pageSize': this.data.queryParams.pageSize,
'pageNo': this.data.pageIndex,
'pageSize': this.data.pageSize,
'weekType': '1'
}
}).then((response) => {
let funcResponse = response.data
let funcList = []
for (let i = 0, l = funcResponse.list.length; i < l; i++) {
let funcItem = {
'id': funcResponse.list[i].activityId,
'entryId': funcResponse.list[i].filmId,
'activityId': funcResponse.list[i].activityId,
'cover': funcResponse.list[i].cover,
'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].visitorPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcResponse.list[i].visitorPrice),
'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': this.ignoreMovieTypeTag(['102', '110', '111','112' ])
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount || funcItem.priceDiscount === 0) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
funcList.push(funcItem)
}
App.ui.hideToast()
let funcData = response.data.list
let funcList = this.movieDataFormat(funcData)
console.log('queryMovieNextWeek')
console.log(JSON.stringify(funcList))
let funcAllHitMovie = this.data.allHitMovie
funcAllHitMovie[1].list = funcList
this.setData({
'movieAll.movieNextWeek': {
title: '下周热映',
list: funcList
}
}, function() {
this.setFooterLocation()
allHitMovie: funcAllHitMovie
})
})
},
ignoreMovieTypeTag: function (funcIgnoreTag) {
let funcRemainTag = []
let funcMovieTypeTag = this.data.movieTypeTag
for (let i = 0, l = funcMovieTypeTag.length; i < l; i++) {
if (!funcIgnoreTag.includes(funcMovieTypeTag[i].value)) funcRemainTag.push(funcMovieTypeTag[i].text)
/**
* 查询专题电影
* @function
* @param
* @returns
*/
queryMovieSpecial: function () {
App.request({
url: 'v1/film/getAllFilm',
params: {
'pageNo': this.data.pageIndex,
'pageSize': this.data.pageSize,
'tagIds': '110,111,112',
}
return funcRemainTag
}).then((response) => {
let funcData = response.data.list
let funcList = this.movieDataFormat(funcData)
console.log('queryMovieSpecial')
console.log(JSON.stringify(funcList))
let funcAllHitMovie = this.data.allHitMovie
for (let i = 0, l = funcList.length; i < l; i++) {
if (funcList[i].tagId.includes('110')) funcAllHitMovie[2].list.push(funcList[i])
if (funcList[i].tagId.includes('111')) funcAllHitMovie[3].list.push(funcList[i])
if (funcList[i].tagId.includes('112')) funcAllHitMovie[4].list.push(funcList[i])
}
this.setData({
allHitMovie: funcAllHitMovie
})
})
},
// 切换今日放映 全部热映
onSelectionStatus: function(event) {
let statusActive = Number(event.currentTarget.dataset.type)
if (statusActive === 0) {
this.getTodayFilm()
} else {
this.getAllFilm()
}
onSelectionTab: function(event) {
let funcTabActiveIndex = Number(event.currentTarget.dataset.type)
funcTabActiveIndex === 0 ? this.queryMovieToday() : this.queryAllHitMovie()
this.setData({
statusActive
tabActiveIndex: funcTabActiveIndex
})
},
// 跳转到电影详情页面
onToMovieDetail: function(event) {
let movieId = event.currentTarget.dataset.movieid
onMovieDetail: function(event) {
let funcItem = event.currentTarget.dataset.item
wx.navigateTo({
url: '/pages/play/movie-detail/movie-detail?id=' + movieId,
url: '/pages/play/movie-detail/movie-detail?id=' + funcItem.id,
})
},
// 跳转到报名页面
......@@ -384,5 +257,80 @@ Page({
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=7',
})
},
/**
* 格式化电影信息数据
* @function
* @param {array} - funcMovieDataList
* @returns
*/
movieDataFormat: function (funcMovieDataList) {
let funcList = []
for (let i = 0, l = funcMovieDataList.length; i < l; i++) {
let funcItem = {
'id': funcMovieDataList[i].activityId,
'entryId': funcMovieDataList[i].filmId,
'activityId': funcMovieDataList[i].activityId,
'cover': funcMovieDataList[i].cover,
'endTime': funcMovieDataList[i].endTime + ' 散场',
'beginTime': funcMovieDataList[i].beginTime,
'keyword': funcMovieDataList[i].keyword,
'filmName': funcMovieDataList[i].filmName,
'filmType': funcMovieDataList[i].filmType,
'filmDirector': funcMovieDataList[i].filmDirector,
'filmLead': funcMovieDataList[i].filmLead,
'price': funcMovieDataList[i].visitorPrice, // 普通价
'priceText': App.modular.utils.formatAmount(funcMovieDataList[i].visitorPrice),
'priceSpecial': funcMovieDataList[i].ownerPrice, // 业主价
'priceSpecialText': App.modular.utils.formatAmount(funcMovieDataList[i].ownerPrice),
'priceDiscount': funcMovieDataList[i].price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcMovieDataList[i].price),
'priceType': 1,
'tags': this.ignoreMovieTypeTag(['102', '110', '111','112' ]),
'tagId': funcMovieDataList[i].tagIds.split(','),
}
let funcUserType = wx.getStorageSync('userInfo').userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if (funcItem.priceDiscount || funcItem.priceDiscount === 0) {
funcItem.priceType = 1
} else {
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if (funcItem.price !== funcItem.priceSpecial && funcUserType) {
funcItem.priceType = 2
} else {
funcItem.priceType = 3
}
}
funcList.push(funcItem)
}
return funcList
},
/**
* 过滤电影标签
* @function
* @param {array} - funcIgnoreTag
* @returns
*/
ignoreMovieTypeTag: function (funcIgnoreTag) {
let funcRemainTag = []
let funcMovieTypeTag = this.data.movieTypeTag
for (let i = 0, l = funcMovieTypeTag.length; i < l; i++) {
if (!funcIgnoreTag.includes(funcMovieTypeTag[i].value)) funcRemainTag.push(funcMovieTypeTag[i].text)
}
return funcRemainTag
},
/**
* 页面滚动事件
* @function
* @param {object} - funcEvent
* @returns
*/
onPageScroll: function (funcEvent) {
App.pageScroll(funcEvent, this)
},
})
\ No newline at end of file
<m-toast></m-toast>
<m-nav titleText="所有影片" scrollHeight="{{navScroll}}" changeHeight="50rpx" styleIndex="{{7}}"></m-nav>
<m-nav titleText="所有影片" scrollHeight="{{navScroll}}" styleIndex="{{7}}"></m-nav>
<view class="status row align-c" style="{{'top: ' + navHeight + 'px'}}">
<block wx:for="{{statusList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="status-item row con-c align-c" data-type="{{index}}" bindtap="onSelectionStatus">
<view class="row con-c align-c {{index === statusActive ? 'status-item-active' : ''}}">
<view class="status row align-c">
<block wx:for="{{tabList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="status-item row con-c align-c" data-type="{{index}}" bindtap="onSelectionTab">
<view class="row con-c align-c {{index === tabActiveIndex ? 'status-item-active' : 'status-item-inactive'}}">
<text>{{item.name}}</text>
</view>
</view>
</block>
</view>
<view id="page" class="contaniner con-s" style="{{'margin-top: ' + (navHeight + classHeight) + 'px;'}}">
<view wx:if="{{statusActive === 0}}">
<block wx:for="{{movieToday}}" wx:for-index="index" wx:for-item="item" wx:key="index" wx:if="{{movieToday.length !== 0}}">
<view class="movie-wrapper row" bindtap="onToMovieDetail" data-movieId="{{item.activityId}}">
<view class="contaniner column">
<!-- 今日放映 -->
<view wx:if="{{tabActiveIndex === 0}}">
<block wx:for="{{movieToday}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="movie-wrapper row" data-item="{{item}}" bindtap="onMovieDetail">
<view class="movie-time-wrapper row align-c">
<view class="movie-time-start">
<text>{{item.beginTime}}</text>
......@@ -31,7 +32,8 @@
<view class="movie-info-wrapper">
<view class="movie-name-wrapper row ac">
<text class="movie-name">{{item.filmName}}</text>
<block wx:for="{{item.tags}}" wx:for-index="indexTags" wx:for-item="itemTags" wx:key="indexTags">
<block wx:for="{{item.tags}}" wx:for-index="indexTags" wx:for-item="itemTags"
wx:key="indexTags">
<text class="movie-tags">{{itemTags}}</text>
</block>
</view>
......@@ -72,7 +74,6 @@
<text>{{item.price === 0 ? '免费' : '¥' + item.priceText}}</text>
</view>
<view class="movie-btn" data-item="{{item}}">
<!-- <view class="movie-btn" catchtap="onReportMovie" data-item="{{item}}"> -->
<text>报名观影</text>
</view>
</view>
......@@ -80,33 +81,34 @@
</view>
</block>
<block wx:if="{{movieToday.length === 0 && !loading}}">
<view class="show-end col align-c">
<view class="show-end col align-c" wx:if="{{movieToday.length === 0}}">
<image src="{{resourcesBase + 'play/no-movie.png'}}"></image>
<text>观影已结束,请期待后续排片</text>
</view>
</block>
</view>
<view wx:if="{{statusActive === 1}}">
<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="line"></view>
<view class="movie-week-title">
<image class="star-left" src="/image/star-left.png"></image>
<text>{{movieList.title}}</text>
<image class="star-right" src="/image/star-right.png"></image>
</view>
<view class="line"></view>
</view>
<block wx:for="{{movieList.list}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="all-movie-wrapper" bindtap="onToMovieDetail" data-movieId="{{item.activityId}}">
<!-- 全部热映 -->
<view wx:if="{{tabActiveIndex === 1}}">
<block wx:for="{{allHitMovie}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="hitmovie_special_wrap row cc ac" wx:if="{{item.list.length > 0}}">
<view class="hitmovie_special_line"></view>
<view class="hitmovie_special_title_wrap row cb ac">
<image class="hitmovie_special_title_ornament" src="./image/star-01.png"></image>
<text class="hitmovie_special_title font_bold_22">{{item.title}}</text>
<image class="hitmovie_special_title_ornament" src="./image/star-03.png"></image>
</view>
<view class="hitmovie_special_line"></view>
</view>
<block wx:for="{{item.list}}" wx:for-index="indexMovie" wx:for-item="itemMovie" wx:key="indexMovie">
<view class="all-movie-wrapper" data-item="{{itemMovie}}" bindtap="onMovieDetail">
<view class="all-movie-cover">
<image src="{{item.cover}}"></image>
<image src="{{itemMovie.cover}}"></image>
</view>
<view class="movie-info-wrapper">
<view class="movie-name-wrapper row ac">
<text class="movie-name">{{item.filmName}}</text>
<block wx:for="{{item.tags}}" wx:for-index="indexTags" wx:for-item="itemTags" wx:key="indexTags">
<text class="movie-name">{{itemMovie.filmName}}</text>
<block wx:for="{{itemMovie.tags}}" wx:for-index="indexTags" wx:for-item="itemTags"
wx:key="indexTags">
<text class="movie-tags">{{itemTags}}</text>
</block>
</view>
......@@ -115,7 +117,7 @@
<text>类型</text>
</view>
<view class="movie-info-right">
<text>{{item.filmType}}</text>
<text>{{itemMovie.filmType}}</text>
</view>
</view>
<view class="movie-info row">
......@@ -123,7 +125,7 @@
<text>导演</text>
</view>
<view class="movie-info-right">
<text>{{item.filmDirector}}</text>
<text>{{itemMovie.filmDirector}}</text>
</view>
</view>
<view class="movie-info row">
......@@ -131,37 +133,38 @@
<text>主演</text>
</view>
<view class="movie-info-right">
<text>{{item.filmLead}}</text>
<text>{{itemMovie.filmLead}}</text>
</view>
</view>
<view class="movie-label">
<text wx:if="{{item.keyword}}">{{item.keyword}}</text>
<text wx:if="{{itemMovie.keyword}}">{{itemMovie.keyword}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 1}}">
<text>{{item.priceDiscount === 0 ? '免费' : '¥' + item.priceDiscountText}}</text>
<view class="movie-free" wx:if="{{itemMovie.priceType === 1}}">
<text>{{itemMovie.priceDiscount === 0 ? '免费' : '¥' + itemMovie.priceDiscountText}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 2}}">
<text>{{item.priceSpecial === 0 ? '免费' : '¥' + item.priceSpecialText}}</text>
<view class="movie-free" wx:if="{{itemMovie.priceType === 2}}">
<text>{{itemMovie.priceSpecial === 0 ? '免费' : '¥' + itemMovie.priceSpecialText}}</text>
</view>
<view class="movie-free" wx:if="{{item.priceType === 3}}">
<text>{{item.price === 0 ? '免费' : '¥' + item.priceText}}</text>
<view class="movie-free" wx:if="{{itemMovie.priceType === 3}}">
<text>{{itemMovie.price === 0 ? '免费' : '¥' + itemMovie.priceText}}</text>
</view>
<!-- <view class="movie-btn" catchtap="onReportMovie" data-item="{{item}}"> -->
<view class="movie-btn" data-item="{{item}}">
<view class="movie-btn" data-item="{{itemMovie}}">
<text>报名观影</text>
</view>
</view>
</view>
</block>
</block>
<block wx:if="{{movieAll.movieWeek.list.length === 0 && movieAll.movieNextWeek.list.length === 0 && !loading}}">
<block wx:if="{{movieAll.movieWeek.list.length === 0}}">
<view class="show-end col align-c">
<image src="{{resourcesBase + 'play/no-movie.png'}}"></image>
<text>观影已结束,请期待后续排片</text>
</view>
</block>
</view>
<view class="footer-img {{footerFixed ? 'footer-fixed' : ''}}">
<view class="footer-img row cc ae">
<image src="/image/movie-bottom.png"></image>
</view>
</view>
\ No newline at end of file
page {
min-height: 100vh;
background-color: #1C1C25;
}
.contaniner {
flex-grow: 1;
}
/* 状态筛选菜单 */
.status {
z-index: 2;
position: fixed;
left: 0;
width: 750rpx;
height: 120rpx;
background-color: #1C1C25;
border-bottom: 1rpx #3A3A40 solid;
}
.status-item {
flex: 1;
height: 120rpx;
height: 60rpx;
font-size: 26rpx;
font-weight: 400;
line-height: 36rpx;
......@@ -23,12 +25,16 @@ page {
}
.status-item-active {
height: 120rpx;
color: #fff;
height: 60rpx;
font-weight: 600;
border-bottom: 4rpx #fff solid;
}
.status-item-inactive {
height: 60rpx;
}
.movie-wrapper {
position: relative;
width: 670rpx;
......@@ -159,39 +165,12 @@ page {
letter-spacing: 3rpx;
line-height: 44rpx;
}
.movie-week-title {
position: relative;
margin: 0 8rpx;
padding: 8rpx 40rpx 4rpx;
}
.star-left {
position: absolute;
left: 0;
bottom: 0;
width: 36rpx;
height: 8rpx;
}
.star-right {
position: absolute;
right: 0;
top: 0;
width: 68rpx;
height: 40rpx;
}
.line {
width: 80rpx;
height: 1rpx;
background: #3A3A40;
}
.all-movie-wrapper {
position: relative;
width: 670rpx;
height: 366rpx;
margin: 80rpx auto 0;
margin: 72rpx 40rpx 8rpx 40rpx;
padding: 32rpx 32rpx 32rpx 278rpx;
background: #272734;
border-radius: 4rpx;
......@@ -206,6 +185,7 @@ page {
border-radius: 4rpx;
}
.footer-img {
flex-grow: 1;
width: 750rpx;
height: 150rpx;
margin-top: 64rpx;
......@@ -234,3 +214,46 @@ image {
width: 100%;
height: 100%;
}
/* 全部热映 */
.hitmovie_special_wrap {
margin: 60rpx 0 0 0;
}
.hitmovie_special {
display: inline-block;
width: 100%;
color: #C2C7CF;
}
.hitmovie_special_line {
display: inline-block;
min-width: 80rpx;
height: 1px;
margin: 0 48rpx;
background: #292931;
}
.hitmovie_special_title_wrap {
position: relative;
}
.hitmovie_special_title {
color: #C2C7CF;
}
.hitmovie_special_title_ornament:nth-child(1) {
position: absolute;
left: -40rpx;
bottom: 0;
width: 36rpx;
height: 8rpx;
}
.hitmovie_special_title_ornament:nth-child(3) {
position: absolute;
right: -40rpx;
bottom: 0;
width: 68rpx;
height: 40rpx;
}
\ No newline at end of file
......@@ -28,12 +28,12 @@
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"enableEngineNative": false,
"minifyWXSS": true
},
"compileType": "miniprogram",
......
......@@ -29,6 +29,7 @@ function emit (wxObject) {
if (funcPageList[i].route === funcReceivePagePath) {
funcPageList[i].onCatchNewEvent(object.event)
console.log(funcPageList[i][object.event.type])
if (typeof funcPageList[i][object.event.type] === 'function' ) funcPageList[i][object.event.type]()
break
}
......@@ -50,12 +51,13 @@ function navigateBack (wxObject) {
console.log('[extend api] navigateBack', object)
if (object && object.event && inspectEventFormat(object.event)) {
let funcPageList = getCurrentPages()
let funcReceivePagePath = object.event.receivePage ? object.event.receivePage : funcPageList[funcPageList.length - 1].route
let funcReceivePagePath = object.event.receivePage ? object.event.receivePage : funcPageList[funcPageList.length - 2].route
if (funcPageList.length > 1) {
for (let i = funcPageList.length - 1; 0 <= i; i--) {
if (funcPageList[i].route === funcReceivePagePath) {
funcPageList[i].onCatchNewEvent(object.event)
console.log(funcPageList[i])
if (typeof funcPageList[i][object.event.type] === 'function' ) funcPageList[i][object.event.type]()
break
}
......
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