itemIndex.vue 17 KB

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