activity.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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.enlistTime }}</text>
  18. <!-- <text>湖南长沙</text> -->
  19. </view>
  20. </view>
  21. </view>
  22. <view class="libot ddflex">
  23. <view class="time fflex"><block v-if="item.state != 5">{{ getTimeText(item.startTime,item.endTime,true) }}</block></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. getTimeText(startTime,endTime,isText){
  65. return util.getTimeText(startTime,endTime,isText);
  66. },
  67. tabClick(it){
  68. if(it == this.current) return false;
  69. this.current = it;
  70. this.getPageList();
  71. },
  72. getPageList(isShow){
  73. if (!this.isLoad) return false;
  74. this.isLoad = false;
  75. let form = this.form;
  76. req.loadIng('加载中')
  77. // form.state = this.current;
  78. // form.state = 2;
  79. req.getRequest('/api/match/enlist/list',form,res => {
  80. this.isShow = true;
  81. if (res && res.length == 10) {
  82. this.isLoad = true;
  83. }
  84. if (this.form.page > 1) {
  85. res = this.pageList.concat(res);
  86. }
  87. this.pageList = res;
  88. uni.hideLoading()
  89. },isShow);
  90. },
  91. jumpUrl(url){
  92. uni.navigateTo({
  93. url: url
  94. })
  95. },
  96. }
  97. };
  98. </script>
  99. <style>page{background-color: #f6f6f6}</style>
  100. <style>
  101. @import "./activity.css";
  102. </style>