123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <template>
- <view class="page">
- <view class="bcenter">
- <view class="avator" v-for="(item, index) in list" :key="index" @click="actMenu(item.userID)">
- <image :src="item.avator" mode="aspectFill" />
- <text>{{item.nick}}</text>
- <image v-if="is_del" class="delit" src="../../static/icon/del_mem.png">
- </image>
- </view>
- <view class="avator" @click="addMember">
- <image src="../../static/icon/icon_add.png" mode="widthFix" />
- <text></text>
- </view>
- <!-- <view class="avator" @click="delMember">
- <image src="../../static/icon/icon_del.png" mode="widthFix" />
- <text></text>
- </view> -->
- </view>
- <ToastW3 ref="ToastW3"></ToastW3>
- <DialogBox ref="DialogBox"></DialogBox>
- </view>
- </template>
- <script>
- export default {
- components: {},
- data() {
- return {
- page: 1,
- list: [],
- num_total: 0,
- groupId: '',
- hasMore: true,
- name: '',
- is_del: false,
- isManage: 0,
- }
- },
- onLoad(parms) {
- let self = this;
- this.groupId = parms.groupId || "1"
- },
- onShow() {
- this.loadData();
- },
- methods: {
- delMember() {
- if (this.is_del) {
- this.is_del = false;
- } else {
- this.is_del = true;
- }
- },
- addMember() {
- uni.navigateTo({
- url: '/pages/chat/addMem?groupId=' + this.groupId
- })
- },
- loadData() {
- // this.groupID = 1;
- this.page = 1;
- this.hasMore = true;
- // let res = await this.TIM.getGroupMemberList(id, this.page)
- // this.list = res.data.memberList;
- let that = this;
- // var offset = (this.page - 1) * 20;
- uni.request({
- url: this.$apiHost2 + '/Chat/groupMembers', //仅为示例,并非真实接口地址。
- data: {
- uuid: getApp().globalData.uuid,
- groupId: this.groupId,
- getall: 1
- },
- header: {
- 'content-type': 'application/json' //自定义请求头信息
- },
- success: (res) => {
- console.log("----", res.data);
- if (res.data.list == undefined || res.data.list == null) {
- res.data.list = []
- }
- this.isManage = res.data.isManage;
- if (that.page > 1) {
- that.list = that.list.concat(res.data.list)
- } else {
- that.list = res.data.list;
- }
- that.num_total = res.data.total;
- }
- });
- },
- actMenu(uid) {
- let that = this;
- uni.showActionSheet({
- title: '',
- itemList: ['禁言', '移除'],
- success: function(res) {
- if (res.tapIndex == 0) {
- that.actMem('lock', uid);
- } else {
- that.actMem('del', uid);
- }
- },
- fail: function(res) {
- console.log(res.errMsg);
- }
- });
- },
- actMem(act, uid) {
- let tips = '确定禁言吗?';
- if (act == 'del') {
- tips = '您确认删除吗?';
- }
- let that = this;
- this.$refs['DialogBox'].confirm({
- title: '提示',
- content: tips,
- DialogType: 'inquiry',
- btn1: '否',
- btn2: '是',
- animation: 0
- }).then((res) => {
- uni.showLoading({})
- uni.request({
- url: that.$apiHost2 + '/Chat/groupActMem', //仅为示例,并非真实接口地址。
- data: {
- uuid: getApp().globalData.uuid,
- groupId: that.groupId,
- userId: uid,
- act: act
- },
- header: {
- 'content-type': 'application/json' //自定义请求头信息
- },
- success: (res) => {
- console.log("----", res.data);
- that.$refs['ToastW3'].showToast({
- title: res.data.str,
- animation: 0
- });
- if (res.data.success == "yes") {
- this.loadData();
- }
- },
- complete: (com) => {
- uni.hideLoading();
- },
- });
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- @import 'groupMemlist.scss';
- </style>
|