<template>
	<view style="background-color: #f2f2f7;">
		<global-push-ad />
		<!-- <template v-if="XCXIsSelect != '是'">
			<view class="banner flex justify-center">
				<view class="banner-box">
					<swiper :indicator-dots="false" style="width: 100%;height: 100%;" :autoplay="true" :interval="300"
						:duration="1000">
						<swiper-item v-for="(item, index) in bannerList" :key="index" @click="goNave(item.url)">
							<view class="swiper-item" style="width: 100%;height: 100%;">
								<image :src="item.imageUrl" style="width: 100%;height: 100%;border-radius: 24rpx;"
									mode="scaleToFill"></image>
							</view>
						</swiper-item>
					</swiper>
				</view>
			</view>
			<view class="" style="width: 100%;margin-top: 20rpx;" v-for="(item, index) in dataList" :key="index">
				<view class=""
					style="padding: 20rpx 20rpx;width: 686rpx;background-color: #ffffff;border-radius: 18rpx;margin: auto;">
					<view class="">
						<text>{{ item.company ? item.company.companyName : '' }}</text>信息简介
					</view>
					<view class="flex flex-wrap" style="margin-top: 20rpx;">
						<text
							style="color: #666666;font-size: 26rpx;padding: 10rpx 25rpx 10rpx 25rpx;background-color: #F6F6F6;border-radius: 8rpx;margin-right: 20rpx;margin-bottom: 20rpx;"
							v-for="(ite, ind) in item.positionWelfare" :key="ind">{{ ite }}</text>
					</view>
					<view class="" style="margin-top: 20rpx;">
						<text>{{ item.company ? item.company.companyName : '' }}提供数据支持</text>
					</view>
				</view>
			</view>
		</template> -->
		<template v-if="isShowDefaultPage">
			<!---------------------------------------- 陈列页 -------------------------------------------------------->
			<view class="page-container" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
				<image class="top-bg" src="/static/images/index/index-bg.svg" mode="aspectFill" />
				<scroll-view
					scroll-y="true"
					class="default-scroll-view"
					:style="{ height: `calc(100vh - 12px - ${statusBarHeight}px)` }"
					refresher-enabled="true"
					:refresher-threshold="80"
					refresher-background=""
					refresher-default-style="white"
					:refresher-triggered="isRefreshing"
					@refresherrefresh="handlePullDownRefresh"
					@refresherpulling="onPullingDown"
					@scrolltolower="loadMore"
					scroll-with-animation="true"
				>
					<view class="recommend-section">
						<view class="recommend-title flex align-center justify-between">
							<view class="recommend-title-l">热门企业</view>
							<view class="recommend-title-r" @click="refreshRecommendCompany">
								<text>换一批推荐</text>
								<image src="/static/images/svg/refresh-arrow.svg" class="refresh-icon"></image>
							</view>
						</view>
						
						<view class="recommend-company-wrapper">
							<view
								class="recommend-company-item flex"
								v-for="company in recommendHostCompanys"
								:key="company.companyId"
								@click="toCompanyPage(company.companyId)"
							>
								<image :src="company.companyLogo ? company.companyLogo : '/static/images/logo.jpg'" class="company-img"></image>
								<view class="recommend-company-info-wrapper">
									<view class="recommend-company-name">{{ company.companyName }}</view>
									<view class="tip">{{ company.companyPeople }} · {{ company.isCrossCompany ? '跨境电商' : '' }} {{ company.workTime }}</view>
									<view class="tip">{{ company.welfare }}</view>
									<view class="positions flex align-center">
										<image src="/static/images/svg/tie.svg" class="position-icon"></image>
										<view class="position-text">
											{{ company.postPushRuleNames }}
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
					
					<view class="position-title">
						<text>精选职位</text>
					</view>
					
					<view class="position-list">
						<view class="gwList-box">
							<view class="gwList-box-item flex justify-center" @click="gotoInfo(item.postPushId)"
								v-for="item in recommendPositions" :key="item.postPushId">
								<view class="gwList-box-item-box">
									<!-- 标题-薪资 -->
									<view class="gwList-box-item-box-title flex justify-between align-center">
										<view class="title-left flex align-center">
											<view class="job-title-text"
												style="max-width: 450rpx;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;">
												<template>
													{{ item.ruleClassifyName }}
												</template>
											</view>
											<view v-if="item.isDue == 1" class="salary-text-box">
												<image src="../../static/images/index/jipinIcom.svg"
													class="jipin-icon" />
												<text class="jipin-text">急聘</text>
											</view>
										</view>
										<view>
											<text class="clip-color">{{ item.salaryRange }}</text>
											<text class="clip-color"> · </text>
											<text class="clip-color">{{ item.salaryTimes }}</text>
										</view>
									</view>
									<!-- 公司名称-公司人数 -->
									<view class="flex align-center justify-between">
										<view class="gwList-box-item-box-name flex align-center">
											<text class="company-name company-name-overflow">{{ item.companyName }}</text>
											<text class="company-people">{{ item.companyPeople ?
												item.companyPeople : '0人' }}</text>
										</view>
										<view class="experience">
											<text>{{ item.experience }}</text>
											<text>{{ item.education }}</text>
										</view>
									</view>
									<!-- 福利标签 -->
									<view class="benefits" v-if="item.welfareTag">{{ item.welfareTag }}</view>
									<!-- 职位标签 -->
									<view class="gwList-box-item-box-label flex align-center flex-wrap">
										<text class="job-tag" v-for="(tag, i) in item.positionTag || []"
											:key="i">{{ tag }}</text>
									</view>
									<!-- 公司简介-位置 -->
									<view class="gwList-box-item-box-info flex justify-between align-center">
										<view class="gwList-box-item-box-info-l flex align-center">
											<view class="user-image">
												<image
													:src="item.hr && item.hr.hrImg ? item.hr.hrImg : '../../static/images/logo.jpg'" class="hr-avatar">
												</image>
												<view class="online-status"
													:style="{ 'background-color': item.user && item.user.onlineStatus == 'ONLINE' ? '#00DD9A' : '#999' }">
												</view>
											</view>
											<view class="company-info-text">
												{{ item.user && item.user.userName || '未知' }}·{{ item.hr &&
													item.hr.hrPosition || '未知' }}
											</view>
											<view v-if="item.respondTime" class="reply-time">{{ item.respondTime }}
											</view>
										</view>
										<view class="location-text">
											{{ item.distance }} {{ item.county }}
										</view>
									</view>
								</view>
							</view>
							<nomore v-if="!loadingRecommendPosition"></nomore>
						</view>
					</view>
				</scroll-view>
			</view>
		</template>
		<template v-else>
			<!---------------------------------------- 求职端 -------------------------------------------------------->
			<view v-if="userType == 1" class="page-container" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">

				<view class="topbg-sticky">
					<image class="top-bg" src="/static/images/index/index-bg.svg" mode="aspectFill" />
					<!-- 标题-搜索 -->
					<view class="topbg-sticky-box">
						<view class="topbg-sticky-title flex justify-between align-center">
							<view class="topbg-sticky-title-left flex align-center">
								<image src="../../static/images/index/xingIcon.svg" class="xing-icon" />
								<view>亿职赞，愿你在追梦路上找到心仪工作</view>
							</view>
							<view class="topbg-sticky-title-right flex align-center"
								@click="goNavs('/package/search/search')">
								<u-icon name="search" color="#ffffff" size="32"></u-icon>
							</view>
						</view>
					</view>

					<!-- tabs和筛选 -->
					<view class="topbg-type flex justify-center">
						<view class="topbg-type-box">
							<!-- 第一行：tabs -->
							<view class="topbg-type-box-row flex justify-between align-center">
								<view class="topbg-type-box-l flex align-center">
									<view class="topbg-type-box-l-i" :class="current == index ? 'i-active' : ''"
										@tap="current = index" v-for="(item, index) in typeList" :key="index">
										{{ item.label }}
									</view>
								</view>
								<!-- 添加求职意向 -->
								<view class="topbg-yx-box-r flex align-center" @click="addDirection">
									<image src="../../static/images/index/Attachment.svg" class="attachment-icon" />
								</view>
							</view>
							
							<view class="topbg-search flex justify-between align-center">
								<view class="topbg-search-l flex align-center">
									<view class="topbg-search-item topbg-search-item__active flex align-center" @click="openTagPopup">
										<text class="topbg-search-item__text">{{ selectTagText ? selectTagText : '跨境标签' }}</text>
										<u-icon name="arrow-down"></u-icon>
									</view>
									<view
										class="topbg-search-item mr-4"
										:class="{ 'topbg-search-item__active': currentSx == 1 }"
										@click="handleChangeSx"
									>最新</view>
								</view>
								
								<view class="topbg-search-r flex align-center">
									<view class="topbg-search-item topbg-search-item__active flex align-center" @click="getLocalJobs('go')">
										<text class="topbg-search-item__text">{{ county ? county : city ? city : '选择地区'
										}}</text>
										<u-icon name="arrow-down"></u-icon>
									</view>
									<view
										class="topbg-search-item mr-4"
										:class="{ 'topbg-search-item__active': filledFieldsCount }"
										@click="goNavs('/package/screen/screen')"
									>
										筛选{{ filledFieldsCount }}
										<u-icon name="arrow-down" :color="filledFieldsCount ? '#016bf6' : '#999999'"></u-icon>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<!-- 岗位推荐 -->
				<template v-if="current != typeList.length - 1">
					<view class="gwList flex justify-center" v-if="dataList.length > 0">
						<view class="gwList-box">
							<scroll-view scroll-y="true" style="width: 100%;height: 100%;" refresher-enabled="true"
								:refresher-threshold="80" refresher-background="#F2F2F7" refresher-default-style="white"
								:refresher-triggered="isRefreshing" @refresherrefresh="handlePullDownRefresh"
								@refresherpulling="onPullingDown" @scrolltolower="loadMore"
								scroll-with-animation="true">
								<view class="gwList-box-item flex justify-center" @click="gotoInfo(item.postPushId)"
									v-for="(item, index) in dataList" :key="index">
									<view class="gwList-box-item-box">
										<!-- 标题-薪资 -->
										<view class="gwList-box-item-box-title flex justify-between align-center">
											<view class="title-left flex align-center">
												<view class="job-title-text"
													style="max-width: 450rpx;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;">
													<template>
														{{ item.ruleClassifyName }}
													</template>
												</view>
												<view v-if="item.isDue == 1" class="salary-text-box">
													<image src="../../static/images/index/jipinIcom.svg"
														class="jipin-icon" />
													<text class="jipin-text">急聘</text>
												</view>
											</view>
											<view>
												<text class="clip-color">{{ item.salaryRange }}</text>
												<text class="clip-color"> · </text>
												<text class="clip-color">{{ item.salaryTimes }}</text>
											</view>
										</view>
										<!-- 公司名称-公司人数 -->
										<view class="flex align-center justify-between">
											<view class="gwList-box-item-box-name flex align-center">
												<text class="company-name company-name-overflow">{{ item.company ?
													item.company.companyName : '' }}</text>
												<text class="company-people" v-if="item.company">{{ item.company ?
													item.company.companyPeople : '0人' }}</text>
											</view>
											<view class="experience">
												<text>{{ item.experience }}</text>
												<text>{{ item.education }}</text>
											</view>
										</view>
										<!-- 福利标签 -->
										<view class="benefits" v-if="item.welfareTag">{{ item.welfareTag }}</view>
										<!-- 职位标签 -->
										<view class="gwList-box-item-box-label flex align-center flex-wrap">
											<text class="job-tag" v-for="(ite, ind) in item.positionTag || []"
												:key="ind">{{ ite }}</text>
										</view>
										<!-- 公司简介-位置 -->
										<view class="gwList-box-item-box-info flex justify-between align-center">
											<view class="gwList-box-item-box-info-l flex align-center">
												<view class="user-image">
													<image
														:src="item.hr && item.hr.hrImg ? item.hr.hrImg : '../../static/images/logo.jpg'" class="hr-avatar">
													</image>
													<view class="online-status"
														:style="{ 'background-color': item.user && item.user.onlineStatus == 'ONLINE' ? '#00DD9A' : '#999' }">
													</view>
												</view>
												<view class="company-info-text">
													{{ item.user && item.user.userName || '未知' }}·{{ item.hr &&
														item.hr.hrPosition || '未知' }}
												</view>
												<view v-if="item.respondTime" class="reply-time">{{ item.respondTime }}
												</view>
											</view>
											<view class="location-text">
												{{ item.distance }} {{ item.county }}
											</view>
										</view>
									</view>
								</view>
								<nomore v-if="dataList.length > 0 && page >= totlo"></nomore>
							</scroll-view>
						</view>
					</view>
					<!-- 暂无数据 -->
					<view class="gwList" v-else>
						<empty />
					</view>
				</template>

				<view class="companyListBox" v-if="current == typeList.length - 1 && companList.length > 0">
					<companyListIndex @goInfo="goInfo" :item="item" v-for="(item, index) in companList" :key="index" />
				</view>

				<view class="gwList" v-if="current == typeList.length - 1 && companList.length == 0">
					<empty />
				</view>
			</view>

			<!---------------------------------------- 招聘端 -------------------------------------------------------->
			<view v-else class="page-container" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
				<image class="top-bg" src="/static/images/index/index-bg.svg" mode="aspectFill" />
				<view class="topbg-sticky">
					<!-- 标题-搜索 -->
					<view class="topbg-sticky-box">
						<view class="topbg-sticky-title flex justify-between align-center">
							<view class="topbg-sticky-title-left flex align-center">
								<image src="../../static/images/index/xingIcon.svg" class="xing-icon" />
								<view>亿职赞，愿你在逐梦路上找到心仪伙伴</view>
							</view>
						</view>
					</view>
				</view>
				
				<!-- tabs和筛选 -->
				<view class="topbg-type flex justify-center">
					<view class="topbg-type-box">
						<!-- 岗位 -->
						<view class="topbg-type-box-row flex justify-between align-center">
							<view class="topbg-type-box-l flex align-center">
								<view class="topbg-type-box-l-i" :class="currentJobSx == index ? 'i-active' : ''"
									@tap="selectJob(item, index)" v-for="(item, index) in jobSxTypeList" :key="index">
									{{ item.name }}
								</view>
							</view>
							<!-- 添加岗位招聘 -->
							<view class="topbg-yx-box-r flex align-center" @click="goNavss('/pages/my/jobPosting?companyId=' + companyId + '&status=' + companyStatus + '&companyName=' + companyName)">
								<image src="../../static/images/index/Attachment.svg" class="attachment-icon" />
							</view>
						</view>
						
						<view class="topbg-search flex justify-between align-center">
							<view class="topbg-search-l flex align-center">
								<view class="topbg-search-item topbg-search-item__active flex align-center" @click="openTagPopup">
									<text class="topbg-search-item__text">{{ selectTagText ? selectTagText : '跨境标签' }}</text>
									<u-icon name="arrow-down"></u-icon>
								</view>
								<view
									class="topbg-search-item mr-4"
									:class="{ 'topbg-search-item__active': currentJobSxs == 1 }"
									@click="handleChangeSx"
								>最新</view>
							</view>
							
							<view class="topbg-search-r flex align-center">
								<view class="topbg-search-item topbg-search-item__active flex align-center" @click="getLocalJobs('go', true)">
									<text class="topbg-search-item__text">{{ county ? county : city ? city : '选择地区'
									}}</text>
									<u-icon name="arrow-down"></u-icon>
								</view>
								<view
									class="topbg-search-item mr-4"
									:class="{ 'topbg-search-item__active': filledFieldsCount }"
									@click="goNavs('/package/screen/screen?type=2')"
								>
									筛选{{ filledFieldsCount }}
									<u-icon name="arrow-down" :color="filledFieldsCount ? '#016bf6' : '#999999'"></u-icon>
								</view>
							</view>
						</view>
					</view>
				</view>

				<!-- 简历列表 -->
				<view class="qyList flex justify-center">
					<view class="qyList-box" v-if="datasList.length > 0">
						<scroll-view scroll-y="true" style="width: 100%;height: 100%;" refresher-enabled="true"
							:refresher-threshold="80" refresher-background="#F2F2F7" refresher-default-style="white"
							:refresher-triggered="isRefreshing" @refresherrefresh="handlePullDownRefresh"
							@refresherpulling="onPullingDown" @scrolltolower="loadMore" scroll-with-animation="true">
							<view
								class="qyList-box-item flex"
								v-for="(item, index) in datasList"
								:key="index"
								@click="goNav('/pages/talentSearch/resumeDetail?resumesId=' + item.resumesId + '&postPushId=' + (jobSxTypeList.length > 0 ? jobSxTypeList[currentJobSx].id : ''), 'company')"
							>
								<view class="qyList-box-item-box">
									<view class="qyList-box-item-info flex align-center">
										<view class="qyList-box-item-info-r">
											<image :src="item.userAvatar ? item.userAvatar : '../../static/images/logo.jpg'" class="avatar" mode="aspectFill"></image>
											<image src="@/static/images/svg/male.svg" v-if="item.userSex == 1" class="sex-icon"></image>
											<image src="@/static/images/svg/female.svg" v-else-if="item.userSex == 2" class="sex-icon"></image>
										</view>
										<view class="qyList-box-item-info-l">
											<view class="flex align-center justify-between">
												<view class="flex align-center">
													<view class="user-name">{{ item.userName }}</view>
													<view class="status-tag online-minutes" v-if="item.onlineMinutes">{{ item.onlineMinutes }}</view>
													<view class="status-tag online-status" v-if="item.browseTag">{{ item.browseTag }}</view>
												</view>
												<text class="clip-color" v-if="item.salaryRange">{{ item.salaryRange }}</text>
											</view>
											<view class="base-info flex align-center">
												<text v-for="(baseItem, i) in item.baseInfoArr" :key="i">{{ baseItem }}</text>
											</view>
										</view>
									</view>
									
									<view class="flex align-center justify-between company-info">
										<view class="flex align-center">
											<image src="@/static/images/svg/bag.svg" class="icon"></image>
											<view class="company-text">{{ item.companyName }} · {{ item.lastWorkPosition }}</view>
											<view class="company-tag" v-if="item.isCrossCompany">跨境</view>
										</view>
										<view class="time">{{ item.lastWorkTime }}</view>
									</view>
									<view class="tags">
										<view class="tag" v-for="(skill, i) in parseSkills(item.intentIndustry)" :key="i">{{ skill }}</view>
									</view>
									<view class="bottom-section flex align-center justify-between">
										<view class="flex align-center">
											<image src="@/static/images/svg/heart.svg" class="expection-icon"></image>
											求职期望：{{ item.expectedPosition }}											
										</view>
										<view class="has-view" v-if="item.isChatColleague">同事已看</view>
									</view>
								</view>
							</view>
							<nomore v-if="datasList.length > 0 && page >= totlo"></nomore>
						</scroll-view>
					</view>
					<view class="qyList-box" v-else>
						<empty :isShow="false" v-if="datasList.length == 0" style="margin-top: 240rpx" />
					</view>
				</view>
			</view>
		</template>
		
		<!-- 跨境标签popup -->
		<u-popup v-model="showTagPopup" mode="top" border-radius="14">
			<view class="tag-popup-container" :style="{ paddingTop: (18 + statusBarHeight) + 'px' }">
				<view class="tag-popup-title">我的跨境标签</view>
				<view class="tag-popup-tip">根据您的跨境标签，为您推荐{{ isJobHunting ? '更匹配的职位' : '更匹配的牛人' }}</view>
				<view class="tag-popup-section" v-for="(tag, index) in tags" :key="index">
					<view class="tag-popup-sub-title">{{ tag.postSkillName }}</view>
					<view class="tag-wrapper">
						<view
							class="tag"
							:class="{ 'tag-select-active': judgeSelectTags(item) }"
							v-for="item in tag.childrenList" :key="item.postSkillId"
							@click="handleSelectTag(item)"
						>{{ item.postSkillName }}</view>
					</view>
				</view>
				<view class="tag-popup-buttons">
					<view class="tag-popup-button" @click="handleResetTags">重置</view>
					<view class="tag-popup-button main-button" @click="handleSearch">搜索</view>
				</view>
			</view>
		</u-popup>

		<view v-if="goback == true" class="goback" @click="gotoBack">
			<image style="width: 88rpx;height: 88rpx;border-radius: 50%;" src="../../static/images/up.jpg" mode="">
			</image>
		</view>
		<u-popup mode="top" ref="permission">
			<view class="popup-content">
				<view class="popup-text-permission">获取位置需要定位权限，用于推荐同城的求职岗位或牛人</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
import empty from '../../components/empty.vue'
import nomore from '../../components/nomore.vue'
import permision from '@/js_sdk/wa-permission/permission.js'
import companyListIndex from '@/components/companyListIndex/companyListIndex.vue'
import { formatNumberToK } from '@/utils/util.js'
import { debounce } from '@/utils/util'
export default {
	components: {
		empty,
		companyListIndex,
		nomore
	},
	data() {
		return {
			statusBarHeight: 0, // 状态栏高度
			enable: true, //开启吸顶
			goback: false,
			county: '', //区
			city: '',
			companyName: "",
			companyId: "",
			datasList: [],
			isfixeds: false,
			userType: 1,
			dataList: [],
			current: 0,
			typeList: [],
			isRefreshing: false,
			currentSx: 0,
			sxTypeList: [{
				id: 1,
				name: '推荐',
			},
			{
				id: 2,
				name: '最新',
			}
			],
			currentjob: 0,
			jobTypeList: [{
				projectName: '',
				name: '全部',
			},],
			currentJobSx: 0,
			jobSxTypeList: [{
				projectName: '',
				name: '全部',
			}],
			currentJobSxs: 0,
			// jobSxsTypeList: [{
			// 	id: 1,
			// 	name: '跨境标签',
			// },
			// {
			// 	id: 2,
			// 	name: '最新',
			// },
			// 	//{
			// 	// 	id: 2,
			// 	// 	name: '优选',
			// 	// }
			// ],
			token: '',
			page: 1,
			limit: 10,
			latitude: '',
			longitude: '',
			totlo: 0,
			education: '', //学历
			experience: '', //经验
			industry: '', //行业
			salaryRange: '', //薪资
			companyPeople: '', //公司规模
			preference: [],
			domeWidth: 0,
			showModal: true,
			arr: [],
			companyStatus: '',
			XCXIsSelect: '是',
			// bannerList: [], //企业端轮播图
			bannerListuser: [], //用户端轮播图
			gongao: [], //公告
			tuiguang: '', //分享标题
			bgImg: '', //分享图片
			companList: [], //公司列表
			directionList: [ //方向列表
				{
					id: '不限',
					name: '不限',
					ruleClassifyId:0
				}
			],
			// 招聘端标签
			positionTag:[
				{
					id: '不限',
					name: '不限',
				}
			],
			positionTagArr:[],
			preferenceChange:false,
			showTagPopup: false, // 跨境标签弹窗
			tags: [], // 跨境tags
			tempSelectTags: [], // 临时选择的跨境标签
			selectTags: [], // 选择的跨境标签
			expecteJobCount: -1, // 求职岗位数量
			findJobCount: -1, // 招聘岗位数量
			recommendHostCompanys: [], // 推荐热门公司
			loadingRecommendHostCompany: false,
			RCPage: 1,
			recommendPositions: [], // 精选职位
			loadingRecommendPosition: false,
			RPPage: 1,
			currentPostionCity: '', // 当前岗位城市（招聘端限制城市使用）
		};
	},
	onShareAppMessage(res) {
		return {
			path: '/pages/index/index?invitation=' + uni.getStorageSync(
				'invitationCode'), //这是为了传参   onload(data){let id=data.id;} 
			title: this.tuiguang,
			imageUrl: this.bgImg
		}
	},
	onShareTimeline(res) {
		return {
			path: '/pages/index/index?invitation=' + uni.getStorageSync(
				'invitationCode'), //这是为了传参  
			title: this.tuiguang,
			imageUrl: this.bgImg
		}
	},
	computed: {
		filledFieldsCount() {
			const fields = [this.education, this.experience, this.industry, this.salaryRange, this.companyPeople];
			const count = fields.filter(item => item).length;
			return count > 0 ? '·' + count : '';
		},
		// 选择的跨境标签文案
		selectTagText() {
			if (this.selectTags.length) {
				return this.selectTags.map(item => item.postSkillName).join('/')
			}
			return ''
		},
		// 判断是否是求职端
		isJobHunting() {
			return this.userType == 1
		},
		// 判断是否显示陈列页
		isShowDefaultPage() {
			// 1.求职端时没有期望岗位
			// 2.招聘端时没有招聘岗位
			if (
				(this.isJobHunting && this.expecteJobCount > 0) ||
				(!this.isJobHunting && this.findJobCount > 0)
			) {
				return false
			}
			return true
		},
		isLoading() {
			if (
				(this.isJobHunting && this.expecteJobCount > -1) ||
				(!this.isJobHunting && this.findJobCount > -1)
			) {
				return false
			}
			return true
		}
	},
	watch: {
		current(newData, oldData) {
			uni.showLoading({
				title: '加载中'
			})
			this.page = 1
			if (this.current == this.typeList.length - 1) { //公司
				this.getComanyList()
			} else {
				this.directionList=[ //方向列表
					{
						id: '不限',
						name: '不限',
						ruleClassifyId:0
					}
				]
				this.preferenceChange=false
				this.preference=[]
				this.industry=''
				this.getPostType()
			}
			
			// 情况选择条件
			this.selectTags = []
			// 求职岗位变更，自动请求对于的跨境标签数据
			this.getTagsData()
		},
		currentSx(newData, oldData) {
			uni.showLoading({
				title: '加载中'
			})
			this.page = 1
			this.getUserList();
		},
		currentjob(newData, oldData) {
			uni.showLoading({
				title: '加载中'
			})
			this.page = 1
			this.getUserList()
		},
		currentJobSx(newData, oldData) {
			uni.showLoading({
				title: '加载中'
			})
			this.page = 1
			this.getPeopList()

			// 招聘岗位变更，自动请求对于的跨境标签数据
			this.getTagsData()
		},
		currentJobSxs(newData, oldData) {
			uni.showLoading({
				title: '加载中'
			})
			this.page = 1
			this.getPeopList()
		},
		//监听userType的变化  如果有旧值跟新值不同  则把分页重置为初始状态，为了解决切换身份后数据分页错误的问题
		userType(newType, oldType) {
			if (newType != oldType) {
				this.page = 1
				if (this.userType == 1) {
					uni.showLoading({
						title: '加载中'
					})
					this.page = 1
					this.getUserList()
				} else {
					uni.showLoading({
						title: '加载中'
					})
					this.page = 1
					this.getCompanyClassify()
				}
			}
		},
		
		// 监听跨境标签弹窗显示
		showTagPopup(value) {
			if (value) {
				this.tempSelectTags = JSON.parse(JSON.stringify(this.selectTags))
			} else {
				this.tempSelectTags = []
			}
		}
	},
	onPageScroll(e) {
		if (e.scrollTop > 350) {
			this.goback = true
		} else {
			this.goback = false
		}
	},
	onLoad(e) {
		// 获取状态栏高度
		let systemInfo = uni.getSystemInfoSync();
		this.statusBarHeight = systemInfo.statusBarHeight || 0;
		this.companyId = uni.getStorageSync('companyId');
		// #ifdef APP
		/* this.getAudioPermision() */
		// #endif
		// 获取邀请码保存到本地
		if (e.invitation) {
			this.$queue.setData('inviterCode', e.invitation);
		}
		// #ifdef MP-WEIXIN
		if (e.scene) {
			const scene = decodeURIComponent(e.scene);
			this.$queue.setData('inviterCode', scene.split(',')[0]);
		}
		// #endif
		// this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
		// uni.showLoading({
		// 	title: '加载中'
		// })

		if (uni.getStorageSync('userType')) {
			this.userType = uni.getStorageSync('userType');
		}
		let that = this
		uni.$on('preferenceUpdated', (data) => {
			let prefer = []
			data.preferences.forEach(function (item) {
				var tem = {
					id: item,
					name: item,
					ruleClassifyId:that.typeList[that.current].id
				}
				prefer.push(tem)
			})
			let preference = this.preference;
			that.preference = preference.filter(item => data.preferences.includes(item));
			that.directionList = prefer
			that.preferenceChange=true
		})
		uni.$on("skillsUpdated", (data) => {
			console.log("接收到的职位技能数据：", data);
			let prefer = data.selectedTags.map(item => ({
				id: item,
				name: item
			}))
			prefer = prefer.filter(tag => tag.id !== '不限')
			prefer.unshift({ id: '不限', name: '不限' })

			// 更新当前岗位下的标签
			if (this.currentRuleClassifyId) {
				this.$set(this.positionTagMap, this.currentRuleClassifyId, prefer)
				this.positionTag = prefer
			}
		})


		//#ifdef H5
		this.getLocalJobs('');
		//#endif
		//#ifdef APP-PLUS
		const appAuthorizeSetting = uni.getAppAuthorizeSetting()
		if (appAuthorizeSetting.locationAuthorized == 'authorized')
			this.getLocalJobs('');
		//#endif
		this.getDomWidth()
		this.$Request.getT('/app/common/type/255').then(res => {
			if (res.code === 0) {
				if (res.data && res.data.value) {
					this.tuiguang = res.data.value;
				}
			}
		});
		if (this.userType == 1) { //用户邀请图
			this.$Request.getT('/app/banner/selectBannerList?state=-1&classify=5').then(res => {
				if (res.code === 0) {
					this.bgImg = res.data[0].imageUrl;
				}
			});
		} else { //企业邀请图
			this.$Request.getT('/app/banner/selectBannerList?state=-1&classify=6').then(res => {
				if (res.code === 0) {
					this.bgImg = res.data[0].imageUrl;
				}
			});
		}
		// 监听筛选条件触发getJobSearchList
		uni.$on('updateScreenFilterRecord', () => {
			//待处理
		})
		// uni.$on('city', data => {
		// 	that.city = data.city
		// 	uni.setStorageSync('city', that.city)
		// })
		uni.$on('filterCity', data => {
			console.log(data, '选择的市')
			that.city = data.city
			that.county = data.county
			uni.setStorageSync('city', that.city)
			this.page = 1
			that.getUserList();
		})
		uni.$on('updateIndexType', data => {
			this.page = 1
			this.getPostType()
		})
	},
	onUnload() {
		uni.$off('filterCity');
		uni.$off('preferenceUpdated')
		uni.$off('updateScreenFilterRecord')
		uni.$off('updateIndexType')
		uni.$off('skillsUpdated')
	},
	onHide() {
		//离开页面时关闭吸顶功能,用于处理h5环境运行下'bottom' of null报错的问题
		this.enable = false
	},
	onShow() {
		let that = this;
		// this.getBannerList()
		// this.getgridList()
		// this.getgonggaoList()
		// #ifdef MP-WEIXIN
		// this.$Request.get('/app/common/type/257').then(res => {
		// 	if (res.code == 0) {
		// 		// #ifdef MP-WEIXIN
		// 		this.XCXIsSelect = res.data.value
		// 		// #endif
		// 		// #ifndef MP-WEIXIN
		// 		this.XCXIsSelect = '是'
		// 		// #endif
		// 	}
		// });
		// this.$Request.get('/app/common/type/238').then(res => {
		// 	if (res.code == 0) {
		// 		// #ifdef MP-WEIXIN
		// 		this.XCXIsSelect = res.data.value
		// 		// #endif
		// 		// #ifndef MP-WEIXIN
		// 		this.XCXIsSelect = '是'
		// 		// #endif
		// 	}
		// });
		// #endif


		this.enable = true
		if (uni.getStorageSync('userType')) {
			this.userType = uni.getStorageSync('userType');
		}

		this.token = uni.getStorageSync('token');
		const condition = this.$queue.getFilterData()
		this.education = condition.education //学历
		this.experience = condition.experience //经验
		this.industry = condition.industry //行业
		this.salaryRange = condition.salaryRange //薪资
		this.companyPeople = condition.companyPeople //公司规模

		// this.getPostType();
		// if (this.userType == 1) {
		// 	uni.setNavigationBarColor({
		// 		frontColor: '#ffffff',
		// 		backgroundColor: '#00DD9A'
		// 	})
		// } else {
		// 	uni.setNavigationBarColor({
		// 		frontColor: '#000000',
		// 		backgroundColor: '#F2F2F7'
		// 	})
		// }
		if (this.token) {
			this.getUserInfo();
			if (this.userType == 1) {
				this.getJobType();
			} else {
				this.jobTypeList = [{
					projectName: '',
					name: '全部',
				}]
				this.getCompanyClassify()
				this.getCompanyStatus()
			}
			this.$Request.getT('/app/common/type/310').then(res => { //消息未读提醒
				if (res.code == 0) {
					if (res.data && res.data.value) {
						this.arr.push(res.data.value)
					}
				}
			})
			this.$Request.getT('/app/common/type/337').then(res => { //预约成功通知(通用)
				if (res.code == 0) {
					if (res.data && res.data.value) {
						this.arr.push(res.data.value)
					}
				}
			})
			this.$Request.getT('/app/common/type/338').then(res => { //订单状态通知
				if (res.code == 0) {
					if (res.data && res.data.value) {
						this.arr.push(res.data.value)
					}
				}
			})
			// #ifdef MP-WEIXIN
			// if (this.showModal) {
			// 	this.openMsg()
			// }
			// #endif
		} else {
			this.jobTypeList = [{
				projectName: '',
				name: '全部',
			}]
		}
		if (this.city || true) {
			if (this.userType == 1) {
				if (this.current != this.typeList.length - 1) {
					this.getPostType(true);
				} else {
					this.getComanyList()
				}
			} else {
				this.getCompanyClassify()
			}
		}

	},
	methods: {
		calculateWorkDuration(start, end) {
			if (!start || !end) return ''
				
			const startDate = new Date(start)
			const endDate = new Date(end)
				
			if (endDate < startDate) return ''
				
			let years = endDate.getFullYear() - startDate.getFullYear()
			let months = endDate.getMonth() - startDate.getMonth()
				
			if (months < 0) {
				years -= 1
				months += 12
			}
				
			let result = ''
			if (years > 0) result += years + '年'
			if (months > 0) result += months + '个月'
				
			return result || '0个月'
		},
		parseSkills(str) {
			if (!str) return [];
		
			try {
				// ✅ 如果是多个 JSON 数组拼接：比如 ["A"],["B"]
				if (str.includes('],[')) {
					const wrapped = `[${str}]`; // 变成 [["A"],["B"]]
					const parsed = JSON.parse(wrapped);
					return [...new Set(parsed.flat())]; // 扁平化 + 去重
				}
		
				// ✅ 正常的单个 JSON 数组字符串
				const parsed = JSON.parse(str);
				if (Array.isArray(parsed)) {
					return [...new Set(parsed)];
				}
			} catch (e) {
				// 非 JSON 格式的情况继续往下处理
			}
		
			// ✅ 替换中文逗号
			str = str.replace(/，/g, ',');
		
			// ✅ 支持多种分隔符
			let arr = [];
			if (str.includes('/')) {
				arr = str.split('/');
			} else if (str.includes(',')) {
				arr = str.split(',');
			} else {
				arr = [str];
			}
		
			return [...new Set(arr.map(s => s.trim()).filter(Boolean))];
		},
		selectJob(job, index) {
			this.currentJobSx = index
			this.currentRuleClassifyId = job.ruleClassifyId
			this.positionTag = this.positionTagMap[job.ruleClassifyId] || [{ id: '不限', name: '不限' }]
			this.currentPostionCity = job.city
			this.city = job.city
			this.getDomWidth()
		},
		//下拉过程
		onPullingDown() {
			// 可以在这里处理下拉过程中的逻辑，比如显示下拉进度
		},
		//下拉刷新处理
		handlePullDownRefresh() {
			this.isRefreshing = true
			// 判断是否是陈列页
			if (!this.isShowDefaultPage) {
				this.page = 1
				if (this.userType == 1) {
					if (this.current != this.typeList.length - 1) {
						this.getUserList()
					} else {
						this.getComanyList()
					}
				} else {
					this.getPeopList()
				}				
			} else {
				this.RCPage = 1
				this.RPPage = 1
				this.getRecommendCompanys()
				this.getDefaultPositions()
			}
		},
		// 加载更多
		loadMore() {
			if (!this.isShowDefaultPage) {
				// 检查是否还有更多数据（当前页码小于总页数）
				if (this.page < this.totlo) {
					this.page += 1
					if (this.userType == 1) {
						if (this.current != this.typeList.length - 1) {
							this.getUserList()
						} else {
							this.getComanyList()
						}
					} else {
						this.getPeopList()
					}
				} else {
					// uni.showToast({
					// 	title: '已加载全部数据',
					// 	icon: 'none'
					// })
				}				
			} else if (this.total > this.recommendPositions.length) {
				this.RPPage++
				this.getDefaultPositions()
			}
		},
		//去企业详情
		goInfo(item) {
			uni.navigateTo({
				url: '/my/enterpriseInfo/enterpriseInfo?companyId=' + item.companyId
			})
		},
		// 
		async getLocalJobs(go = 'go', isBusiness = false) {
			// isBusiness：判断是否是招聘端，如果是则限制选择城市，以公司城市为准
			// #ifdef APP
			const hasLocation = await this.$queue.checkPermission(
				'location',
				'获取位置需要定位权限，用于推荐同城的求职岗位或牛人',
				this
			);
			if (!hasLocation) return this.goNav('/package/screen/city?city=' + this.city + '&county=' + this.county);
			// #endif
			this.getCity(go, isBusiness)
		},

		getCity(go = '', isBusiness = false) {
			var that = this
			// 权限通过，调用定位API
			uni.getLocation({
				type: 'wgs84', //wgs84  gcj02
				success: (res) => {
					console.log(res, '地理位置');
					that.latitude = res.latitude;
					that.longitude = res.longitude;
					if (that.$queue.array_column(that.sxTypeList, 'id').indexOf(3) < 0)
						that.sxTypeList.push({
							id: 3,
							name: '附近'
						})
					if (that.userType == 1) {
						that.getPostType()
					} else {
						that.getCompanyClassify()
					}
					if (isBusiness && this.currentPostionCity) {
						that.goNav(`/package/screen/city?city=${that.currentPostionCity}&county=${that.county}&type=search&onlyShowOneCity=true`)
						return
					}
					if (!uni.getStorageSync('city') || uni.getStorageSync('city') == '' || uni.getStorageSync('city') == null) {
						// #ifdef APP-PLUS
						if (res.address) {
							that.city = res.address.city
							if (go == 'go')
								that.goNav('/package/screen/city?city=' + that.city + '&county=' + that.county + '&type=' + 'search')
							return;
						} else {
							that.getSelectCity(that.longitude, that.latitude, go);
							return
						}
						// #endif
						// #ifndef APP
						that.getSelectCity(that.longitude, that.latitude, go);
						return
						// #endif
					} else {
						that.city = that.city ?? uni.getStorageSync('city')
						if (go == 'go') {
							that.goNav(`/package/screen/city?city=${that.city}&county=${that.county}&type=search&onlyShowOneCity=${ this.userType == 2 ? 'true' : '' }`)
						}
					}
				},
				fail: function () {
					console.log('获取地址失败');
					// 获取位置失败时也要关闭加载并调用数据接口
					uni.hideLoading()
					// 即使没有位置信息，也要加载数据
					if (that.userType == 1) {
						that.getPostType()
					} else {
						that.getCompanyClassify()
					}
					if (go == 'go')
						that.goNav('/package/screen/city?city=' + that.city + '&county=' + that.county + '&type=' + 'search')
				}
			})
		},


		//获取公司列表
		getComanyList() {
			let data = {
				page: this.page,
				limit: this.limit,
				city: this.city == '全国' ? '' : this.city, //城市
				companyScope: this.industry,
				companyPeople: this.companyPeople
			}
			this.$Request.getT('/app/company/listCompany', data).then(res => {
				uni.hideLoading()
				this.isRefreshing = false
				if (res.code == 0) {
					this.totlo = res.data.pages
					if (this.page == 1) {
						this.companList = res.data.records
					} else {
						this.companList = [...this.companList, ...res.data.records]
					}
					// this.companList = res.data
				} else {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					})
				}
			}).catch(err => {
				this.isRefreshing = false
				uni.hideLoading()
			})
		},
		// isSameName(className, name) {
		// 	let str1 = className.trim();
		// 	if (str2 == null)
		// 		return false;
		// 	let str2 = name.trim();
		// 	if (str1.length !== str2.length) {
		// 		return true;
		// 	}
		// 	return str1.toLowerCase() !== str2.toLowerCase();
		// },
		// //获取麦克风/摄像头权限
		// async getAudioPermision() {
		// 	let status = permision.isIOS ? await permision.judgeIosPermission("record") : await permision
		// 		.requestAndroidPermission("android.permission.RECORD_AUDIO")
		// 	let status2 = permision.isIOS ? await permision.judgeIosPermission("camera") : await permision
		// 		.requestAndroidPermission("android.permission.CAMERA")
		// 	if (status === null || status === 1 || status == true) { //已经同意授权
		// 		console.log('获取到权限了')

		// 	} else { //未授权的
		// 		this.popupshowsq = true
		// 	}
		// },
		// goNave(url) {
		// 	if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1 || url.indexOf('/package/') !== -1) {
		// 		uni.navigateTo({
		// 			url
		// 		});
		// 	} else {
		// 		//#ifndef H5
		// 		uni.navigateTo({
		// 			url: '/pages/index/webView?url=' + url
		// 		});
		// 		//#endif
		// 		//#ifdef H5
		// 		window.location.href = url;
		// 		//#endif	
		// 	}
		// },
		// //获取公告
		// getgonggaoList() {
		// 	if (!uni.getStorageSync('userType') || uni.getStorageSync('userType') == 1) {
		// 		this.$Request.get('/app/message/page/1/1/100').then(res => {
		// 			if (res.code == 0) {
		// 				let arr = []
		// 				res.data.list.map(item => {

		// 					if (item.type == 1) {
		// 						arr.push(item.title)
		// 					}
		// 				})
		// 				this.gongao = arr
		// 			} else {
		// 				this.gongao = []
		// 			}
		// 		})
		// 	} else if (uni.getStorageSync('userType') == 2) {
		// 		this.$Request.get('/app/message/page/1/1/100').then(res => {
		// 			if (res.code == 0) {
		// 				let arr = []
		// 				res.data.list.map(item => {
		// 					if (item.type == 2) {
		// 						arr.push(item.title)
		// 					}
		// 				})
		// 				this.gongao = arr
		// 			} else {
		// 				this.gongao = []
		// 			}
		// 		})
		// 	}

		// },

		// //获取bannerlist
		// getBannerList() {
		// 	if (!uni.getStorageSync('userType') || uni.getStorageSync('userType') == 1) {
		// 		this.$Request.get('/app/banner/selectBannerList?classify=1').then(res => {
		// 			if (res.code == 0) {
		// 				this.bannerListuser = res.data
		// 				this.bannerList = res.data
		// 			} else {
		// 				this.bannerListuser = [
		// 					'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fphoto%2F2007-11-7%2F200711072147151187.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1674883340&t=4b9cbb7796600699ac28f75cd138ba04'
		// 				]
		// 			}
		// 		})
		// 	} else if (uni.getStorageSync('userType') == 2) {
		// 		this.$Request.get('/app/banner/selectBannerList?classify=3').then(res => {
		// 			if (res.code == 0) {
		// 				this.bannerList = res.data
		// 			} else {
		// 				this.bannerList = [
		// 					'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fphoto%2F2007-11-7%2F200711072147151187.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1674883340&t=4b9cbb7796600699ac28f75cd138ba04'
		// 				]
		// 			}
		// 		})
		// 	}

		// },
		goNavss(url) {
			if (this.companyStatus) {
				if (this.companyStatus == 1) {
					uni.showToast({
						title: '企业认证审核中，请审核通过后操作!',
						icon: 'none'
					})
					return
				}
				if (this.companyStatus == 3) {
					uni.showToast({
						title: '企业认证审核未通过，请重新认证!',
						icon: 'none'
					})
					return
				}
				uni.navigateTo({
					url: url
				})

			} else {
				uni.showModal({
					title: '提示',
					content: '还未完成企业认证，请完成企业认证后操作',
					complete(ret) {
						if (ret.confirm) {
							uni.navigateTo({
								url: '/pages/my/businessLicense'
							})
						}
					}
				})
			}
		},
		//获取企业认证状态(1:审核中 2:通过 3:拒绝)
		getCompanyStatus() {
			this.$Request.get("/app/company/selectCompanyByUserId").then(res => {
				if (res.code == 0 && res.data) {
					this.companyStatus = res.data.status
					this.companyId = res.data.companyId
					this.companyName = res.data.companyAllName
					uni.setStorageSync('companyStatus', this.companyStatus)
					uni.setStorageSync('companyId', res.data.companyId)
					this.companyId = this.companyId
					// if (this.companyStatus == 1) {
					// 	uni.showModal({
					// 		title: '提示',
					// 		content: '企业正在认证审核中。',
					// 		showCancel: false,
					// 		complete(ret) {
					// 			if (ret.confirm) {
					// 				uni.navigateTo({
					// 					url: "/package/jobIntention/underReview"
					// 				});
					// 			}
					// 		}
					// 	})
					// }
					// if (this.companyStatus == 3) {
					// 	uni.showModal({
					// 		title: '提示',
					// 		content: '企业认证被拒绝。请修改',
					// 		complete(ret) {
					// 			if (ret.confirm) {
					// 				uni.navigateTo({
					// 					url: "/package/jobIntention/underReview"
					// 				});
					// 			}
					// 		}
					// 	})

					// }



				} else {
					this.companyStatus = ''
				}

			})
		},
		// // 开启订阅消息
		// openMsg() {
		// 	console.log('订阅消息')
		// 	var that = this
		// 	uni.getSetting({
		// 		withSubscriptions: true, //是否获取用户订阅消息的订阅状态，默认false不返回
		// 		success(ret) {
		// 			console.log(ret.subscriptionsSetting, '------------------')
		// 			// if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
		// 			if (ret.subscriptionsSetting.itemSettings) {
		// 				uni.setStorageSync('sendMsg', true)
		// 				uni.openSetting({ // 打开设置页 
		// 					success(rea) {
		// 						console.log(rea.authSetting)
		// 					}
		// 				});
		// 			} else { // 用户没有点击“总是保持以上，不再询问”则每次都会调起订阅消息
		// 				console.log(99999)
		// 				uni.setStorageSync('sendMsg', false)
		// 				uni.showModal({
		// 					title: '提示',
		// 					content: '为了更好的体验,请绑定消息推送',
		// 					confirmText: '确定',
		// 					cancelText: '取消',
		// 					confirmColor: '#016BF6',
		// 					success: function (res) {
		// 						if (res.confirm) {
		// 							console.log(that.arr)
		// 							wx.requestSubscribeMessage({
		// 								tmplIds: that.arr,
		// 								success(re) {
		// 									console.log(JSON.stringify(re),
		// 										'++++++++++++++')
		// 									var datas = JSON.stringify(re);
		// 									if (datas.indexOf("accept") != -1) {
		// 										console.log(re)
		// 										uni.setStorageSync('sendMsg', true)
		// 									}
		// 								},
		// 								fail: (res) => {
		// 									console.log(res)
		// 								}
		// 							})
		// 							uni.setStorageSync('sendMsg', true)
		// 							console.log('确认')
		// 							that.showModal = false
		// 						} else if (res.cancel) {
		// 							console.log('取消')
		// 							uni.setStorageSync('sendMsg', false)
		// 							that.showModal = true
		// 						}
		// 					}
		// 				})
		// 			}
		// 		}
		// 	})
		// },
		//回到顶部
		gotoBack() {
			uni.pageScrollTo({
				scrollTop: 0,
				duration: 300
			})
		},
		/**
		 * 获取简历列表
		 */
		getPeopList() {
			if(this.jobSxTypeList.length == 0) return;
			let intentPostSkill = this.selectTags.map(item => item.postSkillName)?.join(',') || ''
			let data = {
				page: this.page,
				limit: this.limit,
				postType: '', //工作性质
				expectedPosition:this.jobSxTypeList.length > 0 ? this.jobSxTypeList[this.currentJobSx].projectName : '', //岗位名称
				screen: +this.currentJobSxs + 1, //1推荐 2最新
				city: this.city == '全国' ? '' : this.city, //城市
				salaryRange: this.salaryRange, //薪资范围
				eduRange: this.education, //学历
				expRange: this.experience, //经验
				// intentPostSkill:this.positionTagArr.join(','),
				intentPostSkill,
				//industryName: this.industry, //行业
				// companyPeople: this.companyPeople, //公司规模
				lng: this.longitude,
				lat: this.latitude,
				//isRecommend:this.currentJobSxs==1?this.currentJobSxs:0,//推荐
				companyId: uni.getStorageSync('companyId') ? uni.getStorageSync('companyId') : ''

			}
			this.$Request.postJson('/app/resumes/selectResumesList', data).then(res => {
				// 1. 停止下拉刷新和隐藏loading（无论请求结果如何都执行）
				this.isRefreshing = false
				uni.hideLoading()

				// 2. 第一层校验：确保res、res.data、res.data.records都存在且为数组
				if (res.code == 0 && res.data && Array.isArray(res.data.records)) {
					this.totalPage = res.data.totalPage
					this.totlo = res.data.totalPage // 注意：变量名疑似笔误（totlo → totalPage？）

					// 3. 处理列表：过滤null/undefined元素 + 安全访问skillTags
					const list = res.data.records
						.filter(item => item !== null && item !== undefined) // 过滤空元素
						.map(item => {
							// 安全赋值：item存在时才访问skillTags，否则赋值为空字符串
							item.skills = item?.skillTags || '';
							
							// 设置薪资范围
							if (!item.salaryRange && item.minSalary && item.maxSalary) {
								item.salaryRange = `${formatNumberToK(item.minSalary)}-${formatNumberToK(item.maxSalary)}`
							}
							
							// 设置基本信息年龄、工作年限、学历
							let baseInfoArr = []
							if (item.userAge) {
								baseInfoArr.push(`${item.userAge}岁`)
							}
							if (item.resumesWorkExperience) {
								baseInfoArr.push(item.resumesWorkExperience)
							}
							if (item.degree) {
								baseInfoArr.push(item.degree)
							}
							item.baseInfoArr = baseInfoArr
							
							// 判断是否是跨境公司
							let isCrossCompany = false
							let workTypeArr = []
							if (typeof item.workType == 'string') {
								workTypeArr = JSON.parse(item.workType?.split('；')[0] || [])
							}
							if (Array.isArray(workTypeArr)) {
								isCrossCompany = workTypeArr.findIndex(type => type == '0') != -1
							}
							item.isCrossCompany = isCrossCompany
							
							// 计算最新一家公司的工作年限
							let lastWorkTime = ''
							if (item.lastWorkStartTime && item.lastWorkEndTime) {
								lastWorkTime = this.calculateWorkDuration(item.lastWorkStartTime, item.lastWorkEndTime)
							}
							item.lastWorkTime = lastWorkTime
							
							return item;
						});

					// 4. 分页赋值（避免空数组覆盖）
					if (this.page == 1) {
						this.datasList = list
					} else {
						this.datasList = [...this.datasList, ...list]
					}
					this.totlo = res.data.pages
				} else {
					// 5. 异常情况：仅第一页清空列表，避免翻页时丢失数据
					if (this.page === 1) {
						this.datasList = []
					}
					// 可选：提示用户无数据
					// uni.showToast({ title: '暂无数据', icon: 'none' })
				}
			}).catch(err => {
				// 6. 捕获请求异常（如网络错误、接口500）
				this.isRefreshing = false
				uni.hideLoading()
				uni.showToast({
					title: '请求失败，请重试',
					icon: 'none'
				})
				console.error('简历列表请求失败：', err)
			})
		},
		/**
		 * 获取公司发布的岗位列表
		 */
		getCompanyClassify() {
			let data = {
			}
			if (uni.getStorageSync('companyId') && uni.getStorageSync('companyId') != 'null')
				data.companyId = uni.getStorageSync('companyId')

			this.$Request.getT('/app/postPush/getCompanyClassify', data).then(res => {
				uni.hideLoading()
				if (res.code === 0 && res.data.length > 0) {
					this.findJobCount = res.data.length
					let arr = []
					let tagMap = {}

					res.data.forEach(item => {
						let obj = {
							id: item.postPushId,
							projectName: item.ruleClassifyName,
							name: item.ruleClassifyName,
							ruleClassifyId: item.ruleClassifyId,
							city: item.city
						}
						
						if (!this.currentPostionCity) {
							this.currentPostionCity = item.city
							this.city = item.city
						}
						arr.push(obj)

						// 处理标签
						let tags = []
						if (item.positionTag && item.positionTag.trim() !== '') {
							tags = item.positionTag
								.split(',')
								.filter(Boolean)
								.map(tag => ({ id: tag, name: tag }))
						}
						if (tags.length === 0) {
							tags = [{ id: '不限', name: '不限' }]
						} else {
							tags.unshift({ id: '不限', name: '不限' })
						}

						tagMap[item.ruleClassifyId] = tags
					})
					if (this.positionTagMap && Object.keys(this.positionTagMap).length > 0) {
						for (const key in tagMap) {
							if (this.positionTagMap[key]) {
								const oldTags = this.positionTagMap[key]
								const newTags = tagMap[key]
								const merged = []
								const seen = new Set()

									;[...oldTags, ...newTags].forEach(tag => {
										if (!seen.has(tag.id)) {
											seen.add(tag.id)
											merged.push(tag)
										}
									})
								tagMap[key] = merged
							}
						}
					}
					
					this.jobSxTypeList = arr
					this.positionTagMap = tagMap

					if (!this.currentRuleClassifyId && arr.length > 0) {
						this.currentRuleClassifyId = arr[0].ruleClassifyId
					}

					this.positionTag =
						this.positionTagMap[this.currentRuleClassifyId] ||
						[{ id: '不限', name: '不限' }]
					this.getPeopList()
				} else if (res.code === 0) {
					this.findJobCount = 0
					// 获取公司招聘岗位后判断是否显示陈列页
					if (this.isShowDefaultPage) {
						this.getRecommendCompanys()
						this.getDefaultPositions()
					}
				}
			})
		},
		/**
		 * 获取dom元素的宽度
		 */
		getDomWidth() {
			this.$nextTick(() => {
				let that = this
				let obj = uni.createSelectorQuery().select('#bottomView' + that
					.currentJobSx) // xx为class或者id，如 .block, #block
				obj.boundingClientRect(function (data) { // data - dom中的参数，宽高等
					// console.log(data.width)
					if (data && data.width) {
						that.domeWidth = data.width * 2 * 0.8
					} else {
						that.domeWidth = 0
					}
				}).exec()
			})

		},
		/**
		 * @param {Object} longitude
		 * @param {Object} latitude
		 * 使用经纬度获取城市
		 */
		getSelectCity(longitude, latitude, go) {
			this.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => {
				if (res.code == 0) {
					// console.log(res, '获取地址信息')
					if (!this.city) {
						this.city = res.data.city ? res.data.city : '区域'
						uni.setStorageSync('city', res.data.city)						
					}
					if (go == 'go')
						this.goNav('/package/screen/city?city=' + this.city + '&county=' + this.county + '&type=' + 'search')
					if (this.userType == 1) {
						this.getUserList()
					} else {
						this.getPeopList()
					}
				}
			});
		},
		/**
		 * 获取求职意向
		 */
		getJobType() {
			return
			this.$Request.get('/app/intention/getIntentionList').then(res => {
				if (res.code == 0 && res.data.records.length > 0) {
					let arr = [{
						projectName: '',
						name: '全部',
					},]
					res.data.records.map(item => {
						let obj = {
							projectName: item.ruleClassifyName,
							name: item.ruleClassifyName,
						}
						arr.push(obj)
					})
					console.log(arr)
					this.jobTypeList = arr
				}
			})
		},
		/**
		 * 获取岗位列表
		 */
		getUserList() {
			if(this.typeList.length == 0) return;
			// 设置跨境标签
			let preference = this.selectTags.map(tag => tag.postSkillName)?.join(',') || ''
			let data = {
				page: this.page,
				limit: this.limit,
				//postType: this.typeList.length > 0 ? this.typeList[this.current].id : '',
				ruleClassifyName: this.typeList.length > 0 ? this.typeList[this.current].name : '', //岗位名称
				screen: +this.currentSx + 1, //1推荐 2最新
				county: this.county, //区
				city: this.city == '全国' ? '' : this.city, //城市
				salaryRange: this.salaryRange, //薪资范围
				education: this.education, //学历
				experience: this.experience, //经验
				industry: this.industry, //行业
				// preference: this.preference.join(','),
				preference,
				companyPeople: this.companyPeople, //公司规模
				lng: this.longitude,
				lat: this.latitude,
				//userId: uni.getStorageSync('userId') ? uni.getStorageSync('userId') : ''
			}
			this.$Request.get('/app/postPush/userGetPostPushList', data).then(res => {
				this.isRefreshing = false
				uni.hideLoading()
				if (res.code == 0) {
					res.data.records.map(item => {
						// 设置福利标签数据
						item.welfareTag = item.welfareTag ? item.welfareTag.replace(/;/g, ' | ') : ''
						// 设置岗位tag数据
						item.positionTag = item.positionTag ? item.positionTag.split(',') : []
						if (item.distance) {
							if (parseFloat(item.distance) > 1000) {
								item.distance = (parseFloat(item.distance) / 1000).toFixed(2) + 'km'
							} else {
								item.distance = (parseFloat(item.distance)).toFixed(2) + 'm'
							}

						} else {
							item.distance = ''
						}

					})
					if (this.page == 1) {
						// console.log(res.data.records, '岗位数据')
						this.dataList = res.data.records
					} else {
						this.dataList = [...this.dataList, ...res.data.records]
					}
					this.totlo = res.data.pages
				}
			}).catch(err => {
				this.isRefreshing = false
				uni.hideLoading()
			})
		},
		/**
		 * 工作性质
		 */
		getPostType(notChangeCity = false) {
			var that = this
			if(that.preferenceChange){
				return this.getUserList()
			}
			//行业期望
			this.$Request.get('/app/intention/getIntentionList', {

			}).then(res => {
				if (res.code == 0) {
					this.expecteJobCount = res.data.length
					// 获取求职岗位后判断是否显示陈列页
					if (this.isShowDefaultPage) {
						this.getRecommendCompanys()
						this.getDefaultPositions()
						return
					}
					
					let arr = res.data
					let classRule = [
						/* {
													id: '',
													name: '',
													label: '全部'
												} */
					]
					let industry = this.directionList
					arr.forEach((item,index) => {
						var tmp = {}
						tmp.id = item.ruleClassifyId
						tmp.name = item.ruleClassifyName
						tmp.label = item.ruleClassifyName
						classRule.push(tmp)
						let indexRulrId=that.typeList.length>0&&that.typeList[that.current].id?that.typeList[that.current].id:arr[0].ruleClassifyId
						if(indexRulrId==item.ruleClassifyId){
							var indus = item.industry ? item.industry.split('/') : []
							indus.forEach(function (ind) {
								var tm = {}
								tm.name = ind
								tm.id = ind
								tm.ruleClassifyId=item.ruleClassifyId
								if (that.$queue.array_column(industry, 'name').indexOf(tm.name) <
									0)
									industry.push(tm)
							})
						}
						
						if (this.current == index && !notChangeCity) {
							this.city = item.citys
						}
					})
					classRule.push({
						id: '',
						name: '',
						label: ''
					}) //模拟个空企业选项，为了兼容源码和设计图
					this.typeList = classRule
					
					var industryArr = this.industry == '' ? [] : this.industry.split(',')
					industryArr.forEach(function (item) {
						if (that.$queue.array_column(that.directionList, 'name').indexOf(item) < 0)
							industry.push({
								id: item,
								name: item,
								ruleClassifyId:that.typeList[that.current].id
							})
					})
					
					this.directionList = industry
					// console.log(this.typeList, '1111')
					this.getUserList()
				}
			}).finally(() => {
				uni.hideLoading()
			})
		},
		/**
		 * 获取个人信息
		 */
		getUserInfo() {
			this.$Request.get("/app/user/selectUserById").then(res => {
				if (res.code == 0) {
					console.log(res.data)
					this.$queue.setData('weChatNum', res.data?.weChatNum)
					if (res.data && res.data.companyId) {
						uni.setStorageSync('companyId', res.data?.companyId)
					}
					if (res.data?.userType == 1 || res.data?.userType == null) {
						this.userType = 1
						uni.setStorageSync('userType', 1)
					} else {
						this.userType = 2
						uni.setStorageSync('userType', 2)
					}
				}
			})
		},
		gotoInfo: debounce(function(postPushId) {
			if (uni.getStorageSync('token')) {
				// #ifdef MP-WEIXIN
				if (uni.getStorageSync('sendMsg')) {
					// console.log('授权+1')
					wx.requestSubscribeMessage({
						tmplIds: this.arr,
						success(re) {
							// console.log(JSON.stringify(re), 111111111111)
							var datas = JSON.stringify(re);
							if (datas.indexOf("accept") != -1) {
								// console.log(re)
							}
						},
						fail: (res) => {
							// console.log(res)
						}
					})
				}
				// #endif
				// uni.navigateTo({
				// 	url: '/pages/index/game/order?postPushId=' + postPushId
				// })
			}
			//  else {
			// 	this.noLogin()
			// }
			uni.navigateTo({
				url: '/pages/index/game/order?postPushId=' + postPushId
			})

		}, 300),
		//不需要登录跳转
		goNavs: debounce(function(url) {
			// #ifdef MP-WEIXIN
			if (uni.getStorageSync('sendMsg')) {
				// console.log('授权+1')
				wx.requestSubscribeMessage({
					tmplIds: this.arr,
					success(re) {
						// console.log(JSON.stringify(re), 111111111111)
						var datas = JSON.stringify(re);
						if (datas.indexOf("accept") != -1) {
							// console.log(re)
						}
					},
					fail: (res) => {
						// console.log(res)
					}
				})
			}
			// #endif
			uni.navigateTo({
				url: url
			})
		}, 300),
		//跳转
		goNav: debounce(function(url, company = '') {
			if (company == 'company') {
				if (this.jobSxTypeList.length <= 0 || this.jobSxTypeList[this.currentJobSx].id == '') return this.$queue.showToast('请先点击右上角发布岗位');
			}
			if (uni.getStorageSync('token')) {
				// #ifdef MP-WEIXIN
				if (uni.getStorageSync('sendMsg')) {
					// console.log('授权+1')
					wx.requestSubscribeMessage({
						tmplIds: this.arr,
						success(re) {
							// console.log(JSON.stringify(re), 111111111111)
							var datas = JSON.stringify(re);
							if (datas.indexOf("accept") != -1) {
								// console.log(re)
							}
						},
						fail: (res) => {
							// console.log(res)
						}
					})
				}
				// #endif
				uni.navigateTo({
					url: url
				})
			} else {
				this.noLogin()
			}

		}, 300),
		//未登录
		noLogin() {
			uni.showModal({
				title: '提示',
				content: '您还未登录,请先登录',
				confirmColor: '#016BF6',
				success: (res) => {
					if (res.confirm) {
						// console.log('用户点击确定');
						// #ifdef H5
						this.$queue.toLogin('navigateTo')
						// #endif
						// #ifdef APP-PLUS
						this.$queue.toLogin()
						// #endif
					} else if (res.cancel) {
						// console.log('用户点击取消');
					}
				}
			})
		},
		//吸顶
		isfixed(e) {
			// console.log(e, '+++++++++++++')
			this.isfixeds = true
		},
		//不吸顶
		isunfixed() {
			this.isfixeds = false
		},
		//添加方向标签
		addDirection() {
			uni.navigateTo({
				url: '/package/jobIntention/tagManage'
			})
		},
		
		// 修改推荐类型（最新）
		handleChangeSx() {
			if (this.isJobHunting) {
				// 求职端
				this.currentSx = this.currentSx == 1 ? 0 : 1
			} else {
				// 招聘端
				this.currentJobSxs = this.currentJobSxs == 1 ? 0 : 1
			}
		},
		
		// 打开跨境标签页面
		openTagPopup() {
			if (!this.tags.length) {
				this.getTagsData()
			}
			this.showTagPopup = true
		},
		
		// 获取跨境标签数据
		getTagsData() {
			let ruleClassifyId = ''
			if (this.isJobHunting) {
				// 求职端
				ruleClassifyId = this.typeList[this.current].id
			} else {
				// 招聘端
				ruleClassifyId = this.jobSxTypeList[this.currentJobSx].ruleClassifyId
			}
			this.$Request
				.getT('/app/userFirst/getPostSkill', {
					ruleClassifyId
				})
				.then((res) => {
					if (res.code === 0) {
						this.tags = res.data
					}
				})
		},
		
		// 选择跨境标签
		handleSelectTag(tag) {
			const index = this.tempSelectTags.findIndex(item => item.postSkillId == tag.postSkillId)
			if (index != -1) {
				this.tempSelectTags.splice(index, 1)
			} else {
				this.tempSelectTags.push(tag)
			}
		},
		
		// 判断跨境标签是否选中了
		judgeSelectTags(tag) {
			return this.tempSelectTags.some(item => item.postSkillId == tag.postSkillId)
		},
		
		// 重置跨境标签
		handleResetTags() {
			this.selectTags = []
			this.showTagPopup = false
			this.getListData()
		},
		
		// 设置跨境标签后搜索
		handleSearch() {
			this.selectTags = this.tempSelectTags
			this.showTagPopup = false
			this.getListData()
		},
		
		// 数据变更后重置页数,且请求数据
		getListData() {
			this.page = 1
			if (this.isJobHunting) {
				// 求职端
				this.getUserList()
			} else {
				// 招聘端
				this.getPeopList()
			}
		},
		
		// 陈列页，获取推荐热门企业数据
		getRecommendCompanys() {
			if (this.loadingRecommendHostCompany) return
			this.loadingRecommendHostCompany = true
			this.$Request
				.getT('/app/company/getHostCompany', {
					page: this.RCPage,
					limit: 3,
				})
				.then(res => {
					if (res.code === 0) {
						this.recommendHostCompanys = res.data.records.map(item => {
							if (item.welfare) {
								item.welfare = item.welfare.replace(/,/g, ' · ')
							}
							// 判断是否是跨境公司
							let type = JSON.parse(item.type)
							let isCrossCompany = false
							if (item.type && Array.isArray(type)) {
								isCrossCompany = type.some(t => t == '0')
							}
							item.isCrossCompany = isCrossCompany
							return item
						})
						
						// 如果刷新到最后一页，则重置刷新
						let current = res.data.current
						let size = res.data.size
						let total = res.data.total
						if (this.RCPage !== 1 && current * size >= total) {
							this.RCPage = 0
							this.getRecommendCompanys()
						}
					}
				})
				.finally(() => {
					this.loadingRecommendHostCompany = false
				})
		},
		
		refreshRecommendCompany() {
			this.RCPage++
			this.getRecommendCompanys()
		},
		
		// 陈列页，获取列表岗位数据
		getDefaultPositions() {
			if (this.loadingRecommendPosition) return
			this.loadingRecommendPosition = true
			this.$Request
				.getT('/app/postPush/getHostPostPush', {
					page: this.RPPage,
					limit: 10,
				})
				.then(res => {
					if (res.code === 0) {
						this.total = res.data.total
						let list = res.data.records.map(position => {
							position.positionTag = position.positionTag?.split(',') || []
							position.welfareTag = position.welfareTag?.replace(/;/g, '|') || ''
							return position
						})
						if (this.RPPage != 1) {
							this.recommendPositions = [...this.recommendPositions, ...list]
						} else {
							this.recommendPositions = list
						}
					}
				})
				.finally(() => {
					this.loadingRecommendPosition = false
					this.isRefreshing = false
				})
		},
		
		// 跳转公司页面
		toCompanyPage: debounce(function(companyId) {
			uni.navigateTo({
				url: `/my/enterpriseInfo/enterpriseInfo?companyId=${companyId}`
			})
		}, 300),
	}
}
</script>

<style lang="scss" scoped>
.page-container {
	display: flex;
	flex-direction: column;
	height: 100vh;
	//#ifdef H5
	height: calc(100vh - var(--window-bottom));
	//#endif
	// margin-bottom: 60px;
	position: relative;
}

.user-image {
	position: relative;

	.online-status {
		width: 12rpx;
		height: 12rpx;
		position: absolute;
		bottom: 0rpx;
		right: 0rpx;
		border-radius: 50%;
		box-sizing: border-box;
		border: 0.5px solid rgba(255, 255, 255, 1);
	}
	.hr-avatar {
		display: block;
		width: 40rpx;
		height: 40rpx;
		border: 0.5px solid rgba(240, 240, 240, 1);
		border-radius: 20rpx;
	}
}

page {
	background: #F2F2F7;
}

.goback {
	position: fixed;
	top: 80%;
	right: 30rpx;
}

.jobtitle {
	position: relative;

	.jobtitleBom {
		position: absolute;
		width: 30rpx;
		left: 50%;
		top: 80%;
		transform: translate(-50%, 0);

	}
}

.topbg-scroll {
	width: 100%;
	white-space: nowrap;
}

.activeQs {
	color: #1A1A1A !important;
	font-weight: 800;
}

.activeQ {
	color: #1A1A1A !important;
	font-size: 38rpx;
	font-weight: 800;
}

.active {
	font-size: 38rpx !important;
	font-weight: 800 !important;
}

.active2 {
	color: #1A1A1A !important;
	font-size: 38rpx !important;
	font-weight: 800 !important;
}

.active3 {
	color: #1A1A1A !important;
	font-size: 28rpx !important;
	font-weight: 800 !important;
}

.topbg {
	width: 100%;
	background-color: #00DD9A;
}

.top-bg {
	position: absolute;
	top: 0;
	z-index: 0;
	width: 100%;
}

.topbg-sticky-box {
	width: 100%;
	padding: 0 20rpx;
	position: relative;
	z-index: 1;
}

.topbg-sticky-title {
	width: 100%;
	margin-bottom: 20rpx;
}

.topbg-sticky-title-left {
	color: rgba(255, 255, 255, 1);
	font-family: DM Sans;
	font-size: 28rpx;
	font-weight: 700;
	line-height: 36rpx;
	letter-spacing: 0%;
	text-align: left;
}

.xing-icon {
	width: 42rpx;
	height: 42rpx;
	margin-right: 12rpx;
}

.topbg-sticky-title-right {
	color: #ffffff;
}

.topbg-sticky-subtitle {
	color: rgba(255, 255, 255, 1);
	font-family: DM Sans;
	font-size: 30rpx;
	font-weight: 700;
	line-height: 36rpx;
	letter-spacing: 0%;
	text-align: left;
}

.topbg-type {
	width: 710rpx;
	border-radius: 6px;
	box-shadow: 0px 8px 12px 0px rgba(0, 0, 0, 0.05);
	background: rgba(255, 255, 255, 1);
	// background: transparent;
	padding: 18rpx;
	margin: 0 auto 12rpx;
	position: relative;
	z-index: 1;

	.topbg-type-box {
		width: 100%;
		margin: 0 20rpx;
	}

	.topbg-type-box-row {
		margin-bottom: 20rpx;
	}

	.topbg-type-box-l {
		flex: 1;
		white-space: nowrap;
		overflow-x: auto;
	}

	.topbg-type-box-l-i {
		color: rgba(153, 153, 153, 1);
		font-family: DM Sans;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 28rpx;
		letter-spacing: 0%;
		text-align: left;
		margin-right: 28rpx;

		&.i-active {
			background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
			-webkit-background-clip: text;
			-webkit-text-fill-color: transparent;
			background-clip: text;
			text-fill-color: transparent;
			font-family: DM Sans;
			font-size: 28rpx;
			font-weight: 700;
			line-height: 36rpx;
			letter-spacing: 0%;
			text-align: left;
		}
	}

	.topbg-type-box-r {
		color: #ffffff;
	}

	.attachment-icon {
		width: 38rpx;
		height: 38rpx;
		margin-left: 20rpx;
	}
	
	// 筛选内容
	.topbg-search {
		.topbg-search-item {
			font-size: 16rpx;
			font-weight: 400;
			line-height: 20rpx;
			color: rgba(153, 153, 153, 1);
			padding: 8rpx;
			border: 0.5px solid rgba(198, 198, 198, 0.1);
			border-radius: 8rpx;
			background: rgba(198, 198, 198, 0.1);
			
			.topbg-search-item__text {
				display: block;
				max-width: 120rpx;
				text-overflow: ellipsis;
				overflow: hidden;
				white-space: nowrap;
				margin-right: 8rpx;
			}
			
			&.mr-4 {
				margin-left: 10rpx;
			}
			
			&.topbg-search-item__active {
				color: #016bf6;
				background: rgba(153, 196, 250, 0.4);
				border-color: #016bf6;
			}
		}
	}
}

.companyListBox {
	width: 100%;
	background-color: #F2F2F7;
}

.title-left {
	display: flex;
	align-items: center;
	gap: 8rpx;
}

.job-title-text {
	color: rgba(23, 23, 37, 1);
	font-family: DM Sans;
	font-size: 32rpx;
	font-weight: bold;
	line-height: 48rpx;
	letter-spacing: 0.5%;
	text-align: left;
}

.salary-text-box {
	border-radius: 24rpx;
	background: #FEE2E3;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	padding: 0 16rpx;

	.jipin-icon {
		width: 20rpx;
		height: 20rpx;
		margin-right: 8rpx;
	}

	.jipin-text {
		color: rgba(237, 66, 69, 1);
		font-family: DM Sans;
		font-size: 16rpx;
		font-weight: 400;
		line-height: 40rpx;
		letter-spacing: 0.5%;
		text-align: left;
	}
}

.clip-color {
	font-size: 24rpx;
	font-weight: bold;
	line-height: 40rpx;
	background-image: linear-gradient(90.00deg, rgba(13, 39, 247, 1),rgba(19, 193, 234, 1));
	-webkit-background-clip: text;
	color: transparent;
	background-clip: text;
}

.company-name,
.company-people {
	color: rgba(156, 164, 171, 1);
	font-family: DM Sans;
	font-size: 24rpx;
	font-weight: 400;
	line-height: 40rpx;
	letter-spacing: 0.5%;
	text-align: left;
}

.job-tag {
	padding: 8rpx;
	border-radius: 8rpx;
	background: rgba(198, 198, 198, 0.1);
	margin-right: 8rpx;
	margin-bottom: 8rpx;
	color: rgba(153, 153, 153, 1);
	font-size: 20rpx;
	line-height: 1;
}

.company-info-text,
.location-text {
	color: rgba(156, 164, 171, 1);
	font-family: DM Sans;
	font-size: 20rpx;
	font-weight: 400;
	line-height: 40rpx;
	letter-spacing: 0.5%;
	text-align: left;
}

.reply-time {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	padding: 4rpx 8rpx;
	font-family: DM Sans;
	font-size: 16rpx;
	font-weight: 400;
	line-height: 20rpx;
	letter-spacing: 0.5%;
	text-align: left;
	border-radius: 12rpx;
	background: #ECE1FD;
	color: #8858C5;
}

.gwList {
	width: 100%;
	flex: 1;
	overflow: auto;
}

.position-list {
	margin: 0 20rpx;
	padding-bottom: 100rpx;
}

.gwList,
.position-list {
	.gwList-box {
		width: 710rpx;
		height: 100%;
	
		.gwList-box-item {
			width: 712rpx;
			background-color: #ffffff;
			border-radius: 12rpx;
			box-shadow: 0px 2rpx 4rpx 0px rgba(0, 0, 0, 0.1);
			background: rgba(253, 253, 253, 1);
			margin-bottom: 12rpx;
			padding: 16rpx 36rpx;
		}
	
		.gwList-box-item-box {
			width: 100%;
			.gwList-box-item-box-title {
				margin-bottom: 12rpx;
			}
	
			.gwList-box-item-box-label {
				margin-top: 14rpx;
			}
	
			.gwList-box-item-box-name {
				color: rgba(156, 164, 171, 1);
				font-size: 24rpx;
				font-weight: 400;
				line-height: 40rpx;
				
				.company-name-overflow {
					max-width: 360rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
					margin-right: 8rpx;
				}
			}
			.experience {
				font-size: 24rpx;
				line-height: 32rpx;
				color: rgba(1, 107, 246, 1);
				text {
					margin-left: 12rpx;
				}
			}
			
			.benefits {
				width: 640rpx;
				font-size: 20rpx;
				line-height: 28rpx;
				color: rgba(153, 153, 153, 1);
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				margin-top: 12rpx;
			}
	
			.gwList-box-item-box-line {
				width: 100%;
				border: 1rpx solid #E6E6E6;
				margin-top: 30rpx;
				margin-bottom: 20rpx;
			}
	
			.gwList-box-item-box-info {
				font-size: 26rpx;
				margin-top: 10rpx;
	
				.gwList-box-item-box-info-l {
					color: #1A1A1A;
					display: flex;
					align-items: center;
					gap: 12rpx;
	
					.people {
						max-width: 110rpx;
						overflow: hidden; //超出的文本隐藏
						text-overflow: ellipsis; //溢出用省略号显示
						white-space: nowrap; // 默认不换行；
					}
				}
	
				.gwList-box-item-box-info-r {
					color: #999999;
					max-width: 50%;
					overflow: hidden; //超出的文本隐藏
					text-overflow: ellipsis; //溢出用省略号显示
					white-space: nowrap; // 默认不换行；
				}
			}
		}
	}
}

.banner {
	width: 100%;
	height: 250rpx;
	// margin-top: 20rpx;

	.banner-box {
		width: 686rpx;
		height: 100%;
		border-radius: 24rpx;
	}
}

.isfixed {
	border-radius: 0 !important;
}

.isfixeds {
	// border-radius: 40rpx 40rpx 0 0;
}

.qyList {
	width: 100%;
	overflow: auto;
	flex: 1;

	.qyList-box {
		width: 712rpx;
		height: 100%;

		.qyList-box-item {
			width: 100%;
			padding: 16rpx 36rpx;
			// height: 400rpx;
			// padding-bottom: 40rpx;
			background-color: #ffffff;
			border-radius: 12rpx;
			margin-bottom: 12rpx;
			box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);

			.qyList-box-item-box {
				width: 100%;
				height: 100%;
			}

			.qyList-box-item-info {
				// margin-top: 40rpx;
			}
			.qyList-box-item-info-r{
				position: relative;
				margin-right: 20rpx;
				.avatar {
					display: block;
					width: 72rpx;
					height: 72rpx;
					border-radius: 50%;
					border: 0.5px solid rgba(240, 240, 240, 1);
				}
				.sex-icon {
					position: absolute;
					top: 0;
					right: 0;
					display: block;
					width: 22rpx;
					height: 22rpx;
					border-radius: 50%;
					background: #fff;
					border: 0.5px solid #fff;
				}
			}
			.qyList-box-item-info-l {
				flex: 1;
				.user-name {
					max-width: 260rpx;
					font-size: 28rpx;
					font-weight: 500;
					line-height: 36rpx;
					color: rgba(51, 51, 51, 1);
					margin-right: 8rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}
				.status-tag {
					padding: 8rpx;
					font-size: 16rpx;
					line-height: 20rpx;
					border-radius: 8rpx;
					margin-right: 8rpx;
				}
				.online-minutes {
					color: rgba(144.88, 87.8, 191.25, 1);
					background: linear-gradient(132.53deg, rgba(106.94, 84.63, 214.02, 0.1) -1.914%,rgba(144.88, 87.8, 191.25, 0.1) 97.996%);
				}
				.online-status {
					color: rgba(29, 209, 104, 1);
					background: rgba(213, 255, 231, 1);
				}
				.base-info {
					margin-top: 6rpx;
					text {
						font-size: 24rpx;
						line-height: 32rpx;
						color: rgba(1, 107, 246, 1);
						margin-right: 12rpx;
					}
				}
			}

			.company-info {
				margin-top: 16rpx;
				.icon {
					width: 40rpx;
					height: 40rpx;
					margin-right: 8rpx;
				}
				.company-text {
					max-width: 420rpx;
					color: rgba(156, 164, 171, 1);
					font-size: 24rpx;
				}
				.company-tag {
					height: 32rpx;
					font-size: 20rpx;
					line-height: 1;
					color: #fff;
					border-radius: 8rpx;
					background: linear-gradient(90.00deg, rgba(13, 39, 247, 0.75) 0%,rgba(19, 193, 234, 0.75) 100%);
					padding: 6rpx 7rpx;
					margin-left: 20rpx;
					box-sizing: border-box;
				}
				.time {
					font-size: 20rpx;
					line-height: 40rpx;
					color: rgba(144.88, 87.8, 191.25, 1);
				}
			}
			// tag样式
			.tags {
				display: flex;
				flex-wrap: wrap;
				.tag {
					padding: 8rpx;
					border-radius: 8rpx;
					background: rgba(198, 198, 198, 0.1);
					font-size: 20rpx;
					line-height: 1;
					color: rgba(153, 153, 153, 1);
					margin-top: 8rpx;
					margin-right: 8rpx;
				}
			}
			.bottom-section {
				color: rgba(156, 164, 171, 1);
				font-size: 24rpx;
				line-height: 40rpx;
				margin-top: 12rpx;
				.expection-icon {
					width: 40rpx;
					height: 40rpx;
					margin-right: 8rpx;
				}
				.has-view {
					line-height: 1;
					font-size: 24rpx;
					color: rgba(102, 102, 102, 1);
					border-radius: 8rpx;
					background: rgba(153, 153, 153, 0.1);
					padding: 8rpx 12rpx;
				}
			}
		}
	}
}

// 跨境标签弹窗
.tag-popup-container {
	padding: 36rpx 40rpx 50rpx;
	.tag-popup-title {
		font-size: 32rpx;
		font-weight: 500;
		line-height: 44rpx;
		color: rgba(31, 44, 55, 1);
		margin-bottom: 24rpx;
	}
	.tag-popup-tip {
		font-size: 28rpx;
		line-height: 36rpx;
		color: rgba(158, 158, 158, 1);
		margin-bottom: 24rpx;
	}
	.tag-popup-section {
		.tag-popup-sub-title {
			color: rgba(31, 44, 55, 1);
			font-size: 28rpx;
			font-weight: 500;
			line-height: 44rpx;
			margin-bottom: 24rpx;
		}
		.tag-wrapper {
			display: flex;
			flex-wrap: wrap;
			.tag {
				font-size: 24rpx;
				line-height: 1;
				color: rgba(153, 153, 153, 1);
				padding: 8rpx;
				margin-right: 12rpx;
				margin-bottom: 24rpx;
				border-radius: 8rpx;
				background: rgba(198, 198, 198, 0.2);
				border: 0.5px solid rgba(198, 198, 198, 0.2);
				
				&.tag-select-active {
					color: rgba(1, 107, 246, 1);
					background: rgba(1, 107, 246, 0.1);
					border: 0.5px solid rgba(1, 107, 246, 1);
				}
			}
		}
	}
	.tag-popup-buttons {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 80rpx;
		.tag-popup-button {
			width: 326rpx;
			height: 80rpx;
			text-align: center;
			line-height: 80rpx;
			border-radius: 80rpx;
			background: rgba(1, 107, 246, 0.1);
			color: rgba(1, 107, 246, 1);
			font-size: 32rpx;
			line-height: 80rpx;
		}
		.main-button {
			color: #fff;
			background: linear-gradient(90.00deg, rgba(13, 39, 247, 1),rgba(19, 193, 234, 1));
		}
	}
}

// 陈列页推荐区域
.default-scroll-view {
	box-sizing: border-box;
}
.recommend-section {
	padding: 28rpx 20rpx 20rpx;
	border-radius: 12rpx;
	box-shadow: 0px 5px 8px 0px rgba(0, 0, 0, 0.05);
	background: linear-gradient(90.00deg, rgba(19, 193, 234, 0.3),rgba(13, 39, 247, 0.3) 100%);
	margin: 0 20rpx;
	.recommend-title {
		color: #fff;
		margin-bottom: 20rpx;
		.recommend-title-l {
			font-size: 32rpx;
			font-weight: 700;
			line-height: 44rpx;
		}
		.recommend-title-r {
			display: flex;
			align-items: center;
			font-size: 16rpx;
			.refresh-icon {
				display: block;
				margin-left: 6rpx;
				width: 30rpx;
				height: 30rpx;
			}
		}
	}
	.recommend-company-item {
		padding: 16rpx;
		background: #fff;
		margin-bottom: 8rpx;
		border-radius: 12rpx;
		&:last-child {
			margin-bottom: 0;
		}
		.company-img {
			display: block;
			width: 116rpx;
			height: 116rpx;
			border-radius: 12rpx;
			margin-right: 24rpx;
		}
		.recommend-company-info-wrapper {
			flex: 1;
			.recommend-company-name {
				font-size: 20rpx;
				font-weight: 500;
				line-height: 26rpx;
				color: rgba(29, 33, 41, 1);
			}
			.tip {
				width: 500rpx;
				margin-top: 4rpx;
				font-size: 20rpx;
				line-height: 26rpx;
				color: rgba(153, 153, 153, 1);
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
			.positions {
				height: 40rpx;
				.position-icon {
					display: block;
					width: 24rpx;
					height: 24rpx;
					margin-right: 12rpx;
				}
				.position-text {
					width: 450rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
					font-size: 24rpx;
					color: rgba(1, 107, 246, 1);
				}
			}
		}
	}
}
.position-title {
	margin: 12rpx 20rpx;
	border-radius: 12px;
	box-shadow: 0px 8px 12px 0px rgba(0, 0, 0, 0.05);
	background: rgba(255, 255, 255, 1);
	padding: 26rpx 20rpx;
	text {
		background-image: linear-gradient(90.00deg, rgba(13, 39, 247, 1),rgba(19, 193, 234, 1));
		-webkit-background-clip: text;
		color: transparent;
		background-clip: text;
		font-style: Bold;
		font-size: 32rpx;
		font-weight: 700;
	}
}
</style>