index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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="!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. <template v-else>
  43. <div
  44. v-for="(item, key) in searchGroupList"
  45. :key="key"
  46. >
  47. <div class="user-item" :class="{'checked': item.isChecked}" @click="changeState(item.user_id)" v-show="item.isShow">
  48. <img v-if="item.cover_photo" class="user-avatar" :src="item.cover_photo" alt>
  49. <div
  50. v-else
  51. class="user-avatar"
  52. :class="`avatar_bg${item.user_id % 9}`"
  53. :data-name="item.nick_name.slice(0,2).toUpperCase()"
  54. ></div>
  55. <span class="name">{{item.nick_name}}</span>
  56. <i v-if="item.isChoosed" class="el-icon-circle-check is-choosed"></i>
  57. <div v-else-if="item.is_admin!=2">
  58. <i v-if="item.isChecked" class="el-icon-circle-check"></i>
  59. <i v-else class="el-icon-circle-uncheck"></i>
  60. </div>
  61. </div>
  62. </div>
  63. </template>
  64. <div class="no-data" v-show="showNum<=0">{{$t('invite.noContact')}}</div>
  65. </div>
  66. </div>
  67. <div class="right">
  68. <p class="tips" v-if="this.inviteType==5">{{$t('invite.transferGroupOwner')}}</p>
  69. <p class="tips" v-else-if="this.checkedNum">{{$t('invite.seleted')}}{{checkedNum}}{{$t('invite.numberMember')}}</p>
  70. <p class="tips" v-else-if="this.inviteType==3">{{$t('invite.checkDeleteMemberTips')}}</p>
  71. <p class="tips" v-else>{{$t('invite.checkAddMemberTips')}}{{this.inviteType==4?$t('public.admin'):$t('public.contact')}}</p>
  72. <div class="group-name" v-if="this.inviteType==1">
  73. <input v-focus v-model="groupName" type="text" :placeholder="$t('invite.writeGroupName')">
  74. </div>
  75. <div class="user-list pub-scroll-box">
  76. <template v-for="(item, key) in checkList">
  77. <div class="user-item" :key="key" v-if="item.isChecked">
  78. <img v-if="item.cover_photo" class="user-avatar" :src="item.cover_photo" alt>
  79. <div
  80. v-else
  81. class="user-avatar"
  82. :class="`avatar_bg${item.user_id % 9}`"
  83. :data-name="item.nick_name.slice(0,2).toUpperCase()"
  84. ></div>
  85. <span class="name">{{item.nick_name}}</span>
  86. <i @click="changeState(item.user_id, false)" class="el-icon-circle-close"></i>
  87. </div>
  88. </template>
  89. </div>
  90. <div class="send-btn">
  91. <el-button @click="optSubmit" type="primary" :disabled="this.inviteType!=1 && checkedNum<=0">{{$t('public.confirm')}}</el-button>
  92. <el-button @click="hidePopup">{{$t('public.cancel')}}</el-button>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </transition>
  99. </template>
  100. <script>
  101. import { Button } from 'element-ui'
  102. import Vue from 'vue'
  103. import { groupInviteMixins } from '@/mixins/group'
  104. Vue.component(Button.name, Button)
  105. export default {
  106. name: 'invitePopup',
  107. mixins: [groupInviteMixins],
  108. methods: {
  109. hidePopup () {
  110. this.visible = false
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. @import './style.scss'
  117. </style>