choreInformation.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <view>
  3. <u-navbar back-text="零工驿站" back-icon-size="0" :customBack="customBack" back-icon-color="#ffffff"
  4. :background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
  5. <!-- 搜索框 -->
  6. <view class="search">
  7. <view class="search-box">
  8. <view class="option">
  9. <nxsearch :selectList="selectList" button="inside" @search="doSearch" @confirm="doSearc"
  10. :setIsFocus="false" @focus="gotoUrl('pages/packages/search/search')"
  11. v-model="searchQuery.keyword" placeholder="输入关键字找零工" />
  12. </view>
  13. </view>
  14. </view>
  15. <!-- 搜索结果 -->
  16. <view class="result">
  17. <view class="tabs">
  18. <view class="left">
  19. <u-tabs bg-color="#F0F0F2" :list="tabList" :is-scroll="false" :current="current"
  20. @change="change"></u-tabs>
  21. </view>
  22. <view class="screen" @click="popupShowtrue">
  23. <view class="icon">
  24. <img src="@/assets/img/riLine-filter-line@1x.png" alt="">
  25. </view>
  26. <view>筛选</view>
  27. </view>
  28. </view>
  29. <view class="result-item " v-for="(item,i) in tabList[current].list" :key="i"
  30. @click="gotoUrl('pages/packages/choreInformation/jobSearchDetails?id='+item.id)" >
  31. <!-- 照片 -->
  32. <view class="photo">
  33. <u-avatar :src="item.photo" :gender="item.gender" ></u-avatar>
  34. </view>
  35. <view class="content">
  36. <!-- 职位薪水 -->
  37. <view class="top">
  38. <view class="position">
  39. {{item.intendedIndustriesN}}
  40. </view>
  41. <view class="salary">
  42. {{item.hopeSalary}}{{getUnit(item)}}
  43. </view>
  44. </view>
  45. <view class="issuer">
  46. {{getPersonName(item.personName,item)}}
  47. </view>
  48. <view class="bottom">
  49. <view class="tags">
  50. <view class="tag-item tag-item2" v-if="getLastTime(item.lastLoginTime)">
  51. 活跃
  52. </view>
  53. <view class="tag-item">
  54. {{item.gender==1?'男':'女'}}
  55. </view>
  56. <view class="tag-item">
  57. {{item.age}}岁
  58. </view>
  59. <view class="tag-item" v-if="item.educationN" >
  60. {{item.educationN}}
  61. </view>
  62. </view>
  63. <view class="date">
  64. {{getTime(item)}}
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <u-divider style="background: #F0F0F2;" bgNoneColor="#F0F0F2"
  70. v-if="tabList[current].recordsTotal==tabList[current].list.length"
  71. :isnone="tabList[current].recordsTotal==0" nonetext="没有找到相关内容"
  72. border-color="#CFD2D5">已经到底了</u-divider>
  73. </view>
  74. <jkpop ref="pop" @reset="reset" @queryBtn="queryBtn" ></jkpop>
  75. <tabbar :current="3"></tabbar>
  76. </view>
  77. </template>
  78. <script>
  79. import * as API from '@/apis/pagejs/tab.js'
  80. import tabbar from "@/components/Tabbar.vue"
  81. import * as API_weixin from '@/apis/weixin.js'
  82. import jkpop from "@/pages/tab/as-components/jk-popup.vue"
  83. import nxsearch from "@/components/nx-search.vue"
  84. export default {
  85. components: {
  86. nxsearch,jkpop,
  87. tabbar
  88. },
  89. data() {
  90. return {
  91. keyword: '',
  92. searchQuery: {
  93. keyword: '',
  94. selectIndex: 0
  95. },
  96. workList: [
  97. ],
  98. selectList: [{
  99. id: 1,
  100. name: '找零工'
  101. },
  102. ],
  103. tabList: [{
  104. name: '最新',
  105. pageIndex: 1,
  106. pageSize: 20,
  107. statusType:"1",
  108. list:[],
  109. recordsTotal:0
  110. }, {
  111. name: '最热',
  112. pageIndex: 1,
  113. pageSize: 20,
  114. statusType:"2",
  115. list:[],
  116. recordsTotal:0
  117. }],
  118. current: 0,
  119. queryForm: {
  120. status: 1
  121. }
  122. }
  123. },
  124. onLoad(op) {
  125. this.findRecruitSearch();
  126. },
  127. onReachBottom() {
  128. var obj = this.tabList[this.current]
  129. if (obj.list.length < obj.recordsTotal) {
  130. this.myLoadmore();
  131. }
  132. },
  133. methods: {
  134. popupShowtrue(){
  135. this.$refs.pop.show();
  136. },
  137. queryBtn(queryForm){
  138. this.$refs.pop.hide();
  139. this.current = 0;
  140. this.tabList[this.current].list=[]
  141. this.tabList[this.current].pageIndex = 1;
  142. queryForm.status=1
  143. this.queryForm=queryForm
  144. this.findRecruitSearch()
  145. },
  146. myLoadmore() {
  147. this.tabList[this.current].pageIndex += 1;
  148. this.findRecruitSearch();
  149. },
  150. findRecruitSearch(){
  151. uni.showLoading({
  152. title: "加载中",
  153. mask: true,
  154. })
  155. var list = this.tabList[this.current].list
  156. var obj = this.tabList[this.current]
  157. var listForm = {
  158. ...obj,
  159. ...this.queryForm
  160. }
  161. delete listForm.list
  162. API.findRecruitSearch(listForm).then((res) => {
  163. if (listForm.pageIndex == 1) {
  164. list = res.data.data;
  165. } else {
  166. list = [
  167. ...list,
  168. ...res.data.data
  169. ];
  170. }
  171. this.tabList[this.current].list = list
  172. this.tabList[this.current].recordsTotal = res.data.recordsTotal;
  173. uni.hideLoading();
  174. }).catch(error => {
  175. uni.showToast({icon: 'none',
  176. title: error,
  177. icon: "none"
  178. })
  179. })
  180. },
  181. customBack() {
  182. },
  183. // 执行搜索
  184. doSearch(searchQuery) {
  185. //.log('searchQuery', searchQuery);
  186. },
  187. change(index) {
  188. this.current = index;
  189. var list = this.tabList[this.current].list
  190. if (list.length == 0) {
  191. this.findRecruitSearch();
  192. }
  193. },
  194. close(){},
  195. reset(queryForm) {
  196. this.queryBtn(queryForm)
  197. }
  198. }
  199. }
  200. </script>
  201. <style>
  202. page {
  203. background: #F0F0F2;
  204. padding-bottom: 50px;
  205. }
  206. </style>
  207. <style lang="scss" scoped>
  208. .search {
  209. background-color: #fff;
  210. padding: 16rpx 32rpx;
  211. .search-box {
  212. border-radius: 50px;
  213. height: 72rpx;
  214. line-height: 72rpx;
  215. }
  216. }
  217. // 搜索结果
  218. .result {
  219. background-color: #fff;
  220. .tabs {
  221. padding-right: 32rpx;
  222. display: flex;
  223. justify-content: space-between;
  224. align-items: center;
  225. border-bottom: 1px solid #f1f1f1;
  226. .left {
  227. width: 33%;
  228. /deep/.u-tabs {
  229. background-color: #fff !important;
  230. }
  231. }
  232. .screen {
  233. display: flex;
  234. align-items: center;
  235. color: rgba(39, 149, 253, 1);
  236. font-size: 16px;
  237. img {
  238. width: 16px;
  239. height: 16px;
  240. vertical-align: middle;
  241. margin-right: 4rpx;
  242. }
  243. }
  244. }
  245. .result-item {
  246. padding: 24rpx 0;
  247. margin: 0 32rpx;
  248. display: flex;
  249. border-bottom: 1px solid #f1f1f1;
  250. // 照片
  251. .photo {
  252. width: 96rpx;
  253. height: 96rpx;
  254. overflow: hidden;
  255. border-radius: 50px;
  256. border: 1px solid rgba(255, 255, 255, 1);
  257. img {
  258. width: 100%;
  259. height: 100%;
  260. }
  261. }
  262. .content {
  263. margin-left: 24rpx;
  264. flex: 1;
  265. // 职位薪水
  266. .top {
  267. display: flex;
  268. justify-content: space-between;
  269. align-items: center;
  270. font-size: 36rpx;
  271. .position {
  272. color: rgba(16, 16, 16, 1);
  273. font-family: 'PingFangSC-medium';
  274. }
  275. .salary {
  276. color: rgba(255, 61, 0, 1);
  277. font-size: 32rpx;
  278. }
  279. }
  280. // 发布人
  281. .issuer {
  282. margin-top: 8rpx;
  283. }
  284. // 标签和时间
  285. .bottom {
  286. display: flex;
  287. justify-content: space-between;
  288. align-items: center;
  289. margin-top: 12rpx;
  290. .tags {
  291. display: flex;
  292. flex-wrap: wrap;
  293. .tag-item {
  294. padding: 0 10rpx;
  295. height: 36rpx;
  296. line-height: 36rpx;
  297. border-radius: 4px;
  298. background-color: rgba(241, 241, 247, 1);
  299. color: rgba(129, 127, 153, 1);
  300. font-size: 24rpx;
  301. text-align: center;
  302. margin-right: 8rpx;
  303. }
  304. .tag-item2 {
  305. background-color:rgb(70, 150, 246);
  306. color: #fff;
  307. }
  308. }
  309. .date {
  310. color: rgba(153, 153, 153, 1);
  311. font-size: 24rpx;
  312. }
  313. }
  314. }
  315. }
  316. }
  317. /deep/.u-close--top-right {
  318. top: 44rpx;
  319. }
  320. </style>