halllist.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. <template>
  2. <view class="center">
  3. <view class="content-money">
  4. <view class="status_bar"><!-- 这里是状态栏 --></view>
  5. <view class="money-box">
  6. <view class="goback-box" @click="toBack">
  7. <image class="goback" src="../../static/img/fanhui.png" mode=""></image>
  8. </view>
  9. <view class="header">会馆场次</view>
  10. </view>
  11. </view>
  12. <swiper class="hallist-bg" autoplay="true" duration="400" interval="5000">
  13. <swiper-item v-for="(item, index) in images" :key="index" class="carousel-item">
  14. <image class="swimage" :src="item" />
  15. </swiper-item>
  16. </swiper>
  17. <view class="main" v-for="(item, index) in list" :key="index">
  18. <view class="mtitle-english">{{ item.show }}</view>
  19. <view class="mmain flex">
  20. <view class="mmain-info">
  21. <view class="mmain-title">
  22. <image class="mmaint-left" :src="item.time_image" mode=""></image>
  23. <view class="mmaint-font">{{ item.nickname }}</view>
  24. <view class="mmaint-time">{{ item.radd_time }}开售</view>
  25. </view>
  26. <view class="mmain-time" style="margin-top: 28rpx;">预约时间:{{ item.add_time }}-{{ item.end_time }}
  27. </view>
  28. <view class="mmain-time">入场时间:{{ item.radd_time | ahead }}-{{ item.rend_time }}</view>
  29. <view class="mmain-time flex">
  30. <view class="mmain-font">距预约结束:</view>
  31. <view class="lyy-b-jz flex" v-if="item.daotime == 1" style="font-size: 30rpx; color: #d13737;">
  32. 已结束</view>
  33. <view class="lyy-b-jz flex" v-else>
  34. <uni-countdowns color="#702400" splitor-color="#faf1e6" background-color="#faf1e6"
  35. border-color="#faf1e6" :show-day="false" :hour="item.hours" :minute="item.minutes"
  36. :second="item.seconds" :index="index" @timeover="isTime"></uni-countdowns>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="mmain-image">
  41. <image :src="item.image" mode=""></image>
  42. </view>
  43. </view>
  44. <view v-if="item.str == '预约'" class="bottom" @click="open(item)">
  45. <view class="bottom-font">立即{{ item.str }}</view>
  46. <image v-if="item.str == '预约'" class="bottom-image" src="../../static/img/jt.png" mode=""></image>
  47. </view>
  48. <view class="bottom" v-else>
  49. <view class="bottom-font">{{ item.daotime == 1 ? '立即进入' : '您已预约' }}</view>
  50. </view>
  51. </view>
  52. <uni-popup ref="popup" type="center">
  53. <view class="popup">
  54. <view class="popup-title">
  55. <view class="title">
  56. 请选择价格档次
  57. </view>
  58. <view class="flex-center">
  59. <view class="pirice" @click="actionPay=ind" :class="{action:actionPay==ind}" v-for="(item,ind) in price_cate">
  60. {{item}}
  61. </view>
  62. </view>
  63. </view>
  64. <view class="btn-box">
  65. <view class="btn-left" @click="close()">取消</view>
  66. <view class="btn-right" @click="appointment()">确定</view>
  67. </view>
  68. </view>
  69. </uni-popup>
  70. <u-tabbar activeColor="#333333" inactive-color='#999999' :list="tabbar"></u-tabbar>
  71. </view>
  72. </template>
  73. <script>
  74. import uniCountdowns from '@/components/uni-countdown/uni-countdowns.vue';
  75. import {
  76. pay_list
  77. } from '../../api/wallet.js';
  78. import {
  79. article
  80. } from '@/api/user.js';
  81. import {
  82. getUserInfo,
  83. rate,
  84. details
  85. } from '@/api/user.js';
  86. import {
  87. mapState,
  88. mapMutations
  89. } from 'vuex';
  90. import {
  91. auction_list,
  92. subscribe,
  93. advance
  94. } from '@/api/hall.js';
  95. import {
  96. timeComputed
  97. } from '@/utils/rocessor.js';
  98. import {
  99. tabbar1
  100. } from '@/utils/tabbar.js';
  101. export default {
  102. components: {
  103. uniCountdowns
  104. },
  105. data() {
  106. return {
  107. actionPay:0,
  108. tabbar: tabbar1,
  109. images: [], //轮播图
  110. name: '', //馆名字
  111. peoplename: '', //馆长名字
  112. id: '', //预约会场id
  113. price_cate: [],
  114. page: 1,
  115. limit: 10,
  116. loadingType: 'more',
  117. list: [],
  118. aliData: {},
  119. bankData: {},
  120. wx: {},
  121. };
  122. },
  123. filters: {
  124. ahead(provider) {
  125. let time = provider.split(':');
  126. console.log(time);
  127. if (time[1] * 1 - 6 < 0) {
  128. time[1] = time[1] * 1 + 54;
  129. if (time[0] * 1 == 0) {
  130. time[0] = '23';
  131. } else {
  132. time[0] = time[0] * 1 - 1;
  133. }
  134. } else {
  135. time[1] = time[1] * 1 - 6;
  136. if (time[1] < 10) {
  137. time[1] = '0' + time[1];
  138. }
  139. }
  140. return time[0] + ':' + time[1] + ':' + time[2];
  141. }
  142. },
  143. onLoad(option) {
  144. this.name = option.name;
  145. this.peoplename = option.peoplename;
  146. },
  147. onShow() {
  148. this.list = [];
  149. this.page = 1;
  150. this.limit = 10;
  151. this.loadingType = 'more';
  152. pay_list({}).then(({
  153. data
  154. }) => {
  155. this.wx = data.wx;
  156. this.aliData = data.zfb;
  157. this.bankData = data.bank;
  158. });
  159. this.loadData();
  160. },
  161. computed: {
  162. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  163. },
  164. methods: {
  165. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  166. loadData() {
  167. const obj = this;
  168. if (obj.loadingType == 'nomore' || obj.loadingType == 'loading') {
  169. return;
  170. }
  171. obj.loadingType = 'loading';
  172. auction_list({
  173. page: obj.page,
  174. limit: obj.limit,
  175. }).then(({
  176. data
  177. }) => {
  178. obj.images = data.slider_image;
  179. console.log(data);
  180. data.data.forEach(e => {
  181. let now_time = timeComputed(e.time);
  182. this.price_cate = data.price_cate;
  183. console.log(e.time, now_time);
  184. e.hours = now_time.hours;
  185. e.minutes = now_time.minutes;
  186. e.seconds = now_time.seconds;
  187. if (now_time.hours < 0 || now_time.minutes < 0 || now_time.seconds < 0) {
  188. e.daotime = 1;
  189. } else {
  190. e.daotime = 0;
  191. }
  192. let jcsj = e.radd_time.split(':');
  193. if (jcsj[0] * 1 >= 8 && jcsj[0] * 1 < 12) {
  194. e.time_image = '../../static/img/morningicon.png';
  195. e.show = 'MORNING SHOWS';
  196. } else if (jcsj[0] * 1 >= 12 && jcsj[0] * 1 < 18) {
  197. e.show = 'AFTERNOON SHOWS';
  198. e.time_image = '../../static/img/afternoonicon.png';
  199. } else {
  200. e.time_image = '../../static/img/eveningicon.png';
  201. e.show = 'EVENING SHOWS';
  202. }
  203. });
  204. obj.list = obj.list.concat(data.data);
  205. if (data.data.length == obj.limit) {
  206. obj.loadingType = 'more';
  207. obj.page++;
  208. } else {
  209. obj.loadingType = 'nomore';
  210. }
  211. });
  212. },
  213. open(item) {
  214. if (this.wx == '' && this.aliData == '' && this.bankData == '') {
  215. uni.showModal({
  216. title: '提示',
  217. content: '您未填写收款信息无法参与,是否前去填写收款信息?',
  218. success: function(res) {
  219. if (res.confirm) {
  220. uni.navigateTo({
  221. url: '/pages/collection/collection'
  222. });
  223. } else if (res.cancel) {
  224. console.log('用户点击取消');
  225. }
  226. }
  227. });
  228. return;
  229. }
  230. this.id = item.id;
  231. this.$refs.popup.open();
  232. // 场次是否已经预约sta=1未预约
  233. },
  234. goDetails(e) {
  235. console.log(e, '123456');
  236. uni.navigateTo({
  237. url: '/pages/index/messageInfo?id=' + this.article[e].id
  238. });
  239. },
  240. close() {
  241. this.id = '';
  242. this.$refs.popup.close();
  243. },
  244. navTo(url) {
  245. uni.navigateTo({
  246. url
  247. });
  248. },
  249. toBack() {
  250. uni.navigateBack({});
  251. },
  252. appointment() {
  253. subscribe({
  254. id: this.id,
  255. price: this.price_cate[this.actionPay]
  256. })
  257. .then(({
  258. data
  259. }) => {
  260. this.$api.msg('预约成功');
  261. console.log(data);
  262. this.$refs.popup.close();
  263. this.page = 1;
  264. this.limit = 10;
  265. this.loadingType = 'more';
  266. this.list = [];
  267. this.loadData();
  268. this.updata();
  269. })
  270. .catch(e => {
  271. this.$refs.popup.close();
  272. console.log(e);
  273. });
  274. },
  275. updata() {
  276. getUserInfo({})
  277. .then(({
  278. data
  279. }) => {
  280. this.setUserInfo(data);
  281. })
  282. .catch(e => {
  283. console.log(e);
  284. });
  285. },
  286. isTime(index) {
  287. console.log(index, '123');
  288. this.list[index].daotime = 1;
  289. }
  290. }
  291. };
  292. </script>
  293. <style lang="scss">
  294. page,
  295. .center {
  296. height: auto;
  297. min-height: 100%;
  298. background: #f2f5f4;
  299. }
  300. .status_bar {
  301. height: var(--status-bar-height);
  302. width: 100%;
  303. }
  304. .money-box {
  305. color:$font-color-dark;
  306. text-align: center;
  307. position: relative;
  308. .header {
  309. width: 100%;
  310. height: 80rpx;
  311. font-size: 32rpx;
  312. font-weight: 700;
  313. z-index: 99;
  314. display: flex;
  315. justify-content: center;
  316. align-items: center;
  317. }
  318. .goback-box {
  319. position: absolute;
  320. left: 18rpx;
  321. top: 0;
  322. height: 80rpx;
  323. display: flex;
  324. align-items: center;
  325. }
  326. .goback {
  327. z-index: 100;
  328. width: 34rpx;
  329. height: 34rpx;
  330. }
  331. .money_bg {
  332. width: 100%;
  333. height: 382rpx;
  334. display: block;
  335. }
  336. }
  337. .shingle-mmain {
  338. position: relative;
  339. z-index: 2;
  340. margin: -90rpx auto 0;
  341. width: 690rpx;
  342. height: 176rpx;
  343. background: #ffffff;
  344. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  345. border-radius: 20rpx;
  346. background-color: #ffffff;
  347. .smmain-item {
  348. width: 33%;
  349. display: flex;
  350. flex-direction: column;
  351. align-items: center;
  352. .red {
  353. color: #fd3b39 !important;
  354. }
  355. .smitem-top {
  356. font-size: 30rpx;
  357. font-family: PingFang SC;
  358. font-weight: bolder;
  359. color: #0c1732;
  360. }
  361. .smitem-bottom {
  362. margin-top: 10rpx;
  363. font-size: 30rpx;
  364. font-family: PingFang SC;
  365. font-weight: 500;
  366. color: #0c1732;
  367. }
  368. .people {
  369. justify-content: center;
  370. .peopleitem {
  371. width: 24rpx;
  372. height: 34rpx;
  373. image {
  374. width: 100%;
  375. height: 100%;
  376. }
  377. }
  378. }
  379. }
  380. .shu {
  381. width: 2rpx;
  382. height: 70rpx;
  383. background: #dcdcdc;
  384. }
  385. }
  386. .main {
  387. margin: 30rpx auto 0;
  388. padding: 50rpx 50rpx 36rpx 50rpx;
  389. width: 690rpx;
  390. background: #ffffff;
  391. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  392. border-radius: 20rpx;
  393. .mtitle-english {
  394. font-size: 30rpx;
  395. font-family: PingFang SC;
  396. font-weight: bold;
  397. color: #9ea6ba;
  398. }
  399. .mmain {
  400. margin-top: 24rpx;
  401. .mmain-info {
  402. .mmain-title {
  403. display: flex;
  404. justify-content: flex-start;
  405. align-items: center;
  406. .mmaint-left {
  407. width: 52rpx;
  408. height: 40rpx;
  409. }
  410. .mmaint-font {
  411. margin-left: 10rpx;
  412. font-size: 32rpx;
  413. font-family: PingFang SC;
  414. font-weight: bold;
  415. color: #0c1732;
  416. }
  417. .mmaint-time {
  418. margin-left: 20rpx;
  419. font-size: 28rpx;
  420. font-family: PingFang SC;
  421. font-weight: 500;
  422. color: #0c1732;
  423. }
  424. }
  425. .mmain-time {
  426. justify-content: flex-start;
  427. margin-top: 10rpx;
  428. font-size: 26rpx;
  429. font-family: PingFang SC;
  430. font-weight: 500;
  431. color: #0c1732;
  432. .lyy-b-jz {
  433. margin-left: 10rpx;
  434. }
  435. }
  436. }
  437. .mmain-image {
  438. padding-top: 14rpx;
  439. width: 182rpx;
  440. height: 182rpx;
  441. image {
  442. width: 100%;
  443. height: 100%;
  444. }
  445. }
  446. }
  447. .bottom {
  448. margin: 0 auto;
  449. margin-top: 32rpx;
  450. width: 440rpx;
  451. height: 80rpx;
  452. background: linear-gradient(90deg, #C38E4F, #ECC697);
  453. border-radius: 20rpx;
  454. display: flex;
  455. justify-content: center;
  456. align-items: center;
  457. .bottom-font {
  458. font-size: 28rpx;
  459. font-family: PingFang SC;
  460. font-weight: bold;
  461. color: #ffffff;
  462. }
  463. .bottom-image {
  464. margin-left: 12rpx;
  465. width: 24rpx;
  466. height: 22rpx;
  467. }
  468. }
  469. }
  470. .popup {
  471. width: 582rpx;
  472. background: #ffffff;
  473. border-radius: 20rpx;
  474. // padding: 118rpx 20rpx 30rpx;
  475. .popup-title {
  476. padding: 30rpx;
  477. text-align: center;
  478. .title {
  479. font-size: $font-lg;
  480. padding-bottom: 30rpx;
  481. }
  482. .pirice {
  483. font-weight: bold;
  484. line-height: 70rpx;
  485. min-width: 140rpx;
  486. height: 70rpx;
  487. border: 1px solid #9ea6ba;
  488. &.action{
  489. color: #FFF;
  490. background-color: $u-type-primary;
  491. border-color: $u-type-primary;
  492. }
  493. }
  494. }
  495. .btn-box {
  496. display: flex;
  497. align-items: center;
  498. justify-content: space-between;
  499. border-top: 1px solid $border-color-light;
  500. font-size: 34rpx;
  501. text-align: center;
  502. font-weight: 500;
  503. line-height: 78rpx;
  504. .btn-left,
  505. .btn-right {
  506. flex-grow: 1;
  507. height: 78rpx;
  508. }
  509. .btn-left {
  510. color: $font-color-dark;
  511. }
  512. .btn-right {
  513. background: $u-type-primary;
  514. color: #ffffff;
  515. }
  516. }
  517. }
  518. .message {
  519. justify-content: space-around;
  520. margin: 20rpx auto 0;
  521. padding: 16rpx 40rpx 16rpx 50rpx;
  522. width: 690rpx;
  523. background: #ffffff;
  524. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  525. border-radius: 20rpx;
  526. .message-left {
  527. width: 52rpx;
  528. height: 52rpx;
  529. flex-shrink: 0;
  530. }
  531. .message-font {
  532. margin: 0 40rpx;
  533. font-size: 28rpx;
  534. font-family: PingFang SC;
  535. font-weight: 500;
  536. color: #0c1732;
  537. }
  538. .message-right {
  539. width: 18rpx;
  540. height: 30rpx;
  541. }
  542. }
  543. .hallist-bg {
  544. position: relative;
  545. z-index: 10;
  546. margin: 0 auto;
  547. width: 702rpx;
  548. height: 300rpx;
  549. border-radius: 14rpx;
  550. overflow: hidden;
  551. image {
  552. width: 100%;
  553. height: 100%;
  554. }
  555. }
  556. .navbar {
  557. display: flex;
  558. align-items: center;
  559. justify-content: space-around;
  560. width: 700rpx;
  561. background: #ffffff;
  562. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  563. border-radius: 20rpx;
  564. margin: 40rpx auto 0;
  565. padding: 40rpx 0 50rpx;
  566. .vvv {
  567. width: 2rpx;
  568. height: 74rpx;
  569. background: #dcdcdc;
  570. }
  571. .navbar-item {
  572. display: flex;
  573. flex-direction: column;
  574. align-items: center;
  575. .navbar-font {
  576. margin-bottom: 10rpx;
  577. display: flex;
  578. justify-content: center;
  579. align-items: center;
  580. image {
  581. margin-right: 10rpx;
  582. width: 40rpx;
  583. height: 40rpx;
  584. }
  585. .font {
  586. font-size: 30rpx;
  587. font-weight: bold;
  588. color: #0c1732;
  589. }
  590. }
  591. .navbar-num {
  592. font-size: 34rpx;
  593. font-weight: bold;
  594. color: #0c1732;
  595. }
  596. }
  597. }
  598. .regulation {
  599. width: 650rpx;
  600. padding: 30rpx;
  601. background: #ffffff;
  602. border-radius: 20rpx;
  603. position: relative;
  604. .regulation_close {
  605. position: absolute;
  606. width: 44rpx;
  607. height: 44rpx;
  608. top: 30rpx;
  609. right: 30rpx;
  610. image {
  611. width: 100%;
  612. height: 100%;
  613. }
  614. }
  615. .regulation_name {
  616. padding: 40rpx 0;
  617. text-align: center;
  618. font-size: 30rpx;
  619. font-weight: bold;
  620. }
  621. .scroll-view {
  622. height: 735rpx;
  623. }
  624. .regulation_btn {
  625. margin: 20rpx auto 0;
  626. width: 496rpx;
  627. height: 78rpx;
  628. background: #dc262b;
  629. border-radius: 10rpx;
  630. font-size: 34rpx;
  631. font-family: PingFang SC;
  632. font-weight: 500;
  633. color: #ffffff;
  634. text-align: center;
  635. line-height: 78rpx;
  636. }
  637. }
  638. </style>