同步数据
This commit is contained in:
@@ -1,24 +1,16 @@
|
||||
<template>
|
||||
<view class="apply" v-if="loaded">
|
||||
<u-avatar :src="group.cover || require('@/static/user/cover.png')" size="128" shape="square" />
|
||||
<view class="name">
|
||||
{{ group.name }}
|
||||
</view>
|
||||
|
||||
<u-button class="apply-btn" v-if="group.can_join" @click="applyGroup" text="申请加群" :disabled="disabled"
|
||||
color="#34CE98" />
|
||||
<view class="name"> {{ group.name }} </view>
|
||||
<u-button class="apply-btn" v-if="group.can_join" @click="modalShow = true" text="申请加群" :disabled="disabled" color="#34CE98" />
|
||||
<view class="" v-else>
|
||||
<view class="" v-if="group.is_full">群已满员</view>
|
||||
<view class="" v-if="group.deny_apply">禁止申请</view>
|
||||
<u-button class="apply-btn2" v-if="group.state === 'accepted'" color="#34CE98" text="进入群聊"
|
||||
@click="toGroupChat" />
|
||||
<u-button class="apply-btn2" v-if="group.state === 'accepted'" color="#34CE98" text="进入群聊" @click="toGroupChat" />
|
||||
</view>
|
||||
|
||||
<u-modal negativeTop="300" :show="modalShow" title="申请原因" showCancelButton @cancel="onHideModal"
|
||||
@confirm="onJoinGroup">
|
||||
<view class="slot-content">
|
||||
<u--input placeholder="申请原因" border="surround" focus v-model="message" />
|
||||
</view>
|
||||
<u-modal negativeTop="300" :show="modalShow" title="申请原因" showCancelButton @cancel="onHideModal" @confirm="onJoinGroup">
|
||||
<view class="slot-content"> <u--input placeholder="申请原因" border="surround" focus v-model="message" /> </view>
|
||||
</u-modal>
|
||||
</view>
|
||||
</template>
|
||||
@@ -45,6 +37,7 @@
|
||||
this.targetId = e.targetId
|
||||
// this.targetId = "TG2"
|
||||
joinGroupPre(this.targetId).then(res => {
|
||||
console.log(res, 'res.返回群的基本信息')
|
||||
this.group = res
|
||||
this.loaded = true
|
||||
}).catch(err => {
|
||||
@@ -62,9 +55,6 @@
|
||||
url: '/pages/im/group/chat?targetId=' + this.targetId
|
||||
})
|
||||
},
|
||||
applyGroup() {
|
||||
this.modalShow = true
|
||||
},
|
||||
onHideModal() {
|
||||
this.message = ''
|
||||
this.modalShow = false
|
||||
@@ -75,8 +65,8 @@
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '申请成功',
|
||||
duration:2000,
|
||||
mast:true
|
||||
duration: 2000,
|
||||
mast: true
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$Router.back()
|
||||
@@ -118,7 +108,8 @@
|
||||
width: 80%;
|
||||
font-size: $title-size;
|
||||
}
|
||||
.apply-btn2{
|
||||
|
||||
.apply-btn2 {
|
||||
padding: 0 100rpx;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user