nearby_team.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="dt-page" style="padding: 20upx;height: 100vh;">
  3. <view v-if="emptyType==0" class="item" v-for="(item,index) in dataList" :key="index" @tap="openMap(item)">
  4. <image :src="item.organizeicon" mode="aspectFit" ></image>
  5. <view class="center">
  6. <view class="title">{{item.organizename}}</view>
  7. <view class="bottom_text">当前群人数{{item.num}}员</view>
  8. </view>
  9. <view class="add" @tap.stop="join(item)" v-if="!item.isJoin">
  10. 加入此团
  11. </view>
  12. <view class="unadd" v-if="item.isJoin">
  13. 已加入
  14. </view>
  15. </view>
  16. <DtNoMore v-if="isNoMore" />
  17. <DtEmpty :type="emptyType" />
  18. </view>
  19. </template>
  20. <script>
  21. import DtEmpty from '../comps/dt_empty.vue'
  22. import DtNoMore from '../comps/dt_no_more.vue'
  23. export default {
  24. components: {
  25. DtEmpty,
  26. DtNoMore
  27. },
  28. data() {
  29. return {
  30. dataList:[],
  31. memberId:'',
  32. jumpType:null
  33. };
  34. },
  35. methods:{
  36. onLoadPage(options) {
  37. wx.hideShareMenu();
  38. this.memberId = this.$auth.getMemberId();
  39. this.jumpType = options.jumpType;
  40. this.requestData();
  41. },
  42. join(item){
  43. this.$dialog.confirm({
  44. content:"确认加入该团",
  45. success: res => {
  46. if (res.confirm) {
  47. this.replaceOranization(item)
  48. }
  49. }
  50. })
  51. },
  52. async replaceOranization(item){
  53. let resp = await this.$api.replaceOranization({
  54. _isShowLoading: true,
  55. memberId:this.memberId,
  56. deId:item.id,
  57. });
  58. if(resp){
  59. this.$dialog.success('加入成功')
  60. if (this.jumpType == 1) {
  61. let lastPage = this.$util.getPageCtx(1).$vm;
  62. lastPage.disabled = false;
  63. uni.navigateBack({ delta: 1 });
  64. }
  65. }
  66. },
  67. async requestData(param){
  68. let resp = await this.$api.getOrganizationList({
  69. _isShowLoading: true,
  70. _isPull: this.isPull,
  71. pageNo: this.pageIndex,
  72. pageSize: this.pageSize
  73. });
  74. let list = this.getDataList(resp)
  75. this.dataList = this.dataList.concat(list)
  76. },
  77. openMap(item){
  78. console.log(item)
  79. uni.navigateTo({
  80. url:"nearby_team_map?info="+encodeURIComponent(JSON.stringify(item))
  81. })
  82. }
  83. },
  84. onReachBottom() {
  85. this.onReachBottomPage()
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. .item{
  91. border-radius: 20upx;
  92. background-color: #fff;
  93. margin-bottom: 20upx;
  94. display: flex;
  95. align-items: center;
  96. image{
  97. width: 80upx;
  98. height: 80upx;
  99. margin: 20upx;
  100. border-radius: 50%;
  101. background-color: #F7F7F7;
  102. }
  103. .center{
  104. flex: 1;
  105. .title{
  106. font-size: 28upx;
  107. font-weight: bold;
  108. margin-bottom: 6upx;
  109. }
  110. .bottom_text{
  111. font-size: 24upx;
  112. color: #666666;
  113. }
  114. }
  115. .add{
  116. width: 146upx;
  117. height: 120upx;
  118. text-align: center;
  119. line-height: 120upx;
  120. font-size: 28upx;
  121. color: #fff;
  122. background-color: $dt-color-primary;
  123. border-top-right-radius: 10upx;
  124. border-bottom-right-radius: 10upx;
  125. }
  126. .unadd{
  127. width: 146upx;
  128. height: 120upx;
  129. text-align: center;
  130. line-height: 120upx;
  131. font-size: 28upx;
  132. color: #999;
  133. background-color: #dbdbdb;
  134. border-top-right-radius: 10upx;
  135. border-bottom-right-radius: 10upx;
  136. }
  137. }
  138. </style>