invite.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <div class="add-person">
  3. <back-bar :title="$t('h5.selectContact')">
  4. <button class="opt-btn opt-del" v-if="inviteType==3" @click="optSubmit">{{$t('group.delete')}}</button>
  5. <button class="opt-btn" v-else @click="optSubmit">{{inviteType==1 ? $t('h5.createGroup') : $t('public.complete')}}</button>
  6. </back-bar>
  7. <div class="input-wrap" v-if="inviteType==1">
  8. <input v-focus v-model="groupName" type="text" :placeholder="$t('invite.writeGroupName')">
  9. </div>
  10. <div class="input-wrap" v-else>
  11. <i class="el-icon-search"></i>
  12. <input type="text" @input="searchUser($event, checkList)" :placeholder="$t('invite.searchContact')">
  13. </div>
  14. <div>
  15. <template v-if="showNum>0 && !isSearchGroup">
  16. <div v-for="(item, key) in checkList"
  17. :key="key">
  18. <div class="user-item"
  19. :class="{'checked': item.isChecked}"
  20. @click="changeStateForH5(item.user_id)"
  21. v-show="item.isShow">
  22. <i v-if="item.isChecked" class="el-icon-circle-check is-choosed"></i>
  23. <i v-else class="el-icon-circle-uncheck"></i>
  24. <img v-if="item.cover_photo" class="user-avatar" :src="item.cover_photo" alt>
  25. <div
  26. v-else
  27. class="user-avatar"
  28. :class="`avatar_bg${item.user_id % 9}`"
  29. :data-name="item.nick_name.slice(0,2).toUpperCase()"
  30. ></div>
  31. <span class="name">{{item.nick_name}}</span>
  32. </div>
  33. </div>
  34. </template>
  35. <div class="no-data" v-else>{{$t('invite.noContact')}}</div>
  36. </div>
  37. </div>
  38. </template>
  39. <script>
  40. import backBar from '@/components/backBar'
  41. import { groupInviteMixins } from '@/mixins/group'
  42. import { getUrlParam } from '@/util/util'
  43. export default {
  44. name: 'chatInvite',
  45. mixins: [groupInviteMixins],
  46. data () {
  47. return {
  48. inviteType: this.$route.params.inviteType * 1,
  49. ext: {
  50. tgGroupId: getUrlParam('tgGroupId') || ''
  51. }
  52. }
  53. },
  54. components: {
  55. backBar
  56. },
  57. computed: {},
  58. methods: {},
  59. async created () {
  60. let groupId = this.$route.params.id
  61. if (!this.group.groupId && groupId) {
  62. this.initGroup({
  63. groupId: groupId,
  64. useCache: false
  65. })
  66. this.changeSessionId(groupId)
  67. await this.getGroupInfo()
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .add-person {
  74. background-color: #ffffff;
  75. }
  76. .opt-btn {
  77. position: absolute;
  78. top: px2rem(14);
  79. right: px2rem(10);
  80. background-color: #279bf3;
  81. height: px2rem(58);
  82. line-height: px2rem(58);
  83. padding: 0 px2rem(26);
  84. font-size: px2rem(30);
  85. color: #ffffff;
  86. border-radius: 4px;
  87. &.opt-del{
  88. background-color: #e25151;
  89. }
  90. }
  91. .input-wrap {
  92. background-color: #ffffff;
  93. height: px2rem(100);
  94. line-height: px2rem(100);
  95. position: relative;
  96. padding-left: px2rem(80);
  97. border-bottom: 1px solid #eeeeee;
  98. .el-icon-search {
  99. position: absolute;
  100. left: 0;
  101. top: px2rem(36);
  102. width: px2rem(80);
  103. height: px2rem(40);
  104. text-align: center;
  105. bottom: 0;
  106. vertical-align: middle;
  107. color: #999;
  108. font-size: px2rem(40);
  109. }
  110. input {
  111. height: px2rem(70);
  112. line-height: px2rem(70);
  113. padding-left: px2rem(12);
  114. width: 100%;
  115. font-size: px2rem(28);
  116. outline: none;
  117. box-sizing: border-box;
  118. border: 0;
  119. }
  120. }
  121. .user-item {
  122. border-bottom: 1px solid #eeeeee;
  123. padding: px2rem(20) px2rem(20) px2rem(20) 0;
  124. display: flex;
  125. align-items: center;
  126. .name {
  127. flex: 1;
  128. display: inline-block;
  129. margin-left: px2rem(20);
  130. font-size: px2rem(34);
  131. color: #333333;
  132. }
  133. }
  134. .no-data{
  135. text-align: center;
  136. color: #999999;
  137. line-height: px2rem(500);
  138. font-size: 12px;
  139. }
  140. .el-icon-circle-uncheck,.el-icon-circle-check {
  141. display: inline-block;
  142. vertical-align: middle;
  143. width: px2rem(44);
  144. height: px2rem(44);
  145. margin: 0 px2rem(26);
  146. }
  147. .el-icon-circle-check{
  148. color: #279bf3;
  149. }
  150. </style>