activity.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view v-if="isShow">
  3. <view class="tab ddflex">
  4. <view :class="'li' + (current == 2 ? ' active':'')" @click="tabClick(2)">待参赛</view>
  5. <view :class="'li' + (current == 3 ? ' active':'')" @click="tabClick(3)">已参赛</view>
  6. </view>
  7. <view class="list" v-if="pageList && pageList.length >0">
  8. <view class="li" v-for="(item,index) in pageList" :key="index" @click="jumpUrl('/match/activityDet/activityDet?id=' + item.id + '&orderId=' + item.orderId)">
  9. <view class="infos ddflex">
  10. <view class="imgbox">
  11. <image :src="item.pic" mode="aspectFill"></image>
  12. <!-- <text class="tag">已认证</text> -->
  13. </view>
  14. <view class="fflex">
  15. <view class="act-tit tovers">{{item.title}}</view>
  16. <view class="area fflex tover">
  17. <text>{{item.startTime}}</text>
  18. <!-- <text>湖南长沙</text> -->
  19. </view>
  20. </view>
  21. </view>
  22. <view class="libot ddflex">
  23. <view class="time fflex" v-if="item.state != 5">{{item.startTime}}-{{item.endTime}}</view>
  24. <view class="btn end">{{item.enlistState == 0 ? '未付款' : item.enlistState == 2 ? '报名成功' : '报名失败'}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="nodata" v-else>
  29. <image :src="picUrlss+'empty.png'"></image>
  30. <text>暂无记录~</text>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. const req = require('../../utils/request.js');
  36. const api = require('../../utils/api.js');
  37. const util = require('../../utils/util.js');
  38. const app = getApp();
  39. export default {
  40. components: {
  41. },
  42. data() {
  43. return {
  44. picUrlss: req.public.picUrls,
  45. isShow: false,
  46. current: 2,
  47. pageList: [],
  48. isLoad: true,
  49. form: {
  50. page: 1,
  51. limit: 10
  52. },
  53. };
  54. },
  55. onLoad() {},
  56. onShow() {
  57. this.getPageList(true);
  58. },
  59. onReachBottom: function() {
  60. this.form.page++;
  61. this.getPageList(false);
  62. },
  63. methods: {
  64. tabClick(it){
  65. if(it == this.current) return false;
  66. this.current = it;
  67. this.isLoad = true;
  68. this.getPageList();
  69. },
  70. getPageList(isShow){
  71. if (!this.isLoad) return false;
  72. this.isLoad = false;
  73. let form = this.form;
  74. req.loadIng('加载中')
  75. form.state = this.current;
  76. // form.state = 2;
  77. req.getRequest('/api/match/enlist/list',form,res => {
  78. this.isShow = true;
  79. if (res && res.length == 10) {
  80. this.isLoad = true;
  81. }
  82. if (this.form.page > 1) {
  83. res = this.pageList.concat(res);
  84. }
  85. this.pageList = res;
  86. uni.hideLoading()
  87. },isShow);
  88. },
  89. jumpUrl(url){
  90. uni.navigateTo({
  91. url: url
  92. })
  93. },
  94. }
  95. };
  96. </script>
  97. <style>
  98. @import "./activity.css";
  99. </style>