resume-card.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view class="resume-card">
  3. <view class="top-section flex justify-between">
  4. <view class="flex user-info">
  5. <view class="avatar-container">
  6. <image :src="avatar ? avatar : '/static/images/logo.jpg'" class="avatar"></image>
  7. <image src="@/static/images/svg/male.svg" class="sex-icon" v-if="sex == 1"></image>
  8. <image src="@/static/images/svg/female.svg" class="sex-icon" v-else-if="sex == 2"></image>
  9. </view>
  10. <view class="user-info-box">
  11. <view class="flex">
  12. <text class="name">{{ userName }}</text>
  13. <view class="online-status" :class="{ online: lineValue == onlineStr, offline: lineValue == offlineStr }">{{ lineText }}</view>
  14. </view>
  15. <view class="base-info flex align-center">
  16. <text v-for="(item, index) in baseInfoArr" :key="index">{{ item }}</text>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="salary">{{ salaryRange }}</view>
  21. </view>
  22. <view class="flex align-center justify-between company-info">
  23. <view class="flex align-center">
  24. <image src="@/static/images/svg/bag.svg" class="icon"></image>
  25. <text class="text">{{ companyName }} · {{ positionName }}</text>
  26. <view class="company-tag" v-if="isCrossCompany">跨境</view>
  27. </view>
  28. <view class="time">{{ companyTime }}</view>
  29. </view>
  30. <view class="tags">
  31. <view class="tag" v-for="(item, index) in skills" :key="index">{{ item }}</view>
  32. </view>
  33. <view class="bottom-section flex align-center">
  34. <image src="@/static/images/svg/heart.svg" class="expection-icon"></image>
  35. 求职期望:{{ ruleClassifyName }}
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import { formatNumberToK } from '@/utils/util.js'
  41. export default {
  42. data() {
  43. return {
  44. avatar: '',
  45. sex: 0, // 1男、2女
  46. userName: '',
  47. baseInfoArr: [], // 基本信息
  48. companyName: '', // 公司
  49. positionName: '', // 职位
  50. salaryRange: '', // 薪资范围
  51. lineValue: '', // 在线状态
  52. isCrossCompany: false, // 是否是跨境
  53. companyTime: '', // 当前公司工作时间
  54. ruleClassifyName: '', // 期望岗位
  55. skills: [], // 技能标签
  56. onlineStr: 'ONLINE',
  57. offlineStr: 'OFFLINE'
  58. };
  59. },
  60. computed: {
  61. lineText() {
  62. if (this.lineValue === this.onlineStr) {
  63. return '在线'
  64. } else if (this.lineValue === this.offlineStr) {
  65. return '离线'
  66. }
  67. return ''
  68. }
  69. },
  70. mounted() {
  71. this.getData()
  72. },
  73. methods: {
  74. // 获取数据
  75. getData() {
  76. this.$Request
  77. .getT('/app/resumes/getResumesReviewData')
  78. .then(res => {
  79. if (res.code === 0) {
  80. const data = res.data
  81. this.avatar = data.userAvatar
  82. this.sex = data.userSex
  83. this.userName = data.userName
  84. this.lineValue = data.onlineStatus
  85. // 设置薪资
  86. this.salaryRange = this.setSalaryRange(data.salaryRange)
  87. // 设置年龄、工龄、学历
  88. if (data.userAge) {
  89. this.baseInfoArr.push(`${data.userAge}岁`)
  90. }
  91. if (data.resumesWorkExperience) {
  92. this.baseInfoArr.push(data.resumesWorkExperience)
  93. }
  94. if (data.degree) {
  95. this.baseInfoArr.push(data.degree)
  96. }
  97. this.companyName = data.companyName
  98. this.positionName = data.position
  99. this.ruleClassifyName = data.ruleClassifyName
  100. // this.skills
  101. }
  102. console.log(res)
  103. })
  104. },
  105. setSalaryRange(value) {
  106. if (value && value.indexOf('-')) {
  107. const salaryValue = value.split('-')
  108. return `${formatNumberToK(salaryValue[0])}-${formatNumberToK(salaryValue[1])}`
  109. }
  110. return ''
  111. },
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .resume-card {
  117. background: #fff;
  118. border-radius: 12rpx;
  119. padding: 16rpx 36rpx;
  120. .top-section {
  121. margin-bottom: 12rpx;
  122. .avatar-container {
  123. position: relative;
  124. margin-right: 20rpx;
  125. .avatar {
  126. width: 72rpx;
  127. height: 72rpx;
  128. border-radius: 72rpx;
  129. border: 1px solid rgba(240, 240, 240, 1);
  130. }
  131. .sex-icon {
  132. position: absolute;
  133. top: 0;
  134. right: 0;
  135. width: 22rpx;
  136. height: 22rpx;
  137. background: #fff;
  138. border-radius: 22rpx;
  139. }
  140. }
  141. .user-info-box {
  142. .name {
  143. font-size: 28rpx;
  144. font-weight: 500;
  145. line-height: 36rpx;
  146. color: rgba(51, 51, 51, 1);
  147. margin-right: 20rpx;
  148. }
  149. .online-status {
  150. font-size: 16rpx;
  151. line-height: 20rpx;
  152. padding: 8rpx 20rpx;
  153. border-radius: 8rpx;
  154. }
  155. .online {
  156. color: rgba(29, 209, 104, 1);
  157. background: rgba(213, 255, 231, 1);
  158. }
  159. .offline {
  160. color: #999;
  161. background: #ddd;
  162. }
  163. // .other {
  164. // color: #8858C5;
  165. // background: #ECE1FD;
  166. // }
  167. .base-info {
  168. margin-top: 6rpx;
  169. text {
  170. font-size: 24rpx;
  171. line-height: 32rpx;
  172. color: rgba(1, 107, 246, 1);
  173. margin-right: 12rpx;
  174. }
  175. }
  176. }
  177. .salary {
  178. font-size: 24rpx;
  179. font-weight: 700;
  180. line-height: 40rpx;
  181. background-image: linear-gradient(90.00deg, rgba(13, 39, 247, 1),rgba(19, 193, 234, 1));
  182. -webkit-background-clip: text;
  183. color: transparent;
  184. background-clip: text;
  185. }
  186. }
  187. .company-info {
  188. .icon {
  189. width: 40rpx;
  190. height: 40rpx;
  191. margin-right: 8rpx;
  192. }
  193. .text {
  194. max-width: 420rpx;
  195. color: rgba(156, 164, 171, 1);
  196. font-size: 24rpx;
  197. line-height: 40rpx;
  198. }
  199. .company-tag {
  200. height: 32rpx;
  201. font-size: 20rpx;
  202. line-height: 1;
  203. color: #fff;
  204. border-radius: 8rpx;
  205. background: linear-gradient(90.00deg, rgba(13, 39, 247, 0.75) 0%,rgba(19, 193, 234, 0.75) 100%);
  206. padding: 6rpx 7rpx;
  207. margin-left: 20rpx;
  208. box-sizing: border-box;
  209. }
  210. .time {
  211. font-size: 20rpx;
  212. line-height: 40rpx;
  213. color: rgba(144.88, 87.8, 191.25, 1);
  214. }
  215. }
  216. // tag样式
  217. .tags {
  218. display: flex;
  219. flex-wrap: wrap;
  220. .tag {
  221. padding: 8rpx;
  222. border-radius: 8rpx;
  223. background: rgba(198, 198, 198, 0.1);
  224. font-size: 20rpx;
  225. line-height: 1;
  226. color: rgba(153, 153, 153, 1);
  227. margin-top: 8rpx;
  228. margin-right: 8rpx;
  229. }
  230. }
  231. .bottom-section {
  232. color: rgba(156, 164, 171, 1);
  233. font-size: 24rpx;
  234. line-height: 40rpx;
  235. margin-top: 12rpx;
  236. .expection-icon {
  237. width: 40rpx;
  238. height: 40rpx;
  239. margin-right: 8rpx;
  240. }
  241. }
  242. }
  243. </style>