index.vue 17 KB

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