Commit ce27434a by wjw

ww-电影bug修改,首页儿童营地接口

parent e61124d2
...@@ -12,16 +12,7 @@ Page({ ...@@ -12,16 +12,7 @@ Page({
winSide: true, winSide: true,
sideHeight: 1250, sideHeight: 1250,
swiperImage: [ swiperImage: [],
{
id: 0,
url: ''
},
{
id: 0,
url: ''
}
],
bannerImage: '', bannerImage: '',
detailImage: [], detailImage: [],
...@@ -46,9 +37,19 @@ Page({ ...@@ -46,9 +37,19 @@ Page({
sideHeight: this.data.sideHeight * wx.getStorageSync('unitProportion') sideHeight: this.data.sideHeight * wx.getStorageSync('unitProportion')
}) })
}, },
// 获取后台信息
queryDetail: function () { queryDetail: function () {
let that = this
App.wxRequest({
url: '/api/v1/park/getList',
success: function(res) {
let funcData = res.list.filter(v => v.name === '儿童营地')
that.setData({
swiperImage: funcData[0].rotationImg,
detailImageUrl: funcData[0].content
})
}
})
}, },
onBackTop: function () { onBackTop: function () {
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<!-- 滚动图片 --> <!-- 滚动图片 -->
<!-- 单张图片 --> <!-- 单张图片 -->
<view class="swiper" wx:if="{{swiperImage.length === 1}}"> <view class="swiper" wx:if="{{swiperImage.length <= 1}}">
</view> </view>
<!-- 多张图片 --> <!-- 多张图片 -->
......
let App = getApp()
Page({ Page({
data: { data: {
history: {}
}, },
onLoad: function (options) { onLoad: function (options) {
let { index } = options
this.getBrands(index)
},
getBrands: function (index) {
let that = this
App.wxRequest({
url: '/api/v1/common/getBrands',
success: function(res) {
let history = res.data[index]
that.setData({
history
})
}
})
}, },
}) })
\ No newline at end of file
<!--pages/home/home/home.wxml--> <navigation class="navigation" titleText="{{history.name}}" backIcon="/image/back.png"></navigation>
<text>pages/home/home/home.wxml</text>
<view class="container">
<block wx:for="{{history.content}}" wx:key="index">
<image mode="widthFix" src="{{item}}"></image>
</block>
</view>
\ No newline at end of file
/* pages/home/home/home.wxss */ .container {
\ No newline at end of file margin-top: 208rpx;
}
image {
width: 750rpx;
}
\ No newline at end of file
...@@ -56,20 +56,7 @@ Page({ ...@@ -56,20 +56,7 @@ Page({
pageSize: 10, pageSize: 10,
// 底部图片数据 // 底部图片数据
footerImage: [ footerImage: []
{
id: 0,
url: ''
},
{
id: 1,
url: ''
},
{
id: 2,
url: ''
}
]
}, },
onLoad: function (options) { onLoad: function (options) {
...@@ -86,6 +73,7 @@ Page({ ...@@ -86,6 +73,7 @@ Page({
that.getBanner() that.getBanner()
that.loadVisiterPlanList() that.loadVisiterPlanList()
that.getNoticeList() that.getNoticeList()
that.getBrands()
} }
}) })
}, },
...@@ -355,7 +343,28 @@ Page({ ...@@ -355,7 +343,28 @@ Page({
// 跳转到登录 // 跳转到登录
onLogin: function () { onLogin: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/login/login', url: '/pages/login/login'
})
},
// 获取品牌故事
getBrands: function () {
let that = this
App.wxRequest({
url: '/api/v1/common/getBrands',
success: function(res) {
let funcData = res.data
that.setData({
footerImage: funcData
})
}
})
},
// 跳转到品牌故事详情页面
onToHistory: function (event) {
let { index } = event.currentTarget.dataset
console.log(index)
wx.navigateTo({
url: '/pages/home/history/history?index=' + index,
}) })
}, },
onTest: function (event) { onTest: function (event) {
......
...@@ -100,8 +100,8 @@ ...@@ -100,8 +100,8 @@
</view> </view>
<view class="footer"> <view class="footer">
<block wx:for="{{footerImage}}" wx:key="index"> <block wx:for="{{footerImage}}" wx:key="brandId">
<image src="{{item.url}}"></image> <image src="{{item.cover}}" bindtap="onToHistory" data-index="{{index}}"></image>
</block> </block>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -325,7 +325,6 @@ ...@@ -325,7 +325,6 @@
width: 750rpx; width: 750rpx;
height: 1148rpx; height: 1148rpx;
margin-bottom: 40rpx; margin-bottom: 40rpx;
background-color: #ccc;
} }
.footer image:last-child { .footer image:last-child {
......
...@@ -19,6 +19,9 @@ Page({ ...@@ -19,6 +19,9 @@ Page({
}, },
success: (response) => { success: (response) => {
let movieInfo = response.data let movieInfo = response.data
// for (let key in movieInfo.allTimes) {
// console.log(key)
// }
let showList = {} let showList = {}
showList[0] = movieInfo.today showList[0] = movieInfo.today
showList[1] = movieInfo.tomorrow showList[1] = movieInfo.tomorrow
...@@ -42,6 +45,7 @@ Page({ ...@@ -42,6 +45,7 @@ Page({
day = '0' + day day = '0' + day
} }
console.log(month, day) console.log(month, day)
console.log(App.modular.miment().format('YYYY-MM-DD'))
this.setData({ this.setData({
statusList: [ statusList: [
{ 'id': 0, 'name': `今日${month}${day}日`}, { 'id': 0, 'name': `今日${month}${day}日`},
...@@ -67,4 +71,12 @@ Page({ ...@@ -67,4 +71,12 @@ Page({
bannerIndex: funcEvent.detail.current bannerIndex: funcEvent.detail.current
}) })
}, },
// 跳转到报名页面
onReportMovie: function (event) {
let id = event.currentTarget.dataset.movieid
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=' + '7' + '&id=' + id,
})
}
}) })
\ No newline at end of file
<navigation class="navigation" titleText="{{movieInfo.filmName}}" color="#ffffff" backIcon="/image/back-w.png"></navigation> <navigation class="navigation" titleText="{{movieInfo.filmName}}" color="#ffffff" backIcon="/image/back-w.png"></navigation>
<view class="container"> <view class="container">
<!-- 顶部轮播图 -->
<view class="banner"> <view class="banner">
<swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="onSwiperChange"> <swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="onSwiperChange">
<block wx:for="{{movieInfo.banners}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{movieInfo.banners}}" wx:for-index="index" wx:for-item="item" wx:key="index">
...@@ -18,7 +19,7 @@ ...@@ -18,7 +19,7 @@
<image src="/image/ornament-2-black.png" mode="widthFix"></image> <image src="/image/ornament-2-black.png" mode="widthFix"></image>
</view> </view>
</view> </view>
<!-- 电影信息 -->
<view class="movie-wrapper"> <view class="movie-wrapper">
<view class="movie-cover"> <view class="movie-cover">
<image src="{{movieInfo.cover}}"></image> <image src="{{movieInfo.cover}}"></image>
...@@ -52,13 +53,14 @@ ...@@ -52,13 +53,14 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 无场次 -->
<view class="show-end col align-c" wx:if="{{false}}"> <view class="show-end col align-c" wx:if="{{false}}">
<image src=""></image> <image src=""></image>
<text>观影已结束,请期待后续排片</text> <text>观影已结束,请期待后续排片</text>
</view> </view>
<!-- 有场次 -->
<view wx:else> <view wx:else>
<!-- 场次日期选择 -->
<view class="status row align-c"> <view class="status row align-c">
<block wx:for="{{statusList}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <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="status-item row con-c align-c" data-type="{{index}}" bindtap="onSelectionStatus">
...@@ -68,19 +70,19 @@ ...@@ -68,19 +70,19 @@
</view> </view>
</block> </block>
</view> </view>
<!-- 场次列表 -->
<block wx:for="{{showList[statusActive]}}" wx:key="id"> <block wx:for="{{showList[statusActive]}}" wx:key="id">
<view class="show-wrapper row align-c"> <view class="show-wrapper row align-c">
<view class="show-time-start"> <view class="show-time-start">
<text>{{item.beginTime}}</text> <text>{{item.beginTime}}</text>
</view> </view>
<view class="show-time-end"> <view class="show-time-end">
<text>{{item.endTime}}</text> <text>{{item.endTime + '散场'}}</text>
</view> </view>
<view class="show-free"> <view class="show-free">
<text>{{item.ownerPrice === 0 ? '免费' : item.ownerPrice}}</text> <text>{{item.ownerPrice === 0 ? '免费' : item.ownerPrice}}</text>
</view> </view>
<view class="show-btn"> <view class="show-btn" bindtap="onReportMovie" data-movieId="{{item.filmId}}">
<text>报名观影</text> <text>报名观影</text>
</view> </view>
</view> </view>
......
...@@ -64,6 +64,7 @@ page { ...@@ -64,6 +64,7 @@ page {
height: 32rpx; height: 32rpx;
margin-top: 6rpx; margin-top: 6rpx;
margin-left: 12rpx; margin-left: 12rpx;
color: #fff;
font-size: 20rpx; font-size: 20rpx;
text-align: center; text-align: center;
line-height: 32rpx; line-height: 32rpx;
...@@ -146,6 +147,7 @@ page { ...@@ -146,6 +147,7 @@ page {
font-size: 26rpx; font-size: 26rpx;
} }
.show-free { .show-free {
width: 60rpx;
margin-left: 130rpx; margin-left: 130rpx;
color: #fff; color: #fff;
font-size: 26; font-size: 26;
......
...@@ -51,6 +51,12 @@ Page({ ...@@ -51,6 +51,12 @@ Page({
} }
}) })
}, },
/**
* 查询全部热映
* @function
* @param
* @returns
*/
getAllFilm: function () { getAllFilm: function () {
// weekType: 0本周热映 1下周 // weekType: 0本周热映 1下周
let movieWeek = [] let movieWeek = []
...@@ -104,9 +110,16 @@ Page({ ...@@ -104,9 +110,16 @@ Page({
}) })
}, },
// 切换今日放映 全部热映
onSelectionStatus: function (event) { onSelectionStatus: function (event) {
let statusActive = Number(event.currentTarget.dataset.type)
if (statusActive === 0) {
this.getTodayFilm()
} else {
this.getAllFilm()
}
this.setData({ this.setData({
statusActive: Number(event.currentTarget.dataset.type) statusActive
}) })
}, },
// 跳转到电影详情页面 // 跳转到电影详情页面
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<view class="movie-time-end"> <view class="movie-time-end">
<text>{{item.endTime}}</text> <text>{{item.endTime}}</text>
</view> </view>
<image class="time-star" src=""></image> <image class="time-star" src="/image/star-time.png"></image>
</view> </view>
<view class="row"> <view class="row">
<view class="movie-cover"> <view class="movie-cover">
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<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">
<image class="star-left" src=""></image> <image class="star-left" src="/image/star-left.png"></image>
<text>{{movieList.title}}</text> <text>{{movieList.title}}</text>
<image class="star-right" src="/image/star-right.png"></image> <image class="star-right" src="/image/star-right.png"></image>
</view> </view>
......
...@@ -10,7 +10,7 @@ page { ...@@ -10,7 +10,7 @@ page {
.status { .status {
width: 750rpx; width: 750rpx;
height: 112rpx; height: 112rpx;
border-bottom: 1px #E2E7EF solid; border-bottom: 1px #3A3A40 solid;
} }
.status-item { .status-item {
flex: 1; flex: 1;
...@@ -61,7 +61,6 @@ page { ...@@ -61,7 +61,6 @@ page {
right: 0; right: 0;
width: 64rpx; width: 64rpx;
height: 20rpx; height: 20rpx;
background-color: #ccc;
} }
.movie-cover { .movie-cover {
...@@ -84,16 +83,21 @@ page { ...@@ -84,16 +83,21 @@ page {
white-space:nowrap; white-space:nowrap;
} }
.movie-dimensional { .movie-dimensional {
width: 52rpx;
height: 32rpx; height: 32rpx;
max-width: 110rpx;
padding: 0 13rpx;
margin-top: 6rpx; margin-top: 6rpx;
margin-left: 12rpx; margin-left: 12rpx;
color: #fff;
font-size: 20rpx; font-size: 20rpx;
text-align: center; text-align: center;
line-height: 32rpx; line-height: 32rpx;
background: #15191F; background: #15191F;
opacity: .5; opacity: .5;
border-radius: 4rpx; border-radius: 4rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.movie-info { .movie-info {
margin-top: 8rpx; margin-top: 8rpx;
...@@ -164,7 +168,6 @@ page { ...@@ -164,7 +168,6 @@ page {
bottom: 0; bottom: 0;
width: 36rpx; width: 36rpx;
height: 8rpx; height: 8rpx;
background-color: #ccc;
} }
.star-right { .star-right {
position: absolute; position: absolute;
...@@ -172,7 +175,6 @@ page { ...@@ -172,7 +175,6 @@ page {
top: 0; top: 0;
width: 68rpx; width: 68rpx;
height: 40rpx; height: 40rpx;
background-color: #ccc;
} }
.line { .line {
......
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