index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <transition name="msgbox-fade">
  3. <div class="pub-wrapper" v-if="visible" @click.stop>
  4. <div class="pub-mask" @click="visible = false"></div>
  5. <div class="pub-modal invite-modal"
  6. v-loading="isLoading"
  7. :element-loading-text="$t('public.loading')"
  8. element-loading-spinner="el-icon-loading"
  9. element-loading-background="rgba(0, 0, 0, 0.2)">
  10. <div class="modal-hd">
  11. <i class="el-icon-close" @click="hidePopup"></i>
  12. </div>
  13. <div class="modal-bd clearfix">
  14. <div class="left">
  15. <div class="search-input">
  16. <input type="text" @input="searchUser($event, checkList)" :placeholder="$t('invite.searchContact')">
  17. <i class="el-icon-search"></i>
  18. </div>
  19. <div class="user-list select-list pub-scroll-box">
  20. <template v-if="showNum>0 && !isSearchGroup">
  21. <div
  22. v-for="(item, key) in checkList"
  23. :key="key"
  24. >
  25. <div class="user-item" :class="{'checked': item.isChecked}" @click="changeState(item.user_id)" v-show="item.isShow">
  26. <img v-if="item.cover_photo" class="user-avatar" :src="item.cover_photo" alt>
  27. <div
  28. v-else
  29. class="user-avatar"
  30. :class="`avatar_bg${item.user_id % 9}`"
  31. :data-name="item.nick_name.slice(0,2).toUpperCase()"
  32. ></div>
  33. <span class="name">{{item.nick_name}}</span>
  34. <i v-if="item.isChoosed" class="el-icon-circle-check is-choosed"></i>
  35. <div v-else-if="item.is_admin!=2">
  36. <i v-if="item.isChecked" class="el-icon-circle-check"></i>
  37. <i v-else class="el-icon-circle-uncheck"></i>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <div class="no-data" v-else>{{$t('invite.noContact')}}</div>
  43. </div>
  44. </div>
  45. <div class="right">
  46. <p class="tips" v-if="this.inviteType==5">{{$t('invite.transferGroupOwner')}}</p>
  47. <p class="tips" v-else-if="this.checkedNum">{{$t('invite.seleted')}}{{checkedNum}}{{$t('invite.numberMember')}}</p>
  48. <p class="tips" v-else-if="this.inviteType==3">{{$t('invite.checkDeleteMemberTips')}}</p>
  49. <p class="tips" v-else>{{$t('invite.checkAddMemberTips')}}{{this.inviteType==4?$t('public.admin'):$t('public.contact')}}</p>
  50. <div class="group-name" v-if="this.inviteType==1">
  51. <input v-focus v-model="groupName" type="text" :placeholder="$t('invite.writeGroupName')">
  52. </div>
  53. <div class="user-list pub-scroll-box">
  54. <template v-for="(item, key) in checkList">
  55. <div class="user-item" :key="key" v-if="item.isChecked">
  56. <img v-if="item.cover_photo" class="user-avatar" :src="item.cover_photo" alt>
  57. <div
  58. v-else
  59. class="user-avatar"
  60. :class="`avatar_bg${item.user_id % 9}`"
  61. :data-name="item.nick_name.slice(0,2).toUpperCase()"
  62. ></div>
  63. <span class="name">{{item.nick_name}}</span>
  64. <i @click="changeState(item.user_id, false)" class="el-icon-circle-close"></i>
  65. </div>
  66. </template>
  67. </div>
  68. <div class="send-btn">
  69. <el-button @click="optSubmit" type="primary" :disabled="this.inviteType!=1 && checkedNum<=0">{{$t('public.confirm')}}</el-button>
  70. <el-button @click="hidePopup">{{$t('public.cancel')}}</el-button>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </transition>
  77. </template>
  78. <script>
  79. import { Button } from 'element-ui'
  80. import Vue from 'vue'
  81. import { groupInviteMixins } from '@/mixins/group'
  82. Vue.component(Button.name, Button)
  83. export default {
  84. name: 'invitePopup',
  85. mixins: [groupInviteMixins],
  86. methods: {
  87. hidePopup () {
  88. this.visible = false
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. @import './style.scss'
  95. </style>