Form_recommend.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. <template>
  2. <div class="recommend-container" v-if="isShow">
  3. <div class="recommend-main">
  4. <div class="close" @click="close"></div>
  5. <div class="recommend-title">为您精选以下开发者</div>
  6. <div class="recommend-second-title">选择后,需求审核通过就会帮您对接哦~</div>
  7. <div class="recommend-list">
  8. <div class="recommend-item first">
  9. <div class="recommend-icon"></div>
  10. <div class="recommend-item-title">性价比最高</div>
  11. <div class="recommend-item-worker" v-for="user in RateUser" :key="user.uid">
  12. <div class="recommend-worker-info-area">
  13. <div class="worder-avatar">
  14. <img :src="user.user_logo" />
  15. </div>
  16. <div class="worder-info">
  17. <p class="recommend-worder-name text-line-1">{{user.nickname}}</p>
  18. <p class="recommend-worder-detail">日薪:{{user.work_price}} | <a href="">查看简历</a></p>
  19. </div>
  20. </div>
  21. <div class="recommend-choice-btn-area">
  22. <span class="recommend-choice-btn" :class="{'cur':firstUser.uid == user.uid}" @click="setFirstChoice(user)">设为主选</span>
  23. <span class="recommend-choice-btn" :class="{'cur':secondUser.uid == user.uid}" @click="setSecondChoice(user)">设为次选</span>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="recommend-item second">
  28. <div class="recommend-icon"></div>
  29. <div class="recommend-item-title">好评最多</div>
  30. <div class="recommend-item-worker" v-for="user in ScoreUser" :key="user.uid">
  31. <div class="recommend-worker-info-area">
  32. <div class="worder-avatar">
  33. <img :src="user.user_logo" />
  34. </div>
  35. <div class="worder-info">
  36. <p class="recommend-worder-name text-line-1">{{user.nickname}}</p>
  37. <p class="recommend-worder-detail">日薪:{{user.work_price}} | <a href="">查看简历</a></p>
  38. </div>
  39. </div>
  40. <div class="recommend-choice-btn-area">
  41. <span class="recommend-choice-btn" :class="{'cur':firstUser.uid == user.uid}" @click="setFirstChoice(user)">设为主选</span>
  42. <span class="recommend-choice-btn" :class="{'cur':secondUser.uid == user.uid}" @click="setSecondChoice(user)">设为次选</span>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="recommend-item third">
  47. <div class="recommend-icon"></div>
  48. <div class="recommend-item-title">技术最牛</div>
  49. <div class="recommend-item-worker" v-for="user in PriceUser" :key="user.uid">
  50. <div class="recommend-worker-info-area">
  51. <div class="worder-avatar">
  52. <img :src="user.user_logo" />
  53. </div>
  54. <div class="worder-info">
  55. <p class="recommend-worder-name text-line-1">{{user.nickname}}</p>
  56. <p class="recommend-worder-detail">日薪:{{user.work_price}} | <a href="">查看简历</a></p>
  57. </div>
  58. </div>
  59. <div class="recommend-choice-btn-area">
  60. <span class="recommend-choice-btn" :class="{'cur':firstUser.uid == user.uid}" @click="setFirstChoice(user)">设为主选</span>
  61. <span class="recommend-choice-btn" :class="{'cur':secondUser.uid == user.uid}" @click="setSecondChoice(user)">设为次选</span>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="recommend-tips">我的选择:</div>
  67. <div class="recommend-my-choice">
  68. <div class="recommend-worker">
  69. <div class="recommend-worder-choiced">
  70. <div class="recommend-worder-choiced-avatar" :style="{
  71. 'background-image': 'url('+firstUser.user_logo+')'
  72. }"></div>
  73. <p class="recommend-worder-choiced-state text-line-1">{{firstUser.nickname? firstUser.nickname:'未选择'}}</p>
  74. <p class="recommend-worder-sort">主选</p>
  75. </div>
  76. <div class="recommend-worder-choiced">
  77. <div class="recommend-worder-choiced-avatar" :style="{
  78. 'background-image': 'url('+secondUser.user_logo+')'
  79. }"></div>
  80. <p class="recommend-worder-choiced-state text-line-1">{{secondUser.nickname? secondUser.nickname:'未选择'}}</p>
  81. <p class="recommend-worder-sort second-choice ">次选</p>
  82. </div>
  83. </div>
  84. <div class="recommend-submit">
  85. <div class="recommend-submit-btn" @click="submit">确认选择</div>
  86. <div class="recommend-submit-btn pass">
  87. <span>跳过选择</span>
  88. <span class="recommend-submit-btn-tips">客户经理为您选择</span>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. export default {
  97. props: ['projectid'],
  98. data() {
  99. return {
  100. firstUser: {},
  101. secondUser: {},
  102. recommend: {},
  103. isShow: true,
  104. }
  105. },
  106. mounted() {
  107. this.fetchData()
  108. },
  109. computed: {
  110. RateUser() {
  111. return this.recommend ? this.recommend['rate_user'] : []
  112. },
  113. ScoreUser() {
  114. return this.recommend ? this.recommend['score_user'] : []
  115. },
  116. PriceUser() {
  117. return this.recommend ? this.recommend['price_user'] : []
  118. }
  119. },
  120. methods: {
  121. setFirstChoice(user) {
  122. if (this.secondUser.uid == user.uid) {
  123. this.secondUser = {}
  124. }
  125. this.firstUser = {
  126. ...user
  127. }
  128. },
  129. setSecondChoice(user) {
  130. if (this.firstUser.uid == user.uid) {
  131. this.firstUser = {}
  132. }
  133. this.secondUser = {
  134. ...user
  135. }
  136. },
  137. fetchData() {
  138. this.$axios
  139. .$post(
  140. "/wapi/work/recommend", {
  141. type: 3,
  142. projectId: this.projectid
  143. }
  144. )
  145. .then((res) => {
  146. if (res.status == 1) {
  147. this.recommend = {
  148. ...res.data
  149. }
  150. } else {
  151. this.$message.error(res.info)
  152. }
  153. })
  154. },
  155. close() {
  156. this.isShow = false
  157. },
  158. submit() {
  159. if(!this.firstUser.uid && !this.secondUser.uid){
  160. this.$message.error("请选择开发者")
  161. return
  162. }
  163. let uids = []
  164. if (this.firstUser.uid) {
  165. uids.push(this.firstUser.uid)
  166. }
  167. if (this.secondUser.uid) {
  168. uids.push(this.secondUser.uid)
  169. }
  170. this.$axios
  171. .$post(
  172. "/wapi/work/updataJobRecommend", {
  173. yy_developer_uid: uids.join(","),
  174. projectId: this.projectid
  175. }
  176. )
  177. .then((res) => {
  178. if (res.status == 1) {
  179. } else {
  180. this.$message.error(res.info)
  181. }
  182. })
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang="scss" scoped>
  188. .recommend-container {
  189. position: fixed;
  190. background: rgba(0, 0, 0, 0.7);
  191. z-index: 50;
  192. top: 0;
  193. bottom: 0;
  194. left: 0;
  195. right: 0;
  196. }
  197. .recommend-main {
  198. position: absolute;
  199. left: 50%;
  200. transform: translateX(-50%);
  201. top: 194px;
  202. width: 880px;
  203. height: 636px;
  204. background: #FFFFFF;
  205. border-radius: 8px;
  206. .close {
  207. width: 16px;
  208. height: 16px;
  209. position: absolute;
  210. right: 19px;
  211. top: 19px;
  212. background: url("~@/assets/img/recommend/close.png") no-repeat 50% 50%;
  213. background-size: cover;
  214. cursor: pointer;
  215. }
  216. }
  217. .recommend-title {
  218. margin-top: 40px;
  219. text-align: center;
  220. font-size: 22px;
  221. font-family: PingFangSC-Medium, PingFang SC;
  222. font-weight: 500;
  223. color: #0B121A;
  224. line-height: 30px
  225. }
  226. .recommend-second-title {
  227. margin-top: 4px;
  228. text-align: center;
  229. font-size: 14px;
  230. font-family: PingFangSC-Regular, PingFang SC;
  231. font-weight: 400;
  232. color: #445973;
  233. line-height: 20px;
  234. }
  235. .recommend-list {
  236. margin-top: 36px;
  237. margin-left: 50px;
  238. margin-right: 50px;
  239. display: flex;
  240. justify-content: space-between;
  241. }
  242. .recommend-item {
  243. width: 240px;
  244. height: 314px;
  245. position: relative;
  246. }
  247. .recommend-icon {
  248. position: absolute;
  249. left: 46px;
  250. top: 0;
  251. width: 39px;
  252. height: 46px;
  253. // border: 1px solid #f00;
  254. }
  255. .recommend-item-title {
  256. margin-top: 16px;
  257. margin-left: 93px;
  258. font-size: 16px;
  259. font-family: PingFangSC-Semibold, PingFang SC;
  260. font-weight: 600;
  261. line-height: 22px
  262. }
  263. .recommend-item-worker {
  264. margin-top: 16px;
  265. margin-left: 16px;
  266. margin-right: 16px;
  267. // width: 208px;
  268. height: 114px;
  269. background: #FFFFFF;
  270. border-radius: 4px;
  271. overflow: hidden;
  272. }
  273. .recommend-worker-info-area {
  274. display: flex;
  275. margin-top: 12px;
  276. }
  277. .worder-avatar {
  278. width: 40px;
  279. height: 40px;
  280. border-radius: 40px;
  281. font-size: 0;
  282. margin-left: 12px;
  283. overflow: hidden;
  284. img {
  285. width: 40px;
  286. height: 40px;
  287. border-radius: 40px;
  288. }
  289. }
  290. .worder-info {
  291. flex: 1;
  292. margin-left: 8px;
  293. display: flex;
  294. flex-direction: column;
  295. // align-items: center;
  296. justify-content: space-between;
  297. }
  298. .recommend-worder-name {
  299. font-size: 14px;
  300. font-family: PingFangSC-Medium, PingFang SC;
  301. font-weight: 500;
  302. color: #0B121A;
  303. line-height: 20px
  304. }
  305. .recommend-worder-detail {
  306. margin-top: 2px;
  307. font-size: 12px;
  308. font-family: PingFangSC-Regular, PingFang SC;
  309. font-weight: 400;
  310. color: #828C99;
  311. line-height: 17px;
  312. a {
  313. color: #4D81BF;
  314. }
  315. }
  316. .recommend-choice-btn-area {
  317. margin-top: 20px;
  318. text-align: center;
  319. }
  320. .recommend-choice-btn {
  321. display: inline-block;
  322. width: 72px;
  323. height: 28px;
  324. border-radius: 14px;
  325. line-height: 28px;
  326. font-size: 13px;
  327. font-weight: 400;
  328. margin-left: 6px;
  329. margin-right: 6px;
  330. cursor: pointer;
  331. background: #FFFFFF;
  332. border: 1px solid #4B5D73;
  333. color: #4B5D73;
  334. &.cur {
  335. background: #4B5D73;
  336. color: #FFFFFF;
  337. }
  338. }
  339. .first {
  340. background: url("~@/assets/img/recommend/bg1.png") no-repeat 50% 50%;
  341. background-size: cover;
  342. .recommend-icon {
  343. background: url("~@/assets/img/recommend/icon1.png") no-repeat 50% 50%;
  344. background-size: cover;
  345. }
  346. .recommend-item-title {
  347. color: #458EE6;
  348. }
  349. }
  350. .second {
  351. background: url("~@/assets/img/recommend/bg2.png") no-repeat 50% 50%;
  352. background-size: cover;
  353. .recommend-icon {
  354. background: url("~@/assets/img/recommend/icon2.png") no-repeat 50% 50%;
  355. background-size: cover;
  356. }
  357. .recommend-item-title {
  358. color: #E66445;
  359. }
  360. }
  361. .third {
  362. background: url("~@/assets/img/recommend/bg3.png") no-repeat 50% 50%;
  363. background-size: cover;
  364. .recommend-icon {
  365. background: url("~@/assets/img/recommend/icon3.png") no-repeat 50% 50%;
  366. background-size: cover;
  367. }
  368. .recommend-item-title {
  369. color: #AB7A42;
  370. }
  371. }
  372. .recommend-tips {
  373. margin: 30px 0 0 50px;
  374. font-size: 14px;
  375. font-family: PingFangSC-Regular, PingFang SC;
  376. font-weight: 400;
  377. color: #637192;
  378. line-height: 20px;
  379. }
  380. .recommend-my-choice {
  381. margin-left: 50px;
  382. margin-right: 50px;
  383. margin-top: 20px;
  384. display: flex;
  385. justify-content: space-between;
  386. }
  387. .recommend-worker {
  388. display: flex;
  389. }
  390. .recommend-worder-choiced {
  391. display: flex;
  392. margin-right: 29px;
  393. width: 80px;
  394. flex-direction: column;
  395. // justify-content: center;
  396. align-items: center;
  397. text-align: center;
  398. }
  399. .recommend-worder-choiced-avatar {
  400. width: 36px;
  401. height: 36px;
  402. background-color: #EBECED;
  403. border-radius: 100%;
  404. background-repeat: no-repeat;
  405. background-position: 50% 50%;
  406. background-size: cover;
  407. }
  408. .recommend-worder-choiced-state {
  409. font-size: 13px;
  410. font-family: PingFangSC-Regular, PingFang SC;
  411. font-weight: 400;
  412. color: #828C99;
  413. line-height: 18px;
  414. margin-top: 4px;
  415. }
  416. .recommend-worder-sort {
  417. margin-top: 6px;
  418. width: 32px;
  419. height: 18px;
  420. background: #FFFFFF;
  421. border-radius: 2px;
  422. border: 1px solid #308EFF;
  423. line-height: 18px;
  424. text-align: center;
  425. font-size: 12px;
  426. font-family: PingFangSC-Regular, PingFang SC;
  427. font-weight: 400;
  428. color: #308EFF;
  429. &.second-choice {
  430. border-color: #445973;
  431. color: #445973;
  432. }
  433. }
  434. .recommend-submit {
  435. display: flex
  436. }
  437. .recommend-submit-btn {
  438. margin-right: 20px;
  439. display: flex;
  440. flex-direction: column;
  441. justify-content: center;
  442. align-items: center;
  443. width: 120px;
  444. height: 54px;
  445. background: #96C6FF;
  446. border-radius: 2px;
  447. color: #FFFFFF;
  448. cursor: pointer;
  449. &:hover {
  450. background: #308EFF
  451. }
  452. }
  453. .recommend-submit-btn-tips {
  454. font-size: 12px;
  455. font-family: PingFangSC-Regular, PingFang SC;
  456. font-weight: 400;
  457. color: rgba(255, 255, 255, 0.5);
  458. line-height: 17px;
  459. }
  460. .pass {
  461. background: #99AABF;
  462. &:hover {
  463. background: #4B5D73
  464. }
  465. }
  466. </style>