itemIndex.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. <template>
  2. <view>
  3. <view class="app-bg">
  4. <image src="/static/img/tream_bg.png"></image>
  5. </view>
  6. <uni-nav-bar color="#fff" :border="false" statusBar left-icon="left" @clickLeft="utils.navigateBack()"
  7. backgroundColor="transparent" fixed title="我的部门"></uni-nav-bar>
  8. <view class="swiper-img" id="app-top">
  9. <uv-swiper :list="topData.banner" @click="tapAdver" keyName="img" bgColor="transparent" indicator
  10. indicatorActiveColor="#DB292B" indicatorInactiveColor="#B7B7B7" previousMargin="15" nextMargin="15"
  11. indicatorMode="line"></uv-swiper>
  12. </view>
  13. <view class="app-body" v-if="user != null">
  14. <view class="pannel fx-r fx-bc fx-ac">
  15. <view class="item fx-h fx-bc fx-ac" @tap="tapOpen" data-url="/pages/user/detail/integral">
  16. <view class="count">{{ user != null ? user.integral : 0 }}</view>
  17. <view class="label">趣豆</view>
  18. </view>
  19. <view class="line"></view>
  20. <view class="item fx-h fx-bc fx-ac">
  21. <view class="count">{{ user != null ? user.total_earnings : 0 }}</view>
  22. <view class="label">我的收益</view>
  23. </view>
  24. <view class="line"></view>
  25. <view class="item fx-h fx-bc fx-ac" @tap="tapOpen" data-url="/pages/user/detail/anticipate">
  26. <view class="count">{{ user != null ? user.anticipate : 0 }}</view>
  27. <view class="label">易趣卷</view>
  28. </view>
  29. </view>
  30. <view class="team-buy" v-if="data.guData != null">
  31. <view class="team-show">
  32. <view class="label">{{ data.guData.name }}</view>
  33. <view class="guNickname">
  34. {{ data.guData.nickname }}
  35. </view>
  36. <view class="body fx-h fx-bc fx-ac">
  37. <!-- <view class="top-input">
  38. <image src="/static/img/team-top-title.png" class="tbg"></image>
  39. <view class="inner fx-r fx-bc fx-ac">
  40. <image src="/static/img/team-top-location.png"></image>
  41. <view class="label">{{ data.guData.name }}</view>
  42. </view>
  43. </view> -->
  44. <!-- <view class="info fx-r fx-g1 fx-bc fx-ac">
  45. <view class="item fx-h fx-bc fx-ac">
  46. <view class="label" v-if="data.guData.status == 1">开放中</view>
  47. <view class="label" style="color: red;" v-else>闭馆中</view>
  48. <view class="name">状态</view>
  49. </view>
  50. <view class="halving"></view>
  51. <view class="item fx-h fx-bc fx-ac">
  52. <view class="label">{{ data.guData.nickname }}</view>
  53. <view class="name">部长</view>
  54. </view>
  55. <view class="halving"></view>
  56. <view class="item fx-h fx-bc fx-ac">
  57. <view class="people fx-r">
  58. <image :src="index == 0 ? '/static/img/hong_people.png' : '/static/img/while_people.png'" v-for="(item,index) in 5"></image>
  59. </view>
  60. <view class="name">流畅</view>
  61. </view>
  62. </view> -->
  63. </view>
  64. </view>
  65. </view>
  66. <view class="venue-list" v-if="data.auction != null">
  67. <view class="item" v-for="(item,index) in data.auction">
  68. <view class="top-info fx-r">
  69. <view class="avatar">
  70. <image :src="item.image" mode="aspectFill"></image>
  71. </view>
  72. <view class="info">
  73. <view class="title">{{ item.nickname }}</view>
  74. <view class="time fx-r fx-bc" v-if="item.is_today">
  75. <image src="/static/img/c-time.png"></image>
  76. 开售:{{ utils.date('H:i:s',item.radd_time + item.in_time) }}
  77. </view>
  78. <view class="time fx-r fx-bc" v-else>
  79. <image src="/static/img/c-time.png"></image>
  80. 场次时间:{{ item.next_day || "无" }}
  81. </view>
  82. </view>
  83. </view>
  84. <view class="yinfo fx-r">
  85. <view class="y-time">预约时间:
  86. <text v-if="item.add_time > 0">
  87. {{ utils.date('H:i',item.add_time) }}-{{ utils.date('H:i',item.end_time) }}
  88. </text>
  89. </view>
  90. <view class="fx-g1"></view>
  91. <view class="y-time">入场时间:
  92. <text>
  93. {{ utils.date('H:i',item.radd_time) }}-{{ utils.date('H:i',item.rend_time) }}
  94. </text>
  95. </view>
  96. </view>
  97. <view class="yfoot fx-r fx-bc" v-if="item.showType == 0">
  98. <view class="time1 fx-r" style="color: #787878;">预约时间:{{ utils.date('m-d H:i',item.add_time) }}
  99. </view>
  100. <view class="fx-g1"></view>
  101. <view class="sbtn-no">未到预约时间</view>
  102. </view>
  103. <view class="yfoot fx-r fx-bc" v-if="item.showType == 1">
  104. <view class="time1 fx-r">
  105. 距预约结束:
  106. <countdown :startTime="utils.date('Y-m-d H:i:s')"
  107. :endTime="utils.date('Y-m-d H:i:m',item.end_time)" />
  108. </view>
  109. <view class="fx-g1"></view>
  110. <view class="sbtn" v-if="item.booking_count <= 0" @tap="tapBooking(item)">立即预约</view>
  111. <view class="sbtn-no" v-else>已预约</view>
  112. </view>
  113. <view class="yfoot fx-r fx-bc" v-if="item.showType == 2">
  114. <view class="time1 fx-r" style="color: #787878;">入场时间:{{ utils.date('m-d H:i',item.radd_time) }}
  115. </view>
  116. <view class="fx-g1"></view>
  117. <view class="sbtn-no">未到入场时间</view>
  118. </view>
  119. <!-- 可以入场时间 -->
  120. <view class="yfoot fx-r fx-bc" v-if="item.showType == 3">
  121. <template v-if="item.booking_count > 0">
  122. <view class="time1 fx-r"
  123. v-if=" item.radd_time >= utils.strtotime() && utils.strtotime() < (item.radd_time + item.in_time) ">
  124. 距入场时间:
  125. <countdown :startTime="utils.date('Y-m-d H:i:s')"
  126. :endTime="utils.date('Y-m-d H:i:s',item.radd_time)" />
  127. </view>
  128. <view class="time1 fx-r"
  129. v-if=" (item.radd_time + item.in_time) >= utils.strtotime() && utils.strtotime() < item.rend_time ">
  130. 距开售时间:
  131. <countdown :startTime="utils.date('Y-m-d H:i:s')"
  132. :endTime="utils.date('Y-m-d H:i:s',(item.radd_time + item.in_time))" />
  133. </view>
  134. <view class="time1 fx-r"
  135. v-if=" item.rend_time >= utils.strtotime() && utils.strtotime() > (item.radd_time + item.in_time) ">
  136. 距结束:
  137. <countdown :startTime="utils.date('Y-m-d H:i:s')"
  138. :endTime="utils.date('Y-m-d H:i:s',item.rend_time)" />
  139. </view>
  140. <view class="fx-g1"></view>
  141. <view class="sbtn" @tap="tapItem(item)">立即进入</view>
  142. </template>
  143. <template v-if="item.booking_count == 0">
  144. <view class="time1 fx-r"
  145. v-if=" item.radd_time >= utils.strtotime() && utils.strtotime() < (item.radd_time + item.in_time) ">
  146. 距入场时间:
  147. <countdown :startTime="utils.date('Y-m-d H:i:s')"
  148. :endTime="utils.date('Y-m-d H:i:s',item.radd_time)" />
  149. </view>
  150. <view class="time1 fx-r"
  151. v-if=" (item.radd_time + item.in_time) >= utils.strtotime() && utils.strtotime() < item.rend_time ">
  152. 距开售时间:
  153. <countdown :startTime="utils.date('Y-m-d H:i:s')"
  154. :endTime="utils.date('Y-m-d H:i:s',(item.radd_time + item.in_time))" />
  155. </view>
  156. <view class="time1 fx-r"
  157. v-if=" item.rend_time >= utils.strtotime() && utils.strtotime() > (item.radd_time + item.in_time) ">
  158. 距结束:
  159. <countdown :startTime="utils.date('Y-m-d H:i:s')"
  160. :endTime="utils.date('Y-m-d H:i:s',item.rend_time)" />
  161. </view>
  162. <view class="fx-g1"></view>
  163. <view class="sbtn-no">未预约无法入场</view>
  164. </template>
  165. </view>
  166. </view>
  167. </view>
  168. </view>
  169. <view v-else :style="'height:60vh;'" class="user-bann fx-h fx-bc fx-ac">
  170. <view class="tips">你还未登录,请点击登录查看</view>
  171. <view class="btn" @tap="tapLogin" style="margin-top: 10px;">立即登录</view>
  172. </view>
  173. <view class="popwin fx-h fx-bc fx-ac" v-if="isShowContent">
  174. <view class="bg"></view>
  175. <view class="body fx-h fx-bc fx-ac">
  176. <view style="font-size: 16px;color: #333;font-weight: bold;padding-bottom: 25rpx;">CBB产品订单购买协议</view>
  177. <scroll-view scroll-y class="max-he">
  178. <mp-html :content="topData.content"></mp-html>
  179. </scroll-view>
  180. <view class="btn" @tap="tapAction">已阅读并同意</view>
  181. </view>
  182. </view>
  183. <uv-modal ref='itemModal' title="预约场次" :showConfirmButton="false">
  184. <view class="booking">
  185. <view class="booking-content">
  186. 预约<text v-if="itemData != null ">{{ itemData.reserve_count }}单</text>,需要<text
  187. v-if="itemData != null ">{{ itemData.all_anticipate }}</text>易趣卷是否立即预约?
  188. </view>
  189. <view class="foot fx-r">
  190. <view class="btn ihover" @tap="tapBookAc">确认</view>
  191. <view class="nbtn ihover" @tap="itemModalClose()">取消</view>
  192. </view>
  193. </view>
  194. </uv-modal>
  195. </view>
  196. </template>
  197. <script>
  198. import countdown from "@/components/cz-countdown/cz-countdown.vue";
  199. import {
  200. mapState,
  201. mapMutations
  202. } from 'vuex';
  203. export default {
  204. components: {
  205. countdown
  206. },
  207. computed: mapState(['user', 'sysData']),
  208. data() {
  209. return {
  210. barheight: 0,
  211. data: {
  212. guData: null,
  213. auction: null
  214. },
  215. topData: {
  216. banner: [],
  217. content: ""
  218. },
  219. isShowContent: false,
  220. itemData: null,
  221. actionType: "",
  222. isSubmit: false,
  223. intervalId: 0
  224. }
  225. },
  226. onLoad() {
  227. this.initView();
  228. this.intervalId = setInterval(this.interval, 1000);
  229. },
  230. onShow() {
  231. this.checkUserLogin({
  232. page: this,
  233. isLogion: false,
  234. fn: this.uInit
  235. });
  236. },
  237. onUnload() {
  238. clearInterval(this.intervalId);
  239. },
  240. methods: {
  241. ...mapMutations(['checkUserLogin']),
  242. initView: function() {
  243. this.$nextTick(() => {
  244. uni.createSelectorQuery().select("#app-top").boundingClientRect(res => {
  245. this.barheight = res.height;
  246. }).exec();
  247. });
  248. // #ifdef H5
  249. this.footHeight = 60;
  250. // #endif
  251. this
  252. .request
  253. .get("guInit")
  254. .then(res => {
  255. if (res.code == 200) {
  256. this.topData = res.data;
  257. let content = this.topData.content.replace(/&lt;/g,'<')
  258. content = content.replace(/&gt;/g,'>')
  259. content = content.replace(/&lt;\/p&gt;/g,'')
  260. console.log(content,'content')
  261. this.topData.content = content
  262. }
  263. });
  264. },
  265. /**
  266. * 获取其他信息
  267. */
  268. uInit: function() {
  269. this
  270. .request
  271. .post("getUserGu")
  272. .then(res => {
  273. uni.hideLoading();
  274. if (res.code == 200) {
  275. this.data = res.data;
  276. this.interval();
  277. }
  278. })
  279. .catch(err => {
  280. this.utils.Tip("加载失败,重新点击尝试!" + JSON.stringify(error));
  281. uni.hideLoading();
  282. });
  283. },
  284. /**
  285. * 预约操作
  286. */
  287. tapBooking: function(item) {
  288. if (this.user == null) {
  289. uni.navigateTo({
  290. url: "/pages/login/index"
  291. });
  292. return;
  293. }
  294. //是否认证
  295. if (this.user.is_auth != 1) {
  296. this.utils.showModal("您还未认证,点击进行认证", () => {
  297. uni.navigateTo({
  298. url: "/pages/user/approve"
  299. });
  300. });
  301. return;
  302. }
  303. //是否填写银行信息
  304. if (this.user.is_bank != 1) {
  305. this.utils.showModal("您还配置收款信息,点击配置", () => {
  306. uni.navigateTo({
  307. url: "/pages/user/bank/bank"
  308. });
  309. });
  310. return;
  311. }
  312. this.isShowContent = true;
  313. this.itemData = item;
  314. this.actionType = "booking";
  315. },
  316. tapAction: function() {
  317. this.isShowContent = false;
  318. if (this.actionType == "booking") {
  319. this.$refs.itemModal.open()
  320. }
  321. },
  322. itemModalClose(){
  323. this.$refs.itemModal.close()
  324. },
  325. /**
  326. * 打开Open
  327. * @param {Object} ev
  328. */
  329. tapOpen: function(ev) {
  330. let url = ev.currentTarget.dataset.url;
  331. this.utils.navigateTo(url);
  332. },
  333. /**
  334. * 预约单
  335. */
  336. tapBookAc: function() {
  337. this.$refs.itemModal.close
  338. if (this.isSubmit) return;
  339. this.isSubmit = true;
  340. uni.showLoading({
  341. title: '提交数据..'
  342. });
  343. this
  344. .request
  345. .post("auctionSubscribe", {
  346. id: this.itemData.id
  347. })
  348. .then(res => {
  349. uni.hideLoading();
  350. this.isSubmit = false;
  351. if (res.code == 200) {
  352. this.utils.Tip(res.msg);
  353. this.uInit();
  354. } else {
  355. this.utils.Tip(res.msg);
  356. }
  357. })
  358. .catch(err => {
  359. this.isSubmit = false;
  360. this.utils.Tip("加载失败,重新点击尝试!" + JSON.stringify(error));
  361. uni.hideLoading();
  362. });
  363. },
  364. /**
  365. *
  366. */
  367. tapLogin: function() {
  368. uni.navigateTo({
  369. url: "../login/index"
  370. });
  371. },
  372. tapAdver: function() {
  373. },
  374. /**
  375. * 详情页面
  376. */
  377. tapItem: function(item) {
  378. uni.navigateTo({
  379. url: "./rush?id=" + item.id
  380. })
  381. },
  382. interval: function() {
  383. if (this.data.auction != null) {
  384. let time = this.utils.strtotime();
  385. for (let i in this.data.auction) {
  386. let d = this.data.auction[i];
  387. //判断是否预约时间
  388. if (time >= d.add_time && time < d.end_time) {
  389. this.$set(this.data.auction[i], 'showType', 1);
  390. }
  391. //入场时间
  392. if (time >= d.end_time && time < d.radd_time) {
  393. this.$set(this.data.auction[i], 'showType', 2);
  394. }
  395. //判断是否入场-判断是不是到预约时间-是否已预约
  396. if (d.booking_count > 0 && time >= d.radd_time && time < d.rend_time) {
  397. this.$set(this.data.auction[i], 'showType', 3);
  398. }
  399. if (d.booking_count <= 0 && time >= d.radd_time && time < d.rend_time && time > d.end_time) {
  400. this.$set(this.data.auction[i], 'showType', 3);
  401. }
  402. if (time > d.rend_time) {
  403. this.$set(this.data.auction[i], 'showType', 4);
  404. }
  405. }
  406. }
  407. }
  408. }
  409. }
  410. </script>
  411. <style lang="scss">
  412. .app-bg {
  413. position: absolute;
  414. image {
  415. width: 100vw;
  416. height: 45vw;
  417. }
  418. }
  419. .app-body {
  420. position: relative;
  421. z-index: 9;
  422. padding: 0px 30rpx;
  423. }
  424. //业绩通道
  425. .pannel {
  426. background: #fff;
  427. border-radius: 20rpx;
  428. margin-top: 20rpx;
  429. padding: 60rpx 0;
  430. .item {
  431. width: calc(33% - 1px);
  432. .label {
  433. font-size: 14px;
  434. color: #666666;
  435. margin-top: 5px;
  436. }
  437. .count {
  438. font-weight: bold;
  439. font-size: 30rpx;
  440. color: #0C1732;
  441. }
  442. }
  443. .line {
  444. width: 1px;
  445. height: 45px;
  446. background: #DCDCDC;
  447. }
  448. }
  449. //抢货通道
  450. .team-buy {
  451. background-image: url("@/static/img/indexChatBg1.png");
  452. background-repeat: no-repeat;
  453. background-position: left bottom;
  454. background-size: 100% auto;
  455. height: 240rpx;
  456. margin-top: 20rpx;
  457. .team-show {
  458. color: #fff;
  459. font-weight: bold;
  460. text-align: center;
  461. padding-top: 70rpx;
  462. text-align: center;
  463. .label {
  464. font-size: 45rpx;
  465. padding-top: 15rpx;
  466. }
  467. .guNickname {
  468. display: inline-block;
  469. margin-top: 20rpx;
  470. font-size: 28rpx;
  471. padding: 8rpx 30rpx;
  472. background-color: #fffdf1;
  473. border: 1px solid #EDC299;
  474. border-radius: 100rpx;
  475. color: #EA3616;
  476. box-shadow: 4rpx 4rpx 10rpx 2rpx #FCD3BF inset;
  477. }
  478. }
  479. }
  480. .venue-list {
  481. .item {
  482. background: #fff;
  483. border-radius: 20rpx;
  484. padding: 30rpx;
  485. margin-top: 20rpx;
  486. .top-info {
  487. .avatar {
  488. width: 100rpx;
  489. height: 100rpx;
  490. border-radius: 10rpx;
  491. background: #f1f1f1;
  492. image {
  493. width: 100rpx;
  494. height: 100rpx;
  495. border-radius: 10rpx;
  496. }
  497. }
  498. .info {
  499. width: calc(100% - 120rpx);
  500. margin-left: 20rpx;
  501. .title {
  502. color: #081734;
  503. font-size: 34rpx;
  504. font-weight: bold;
  505. }
  506. .time {
  507. font-size: 22rpx;
  508. color: #666666;
  509. image {
  510. width: 30rpx;
  511. height: 28rpx;
  512. margin-right: 8rpx;
  513. }
  514. margin-top: 20rpx;
  515. }
  516. }
  517. }
  518. .yinfo {
  519. padding: 40rpx 0;
  520. .y-time {
  521. color: #666666;
  522. font-size: 26rpx;
  523. text {
  524. color: #081734;
  525. }
  526. }
  527. border-bottom: 1px solid #f1f1f1;
  528. }
  529. .yfoot {
  530. padding-top: 10px;
  531. .time1 {
  532. font-size: 14px;
  533. }
  534. .sbtn {
  535. background: #d13737;
  536. color: #fff;
  537. font-size: 14px;
  538. border-radius: 20rpx;
  539. padding: 4px 10px;
  540. }
  541. .sbtn-no {
  542. background: #f1f1f1;
  543. color: #787878;
  544. font-size: 14px;
  545. border-radius: 20rpx;
  546. padding: 4px 10px
  547. }
  548. }
  549. }
  550. }
  551. .user-bann {
  552. .tips {
  553. font-size: 14px;
  554. color: #787878;
  555. }
  556. .btn {
  557. background: $ic-appcolor;
  558. font-size: 14px;
  559. color: #fff;
  560. width: 160px;
  561. border-radius: 20px;
  562. height: 40px;
  563. text-align: center;
  564. line-height: 40px;
  565. }
  566. }
  567. /**弹出框 **/
  568. .popwin {
  569. position: fixed;
  570. width: 100%;
  571. height: 100%;
  572. top: 0;
  573. left: 0;
  574. z-index: 88;
  575. }
  576. .popwin .bg {
  577. background: rgba(0, 0, 0, 0.5);
  578. height: 100%;
  579. width: 100%;
  580. position: absolute;
  581. left: 0;
  582. top: 0;
  583. }
  584. .popwin .body {
  585. padding: 20px;
  586. width: 80%;
  587. background: #fff;
  588. position: relative;
  589. border-radius: 8px;
  590. }
  591. .max-he {
  592. height: 60vh;
  593. }
  594. .popwin .btn {
  595. margin-top: 6px;
  596. border-radius: 4px;
  597. background: #dc262b;
  598. font-size: 14px;
  599. color: #fff;
  600. width: 100px;
  601. text-align: center;
  602. padding: 6px 2px;
  603. }
  604. .popwin .btn.no {
  605. background: #f1f1f1;
  606. color: #ccc
  607. }
  608. .booking {
  609. .booking-content {
  610. font-size: 26px;
  611. padding: 10px 0;
  612. text {
  613. color: #d13737;
  614. }
  615. }
  616. .foot {
  617. padding: 20rpx 0;
  618. .btn {
  619. height: 40px;
  620. background: #dc262b;
  621. border-radius: 5px;
  622. font-size: 14px;
  623. color: #fff;
  624. text-align: center;
  625. line-height: 40px;
  626. width: 30vw;
  627. margin-right: 4vw;
  628. }
  629. .nbtn {
  630. height: 40px;
  631. border: 1px solid #dc262b;
  632. border-radius: 5px;
  633. font-size: 14px;
  634. color: #dc262b;
  635. text-align: center;
  636. line-height: 40px;
  637. width: 30vw;
  638. margin-left: 4vw;
  639. }
  640. }
  641. }
  642. </style>