choreInformation.vue 7.2 KB

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