invite.vue 3.9 KB

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