You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2025 lines
67 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view class="p-root-detail-job g_ml_10 g_mr_10 g_mt_10 g_kuaishou">
<!-- {{ from }} -->
<!-- {{ selfJob }} -->
<view class="g_pt_16 g_pb_16 g_pl_16 g_pr_16 g_radius_8 g_bg_f">
<view v-if="speed == 0" class="">
<rh-loading />
</view>
<view v-if="speed == 1" class="">
<view class="m-info g_mb_12">
<view class="g_flex_1">
<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.aliasJobName || jobDetail.jobName }}</view>
<view class="g_fs_14 g_c_9">
{{ jobDetail.updateTime }}
</view>
<!-- <view class="g_flex_none g_flex_column_center">
<g-panel-server :str="attention ? jobDetail.serverPrice : '关注查看'" verson="new" />
</view> -->
</view>
<template v-if="jobDetail.classify == 1">
<view class="g_c_9">
<view class="g_flex_row_between flex_center g_mb_12" v-if="jobDetail.addss">
<!-- <view class="g_flex_column_center">
<i class="iconfont icon-dingwei2 g_c_6 g_fs_17 g_lh_1_2"></i>
</view> -->
<view class="g_fs_14 g_ml_4 g_lh_1_2 g_flex_column_center">
{{ (jobDetail.addss ? jobDetail.addss + " | " : "") + jobDetail.genderAge }}
</view>
</view>
<!-- <view class="g_flex_row_start">
<view class="g_fs_14 g_ml_4 g_lh_1_2 g_flex_column_center">{{ jobDetail.genderAge }} </view>
</view> -->
</view>
</template>
</view>
</view>
<view class="g_flex_row_start" v-if="jobDetail.jobSpecialLabelNames">
<!-- :style="{ color: labelColor[index % labelColor.length], 'background-color': bgColor[index % bgColor.length] }" -->
<view v-for="(item, index) in jobDetail.jobSpecialLabelNames" :style="{ color: `${labelColor[index % labelColor.length]}`, 'background-color': `${bgColor[index % bgColor.length]}` }" class="g_mr_8 g_mb_8 g_pl_4 g_pr_4"> {{ item }}</view>
</view>
<!-- <view class="g_flex_row_start" v-if="appid == 'wxb0c590fd696b79be' && isUseNewJob">
<view v-for="(item, index) in jobDetail.jobRequestLabelNames" :style="{ color: `${labelColor[index % labelColor.length]}`, 'background-color': `${bgColor[index % bgColor.length]}` }" class="g_mr_8 g_mb_4 g_pl_4 g_pr_4 g_c_6 g_bg_f_5"> {{ item }}</view>
</view> -->
<view class="g_flex_row_start flex_center g_mt_8">
<view class="g_fs_16 g_fw_600 g_c_f40 g_lh_1_2 g_flex_column_center" v-if="jobDetail.priceStr">
{{ jobDetail.priceStr }}
</view>
<view class="g_fs_14 g_c_9" v-if="jobDetail.monthPay && jobDetail.priceStr && jobDetail.priceStr.indexOf('元/月') == -1">
{{ jobDetail.monthPay ? "丨" + jobDetail.monthPay : "" }}
</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">
<view class="g_flex_none g_flex_column_center">
<i class="iconfont icon-dizhi1 g_c_main g_mr_10 g_w_14 g_h_14"></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>
<!-- 轮播banner -->
<!-- 轮播banner -->
<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>
<!-- #ifdef H5 || APP-PLUS -->
<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>
<!-- #endif -->
</view>
</view>
</scroll-view>
</view>
<!-- 职位描述富文本 -->
<view class="g_flex_row_center g_border_e_b">
<u-tabs inactive-color="#000000" bg-color="transparent" :list="tabInfo.list" :current="tabInfo.active" :active-color="globalData.themeColor" bar-width="32" bar-height="6" @change="setType" :gutter="50" font-size="36" duration="0.05" height="76"></u-tabs>
</view>
<view class="" v-if="tabInfo.active == 0">
<view class="g_fs_15">
<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_18" 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" style="font-size: 16px">
{{ `${inner.num}. ` }}
</view>
<view class="g_flex_1" style="font-size: 16px">
{{ `${inner.key}: ` }}
<text class="g_fw_400 g_ml_4" selectable="false" space="false" decode="false" style="font-size: 16px">
{{ inner.value }}
</text>
</view>
</view>
<!-- @blur="inner.edit = false" -->
</view>
</template>
</template>
</view>
</view>
<view class="g_flex_column_center" v-if="tabInfo.active == 1">
<view class="g_fs_16">
<!-- <view class="g_fw_600 g_flex_row_start flex_center g_mb_8 g_mt_16"> <view class="g_mr_12 g_bg_main" style="width: 4px; height: 19px; border-radius: 2px"> </view>职位描述 </view> -->
<view class="g_c_0 g_pt_12 g_fs_18" style="white-space: pre-line">
<view @click="setCopy" v-if="jobDetail.jobInfoWithoutReturnFee || jobDetail.jobInfo">
<span class="desp-copy g_c_main g_border_main">复制</span>
</view>
{{ jobDetail.jobInfoWithoutReturnFee || jobDetail.jobInfo || "-" }}
</view>
</view>
</view>
<!-- 底部固定操作栏 -->
<g-panel-fixed>
<slot>
<view class="g_pl_20 g_pr_20 g_flex_row_center flex_center flex_nw" style="width: calc(100% - 0px)">
<view class="g_flex_none g_flex_column_center" v-if="from != 'bill'">
<!-- @click="showShareImg" -->
<button class="g_pl_0 g_pr_0 g_bg_f g_mr_16" hover-class="thover" v-if="envVersion != 'trial'" style="line-height: 1" open-type="share">
<icon class="iconfont icon-zhuanfa1 g_fsi_16" style="color: #787878; line-height: 1; margin-top: -5px; font-size: 19px !important"> </icon>
<view class="g_fs_12 g_c_6 g_w_28" style="margin-top: 4px">分享</view>
</button>
</view>
<!-- && miniAppInfo.id != loginInfo.agencyId -->
<!-- <view class="g_flex_none g_flex_column_center" v-if="attention && 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 :class="['iconfont g_mr_2', isSc ? 'icon-heart-fill g_c_f0' : 'icon-heart g_c_6']" style="line-height: 1; margin-top: -5px; font-size: 20px !important"> </icon>
<view class="g_fs_12 g_c_6" style="margin-top: 4px">{{ isSc ? "已收藏" : "收藏" }}</view>
</button>
</view> -->
<view class="g_flex_none g_flex_column_center">
<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="goIm">
<icon class="iconfont icon-message" style="color: #787878; line-height: 1; margin-top: -5px; font-size: 20px !important"> </icon>
<view class="g_fs_12 g_c_6" style="margin-top: 4px">IM</view>
</button>
</view>
<view class="g_flex_1 g_flex_column_center" hover-class="none" hover-stop-propagation="false">
<view class="g_flex_row_end" hover-class="none" hover-stop-propagation="false">
<view class="g_flex_none g_flex_column_center" style="margin-right: 8px; width: 100px" v-if="attention && from != 'bill' && jobDetail.agencyId != loginInfo.agencyId && false">
<view v-if="!isLogin" class="g_flex_column_center">
<rh-quicklogin mobileToLogin="/appLoginByTelAssistant" codeToMobile="/getWechatTel" @exportSetToken="pushSetToken('relationService')">
<rh-button
:cusStyle="{
position: 'relative',
top: '-1px',
right: '-1px',
}"
btnText="联系客服"
class="g_flex_1 g_fw_600"
size="small_auto"
></rh-button>
</rh-quicklogin>
</view>
<view v-else class="g_flex_column_center">
<rh-button
btnText="联系客服"
class="g_fw_600 g_mr_12 g_w_100"
size="small_auto"
@clickBtn="showService"
:cusStyle="{
position: 'relative',
top: '-1px',
right: '-1px',
}"
>
</rh-button>
</view>
</view>
<view class="g_flex_1 g_flex_column_center">
<view v-if="!isLogin" class="">
<rh-quicklogin mobileToLogin="/appLoginByTelAssistant" codeToMobile="/getWechatTel" @exportSetToken="pushSetToken('record')">
<rh-button
:cusStyle="{
position: 'relative',
top: '-1px',
right: '-1px',
}"
btnText="立即报名"
class="g_flex_1 g_fw_600"
size="small_auto"
type="primary"
></rh-button>
</rh-quicklogin>
</view>
<view v-else class="">
<rh-button
:cusStyle="{
position: 'relative',
top: '-1px',
right: '-1px',
}"
btnText="立即报名"
class="g_flex_1 g_fw_600"
size="small_auto"
:type="jobDetail.recruitment == 2 || !attention ? 'infro' : 'primary'"
@clickBtn="handleOpenApplyPopup"
></rh-button>
</view>
</view>
</view>
</view>
</view>
</slot>
</g-panel-fixed>
</view>
</view>
<view class="g_h_104s"></view>
<view class="g_pt_10 pop-container" :class="showServicePop ? 'show' : ''" v-if="false">
<view class="g_p_8 g_bg_f g_border_e">
<view class="g_flex_row_between">
<view class="g_flex_row_start flex_center">
<view>
<view class="g_bg_main g_c_f g_flex_row_center g_fs_24 flex_center g_w_36 g_h_36 g_mr_4 g_radius_50 icon-kefu iconfont" />
</view>
<view>
<view class="g_fs_14">专属招聘客服</view>
<view class="g_fs_12 g_c_6">您好!是否需要帮您推荐职位?</view>
</view>
</view>
<view class="g_flex_row_end flex_center">
<view class="g_w_62 g_mr_6" @click="showServicePop = false">
<rh-button btnText="稍后再说" height="28" fontSize="12" class=" " size="small_auto" type="infro" @clickBtn="showServicePop = false"></rh-button>
</view>
<view class="g_w_62">
<rh-button btnText="立即咨询" height="28" fontSize="12" class="" size="small_auto" type="primary" @clickBtn="showService"></rh-button>
</view>
</view>
</view>
</view>
</view>
<u-popup v-model="canvasInfo.isShow" border-radius="8" mode="bottom" :closeable="true" :mask-close-able="false">
<view class="g_pt_24 g_pb_24 g_h_all g_w_all g_flex_row_center">
<!-- #ifdef MP-WEIXIN -->
<image :src="canvasInfo.posterImg" class="g_pb_24" style="height: 75vh; width: calc(75vh * 0.52)" :show-menu-by-longpress="true" mode="aspectFit|aspectFill|widthFix" lazy-load="false"></image>
<!-- #endif -->
<!-- #ifdef H5 || APP-PLUS -->
<view class="canvas-card g_position_rela g_flex_row_center" id="canvas-card" style="">
<view class="m-card g_position_abso g_w_all" style="left: 50%; transform: translateX(-50%)">
<view class="g_c_f g_fs_12 g_fw_600 g_mt_92 g_text_c"> {{ userInfo.agencyName }} </view>
<view class="g_bg_f g_mt_48 g_flex_row_center g_p_10" style="width: 90%; height: 118px; border-radius: 4px">
<view class="g_fs_16 g_fw_600 g_mb_8">
{{ jobDetail.jobName }}
</view>
<view class="g_flex_row_start">
<image class="g_w_40 g_h_40" :src="jobDetail.logo" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""> </image>
<view class="g_ml_8">
<view class="g_c_f40 g_fs_16 g_mb_4">
<span class="g_fw_600 g_mr_4">
{{ jobDetail.priceStr }}
</span>
<span class="g_fs_14">
{{ jobDetail.monthPay }}
</span>
</view>
<view class="g_fs_12 g_c_6">
{{ jobDetail.shortDistrict }}
<span class="g_fs_12">
{{ jobDetail.age }}
</span>
</view>
</view>
</view>
<view class="g_flex_row_start g_fs_12 g_mt_8">
<view v-for="(item, index) in jobDetail.jobSpecialLabelNames" v-if="index < 3" style="background-color: #ddd; color: #333" class="g_mr_8 g_p_2 g_radius_4"> {{ item }}</view>
</view>
</view>
<view class="g_mt_48 g_text_c">
<view class="g_fs_12 g_c_f"> 长按查看职位详情 </view>
<view class="m-logo g_flex_c">
<image
:src="canvasInfo.wxCode"
class="g_flex_row_center"
:style="{
width: 141 + 'px',
height: 141 + 'px',
top: '302px',
}"
></image>
</view>
<view class="g_fs_14 g_c_f"> 好工作 放心干 </view>
</view>
</view>
</view>
<!-- #endif -->
<rh-button btnText="保存到相册" type="primary" @clickBtn="saveToalbum"></rh-button>
</view>
</u-popup>
<u-popup v-model="applyPopup.isShow" mode="center" negative-top="300" :uZindex="1" border-radius="12" :closeable="true" :mask-close-able="true">
<view class="">
<!-- <view class="g_text_c g_fs_18 g_fw_600 g_pt_18 g_flex_c" style="position: absolute; top: 0; left: 0; width: 100%">快速报名</view> -->
<applyPanel :jid="jobDetail.id" :subLoading="btnLoading" @exportForm="submitApply" />
</view>
</u-popup>
<u-popup v-model="serviceShow" mode="center" border-radius="8" :mask-close-able="false" width="600rpx">
<i class="iconfont icon-guanbi g_c_6" style="position: absolute; right: 12px; top: 12px" @click="hideService"></i>
<div class="g_pt_32 g_pb_32 g_text_c">
<p class="g_fs_18 g_mb_24 g_fw_600">加客服微信</p>
<div class="g_pb_32 g_fs_14 g_c_6" @click.stop="makePhoneCall" :mark:tel="currentStore.tel">联系电话: {{ currentStore.splitPhone }}</div>
<!-- <image src="https://open.work.weixin.qq.com/wwopen/userQRCode?vcode=vc42c1ec51fd446856" :show-menu-by-longpress="true" style="width: 184px; height: 184px"></image> -->
<image class="" style="width: 184px; height: 184px" :src="currentStore.wechatQrcode" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" show-menu-by-longpress> </image>
<p class="g_fs_12 g_mt_12">长按识别二维码</p>
</div>
</u-popup>
<u-popup v-model="showPushJobPop" mode="center" negative-top="300" :uZindex="1" border-radius="12" :closeable="false" :mask-close-able="true">
<view class="g_p_16" style="width: 80vw">
<view class="g_fs_18 g_fw_600 g_text_c">客服联系</view>
<view class="g_text_c g_mt_16">
<view class="g_fs_15"> 允许客服主动联系,快速推荐合适岗位 </view>
<view class="g_flex_row_end flex_center g_mt_12">
<checkbox-group class="dib" name="acheck" @change="switchRadioChange">
<label>
<checkbox :checked="pushJobChecked" value="acheck" class="dib biggerSize" color="#3578f6" style="transform: scale(0.7)" />
</label>
</checkbox-group>
<view class="g_fs_14">七天内不再提示</view>
</view>
<view class="g_flex_row_end flex_center g_mt_16">
<view class="g_w_64 g_mr_10" @click="handlePushJob('unallowed')">
<rh-button btnText="不允许" height="32" fontSize="12" class=" " size="small_auto" type="infro"></rh-button>
</view>
<view class="g_w_64">
<view v-if="!isLogin" class="g_flex_column_center">
<rh-quicklogin mobileToLogin="/appLoginByTelAssistant" codeToMobile="/getWechatTel" @exportSetToken="pushSetToken('pushJob')">
<rh-button btnText="允许" height="32" fontSize="12" class="" size="small_auto" type="primary"></rh-button>
</rh-quicklogin>
</view>
<rh-button v-else btnText="允许" height="32" fontSize="12" class="" size="small_auto" type="primary" @clickBtn="handlePushJob('allow')"></rh-button>
</view>
</view>
</view>
</view>
</u-popup>
<canvas type="2d" style="position: absolute; left: -2000px; width: 425px; height: 350px; background: #fff" id="canvasId" ref="canvasId"></canvas>
</view>
</template>
<script>
// #ifdef H5 || APP-PLUS
// import html2canvas from "html2canvas";
// #endif
// #ifdef H5
import { saveAs } from "file-saver";
// #endif
import dateTimePicker from "../../utils/dateTimePicker.js";
// import dateUtil from "../../utils/dateUtil.js";
import applyPanel from "../../pages/home/child/applyRecord.vue";
import _G from "./utils/commonSub.js";
export default {
onReady() {
this.G.setNavStyle();
},
onShareAppMessage() {
let that = this;
let path;
if (this.isMember) {
path = `/root/detail/job?id=${that.jobDetail.id}&from=home&userId=${that.userInfo.user.id}`;
} else {
path = `/root/detail/job?id=${that.jobDetail.id}&from=home`;
}
// console.log("path", path);
return {
promise: new Promise((resolve, reject) => {
that.getWXCanvas("", "setShare").then((res) => {
// console.log("getWXCanvas", res);
wx.hideLoading();
resolve({
// title: "你想找的厂都有,立即查看",
title: "",
imageUrl: res.tempFilePath,
path,
});
});
}),
};
},
mounted() {
var obj = dateTimePicker.dateTimePicker(this.startYear, this.endYear, this.currentTime);
this.currentTime = this.G.formatDateYMD(new Date().toLocaleDateString()) + " 06:00";
this.dateTimeArray = obj.dateTimeArray;
this.dateTime = obj.dateTime;
},
components: {
applyPanel,
},
data() {
return {
pushJobChecked: false, // 是否七天内显示
showPushJobPop: false,
showServicePop: false, // 显示客服下拉弹窗
isFullscreen: false, // 添加全屏状态跟踪
tabInfo: {
list: [
{
name: "职位详情",
key: "0",
},
{
name: "通告分享",
key: "1",
},
],
active: 0,
},
goImLoading: false,
isUseNewJob: getApp().globalData.isUseNewJob,
appid: getApp().globalData.appId,
globalData: getApp().globalData,
isLogin: false,
envVersion: uni.getStorageSync("ENV_VERSION"), // 小程序环境判断
isMember: uni.getStorageSync("IS_MINIAPP_MEMBER"), // 登陆者是否当前小程序成员的判断
hasPermission: uni.getStorageSync("HAS_PERMISSION") == 1 ? true : false, // 登陆者是否有权限查看
muted: true,
videoContextTemp: {},
corpUserFlag: false,
agreeRadio: ["agree"],
isPerson: false,
speed: 1,
uid: 0, // 职位id
userId: 0, // 可能存在的推荐人id
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, // 收藏判断
attention: true, // 分享时隐藏信息
selfJob: false, // 是否是自己团队职位的判断
showPrice: true, // 隐藏服务费
labelColor: ["#c41d7f", "#096dd9", "#531dab", "#d46b08", "#389e0d", "#08979c", "#cf1322"],
bgColor: ["#fff0f6", "#e6f7ff", "#f9f0ff", "#fff7e6", "#f6ffed", "#e6fffb", "#fff1f0"],
loginInfo: {},
cdnBaseImg: this.G.store().cdnBaseImg,
IS_CREATOR: false,
applyList: [],
wxPlat: "",
canvasInfo: {
// 分享的图片相关信息
posterImg: "",
isShow: false,
wxCode: "",
},
userInfo: uni.getStorageSync("apply-userinfo"), // 登录人的信息
miniAppInfo: uni.getStorageSync("miniApp-info"), // 小程序的信息
serviceShow: false, // 客服弹窗
currentStore: {},
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: [],
},
],
btnLoading: false, // 报名提交按钮的loading
};
},
onLoad(options) {
let that = this;
// console.log("详情", options);
// console.log("this.G.store().cdnBaseImg", this.G.store().cdnBaseImg);
if (options.id) {
this.uid = options.id;
}
setTimeout(() => {
this.showServicePop = true;
}, 5000);
if (options.from) {
this.from = options.from;
}
if (options.userId) {
this.userId = options.userId;
uni.setStorageSync("AGENCY_USER_ID", options.userId);
}
// if (!uni.getStorageSync("apply-token")) {
// // console.log("apply-token");
// uni.navigateTo({
// url: "/root/login/index?type=detail&id=" + options.id,
// });
// return;
// }
if (options.storeJobId) {
// console.log("HHHHHHHHHHHHH");
this.uid = options.storeJobId;
} else if (options.scene) {
// console.log("XXXXXXXXXXXX");
//扫小程序码携带参数
var sceneStr = decodeURIComponent(options.scene);
var sceneJson = this.G.sceneToJson(sceneStr);
// console.log("sceneJson===", sceneJson);
this.uid = sceneJson.storeJobId || sceneJson.i.split("_")[1];
this.userId = sceneJson.i.split("_")[0];
uni.setStorageSync("AGENCY_USER_ID", this.userId);
}
// console.log("=====================", that.api.hasSee);
this.getDetail().then((res) => {
// console.log("res", res);
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 = 1;
item.childrenType.forEach((innerItem) => {
item.children.push({
key: innerItem,
value: objMiddle[innerItem],
num,
show: objMiddle[innerItem] ? true : false,
edit: false,
});
if (objMiddle[innerItem]) {
num++;
}
});
item.num = num1;
if (item.children[item.children.length - 1].num != 1) {
item.show = true;
num1++;
}
});
// this.toKnowInfo(res.agencyId);
});
this.loginInfo = uni.getStorageSync("apply-userinfo");
if (uni.getStorageSync("apply-token")) {
that.G.Get(that.api.hasSee + "?jobId=" + that.uid, "", (res) => {});
}
if (this.miniAppInfo.autoDeliverySecond) {
// 用户没有同意过,则弹出弹窗
if (!uni.getStorageSync("userAllowed")) {
let time = this.miniAppInfo.autoDeliverySecond * 1000; // 获取自动弹出客服弹窗的时间间隔(单位:秒)
let nowTime = new Date().getTime();
if ((uni.getStorageSync("pushJob_deadline") && (nowTime - uni.getStorageSync("pushJob_deadline")) / (1000 * 60 * 60 * 24) > 7) || !uni.getStorageSync("pushJob_deadline")) {
setTimeout(() => {
this.showPushJobPop = true;
}, time);
}
// 用户同意过,则静默调用接口
} else if (uni.getStorageSync("userAllowed") && uni.getStorageSync("apply-userinfo")) {
that.handlePushJob("allow");
}
}
// console.log("this.applyList", this.applyList);
},
onShow() {
let that = this;
this.isLogin = uni.getStorageSync("apply-userinfo") ? true : false;
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.getSystemInfo({
success: function (res) {
// console.log(res);
that.wxPlat = res.hostName;
},
});
},
methods: {
getCode(callback = () => {}) {
uni.login({
success(wxRes) {
callback(wxRes.code);
},
fail(res) {
// console.log(res);
},
});
},
goAddress() {
let that = this;
// // console.log(e.currentTarget.dataset.address);
var address = this.jobDetail;
// console.log(address);
wx.openLocation({
latitude: Number(address.storeLat),
longitude: Number(address.storeLng),
name: address.storeName,
address: address.storeAddr,
scale: 15,
success(res) {
// console.log(res);
},
fail(res) {
// console.log(res);
},
});
},
makePhone(tel) {
uni.makePhoneCall({
phoneNumber: tel, //仅为示例
});
},
radioGroupChange(e) {
// console.log(e);
},
goPage($path) {
uni.navigateTo({
url: $path,
});
},
// toKnowInfo(id) {
// let that = this;
// // console.log(id);
// that.G.Get(that.api.bind_enterpriseDetail + "/" + id, "", (res) => {
// if (that.loginInfo.agencyId == that.jobDetail.agencyId || res.recordStatus == 1 || res.recordStatus == 2) {
// that.attention = true;
// } else {
// that.G.handleConfirm(
// "你还不是他的粉丝,无法查看职位",
// (res) => {
// let params = {
// id: that.jobDetail.agencyId,
// isShowMore: false,
// jobDetailShow: false,
// };
// uni.navigateTo({
// url: "/root/detail/user?" + that.G.objToStr(params),
// });
// },
// (res) => {},
// "关注发单号",
// true,
// "去关注"
// );
// }
// that.speed = 1;
// });
// },
handleCollection() {
let that = this;
if (this.isLogin) {
that.G.Get(that.api.yi_job_collect + "/" + that.uid, {}, (res) => {
that.isSc = !that.isSc;
uni.showToast({
title: that.isSc ? "收藏成功" : "取消收藏",
icon: "success",
});
});
} else {
uni.showModal({
title: "登录提示",
content: "收藏功能需要登录才能使用,是否登录",
success(res) {
if (res.confirm) {
uni.navigateTo({
url: "/root/login/index?path=detail",
});
} else {
}
},
});
}
},
showService() {
let that = this;
if (!that.isLogin) {
uni.showToast({
title: "请先登录",
icon: "none",
});
return;
}
if (that.goImLoading) {
return false;
}
that.goImLoading = true;
that.F.wyyxGet(that.api.job_get_cus + "?jobId=" + that.jobDetail.id, {}, (cusData) => {
that.F.wyyxPost(
that.api.wyyx_create,
{
// senderUserId: uni.getStorageSync("apply-uid"),
// receiverUserId: cusData,
senderAccid: uni.getStorageSync("im-accid"),
receiverAccid: cusData,
},
(res) => {
uni.$UIKitStore.uiStore.selectConversation(res.conversationId);
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(
that.api.wyyx_sendCard,
{
conversationType: 1,
// senderUserId: uni.getStorageSync("apply-uid"), // 发送者id 即当前登录用户id
// receiverUserId: cusData, // 接收方用户id
senderAccid: uni.getStorageSync("im-accid"),
receiverAccid: cusData,
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.showPrice ? that.jobDetail.serverPrice : "",
monthPay: that.jobDetail.monthPay || "",
jobId: that.uid || "",
},
},
() => {
// uni.navigateTo({
// url: "/root/NEUIKit/pages/Chat/index",
// });
that.goImLoading = false;
},
() => {},
);
},
() => {},
);
});
},
// showService() {
// if (this.appid == "wxb0c590fd696b79be") {
// this.getKefu();
// } else {
// this.getKefu();
// }
// // this.serviceShow = true;
// },
hideService() {
this.serviceShow = false;
},
getDetail() {
let that = this;
that.speed = 0;
return new Promise((resolve) => {
that.G.Get(that.api.job_personDetail + "/" + that.uid, "", (res) => {
that.isSc = res.record.collected == 1 ? true : false;
// console.log("职位详情:", res);
res = {
...res,
...res.record,
};
if (!res.hasOwnProperty("storeJobDetail")) {
res.storeJobDetail = {};
}
res.addss = that.G.setJobInfoPositionv3(res.storeAddr);
// console.log("职位详情1------", res);
that.isPerson = res.agencyId == uni.getStorageSync("apply-agencyId") ? true : false;
// res.serverPrice = that.G.setReturnFee(res.returnFee, res.returnFeeType);
res.agencyServerPrice = that.G.setReturnFee(res.agencyReturnFee, res.agencyReturnFeeType);
res.serverPrice = that.G.setReturnFee(res.returnFee, res.returnFeeType);
let setData = that.G.disposeJobListData(res);
// console.log("setData.district", setData.district);
res.addressStr = setData.district.slice(0, -1);
res.sexStr = setData.genderAge;
// res.ageStr = setData.age;
// res.priceStr = that.G.getSalaryClassifyValue(res.salaryClassify, res.salaryClassifyValue);
res.priceStr = res.salaryClassify != 7 ? that.G.getSalaryClassifyValue(res.salaryClassify, res.salaryClassifyValue) : that.G.getSalaryClassifyValue(res.salaryClassify, res.minMonthlyPay, res.maxMonthlyPay);
res.monthPay = res.minMonthlyPay / 100 + "-" + res.maxMonthlyPay / 100;
res.updateTime = that.G.setDeadLine(res.updateTime, "jiaofu");
// console.log("res.images", res.images);
that.swiperArray =
res.images.length == 0
? []
: res.images.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.loginInfo.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, "");
}
// that.jobDetail.jobRequestLabelNamesList = that.jobDetail.jobRequestLabelNames.split(",");
// that.jobDetail.jobSpecialLabelNamesList = that.jobDetail.jobSpecialLabelNames.split(",");
var str = that.jobDetail.supplier;
var reg = /1[3456789]\d{9}/g;
var phone = str && str.contactsTel ? str.contactsTel.match(reg) : null;
if (phone != null) {
that.jobDetail["phone"] = phone.toString();
}
// // console.log(phone.length);
// that.jobDetail.jobName = '三顿饭卡加斯冯老师独立开发技术的返利看打两发慷慨激昂收代理费'
that.jobDetail.logo = that.jobDetail.logo.indexOf("http:") > -1 ? that.jobDetail.logo.replace("http:", "https:") : that.jobDetail.logo;
setTimeout(() => {
that.speed = 1;
}, 100);
resolve(that.jobDetail);
});
});
},
getImgCode() {
var that = this;
return new Promise((resolve) => {
that.G.Get(that.api.get_singlejob_QRcode + "/" + that.uid, "", (res) => {
// console.log("res", res);
that.canvasInfo.wxCode = res.qrcode;
resolve();
});
});
},
// 微信端绘制
getWXCanvas(sharelImg, type) {
const that = this;
// type: 值为setShare是通过官方分享接口分享出去的封面, 为setJob是通过分享按钮生成分享的海报
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);
// // console.log("sharelImg", sharelImg);
const canvas = res[0].node;
const ctx = canvas.getContext("2d");
if (type == "setShare") {
that.setShareCover(ctx, canvas, mycenter).then((canvas) => {
// console.log("output canvas", canvas);
uni.canvasToTempFilePath({
canvas: canvas,
success(res) {
// console.log("res222", res);
resolve(res);
},
fail(res) {
uni.hideLoading();
uni.showToast({
title: res.errMsg,
icon: "error",
});
},
});
});
} else if (type == "setJob") {
new Promise(function (resolve) {
// 绘制背景图片
uni.getImageInfo({
src: sharelImg, // 网络图片
success(res) {
// console.log("res111", res);
canvas.width = res.width;
canvas.height = res.height;
mycenter = canvas.width / 2;
myheight = canvas.height;
const img = canvas.createImage();
img.src = res.path;
// console.log("img111", img);
img.onload = (info) => {
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
// console.log("info111", info);
resolve(true);
};
},
fail(err) {},
});
}).then(() => {
// console.log("inthen");
//使用:
that
.setShareJobImg(ctx, canvas, mycenter)
.then(function (canvas1) {
// console.log("canvas1", canvas1);
uni.canvasToTempFilePath({
canvas: canvas1,
success(res) {
// console.log("res222", res);
resolve(res);
},
fail(res) {
uni.hideLoading();
uni.showToast({
title: res.errMsg,
icon: "error",
});
},
});
})
.catch((err) => {
// console.log(err);
uni.hideLoading();
uni.showToast({
title: "生成失败,请重试",
});
});
});
}
});
});
},
/**
* 生成分享小程序的封面
*/
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 = 44,
labelHeight = 44;
line1 = 0; // 第一行距顶部距离
line2 = 90 - dis;
line3 = 200 - dis;
line4 = 280 - dis;
line5 = 350 - dis - labelHeight;
line6 = 380 - dis - labelHeight - 10;
line7 = 460 - dis - labelHeight;
// 绘制基础白色背景
// console.log("that.jobDetail", that.jobDetail);
_G.roundRect1(ctx, 0, 0, 750, 600, 0, "#fff");
return new Promise(function (imgres) {
_G.fillTextLineBreak(ctx, that.jobDetail.jobName.length > 11 ? that.jobDetail.jobName.slice(0, 11) + "..." : that.jobDetail.jobName, baseLeft, line2, 800, 20, "#000", titleFontSize, "500", "left"); // 岗位标题
// _G.fillTextLineBreak(ctx, that.jobDetail.jobName, baseLeft, line2, 800, 20, "#000", titleFontSize, "500", "left"); // 岗位标题
// console.log("isLogin", that.isLogin);
// console.log("innerLogin", that.isLogin);
_G.fillTextLineBreak(ctx, that.jobDetail.monthPay, 750 - ctx.measureText(that.jobDetail.monthPay).width, line3, 400, 20, "#ff4400", titleFontSize, "400"); // 月工资
_G.fillTextLineBreak(ctx, that.jobDetail.salaryClassify == 7 ? "月薪" : that.jobDetail.priceStr, baseLeft + 10, line3, 400, 40, "#ff4400", titleFontSize + 6, "600", "left"); // 时薪
if (that.jobDetail.jobRequestLabelNames.length > 0) {
that.jobDetail.jobRequestLabelNames
.filter((itema, indexa) => {
return indexa < 3;
})
.forEach((item1, index) => {
if (index <= 3) {
_G.fillTextLineBreak(ctx, item1, baseLeft + labelLeft + 12, line4 + 4, 400, 40, "#666", mainFontSize); // 标签字符
_G.roundRect1(ctx, baseLeft + labelLeft, line4 - 38, ctx.measureText(item1).width + 24, 56, 8, "#00000012");
labelLeft += ctx.measureText(item1).width + 32;
if (index == 3) {
labelLeft = 0;
}
}
// else if (index > 3 && index <= 6) {
// _G.roundRect1(ctx, baseLeft + labelLeft, line5 - 38, ctx.measureText(item1).width + 24, 56, 8, "#00000012");
// _G.fillTextLineBreak(ctx, item1, baseLeft + labelLeft + 12, line5 + 4, 400, 40, "#666", mainFontSize); // 标签字符
// labelLeft += ctx.measureText(item1).width + 32;
// }
});
}
// 临时注释
// else if (that.jobDetail.jobSpecialLabelNames.length > 0) {
// that.jobDetail.jobSpecialLabelNames.forEach((item1, index) => {
// if (index <= 3) {
// _G.fillTextLineBreak(ctx, item1, baseLeft + labelLeft + 12, line4 + 4, 400, 40, "#666", mainFontSize); // 标签字符
// _G.roundRect1(ctx, baseLeft + labelLeft, line4 - 38, ctx.measureText(item1).width + 24, 56, 8, "#00000012");
// labelLeft += ctx.measureText(item1).width + 32;
// if (index == 3) {
// labelLeft = 0;
// }
// } else if (index > 3 && index <= 6) {
// _G.roundRect1(ctx, baseLeft + labelLeft, line5 - 38, ctx.measureText(item1).width + 24, 56, 8, "#00000012");
// _G.fillTextLineBreak(ctx, item1, baseLeft + labelLeft + 12, line5 + 4, 400, 40, "#666", mainFontSize); // 标签字符
// labelLeft += ctx.measureText(item1).width + 32;
// }
// });
// }
// 根据标签数量调整宣传标语位置
// _G.roundRect1(ctx, mycenter - 712 / 2, line6 + (that.jobDetail.jobSpecialLabelNames.length > 3 ? 0 : -70), 712, 60, 4, "#fff6e8"); // 宣传标语背景
_G.roundRect1(ctx, mycenter - 712 / 2, line6, 712, 60, 4, "#fff6e8"); // 宣传标语背景
// 绘制立即咨询
// 根据标签数量调整立即咨询背景位置
// _G.roundRect1(ctx, mycenter - 712 / 2, line7 + (that.jobDetail.jobSpecialLabelNames.length > 3 ? 0 : -70), 712, 100, 4, "#3b80fa"); // 立即咨询背景
_G.roundRect1(ctx, mycenter - 712 / 2, line7, 712, 100, 4, "#3b80fa"); // 立即咨询背景
// 根据标签数量调整立即咨询位置
// _G.fillTextLineBreak(ctx, "立即咨询", mycenter - 24 - ctx.measureText("立即咨询").width / 2, line7 + (that.jobDetail.jobSpecialLabelNames.length > 3 ? 70 : 0), 300, 120, "#fff", titleFontSize, "500"); // 立即咨询
_G.fillTextLineBreak(ctx, "立即咨询", mycenter - 24 - ctx.measureText("立即咨询").width / 2, line7 + 65, 300, 120, "#fff", titleFontSize, "500"); // 立即咨询
// 绘制职位logo
// console.log("that.jobDetail.logo", that.jobDetail.logo);
// uni.downloadFile({
// url: that.jobDetail.logo,
// success(res) {
// // console.log("draw", res);
// const img = canvas.createImage();
// img.src = res.tempFilePath;
// img.onload = () => {
// _G.roundRect(ctx, img, baseLeft, line2, logoSize, logoSize, 8);
// };
// },
// fail(err) {
// // console.log("logodownloadFile err", err);
// },
// });
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) => {
// 根据标签数量调整安全标识位置
// _G.fillTextLineBreak(ctx, item1, baseLeft + safeMarkPosition, line6 + (that.jobDetail.jobSpecialLabelNames.length > 3 ? 0 : -70) + 40, 100, 32, "#fca025");
// _G.roundRect(ctx, img, baseLeft + safeMarkPosition - 36, line6 + (that.jobDetail.jobSpecialLabelNames.length > 3 ? 0 : -70) + 12, 32, 32, 12);
_G.fillTextLineBreak(ctx, item1, baseLeft + safeMarkPosition, line6 + 40, 100, 32, "#fca025");
_G.roundRect(ctx, img1, baseLeft + safeMarkPosition - 36, line6 + 12, 32, 32, 12);
safeMarkPosition += 130 + ctx.measureText(item1).width;
});
setTimeout(() => {
// console.log("success draw");
imgres(canvas);
}, 200);
};
},
fail(err) {
// console.log("downloadFile err", err);
},
});
}).catch((err) => {
// console.log("all err", err);
});
},
// 生成分享的海报
setShareJobImg(ctx, canvas, mycenter, funObj) {
let that = this;
let labelLeft = 0;
// ctx.arcTo()
let baseTop, logoLeft, logoSize, titleSize, ageTop, salaryClassifyValueLeft, salaryClassifyValueTop, monthlyPaySize, position, markTop, roundRectHeight, fubiaotiTop, bottomSloganTop, QRSize;
logoLeft = 56 * 2;
let baseMiddle = 248 * 2;
// if (that.data.checkedList.length == 1) {
baseTop = 2 * 370;
logoSize = 2 * 96;
QRSize = 2 * 260;
titleSize = 2 * 30;
roundRectHeight = 2 * 260;
ageTop = 2 * 110;
salaryClassifyValueLeft = 2 * 56;
salaryClassifyValueTop = 2 * 54;
monthlyPaySize = 2 * 24;
markTop = 2 * 145;
fubiaotiTop = 2 * 155;
bottomSloganTop = 2 * 355;
// console.log("that.canvasInfo.wxCode", that.canvasInfo.wxCode);
return new Promise((imgres) => {
_G.roundRect1(ctx, 24 * 2, baseTop - 100, 1104, roundRectHeight, 32, "#fff");
// console.log(that.jobDetail);
// // console.log(that.jobDetail.store);
// // console.log(app.globalData.ip + that.currCode);
that.jobDetail.jobRequestLabelNames.forEach((item1, index) => {
// // console.log(item1);
// // console.log(ctx.measureText(item1).width);
if (index <= 2) {
_G.fillTextLineBreak(ctx, item1, 60 * 2 + labelLeft, baseTop + markTop + 30 * 2, 400 * 2, 20, "#333", monthlyPaySize); // 标签字符
_G.roundRect1(ctx, 52 * 2 + labelLeft, baseTop + markTop, ctx.measureText(item1).width + 16 * 2, 40 * 2, 32 * 2, "#00000012");
labelLeft += ctx.measureText(item1).width + 32 * 2;
}
});
_G.fillTextLineBreak(ctx, that.jobDetail.jobName.length > 11 ? that.jobDetail.jobName.slice(0, 11) + "..." : that.jobDetail.jobName, logoLeft, baseTop, 1000, 20, "#000", titleSize, "600", "left"); // 岗位标题
// _G.fillTextLineBreak(ctx, that.jobDetail.jobName, logoLeft, baseTop, 500 * 2, 20, "#333", titleSize, "600", "left"); // 岗位标题
_G.fillTextLineBreak(ctx, that.jobDetail.priceStr, salaryClassifyValueLeft, baseTop + salaryClassifyValueTop, 400 * 2, 20, "#ff4400", titleSize, "600"); // 时薪
_G.fillTextLineBreak(ctx, that.jobDetail.monthPay, salaryClassifyValueLeft + ctx.measureText(that.jobDetail.priceStr + " ").width, baseTop + salaryClassifyValueTop, 400 * 2, 20, "#ff4400", monthlyPaySize, "400"); // 月工资
_G.fillTextLineBreak(ctx, that.jobDetail.shortDistrict, salaryClassifyValueLeft, baseTop + ageTop, 300 * 2, 20, "#333", monthlyPaySize); // 省市年龄
_G.fillTextLineBreak(ctx, that.jobDetail.age, salaryClassifyValueLeft + ctx.measureText(that.jobDetail.shortDistrict).width, baseTop + ageTop, 300 * 2, 20, "#333", monthlyPaySize); // 省市年龄
// - ctx.measureText(that.userInfo.agencyName).width / 2
_G.fillTextLineBreak(ctx, that.miniAppInfo.fullName || that.miniAppInfo.agencyName, mycenter - ctx.measureText(that.miniAppInfo.fullName || that.miniAppInfo.agencyName).width / 2, baseTop - fubiaotiTop, 400 * 2, 20, "#fff", monthlyPaySize, "600"); // 代理名称
// - ctx.measureText("长按查看职位详情").width / 4
// _G.fillTextLineBreak(ctx, "长按查看职位详情", mycenter - ctx.measureText("长按查看职位详情").width / 2, baseTop + bottomSloganTop - 30, 300 * 2, 20, "#fff", monthlyPaySize); // 底部slogan
// - ctx.measureText("好工作 放心干").width / 3.2
_G.fillTextLineBreak(ctx, "长按查看职位详情", mycenter - ctx.measureText("长按查看职位详情").width / 2, baseTop + bottomSloganTop + 730, 500 * 2, 20, "#fff", monthlyPaySize); // 底部slogan
// console.log("that.canvasInfo.wxCode", that.canvasInfo.wxCode);
uni.getImageInfo({
src: "https://daotian.matripe.com.cn" + that.canvasInfo.wxCode,
success(res) {
// console.log("res333", res);
const img = canvas.createImage();
img.src = res.path;
img.onload = () => {
// console.log("ctx", ctx);
// console.log("canvas", canvas);
_G.roundRect1(ctx, mycenter - 580 / 2, baseTop + 740, 580, 580, 0, "#fff");
_G.roundRect(ctx, img, mycenter - res.width / 2 - 40, baseTop + 770, QRSize, QRSize, 0);
// if (index == that.data.checkedList.length - 1) {
setTimeout(() => {
imgres(canvas);
}, 200);
// }
// // console.log("that.jobDetail.logo", that.jobDetail.logo);
// uni.getImageInfo({
// src: that.jobDetail.logo,
// success(res) {
// // console.log("res444", res);
// const img = canvas.createImage();
// img.src = res.path;
// img.onload = () => {
// imgres(canvas);
// };
// },
// fail(err) {},
// });
// uni.downloadFile({
// url: that.jobDetail.logo || "https://matripe.oss-cn-beijing.aliyuncs.com/default.png", //网络图片,如果不行请换一个
// success(res) {
// // console.log(res);
// const img = canvas.createImage();
// img.src = res.tempFilePath;
// img.onload = () => {
// _G.roundRect(ctx, img, logoLeft, baseTop + 40, logoSize, logoSize, 8);
// setTimeout(() => {
// imgres(canvas);
// }, 200);
// };
// },
// fail(err) {
// // console.log(err);
// },
// });
};
},
fail(err) {
// console.log(err);
},
});
});
},
handleViewBig($item, $index) {
let that = this;
// 只筛选出类型为'image'的项目用于预览
const imageUrls = that.swiperArray.filter((item) => item.type === "image").map((item) => item.image);
// 计算当前图片在过滤后数组中的索引
let imageIndex = 0;
for (let i = 0; i < that.swiperArray.length; i++) {
if (that.swiperArray[i].type === "image") {
if (that.swiperArray[i] === $item) {
break;
}
imageIndex++;
}
}
uni.previewImage({
urls: imageUrls,
current: imageIndex,
});
},
showShareImg() {
let that = this;
if (this.isLogin) {
if (that.canvasInfo.posterImg) {
that.canvasInfo.isShow = true;
return;
}
uni.showLoading({
title: "生成中",
});
this.getImgCode().then((res) => {
that
.getWXCanvas("https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/2023-09-01/7ca85384-9f22-474d-893f-092b61de684d_share.png", "setJob")
.then((canvasRes) => {
// console.log("canvasRes", canvasRes);
that.canvasInfo.posterImg = canvasRes.tempFilePath;
that.canvasInfo.isShow = true;
})
.finally(() => {
uni.hideLoading();
});
});
} else {
uni.showModal({
title: "登录提示",
content: "分享功能需要登录才能使用,是否登录",
success(res) {
if (res.confirm) {
uni.navigateTo({
url: "/root/login/index?path=detail",
});
} else {
}
},
});
}
},
saveToalbum() {
let that = this;
// console.log(that.canvasInfo.posterImg);
uni.saveImageToPhotosAlbum({
filePath: that.canvasInfo.posterImg,
success(res) {
// console.log(res);
if (res.errMsg == "saveImageToPhotosAlbum:ok") {
uni.showToast({
title: "图片已保存",
icon: "none",
duration: 1500,
});
}
},
fail(res) {
// console.log(res);
uni.showToast({
title: "图片保存失败",
icon: "none",
duration: 1500,
});
},
});
},
handleOpenApplyPopup() {
let that = this;
if (!that.isLogin) {
uni.showModal({
title: "登录提示",
content: "报名功能需要登录才能使用,是否登录",
success(res) {
if (res.confirm) {
uni.navigateTo({
url: "/root/login/index?path=detail",
});
} else {
}
},
});
return;
}
if (!this.attention) {
return false;
}
that.getCode((res) => {
uni.setStorageSync("apply-code", res);
// console.log("是否执行");
});
// that.applyPopup.isShow = true;
uni.navigateTo({
url: "/root/home/quickApplication?jobId=" + this.jobDetail.id + "&jobName=" + this.jobDetail.jobName + "&title=报名&type=" + that.jobDetail.jobType + "&tid=" + that.jobDetail.record.templateId,
});
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;
},
// 复制通告
setCopy(e) {
var that = this;
let text = that.jobDetail.jobInfoWithoutReturnFee || that.jobDetail.jobInfo;
uni.setClipboardData({
data: text,
success(res) {
uni.getClipboardData({
success(res) {
// console.log(res.data); // data
uni.showToast({
title: "复制成功",
icon: "success",
});
},
});
},
});
},
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 (!that.G.setReg(that.formInfo.idCard, "idcard")) {
uni.showToast({
icon: "none",
title: "请输入正确的身份证号",
});
return false;
}
if (that.formInfo.tel == "") {
uni.showToast({
icon: "none",
title: "请输入联系电话",
});
return false;
}
if (!that.G.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(that.api.job_recordJob, that.formInfo, (res) => {
// console.log(res);
uni.showToast({
icon: "success",
title: "报名成功",
});
that.applyPopup.isShow = false;
});
},
/**
* 新的报名方法
*/
submitApply(e, callBack) {
let that = this;
that.btnLoading = true;
let params = {
userName: e.name,
tel: e.tel,
jobId: that.jobDetail.id,
};
// console.log('uni.getStorageSync("AGENCY_ID")', uni.getStorageSync("AGENCY_ID"));
// console.log('uni.getStorageSync("userinfo")', uni.getStorageSync("apply-userinfo"));
// return
if (uni.getStorageSync("AGENCY_ID") == uni.getStorageSync("apply-userinfo").user.agencyId) {
params.agencyUserId = uni.getStorageSync("apply-userinfo").user.id;
params.followUserId = uni.getStorageSync("apply-userinfo").user.id;
}
if (uni.getStorageSync("AGENCY_USER_ID")) {
params.agencyUserId = uni.getStorageSync("AGENCY_USER_ID");
params.followUserId = uni.getStorageSync("AGENCY_USER_ID");
}
that.G.Post(
that.api.yi_job_recordJob,
params,
(res) => {
that.applyPopup.isShow = false;
// uni.showTabBar();
uni.showToast({
title: "报名成功",
icon: "success",
});
that.btnLoading = false;
// uni.navigateTo({
// url: "/root/other/result",
// success: function (res) {
// callBack(true);
// },
// });
},
() => {
that.btnLoading = 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) {
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: "https://work.weixin.qq.com/kfid/kfc8e1e424ef907601f",
},
showMessageCard: true,
sendMessagePath: `/root/detail/job.html?id=${that.uid}&classify=${that.jobDetail.classify}`,
// sendMessageImg:'../../assets/images/jbn.png',
corpId: "ww225068732d3e7462",
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: "下载失败",
});
},
});
}
},
/**
* 拨打电话
*/
makePhoneCall(e) {
var that = this;
if (!e.mark.tel) {
uni.showToast({
title: "暂无联系方式",
icon: "none",
});
return;
}
uni.makePhoneCall({
phoneNumber: e.mark.tel,
});
},
getKefu() {
let that = this;
that.currentStore = uni.getStorageSync("CUSTOMSERVICE_INFO");
that.currentStore.splitPhone = this.G.splitPhone(that.currentStore.tel);
that.serviceShow = true;
},
pushSetToken(_type) {
let that = this;
that.G.checkToken().then(() => {
that.isLogin = true;
that.loginInfo = uni.getStorageSync("apply-userinfo");
//联系客服
if (_type == "relationService") {
that.showService();
//报名
} else if (_type == "record") {
that.handleOpenApplyPopup();
//职位推送
} else if (_type == "pushJob") {
that.handlePushJob("allow");
}
});
},
setType(e) {
this.tabInfo.active = e;
},
goIm() {
let that = this;
that.F.wyyxGet(that.api.job_get_cus + "?jobId=" + that.jobDetail.id, {}, (cusData) => {
that.F.wyyxPost(
that.api.wyyx_create,
{
senderUserId: uni.getStorageSync("apply-uid"),
receiverUserId: cusData,
},
(res) => {
uni.$UIKitStore.uiStore.selectConversation(res.conversationId);
that.F.wyyxPost(
that.api.wyyx_sendCard,
{
conversationType: 1,
// senderUserId: uni.getStorageSync("apply-uid"), // 发送者id 即当前登录用户id
// receiverUserId: cusData, // 接收方用户id
senderAccid: uni.getStorageSync("im-accid"),
receiverAccid: cusData,
type: 100000,
jobDetail: {
title: that.jobDetail.jobName,
info: (that.jobDetail.addss ? that.jobDetail.addss + "丨" : "") + that.jobDetail.genderRestrict + "丨" + that.jobDetail.age,
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/index",
});
},
() => {},
);
},
() => {},
);
});
},
switchRadioChange(e) {
let that = this;
if (e && e.detail && e.detail.value && e.detail.value[0] == "acheck") {
that.pushJobChecked = true;
} else {
that.pushJobChecked = false;
}
},
handlePushJob(_type) {
let that = this;
// console.log("that.pushJobChecked", that.pushJobChecked);
if (_type == "allow") {
if (this.loginInfo && this.loginInfo.tel) {
that.autoDelivery();
}
} else {
if (this.pushJobChecked) {
uni.setStorageSync("pushJob_deadline", new Date().getTime());
}
that.showPushJobPop = false;
}
},
autoDelivery() {
let that = this;
this.G.Post("/yishoudan/user/applyClue/autoDelivery", { tel: this.loginInfo.tel }, (res) => {
// console.log("res", res);
that.showPushJobPop = false;
uni.setStorageSync("userAllowed", true);
});
},
},
};
</script>
<style lang="scss">
page {
padding-bottom: 120px;
background-color: #ededed;
}
.canvas-card {
width: 75%;
height: 85%;
background-image: url("https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/2023-09-01/7ca85384-9f22-474d-893f-092b61de684d_share.png");
background-repeat: no-repeat;
background-size: 100% 100%;
}
.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 {
.g-components-panel-fixed {
min-height: 0;
padding-bottom: calc(12px + constant(safe-area-inset-bottom));
padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.no_style {
// height: 40px;
}
.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 #3578f6;
}
}
.label {
position: relative;
&::before {
content: "*";
color: #ff0000;
}
}
}
}
}
.riliIcon {
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
z-index: 1;
}
.servicePrice {
height: 64px;
border: 1rpx solid #ff4400;
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;
}
.g_h_104s {
padding-top: 12px;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
min-height: 100px;
}
.pop-container {
position: fixed;
top: 0;
left: 0;
right: 0;
transform: translateY(-100%); /* */
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* */
z-index: 9999; /* */
}
.pop-container.show {
transform: translateY(-4px); /* */
}
</style>