halllist.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  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. this.chain = data.chain;
  159. });
  160. this.loadData();
  161. },
  162. computed: {
  163. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  164. },
  165. methods: {
  166. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  167. loadData() {
  168. const obj = this;
  169. if (obj.loadingType == 'nomore' || obj.loadingType == 'loading') {
  170. return;
  171. }
  172. obj.loadingType = 'loading';
  173. auction_list({
  174. page: obj.page,
  175. limit: obj.limit,
  176. }).then(({
  177. data
  178. }) => {
  179. obj.images = data.slider_image;
  180. console.log(data);
  181. data.data.forEach(e => {
  182. let now_time = timeComputed(e.time);
  183. this.price_cate = data.price_cate;
  184. console.log(e.time, now_time);
  185. e.hours = now_time.hours;
  186. e.minutes = now_time.minutes;
  187. e.seconds = now_time.seconds;
  188. if (now_time.hours < 0 || now_time.minutes < 0 || now_time.seconds < 0) {
  189. e.daotime = 1;
  190. } else {
  191. e.daotime = 0;
  192. }
  193. let jcsj = e.radd_time.split(':');
  194. if (jcsj[0] * 1 >= 8 && jcsj[0] * 1 < 12) {
  195. e.time_image = '../../static/img/morningicon.png';
  196. e.show = 'MORNING SHOWS';
  197. } else if (jcsj[0] * 1 >= 12 && jcsj[0] * 1 < 18) {
  198. e.show = 'AFTERNOON SHOWS';
  199. e.time_image = '../../static/img/afternoonicon.png';
  200. } else {
  201. e.time_image = '../../static/img/eveningicon.png';
  202. e.show = 'EVENING SHOWS';
  203. }
  204. });
  205. obj.list = obj.list.concat(data.data);
  206. if (data.data.length == obj.limit) {
  207. obj.loadingType = 'more';
  208. obj.page++;
  209. } else {
  210. obj.loadingType = 'nomore';
  211. }
  212. });
  213. },
  214. open(item) {
  215. if (this.wx == '' && this.aliData == '' && this.bankData == ''&&this.chain=='') {
  216. uni.showModal({
  217. title: '提示',
  218. content: '您未填写收款信息无法参与,是否前去填写收款信息?',
  219. success: function(res) {
  220. if (res.confirm) {
  221. uni.navigateTo({
  222. url: '/pages/collection/collection'
  223. });
  224. } else if (res.cancel) {
  225. console.log('用户点击取消');
  226. }
  227. }
  228. });
  229. return;
  230. }
  231. this.id = item.id;
  232. this.$refs.popup.open();
  233. // 场次是否已经预约sta=1未预约
  234. },
  235. goDetails(e) {
  236. console.log(e, '123456');
  237. uni.navigateTo({
  238. url: '/pages/index/messageInfo?id=' + this.article[e].id
  239. });
  240. },
  241. close() {
  242. this.id = '';
  243. this.$refs.popup.close();
  244. },
  245. navTo(url) {
  246. uni.navigateTo({
  247. url
  248. });
  249. },
  250. toBack() {
  251. uni.navigateBack({});
  252. },
  253. appointment() {
  254. subscribe({
  255. id: this.id,
  256. price: this.price_cate[this.actionPay]
  257. })
  258. .then(({
  259. data
  260. }) => {
  261. this.$api.msg('预约成功');
  262. console.log(data);
  263. this.$refs.popup.close();
  264. this.page = 1;
  265. this.limit = 10;
  266. this.loadingType = 'more';
  267. this.list = [];
  268. this.loadData();
  269. this.updata();
  270. })
  271. .catch(e => {
  272. this.$refs.popup.close();
  273. console.log(e);
  274. });
  275. },
  276. updata() {
  277. getUserInfo({})
  278. .then(({
  279. data
  280. }) => {
  281. this.setUserInfo(data);
  282. })
  283. .catch(e => {
  284. console.log(e);
  285. });
  286. },
  287. isTime(index) {
  288. console.log(index, '123');
  289. this.list[index].daotime = 1;
  290. }
  291. }
  292. };
  293. </script>
  294. <style lang="scss">
  295. page,
  296. .center {
  297. height: auto;
  298. min-height: 100%;
  299. background: #f2f5f4;
  300. }
  301. .status_bar {
  302. height: var(--status-bar-height);
  303. width: 100%;
  304. }
  305. .money-box {
  306. color:$font-color-dark;
  307. text-align: center;
  308. position: relative;
  309. .header {
  310. width: 100%;
  311. height: 80rpx;
  312. font-size: 32rpx;
  313. font-weight: 700;
  314. z-index: 99;
  315. display: flex;
  316. justify-content: center;
  317. align-items: center;
  318. }
  319. .goback-box {
  320. position: absolute;
  321. left: 18rpx;
  322. top: 0;
  323. height: 80rpx;
  324. display: flex;
  325. align-items: center;
  326. }
  327. .goback {
  328. z-index: 100;
  329. width: 34rpx;
  330. height: 34rpx;
  331. }
  332. .money_bg {
  333. width: 100%;
  334. height: 382rpx;
  335. display: block;
  336. }
  337. }
  338. .shingle-mmain {
  339. position: relative;
  340. z-index: 2;
  341. margin: -90rpx auto 0;
  342. width: 690rpx;
  343. height: 176rpx;
  344. background: #ffffff;
  345. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  346. border-radius: 20rpx;
  347. background-color: #ffffff;
  348. .smmain-item {
  349. width: 33%;
  350. display: flex;
  351. flex-direction: column;
  352. align-items: center;
  353. .red {
  354. color: #fd3b39 !important;
  355. }
  356. .smitem-top {
  357. font-size: 30rpx;
  358. font-family: PingFang SC;
  359. font-weight: bolder;
  360. color: #0c1732;
  361. }
  362. .smitem-bottom {
  363. margin-top: 10rpx;
  364. font-size: 30rpx;
  365. font-family: PingFang SC;
  366. font-weight: 500;
  367. color: #0c1732;
  368. }
  369. .people {
  370. justify-content: center;
  371. .peopleitem {
  372. width: 24rpx;
  373. height: 34rpx;
  374. image {
  375. width: 100%;
  376. height: 100%;
  377. }
  378. }
  379. }
  380. }
  381. .shu {
  382. width: 2rpx;
  383. height: 70rpx;
  384. background: #dcdcdc;
  385. }
  386. }
  387. .main {
  388. margin: 30rpx auto 0;
  389. padding: 50rpx 50rpx 36rpx 50rpx;
  390. width: 690rpx;
  391. background: #ffffff;
  392. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  393. border-radius: 20rpx;
  394. .mtitle-english {
  395. font-size: 30rpx;
  396. font-family: PingFang SC;
  397. font-weight: bold;
  398. color: #9ea6ba;
  399. }
  400. .mmain {
  401. margin-top: 24rpx;
  402. .mmain-info {
  403. .mmain-title {
  404. display: flex;
  405. justify-content: flex-start;
  406. align-items: center;
  407. .mmaint-left {
  408. width: 52rpx;
  409. height: 40rpx;
  410. }
  411. .mmaint-font {
  412. margin-left: 10rpx;
  413. font-size: 32rpx;
  414. font-family: PingFang SC;
  415. font-weight: bold;
  416. color: #0c1732;
  417. }
  418. .mmaint-time {
  419. margin-left: 20rpx;
  420. font-size: 28rpx;
  421. font-family: PingFang SC;
  422. font-weight: 500;
  423. color: #0c1732;
  424. }
  425. }
  426. .mmain-time {
  427. justify-content: flex-start;
  428. margin-top: 10rpx;
  429. font-size: 26rpx;
  430. font-family: PingFang SC;
  431. font-weight: 500;
  432. color: #0c1732;
  433. .lyy-b-jz {
  434. margin-left: 10rpx;
  435. }
  436. }
  437. }
  438. .mmain-image {
  439. padding-top: 14rpx;
  440. width: 182rpx;
  441. height: 182rpx;
  442. image {
  443. width: 100%;
  444. height: 100%;
  445. }
  446. }
  447. }
  448. .bottom {
  449. margin: 0 auto;
  450. margin-top: 32rpx;
  451. width: 440rpx;
  452. height: 80rpx;
  453. background: linear-gradient(90deg, #C38E4F, #ECC697);
  454. border-radius: 20rpx;
  455. display: flex;
  456. justify-content: center;
  457. align-items: center;
  458. .bottom-font {
  459. font-size: 28rpx;
  460. font-family: PingFang SC;
  461. font-weight: bold;
  462. color: #ffffff;
  463. }
  464. .bottom-image {
  465. margin-left: 12rpx;
  466. width: 24rpx;
  467. height: 22rpx;
  468. }
  469. }
  470. }
  471. .popup {
  472. width: 582rpx;
  473. background: #ffffff;
  474. border-radius: 20rpx;
  475. // padding: 118rpx 20rpx 30rpx;
  476. .popup-title {
  477. padding: 30rpx;
  478. text-align: center;
  479. .title {
  480. font-size: $font-lg;
  481. padding-bottom: 30rpx;
  482. }
  483. .pirice {
  484. font-weight: bold;
  485. line-height: 70rpx;
  486. min-width: 140rpx;
  487. height: 70rpx;
  488. border: 1px solid #9ea6ba;
  489. &.action{
  490. color: #FFF;
  491. background-color: $u-type-primary;
  492. border-color: $u-type-primary;
  493. }
  494. }
  495. }
  496. .btn-box {
  497. display: flex;
  498. align-items: center;
  499. justify-content: space-between;
  500. border-top: 1px solid $border-color-light;
  501. font-size: 34rpx;
  502. text-align: center;
  503. font-weight: 500;
  504. line-height: 78rpx;
  505. .btn-left,
  506. .btn-right {
  507. flex-grow: 1;
  508. height: 78rpx;
  509. }
  510. .btn-left {
  511. color: $font-color-dark;
  512. }
  513. .btn-right {
  514. background: $u-type-primary;
  515. color: #ffffff;
  516. }
  517. }
  518. }
  519. .message {
  520. justify-content: space-around;
  521. margin: 20rpx auto 0;
  522. padding: 16rpx 40rpx 16rpx 50rpx;
  523. width: 690rpx;
  524. background: #ffffff;
  525. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  526. border-radius: 20rpx;
  527. .message-left {
  528. width: 52rpx;
  529. height: 52rpx;
  530. flex-shrink: 0;
  531. }
  532. .message-font {
  533. margin: 0 40rpx;
  534. font-size: 28rpx;
  535. font-family: PingFang SC;
  536. font-weight: 500;
  537. color: #0c1732;
  538. }
  539. .message-right {
  540. width: 18rpx;
  541. height: 30rpx;
  542. }
  543. }
  544. .hallist-bg {
  545. position: relative;
  546. z-index: 10;
  547. margin: 0 auto;
  548. width: 702rpx;
  549. height: 300rpx;
  550. border-radius: 14rpx;
  551. overflow: hidden;
  552. image {
  553. width: 100%;
  554. height: 100%;
  555. }
  556. }
  557. .navbar {
  558. display: flex;
  559. align-items: center;
  560. justify-content: space-around;
  561. width: 700rpx;
  562. background: #ffffff;
  563. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  564. border-radius: 20rpx;
  565. margin: 40rpx auto 0;
  566. padding: 40rpx 0 50rpx;
  567. .vvv {
  568. width: 2rpx;
  569. height: 74rpx;
  570. background: #dcdcdc;
  571. }
  572. .navbar-item {
  573. display: flex;
  574. flex-direction: column;
  575. align-items: center;
  576. .navbar-font {
  577. margin-bottom: 10rpx;
  578. display: flex;
  579. justify-content: center;
  580. align-items: center;
  581. image {
  582. margin-right: 10rpx;
  583. width: 40rpx;
  584. height: 40rpx;
  585. }
  586. .font {
  587. font-size: 30rpx;
  588. font-weight: bold;
  589. color: #0c1732;
  590. }
  591. }
  592. .navbar-num {
  593. font-size: 34rpx;
  594. font-weight: bold;
  595. color: #0c1732;
  596. }
  597. }
  598. }
  599. .regulation {
  600. width: 650rpx;
  601. padding: 30rpx;
  602. background: #ffffff;
  603. border-radius: 20rpx;
  604. position: relative;
  605. .regulation_close {
  606. position: absolute;
  607. width: 44rpx;
  608. height: 44rpx;
  609. top: 30rpx;
  610. right: 30rpx;
  611. image {
  612. width: 100%;
  613. height: 100%;
  614. }
  615. }
  616. .regulation_name {
  617. padding: 40rpx 0;
  618. text-align: center;
  619. font-size: 30rpx;
  620. font-weight: bold;
  621. }
  622. .scroll-view {
  623. height: 735rpx;
  624. }
  625. .regulation_btn {
  626. margin: 20rpx auto 0;
  627. width: 496rpx;
  628. height: 78rpx;
  629. background: #dc262b;
  630. border-radius: 10rpx;
  631. font-size: 34rpx;
  632. font-family: PingFang SC;
  633. font-weight: 500;
  634. color: #ffffff;
  635. text-align: center;
  636. line-height: 78rpx;
  637. }
  638. }
  639. </style>