halllist.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  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. .money-box {
  366. color: #ffffff;
  367. text-align: center;
  368. position: relative;
  369. .header {
  370. position: absolute;
  371. left: 0;
  372. top: 0;
  373. width: 100%;
  374. height: 80rpx;
  375. font-size: 32rpx;
  376. font-weight: 700;
  377. z-index: 99;
  378. display: flex;
  379. justify-content: center;
  380. align-items: center;
  381. }
  382. .goback-box {
  383. position: absolute;
  384. left: 18rpx;
  385. top: 0;
  386. height: 80rpx;
  387. display: flex;
  388. align-items: center;
  389. }
  390. .goback {
  391. z-index: 100;
  392. width: 34rpx;
  393. height: 34rpx;
  394. }
  395. .money_bg {
  396. width: 100%;
  397. height: 382rpx;
  398. display: block;
  399. }
  400. }
  401. .shingle-mmain {
  402. position: relative;
  403. z-index: 2;
  404. margin: -90rpx auto 0;
  405. width: 690rpx;
  406. height: 176rpx;
  407. background: #ffffff;
  408. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  409. border-radius: 20rpx;
  410. background-color: #ffffff;
  411. .smmain-item {
  412. width: 33%;
  413. display: flex;
  414. flex-direction: column;
  415. align-items: center;
  416. .red {
  417. color: #fd3b39 !important;
  418. }
  419. .smitem-top {
  420. font-size: 30rpx;
  421. font-family: PingFang SC;
  422. font-weight: bolder;
  423. color: #0c1732;
  424. }
  425. .smitem-bottom {
  426. margin-top: 10rpx;
  427. font-size: 30rpx;
  428. font-family: PingFang SC;
  429. font-weight: 500;
  430. color: #0c1732;
  431. }
  432. .people {
  433. justify-content: center;
  434. .peopleitem {
  435. width: 24rpx;
  436. height: 34rpx;
  437. image {
  438. width: 100%;
  439. height: 100%;
  440. }
  441. }
  442. }
  443. }
  444. .shu {
  445. width: 2rpx;
  446. height: 70rpx;
  447. background: #dcdcdc;
  448. }
  449. }
  450. .main {
  451. margin: 30rpx auto 0;
  452. padding: 50rpx 50rpx 36rpx 50rpx;
  453. width: 690rpx;
  454. background: #ffffff;
  455. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  456. border-radius: 20rpx;
  457. .mtitle-english {
  458. font-size: 30rpx;
  459. font-family: PingFang SC;
  460. font-weight: bold;
  461. color: #9ea6ba;
  462. }
  463. .mmain {
  464. margin-top: 24rpx;
  465. .mmain-info {
  466. .mmain-title {
  467. display: flex;
  468. justify-content: flex-start;
  469. align-items: center;
  470. .mmaint-left {
  471. width: 52rpx;
  472. height: 40rpx;
  473. }
  474. .mmaint-font {
  475. margin-left: 10rpx;
  476. font-size: 32rpx;
  477. font-family: PingFang SC;
  478. font-weight: bold;
  479. color: #0c1732;
  480. }
  481. .mmaint-time {
  482. margin-left: 20rpx;
  483. font-size: 28rpx;
  484. font-family: PingFang SC;
  485. font-weight: 500;
  486. color: #0c1732;
  487. }
  488. }
  489. .mmain-time {
  490. justify-content: flex-start;
  491. margin-top: 10rpx;
  492. font-size: 26rpx;
  493. font-family: PingFang SC;
  494. font-weight: 500;
  495. color: #0c1732;
  496. .lyy-b-jz {
  497. margin-left: 10rpx;
  498. }
  499. }
  500. }
  501. .mmain-image {
  502. padding-top: 14rpx;
  503. width: 182rpx;
  504. height: 182rpx;
  505. image {
  506. width: 100%;
  507. height: 100%;
  508. }
  509. }
  510. }
  511. .bottom {
  512. margin-top: 32rpx;
  513. width: 380rpx;
  514. height: 64rpx;
  515. background: #d13737;
  516. border-radius: 20rpx;
  517. display: flex;
  518. justify-content: center;
  519. align-items: center;
  520. .bottom-font {
  521. font-size: 28rpx;
  522. font-family: PingFang SC;
  523. font-weight: bold;
  524. color: #ffffff;
  525. }
  526. .bottom-image {
  527. margin-left: 12rpx;
  528. width: 24rpx;
  529. height: 22rpx;
  530. }
  531. }
  532. }
  533. .popup {
  534. width: 582rpx;
  535. background: #ffffff;
  536. border-radius: 20rpx;
  537. padding: 118rpx 20rpx 30rpx;
  538. .popup-title {
  539. text-align: center;
  540. font-size: 42rpx;
  541. font-family: PingFang SC;
  542. font-weight: 500;
  543. color: #0c1732;
  544. }
  545. .btn-box {
  546. padding-top: 90rpx;
  547. display: flex;
  548. align-items: center;
  549. justify-content: space-between;
  550. .btn-left {
  551. width: 248rpx;
  552. height: 78rpx;
  553. border: 2rpx solid #dc262b;
  554. border-radius: 10rpx;
  555. font-size: 34rpx;
  556. font-family: PingFang SC;
  557. font-weight: 500;
  558. color: #dc262b;
  559. text-align: center;
  560. line-height: 78rpx;
  561. }
  562. .btn-right {
  563. width: 248rpx;
  564. height: 78rpx;
  565. background: #dc262b;
  566. border-radius: 10rpx;
  567. font-size: 34rpx;
  568. font-family: PingFang SC;
  569. font-weight: 500;
  570. color: #ffffff;
  571. text-align: center;
  572. line-height: 78rpx;
  573. }
  574. }
  575. }
  576. .message {
  577. justify-content: space-around;
  578. margin: 20rpx auto 0;
  579. padding: 16rpx 40rpx 16rpx 50rpx;
  580. width: 690rpx;
  581. background: #ffffff;
  582. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  583. border-radius: 20rpx;
  584. .message-left {
  585. width: 52rpx;
  586. height: 52rpx;
  587. flex-shrink: 0;
  588. }
  589. .message-font {
  590. margin: 0 40rpx;
  591. font-size: 28rpx;
  592. font-family: PingFang SC;
  593. font-weight: 500;
  594. color: #0c1732;
  595. }
  596. .message-right {
  597. width: 18rpx;
  598. height: 30rpx;
  599. }
  600. }
  601. .hallist-bg {
  602. position: relative;
  603. z-index: 10;
  604. margin: -280rpx auto 0;
  605. width: 702rpx;
  606. height: 300rpx;
  607. border-radius: 14rpx;
  608. image {
  609. width: 100%;
  610. height: 100%;
  611. }
  612. }
  613. .navbar {
  614. display: flex;
  615. align-items: center;
  616. justify-content: space-around;
  617. width: 700rpx;
  618. background: #ffffff;
  619. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  620. border-radius: 20rpx;
  621. margin: 40rpx auto 0;
  622. padding: 40rpx 0 50rpx;
  623. .vvv {
  624. width: 2rpx;
  625. height: 74rpx;
  626. background: #dcdcdc;
  627. }
  628. .navbar-item {
  629. display: flex;
  630. flex-direction: column;
  631. align-items: center;
  632. .navbar-font {
  633. margin-bottom: 10rpx;
  634. display: flex;
  635. justify-content: center;
  636. align-items: center;
  637. image {
  638. margin-right: 10rpx;
  639. width: 40rpx;
  640. height: 40rpx;
  641. }
  642. .font {
  643. font-size: 30rpx;
  644. font-weight: bold;
  645. color: #0c1732;
  646. }
  647. }
  648. .navbar-num {
  649. font-size: 34rpx;
  650. font-weight: bold;
  651. color: #0c1732;
  652. }
  653. }
  654. }
  655. </style>