moreMem.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view>
  3. <u-grid :col="6" :border="false">
  4. <u-grid-item v-for="(item, index) in memberItemIndex" :index="index" :key="item.id" @tap="linkTo(item.id)">
  5. <img-cache :src="item.avatar"></img-cache>
  6. <view class="grid-text">{{ item.groupNickName||item.nickName }}</view>
  7. </u-grid-item>
  8. </u-grid>
  9. </view>
  10. </template>
  11. <script>
  12. import ImgCache from '@/components/img-cache/img-cache.vue';
  13. export default {
  14. name:'moreMembers',
  15. components:{
  16. ImgCache
  17. },
  18. data() {
  19. return {
  20. $url:''
  21. };
  22. },
  23. onShow() {
  24. this.queryMems();
  25. },
  26. methods:{
  27. showAddGroupUser(){
  28. this.$u.route({
  29. url: 'pageC/chat/addGroupUser'
  30. });
  31. },
  32. linkTo(id){
  33. this.$u.route({
  34. url: 'pageC/businessCard/businessCard',
  35. params:{ id: id, source: 1}
  36. })
  37. },
  38. queryMems(){
  39. this.$socket.queryMembers(this.chatObj.chatId, this.userData.user.operId, res => {
  40. if (res.success) {
  41. this.$u.vuex('memberItemIndex',res.members)
  42. uni.setNavigationBarTitle({
  43. title: '群成员(' + this.memberItemIndex.length +')'
  44. });
  45. } else {
  46. uni.showModal({
  47. title: '获取数据失败',
  48. showCancel: false
  49. });
  50. }
  51. });
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss">
  57. .grid-text{
  58. width: 80rpx;
  59. overflow: hidden;
  60. height: 44rpx;
  61. }
  62. .img-cache{
  63. width: 80rpx;
  64. height: 80rpx;
  65. }
  66. </style>