seenMe.vue 5.0 KB

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