movieList.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="movieList">
  3. <!-- 列表 -->
  4. <zs-list :mt="(height+8) +'px'" :status="status">
  5. <view class="item" v-for="(item,index) in list" :key="index">
  6. <view class="img-box">
  7. <view class="tag" v-if="item.version">
  8. {{item.version}}
  9. </view>
  10. <zs-img class="icon" :src="item.posterUrl" radius="full" width="120rpx" height="150rpx" mode="widthFix" ></zs-img>
  11. </view>
  12. <view class="info">
  13. <view class="name">
  14. {{item.name}}
  15. </view>
  16. <view class="score-box">
  17. <view class="score">
  18. 评分 <view class="num">
  19. {{item.score}}
  20. </view>
  21. </view>
  22. <view class="want-num" v-if="item.wish">
  23. {{item.wish | filterNum}}人想看
  24. </view>
  25. </view>
  26. <view class="actor">
  27. {{item.description}}
  28. </view>
  29. <!-- <view class="play-movie-num">
  30. 今天 269家影院放映2507场
  31. </view> -->
  32. </view>
  33. <button class="buy-btn" type="default" @click="buy(item.movieId)">购票</button>
  34. </view>
  35. </zs-list>
  36. </view>
  37. </template>
  38. <script>
  39. import {cinema_shows} from '@/api/movie.js'
  40. export default {
  41. data() {
  42. return {
  43. list:[],
  44. query:{
  45. cinemaId:0
  46. }
  47. }
  48. },
  49. methods: {
  50. cinema_shows() {
  51. this.status = 'loading'
  52. cinema_shows(this.query).then(res=>{
  53. this.status = 'noMore'
  54. this.list = res.content.data.movieShows
  55. })
  56. },
  57. buy(id){
  58. uni.navigateTo({
  59. url:`/movie/movieDetail?id=${id}&cinemaId=${this.query.cinemaId}`
  60. })
  61. },
  62. },
  63. onLoad(options) {
  64. this.query.cinemaId = options.id
  65. this.cinema_shows()
  66. }
  67. }
  68. </script>
  69. <style lang="scss" >
  70. .movieList{
  71. background: #F9F9F9;
  72. .zs-list{
  73. padding: 20rpx 24rpx;
  74. .item{
  75. background: #FFFFFF;
  76. border-radius: 16rpx 16rpx 16rpx 16rpx;
  77. padding: 24rpx;
  78. display: flex;
  79. margin-bottom: 20rpx;
  80. position: relative;
  81. .img-box{
  82. position: relative;
  83. .tag{
  84. position: absolute;
  85. top: 8rpx;
  86. left: 12rpx;
  87. background: rgba(0, 0, 0, .8);
  88. padding: 6rpx 4rpx;
  89. border-radius: 8rpx 8rpx 8rpx 8rpx;
  90. font-size: 18rpx;
  91. color: #FFFFFF;
  92. }
  93. .icon{
  94. width: 160rpx;
  95. height: 200rpx;
  96. border-radius: 16rpx;
  97. background: #F9F9F9;
  98. }
  99. }
  100. .info{
  101. font-size: 24rpx;
  102. color: #AAAAAA;
  103. display: flex;
  104. flex-direction: column;
  105. // justify-content: space-between;
  106. margin-left: 20rpx;
  107. .name{
  108. font-weight: 600;
  109. font-size: 28rpx;
  110. color: #222222;
  111. width: 400rpx;
  112. white-space: nowrap;
  113. overflow: hidden;
  114. text-overflow: ellipsis;
  115. }
  116. .score-box{
  117. display: flex;
  118. margin-top: 20rpx;
  119. .score{
  120. display: flex;
  121. align-items: center;
  122. .num{
  123. font-size: 28rpx;
  124. color: #FF4D3A;
  125. padding: 0 12rpx;
  126. }
  127. }
  128. .want-num{
  129. padding: 0 12rpx;
  130. border-left: 2rpx solid #F0F0F0;
  131. align-self: flex-end;
  132. // font-size: 24rpx;
  133. // color: #AAAAAA;
  134. }
  135. }
  136. .actor{
  137. margin-top: 20rpx;
  138. width: 350rpx;
  139. line-height: 44rpx;
  140. overflow: hidden;
  141. text-overflow: ellipsis;
  142. /* 弹性伸缩盒子模型显示 */
  143. display: -webkit-box;
  144. /* 限制在一个块元素显示的文本的行数 */
  145. -webkit-line-clamp: 2;
  146. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  147. -webkit-box-orient: vertical;
  148. // font-size: 24rpx;
  149. // color: #AAAAAA;
  150. }
  151. .play-movie-num{
  152. // font-size: 24rpx;
  153. // color: #AAAAAA;
  154. }
  155. }
  156. .buy-btn{
  157. position: absolute;
  158. top: 50%;
  159. right: 24rpx;
  160. transform: translateY(-50%);
  161. width: 120rpx;
  162. height: 52rpx;
  163. line-height: 52rpx;
  164. background: #EE4320;
  165. border-radius: 26rpx;
  166. font-size: 28rpx;
  167. color: #FFFFFF;
  168. }
  169. .presell-btn{
  170. position: absolute;
  171. top: 50%;
  172. right: 0;
  173. transform: translateY(-50%);
  174. width: 120rpx;
  175. height: 52rpx;
  176. line-height: 52rpx;
  177. background: #3879F9;
  178. border-radius: 26rpx;
  179. font-size: 28rpx;
  180. color: #FFFFFF;
  181. }
  182. }
  183. }
  184. }
  185. </style>