index.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view>
  3. <view class="tab ddflex">
  4. <view :class="'li ' + (type == 1 ? 'active' : '')" @click="swiType(1)">我加入的</view>
  5. <view :class="'li ' + (type == 2 ? 'active' : '')" @click="swiType(2)">我创建的</view>
  6. </view>
  7. <view class="placeholder-view"></view>
  8. <view class="list" v-if="pageList.length>0">
  9. <view class="li ddflex" v-for="(item,index) in pageList" :key="index" @click="jumpUrl(item)">
  10. <image :src="item.url?item.url:picUrlss+'office_images/team_default.png'" mode="aspectFill" class="team-img"></image>
  11. <view class="fflex">
  12. <view class="team-tit tover">{{item.title}}</view>
  13. <view class="team-sta">日新贴{{item.dayMomentsNum}}</view>
  14. </view>
  15. <view class="join-btn" v-if="type == 1">去看看</view>
  16. <block v-else>
  17. <view class="join-btn" v-if="item.auditStatus == 1">去看看</view>
  18. <view :class="'sta'+(item.auditStatus == 2 ? ' fail':'')" v-else>{{item.auditStatus == 0 ? '审核中' : '审核失败'}}</view>
  19. </block>
  20. </view>
  21. </view>
  22. <view class="nodata" v-else>
  23. <image :src="picUrlss + 'empty_dd.png'"></image>
  24. <text>暂无团队</text>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. const app = getApp();
  30. const api = require('../../utils/api.js');
  31. const req = require('../../utils/request.js');
  32. export default {
  33. data() {
  34. return {
  35. picUrlss: req.public.picUrls,
  36. type: 1,//团队类型 1、我加入的 2、我创建的
  37. form: {
  38. page: 1,
  39. limit: 12
  40. },
  41. isLoad: true,
  42. pageList: []
  43. };
  44. },
  45. onLoad() {
  46. this.getPageList();
  47. },
  48. methods: {
  49. swiType(type){
  50. if(this.type == type) return false;
  51. this.type = type;
  52. this.form.page = 1;
  53. this.isLoad = true;
  54. this.getPageList();
  55. },
  56. getPageList(){
  57. if (!this.isLoad) return false;
  58. this.isLoad = false;
  59. let form = this.form;
  60. form.teamType = this.type;
  61. req.getRequest(api.user_team_list,form,data=>{
  62. if (data.list && data.list.length >= 10) this.isLoad = true;
  63. if (this.form.page > 1) data.list = this.pageList.concat(data.list);
  64. this.pageList = data.list;
  65. })
  66. },
  67. jumpUrl(item){
  68. if(item.auditStatus != 1 && item.auditStatus != 2) return req.msg('团队正在审核中');
  69. if(item.auditStatus == 1){//审核 0待审核 1通过 2未通过
  70. uni.navigateTo({
  71. url: '/office/team/index?id=' + item.id
  72. })
  73. }else{
  74. uni.navigateTo({
  75. url: '/office/createTeam/index?id=' + item.id
  76. })
  77. }
  78. }
  79. }
  80. };
  81. </script>
  82. <style>
  83. @import './index.css';
  84. </style>