Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
89b09175
authored
Sep 14, 2020
by
wjw
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ww-电影接口
parent
8530a62f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
193 additions
and
207 deletions
pages/play/movie-detail/movie-detail.js
pages/play/movie-detail/movie-detail.wxml
pages/play/movie/movie.js
pages/play/movie/movie.wxml
pages/play/movie/movie.wxss
pages/play/movie-detail/movie-detail.js
View file @
89b09175
let
App
=
getApp
()
Page
({
data
:
{
movieName
:
'龙猫'
,
bannerIndex
:
0
,
bannerStyle
:
1
,
isMovieEnd
:
false
,
banner
:
[
{
id
:
0
,
img
:
''
},
{
id
:
1
,
img
:
''
},
{
id
:
2
,
img
:
''
}
],
statusActive
:
0
,
statusList
:
[
{
'id'
:
0
,
'name'
:
'今日08月12日'
},
{
'id'
:
1
,
'name'
:
'明日08月13日'
},
],
movieInfo
:
{
name
:
'龙猫'
,
cover
:
''
,
type
:
'动画 / 奇幻 / 冒险'
,
director
:
'宫崎骏'
,
dimensional
:
'5D'
,
actor
:
'日高法子 坂本千夏 糸井重里 岛本须美 北林谷荣 高木均 雨笠利 雨笠利'
},
showList
:
{
0
:
[
{
id
:
0
,
timeStart
:
'09:00'
,
timeEnd
:
'11:35散场'
,
free
:
'免费'
},
{
id
:
1
,
timeStart
:
'13:00'
,
timeEnd
:
'15:35散场'
,
free
:
'免费'
}
],
1
:
[
{
id
:
0
,
timeStart
:
'1'
,
timeEnd
:
'1'
,
free
:
'免费'
},
{
id
:
1
,
timeStart
:
'1'
,
timeEnd
:
'1'
,
free
:
'免费'
}
]
}
statusList
:
[],
movieInfo
:
{},
showList
:
{},
free
:
'免费'
},
onLoad
:
function
(
options
)
{
let
activityId
=
options
.
id
App
.
wxRequest
({
url
:
'/api/v1/film/getFilmDetail'
,
data
:
{
'activityId'
:
activityId
,
},
success
:
(
response
)
=>
{
let
movieInfo
=
response
.
data
let
showList
=
{}
showList
[
0
]
=
movieInfo
.
today
showList
[
1
]
=
movieInfo
.
tomorrow
this
.
setData
({
movieInfo
,
showList
})
}
})
this
.
getNowTime
()
},
// 获取标签日期
getNowTime
:
function
()
{
let
now
=
new
Date
()
let
month
=
now
.
getMonth
()
+
1
let
day
=
now
.
getDate
()
if
(
month
<
10
)
{
month
=
'0'
+
month
}
if
(
day
<
10
)
{
day
=
'0'
+
day
}
console
.
log
(
month
,
day
)
this
.
setData
({
statusList
:
[
{
'id'
:
0
,
'name'
:
`今日
${
month
}
月
${
day
}
日`
},
{
'id'
:
1
,
'name'
:
`今日
${
month
}
月
${
day
+
1
}
日`
},
],
})
},
// 选择标签页日期
onSelectionStatus
:
function
(
event
)
{
console
.
log
(
event
.
currentTarget
.
dataset
.
type
)
this
.
setData
({
...
...
pages/play/movie-detail/movie-detail.wxml
View file @
89b09175
...
...
@@ -3,10 +3,9 @@
<view class="container">
<view class="banner">
<swiper autoplay circular class="banner-swiper" indicator-dots="{{false}}" interval="5000" duration="500" bindchange="onSwiperChange">
<block wx:for="{{
banner
}}" 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">
<swiper-item class="banner-swiper-item" data-item="{{item}}" bindtap="bannerClick">
{{item.id}}
<image class="banner-swiper-image" src="{{item.img}}"></image>
<image class="banner-swiper-image" src="{{item}}"></image>
</swiper-item>
</block>
</swiper>
...
...
@@ -20,15 +19,15 @@
</view>
</view>
<view class="movie-wrapper"
bindtap="onToMovieDetail"
>
<view class="movie-wrapper">
<view class="movie-cover">
<image src="{{
item
.cover}}"></image>
<image src="{{
movieInfo
.cover}}"></image>
</view>
<view class="movie-info-wrapper">
<view class="movie-name row">
<text>{{movieInfo.
n
ame}}</text>
<text>{{movieInfo.
filmN
ame}}</text>
<view class="movie-dimensional">
<text>{{movieInfo.
dimensional
}}</text>
<text>{{movieInfo.
tags
}}</text>
</view>
</view>
<view class="movie-info row">
...
...
@@ -36,7 +35,7 @@
<text>类型</text>
</view>
<view class="movie-info-right">
<text>{{movieInfo.
t
ype}}</text>
<text>{{movieInfo.
filmT
ype}}</text>
</view>
</view>
<view class="movie-info row">
...
...
@@ -44,17 +43,17 @@
<text>导演</text>
</view>
<view class="movie-info-right">
<text>{{movieInfo.
d
irector}}</text>
<text>{{movieInfo.
filmD
irector}}</text>
</view>
</view>
<view class="movie-info-actor">
<text class="movie-actor">主演</text>
<text class="actor">{{movieInfo.
actor
}}</text>
<text class="actor">{{movieInfo.
filmLead
}}</text>
</view>
</view>
</view>
<view class="show-end col align-c" wx:if="{{
isMovieEnd
}}">
<view class="show-end col align-c" wx:if="{{
false
}}">
<image src=""></image>
<text>观影已结束,请期待后续排片</text>
</view>
...
...
@@ -73,13 +72,13 @@
<block wx:for="{{showList[statusActive]}}" wx:key="id">
<view class="show-wrapper row align-c">
<view class="show-time-start">
<text>{{item.
timeStart
}}</text>
<text>{{item.
beginTime
}}</text>
</view>
<view class="show-time-end">
<text>{{item.
timeEnd
}}</text>
<text>{{item.
endTime
}}</text>
</view>
<view class="show-free">
<text>{{
item.
free}}</text>
<text>{{free}}</text>
</view>
<view class="show-btn">
<text>报名观影</text>
...
...
pages/play/movie/movie.js
View file @
89b09175
let
App
=
getApp
()
Page
({
data
:
{
btn
:
'报名观影'
,
// 请求参数
queryParams
:
{
pageNo
:
'1'
,
pageSize
:
'-1'
},
statusActive
:
0
,
statusList
:
[
{
'id'
:
0
,
'name'
:
'今日放映'
},
{
'id'
:
1
,
'name'
:
'全部热映'
},
],
movieToday
:
[
{
id
:
0
,
cover
:
''
,
timeStart
:
'09:00'
,
timeEnd
:
'10:35 散场'
,
name
:
'龙猫'
,
dimensional
:
'5D'
,
type
:
'动画 / 奇幻 / 冒险'
,
actor
:
'日高法子 坂本千夏 糸井重里'
,
director
:
'宫崎骏'
,
label
:
'暖心重映'
,
free
:
'免费'
,
},
{
id
:
1
,
cover
:
''
,
timeStart
:
'11:00'
,
timeEnd
:
'12:35 散场'
,
name
:
'千与千寻'
,
dimensional
:
'2D'
,
type
:
'剧情 / 动画 / 奇幻'
,
actor
:
'柊瑠美 入野自由 夏木真理…'
,
director
:
'宫崎骏'
,
label
:
'学会爱 然后长大'
,
free
:
'免费'
,
},
{
id
:
2
,
cover
:
''
,
timeStart
:
'09:00'
,
timeEnd
:
'10:35 散场'
,
name
:
'龙猫'
,
dimensional
:
'5D'
,
type
:
'动画 / 奇幻 / 冒险'
,
actor
:
'日高法子 坂本千夏 糸井重里'
,
director
:
'宫崎骏'
,
label
:
'暖心重映'
,
free
:
'免费'
,
},{
id
:
3
,
cover
:
''
,
timeStart
:
'09:00'
,
timeEnd
:
'10:35 散场'
,
name
:
'龙猫'
,
dimensional
:
'5D'
,
type
:
'动画 / 奇幻 / 冒险'
,
actor
:
'日高法子 坂本千夏 糸井重里'
,
director
:
'宫崎骏'
,
label
:
'暖心重映'
,
free
:
'免费'
,
}
],
// 今日热映
movieToday
:
[],
//全部热映
movieAll
:
{
movieWeek
:
{
title
:
'本周热映'
,
list
:
[
{
id
:
0
,
cover
:
''
,
name
:
'龙猫'
,
dimensional
:
'5D'
,
type
:
'动画 / 奇幻 / 冒险'
,
actor
:
'日高法子 坂本千夏 糸井重里'
,
director
:
'宫崎骏'
,
label
:
'暖心重映'
,
free
:
'免费'
,
},
{
id
:
1
,
cover
:
''
,
name
:
'龙猫'
,
dimensional
:
'5D'
,
type
:
'动画 / 奇幻 / 冒险'
,
actor
:
'日高法子 坂本千夏 糸井重里'
,
director
:
'宫崎骏'
,
label
:
'暖心重映'
,
free
:
'免费'
,
}
]
list
:
[]
},
movieNextWeek
:
{
title
:
'下周热映'
,
list
:
[
{
id
:
0
,
cover
:
''
,
name
:
'海上钢琴师'
,
dimensional
:
'3D'
,
type
:
'剧情 / 音乐'
,
actor
:
'蒂姆·罗斯 普路特·泰勒…'
,
director
:
'朱塞佩·托纳多雷'
,
label
:
'琴键有限 人生无限'
,
free
:
'免费'
,
},
{
id
:
1
,
cover
:
''
,
name
:
'绿皮书'
,
dimensional
:
'2D'
,
type
:
'剧情 / 喜剧 / 传记'
,
actor
:
'维果·莫腾森 马赫沙拉...'
,
director
:
'彼得·法雷里'
,
label
:
'两种人生 一段旅程'
,
free
:
'免费'
,
}
]
list
:
[]
}
}
},
onLoad
:
function
(
options
)
{
onLoad
:
function
()
{
this
.
getTodayFilm
()
this
.
getAllFilm
()
},
/**
* 查询今日放映
* @function
* @param
* @returns
*/
getTodayFilm
:
function
()
{
App
.
wxRequest
({
url
:
'/api/v1/film/getTodayFilm'
,
data
:
{
'pageNo'
:
this
.
data
.
queryParams
.
pageNo
,
'pageSize'
:
this
.
data
.
queryParams
.
pageSize
,
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
let
movieToday
=
funcResponse
.
list
movieToday
.
forEach
(
v
=>
{
v
.
endTime
=
v
.
endTime
+
' 散场'
v
.
filmType
=
v
.
filmType
.
replace
(
/
\/
/g
,
' / '
)
v
.
filmDirector
=
v
.
filmDirector
.
replace
(
/
\/
/g
,
' '
)
v
.
filmLead
=
v
.
filmLead
.
replace
(
/
\/
/g
,
' '
)
})
this
.
setData
({
movieToday
})
}
})
},
getAllFilm
:
function
()
{
// weekType: 0本周热映 1下周
let
movieWeek
=
[]
let
movieNextWeek
=
[]
//本周热映
App
.
wxRequest
({
url
:
'/api/v1/film/getAllFilm'
,
data
:
{
'pageNo'
:
this
.
data
.
queryParams
.
pageNo
,
'pageSize'
:
this
.
data
.
queryParams
.
pageSize
,
'weekType'
:
'0'
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
movieWeek
=
funcResponse
.
list
movieWeek
.
forEach
(
v
=>
{
v
.
filmType
=
v
.
filmType
.
replace
(
/
\/
/g
,
' / '
)
v
.
filmDirector
=
v
.
filmDirector
.
replace
(
/
\/
/g
,
' '
)
v
.
filmLead
=
v
.
filmLead
.
replace
(
/
\/
/g
,
' '
)
})
this
.
setData
({
'movieAll.movieWeek.list'
:
movieWeek
})
}
})
App
.
wxRequest
({
url
:
'/api/v1/film/getAllFilm'
,
data
:
{
'pageNo'
:
this
.
data
.
queryParams
.
pageNo
,
'pageSize'
:
this
.
data
.
queryParams
.
pageSize
,
'weekType'
:
'1'
},
success
:
(
response
)
=>
{
let
funcResponse
=
response
.
data
movieNextWeek
=
funcResponse
.
list
movieNextWeek
.
forEach
(
v
=>
{
v
.
filmType
=
v
.
filmType
.
replace
(
/
\/
/g
,
' / '
)
v
.
filmDirector
=
v
.
filmDirector
.
replace
(
/
\/
/g
,
' '
)
v
.
filmLead
=
v
.
filmLead
.
replace
(
/
\/
/g
,
' '
)
})
this
.
setData
({
'movieAll.movieNextWeek.list'
:
movieNextWeek
})
}
})
},
onSelectionStatus
:
function
(
event
)
{
console
.
log
(
event
.
currentTarget
.
dataset
.
type
)
this
.
setData
({
statusActive
:
Number
(
event
.
currentTarget
.
dataset
.
type
)
})
},
// 跳转到电影详情页面
onToMovieDetail
:
function
()
{
onToMovieDetail
:
function
(
event
)
{
let
movieId
=
event
.
currentTarget
.
dataset
.
movieid
wx
.
navigateTo
({
url
:
'/pages/play/movie-detail/movie-detail
'
,
url
:
'/pages/play/movie-detail/movie-detail
?id='
+
movieId
,
})
},
onReportMovie
:
function
()
{
console
.
log
(
'报名观影'
)
// 跳转到报名页面
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
pages/play/movie/movie.wxml
View file @
89b09175
...
...
@@ -13,13 +13,13 @@
<view wx:if="{{statusActive === 0}}">
<block wx:for="{{movieToday}}" wx:key="id">
<view class="movie-wrapper row"
bindtap="onToMovieDetail"
>
<view class="movie-wrapper row">
<view class="movie-time-wrapper row align-c">
<view class="movie-time-start">
<text>{{item.
timeStart
}}</text>
<text>{{item.
beginTime
}}</text>
</view>
<view class="movie-time-end">
<text>{{item.
timeEnd
}}</text>
<text>{{item.
endTime
}}</text>
</view>
</view>
<view class="row">
...
...
@@ -28,9 +28,9 @@
</view>
<view class="movie-info-wrapper">
<view class="movie-name row">
<text>{{item.
n
ame}}</text>
<text>{{item.
filmN
ame}}</text>
<view class="movie-dimensional">
<text>{{item.
dimensional
}}</text>
<text>{{item.
tags
}}</text>
</view>
</view>
<view class="movie-info row">
...
...
@@ -38,7 +38,7 @@
<text>类型</text>
</view>
<view class="movie-info-right">
<text>{{item.
t
ype}}</text>
<text>{{item.
filmT
ype}}</text>
</view>
</view>
<view class="movie-info row">
...
...
@@ -46,7 +46,7 @@
<text>导演</text>
</view>
<view class="movie-info-right">
<text>{{item.
d
irector}}</text>
<text>{{item.
filmD
irector}}</text>
</view>
</view>
<view class="movie-info row">
...
...
@@ -54,17 +54,17 @@
<text>主演</text>
</view>
<view class="movie-info-right">
<text>{{item.
actor
}}</text>
<text>{{item.
filmLead
}}</text>
</view>
</view>
<view>
<text
class="movie-label">{{item.label
}}</text>
<view
class="movie-label"
>
<text
>{{item.keyword
}}</text>
</view>
<view class="movie-free">
<text>{{item.
fre
e}}</text>
<text>{{item.
ownerPric
e}}</text>
</view>
<view class="movie-btn" catchtap="onReportMovie">
<text>
{{btn}}
</text>
<view class="movie-btn" catchtap="onReportMovie"
data-movieId="{{item.activityId}}"
>
<text>
报名观影
</text>
</view>
</view>
</view>
...
...
@@ -73,19 +73,21 @@
</view>
<view wx:else>
<block wx:for="{{movieAll}}" wx:for-index="key" wx:for-item="movieList" wx:key="key">
<view class="movie-week">
<view class="movie-week"
wx:if="{{movieList.list.length > 0}}"
>
<text>{{movieList.title}}</text>
</view>
<block wx:for="{{movieList.list}}" wx:key="id">
<view class="all-movie-wrapper" bindtap="onToMovieDetail">
<view class="all-movie-wrapper" bindtap="onToMovieDetail"
data-movieId="{{item.activityId}}"
>
<view class="all-movie-cover">
<image src="{{item.cover}}"></image>
</view>
<view class="movie-info-wrapper">
<view class="movie-name row">
<text>{{item.name}}</text>
<view class="movie-name-wrapper row">
<view class="movie-name">
<text>{{item.filmName}}</text>
</view>
<view class="movie-dimensional">
<text>{{item.
dimensional
}}</text>
<text>{{item.
tags
}}</text>
</view>
</view>
<view class="movie-info row">
...
...
@@ -93,7 +95,7 @@
<text>类型</text>
</view>
<view class="movie-info-right">
<text>{{item.
t
ype}}</text>
<text>{{item.
filmT
ype}}</text>
</view>
</view>
<view class="movie-info row">
...
...
@@ -101,7 +103,7 @@
<text>导演</text>
</view>
<view class="movie-info-right">
<text>{{item.
d
irector}}</text>
<text>{{item.
filmD
irector}}</text>
</view>
</view>
<view class="movie-info row">
...
...
@@ -109,14 +111,14 @@
<text>主演</text>
</view>
<view class="movie-info-right">
<text>{{item.
actor
}}</text>
<text>{{item.
filmLead
}}</text>
</view>
</view>
<view>
<text
class="movie-label">{{item.label
}}</text>
<view
class="movie-label"
>
<text
>{{item.keyword
}}</text>
</view>
<view class="movie-free">
<text>{{item.
fre
e}}</text>
<text>{{item.
ownerPric
e}}</text>
</view>
</view>
</view>
...
...
pages/play/movie/movie.wxss
View file @
89b09175
...
...
@@ -64,10 +64,15 @@ page {
.movie-info-wrapper {
margin-left: 34rpx;
}
.movie-name {
.movie-name
-wrapper
{
height: 52rpx;
}
.movie-name {
color: #fff;
font-size: 30rpx;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
.movie-dimensional {
width: 52rpx;
...
...
@@ -100,6 +105,8 @@ page {
.movie-label {
height:32rpx;
margin-top: 16rpx;
}
.movie-label text {
padding: 0 8rpx;
color: #86C5E1;
font-size: 22rpx;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment