<template>
	<div data-remark='职位详情' class="g-rh-job-detail p-root-detail-job g_bg_page g_pt_10 g_pl_12 g_pr_12 g_kuaishou">
		<div v-if="speed == 0">
			<rh-loading />
		</div>
		<div v-if="speed == 1">
			<view class="r_box g_mb_10" v-if="(isSharePage && isFans == 2) || !isSharePage">
				<div class="g_flex_row_between flex_center g_pl_16 g_pr_16 g_fs_16 g_border_e_b" @click="goUserMain" style="height: 60px">
					<view class="g_fw_600 g_mr_4 g_flex_column_center">{{ userinfo.agencyId == jobDetail.agencyId ? "项目方" : "发单号" }}</view>
					<view class="g_flex_row_end flex_center g_flex_1">
						<span class="g_c_6 g_flex_1 g_text_r" selectable="false" space="false" decode="false">{{ userinfo.agencyId == jobDetail.agencyId ? jobDetail.upFullName || jobDetail.upAgencyName || jobDetail.upProviderName || "-" : jobDetail.fullName || jobDetail.agencyName }}</span>
						<span class="iconfont icon-gengduo11 g_fs_14 g_c_6 g_ml_4"></span>
					</view>
				</div>
				<div class="g_mb_10 g_pl_16 g_pr_16 servicePrice" @click="showFee" style="height: 60px">
					<div class="g_flex_row_between flex_center g_fs_16">
						<div class="g_flex_row_start" style="flex: none">
							<div class="g_fw_600 g_mr_4 g_hs_67 g_flex_column_center">代理佣金</div>
							<icon :class="showPrice ? 'icon-zhengyan1' : 'icon-biyan1'" class="iconfont g_c_f40 g_fs_22 g_hs_67 g_flex_column_center" @click.stop="() => (showPrice = !showPrice)" style="width: 67px"></icon>
						</div>
						<div class="g_flex_row_end flex_center g_hs_67" style="flex: 1">
							<span class v-if="showPrice">{{ jobDetail.serverPrice || "费用待定" }}</span>
							<span class v-else>***</span>
							<div class="iconfont icon-gengduo11 g_fs_14 g_c_6 g_ml_4"></div>
						</div>
					</div>
				</div>
			</view>
			<!-- 基本信息 -->
			<view class="g_bg_f g_pt_10 g_pl_16 g_pr_16 g_kuaishou g_radius_8 g_pb_16">
				<div class="m-info g_mb_12">
					<i class="iconfont icon-yitingzhao" v-if="jobDetail.recruitment == 2" style="position: absolute; right: 30px; top: 30%; transform: translateY(-50%); color: #ff4d4f; font-size: 80px; z-index: 1"></i>
					<view class="g_mb_10 g_flex_row_between flex_center">
						<view class="g_flex_1 g_c_3 g_fs_20 g_fw_bold">{{ jobDetail.jobName }}</view>
						<view class="g_fs_14 g_c_9">
							{{ jobDetail.updateTime }}
						</view>
					</view>
					<template>
						<view class="g_c_9">
							<view class="g_flex_row_between flex_center g_mb_12">
								<view class="g_fs_14 g_ml_4 g_lh_1_2 g_flex_column_center">{{ (jobDetail.addss ? jobDetail.addss + "丨" : "") + jobDetail.genderRestrict + "丨" + jobDetail.age }} </view>
							</view>
						</view>
					</template>
					<div class="g_flex_row_start">
						<div v-for="(item, index) in jobDetail.jobRequestLabelNames" class="g_mr_8 g_mb_8 g_pl_4 g_pr_4" :style="{ color: labelColor[index % labelColor.length], 'background-color': bgColor[index % bgColor.length] }">{{ item }}</div>
					</div>
					<view class="g_flex_row_between flex_center g_mt_8">
						<view class="g_flex_row_start flex_center">
							<view class="g_fs_16 g_fw_600 g_c_f40 g_lh_1_2 g_flex_column_center" v-if="jobDetail.priceStr" v-html="jobDetail.priceStr"> </view>
							<view class="g_fs_14 g_c_9" v-if="jobDetail.monthPay">
								{{ jobDetail.monthPay ? "丨" + jobDetail.monthPay : "" }}
							</view>
						</view>
					</view>
					<div>
						<view class="m-address g_mt_16 g_mb_16 g_pt_10 g_pb_10 g_flex_row_start g_border_e_t g_border_e_b" hover-class="thover" @click="goAddress" v-if="jobDetail.storeLat && jobDetail.storeLng && jobDetail.storeDistrict">
							<view class="g_flex_none g_flex_column_center">
								<i class="iconfont icon-dizhi1 g_mr_10 g_w_14 g_h_14" :style="{color: globalData.themeColor}"></i>
							</view>
							<view class="g_flex_1 g_ml_4 g_mr_4 g_flex_column_center">
								<view class="g_fs_16 g_c_3 g_ell_1">
									{{ jobDetail.storeAddr || "-" }}
								</view>
							</view>
							<view class="g_flex_none g_flex_column_center">
								<i class="iconfont icon-gengduo11 g_c_9 g_w_14 g_h_14"></i>
							</view>
						</view>
						<view v-else class="g_border_e_t g_mt_16"></view>
					</div>
					<view class="m-banner g_pb_16 g_border_f5_b g_mt_12" v-if="swiperArray.length > 0">
						<scroll-view class="banner-scroll" scroll-x="true" show-scrollbar="false" :scroll-with-animation="true">
							<view class="scroll-content">
								<view v-for="(item, index) in swiperArray" :key="index" class="scroll-item" :class="index == 0 ? 'g_ml_0 g_mr_0' : ''" @click="item.type == 'image' ? handleViewBig(item, index) : showVideo(item)">
									<u-image :radius="4" v-if="item.type == 'image'" :showLoading="true" :src="item.image" width="58px" height="58px" style="border-radius: 4px"> </u-image>
									<view class="g_w_58 g_h_58 g_radius_4 videoContainer" v-else>
										<video class="theVideo" :show-fullscreen-btn="true" :show-play-btn="true" :show-center-play-btn="true" :enable-play-gesture="true" :id="item.id" :src="item.image" @fullscreenchange="fullScreen" :muted="muted" :show-mute-btn="isFullscreen" :show-progress="isFullscreen" :show-time="isFullscreen" :controls="isFullscreen" :enable-progress-gesture="isFullscreen" :object-fit="'cover'" style="width: 100%; height: 100%"></video>
									</view>
								</view>
							</view>
						</scroll-view>
					</view>
					<view class="g_flex_row_center g_border_e_b">
						<u-tabs bg-color="transparent" :list="tabInfo.list" :current="tabInfo.active" :active-color="globalData.themeColor" bar-width="32" bar-height="6" @change="handleUpdateTab" :gutter="50" font-size="32" duration="0.05" height="76"></u-tabs>
					</view>
					<view class="content_card">
						<view v-if="tabInfo.active == 0" style="line-height: 24px" class="">
							<view class="" v-if="!jobDetail.cozeStructureRes">
								<view v-if="jobDetail.notes">
									<view class="detailH3">注意事项</view>
									<view class="pri g_c_f40" style="line-height: 24px; padding: 3px 8px; border-radius: 4px; text-align: justify">{{ jobDetail.notes }}</view>
								</view>
								<view class="detailH3">一、薪资待遇</view>
								<view class="g_radius_4">
									<view class="g_flex_row_between">
										<view class="rb1">1. 薪资明细：</view>
										<view class="textb1">{{ jobDetail.salaryDetail }}</view>
									</view>
								</view>
								<view class="detailH3">二、职位要求</view>
								<view class="g_radius_4">
									<view class="g_flex_row_between">
										<view class="rb1">1. 性别年龄：</view>
										<view class="textb1">{{ jobDetail.genderRestrict + " " + jobDetail.age }}</view>
									</view>
								</view>
								<view class="detailH3">三、岗位说明</view>
								<view class="g_radius_4">
									<view class="g_flex_row_between">
										<view class="rb1">1. 班次工时：</view>
										<view class="textb1">{{ jobDetail.workClasses }}</view>
									</view>
									<view class="g_flex_row_between">
										<view class="rb1">2. 其他说明：</view>
										<view class="textb1">{{ jobDetail.otherDesp }}</view>
									</view>
								</view>
								<view class="detailH3">四、面试对接</view>
								<view class="g_radius_4">
									<view class="g_flex_row_between">
										<view class="rb1">1. 面试地点：</view>
										<view class="textb1 g_flex_row_between g_flex_1">
											<view class>{{ jobDetail.interviewAddr || "-" }}</view>
											<i v-if="jobDetail.interviewLat" class="iconfont icon-dizhi11 f16 mr4 biggerSize" style="color: #027aff" data-type="interview"></i>
										</view>
									</view>
								</view>
								<view v-if="jobDetail.OtherInfo">
									<view class="detailH3">其它信息</view>
									<view class="pri" style="line-height: 24px; padding: 3px 8px; border-radius: 4px; color: #333">{{ jobDetail.OtherInfo }}</view>
								</view>
							</view>
							<view class="g_fs_15" v-else>
								<template v-for="(item, index) in templateArr" :key="index">
									<view class="g_flex_row_start flex_center g_fw_600 g_mt_12 g_mb_8 g_fs_16" v-if="item.show">
										<view class="" v-if="item.num == 1">一、</view>
										<view class="" v-if="item.num == 2">二、</view>
										<view class="" v-if="item.num == 3">三、</view>
										<view class="" v-if="item.num == 4">四、</view>
										<view class="" v-if="item.num == 5">五、</view>
										<view class="" v-if="item.num == 6">六、</view>
										<view class="">
											{{ item.type }}
										</view>
									</view>
									<template v-for="(inner, index) in item.children" :key="index">
										<view class="g_flex_row_start g_fs_14" style="line-height: 22px; padding-left: 16px" v-if="inner.show">
											<view class="g_flex_row_start flex_start g_fw_600">
												<view class="g_mr_4" hover-class="none" hover-stop-propagation="false">
													{{ `${inner.num}. ` }}
												</view>
												<view class="g_flex_1">
													{{ `${inner.key}: ` }}
													<text class="g_fw_400 g_ml_4" selectable="false" space="false" decode="false">
														{{ inner.value }}
													</text>
												</view>
											</view>
										</view>
									</template>
								</template>
							</view>
						</view>
						<!-- 职位描述富文本 -->
						<view class="g_flex_column_center" v-if="tabInfo.active == 1">
							<view class="g_fs_16 g_pb_32">
								<view class="g_c_3 g_pt_16 pri">
									<view class="" v-if="from != 'new'">
										<view @click="setCopy('new')" v-if="jobDetail.jobInfoWithoutReturnFee || jobDetail.jobInfo"> <span class="desp-copy" :style="{color: globalData.themeColor, border: '1px solid ' + globalData.themeColor}">复制</span> </view>{{ jobDetail.jobInfoWithoutReturnFee || jobDetail.jobInfo || "-" }}
								</view>
								<view class="" v-else>
										<view @click="setCopy('new')" v-if="jobDetail.cozeJobInfoWithoutReturnFee || jobDetail.jobInfo"> <span class="desp-copy" :style="{color: globalData.themeColor, border: '1px solid ' + globalData.themeColor}">复制</span> </view>{{ jobDetail.cozeJobInfoWithoutReturnFee || jobDetail.jobInfo || "-" }}
									</view>
								</view>
								<view class="" v-if="isLogin">
									<view class="contactInfo" style="white-space: pre-line">{{ userinfo.noticeEndStr ? userinfo.noticeEndStr : "详情咨询：" + userinfo.tel }}</view>
									<view class="g_fs_14 g_text_c g_mt_16" v-if="userinfo.agencyStatus == 1">
										以上联系人，可以
										<span class="g_fw_600" @click="changeContact" style="color: #576b95; text-decoration: underline">改成我的</span>
									</view>
								</view>
							</view>
						</view>
						<view class="" v-if="tabInfo.active == 2">
							<view class="g_pt_16 g_fs_16 pri" style="">
								<view @click.stop="setCopy('old')">
									<span class="desp-copy" :style="{color: globalData.themeColor, border: '1px solid ' + globalData.themeColor}">复制</span>
								</view>
								<rich-text class style="text-align: justify" :nodes="jobDetail.lastNotice"></rich-text>
							</view>
						</view>
					</view>
				</div>
			</view>
			<!-- 底部固定操作栏 -->
			<div class="g_h_104"></div>
			<rh-fixed>
				<slot>
					<div class="g_pl_20 g_pr_20 g_flex_row_center flex_center flex_nw" style="width: 100%">
						<!-- #ifdef MP-WEIXIN -->
						<div class="g_flex_none g_flex_column_center" v-if="from != 'bill'">
							<button class="g_pl_0 g_pr_0 g_bg_f g_mr_16" hover-class="thover" open-type="share" style="line-height: 1">
								<icon class="iconfont icon-zhuanfa1 g_fsi_16" style="color: #787878; line-height: 1; margin-top: -5px"></icon>
								<div class="g_fs_12 g_c_6 g_w_28" style="margin-top: 8px">分享</div>
							</button>
						</div>
						<!-- #endif -->
						<div class="g_flex_none g_flex_column_center" v-if="false && from == 'bill'">
							<button class="g_pl_0 g_pr_0 g_bg_f g_mr_12" hover-class="thover" @click="goEditJob" style="line-height: 1">
								<icon class="iconfont icon-bianji g_fsi_16" style="color: #787878; line-height: 1; margin-top: -5px"></icon>
								<div class="g_fs_12 g_c_6 g_w_28" style="margin-top: 8px">编辑</div>
							</button>
						</div>
						<div class="g_flex_none g_flex_column_center" v-if="from != 'bill'">
							<button class="g_pl_0 g_pr_0 g_bg_f g_mr_12 g_w_36" hover-class="thover" style="line-height: 1; border-radius: 0" @click="handleCollection">
								<icon v-if="isSc" class="iconfont icon-yishoucang g_fsi_16" style="color: #ff4400; line-height: 1; margin-top: -5px"></icon>
								<icon v-else class="iconfont icon-shoucang g_fsi_16" style="color: #787878; line-height: 1; margin-top: -5px"></icon>
								<div class="g_fs_12 g_c_6" style="margin-top: 8px">{{ isSc ? "已收藏" : "收藏" }}</div>
							</button>
						</div>
						<div class="g_flex_none g_flex_column_center" v-if="userinfo && userinfo.agencyId && false">
							<rh-button primaryColor='#00b666' btnText="聊一聊" class="g_flex_1 g_fw_600" size="small_auto" @clickBtn="goIm"></rh-button>
						</div>
						<div class="g_flex_1 g_flex_row_center" v-if="userinfo && userinfo.agencyId">
							<div class="g_flex_none g_flex_column_center g_mr_12">
								<rh-button primaryColor='#00b666' btnText="联系客服" class="g_w_100" size="small_auto" @clickBtn="goIm"></rh-button>
							</div>
							<div class="g_flex_1 g_flex_column_center">
								<rh-button primaryColor='#00b666' btnText="我要报名" class="" size="small_auto" :type="jobDetail.recruitment == 2 ? 'infro' : 'primary'" @clickBtn="handleOpenApplyPopup" style="width: calc(100% - 32px)"></rh-button>
							</div>
						</div>
					</div>
				</slot>
			</rh-fixed>
		</div>
		<!-- 报名弹窗 -->
		<u-popup v-model="applyPopup.isShow" mode="center" border-radius="8" :mask-close-able="false" width="694rpx">
			<div class="g_pt_24 g_pl_32 g_pr_32 g_pb_24 apply">
				<div class="g_flex_row_center g_fs_18 g_c_3 g_fw_600 g_mb_16">报名确认</div>
				<scroll-view>
					<div class="link">
						<div class="item g_flex_row_start g_mb_10">
							<div class="g_flex_none g_fs_14 g_c_3 g_mr_16 g_w_60 g_text_word_c g_flex_column_center">报名岗位</div>
							<div class="g_flex_1 g_ell_1 g_fs_15 g_c_3 g_fw_600 g_flex_column_center">
								{{ jobDetail.jobName }}
							</div>
						</div>
						<div class="item g_flex_row_start g_mb_12">
							<div class="g_flex_none g_fs_14 g_c_3 g_mr_16 g_w_60 g_text_word_c g_flex_column_center">服务费</div>
							<div class="g_flex_1 g_ell_1 g_c_f0 g_fw_700 g_flex_column_center">
								{{ jobDetail.serverPrice }}
							</div>
						</div>
						<div class="item g_mb_10">
							<div class="g_fs_14 g_c_3 label g_mb_5">姓名</div>
							<div>
								<input type="text" v-model="formInfo.userName" placeholder-class="g_c_c" placeholder="请输入姓名或称呼" class="g_bg_f_9 g_radius_4 g_h_40 g_pl_12 g_pr_12" />
							</div>
						</div>
						<div class="item g_mb_10">
							<div class="g_fs_14 g_c_3 label g_mb_5">身份证</div>
							<div style="position: relative; line-height: 40px" :maxlength="18" class="g_bg_f_9 g_radius_4 g_h_40 g_pl_12 g_pr_12">
								<input type="text" maxlength="18" v-model="formInfo.idCard" placeholder-class="g_c_c" class="g_h_40 g_w_200" placeholder="手动输入或拍照自动识别" />
								<div class="t-icon t-icon-paizhao riliIcon" style="width: 16px; height: 14px" @click="getIDCardInfo"></div>
							</div>
						</div>
						<div class="item g_mb_8">
							<div class="g_fs_14 g_c_3 label g_mb_5">联系电话</div>
							<div>
								<input type="text" v-model="formInfo.tel" :maxlength="11" placeholder-class="g_c_c" placeholder="请输入联系电话" class="g_bg_f_9 g_radius_4 g_h_40 g_pl_12 g_pr_12" />
							</div>
						</div>
						<div class="g_fs_11 g_mb_10" style="color: #b8b8b8">注意：不同的报名人填写同一个手机号报名将会失败。</div>
						<div class="item g_mb_12">
							<div class="g_fs_14 g_c_3 label g_mb_5">预约面试时间</div>
							<div @click="show = true" style="position: relative; line-height: 40px" class="g_flex_1 g_bg_f_9 g_radius_4 g_h_40 g_pl_12 g_pr_12">
								<div style="position: absolute; left: 0; top: 0; width: 100%; z-index: 2; padding-left: 12px">
									<picker mode="multiSelector" class="g_h_40" :range="dateTimeArray" :value="dateTime" @change="changeDateTime" @columnchange="changeDateTimeColumn($event)" style="color: #333">
										{{ !!currentTime ? currentTime : "----" }}
									</picker>
								</div>
								<i class="iconfont icon-rili g_fs_16 g_ml_4 g_c_9 riliIcon"></i>
							</div>
						</div>
						<div class="item g_mb_16">
							<div class="g_fs_14 g_c_3 g_mb_5">备注</div>
							<div>
								<textarea v-model="formInfo.desp" placeholder-class="g_c_c" type="textarea" placeholder="请输入备注" class="g_bg_f_9 g_radius_4 g_h_40 g_pl_12 g_pt_6" style="min-height: 80px" />
							</div>
						</div>
						<div class="g_flex_row_center g_flex_row_center g_mb_16" style="color: rgba(0, 0, 0, 0.45)">
							<u-checkbox-group @change="radioGroupChange" shape="circle">
								<u-checkbox v-model="agreeRadio" name="agree" active-color="#00b666">
									<div class="g_flex_row_center g_fs_12 g_flex_row_center">
										<div>我已阅读并同意</div>
										<div @click="goPage('/root/person/agreeUser')" style="color: #576b95">;">《用户协议》</div>
										<div>及</div>
										<div @click="goPage('/root/person/agreeUser')" style="color: #576b95">;">《隐私政策》</div>
									</div>
								</u-checkbox>
							</u-checkbox-group>
						</div>
						<div class="g_flex_row_between item">
							<div class="g_fs_16 g_c_9 g_flex_c g_mr_16" hover-class="btnHoverBg" @click="applyPopup.isShow = false">取消</div>
							<div class="btn g_fs_16 g_c_f g_flex_1 g_flex_c g_ml_16" :style="{'background-color': globalData.themeColor}" hover-class="thover" @click="handleSubmit">确认报名</div>
						</div>
					</div>
				</scroll-view>
			</div>
		</u-popup>
		<canvas type="2d" style="position: absolute; left: -2000px; width: 425px; height: 350px; background: #fff" id="canvasId" ref="canvasId"></canvas>
	</div>
</template>

<script>
import dateTimePicker from "../../libs/utils/dateTimePicker.js";
import dateUtil from "../../libs/utils/dateUtil.js";
import rhJS from '../../libs/utils/base.js';
export default {
	onReady() {
		rhJS.setNavStyle();
	},
	onShareAppMessage() {
		let that = this;
		let path;
		// 职位id_职位创建方_分享人_分享人团队
		path = `/root/detail/job?scene=id=${that.jobDetail.id}_${that.jobDetail.agencyId}_${that.shareUserId || that.userinfo.user.id}_${that.shareUserAgencyId ? (that.isFans == 2 ? that.userinfo.agencyId : that.shareUserAgencyId) : that.userinfo.agencyId}`;
		this.G.Get('/yishoudan/job/view/record/addRecord', { jobId: that.jobDetail.id, classify: 1 }, () => {});
		return {
			promise: new Promise((resolve, reject) => {
				uni.showLoading({
					title: "生成中",
				});
				setTimeout(() => {
					that.getWXCanvas("", "setShare").then((res) => {
						wx.hideLoading();
						resolve({
							title: " ",
							imageUrl: res.tempFilePath,
							path,
						});
					});
				}, 100);
			}),
		};
	},
	mounted() {
		var obj = dateTimePicker.dateTimePicker(this.startYear, this.endYear, this.currentTime);
		this.currentTime = dateUtil.formatDateYMD(new Date().toLocaleDateString()) + " 06:00";
		this.dateTimeArray = obj.dateTimeArray;
		this.dateTime = obj.dateTime;
	},
	data() {
		return {
			isFullscreen: false, // 添加全屏状态跟踪
			globalData: getApp().globalData,
			videoContextTemp: {},
			goImLoading: false, // 跳转im的loading
			isSharePage: false, // 是否是分享页面的判断
			isFans: false,
			shareUserId: null, // 分享人id
			shareJobAgencyId: null, // 分享人id
			shareUserAgencyId: null, // 分享人id
			corpUserFlag: false,
			agreeRadio: ["agree"],
			isPerson: false,
			speed: 0,
			uid: 0,
			jobDetail: {},
			isCollection: false,
			swiperArray: [],
			applyPopup: {
				isShow: false,
			},
			formInfo: {
				userName: "",
				idCard: "",
				tel: "",
				interTime: "",
			},
			startYear: new Date().getFullYear(),
			endYear: new Date().getFullYear() + 2,
			currentTime: "",
			dateTimeArray: null,
			dateTime: [],
			from: "", // 来源页面
			isSc: false, // 收藏判断
			selfJob: false, // 是否是自己团队职位的判断
			showPrice: true, // 隐藏服务费
			labelColor: ["#c41d7f", "#096dd9", "#531dab", "#d46b08", "#389e0d", "#08979c", "#cf1322"],
			bgColor: ["#fff0f6", "#e6f7ff", "#f9f0ff", "#fff7e6", "#f6ffed", "#e6fffb", "#fff1f0"],
			userinfo: {},
			cdnBaseImg: this.G.store().cdnBaseImg,
			IS_CREATOR: false,
			tabInfo: {
				list: [],
				active: 0,
			},
			applyList: [],
			wxPlat: "",
			templateArr: [
				// 职位描述模板
				{
					type: "工作内容",
					show: false,
					childrenType: ["工作内容", "工作方式", "班次工时", "休息", "工衣", "车间", "安检门", "带手机", "流水线"],
					children: [],
				},
				{
					type: "工作要求",
					show: false,
					childrenType: ["性别年龄", "文化学历", "身份证", "资质证件", "纹身烟疤", "案底黑户", "少数民族", "区域要求", "身体状况", "体检要求", "返厂政策"],
					children: [],
				},
				{
					type: "薪资待遇",
					show: false,
					childrenType: ["岗位薪资", "综合月薪", "薪资明细", "发薪日", "银行卡", "预支工资", "岗前培训", "试用期", "员工福利"],
					children: [],
				},
				{
					type: "吃饭住宿",
					show: false,
					childrenType: ["吃饭", "住宿", "保险"],
					children: [],
				},
				{
					type: "押金",
					show: false,
					childrenType: ["餐卡押金", "宿舍押金", "工装押金", "厂牌押金", "工具押金"],
					children: [],
				},
				{
					type: "面试",
					show: false,
					childrenType: ["面试地址", "面试评价", "面试时间", "面试注意事项", "项目驻场"],
					children: [],
				},
				{
					type: "其他",
					show: false,
					childrenType: ["职位描述"],
					children: [],
				},
			],
		};
	},
	props:{
		dataoptions:{
			default:()=>{
				return {}
			}
		},
	},
	mounted() {
		let that = this;
		let options = this.dataoptions;
		console.log("详情", options);
		let loginUrl;
		if (options.id) {
			this.uid = options.id;
			loginUrl = "/root/person/loginIndex?type=detail&path=/root/detail/job";
		} else if (options.scene) {
			var sceneStr = decodeURIComponent(options.scene);
			var sceneJson = rhJS.sceneToJson(sceneStr);
			console.log("sceneJson===", sceneJson);
			console.log("id对应的角色", "职位id_职位项目方_分享人_分享人团队");
			// 职位id_职位创建方_分享人_分享人团队
			this.uid = sceneJson.id.split("_")[0]; // 职位id
			this.shareJobAgencyId = sceneJson.id.split("_")[1]; // 职位创建方id
			this.shareUserId = sceneJson.id.split("_")[2]; // 分享人id
			this.shareUserAgencyId = sceneJson.id.split("_")[3]; // 分享人团队id
			this.isSharePage = true;
			loginUrl = `/root/person/loginIndex?type=detail&path=/root/detail/job&scene=${JSON.stringify(sceneJson)}`;
		}
		this.from = options.from || "home";
		if (!uni.getStorageSync("apply-token")) {
			console.log("apply-token");
			console.log("options.scene", options.scene);
			uni.reLaunch({
				url: loginUrl,
			});
			return;
		}
		this.shareJobAgencyId && this.checkIsFans(this.shareJobAgencyId);

		this.userinfo = uni.getStorageSync("apply-userinfo");
		that.hasSee();
		this.IS_CREATOR = uni.getStorageSync("IS_CREATOR") == 1 ? true : false;
		console.log("this.IS_CREATOR", this.IS_CREATOR);
		this.corpUserFlag = uni.getStorageSync("apply-userinfo").corpUserFlag;
		uni.$on("updateJobDetail", () => {
			this.initDetail();
		});
		if (uni.getStorageSync("apply-token")) {
			this.getIgnore();
			this.initDetail();
		}
		uni.getSystemInfo({
			success: function (res) {
				console.log(res);
				that.wxPlat = res.hostName;
			},
		});
	},
	onShow() {},
	methods: {
		initDetail() {
			let that = this;
			this.getDetail().then((res) => {
				console.log("res", res);
				let objMiddle = res.cozeStructureRes ? JSON.parse(res.cozeStructureRes) : {};
				// let objMiddle = JSON.parse(res.cozeStructureRes);
				console.log("objMiddle", objMiddle);
				delete objMiddle["佣金"];
				delete objMiddle["佣金详情"];
				delete objMiddle["企业位置"];
				delete objMiddle["职位标签"];
				delete objMiddle["职位标题"];
				delete objMiddle["职位分类"];
				delete objMiddle["项目驻场"];
				let num1 = 1;
				this.templateArr.forEach((item) => {
					let num = 0;
					item.children = [];
					item.childrenType.forEach((innerItem) => {
						if (objMiddle[innerItem]) {
							num++;
						}
						item.children.push({
							key: innerItem,
							value: objMiddle[innerItem],
							num,
							show: objMiddle[innerItem] ? true : false,
							edit: false,
						});
					});
					item.num = num1;
					if (item.children[item.children.length - 1].num != 0) {
						item.show = true;
						num1++;
					}
				});
				that.speed = 1;
				// this.toKnowInfo(res.agencyId);
			});
		},
		hasSee() {
			var that = this;
			that.G.Get('/yishoudan/job/view/record/addRecord' + "?jobId=" + that.uid, "", (res) => {
				console.log("res", res);
			});
		},
		goAddress() {
			let that = this;
			uni.navigateTo({
				url: "/root/detail/address?uid=" + that.uid,
			});
		},
		makePhone(tel) {
			uni.makePhoneCall({
				phoneNumber: tel, //仅为示例
			});
		},
		radioGroupChange(e) {
			console.log(e);
		},
		goPage($path) {
			uni.navigateTo({
				url: $path,
			});
		},
		getIgnore() {
			let that = this;
			that.G.Get('/assistant/custom/job/ignore/add' + "/" + that.uid + "?classify=2", {}, (res) => {
				console.log(res);
			});
		},
		toKnowInfo(id) {
			let that = this;
			console.log(id);
			that.G.Get('/assistant/circle/agency/detail' + "/" + id, "", (res) => {
				if (that.userinfo.agencyId == that.jobDetail.agencyId || res.recordStatus == 1 || res.recordStatus == 2) {
					// that.attention = true;
				} else {
					rhJS.handleConfirm({
						title: "关注发单号",
						content: "你还不是他的粉丝，无法查看职位",
						confirmText: "去关注",
						success: (res) => {
							if (res.confirm) {
								let params = {
									id: that.jobDetail.agencyId,
									isShowMore: false,
									jobDetailShow: false,
									shareForm: "apply",
								};
								uni.navigateTo({
									url: "/root/detail/userShare?" + rhJS.objToStr(params),
								});
							}
						},
					});
				}
				that.speed = 1;
			});
		},
		handleCollection() {
			let that = this;
			that.G.Get(
				'/assistant/custom/job/ignore/add' + "/" + that.uid,
				{
					classify: 0,
				},
				(res) => {
					that.isSc = !that.isSc;
					uni.showToast({
						title: that.isSc ? "收藏成功" : "取消收藏",
						icon: "success",
					});
				}
			);
		},
		getDetail() {
			let that = this;
			that.speed = 0;
			return new Promise((resolve) => {
				that.G.Get('/assistant/custom/job/v2/detail' + "/" + that.uid, "", (res) => {
					that.isSc = res.collect == 1 ? true : false;
					console.log("职位详情：", res);
					res = { ...res, ...res.record };
					if (!res.hasOwnProperty("storeJobDetail")) {
						res.storeJobDetail = {
							jobDesp: "",
						};
					}

					console.log("职位详情1：", res);
					that.isPerson = res.agencyId == uni.getStorageSync("apply-agencyId") ? true : false;
					if (that.isPerson) {
						that.tabInfo.list = [
							{
								name: "职位详情",
								active: 1,
								tip: 1,
							},
							{
								name: "通告分享",
								active: 2,
								tip: 2,
							},
							{
								name: "原始通告",
								active: 3,
								tip: 3,
							},
						];
					} else {
						that.tabInfo.list = [
							{
								name: "职位详情",
								active: 1,
								tip: 1,
							},
							{
								name: "通告分享",
								active: 2,
								tip: 2,
							},
						];
					}
					res.agencyServerPrice = rhJS.setReturnFee(res.agencyReturnFee, res.agencyReturnFeeType);
					res.serverPrice = rhJS.setReturnFee(res.returnFee, res.returnFeeType);
					let setData = rhJS.disposeJobListData(res);
					res.addressStr = setData.district.slice(0, -1);
					res.sexStr = setData.genderAge;
					res.genderRestrict = rhJS.getGenderByMinAge(res);
					res.addss = rhJS.setJobInfoPositionv3(res.storeAddr);
					res.monthPay = res.minMonthlyPay / 100 + "-" + res.maxMonthlyPay / 100;
					res.priceStr = res.salaryClassify != 7 ? rhJS.getSalaryClassifyValueHtml(res.salaryClassify, res.salaryClassifyValue) : rhJS.getSalaryClassifyValue(res.salaryClassify, res.minMonthlyPay, res.maxMonthlyPay);
					res.updateTime = rhJS.setDeadLine(res.updateTime, "jiaofu");
					that.swiperArray =
						res.imgs.length == 0
							? []
							: res.imgs.map((item, index) => {
									return {
										id: index + 1,
										image: item.url,
										type: item.url.indexOf(".mp4") > -1 ? "video" : "image",
									};
							  });
					if (res.logo) {
						that.swiperArray.unshift({
							id: 0,
							image: res.logo,
							type: "image",
						});
					}
					that.jobDetail = res;
					that.selfJob = that.jobDetail.agencyId == that.userinfo.agencyId;
					if (that.jobDetail.jobInfo.indexOf("————————" > -1)) {
						that.jobDetail.jobInfo = that.jobDetail.jobInfo.replace(/\*\*\*\*\*/g, "").split("————————")[0];
					} else {
						that.jobDetail.jobInfo = that.jobDetail.jobInfo.replace(/\*\*\*\*\*/g, "");
					}
					var str = that.jobDetail.supplier;
					var reg = /1[3456789]\d{9}/g;
					var phone = str.match(reg);
					if (phone != null) {
						that.jobDetail["phone"] = phone.toString();
					}
					resolve(that.jobDetail);
				});
			});
		},
		handleViewBig($item, $index) {
			let that = this;
			uni.previewImage({
				urls: that.swiperArray.map((item) => {
					return item.image;
				}),
				current: $index,
			});
		},
		goUserMain() {
			let that = this;
			let loginId = uni.getStorageSync("apply-userinfo").agencyId;
			if (loginId == this.jobDetail.agencyId) {
				return;
			}
			let params = {
				id: this.jobDetail.agencyId,
				isShowMore: true,
				isShowJob: true,
				shareForm: "apply",
			};
			uni.navigateTo({
				url: "/root/detail/userShare?" + rhJS.objToStr(params),
			});
		},

		handleOpenApplyPopup() {
			let that = this;
			// if (!this.attention) {
			// 	return false;
			// }
			let params = {
				jobId: this.jobDetail.id,
				jobName: this.jobDetail.jobName,
				title: "报名",
				type: that.jobDetail.jobType,
				agencyId: that.jobDetail.agencyId,
			};
			if (that.isFans !== false) {
				params.isFans = that.isFans;
			}
			that.shareUserId && (params.agencyUserId = that.isFans == 2 ? "" : that.shareUserId);
			// 如果粉丝自己报名,要把自己的id传到报名页,而不是传分享人的
			that.shareUserAgencyId && (params.shareUserAgencyId = that.isFans == 2 ? that.userinfo.agencyId : that.shareUserAgencyId);
			uni.navigateTo({
				url: `/root/home/quickApplication?params=${JSON.stringify(params)}`,
			});
			// if (this.jobDetail.recruitment == 1) {
			// 	this.formInfo = {
			// 		userName: "",
			// 		idCard: "",
			// 		tel: "",
			// 		interTime: "",
			// 	};
			// 	this.applyPopup = {
			// 		isShow: true,
			// 	};
			// } else {
			// 	uni.showToast({
			// 		title: "停招职位不能报名",
			// 		icon: "none",
			// 	});
			// }
		},
		handleToggleCollection() {
			this.isCollection = !this.isCollection;
			if (this.isCollection) {
				uni.showToast({
					icon: "success",
					title: "收藏成功",
				});
			}
		},

		changeDateTime(e) {
			console.log(e);
			var dateTimeArray = this.dateTimeArray,
				dateTime = e.detail.value;
			this.currentTime = dateTimeArray[0][dateTime[0]].replace("年", "") + "-" + dateTimeArray[1][dateTime[1]].replace("月", "") + "-" + dateTimeArray[2][dateTime[2]].replace("日", "") + " " + dateTimeArray[3][dateTime[3]];
		},

		changeDateTimeColumn(e) {
			console.log(e);
			var arr = this.dateTime;
			var dateArr = this.dateTimeArray;
			arr[e.detail.column] = e.detail.value;
			dateArr[2] = dateTimePicker.getMonthDay(dateArr[0][arr[0]], dateArr[1][arr[1]]);
			for (let index = 0; index < dateArr[2].length; index++) {
				dateArr[2][index] = dateArr[2][index] + "日";
			}
			// .replace("年",'').replace("月",'').replace("日",'')
			dateTimeArray = dateArr;
			dateTime = arr;
		},

		handleSubmit() {
			let that = this;
			console.log("that.formInfo", that.formInfo);
			that.formInfo.jobId = that.uid;
			that.formInfo.interviewTimeStr = that.currentTime;
			console.log("that.formInfo1", that.formInfo, that.agreeRadio);
			if (that.formInfo.userName == "") {
				uni.showToast({
					icon: "none",
					title: "请输入您的真实姓名，只包含中文或英文字符",
				});
				return false;
			}
			if (that.formInfo.idCard == "") {
				uni.showToast({
					icon: "none",
					title: "请输入18位有效身份证号码",
				});
				return false;
			}
			if (!rhJS.isValidIdCard(that.formInfo.idCard)) {
				uni.showToast({
					icon: "none",
					title: "请输入正确的身份证号",
				});
				return false;
			}
			if (that.formInfo.tel == "") {
				uni.showToast({
					icon: "none",
					title: "请输入联系电话",
				});
				return false;
			}
			if (!rhJS.setReg(that.formInfo.tel, "tel")) {
				uni.showToast({
					icon: "none",
					title: "请输入正确的联系电话",
				});
				return false;
			}
			if (!that.agreeRadio.length) {
				uni.showToast({
					icon: "none",
					title: "请阅读协议",
				});
				return false;
			}
			that.G.Post('/assistant/apply/handler/add', that.formInfo, (res) => {
				console.log(res);
				uni.showToast({
					icon: "success",
					title: "报名成功",
				});
				that.applyPopup.isShow = false;
			});
		},
		goEditJob() {
			let that = this;
			uni.navigateTo({
				url: "/root/home/jobForm?id=" + that.uid,
			});
		},
		getIDCardInfo() {
			let that = this;

			that.G.uploadImg((res) => {
				console.log("身份证信息：", res);
				this.formInfo.userName = res.info.name;
				this.formInfo.idCard = res.info.num;
				this.formInfo.nation = res.info.nationality;
				this.formInfo.age = res.info.age;
				this.formInfo.address = res.info.address;
				this.formInfo.idCardImageUrl = res.image;
				this.formInfo.sex = res.info.sex == "男" ? 1 : 2;
			}, "idcard");
		},
		// 显示视频
		showVideo(e) {
			var that = this;
			console.log("showVideo e", e);
			console.log("showVideo that.swiperArray", that.swiperArray);
			this.videoContext = uni.createVideoContext(`${e.id}`, this);
			that.videoContextTemp = that.videoContext;
			this.videoContext.requestFullScreen({
				direction: "landscape", // 横屏全屏
			});
			this.videoContext.hideStatusBar();
			this.videoContext.play();
		},
		takeTel($item) {
			console.log($item);
			// if ($item) {
			uni.makePhoneCall({
				phoneNumber: $item.customServiceUser.tel,
			});
			// }
		},
		kefu(e) {
			console.log(e);
			console.log(this.jobDetail);
			console.log(this.jobDetail.storeJobDetail);
			var that = this;

			let url = this.jobDetail.storeJobDetail.customServiceUrl;
			// console.log('/pages/detail/index?storeJobId' + this.data.searchForm.storeJobId);
			if (url != "") {
				uni.openCustomerServiceChat({
					// extInfo: { url: 'https://work.weixin.qq.com/kfid/kfc84d8465f4c633511' },
					extInfo: { url: url || "https://work.weixin.qq.com/kfid/kfc84d8465f4c633511" },
					showMessageCard: true,
					sendMessagePath: `/root/detail/job.html?id=${that.uid}&classify=${that.jobDetail.classify}`,
					corpId: "wwc227639d3a136c8d",
					success(res) {
						console.log("res", res);
					},
					fail(err) {
						console.log("err", err);
					},
				});
			} else {
				uni.showToast({
					title: "该岗位暂无客服",
					icon: "none",
					duration: 2000,
				});
			}
		},
		fullScreen(e) {
			console.log(e);
			this.muted = true;
			this.isFullscreen = e.detail.fullScreen; // 更新全屏状态

			if (!e.detail.fullScreen) {
				this.videoContext.stop();
			}
		},
		shareVideo(e) {
			var that = this;
			console.log(e);
			uni.showLoading({
				title: "下载中...",
				mask: true,
			});
			if (this.wxPlat == "wxwork") {
				uni.downloadFile({
					url: e.image, // 下载url
					success: (downloadRes) => {
						uni.saveVideoToPhotosAlbum({
							filePath: downloadRes.tempFilePath,
							success: () => {
								console.log("视频已保存到相册");
							},
							fail: () => {
								console.error("保存视频到相册失败");
							},
						});
						uni.hideLoading();
					},
					fail: () => {
						uni.hideLoading();
						console.error("下载文件失败");
					},
				});
			} else {
				uni.downloadFile({
					url: e.image, // 下载url
					success(res) {
						// 下载完成后转发
						uni.hideLoading();
						uni.showLoading({
							title: "分享中...",
							mask: true,
						});
						uni.shareVideoMessage({
							videoPath: res.tempFilePath,
							success() {
								uni.hideLoading();
								console.log("=================-----=========");
								console.log(that.videoContextTemp);
								that.videoContextTemp.exitFullScreen();
								// uni.setNavigationBarTitle({
								//   title: '当前页面'
								// })
							},
							fail: (res) => {
								console.log(res);
								console.log("失败原因1111");
								uni.hideLoading();
								uni.showToast({
									title: "分享失败",
								});
							},
						});
					},
					fail: (res) => {
						console.log("失败原因" + res);
						uni.hideLoading();
						uni.showToast({
							title: "下载失败",
						});
					},
				});
			}
		},
		handleUpdateTab(e) {
			let that = this;
			rhJS.isLogin();
			if (rhJS.isLogin()) {
				that.tabInfo.active = e;
			}
		},
		showFee() {
			let that = this;
			let content, title;
			if (that.jobDetail.returnFeeDesp) {
				title = "佣金: " + that.jobDetail.serverPrice;
				content = that.jobDetail.returnFeeDesp;
			} else {
				title = "费用待定";
				content = "费用暂未公布";
			}

			rhJS.handleConfirm({
				title,
				content,
				contentColor: "#ccc",
				confirmColor: "#576b95",
				confirmText: "确定",
				showCancel: false,
				success(res) {},
			});
		},
		// 复制通告
		setCopy(e) {
			var that = this;
			let text;
			console.log(e);
			if (e == "new") {
				text = that.from != "new" ? that.jobDetail.jobInfoWithoutReturnFee || that.jobDetail.jobInfo : that.jobDetail.cozeJobInfoWithoutReturnFee;
			} else if (e == "old") {
				text = that.jobDetail.lastNotice;
			} else if (e == "jobName") {
				text = that.jobDetail.jobName + "@" + (that.jobDetail.agencyName || "-");
			}
			console.log("text", text);
			uni.setClipboardData({
				data: text,
				success(res) {
					console.log(res.data); // data
					uni.showToast({
						title: "复制成功",
						icon: "success",
					});
				},
			});
		},
		goIm() {
			let that = this;
			if (that.goImLoading) {
				return false;
			}

			that.goImLoading = true;
			that.F.wyyxGet('/yishoudan/job/customer/support/getJobCustomerSupportIM' + "?jobId=" + that.jobDetail.id, {}, (cusData) => {
				that.F.wyyxPost(
					'/wyyx/conversations/startConversations',
					{
						// senderUserId: uni.getStorageSync("apply-uid"),
						// receiverUserId: cusData,
						senderAccid: uni.getStorageSync("im-accid"),
						receiverAccid: cusData.accid,
					},
					(res) => {
						uni.$UIKitStore.uiStore.selectConversation(res.conversationId);
						console.log("that.jobDetail", that.jobDetail);
						let list = ["addss", "genderRestrict", "genderAge"];
						let newList = [];
						list.forEach((item) => {
							if (that.jobDetail[item]) {
								newList.push(that.jobDetail[item]);
							}
						});
						that.jobDetail.info = newList.join("丨");
						that.F.wyyxPost(
							'/wyyx/messages/sendMessages100',
							{
								conversationType: 1,
								senderAccid: uni.getStorageSync("im-accid"),
								receiverAccid: cusData.accid,
								type: 100000,
								jobDetail: {
									title: that.jobDetail.jobName,
									info: that.jobDetail.info,
									label: that.jobDetail.jobRequestLabelNames.length > 0 ? that.jobDetail.jobRequestLabelNames : "",
									salaryClassifyValue: that.jobDetail.priceStr,
									serviceFee: that.jobDetail.fuWuFei,
									monthPay: that.jobDetail.monthPay,
									jobId: that.uid,
								},
							},
							() => {
								// uni.navigateTo({
								// 	url: "/root/NEUIKit/pages/Chat/index",
								// });
							},
							() => {}
						);
					},
					() => {}
				);
			});
		},
		// 微信端绘制
		getWXCanvas(sharelImg, type) {
			const that = this;
			return new Promise((resolve) => {
				var mycenter = 0; //文字左右居中显示
				var myheight = 0; //文字高度
				const query = uni.createSelectorQuery().in(this);
				query
					.select("#canvasId")
					.fields({
						node: true,
						size: true,
					})
					.exec((res) => {
						console.log("uni 获取节点信息：", res);
						const canvas = res[0].node;
						const ctx = canvas.getContext("2d");
						that.setShareCover(ctx, canvas, mycenter).then((canvas) => {
							uni.canvasToTempFilePath({
								canvas: canvas,
								success(res) {
									resolve(res);
								},
								fail(res) {
									uni.hideLoading();
									uni.showToast({
										title: res.errMsg,
										icon: "error",
									});
								},
							});
						});
					});
			});
		},
		/**
		 * 生成分享小程序的封面
		 */
		setShareCover(ctx, canvas, mycenter) {
			let that = this;
			canvas.width = 750;
			canvas.height = 600;
			mycenter = canvas.width / 2;
			let labelLeft = 0;
			let baseLeft, logoSize, titleFontSize, mainFontSize, line1, line2, line3, line4, line5, line6, line7, line8;
			baseLeft = 24; // 左侧基准线
			logoSize = 132; // logo尺寸
			mainFontSize = 36; // 内容字体大小
			titleFontSize = 56; // 标题字体大小
			let dis = 0,
				labelHeight = 0;
			line1 = 0; // 第一行距顶部距离
			line2 = 90 - dis;
			line3 = 200 - dis;
			line4 = 280 - dis;
			line5 = 350 - dis - labelHeight;
			line6 = 380 - dis - labelHeight - 0;
			line7 = 460 - dis - labelHeight;

			// 绘制基础白色背景
			console.log("that.jobDetail", that.jobDetail);
			rhJS.roundRect1(ctx, 0, 0, 750, 600, 0, "#fff");
			return new Promise(function (imgres) {
				// 岗位标题
				rhJS.fillTextLineBreak(ctx, that.jobDetail.jobName.length > 11 ? that.jobDetail.jobName.slice(0, 11) + "..." : that.jobDetail.jobName, baseLeft, line2, 800, 20, "#000", titleFontSize, "500", "left");

				// 时薪
				if (rhJS.getSalaryClassifyValue(that.jobDetail.salaryClassify, that.jobDetail.salaryClassifyValue) == "0-0元/月") {
					// 月工资
					rhJS.fillTextLineBreak(ctx, that.jobDetail.priceStr, baseLeft, line3, 600, 40, "#ff4400", titleFontSize + 6, "600", "left");
				} else {
					// 月工资
					rhJS.fillTextLineBreak(ctx, rhJS.getSalaryClassifyValue(that.jobDetail.salaryClassify, that.jobDetail.salaryClassifyValue), baseLeft, line3, 400, 40, "#ff4400", titleFontSize + 6, "600", "left");
					rhJS.fillTextLineBreak(ctx, that.jobDetail.monthPay, 750 - ctx.measureText(that.jobDetail.monthPay).width, line3 + 6, 400, 20, "#ff4400", titleFontSize, "400");
				}

				if (that.jobDetail.jobRequestLabelNames.length > 0) {
					that.jobDetail.jobRequestLabelNames.forEach((item1, index) => {
						if (index <= 3) {
							rhJS.fillTextLineBreak(ctx, item1, baseLeft + labelLeft + 12, line4 + 4, 400, 40, "#666", mainFontSize); // 标签字符
							rhJS.roundRect1(ctx, baseLeft + labelLeft, line4 - 38, ctx.measureText(item1).width + 24, 56, 8, "#00000012");
							labelLeft += ctx.measureText(item1).width + 42;
							if (index == 3) {
								labelLeft = 0;
							}
						} else if (index > 3 && index <= 6) {
							rhJS.roundRect1(ctx, baseLeft + labelLeft, line5 - 38, ctx.measureText(item1).width + 24, 56, 8, "#00000012");
							rhJS.fillTextLineBreak(ctx, item1, baseLeft + labelLeft + 12, line5 + 4, 400, 40, "#666", mainFontSize); // 标签字符
							labelLeft += ctx.measureText(item1).width + 42;
						}
					});
				}
				// 根据标签数量调整宣传标语位置
				rhJS.roundRect1(ctx, mycenter - 712 / 2, line6, 712, 60, 4, "#fff6e8"); // 宣传标语背景
				// 绘制立即咨询
				// 根据标签数量调整立即咨询背景位置
				rhJS.roundRect1(ctx, mycenter - 712 / 2, line7, 712, 100, 4, "#00b666"); // 立即咨询背景
				// 根据标签数量调整立即咨询位置
				rhJS.fillTextLineBreak(ctx, "立即咨询", mycenter - 24 - ctx.measureText("立即咨询").width / 2, line7 + 65, 300, 120, "#fff", titleFontSize, "500"); // 立即咨询
				// 绘制职位logo
				uni.downloadFile({
					url: "https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/pugongying/goxj2-qpwbo.png",
					success(res) {
						console.log("duihao", res);
						const img1 = canvas.createImage();
						img1.src = res.tempFilePath;
						console.log("img info img", img1);
						img1.onload = (info) => {
							console.log("img info", info);
							let safeMarkPosition = 44;
							// 宣传标语
							["安全保障", "工资保障", "补贴保障"].forEach((item1, index) => {
								// 根据标签数量调整安全标识位置
								rhJS.fillTextLineBreak(ctx, item1, baseLeft + safeMarkPosition, line6 + 40, 100, 32, "#fca025");
								rhJS.roundRect(ctx, img1, baseLeft + safeMarkPosition - 36, line6 + 12, 32, 32, 12);
								safeMarkPosition += 130 + ctx.measureText(item1).width;
							});
							setTimeout(() => {
								imgres(canvas);
							}, 200);
						};
					},
					fail(err) {
						console.log("downloadFile err", err);
					},
				});
			}).catch((err) => {
				console.log("all err", err);
			});
		},
		checkIsFans(upAgencyId) {
			let that = this;
			that.G.Post("/assistant/circle/agency/checkUserTypeForAssistant", { upAgencyId }, (res) => {
				console.log("isFans", res);
				that.isFans = res;
			});
		},
	},
};
</script>

<style lang="scss">
.shareVideo {
	position: absolute;
	bottom: 80px;
	right: 30px;
	width: 36px;
	height: 36px;
	text-align: center;
	z-index: 1111;
	background-color: #ffffff66;
	border-radius: 50%;
	.iconfont {
		color: #fff;
		font-size: 20px;
		line-height: 36px;
		&.icon-huidaodingbu {
			transform: rotate(180deg);
		}
	}
}

.p-root-detail-job {
	.m-boss {
		.box {
			background-color: rgba(0, 182, 102, 0.05);
		}
	}
	.m-banner {
		.u-swiper__wrapper__item {
			margin-right: 10px;
		}

		image {
			border-radius: 4px !important;
		}

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

			.scroll-content {
				display: inline-block;
				white-space: nowrap;

				.scroll-item {
					display: inline-block;
					width: 58px;
					height: 58px;
					margin-right: 12px;
					vertical-align: top;

					&:last-child {
						margin-right: 0;
					}

					.videoContainer {
						position: relative;
						background-color: #000; // 黑色背景

						.theVideo {
							width: 100%;
							height: 100%;

							// 小图时隐藏控制栏
							::v-deep .uni-video-controls {
								display: none !important;
							}

							// 全屏时显示控制栏
							::v-deep .uni-video-fullscreen-controls {
								display: block !important;
							}
						}

						// 小图时只显示居中的播放按钮
						::v-deep .uni-video-cover-play-button {
							display: block !important;
							width: 40px;
							height: 40px;
							margin: auto;
						}
					}
				}
			}
		}

		// .swiper {

		// 	// 为最后一个视频项目添加特殊处理
		// 	swiper-item:last-child {
		// 		.videoContainer {
		// 			// 确保视频容器不会被裁剪
		// 			overflow: visible !important;

		// 			.theVideo {
		// 				// 确保视频元素能够完整显示
		// 				width: 100%;
		// 				height: 100%;
		// 			}

		// 			.shareVideo {
		// 				// 调整分享按钮位置，确保不会遮挡视频
		// 				right: 10px;
		// 				bottom: 10px;
		// 			}
		// 		}
		// 	}
		// }
	}

	.m-state {
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 1;
		box-shadow: 0px -4rpx 8rpx 0px rgba(218, 218, 218, 0.5);
	}
	.apply {
		.link {
			.item {
				.btn {
					width: 240rpx;
					height: 76rpx;
					border-radius: 42rpx;
					&:first-child {
						border: 2rpx solid #00b666;
					}
				}
				.label {
					position: relative;
					&::before {
						content: "*";
						color: #ff0000;
					}
				}
			}
		}
	}
	.riliIcon {
		position: absolute;
		right: 15px;
		top: 50%;
		transform: translateY(-50%);
		z-index: 1;
	}
	.servicePrice {
		height: 64px; // background-color: #ffeee7;
		// border-right-color: transparent;
		// border-left-color: transparent;
		// width: 100vw;
		// margin-left: -20px;
	}
	.kefuBox {
		position: fixed;
		right: 25px;
		bottom: 182px;
		z-index: 9999;
		.iconBox {
			width: 48px;
			height: 48px;
			margin-bottom: 12px;
			border-radius: 50%;
			text-align: center;
			line-height: 48px;
			box-shadow: 2px 0 12px 2px rgba(108, 108, 108, 0.2);
			background: #fff;
			z-index: 9999;
		}
	}
	.desp-copy {
		font-size: 12px;
		float: right;
		/* top: 11px;
  right: 8px;
  position: relative; */
		border-radius: 25rpx;
		padding: 0px 8px;
		height: 16px;
		line-height: 16px;
		margin-right: 16px;
	}
	.detailH3 {
		font-size: 16px;
		font-weight: 400;
		color: #000;
		line-height: 22px;
		margin-top: 16px;
		margin-bottom: 8px;
	}
	.pri {
		white-space: pre-line;
	}
	.pri:empty:before,
	.textb1:empty:before {
		content: "-" !important;
		color: #333;
	}
}

.g_hs_67 {
	height: 60px;
}
</style>
