collect.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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">
  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">
  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. total: 1
  75. }
  76. },
  77. onLoad() {
  78. that = this
  79. that.getList()
  80. },
  81. methods: {
  82. getList() {
  83. $api.req({
  84. url: '/data/api.auth.DemandLabor/mycollection',
  85. method: 'POST',
  86. data: {
  87. type: that.active + 1,
  88. page: that.page
  89. }
  90. }, function(res) {
  91. if(res.code == 1) {
  92. that.pageList = res.data.data
  93. if(that.pageList.length > 0) {
  94. for(var i=0;i<that.pageList.length;i++) {
  95. that.pageList[i].date = that.pageList[i].create_at.substr(0,10).split("-")[1]+"月"+that.pageList[i].create_at.substr(0,10).split("-")[2]+"日";
  96. }
  97. }
  98. if(that.active == 1) {
  99. for(var i=0;i<that.pageList.length;i++) {
  100. that.pageList[i].joblist.real_name = '*' + that.pageList[i].joblist.real_name.slice(1)
  101. }
  102. }
  103. that.total = res.data.total
  104. }
  105. })
  106. },
  107. changeTop(index) {
  108. that.active = index
  109. that.pageList = []
  110. that.getList()
  111. },
  112. toDetail(id) {
  113. $api.jump('/page_index/pages/demand/recruitDetail?id='+id)
  114. },
  115. toDetail2(id) {
  116. $api.jump('/page_index/pages/demand/wantedDetail?id='+id)
  117. },
  118. onReachBottom() {
  119. console.log("到底了");
  120. if (that.page >= that.total) {
  121. $api.info("没有更多了")
  122. } else {
  123. this.page++
  124. this.getList()
  125. }
  126. }
  127. },
  128. }
  129. </script>
  130. <style lang="scss" scoped>
  131. .content {
  132. padding: 0 30rpx;
  133. background: #F4F4F4;
  134. .top {
  135. width: 100%;
  136. height: 80rpx;
  137. background: #FFFFFF;
  138. border-radius: 40rpx;
  139. font-size: 30rpx;
  140. font-weight: 500;
  141. color: #222222;
  142. margin-top: 20rpx;
  143. .top_item {
  144. width: 50%;
  145. text-align: center;
  146. }
  147. .active {
  148. width: 340rpx;
  149. height: 68rpx;
  150. background: #506DFF;
  151. border-radius: 36px;
  152. color: #FFFFFF;
  153. line-height: 68rpx;
  154. }
  155. }
  156. .list {
  157. width: 100%;
  158. .list_item {
  159. background-color: #fff;
  160. width: 100%;
  161. padding: 28rpx 0 20rpx;
  162. box-sizing: border-box;
  163. padding: 20rpx;
  164. border-radius: 20rpx;
  165. // border-top: 1rpx solid #F4F4F4;
  166. margin-top: 20rpx;
  167. .item_title {
  168. font-size: 32rpx;
  169. font-weight: 600;
  170. color: #222222;
  171. }
  172. .item_blue {
  173. font-size: 32rpx;
  174. font-weight: bold;
  175. color: #506DFF;
  176. }
  177. .item_box {
  178. height: 40rpx;
  179. background: #F0F2F6;
  180. border-radius: 2px;
  181. box-sizing: border-box;
  182. padding: 4rpx 18rpx;
  183. font-size: 22rpx;
  184. font-weight: 400;
  185. color: #444444;
  186. margin-right: 20rpx;
  187. }
  188. .item_name {
  189. font-size: 24rpx;
  190. font-weight: 400;
  191. color: #666666;
  192. padding: 16rpx 0 20rpx;
  193. }
  194. .item_avatar {
  195. width: 40rpx;
  196. height: 40rpx;
  197. border-radius: 50%;
  198. margin-right: 12rpx;
  199. }
  200. .item_avatar1 {
  201. width: 88rpx;
  202. height: 88rpx;
  203. border-radius: 50%;
  204. margin-right: 20rpx;
  205. }
  206. .item_right1 {
  207. }
  208. .text_style1 {
  209. font-size: 22rpx;
  210. font-weight: 400;
  211. color: #666666;
  212. padding: 12rpx 0;
  213. }
  214. .item_box1 {
  215. margin-top: 8rpx;
  216. background: #EDF0FF;
  217. border-radius: 8rpx;
  218. box-sizing: border-box;
  219. padding: 4rpx 16rpx;
  220. font-size: 24rpx;
  221. font-weight: 400;
  222. color: #506DFF;
  223. }
  224. .item_btn1 {
  225. width: 140rpx;
  226. height: 52rpx;
  227. background: #F1F3FF;
  228. border-radius: 28rpx;
  229. font-size: 26rpx;
  230. font-weight: 500;
  231. color: #506DFF;
  232. line-height: 52rpx;
  233. text-align: center;
  234. }
  235. .user_name {
  236. font-size: 20rpx;
  237. font-weight: 400;
  238. color: #333333;
  239. }
  240. .user_right {
  241. font-size: 20rpx;
  242. font-weight: 400;
  243. color: #A1A1A1;
  244. }
  245. }
  246. }
  247. }
  248. </style>