adminInfo.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="app">
  3. <view class="tips">
  4. <view class="tip">群管理可以拥有的能力</view>
  5. <view class="tip">·可以拉群申请,邀请其他人加群里</view>
  6. <view class="tip">·移除群聊成员(群主/管理员除外)</view>
  7. <view class="tip">·发布群公告</view>
  8. <view class="tip">·修改群名称</view>
  9. </view>
  10. <view class="cath-user fx-r">
  11. <view class="item fx-h fx-bc fx-ac" v-for="item in data">
  12. <image class="avatar" :src="item.avatar == '' ? '/static/chat/user-avatar.png' : item.avatar" mode="aspectFill"></image>
  13. <view class="text" style="width: 16vw;">{{item.nickname}}</view>
  14. </view>
  15. <view class="item fx-h fx-bc fx-ac" @tap="tapAdd" >
  16. <image class="avatar" src="/static/chat/id_chat_add.png" mode="aspectFill"></image>
  17. <view class="text">添加成员</view>
  18. </view>
  19. <view class="item fx-h fx-bc fx-ac" @tap="tapJdd">
  20. <image class="avatar" src="/static/chat/id_chat_reduce.png" mode="aspectFill"></image>
  21. <view class="text">移除成员</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <style>
  28. .tips{padding: 10px;border-bottom: 1px solid #f1f1f1;}
  29. .tips .tip{font-size: 14px;color: #787878;margin-top: 4px;}
  30. .cath-user{padding: 10px;}
  31. .cath-user .item{width:16.5%;margin-bottom: 10px;}
  32. .cath-user .item .avatar{width:40px;height: 40px;border-radius: 6px;}
  33. .cath-user .item .text{font-size: 12px;margin-top: 4px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis;text-align: center;}
  34. </style>
  35. <script>
  36. import {mapState,mapMutations} from 'vuex';
  37. export default {
  38. computed: mapState(['user','sysData','txbagenum']),
  39. data() {
  40. return {
  41. data : [],
  42. groupId : 0
  43. }
  44. },
  45. onLoad(options) {
  46. this.groupId = options.groupId;
  47. this.checkUserLogin({
  48. page:this,isLogin:true,fn:this.initView
  49. });
  50. uni.$on('groupAdmin',this.initView);
  51. },
  52. onUnload() {
  53. uni.$off('groupAdmin',this.initView);
  54. },
  55. methods: {
  56. ...mapMutations(['checkUserLogin','setSys']),
  57. /**
  58. *
  59. */
  60. initView:function(){
  61. uni.showLoading({ title:"加载中..." });
  62. this
  63. .request
  64. .post("chatGroupAdminuser",{groupId : this.groupId})
  65. .then(res=>{
  66. uni.hideLoading();
  67. if(res.code == 200) {
  68. this.data = res.data;
  69. } else {
  70. this.utils.showModal(res.msg);
  71. }
  72. })
  73. .catch(err=>{
  74. uni.hideLoading();
  75. uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
  76. });
  77. },
  78. tapAdd:function(){
  79. var nAr = [];
  80. for(var i in this.data){
  81. nAr.push(this.data[i].uid);
  82. }
  83. uni.navigateTo({
  84. url:"adminAdd?groupId=" + this.groupId + "&notData=" + JSON.stringify(nAr)
  85. })
  86. },
  87. tapJdd:function(){
  88. uni.navigateTo({
  89. url:"adminJdd?groupId=" + this.groupId
  90. })
  91. }
  92. }
  93. }
  94. </script>