activity.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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(options) {
  56. if(options.current){
  57. this.current = options.current
  58. }
  59. },
  60. onShow() {
  61. this.getPageList(true);
  62. },
  63. onReachBottom: function() {
  64. this.form.page++;
  65. this.getPageList(false);
  66. },
  67. methods: {
  68. tabClick(it){
  69. if(it == this.current) return false;
  70. this.current = it;
  71. this.form.page = 1;
  72. this.isLoad = true;
  73. this.getPageList();
  74. },
  75. getPageList(isShow){
  76. if (!this.isLoad) return false;
  77. this.isLoad = false;
  78. let form = this.form;
  79. req.loadIng('加载中')
  80. form.state = this.current;
  81. // form.state = 2;
  82. req.getRequest('/api/match/enlist/list',form,res => {
  83. this.isShow = true;
  84. if (res && res.length == 10) {
  85. this.isLoad = true;
  86. }
  87. if (this.form.page > 1) {
  88. res = this.pageList.concat(res);
  89. }
  90. this.pageList = res;
  91. uni.hideLoading()
  92. },isShow);
  93. },
  94. jumpUrl(url){
  95. uni.navigateTo({
  96. url: url
  97. })
  98. },
  99. }
  100. };
  101. </script>
  102. <style>
  103. @import "./activity.css";
  104. </style>