This commit is contained in:
2023-11-28 20:45:05 +08:00
parent a8ddb2ff68
commit 12c9920e1e
518 changed files with 2 additions and 87911 deletions

View File

@@ -1,191 +0,0 @@
<template>
<view class="bgColor">
<watermark></watermark>
<view class="QRcode-box">
<view style="width: 100%;" v-if="detail">
<uni-list :border="false">
<uni-list-chat :title="detail.group.name" :avatar-list="portraits" :note="'('+detail.user.length+'人)'" badge-positon="left"></uni-list-chat>
</uni-list>
</view>
<view class="QRcode-img">
<image :src="QRimg" mode="aspectFill" @click="resetQrCode"></image>
</view>
<view class="QRcode-tips">扫一扫上面的二维码图案加入群聊</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
QRimg:'',
detail:'',
portraits:[]
}
},
onLoad(e) {
this.resetQrCode(e.groupId)
this.getInfo(e.groupId)
},
computed:{
userInfo(){
return this.$store.state.userInfo
}
},
onShow(){},
methods: {
getInfo(e){//详情
this.$http.request({
url: '/group/getInfo/'+e,
success: (res) => {
if (res.data.code == 200) {
this.detail=res.data.data
var portraits=[]
for (var i = 0; i < this.detail.user.length; i++) {
portraits.push({
url:this.detail.user[i].portrait
})
}
this.portraits=portraits
}
}
});
},
resetQrCode(e){
this.$http.request({
url: '/group/getGroupQrCode/'+e,
success: (res) => {
if (res.data.code == 200) {
this.QRimg=res.data.data
}
}
});
}
},
onNavigationBarButtonTap(e) {
switch (e.index) {
case 0:
uni.showActionSheet({
// itemList: ['换个样式', '保存到手机', '扫描二维码', '重置二维码'],
itemList: ['保存到手机'],
success: (res)=> {
switch (res.tapIndex) {
case 0:
// #ifdef APP-PLUS
this.$fc.plusSaveBase64Img({base64:this.QRimg})
// #endif
// #ifdef H5
this.$fc.h5SaveBase64Img({base64:this.QRimg})
// #endif
break;
default:
break;
}
},
fail: (res)=> {
console.log(res.errMsg);
}
});
break;
default:
break;
}
}
}
</script>
<style scoped>
/* #ifdef APP-PLUS */
.bgColor{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #EDEDED;
overflow: auto;
}
/* #endif */
/* #ifdef H5 */
page{
background: #EDEDED;
}
/* #endif */
.QRcode-box{
width: 666rpx;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
padding: 32rpx;
background-color: #fff;
border-radius: 24rpx;
box-sizing: border-box;
display: flex;flex-direction: column;
align-items: center;
}
.QRcode-img{
width: 600rpx;
height: 600rpx;
}
.QRcode-img image{width: 100%;height: 100%;}
.QRcode-tips{
margin-top: 6rpx;
font-size: 26rpx;
color: #999;
}
.person-wx {
width: 100%;
margin-bottom: 24rpx;
}
.person-wx-user {
display: flex;
flex-direction: row;
align-items: center;
}
.person-wx-avatar {
width: 120rpx;
min-width: 120rpx;
height: 120rpx;
margin-right: 42rpx;
border-radius: 16rpx;
}
.person-wx-user-detail {
display: flex;
flex-direction: column;
justify-content: center;
width: 440rpx;
}
.person-wx-nikename {
font-size: 32rpx;
display: flex;flex-direction: row;align-items: center;
}
.person-wx-nikename .text{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 480rpx;
}
.person-wx-name {
color: #666;
font-size: 28rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-top: 12rpx;
}
.person-wx-nikename-icon.nan{
color: #007AFF;
}
.person-wx-nikename-icon.nv{
color: #FF5A5F;
}
.person-wx-nikename-icon{
margin-right: auto;
}
</style>

View File

@@ -1,431 +0,0 @@
<template>
<view class="bgColor" v-if="detail">
<watermark></watermark>
<view class="wxgroup-list">
<view class="wxgroup-list-item" v-for="(v, i) in detail.user" @click="gofriend(v)" :key="i">
<image class="wxgroup-list-img" :src="v.portrait" mode="aspectFill"></image>
<text class="wxgroup-list-text">{{ v.nickName }}</text>
</view>
<view class="wxgroup-list-item" @click="qunAdd">
<view class="wxgroup-list-icon"><view class="wxfont jia"></view></view>
</view>
<view class="wxgroup-list-item" @click="qunless">
<view class="wxgroup-list-icon"><view class="wxfont jian"></view></view>
</view>
</view>
<tool-list-wx :list="list3" @itemClick="itemClick3"></tool-list-wx>
<view class="wxgroupInfo">
<view class="xw-tool-list">
<view class="xw-tool-list-content">
<view class="xw-tool-item">
<text class="xw-tool-text">消息免打扰</text>
<switch color="#05C160" :checked="Baneddisturb" @change="switchChange($event, 'xxmdr')" style="transform:scale(0.75);" />
</view>
</view>
<view class="xw-tool-list-content">
<view class="xw-tool-item">
<text class="xw-tool-text">置顶聊天</text>
<switch color="#05C160" :checked="Banedtop" @change="switchChange($event, 'zdlt')" style="transform:scale(0.75);" />
</view>
</view>
<view class="xw-tool-list-content">
<view class="xw-tool-item">
<text class="xw-tool-text">保存到通讯录</text>
<switch color="#05C160" :checked="BanedkeepGroup" @change="switchChange($event, 'bcdtxl')" style="transform:scale(0.75);" />
</view>
</view>
</view>
<view class="xw-tool-list">
<view class="xw-tool-list-content" v-if="detail.master == 'Y'" @click="jiesan">
<view class="xw-tool-btn-item"><view class="xw-tool-btn-text" style="color: #FF5A5F;">解散该群</view></view>
</view>
<view class="xw-tool-list-content" @click="qingchu">
<view class="xw-tool-btn-item"><view class="xw-tool-btn-text" style="color: #FF5A5F;">清空群消息</view></view>
</view>
<view class="xw-tool-list-content" @click="quitqun">
<view class="xw-tool-btn-item"><view class="xw-tool-btn-text" style="color: #FF5A5F;">删除并退出</view></view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
detail: {
set: {
top: 'N',
keepGroup: 'N',
disturb: 'N'
},
group: {
notice: ''
},
user: []
}
};
},
computed: {
list3() {
return [
{
title: '群聊名称',
path: '#'
},
{
title: '群二维码',
path: '#',
else: [
{
type: 'img',
content: '../../static/wx/t05.png'
}
]
},
{
title: '群公告',
path: '#',
else: [
{
type: 'text',
content: this.detail.group.notice ? this.detail.group.notice : ''
}
]
}
];
},
Banedtop() {
return this.detail.set.top == 'Y' ? true : false;
},
BanedkeepGroup() {
return this.detail.set.keepGroup == 'Y' ? true : false;
},
Baneddisturb() {
return this.detail.set.disturb == 'Y' ? true : false;
}
},
onLoad(e) {
this.param = e.param;
},
onShow() {
this.getInfo(this.param);
},
methods: {
qunAdd() {
uni.navigateTo({
url: '../../wx/groupInfo/qunAdd?groupId=' + this.detail.group.groupId
});
},
qunless() {
uni.navigateTo({
url: '../../wx/groupInfo/qunless?groupId=' + this.detail.group.groupId
});
},
jiesan() {
// 解散群聊
uni.showModal({
title: '提示',
content: '确认解散群聊吗?',
success: res => {
if (res.confirm) {
this.$http.request({
url: '/group/removeGroup/' + this.detail.group.groupId,
success: res => {
if (res.data.code == 200) {
delete this.$store.state.chatlist[this.detail.group.groupId]
this.$store.dispatch('updateChatListInfoById',{
userId: this.detail.group.groupId,
data: {}
});
this.$store.dispatch('updateChatById', {
userId: this.detail.group.groupId,
data: []
});
uni.navigateBack({
delta:2
}).then(()=>{
uni.showToast({
title:'解散成功',
icon:'none'
})
})
}
}
});
}
}
});
},
quitqun() {
uni.showModal({
title: '提示',
content: '确认退出群聊吗?',
success: res => {
if (res.confirm) {
this.$http.request({
url: '/group/logoutGroup/' + this.detail.group.groupId,
success: res => {
if (res.data.code == 200) {
delete this.$store.state.chatlist[this.detail.group.groupId]
this.$store.dispatch('updateChatListInfoById',{
userId: this.detail.group.groupId,
data: {}
});
this.$store.dispatch('updateChatById', {
userId: this.detail.group.groupId,
data: []
});
uni.navigateBack({
delta:2
}).then(()=>{
uni.showToast({
title:'退出成功',
icon:'none'
})
})
}
}
});
}
}
});
},
qingchu() {
uni.showModal({
title: '提示',
content: '确认清除群聊消息吗?',
success: res => {
if (res.confirm) {
delete this.$store.state.chatlist[this.detail.group.groupId]
this.$store.dispatch('updateChatListInfoById',{
userId: this.detail.group.groupId,
data: {}
});
this.$store.dispatch('updateChatById', {
userId: this.detail.group.groupId,
data: []
});
uni.navigateBack({
delta:2
}).then(()=>{
uni.showToast({
title:'清除成功',
icon:'none'
})
})
}
}
});
},
gofriend(e) {
uni.navigateTo({
url: '../../wx/personInfo/detail?param=' + e.userId+'&source=7'
});
},
switchChange(e, type) {
var yn = e.detail.value ? 'Y' : 'N';
var url, formData, ynText;
switch (type) {
case 'xxmdr':
url = '/group/editDisturb';
formData = {
groupId: this.param,
disturb: yn
};
ynText = e.detail.value ? '已静默消息' : '已取消静默消息';
var data=JSON.parse(JSON.stringify(this.$store.state.chatlist[this.detail.group.groupId]))
var ynx = data.disturb=='N' ? 'Y' : 'N';
data.disturb=ynx
this.$store.dispatch('updateChatListInfoById', {
userId: this.detail.group.groupId,
data: data
})
this.$store.dispatch('getChatList')
break;
case 'zdlt':
url = '/group/editTop';
formData = {
groupId: this.param, //群组id
top: yn
};
ynText = e.detail.value ? '已置顶' : '已取消置顶';
var data=JSON.parse(JSON.stringify(this.$store.state.chatlist[this.detail.group.groupId]))
var ynx = data.top=='N' ? 'Y' : 'N';
data.top=ynx
this.$store.dispatch('updateChatListInfoById', {
userId: this.detail.group.groupId,
data: data
})
this.$store.dispatch('getChatList')
break;
case 'bcdtxl':
url = '/group/editKeepGroup';
formData = {
groupId: this.param, //群组id
keepGroup: yn
};
ynText = e.detail.value ? '已保存' : '已移除';
break;
default:
break;
}
this.$http.request({
url: url,
method: 'POST',
data: JSON.stringify(formData),
success: res => {
if (res.data.code == 200) {
uni.showToast({
title: ynText,
icon: 'none'
});
}
}
});
},
itemClick3(e, i) {
switch (i) {
case 0:
uni.navigateTo({
url: 'editGroupName?groupId=' + this.detail.group.groupId + '&name=' + this.detail.group.name
});
break;
case 1:
uni.navigateTo({
url: 'QRcode?groupId=' + this.detail.group.groupId
});
break;
case 2:
uni.navigateTo({
url: 'editGroupNotice?groupId=' + this.detail.group.groupId + '&notice=' + this.detail.group.notice
});
break;
default:
break;
}
},
getInfo(e) {
//详情
this.$http.request({
url: '/group/getInfo/' + e,
success: res => {
if (res.data.code == 200) {
this.detail = res.data.data;
uni.setNavigationBarTitle({
title: '聊天信息(' + this.detail.user.length + ')'
});
}
}
});
}
}
};
</script>
<style scoped>
/* #ifdef APP-PLUS */
.bgColor {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #ededed;
overflow: auto;
}
/* #endif */
/* #ifdef H5 */
page {
background: #ededed;
}
/* #endif */
.xw-tool-list {
display: flex;
flex-direction: column;
background-color: #ffffff;
margin-bottom: 18rpx;
}
.xw-tool-item {
display: flex;
flex-direction: row;
align-items: center;
padding: 26rpx 24rpx;
border-bottom: 1px #eee solid;
}
.xw-tool-list-content:nth-last-child(1) .xw-tool-item {
border: none;
}
.xw-tool-text {
margin-right: auto;
}
.xw-tool-btn-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding: 34rpx 44rpx;
border-bottom: 1px #eee solid;
font-weight: bold;
color: #5f698c;
}
.wxgroup-list {
background-color: #fff;
padding: 24rpx;
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-bottom: 24rpx;
}
.wxgroup-list-item {
width: 20%;
overflow: hidden;
box-sizing: border-box;
margin-top: 12rpx;
margin-bottom: 12rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.wxgroup-list-icon .wxfont {
color: #999;
font-size: 46rpx;
}
.wxgroup-list-img {
width: 105rpx;
height: 105rpx;
border-radius: 12rpx;
}
.wxgroup-list-icon {
display: flex;
flex-direction: column;
width: 105rpx;
height: 105rpx;
border-radius: 12rpx;
align-items: center;
justify-content: center;
border: 1px #ddd dashed;
}
.wxgroup-list-text {
text-align: center;
width: 105rpx;
font-size: 24rpx;
color: #999;
margin-top: 12rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.xw-tool-else .text {
color: #666;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 520rpx;
}
</style>

View File

@@ -1,114 +0,0 @@
<template>
<view>
<watermark></watermark>
<form @submit="subform" class="remarkForm">
<view class="remarkForm-item">
<view class="remarkForm-label">群名</view>
<input class="remarkForm-input" placeholder="修改群名" type="text" v-model="form.name" />
</view>
</form>
</view>
</template>
<script>
export default {
data() {
return {
form:{
groupId: "",
name: ""
}
};
},
onLoad(e) {
this.form.groupId=e.groupId
this.form.name=e.name
},
methods: {
subform(e) {
var rules = {
name: {
rules: [{
checkType: "required",
errorMsg: "请填写内容"
}]
}
};
var formData = JSON.parse(JSON.stringify(this.form));
var checkRes = this.$zmmFormCheck.check(formData, rules);
if (checkRes) {
this.$http.request({
url: '/group/editGroupName',
method: 'POST',
data:JSON.stringify(formData),
success: (res) => {
if (res.data.code == 200) {
var data=JSON.parse(JSON.stringify(this.$store.state.chatlist[this.form.groupId]))
var ChatData=JSON.parse(JSON.stringify(this.$store.state.chatDatalist[this.form.groupId]))
ChatData.groupInfo.nickName=this.form.name
this.$store.dispatch('updateChatObjById', {
userId: this.form.groupId,
data: ChatData
})
data.nickName=this.form.name
this.$store.dispatch('updateChatListInfoById', {
userId: this.form.groupId,
data: data
})
this.$store.dispatch('getChatList')
uni.navigateBack({
delta:1
}).then(()=>{
uni.showToast({
title:'修改成功',
icon:'success'
})
})
}
}
});
} else {
uni.showToast({
title: this.$zmmFormCheck.error,
icon: "none",
position: 'bottom'
});
}
}
},
onNavigationBarButtonTap(e) {
switch (e.index) {
case 0:
this.subform()
break;
default:
break;
}
},
};
</script>
<style scoped lang="scss">
.remarkForm{
padding:24rpx 44rpx;
display: flex;flex-direction: column;
}
.remarkForm-item{
display: flex;flex-direction: column;
margin-bottom: 24rpx;
}
.remarkForm-textarea{
width: 100%;
line-height: 48rpx;
min-height: 240rpx;
}
.remarkForm-label{font-size: 26rpx;color: #5C5C5C;margin-bottom: 15rpx;}
.remarkForm-input{
border-radius: 12rpx;
background-color: #F7F7F7;
height: 110rpx;
line-height: 110rpx;
padding:0 34rpx;
}
</style>

View File

@@ -1,100 +0,0 @@
<template>
<view>
<watermark></watermark>
<form @submit="subform" class="remarkForm">
<view class="remarkForm-item">
<view class="remarkForm-label">群公告</view>
<input class="remarkForm-input" placeholder="修改群公告" type="text" v-model="form.notice" />
</view>
</form>
</view>
</template>
<script>
export default {
data() {
return {
form:{
groupId:'',
notice:''
}
};
},
onLoad(e) {
this.form.groupId=e.groupId
this.form.notice=e.notice
},
methods: {
subform(e) {
var rules = {
notice: {
rules: [{
checkType: "required",
errorMsg: "请填写内容"
}]
}
};
var formData = JSON.parse(JSON.stringify(this.form));
var checkRes = this.$zmmFormCheck.check(formData, rules);
if (checkRes) {
this.$http.request({
url: '/group/editGroupNotice',
method: 'POST',
data:JSON.stringify(formData),
success: (res) => {
if (res.data.code == 200) {
uni.navigateBack({
delta:1
}).then(()=>{
uni.showToast({
title:'修改成功',
icon:'success'
})
})
}
}
});
} else {
uni.showToast({
title: this.$zmmFormCheck.error,
icon: "none",
position: 'bottom'
});
}
}
},
onNavigationBarButtonTap(e) {
switch (e.index) {
case 0:
this.subform()
break;
default:
break;
}
},
};
</script>
<style scoped lang="scss">
.remarkForm{
padding:24rpx 44rpx;
display: flex;flex-direction: column;
}
.remarkForm-item{
display: flex;flex-direction: column;
margin-bottom: 24rpx;
}
.remarkForm-textarea{
width: 100%;
line-height: 48rpx;
min-height: 240rpx;
}
.remarkForm-label{font-size: 26rpx;color: #5C5C5C;margin-bottom: 15rpx;}
.remarkForm-input{
border-radius: 12rpx;
background-color: #F7F7F7;
height: 110rpx;
line-height: 110rpx;
padding:0 34rpx;
}
</style>

View File

@@ -1,93 +0,0 @@
<template>
<view class="bgColor">
<watermark></watermark>
<view class="wxgrouplist">
<view class="wxgrouplist-item" v-for="(v,i) in list" :key="i" @click="goGroup(v)">
<view class="wxgrouplist-imgs">
<image v-for="(item,index) in v.portrait" :src="item" mode="aspectFill"></image>
</view>
<view class="wxgrouplist-title">{{v.name}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list:[]
};
},
computed: {},
onLoad(e) {},
onShow() {
this.getlist();
},
methods: {
goGroup(e){
uni.navigateTo({
url:'../chatWindow/index?userId='+e.groupId+'&windowType=GROUP'
})
},
getlist(e) {
this.$http.request({
url: '/group/groupList',
success: res => {
if (res.data.code == 200) {
this.list = res.data.data;
}
}
});
}
}
};
</script>
<style scoped>
/* #ifdef APP-PLUS */
.bgColor {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #ededed;
overflow: auto;
}
/* #endif */
/* #ifdef H5 */
page {
background: #ededed;
}
/* #endif */
.wxgrouplist{
display: flex;flex-direction: column;
}
.wxgrouplist-item{
padding:0 28rpx;
background-color: #fff;
display: flex;flex-direction: row;align-items: center;
}
.wxgrouplist-imgs{
width: 80rpx;
height: 80rpx;
border-radius: 12rpx;
overflow: hidden;
display: flex;flex-direction: row;flex-wrap: wrap;
background-color: #DEDEDE;
}
.wxgrouplist-imgs image{
margin: 2rpx;
width: 36rpx;
height: 36rpx;
}
.wxgrouplist-title{
flex: 1;
border-bottom: 1px #F4F4F4 solid;
font-size: 32rpx;
color: #333;
line-height: 105rpx;
margin-left: 38rpx;
}
</style>

View File

@@ -1,213 +0,0 @@
<template>
<view class="wx-createGroup" :style="'height: calc(100vh - ' + windowTop + 'px)'">
<watermark></watermark>
<view class="wx-createGroup-check"><uni-indexed-list-wx showSelect :showAdd="false" :options="list" @click="bindClick"></uni-indexed-list-wx></view>
<view class="wx-createGroup-foot">
<view class="wx-btn wx-btn-info" @click="createGroup">
完成
<text v-if="select.length > 0">({{ select.length }})</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
detail: {
user: []
},
list: [],
select: [],
windowTop: 0,
groupId: ''
};
},
onLoad(e) {
this.groupId = e.groupId;
},
mounted() {
this.getflist();
uni.getSystemInfo({
success: res => {
this.windowTop = res.windowTop;
}
});
},
methods: {
createGroup() {
if(this.select.length<=0){
uni.showToast({
title:'未选择',
icon:'none'
})
return
}
var ids = [];
for (var i = 0; i < this.select.length; i++) {
if(this.select[i].data.addtype=='N'){
ids.push(this.select[i].data.userId);
}
}
var formData = {
groupId: this.groupId,
list: ids
};
this.$http.request({
url: '/group/invitationGroup',
method: 'POST',
data: JSON.stringify(formData),
success: res => {
if (res.data.code == 200) {
uni.navigateBack({
delta: 1
}).then(res=>{
uni.showToast({
title:'已邀请',
icon:'none'
})
});
}
}
});
},
bindClick(e) {
this.select = e.select;
},
getflist() {
this.$http.request({
url: '/group/getInfo/' + this.groupId,
success: res => {
if (res.data.code == 200) {
this.detail = res.data.data;
this.$http.request({
url: '/friend/friendList',
method: 'POST',
data:JSON.stringify({}),
success: res => {
if (res.data.code == 200) {
var data = res.data.data;
var list = [];
for (var i = 0; i < data.length; i++) {
var item = data[i];
if (item.userType == 'normal') {
list.push({
name: item.nickName,
avatar: item.portrait,
userId: item.userId,
chatNo: item.chatNo
});
}
}
var newlist=[]
var data1=leesData(this.detail.user, list,'userId')
var data2=leesDataRE(this.detail.user, list,'userId')
for (var i = 0; i < data1.length; i++) {
var item=data1[i]
newlist.push({
name: item.name,
avatar: item.avatar,
userId: item.userId,
chatNo: item.chatNo,
addtype:'N',
checked: false
})
}
for (var i = 0; i < data2.length; i++) {
var item=data2[i]
newlist.push({
name: item.name,
avatar: item.avatar,
userId: item.userId,
chatNo: item.chatNo,
addtype:'Y',
checked: true
})
}
this.list = this.$fc.sortList({ list: newlist, key: 'name' });
function leesData(arr1,arr2,key){//去掉相同的属性
var result = [];
for (var i = 0; i < arr2.length; i++) {
var obj = arr2[i];
var num = obj[key];
var flag = false;
for (var j = 0; j < arr1.length; j++) {
var aj = arr1[j];
var n = aj[key];
if (n == num) {
flag = true;
break;
}
}
if (!flag) {
result.push(obj);
}
}
return result
}
function leesDataRE(arr1,arr2,key){//保留相同的属性
var result = [];
for (var i = 0; i < arr2.length; i++) {
var obj = arr2[i];
var num = obj[key];
var flag = false;
for (var j = 0; j < arr1.length; j++) {
var aj = arr1[j];
var n = aj[key];
if (n == num) {
flag = true;
break;
}
}
if (flag) {
result.push(obj);
}
}
return result
}
}
}
});
}
}
});
}
}
};
</script>
<style scoped>
.wx-createGroup {
display: flex;
flex-direction: column;
}
.wx-createGroup-check {
height: 90%;
position: relative;
}
.wx-createGroup-foot {
box-sizing: border-box;
height: 10%;
display: flex;
flex-direction: row;
justify-content: flex-end;
background-color: #eee;
padding: 24rpx;
}
.wx-btn {
min-width: 200rpx;
height: 75rpx;
line-height: 75rpx;
text-align: center;
border-radius: 12rpx;
background-color: #007aff;
color: #fff;
font-size: 32rpx;
}
.wx-btn-info {
background-color: #05c160;
}
</style>

View File

@@ -1,143 +0,0 @@
<template>
<view class="wx-createGroup" :style="'height: calc(100vh - ' + windowTop + 'px)'">
<watermark></watermark>
<view class="wx-createGroup-check"><uni-indexed-list-wx showSelect :showAdd="false" :options="list" @click="bindClick"></uni-indexed-list-wx></view>
<view class="wx-createGroup-foot">
<view class="wx-btn wx-btn-error" @click="createGroup">
删除
<text v-if="select.length > 0">({{ select.length }})</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
detail: {
user: []
},
list: [],
select: [],
windowTop: 0,
groupId: ''
};
},
onLoad(e) {
this.groupId = e.groupId;
},
mounted() {
this.getflist();
uni.getSystemInfo({
success: res => {
this.windowTop = res.windowTop;
}
});
},
computed:{
userInfo(){
return this.$store.state.userInfo
}
},
methods: {
createGroup() {
if(this.select.length<=0){
uni.showToast({
title:'未选择',
icon:'none'
})
return
}
var ids = [];
for (var i = 0; i < this.select.length; i++) {
ids.push(this.select[i].data.userId);
}
var formData = {
groupId: this.groupId,
list: ids
};
this.$http.request({
url: '/group/kickedGroup',
method: 'POST',
data: JSON.stringify(formData),
success: res => {
if (res.data.code == 200) {
uni.navigateBack({
delta: 1
}).then(res=>{
uni.showToast({
title:'已删除',
icon:'none'
})
});
}
}
});
},
bindClick(e) {
this.select = e.select;
},
getflist() {
this.$http.request({
url: '/group/getInfo/' + this.groupId,
success: res => {
if (res.data.code == 200) {
this.detail = res.data.data;
var data = this.detail.user;
var list = [];
for (var i = 0; i < data.length; i++) {
var item = data[i];
if (item.userId !== this.userInfo.userId) {
list.push({
name: item.nickName,
avatar: item.portrait,
userId: item.userId
});
}
}
this.list = this.$fc.sortList({ list: list, key: 'name' });
}
}
});
}
}
};
</script>
<style scoped>
.wx-createGroup {
display: flex;
flex-direction: column;
}
.wx-createGroup-check {
height: 90%;
position: relative;
}
.wx-createGroup-foot {
box-sizing: border-box;
height: 10%;
display: flex;
flex-direction: row;
justify-content: flex-end;
background-color: #eee;
padding: 24rpx;
}
.wx-btn {
min-width: 200rpx;
height: 75rpx;
line-height: 75rpx;
text-align: center;
border-radius: 12rpx;
background-color: #007aff;
color: #fff;
font-size: 32rpx;
}
.wx-btn-info {
background-color: #05c160;
}
.wx-btn-error{
background-color: #FF5A5F;
}
</style>

View File

@@ -1,117 +0,0 @@
<template>
<view class="bgColor" v-if="detail">
<watermark></watermark>
<view class="wxscanCodeDetail">
<view class="wxscanCodeDetail-imgs">
<image v-for="(item,index) in detail.portrait" :src="item" mode="aspectFill"></image>
</view>
<view class="wxscanCodeDetail-title">{{detail.name}}({{detail.count}})</view>
<view class="wx-btn wx-btn-info" @click="ingroup">加入群聊</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
detail:''
};
},
computed: {},
onLoad(e) {
this.param = e.param;
},
onShow() {
this.getInfo(this.param);
},
methods: {
ingroup(){
var data=this.param.split(':')
var type=data[0]
var value=data[1]
this.$http.request({
url: '/group/joinGroup/' + value,
success: res => {
if (res.data.code == 200) {
uni.navigateBack({
delta:1
})
}
}
});
},
getInfo(e) {
//详情
this.$http.request({
url: '/group/scanCode/' + e,
success: res => {
if (res.data.code == 200) {
this.detail = res.data.data;
}
}
});
}
}
};
</script>
<style scoped>
/* #ifdef APP-PLUS */
.bgColor {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #ededed;
overflow: auto;
}
/* #endif */
/* #ifdef H5 */
page {
background: #ededed;
}
/* #endif */
.wx-btn {
min-width: 200rpx;
height: 75rpx;
line-height: 75rpx;
text-align: center;
border-radius: 12rpx;
background-color: #007aff;
color: #fff;
font-size: 32rpx;
}
.wx-btn-info {
background-color: #05c160;
}
.wxscanCodeDetail{
height: 100vh;
display: flex;flex-direction: column;
background-color: #fff;
align-items: center;
}
.wxscanCodeDetail-imgs{
width: 120rpx;
height: 120rpx;
border-radius: 12rpx;
overflow: hidden;
display: flex;flex-direction: row;flex-wrap: wrap;
background-color: #DEDEDE;
margin-top: 8.5vh;
}
.wxscanCodeDetail-imgs image{
margin: 2rpx;
width: 56rpx;
height: 56rpx;
}
.wxscanCodeDetail-title{
word-break: break-all;
font-size: 40rpx;
color: #333;
margin-top: 4vh;
margin-bottom: 50vh;
}
</style>