| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template>
- <view class="dt-page" style="padding: 20upx;height: 100vh;">
- <view v-if="emptyType==0" class="item" v-for="(item,index) in dataList" :key="index" @tap="openMap(item)">
- <image :src="item.organizeicon" mode="aspectFit" ></image>
- <view class="center">
- <view class="title">{{item.organizename}}</view>
- <view class="bottom_text">当前群人数{{item.num}}员</view>
- </view>
- <view class="add" @tap.stop="join(item)" v-if="!item.isJoin">
- 加入此团
- </view>
- <view class="unadd" v-if="item.isJoin">
- 已加入
- </view>
- </view>
- <DtNoMore v-if="isNoMore" />
- <DtEmpty :type="emptyType" />
- </view>
- </template>
- <script>
- import DtEmpty from '../comps/dt_empty.vue'
- import DtNoMore from '../comps/dt_no_more.vue'
- export default {
- components: {
- DtEmpty,
- DtNoMore
- },
- data() {
- return {
- dataList:[],
- memberId:'',
- jumpType:null
- };
- },
- methods:{
-
- onLoadPage(options) {
- wx.hideShareMenu();
- this.memberId = this.$auth.getMemberId();
- this.jumpType = options.jumpType;
- this.requestData();
- },
- join(item){
- this.$dialog.confirm({
- content:"确认加入该团",
- success: res => {
- if (res.confirm) {
- this.replaceOranization(item)
- }
- }
- })
- },
- async replaceOranization(item){
- let resp = await this.$api.replaceOranization({
- _isShowLoading: true,
- memberId:this.memberId,
- deId:item.id,
- });
- if(resp){
- this.$dialog.success('加入成功')
- if (this.jumpType == 1) {
- let lastPage = this.$util.getPageCtx(1).$vm;
- lastPage.disabled = false;
- uni.navigateBack({ delta: 1 });
- }
- }
- },
- async requestData(param){
- let resp = await this.$api.getOrganizationList({
- _isShowLoading: true,
- _isPull: this.isPull,
- pageNo: this.pageIndex,
- pageSize: this.pageSize
- });
- let list = this.getDataList(resp)
- this.dataList = this.dataList.concat(list)
- },
- openMap(item){
- console.log(item)
- uni.navigateTo({
- url:"nearby_team_map?info="+encodeURIComponent(JSON.stringify(item))
- })
- }
- },
- onReachBottom() {
- this.onReachBottomPage()
- }
- }
- </script>
- <style lang="scss">
- .item{
- border-radius: 20upx;
- background-color: #fff;
- margin-bottom: 20upx;
- display: flex;
- align-items: center;
- image{
- width: 80upx;
- height: 80upx;
- margin: 20upx;
- border-radius: 50%;
- background-color: #F7F7F7;
- }
- .center{
- flex: 1;
- .title{
- font-size: 28upx;
- font-weight: bold;
- margin-bottom: 6upx;
- }
- .bottom_text{
- font-size: 24upx;
- color: #666666;
- }
- }
- .add{
- width: 146upx;
- height: 120upx;
- text-align: center;
- line-height: 120upx;
- font-size: 28upx;
- color: #fff;
- background-color: $dt-color-primary;
- border-top-right-radius: 10upx;
- border-bottom-right-radius: 10upx;
- }
- .unadd{
- width: 146upx;
- height: 120upx;
- text-align: center;
- line-height: 120upx;
- font-size: 28upx;
- color: #999;
- background-color: #dbdbdb;
- border-top-right-radius: 10upx;
- border-bottom-right-radius: 10upx;
- }
- }
- </style>
|