activityManage.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view>
  3. <view class="top-fixed">
  4. <view class="search-box ddflex">
  5. <view class="search-input ddflex fflex">
  6. <image src="/static/images/ssico.png"></image>
  7. <input @confirm="searchFn" confirm-type="search" @input="searchFn" v-model="searchVal" class="fflex"
  8. placeholder="请输入关键词" />
  9. </view>
  10. </view>
  11. </view>
  12. <view style="height: 150rpx;"></view>
  13. <view class="title">
  14. 我的活动<text>共{{total}}个</text>
  15. </view>
  16. <view class="padd30" v-if="pageList.length>0">
  17. <view class="act-bar ddflex" v-for="item,index in pageList">
  18. <view class="act-pic">
  19. <image :src="item.pic" mode="aspectFill"></image>
  20. <view class="act-pic-tag" v-if="item.state==0">审核中</view>
  21. <view class="act-pic-tag" v-if="item.state==6">审核失败</view>
  22. </view>
  23. <view class="flex">
  24. <view class="act-title tovers">{{item.title}}</view>
  25. <view class="act-time">活动时间:{{formatTime(item.endTime)}}</view>
  26. <view class="act-bottom ddflex">
  27. <view class="act-bottom-look ddflex">
  28. <image src="../static/images/person.png"></image>
  29. {{item.person}}人
  30. </view>
  31. <view class="act-edit" @click="jumpUrl('/match/activityEdit/activityEdit?id='+item.id)">修改</view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="nodata nosp bgfff" v-else>
  37. <image :src="picUrlss+'empty_sp.png'"></image>
  38. <text>暂无活动</text>
  39. </view>
  40. <view class="act-create" @click="jumpUrl('/match/activityEdit/activityEdit')">
  41. <image src="../static/images/add.png"></image>
  42. <view>发布</view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. const app = getApp();
  48. const req = require("../../utils/request.js");
  49. import util from "../../utils/util.js";
  50. export default {
  51. components: {},
  52. props: {},
  53. data() {
  54. return {
  55. picUrlss:req.public.picUrls,
  56. pageList: [],
  57. isLoad: true,
  58. form: {
  59. page: 1,
  60. limit: 10
  61. },
  62. searchVal:'',
  63. total:0
  64. }
  65. },
  66. onLoad(options) {
  67. this.getPageList()
  68. },
  69. onShow() {
  70. },
  71. onReachBottom: function() {
  72. this.form.page++;
  73. this.getPageList(false);
  74. },
  75. methods: {
  76. jumpUrl(url){
  77. uni.navigateTo({
  78. url:url
  79. })
  80. },
  81. getPageList(isShow) {
  82. if (!this.isLoad) return false;
  83. this.isLoad = false;
  84. let form = this.form;
  85. if(this.searchVal){
  86. form.search = this.searchVal
  87. }else{
  88. form.search = ''
  89. }
  90. uni.showLoading();
  91. req.getRequest(
  92. '/api/match/page',
  93. form,
  94. res => {
  95. this.total = res.total
  96. res = res?res.list:[]
  97. this.isShow = true;
  98. if (res && res.length == 10) {
  99. this.isLoad = true;
  100. }
  101. if (this.form.page > 1) {
  102. res = this.pageList.concat(res);
  103. }
  104. this.pageList = res;
  105. uni.hideLoading();
  106. },
  107. isShow
  108. );
  109. },
  110. searchFn(){
  111. this.isLoad = true
  112. this.form.page=1
  113. this.getPageList()
  114. },
  115. formatTime(date){
  116. date = new Date(date.replace(/-/g, '/'))
  117. return util.formatTime(date).t3
  118. },
  119. },
  120. mounted() {
  121. },
  122. onPageScroll: function(e) {
  123. }
  124. }
  125. </script>
  126. <style>
  127. @import "./activityManage.css";
  128. </style>