Pārlūkot izejas kodu

招聘就业工作年限修改

zaijin 2 gadi atpakaļ
vecāks
revīzija
758f0fb52e
1 mainītis faili ar 46 papildinājumiem un 8 dzēšanām
  1. 46 8
      h5_web/pages/recruitment/recruitment.vue

+ 46 - 8
h5_web/pages/recruitment/recruitment.vue

@@ -8,11 +8,13 @@
 		<!-- <u-navbar title-color="#FFFFFF" :customBack="navbarCustomBack" :bpay-bottom="false" back-icon-color="#FFFFFF"
 			:background="{background: '#3D5D4C' }" title="招聘就业" class="recruitment-unavbar" /> -->
 		<z-paging ref="recruitmentPaging" v-model="recruitmentJobList" @query="recruitmentQueryList">
-			<u-navbar slot="top" back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
+			<u-navbar slot="top" back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }"
+				:border-bottom="false"></u-navbar>
 			<!-- ###################################-- 轮播图 -- ################################### -->
 			<view class="recruitment-banner" slot="top">
 				<u-swiper :list="bannerList" name="bannerUrl" border-radius="0" mode="round" height="300"
-					img-mode="scaleToFill" @click="swiperClick" :mode="bannerList.length > 1 ? 'round' : 'none'"></u-swiper>
+					img-mode="scaleToFill" @click="swiperClick" :mode="bannerList.length > 1 ? 'round' : 'none'">
+				</u-swiper>
 			</view>
 
 			<!-- ###################################-- 请输入您关键词 -- ################################### -->
@@ -44,9 +46,11 @@
 										<view class="img">
 											<!-- <u-image :src="recommendItem.logoUrl" mode="aspectFill" width="140"
 												height="140" border-radius="10" /> -->
-											<u-image :src="recommendItem.logoUrl" width="140" height="140" border-radius="10" mode="aspectFill">
+											<u-image :src="recommendItem.logoUrl" width="140" height="140"
+												border-radius="10" mode="aspectFill">
 												<view slot="error">
-													<u-image src="../../static/img/default-company.png" width="140" height="140" border-radius="10" mode="aspectFill"/>
+													<u-image src="../../static/img/default-company.png" width="140"
+														height="140" border-radius="10" mode="aspectFill" />
 												</view>
 											</u-image>
 										</view>
@@ -82,9 +86,11 @@
 					<view class="dataarea-card-left">
 						<!-- <u-image :src="item.companyLogoUrl" mode="aspectFill" width="120" height="120"
 							border-radius="10" /> -->
-						<u-image :src="item.companyLogoUrl" width="120" height="120" border-radius="10" mode="aspectFill">
+						<u-image :src="item.companyLogoUrl" width="120" height="120" border-radius="10"
+							mode="aspectFill">
 							<view slot="error">
-								<u-image src="../../static/img/default-company.png" width="120" height="120" border-radius="10" mode="aspectFill"/>
+								<u-image src="../../static/img/default-company.png" width="120" height="120"
+									border-radius="10" mode="aspectFill" />
 							</view>
 						</u-image>
 					</view>
@@ -92,7 +98,8 @@
 						<view class="dataarea-content-left">
 							<view>{{item.postName}}</view>
 							<view class="content">
-								{{ item.areaName }}|经验{{ item.workYear }}年|{{ getEducationBg(item.educationBg) }}
+								{{ item.areaName }}|
+								{{ getDictsLabel(workYearList, item.workYear) }}|{{ getEducationBg(item.educationBg) }}
 							</view>
 							<view>{{item.companyName}}</view>
 						</view>
@@ -128,7 +135,8 @@
 					name: '最新',
 					text: '1'
 				}],
-				degrEducList: []
+				degrEducList: [],
+				workYearList: []
 			}
 		},
 		onLoad() {
@@ -157,6 +165,18 @@
 						});
 					}
 				});
+				this.$u.api.getDictdataUrl({
+					key: 'work_year'
+				}).then(res => {
+					if (res.code == 200) {
+						this.workYearList = res.data.map(item => {
+							return {
+								...item,
+								value: item.text
+							}
+						});
+					}
+				});
 			},
 			/**
 			 * 获取教育等级名称
@@ -305,6 +325,24 @@
 						id: param?.id
 					}
 				});
+			},
+			/**
+			 * 通过value获取label
+			 * @param {Object} list
+			 * @param {Object} value
+			 */
+			getDictsLabel(list, value) {
+				let label = '-';
+				try {
+					list.forEach(item => {
+						if (Number(item.text) === Number(value)) {
+							throw (item)
+						}
+					})
+				} catch (e) {
+					label = e.label
+				}
+				return label
 			}
 		}
 	}