index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <view class="movie">
  3. <view class="header" :style="{height:height +'px'}">
  4. <image class="back" src="../../static/back-btn.png" @click="back" mode=""></image>
  5. <view class="tab" :class="[tab == 1?'active':'']" @click="handleTab(1)">
  6. 热映
  7. </view>
  8. <view class="tab" :class="[tab == 2?'active':'']" @click="handleTab(2)">
  9. 影院
  10. </view>
  11. <view class="tab" :class="[tab == 3?'active':'']" @click="handleTab(3)">
  12. 待映
  13. </view>
  14. </view>
  15. <!-- 列表 -->
  16. <zs-list :mt="(height+8) +'px'" @load="loadMore" :status="status">
  17. <template v-if="tab == 1">
  18. <view class="item" v-for="(item,index) in list1" :key="index">
  19. <view class="img-box">
  20. <view class="tag">
  21. IMAX 2D
  22. </view>
  23. <view class="icon">
  24. </view>
  25. </view>
  26. <view class="info">
  27. <view class="name">
  28. 熊出没·逆转时空
  29. </view>
  30. <view class="score-box">
  31. <view class="score">
  32. 评分 <view class="num">
  33. 9.6
  34. </view>
  35. </view>
  36. <view class="want-num">
  37. 4.2万人想看
  38. </view>
  39. </view>
  40. <view class="actor">
  41. 张伟 张秉君
  42. </view>
  43. <view class="play-movie-num">
  44. 今天 269家影院放映2507场
  45. </view>
  46. </view>
  47. <button class="buy-btn" type="default" @click="buy">购票</button>
  48. </view>
  49. </template>
  50. <template v-else-if="tab == 2">
  51. <view class="cinema-item" v-for="(item,index) in list2" :key="index">
  52. <view class="name-box">
  53. <view class="name">
  54. 熊出没·逆转时空1111
  55. </view>
  56. <view class="price">
  57. ¥19.9 <view class="label">起</view>
  58. </view>
  59. </view>
  60. <view class="address-box">
  61. <view class="address">
  62. 沙坪坝区大学城景苑路(美丽熙街)8号附1027号
  63. </view>
  64. <view class="distance">
  65. 700m
  66. </view>
  67. </view>
  68. <view class="movie-name">
  69. 飞驰人生2/熊出没·逆转时空/第二十条
  70. </view>
  71. </view>
  72. </template>
  73. <template v-else-if="tab == 3">
  74. <view class="item" v-for="(item,index) in list3" :key="index">
  75. <view class="img-box">
  76. <view class="tag">
  77. IMAX 2D
  78. </view>
  79. <view class="icon">
  80. </view>
  81. </view>
  82. <view class="info">
  83. <view class="name">
  84. 熊出没·逆转时空222222
  85. </view>
  86. <view class="score-box">
  87. <view class="score">
  88. 评分 <view class="num">
  89. 9.6
  90. </view>
  91. </view>
  92. <view class="want-num">
  93. 4.2万人想看
  94. </view>
  95. </view>
  96. <view class="actor">
  97. 张伟 张秉君
  98. </view>
  99. <view class="play-movie-num">
  100. 今天 269家影院放映2507场
  101. </view>
  102. </view>
  103. <button class="presell-btn" type="default" @click="buy">预售</button>
  104. </view>
  105. </template>
  106. </zs-list>
  107. </view>
  108. </template>
  109. <script>
  110. export default {
  111. data() {
  112. return {
  113. status: "more",
  114. tab:1,
  115. height:0,
  116. list1:[1,2,3,4,5],
  117. list2:[1,2,3,4],
  118. list3:[1,2,3],
  119. }
  120. },
  121. methods: {
  122. list() {
  123. return this['list'+this.tab]
  124. }
  125. },
  126. methods: {
  127. back(){
  128. uni.switchTab({
  129. url:'/pages/index/index'
  130. })
  131. },
  132. handleTab(val){
  133. this.tab = val
  134. },
  135. buy(){
  136. uni.navigateTo({
  137. url:'/detail/movie/movieDetail'
  138. })
  139. },
  140. loadMore() {
  141. }
  142. },
  143. created() {
  144. //去除
  145. //#ifndef H5 || MP-ALIPAY ||APP-PLUS
  146. //获取小程序胶囊的高度
  147. let {
  148. bottom
  149. } = uni.getMenuButtonBoundingClientRect()
  150. this.height = bottom
  151. //#endif
  152. }
  153. }
  154. </script>
  155. <style lang="scss" >
  156. .movie{
  157. background: #F9F9F9;
  158. .header{
  159. display: flex;
  160. justify-content: center;
  161. align-items: flex-end;
  162. background: #fff;
  163. padding-bottom: 8px;
  164. position: fixed;
  165. top: 0;
  166. left: 0;
  167. width: 100%;
  168. .back{
  169. position: absolute;
  170. left: 32rpx;
  171. bottom: 8px;
  172. width: 40rpx;
  173. height: 40rpx;
  174. }
  175. .tab{
  176. font-size: 36rpx;
  177. color: #AAAAAA;
  178. padding: 0 20rpx;
  179. vertical-align: bottom;
  180. }
  181. .tab.active{
  182. color: #222222;
  183. font-weight: 600;
  184. }
  185. }
  186. .zs-list{
  187. padding: 20rpx 24rpx;
  188. .item{
  189. background: #FFFFFF;
  190. border-radius: 16rpx 16rpx 16rpx 16rpx;
  191. padding: 24rpx;
  192. display: flex;
  193. margin-bottom: 20rpx;
  194. position: relative;
  195. .img-box{
  196. position: relative;
  197. .tag{
  198. position: absolute;
  199. top: 8rpx;
  200. left: 12rpx;
  201. background: rgba(0, 0, 0, .8);
  202. padding: 6rpx 4rpx;
  203. border-radius: 8rpx 8rpx 8rpx 8rpx;
  204. font-size: 18rpx;
  205. color: #FFFFFF;
  206. }
  207. .icon{
  208. width: 160rpx;
  209. height: 200rpx;
  210. border-radius: 16rpx;
  211. background: #F9F9F9;
  212. }
  213. }
  214. .info{
  215. font-size: 24rpx;
  216. color: #AAAAAA;
  217. display: flex;
  218. flex-direction: column;
  219. justify-content: space-between;
  220. margin-left: 20rpx;
  221. .name{
  222. font-weight: 600;
  223. font-size: 28rpx;
  224. color: #222222;
  225. width: 400rpx;
  226. white-space: nowrap;
  227. overflow: hidden;
  228. text-overflow: ellipsis;
  229. }
  230. .score-box{
  231. display: flex;
  232. .score{
  233. display: flex;
  234. align-items: center;
  235. .num{
  236. font-size: 28rpx;
  237. color: #FF4D3A;
  238. padding: 0 12rpx;
  239. }
  240. }
  241. .want-num{
  242. padding: 0 12rpx;
  243. border-left: 2rpx solid #F0F0F0;
  244. align-self: flex-end;
  245. // font-size: 24rpx;
  246. // color: #AAAAAA;
  247. }
  248. }
  249. .actor{
  250. // font-size: 24rpx;
  251. // color: #AAAAAA;
  252. }
  253. .play-movie-num{
  254. // font-size: 24rpx;
  255. // color: #AAAAAA;
  256. }
  257. }
  258. .buy-btn{
  259. position: absolute;
  260. top: 50%;
  261. right: 0;
  262. transform: translateY(-50%);
  263. width: 120rpx;
  264. height: 52rpx;
  265. line-height: 52rpx;
  266. background: #EE4320;
  267. border-radius: 26rpx;
  268. font-size: 28rpx;
  269. color: #FFFFFF;
  270. }
  271. .presell-btn{
  272. position: absolute;
  273. top: 50%;
  274. right: 0;
  275. transform: translateY(-50%);
  276. width: 120rpx;
  277. height: 52rpx;
  278. line-height: 52rpx;
  279. background: #3879F9;
  280. border-radius: 26rpx;
  281. font-size: 28rpx;
  282. color: #FFFFFF;
  283. }
  284. }
  285. .cinema-item{
  286. background: #FFFFFF;
  287. border-radius: 16rpx 16rpx 16rpx 16rpx;
  288. padding: 24rpx;
  289. margin-bottom: 20rpx;
  290. .name-box{
  291. display: flex;
  292. justify-content: space-between;
  293. .name{
  294. font-weight: 600;
  295. font-size: 28rpx;
  296. color: #222222;
  297. width: 450rpx;
  298. white-space: nowrap;
  299. overflow: hidden;
  300. text-overflow: ellipsis;
  301. }
  302. .price{
  303. display: flex;
  304. align-items: center;
  305. font-size: 28rpx;
  306. color: #FF4D3A;
  307. .label{
  308. font-size: 24rpx;
  309. color: #AAAAAA;
  310. }
  311. }
  312. }
  313. .address-box{
  314. display: flex;
  315. justify-content: space-between;
  316. font-size: 24rpx;
  317. color: #AAAAAA;
  318. margin-top: 16rpx;
  319. .address{
  320. width: 460rpx;
  321. white-space: nowrap;
  322. overflow: hidden;
  323. text-overflow: ellipsis;
  324. }
  325. .distance{
  326. }
  327. }
  328. .movie-name{
  329. font-size: 24rpx;
  330. color: #222222;
  331. margin-top: 16rpx;
  332. width: 100%;
  333. white-space: nowrap;
  334. overflow: hidden;
  335. text-overflow: ellipsis;
  336. }
  337. }
  338. }
  339. }
  340. </style>