halllist.vue 15 KB

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