seenMe.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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">{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</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. import { formatName } from '@/utils/getText'
  61. const router = useRouter()
  62. const total = ref(0)
  63. const items = ref([])
  64. const page = ref({
  65. pageNo: 1,
  66. pageSize: 10
  67. })
  68. const userStore = useUserStore()
  69. let userInfo = ref(JSON.parse(localStorage.getItem('userInfo')) || {})
  70. userStore.$subscribe((mutation, state) => {
  71. if (state.userInfo && Object.keys(state.userInfo).length) userInfo.value = state?.userInfo
  72. })
  73. const getData = async () => {
  74. const res = await getInterestedMePage(page.value)
  75. items.value = res.list.map(e => {
  76. e.enterprise = dealDictObjData({}, e.enterprise)
  77. e.active = false
  78. return e
  79. })
  80. total.value = res.total
  81. }
  82. getData()
  83. const handleChangePage = (e) => {
  84. page.value.pageNo = e
  85. getData()
  86. }
  87. const handleEnterprise = (item) => {
  88. const id = item.enterprise.id
  89. if (!id) return
  90. router.push(`/recruit/personal/company/details/${id}?key=briefIntroduction`)
  91. }
  92. const goBuy = () => {
  93. router.push('/recruit/personal/personalCenter/memberBenefits/membershipPackage')
  94. }
  95. </script>
  96. <style scoped lang="scss">
  97. .title1 {
  98. color: var(--color-666);
  99. position: relative;
  100. max-width: 200px;
  101. margin-right: 8px;
  102. overflow: hidden;
  103. text-overflow: ellipsis;
  104. white-space: nowrap;
  105. font-size: 16px;
  106. }
  107. .company {
  108. flex: 1;
  109. display: flex;
  110. justify-content: end;
  111. }
  112. .company-info {
  113. float: left;
  114. margin-left: 16px;
  115. }
  116. .company-info p {
  117. height: 18px;
  118. font-size: 13px;
  119. font-weight: 400;
  120. color: var(--color-999);
  121. }
  122. .textColor666 { color: var(--color-666); }
  123. .positionItem {
  124. margin-bottom: 12px;
  125. border-radius: 12px;
  126. padding: 0;
  127. overflow: hidden;
  128. transition: all .2s linear;
  129. background-color: #fff;
  130. &:hover {
  131. 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;
  132. }
  133. .position-and-company {
  134. display: flex;
  135. padding: 16px 20px;
  136. width: 100%;
  137. .position {
  138. width: 484px;
  139. padding-right: 12px;
  140. }
  141. }
  142. }
  143. .footer {
  144. height: 36px;
  145. line-height: 36px;
  146. padding: 0px 20px;
  147. font-size: 14px;
  148. color: var(--color-999);
  149. background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
  150. }
  151. .tips {
  152. position: absolute;
  153. top: 50%;
  154. left: 50%;
  155. transform: translate(-50%, -50%);
  156. }
  157. </style>