seenMe.vue 5.2 KB

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