collect.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="content">
  3. <view class="top hflex acenter jcenter">
  4. <block v-for="(item,index) in top" :key="index">
  5. <view class="top_item" :class="active == index ? 'active' :''" @click="changeTop(index)">{{item.name}}</view>
  6. </block>
  7. </view>
  8. <view class="list" v-if="active == 0 && pageList.length > 0">
  9. <block v-for="(item,index) in pageList" :key="index">
  10. <view class="list_item" @click="toDetail(item.recruitment.id)">
  11. <view class="hflex acenter jbetween">
  12. <view class="item_title">{{item.recruitment.title}}</view>
  13. <view class="item_blue">{{item.recruitment.salary_start}}-{{item.recruitment.salary_end}}</view>
  14. </view>
  15. <view class="item_name">{{item.recruitment.shipyard.name}}</view>
  16. <view class="hflex acenter" style="padding: 0 0 28rpx;">
  17. <view class="item_box">{{item.recruitment.city}}</view>
  18. <view class="item_box">{{item.recruitment.schooling}}</view>
  19. <view class="item_box">{{item.recruitment.experience}}</view>
  20. </view>
  21. <view class="hflex acenter jbetween" style="padding-top: 16rpx;">
  22. <view class="hflex acenter">
  23. <image class="item_avatar" mode="aspectFill" :src="item.recruitment.contact_headimg"></image>
  24. <view class="user_name">{{item.recruitment.contact_person}}·{{item.recruitment.contact_position}}</view>
  25. </view>
  26. <view class="user_right">{{item.date}}</view>
  27. </view>
  28. </view>
  29. </block>
  30. </view>
  31. <view class="list" v-if="active == 1 && pageList.length > 0">
  32. <block v-for="(item,index) in pageList" :key="index">
  33. <view class="list_item hflex jbetween" @click="toDetail2(item.joblist.id)">
  34. <view class="hflex">
  35. <image class="item_avatar1" :src="item.joblist.head_img"></image>
  36. <view class="item_right1 vflex">
  37. <view class="item_title">{{item.joblist.real_name}}</view>
  38. <view class="hflex acenter">
  39. <view class="text_style1">{{item.joblist.city}}</view>
  40. <view style="padding: 0 8rpx;">|</view>
  41. <view class="text_style1">{{item.joblist.age}}岁</view>
  42. <view style="padding: 0 8rpx;">|</view>
  43. <view class="text_style1">{{item.joblist.work_year}}年</view>
  44. <view style="padding: 0 8rpx;">|</view>
  45. <view class="text_style1">{{item.joblist.schooling}}</view>
  46. </view>
  47. <view class="item_box1 hflex acenter">应聘岗位<view style="padding: 0 8rpx;">|</view>{{item.joblist.job_application}}</view>
  48. </view>
  49. </view>
  50. <view class="item_btn1">打招呼</view>
  51. </view>
  52. </block>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import $api from '@/static/js/api.js'
  58. var that = ''
  59. export default {
  60. data() {
  61. return {
  62. top: [
  63. {
  64. name: '招聘信息',
  65. },
  66. {
  67. name: '求职信息'
  68. }
  69. ],
  70. active: 0,
  71. pageList: [
  72. ],
  73. page: 1,
  74. limit: 10,
  75. total: 1
  76. }
  77. },
  78. onLoad() {
  79. that = this
  80. that.getList()
  81. },
  82. methods: {
  83. getList() {
  84. $api.req({
  85. url: '/data/api.auth.DemandLabor/mycollection',
  86. method: 'POST',
  87. data: {
  88. type: that.active + 1,
  89. page: that.page
  90. }
  91. }, function(res) {
  92. if(res.code == 1) {
  93. if(that.page == 1) {
  94. that.pageList = res.data.data
  95. } else {
  96. that.pageList = that.pageList.concat(res.data.data)
  97. }
  98. if(that.pageList.length > 0) {
  99. for(var i=0;i<that.pageList.length;i++) {
  100. that.pageList[i].date = that.pageList[i].create_at.substr(0,10).split("-")[1]+"月"+that.pageList[i].create_at.substr(0,10).split("-")[2]+"日";
  101. }
  102. }
  103. if(that.active == 1) {
  104. for(var i=0;i<that.pageList.length;i++) {
  105. that.pageList[i].joblist.real_name = '*' + that.pageList[i].joblist.real_name.slice(1)
  106. }
  107. }
  108. that.total = res.data.total
  109. that.limit = res.data.limit
  110. }
  111. })
  112. },
  113. changeTop(index) {
  114. that.active = index
  115. that.page = 1
  116. that.pageList = []
  117. that.getList()
  118. },
  119. toDetail(id) {
  120. $api.jump('/page_index/pages/demand/recruitDetail?id='+id)
  121. },
  122. toDetail2(id) {
  123. $api.jump('/page_index/pages/demand/wantedDetail?id='+id)
  124. },
  125. onReachBottom() {
  126. if (that.page * that.limit >= that.total) {
  127. $api.info("没有更多了")
  128. } else {
  129. this.page++
  130. this.getList()
  131. }
  132. }
  133. },
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .content {
  138. padding: 0 30rpx;
  139. background: #F4F4F4;
  140. .top {
  141. width: 100%;
  142. height: 80rpx;
  143. background: #FFFFFF;
  144. border-radius: 40rpx;
  145. font-size: 30rpx;
  146. font-weight: 500;
  147. color: #222222;
  148. margin-top: 20rpx;
  149. .top_item {
  150. width: 50%;
  151. text-align: center;
  152. }
  153. .active {
  154. width: 340rpx;
  155. height: 68rpx;
  156. background: #506DFF;
  157. border-radius: 36px;
  158. color: #FFFFFF;
  159. line-height: 68rpx;
  160. }
  161. }
  162. .list {
  163. width: 100%;
  164. .list_item {
  165. background-color: #fff;
  166. width: 100%;
  167. padding: 28rpx 0 20rpx;
  168. box-sizing: border-box;
  169. padding: 20rpx;
  170. border-radius: 20rpx;
  171. // border-top: 1rpx solid #F4F4F4;
  172. margin-top: 20rpx;
  173. .item_title {
  174. font-size: 32rpx;
  175. font-weight: 600;
  176. color: #222222;
  177. }
  178. .item_blue {
  179. font-size: 32rpx;
  180. font-weight: bold;
  181. color: #506DFF;
  182. }
  183. .item_box {
  184. height: 40rpx;
  185. background: #F0F2F6;
  186. border-radius: 2px;
  187. box-sizing: border-box;
  188. padding: 4rpx 18rpx;
  189. font-size: 22rpx;
  190. font-weight: 400;
  191. color: #444444;
  192. margin-right: 20rpx;
  193. }
  194. .item_name {
  195. font-size: 24rpx;
  196. font-weight: 400;
  197. color: #666666;
  198. padding: 16rpx 0 20rpx;
  199. }
  200. .item_avatar {
  201. width: 40rpx;
  202. height: 40rpx;
  203. border-radius: 50%;
  204. margin-right: 12rpx;
  205. }
  206. .item_avatar1 {
  207. width: 88rpx;
  208. height: 88rpx;
  209. border-radius: 50%;
  210. margin-right: 20rpx;
  211. }
  212. .item_right1 {
  213. }
  214. .text_style1 {
  215. font-size: 22rpx;
  216. font-weight: 400;
  217. color: #666666;
  218. padding: 12rpx 0;
  219. }
  220. .item_box1 {
  221. margin-top: 8rpx;
  222. background: #EDF0FF;
  223. border-radius: 8rpx;
  224. box-sizing: border-box;
  225. padding: 4rpx 16rpx;
  226. font-size: 24rpx;
  227. font-weight: 400;
  228. color: #506DFF;
  229. }
  230. .item_btn1 {
  231. width: 140rpx;
  232. height: 52rpx;
  233. background: #F1F3FF;
  234. border-radius: 28rpx;
  235. font-size: 26rpx;
  236. font-weight: 500;
  237. color: #506DFF;
  238. line-height: 52rpx;
  239. text-align: center;
  240. }
  241. .user_name {
  242. font-size: 20rpx;
  243. font-weight: 400;
  244. color: #333333;
  245. }
  246. .user_right {
  247. font-size: 20rpx;
  248. font-weight: 400;
  249. color: #A1A1A1;
  250. }
  251. }
  252. }
  253. }
  254. </style>