seenMe.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <div
  3. style="position: relative; min-height: calc(100vh - 198px);"
  4. :class="{
  5. 'disable1': userInfo?.vipExpireDate > Date.now() && !userInfo?.entitlement?.viewersList,
  6. 'disable2': !userInfo?.vipExpireDate || (userInfo?.vipExpireDate && userInfo?.vipExpireDate < Date.now())
  7. }"
  8. >
  9. <div v-if="userInfo?.entitlement?.viewersList && userInfo?.vipFlag && userInfo?.vipExpireDate && userInfo?.vipExpireDate > Date.now()">
  10. <div v-if="items.length" class="mt-3">
  11. <div class="positionItem" :class="item.active ? 'elevation-8' : 'elevation-3'" v-for="(item, index) in items" :key="index" @mouseenter="item.active = true" @mouseleave="item.active = false">
  12. <div class="position-and-company">
  13. <div class="position">
  14. <div class="float-left">
  15. <v-img :src="getUserAvatar(item?.contact.avatar, item?.contact.sex)" :width="40" style="height: 40px;border-radius: 4px;"/>
  16. </div>
  17. <div class="company-info">
  18. <h3 v-ellipse-tooltip class="title1">{{ item.contact.name }}</h3>
  19. <p class="mt-2">{{ item?.post?.nameCn }}</p>
  20. </div>
  21. </div>
  22. <div class="company" @click.stop="jumpToEnterpriseDetail(item.enterprise.id, false)">
  23. <div class="float-left">
  24. <v-img :src="item?.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" :alt="item.enterprise.anotherName" :width="40" style="height: 40px;border-radius: 4px;"/>
  25. </div>
  26. <div class="company-info">
  27. <h3 v-ellipse-tooltip :class="{'default-active': item.active }" class="title1 cursor-pointer" style="max-width: 455px;">{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</h3>
  28. <p class="mt-2">{{ item.enterprise.scaleName }}<span class="mx-2">|</span>{{ item.enterprise.industryName }}</p>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="footer">
  33. {{ $t('position.viewTime') + timesTampChange(item.updateTime) }}
  34. </div>
  35. </div>
  36. <CtPagination
  37. :total="total"
  38. :page="page.pageNo"
  39. :limit="page.pageSize"
  40. @handleChange="handleChangePage"
  41. ></CtPagination>
  42. </div>
  43. <Empty v-else :elevation="false"></Empty>
  44. </div>
  45. </div>
  46. </template>
  47. <script setup>
  48. // 看过我
  49. defineOptions({ name: 'position-seen-me' })
  50. import { ref } from 'vue'
  51. import { getInterestedMePage } from '@/api/recruit/personal/personalCenter'
  52. import { dealDictObjData } from '@/utils/position'
  53. import { timesTampChange } from '@/utils/date'
  54. import Empty from '@/components/Empty'
  55. import { getUserAvatar } from '@/utils/avatar'
  56. import { useUserStore } from '@/store/user'
  57. import { formatName } from '@/utils/getText'
  58. import { jumpToEnterpriseDetail } from '@/utils/position'
  59. const total = ref(0)
  60. const items = ref([])
  61. const page = ref({
  62. pageNo: 1,
  63. pageSize: 10
  64. })
  65. const userStore = useUserStore()
  66. let userInfo = ref(JSON.parse(localStorage.getItem('userInfo')) || {})
  67. userStore.$subscribe((mutation, state) => {
  68. if (state.userInfo && Object.keys(state.userInfo).length) userInfo.value = state?.userInfo
  69. })
  70. const getData = async () => {
  71. const res = await getInterestedMePage(page.value)
  72. items.value = res.list.map(e => {
  73. e.enterprise = dealDictObjData({}, e.enterprise)
  74. e.active = false
  75. return e
  76. })
  77. total.value = res.total
  78. }
  79. getData()
  80. const handleChangePage = (e) => {
  81. page.value.pageNo = e
  82. getData()
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. .title1 {
  87. color: var(--color-666);
  88. position: relative;
  89. max-width: 400px;
  90. margin-right: 8px;
  91. overflow: hidden;
  92. text-overflow: ellipsis;
  93. white-space: nowrap;
  94. font-size: 16px;
  95. }
  96. .company {
  97. flex: 1;
  98. display: flex;
  99. }
  100. .company-info {
  101. float: left;
  102. margin-left: 16px;
  103. }
  104. .company-info p {
  105. height: 18px;
  106. font-size: 13px;
  107. font-weight: 400;
  108. color: var(--color-999);
  109. }
  110. .textColor666 { color: var(--color-666); }
  111. .positionItem {
  112. margin-bottom: 12px;
  113. border-radius: 12px;
  114. padding: 0;
  115. overflow: hidden;
  116. transition: all .2s linear;
  117. background-color: #fff;
  118. .position-and-company {
  119. display: flex;
  120. padding: 16px 20px;
  121. width: 100%;
  122. .position {
  123. width: 484px;
  124. padding-right: 12px;
  125. }
  126. }
  127. }
  128. .footer {
  129. height: 36px;
  130. line-height: 36px;
  131. padding: 0px 20px;
  132. font-size: 14px;
  133. color: var(--color-999);
  134. background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
  135. }
  136. .tips {
  137. position: absolute;
  138. top: 50%;
  139. left: 50%;
  140. transform: translate(-50%, -50%);
  141. }
  142. .disable1 {
  143. position: relative;
  144. overflow: hidden;
  145. &::after {
  146. content: '当前会员套餐的福利不包含谁看过我';
  147. position: absolute;
  148. display: flex;
  149. align-items: center;
  150. justify-content: center;
  151. font-size: 1.5em;
  152. font-family: 'MiSans-Bold';
  153. color: #fff;
  154. top: 0;
  155. border-radius: 12px;
  156. left: 0;
  157. width: 100%;
  158. height: 100%;
  159. background-color: rgba(0, 0, 0, 0.35);
  160. }
  161. }
  162. .disable2 {
  163. position: relative;
  164. overflow: hidden;
  165. &::after {
  166. content: '谁看过我为会员福利内容';
  167. position: absolute;
  168. display: flex;
  169. align-items: center;
  170. justify-content: center;
  171. font-size: 1.5em;
  172. font-family: 'MiSans-Bold';
  173. color: #fff;
  174. top: 0;
  175. border-radius: 12px;
  176. left: 0;
  177. width: 100%;
  178. height: 100%;
  179. background-color: rgba(0, 0, 0, 0.35);
  180. }
  181. }
  182. </style>