halllist.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  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. // 场次是否已经预约sta=1未预约
  231. if (item.sta != 1) {
  232. this.id = item.id;
  233. this.nav();
  234. // advance({
  235. // id: item.id
  236. // })
  237. // .then(e => {
  238. // console.log(e, 'success');
  239. // this.nav();
  240. // })
  241. // .catch(e => {
  242. // console.log(e, 'fail');
  243. // });
  244. } else {
  245. this.id = item.id;
  246. this.$refs.popup.open();
  247. // this.appointment();
  248. }
  249. },
  250. goDetails(e) {
  251. console.log(e, '123456');
  252. uni.navigateTo({
  253. url: '/pages/index/messageInfo?id=' + this.article[e].id
  254. });
  255. },
  256. close() {
  257. this.id = '';
  258. this.$refs.popup.close();
  259. },
  260. nav() {
  261. uni.navigateTo({
  262. url: '/pages/hall/hallinfo?id=' + this.id + '&name=' + this.name + '&peoplename=' + this
  263. .peoplename
  264. });
  265. },
  266. navTo(url) {
  267. uni.navigateTo({
  268. url
  269. });
  270. },
  271. toBack() {
  272. uni.navigateBack({});
  273. },
  274. appointment() {
  275. subscribe({
  276. id: this.id,
  277. price: this.price_cate[this.actionPay]
  278. })
  279. .then(({
  280. data
  281. }) => {
  282. this.$api.msg('预约成功');
  283. console.log(data);
  284. this.$refs.popup.close();
  285. this.page = 1;
  286. this.limit = 10;
  287. this.loadingType = 'more';
  288. this.list = [];
  289. this.loadData();
  290. this.updata();
  291. })
  292. .catch(e => {
  293. this.$refs.popup.close();
  294. console.log(e);
  295. });
  296. },
  297. updata() {
  298. getUserInfo({})
  299. .then(({
  300. data
  301. }) => {
  302. this.setUserInfo(data);
  303. })
  304. .catch(e => {
  305. console.log(e);
  306. });
  307. },
  308. isTime(index) {
  309. console.log(index, '123');
  310. this.list[index].daotime = 1;
  311. }
  312. }
  313. };
  314. </script>
  315. <style lang="scss">
  316. page,
  317. .center {
  318. height: auto;
  319. min-height: 100%;
  320. background: #f2f5f4;
  321. }
  322. .status_bar {
  323. height: var(--status-bar-height);
  324. width: 100%;
  325. }
  326. .money-box {
  327. color:$font-color-dark;
  328. text-align: center;
  329. position: relative;
  330. .header {
  331. width: 100%;
  332. height: 80rpx;
  333. font-size: 32rpx;
  334. font-weight: 700;
  335. z-index: 99;
  336. display: flex;
  337. justify-content: center;
  338. align-items: center;
  339. }
  340. .goback-box {
  341. position: absolute;
  342. left: 18rpx;
  343. top: 0;
  344. height: 80rpx;
  345. display: flex;
  346. align-items: center;
  347. }
  348. .goback {
  349. z-index: 100;
  350. width: 34rpx;
  351. height: 34rpx;
  352. }
  353. .money_bg {
  354. width: 100%;
  355. height: 382rpx;
  356. display: block;
  357. }
  358. }
  359. .shingle-mmain {
  360. position: relative;
  361. z-index: 2;
  362. margin: -90rpx auto 0;
  363. width: 690rpx;
  364. height: 176rpx;
  365. background: #ffffff;
  366. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  367. border-radius: 20rpx;
  368. background-color: #ffffff;
  369. .smmain-item {
  370. width: 33%;
  371. display: flex;
  372. flex-direction: column;
  373. align-items: center;
  374. .red {
  375. color: #fd3b39 !important;
  376. }
  377. .smitem-top {
  378. font-size: 30rpx;
  379. font-family: PingFang SC;
  380. font-weight: bolder;
  381. color: #0c1732;
  382. }
  383. .smitem-bottom {
  384. margin-top: 10rpx;
  385. font-size: 30rpx;
  386. font-family: PingFang SC;
  387. font-weight: 500;
  388. color: #0c1732;
  389. }
  390. .people {
  391. justify-content: center;
  392. .peopleitem {
  393. width: 24rpx;
  394. height: 34rpx;
  395. image {
  396. width: 100%;
  397. height: 100%;
  398. }
  399. }
  400. }
  401. }
  402. .shu {
  403. width: 2rpx;
  404. height: 70rpx;
  405. background: #dcdcdc;
  406. }
  407. }
  408. .main {
  409. margin: 30rpx auto 0;
  410. padding: 50rpx 50rpx 36rpx 50rpx;
  411. width: 690rpx;
  412. background: #ffffff;
  413. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  414. border-radius: 20rpx;
  415. .mtitle-english {
  416. font-size: 30rpx;
  417. font-family: PingFang SC;
  418. font-weight: bold;
  419. color: #9ea6ba;
  420. }
  421. .mmain {
  422. margin-top: 24rpx;
  423. .mmain-info {
  424. .mmain-title {
  425. display: flex;
  426. justify-content: flex-start;
  427. align-items: center;
  428. .mmaint-left {
  429. width: 52rpx;
  430. height: 40rpx;
  431. }
  432. .mmaint-font {
  433. margin-left: 10rpx;
  434. font-size: 32rpx;
  435. font-family: PingFang SC;
  436. font-weight: bold;
  437. color: #0c1732;
  438. }
  439. .mmaint-time {
  440. margin-left: 20rpx;
  441. font-size: 28rpx;
  442. font-family: PingFang SC;
  443. font-weight: 500;
  444. color: #0c1732;
  445. }
  446. }
  447. .mmain-time {
  448. justify-content: flex-start;
  449. margin-top: 10rpx;
  450. font-size: 26rpx;
  451. font-family: PingFang SC;
  452. font-weight: 500;
  453. color: #0c1732;
  454. .lyy-b-jz {
  455. margin-left: 10rpx;
  456. }
  457. }
  458. }
  459. .mmain-image {
  460. padding-top: 14rpx;
  461. width: 182rpx;
  462. height: 182rpx;
  463. image {
  464. width: 100%;
  465. height: 100%;
  466. }
  467. }
  468. }
  469. .bottom {
  470. margin: 0 auto;
  471. margin-top: 32rpx;
  472. width: 440rpx;
  473. height: 80rpx;
  474. background: linear-gradient(90deg, #C38E4F, #ECC697);
  475. border-radius: 20rpx;
  476. display: flex;
  477. justify-content: center;
  478. align-items: center;
  479. .bottom-font {
  480. font-size: 28rpx;
  481. font-family: PingFang SC;
  482. font-weight: bold;
  483. color: #ffffff;
  484. }
  485. .bottom-image {
  486. margin-left: 12rpx;
  487. width: 24rpx;
  488. height: 22rpx;
  489. }
  490. }
  491. }
  492. .popup {
  493. width: 582rpx;
  494. background: #ffffff;
  495. border-radius: 20rpx;
  496. // padding: 118rpx 20rpx 30rpx;
  497. .popup-title {
  498. padding: 30rpx;
  499. text-align: center;
  500. .title {
  501. font-size: $font-lg;
  502. padding-bottom: 30rpx;
  503. }
  504. .pirice {
  505. font-weight: bold;
  506. line-height: 70rpx;
  507. min-width: 140rpx;
  508. height: 70rpx;
  509. border: 1px solid #9ea6ba;
  510. &.action{
  511. color: #FFF;
  512. background-color: $u-type-primary;
  513. border-color: $u-type-primary;
  514. }
  515. }
  516. }
  517. .btn-box {
  518. display: flex;
  519. align-items: center;
  520. justify-content: space-between;
  521. border-top: 1px solid $border-color-light;
  522. font-size: 34rpx;
  523. text-align: center;
  524. font-weight: 500;
  525. line-height: 78rpx;
  526. .btn-left,
  527. .btn-right {
  528. flex-grow: 1;
  529. height: 78rpx;
  530. }
  531. .btn-left {
  532. color: $font-color-dark;
  533. }
  534. .btn-right {
  535. background: $u-type-primary;
  536. color: #ffffff;
  537. }
  538. }
  539. }
  540. .message {
  541. justify-content: space-around;
  542. margin: 20rpx auto 0;
  543. padding: 16rpx 40rpx 16rpx 50rpx;
  544. width: 690rpx;
  545. background: #ffffff;
  546. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  547. border-radius: 20rpx;
  548. .message-left {
  549. width: 52rpx;
  550. height: 52rpx;
  551. flex-shrink: 0;
  552. }
  553. .message-font {
  554. margin: 0 40rpx;
  555. font-size: 28rpx;
  556. font-family: PingFang SC;
  557. font-weight: 500;
  558. color: #0c1732;
  559. }
  560. .message-right {
  561. width: 18rpx;
  562. height: 30rpx;
  563. }
  564. }
  565. .hallist-bg {
  566. position: relative;
  567. z-index: 10;
  568. margin: 0 auto;
  569. width: 702rpx;
  570. height: 300rpx;
  571. border-radius: 14rpx;
  572. overflow: hidden;
  573. image {
  574. width: 100%;
  575. height: 100%;
  576. }
  577. }
  578. .navbar {
  579. display: flex;
  580. align-items: center;
  581. justify-content: space-around;
  582. width: 700rpx;
  583. background: #ffffff;
  584. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  585. border-radius: 20rpx;
  586. margin: 40rpx auto 0;
  587. padding: 40rpx 0 50rpx;
  588. .vvv {
  589. width: 2rpx;
  590. height: 74rpx;
  591. background: #dcdcdc;
  592. }
  593. .navbar-item {
  594. display: flex;
  595. flex-direction: column;
  596. align-items: center;
  597. .navbar-font {
  598. margin-bottom: 10rpx;
  599. display: flex;
  600. justify-content: center;
  601. align-items: center;
  602. image {
  603. margin-right: 10rpx;
  604. width: 40rpx;
  605. height: 40rpx;
  606. }
  607. .font {
  608. font-size: 30rpx;
  609. font-weight: bold;
  610. color: #0c1732;
  611. }
  612. }
  613. .navbar-num {
  614. font-size: 34rpx;
  615. font-weight: bold;
  616. color: #0c1732;
  617. }
  618. }
  619. }
  620. .regulation {
  621. width: 650rpx;
  622. padding: 30rpx;
  623. background: #ffffff;
  624. border-radius: 20rpx;
  625. position: relative;
  626. .regulation_close {
  627. position: absolute;
  628. width: 44rpx;
  629. height: 44rpx;
  630. top: 30rpx;
  631. right: 30rpx;
  632. image {
  633. width: 100%;
  634. height: 100%;
  635. }
  636. }
  637. .regulation_name {
  638. padding: 40rpx 0;
  639. text-align: center;
  640. font-size: 30rpx;
  641. font-weight: bold;
  642. }
  643. .scroll-view {
  644. height: 735rpx;
  645. }
  646. .regulation_btn {
  647. margin: 20rpx auto 0;
  648. width: 496rpx;
  649. height: 78rpx;
  650. background: #dc262b;
  651. border-radius: 10rpx;
  652. font-size: 34rpx;
  653. font-family: PingFang SC;
  654. font-weight: 500;
  655. color: #ffffff;
  656. text-align: center;
  657. line-height: 78rpx;
  658. }
  659. }
  660. </style>