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.

1957 lines
78 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>
<form @submit.stop.prevent="beforeFormSubmit" v-if="pageShow">
<view :style="'padding:0 10px;padding-bottom: 160px;overflow: ' + (iosDialog1 ? 'hidden' : '') + ';'" :class="iosDialog1 ? 'hasHigh' : ''">
<!-- <view class="quickapply mt10" catchtap="chooseIdCard">
<view class="upload">
<view class="t-icon t-icon-paizhao"></view>
<view size='mini' class="info">
<view class="" hover-class="none" hover-stop-propagation="false">拍照或相册上传</view>
<view class="" hover-class="none" hover-stop-propagation="false">系统智能识别并自动填写</view>
</view>
</view>
<view class="idCardPreview" style="display: flex;align-items: center; justify-content: flex-end;" hover-class="none" hover-stop-propagation="false">
<image class="" wx:if='{{currentImg}}' src="{{currentImg}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" catchtap='showImg'></image>
<view class="t-icon t-icon-gengduo111" hover-class="none" hover-stop-propagation="false" style="width: 18px;height: 18px;" wx:else></view>
</view>
</view>-->
<!-- <view class="weui-cells__group weui-cells__group_form mt10">
<view class="weui-cells weui-cells_form ">
<view class="weui-cell">
<view class="weui-cell__hd">
<label class="weui-label c085">联系电话</label>
</view>
<view class="weui-cell__bd">
<input class="weui-input" type="number" name="tel" bindblur="getTel" bindinput="bothwayBind" data-type='tel' value="{{userInfo.tel}}" placeholder="请输入电话" placeholder-class="input__placeholder" />
</view>
</view>
</view>
</view>-->
<view class="f14 pl16 c6" hover-class="none" style="height: 48px; line-height: 67px" :hover-stop-propagation="false">信息</view>
<view class="weui-cells__group weui-cells__group_form" style="border-radius: 8px; overflow: hidden">
<view class="weui-cells weui-cells_form" style="margin-top: 0">
<view class="weui-cell name">
<view class="weui-cell__hd display-flex aic" style="max-width: 80px">
<label class="weui-label c085">
姓名
<text class="cfred">*</text>
</label>
<image
class="idcardImg"
v-if="idCardImg"
@tap="previewImage"
style="width: 48px; height: 32px"
:src="idCardImg"
mode="aspectFit|aspectFill|widthFix"
:lazy-load="false"
></image>
</view>
<view class="weui-cell__bd">
<input
class="weui-input"
type="text"
name="userName"
@input="bothwayBind"
data-type="name"
:value="userInfo.name"
placeholder="手动输入或拍照自动识别 →"
placeholder-class="input__placeholder"
/>
</view>
<view class="t-icon t-icon-paizhao5 rightPz" @click.stop="chooseIdCard"></view>
</view>
<view class="weui-cell sex">
<view class="weui-cell__hd">
<label class="weui-label c085">
性别
<text class="cfred">*</text>
</label>
</view>
<view class="weui-cell__bd">
<radio-group @change="radioChange" name="sex" class="fr radiogroup">
<view class="dib" v-for="(item, index) in sex" :key="index">
<radio :value="item.id" color="var(--color-ysd)" :checked="item.checked" style="transform: scale(0.8); margin-right: 4px">
<view class="dib f20" style="margin-left: 4px">{{ item.value }}</view>
</radio>
</view>
</radio-group>
</view>
</view>
<view class="weui-cell">
<view class="weui-cell__hd">
<label class="weui-label c085">
年龄
<text class="cfred">*</text>
</label>
</view>
<view class="weui-cell__bd">
<!-- <input class="weui-input" type="number" name="age" bindinput="bothwayBind" data-type='age' value="{{userInfo.age}}" placeholder="请输入年龄" placeholder-class="input__placeholder" /> -->
<picker @change="bindPickerChangeAge" :value="ageIndex" :range="ageArray">
<view class="picker tr">
<block v-if="ageIndex == -1">
<view class="ccc tr dib" style="color: #ccc">请选择年龄</view>
</block>
<block v-else>
<view class="c3 tr dib">{{ ageArray[ageIndex] }}</view>
</block>
<i class="iconfont icon-gengduo11 f16 ml4 dib pr c9" style="line-height: 1; top: 1px"></i>
</view>
</picker>
</view>
</view>
<view class="weui-cell">
<view class="weui-cell__hd">
<label class="weui-label c085">民族</label>
</view>
<!-- <view class="weui-cell__bd">
<input class="weui-input" type="text" name="nation" value="{{userInfo.nationality}}" placeholder="请输入民族" placeholder-class="weui-input__placeholder" />
</view>-->
<view class="weui-cell__bd">
<picker @change="bindPickerChangeNation" :data-id="item.id" :value="item.name" :range="nationArray" range-key="name">
<view class="picker tr">
<block v-if="nationIndex == -1">
<view class="ccc tr dib" style="color: #ccc">请选择民族</view>
</block>
<block v-else>
<view class="c3 tr dib">{{ nationArray[nationIndex].name }}</view>
</block>
<i class="iconfont icon-gengduo11 f16 ml4 dib pr c9" style="line-height: 1; top: 1px"></i>
</view>
</picker>
</view>
</view>
<!-- <view class="weui-cell">
<view class="weui-cell__hd">
<label class="weui-label c085">联系电话</label>
</view>
<view class="weui-cell__bd">
<input class="weui-input" type="number" name="tel" bindblur="getTel" bindinput="bothwayBind" data-type='tel' value="{{userInfo.tel}}" placeholder="请输入电话" placeholder-class="input__placeholder" />
</view>
</view>-->
<view class="weui-cell">
<view class="weui-cell__hd">
<label class="weui-label c085">
身份证号
<text class="cfred">*</text>
</label>
</view>
<view class="weui-cell__bd display-flex">
<input
class="weui-input flex-1"
type="idcard"
name="idCard"
@input="bothwayBind"
data-type="num"
:value="userInfo.num"
placeholder="请输入身份证号"
placeholder-class="input__placeholder"
/>
</view>
</view>
<view class="weui-cell">
<view class="weui-cell__hd">
<label class="weui-label c085">家庭住址</label>
</view>
<view :class="'weui-cell__bd ' + (iosDialog1 ? 'heiover' : '')" :style="'opacity: ' + (iosDialog1 ? 0 : 1) + ' !important;'">
<textarea
class="weui-input"
type="text"
name="address"
@input="bothwayBind"
data-type="address"
:value="userInfo.address"
:disable-default-padding="true"
placeholder="请输入家庭住址"
placeholder-class="input__placeholder"
auto-height
style="min-height: 23px"
></textarea>
</view>
</view>
<view class="weui-cell display-flex">
<view class="weui-cell__hd">
<label class="weui-label c085">上传附件</label>
</view>
<!-- <view class="weui-cell__bd">
<input class="weui-input" type="text" name="nation" value="{{userInfo.nationality}}" placeholder="请输入民族" placeholder-class="weui-input__placeholder" />
</view>-->
<view class="weui-cell__bd cbc" style="text-align: right" @tap="chooseMedia">
请选择附件上传
<i class="iconfont icon-gengduo11 f16 ml4 dib pr c9" style="line-height: 1; top: 1px"></i>
</view>
</view>
<scroll-view :scroll-x="true" v-if="files.length > 0" class="uploadImgBox" hover-class="none" :hover-stop-propagation="false" enable-flex>
<!-- <view class="fsa" style="justify-content:start" hover-class="none" hover-stop-propagation="false"> -->
<view class="uploadImgSubBox" style hover-class="none" :hover-stop-propagation="false" v-for="(item, index) in files" :key="index">
<i class="iconfont icon-guanbi11 close" @click.stop="deleteImg($event, { id: item.id })" :data-id="item.id"></i>
<image class :src="item.url" @tap="showImgs" :data-url="item.url" mode="aspectFill" :lazy-load="false"></image>
</view>
<!-- </view> -->
</scroll-view>
</view>
</view>
<!-- <view class="weui-cells__group weui-cells__group_form bt1" style="margin-top: 0px;background-color:#fff">
</view>-->
<view class="weui-cells__group weui-cells__group_form mt10" style="margin-top: 10px; border-radius: 8px; overflow: hidden">
<view class="weui-cells weui-cells_form">
<view class="weui-cell">
<view class="weui-cell__hd">
<label class="weui-label c085">
电话
<text class="cfred">*</text>
</label>
</view>
<view class="weui-cell__bd">
<input
class="weui-input"
type="number"
name="tel"
@blur="getTel"
@input="bothwayBind"
data-type="tel"
:value="userInfo.tel"
placeholder="请输入电话"
placeholder-class="input__placeholder"
/>
</view>
</view>
</view>
</view>
<view class="f14 pl16 c6" hover-class="none" style="height: 48px; line-height: 67px" :hover-stop-propagation="false">职位信息</view>
<view class="weui-cells__group weui-cells__group_form mt10" style="border-radius: 8px; overflow: hidden">
<view class="weui-cells weui-cells_form">
<view class="weui-cells searchbar-result" v-if="searchListShow">
<view
class="weui-cell weui-cell_active weui-cell_access"
:data-name="item.aliasName"
:data-id="item.id"
@tap="setValue"
v-for="(item, idx) in storeArray"
:key="idx"
>
<view class="weui-cell__bd weui-cell_primary">
<view>{{ item.aliasName }}</view>
</view>
</view>
</view>
<view class="weui-cell">
<view class="weui-cell__hd">
<label class="weui-label c3">
报名岗位
<text class="cfred">*</text>
</label>
</view>
<view class="weui-cell__bd">
<view class hover-class="none" :hover-stop-propagation="false" style="text-align: right; color: #333" @tap="toJobAndAgencySelect" data-type="job">
<view class hover-class="none" :hover-stop-propagation="false" v-if="jobName">
{{ jobName }}
<!-- <i class="iconfont icon-gengduo1 f16 ml4 dib pr c9" style="line-height:1;"></i> -->
</view>
<!-- <view class hover-class="none" hover-stop-propagation="false" style="text-align:right;color:#ccc" wx:else>
请选择岗位
<i class="iconfont icon-gengduo1 f16 ml4 dib pr c9" style="line-height:1;"></i>
</view> -->
</view>
</view>
</view>
<view class="weui-cell">
<view class="weui-cell__hd">
<label class="weui-label c3">
面试时间
<text class="cfred">*</text>
</label>
</view>
<view class="weui-cell__bd tr">
<picker
mode="multiSelector"
:value="dateTime"
@change="changeDateTime"
@columnchange="changeDateTimeColumn"
:range="dateTimeArray"
style="color: #333"
>
{{ !!currentTime ? currentTime : '----' }}
<i class="iconfont icon-rili f16 ml4 dib pr c9" style="line-height: 1"></i>
</picker>
</view>
</view>
<view class="weui-cell">
<view class="weui-cell__hd">
<label class="weui-label c3">
<!-- <text class="cfred">*</text> -->
预计到达
</label>
</view>
<view class="weui-cell__bd tr">
<picker
mode="multiSelector"
:value="dateTime2"
@change="changeDateTime2"
@columnchange="changeDateTimeColumn2"
:range="dateTimeArray"
style="color: #333"
>
{{ !!currentTime2 ? currentTime2 : '----' }}
<i class="iconfont icon-rili f16 ml4 dib pr c9" style="line-height: 1"></i>
</picker>
</view>
</view>
<view class="weui-cell" :style="'padding-bottom:' + (isShowZhedie ? 0 : 16) + 'px;'">
<view class="weui-cell__hd">
<label class="weui-label c3">政策</label>
</view>
<view class="weui-cell__bd" style="padding-top: 8px">
<view style="color: #333; white-space: pre-line; line-height: 1.8" :class="(!zhedie ? 'over3' : '') + ' ' + (policy ? 'tal' : 'tar')">
{{ policy == '' ? '-' : policy }}
</view>
</view>
</view>
<block v-if="isShowZhedie">
<view class="tc f14 c9 bt1 mt8 ml10 mr10" style="line-height: 42px" hover-class="thover" @click.stop="ifZhedie" v-if="zhedie">
收起
<i class="iconfont icon-shouqi f14"></i>
</view>
<view class="tc f14 c9 bt1 mt8 ml10 mr10" style="line-height: 42px" hover-class="thover" @click.stop="ifZhankai" v-if="!zhedie">
展开
<i class="iconfont icon-xiala1 f14"></i>
</view>
</block>
</view>
</view>
<view class="remark display-flex bgcf mt10 br_8">
<view class="weui-cell__hd">
<label class="weui-label c085">备注</label>
</view>
<view :class="'weui-cell__bd ' + (iosDialog1 ? 'heiover' : '')" :style="'opacity: ' + (iosDialog1 ? 0 : 1) + ' !important;'">
<textarea
class="weui-input"
type="text"
name="desp"
@input="bothwayBind"
data-type="desp"
:value="userInfo.desp"
:disable-default-padding="true"
placeholder="请输入备注"
placeholder-class="input__placeholder"
auto-height
style="min-height: 23px"
></textarea>
</view>
</view>
<!-- <view class="weui-cells__group weui-cells__group_form mt10" style="background-color:#fff;margin-top:10px;border-radius:8px;overflow:hidden">
<view class="weui-cell" style="background-color:#fff">
<view class="weui-cell__hd">
<label class="weui-label c6">
代理
</label>
</view>
<view class="weui-cell__bd">
<view class hover-class="none" hover-stop-propagation="false" style="text-align:right;color:#999" data-type="agency">
<view class hover-class="none" hover-stop-propagation="false" wx:if="{{agentName}}">
{{agentName}}
</view>
</view>
</view>
</view>
</view> -->
<view class="f12 ml8 c045 mt12">
<radio-group class="dib">
<radio
:checked="switch1Checked"
@click.stop="switch1Change"
value="0"
class="dib"
color="#0dcc91"
style="transform: scale(0.7); position: relative; top: -2px"
/>
</radio-group>
我已阅读并同意
<navigator url="../../serviceTerm/index" class="aLink dib">《服务协议》</navigator>
<navigator url="../../secret/index" class="aLink dib">《隐私政策》</navigator>
</view>
</view>
<view
class="btmFix display-flex"
style="padding-left: 16px; padding-right: 16px; height: calc(constant(safe-area-inset-bottom) + 64px); height: calc(env(safe-area-inset-bottom) + 64px)"
>
<view class="c6 f16 flex-1" @click.stop="shrink" style="line-height: 56px">取消</view>
<!-- <button class="dtBtnD mr12" catchtap="showInfo" style="width: 90px !important;margin-right: 16px;">预览</button> -->
<button class="loginOut ml12" style="width: 260px" :loading="loading" hover-class="button-hover" formType="submit">立即报名</button>
</view>
</form>
<!-- catchtouchmove='preventTouchMove' -->
<view class="fadeIn" v-if="iosDialog1" style="position: relative; z-index: 999">
<view class="weui-mask" @touchmove.stop.prevent="preventTouchMove"></view>
<view class="weui-dialog">
<view class="weui-dialog__hd" style="border-bottom: 1px solid #eee; padding: 12px 12px">
<strong class="weui-dialog__title">报名信息</strong>
</view>
<view class="weui-dialog__bd wbv0" style="margin-bottom: 0">
<view class="f16 c3 mb8 mt8">
<text style="min-width: 90px" class="dib tr">姓名:</text>
<block v-if="userInfo.name">
<text class="fwb" v-if="userInfo.name">{{ userInfo.name }}</text>
<text class="fwb" v-if="userInfo.sex">/{{ userInfo.sex == '1' || userInfo.sex == '男' ? '男' : '女' }}</text>
<text class="fwb" v-if="userInfo.age">/{{ userInfo.age }}岁</text>
<text class="fwb" v-if="userInfo.nationality && userInfo.nationality != '族'">/{{ userInfo.nationality }}</text>
</block>
<block v-else>-</block>
</view>
<view class="f16 c3 mb8">
<text style="min-width: 90px" class="dib tr">电话:</text>
<text style="color: #576b95">
{{ userInfo.tel == '' || userInfo.tel == null || userInfo.tel == 'undefined' ? '-' : userInfo.tel }}
</text>
</view>
<view class="f16 c3 mb8">
<text style="min-width: 90px" class="dib tr">身份证号:</text>
<text>{{ userInfo.num == '' || userInfo.num == null || userInfo.num == 'undefined' ? '-' : userInfo.num }}</text>
</view>
<view class="f16 c3 mb8">
<text style="min-width: 90px" class="dib tr">家庭住址:</text>
<text>
{{ userInfo.address == '' || userInfo.address == null || userInfo.address == 'undefined' ? '-' : userInfo.address }}
</text>
</view>
<view class="f16 c3 mb8 mt20">
<text style="min-width: 90px" class="dib tr">报名岗位:</text>
<text class="fwb">{{ jobName || '-' }}</text>
</view>
<view class="f16 c3 mb8">
<text style="min-width: 90px" class="dib tr">面试时间:</text>
<text>{{ currentTime }}</text>
</view>
<view class="f16 c3 mb8">
<text style="min-width: 90px" class="dib tr">接待时间:</text>
<text>{{ currentTime2 }}</text>
</view>
<view class="f16 c3 mb8">
<text style="min-width: 90px" class="dib tr">政策:</text>
<text style>{{ policy || '-' }}</text>
</view>
</view>
<view class="weui-dialog__ft">
<view aria-role="button" class="weui-dialog__btn weui-dialog__btn_default" @tap="copyClose">复制文本</view>
<view aria-role="button" class="weui-dialog__btn weui-dialog__btn_primary" @tap="close1"></view>
</view>
</view>
</view>
</view>
</template>
<script>
// pages/newEnroll/index.js
const app = getApp();
var dateTimePicker = require('../../../utils/dateTimePicker.js');
var dateUtil = require('../../../utils/dateUtil.js');
import { isNotEmptyCheck, nationArray } from '../../../utils/commonUtil';
const mydate = new Date();
export default {
data() {
return {
pageFrom: 1,
files: [],
switch1Checked: true,
urls: [],
userInfo: {
name: '',
address: '',
age: '',
nationality: '',
sex: '',
num: '',
tel: '',
idCardImageUrl: '',
desp: ''
},
showUpload: true,
name: '',
sex: [
{
id: 1,
value: '男'
},
{
id: 2,
value: '女'
}
],
loading: false,
idInfo: {},
index: -1,
agentArray: [],
ageArray: [],
ageIndex: -1,
// jobIndex: -1,
jobArray: [
// {
// id: 1,
// name: "GG",
// },
],
storeIndex: -1,
storeArray: [
// {
// id: 1,
// name: "GG",
// },
],
dateTimeArray1: null,
dateTime1: null,
startYear: 2022,
endYear: 2024,
currentTime: dateUtil.formatDateYMD(mydate.toLocaleDateString()),
currentTime2: dateUtil.formatDateYMD(mydate.toLocaleDateString()),
copyTime: dateUtil.formatDateYMD(mydate.toLocaleDateString()),
searchListShow: false,
searchListShow: false,
searchKeys: '',
searchKeysA: '',
inputShowed: false,
inputVal: '',
inputShowedA: false,
inputValA: '',
storeId: '',
agentId: '',
agentName: '',
storeJobId: '',
policy: '',
currentImg: '',
nationIndex: -1,
// 民族的索引
managerRoleClassify: app.globalData.loginUserInfo.managerRoleClassify,
// 管理员权限
agencyStatus: app.globalData.loginUserInfo.agencyStatus,
corpUserFlag: app.globalData.loginUserInfo.corpUserFlag,
//内部成员
nationArray,
currentUser: {},
jobName: '',
newAddImg: [],
tel: '',
iosDialog1: false,
zhedie: false,
isShowZhedie: false,
idCardImg: '',
dateTime: '',
pageShow: false,
selected: 0,
isShow: false,
dateTimeArray: '',
dateTimeArray2: '',
dateTime2: '',
type: ''
};
}
/**
* 生命周期函数--监听页面加载
*/,
onLoad: function (options) {
var that = this;
console.log(options);
// 先统一给代理名字赋予登陆者的名称applyType
that.setData({
agentName: app.globalData.user.userName,
agentId: app.globalData.user.agencyId,
pageFrom: options.applyType
});
console.log(that.pageFrom + '1首页 2报名页');
// console.log(JSON.parse(options.info));
// 获取缓存的报名人信息
let info = uni.getStorageSync('townsManInfo');
console.log(info);
if (app.globalData.isNotEmptyCheck(info)) {
// 统一给代理岗位相关的字段赋值
if (app.globalData.isNotEmptyCheck(info.userId)) {
that.getImgs(info.userId);
}
if (info.nationality.substr(info.nationality.length - 1, 1) != '族' && info.nationality.substr(info.nationality.length - 1, 1) != '') {
info.nationality = info.nationality + '族';
}
that.setData({
userInfo: info,
currentImg: info.currentImg
});
if (app.globalData.isNotEmptyCheck(info.imgs)) {
that.setData({
files: info.imgs,
urls: info.imgs
});
}
// this.setData({
// userInfo: info,
// currentImg: info.currentImg,
// currentTime: info.currentTime,
// });
console.log(info);
if (info.sex == '男' || info.sex == '1') {
this.sex[0].checked = true;
} else if (info.sex == '女' || info.sex == '2') {
this.sex[1].checked = true;
}
that.nationArray.forEach((item, index) => {
if (item.name.indexOf(info.nationality) > -1 && info.nationality != '') {
console.log('isin');
that.setData({
nationIndex: index
});
}
});
console.log(that.nationIndex);
this.setData({
sex: this.sex
});
if (info.age) {
this.setData({
ageIndex: parseInt(info.age) - 16
});
}
}
// this.getPolicyByStoreJobId(that.data.storeJobId);
console.log(app.globalData.loginUserInfo);
// let jobInfo = wx.getStorageSync("townsManInfoJob");
// if (app.isNotEmptyCheck(jobInfo)) {
// console.log(jobInfo);
// this.setData({
// storeJobId: jobInfo.id,
// jobName: jobInfo.jobName,
// inputVal: jobInfo.storeName || jobInfo.aliasName,
// storeId: jobInfo.storeId,
// policy: jobInfo.policy,
// currentTime: jobInfo.currentTime,
// currentTime2: jobInfo.currentTime2,
// isShowZhedie: true,
// });
// }
if (app.globalData.isNotEmptyCheck(options.info)) {
console.log(options.info);
console.log(JSON.parse(options.info));
// 如果随路由传过来的信息有更新,赋值新的数据
this.setData({
storeJobId: JSON.parse(options.info).id,
jobName: JSON.parse(options.info).jobName,
inputVal: JSON.parse(options.info).storeName || JSON.parse(options.info).aliasName,
storeId: JSON.parse(options.info).storeId
});
that.getPolicyByStoreJobId(that.storeJobId).then(function () {
console.log(that.policy);
let data = {
currentTime: that.currentTime,
currentTime2: that.currentTime2,
storeJobId: that.storeJobId,
jobName: that.jobName,
agentName: that.agentName,
policy: that.policy
};
console.log(data);
uni.setStorage({
key: 'townsManInfoJob',
data
});
});
}
if (app.globalData.isNotEmptyCheck(options.agencyInfo)) {
that.setData({
agentName: JSON.parse(options.agencyInfo).agencyName,
agentId: JSON.parse(options.agencyInfo).id
});
}
if (app.globalData.isNotEmptyCheck(options.imgUrl)) {
console.log(options.imgUrl);
// let imgUrl = JSON.parse(options.imgUrl);
that.uploadIdcardImg(options.imgUrl);
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
// let src = wx.getStorageSync("src");
// console.log(src);
},
onShow: function () {
let that = this;
that.setData({
pageShow: false
});
// wx.hideTabBar({
// success(e) {
// setTimeout(() => {
that.setData({
pageShow: true
});
// }, 500);
// // that.setData({
// // currentJobDrawer: { ...event.currentTarget.dataset.item, index: event.currentTarget.dataset.index },
// // drawerShow: true,
// // });
// },
// });
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
selected: 1,
isShow: false
});
}
that.pushImg();
for (let i = 16; i < 70; i++) {
that.ageArray.push(i);
}
// let that = this;
// let info = wx.getStorageSync("townsManInfo");
// if (app.isNotEmptyCheck(info)) {
// this.setData({
// userInfo: info,
// currentImg: info.currentImg,
// currentTime: info.currentTime,
// });
// console.log(info);
// if (info.sex == "男") {
// this.data.sex[0].checked = true;
// } else if (info.sex == "女") {
// this.data.sex[1].checked = true;
// }
// that.data.nationArray.forEach((item, index) => {
// if (item.name.indexOf(info.nationality) > -1 && info.nationality != "") {
// console.log("isin");
// that.setData({
// nationIndex: index,
// });
// }
// });
// console.log(that.data.nationIndex);
// this.setData({
// sex: this.data.sex,
// });
// }
// this.pickerTap();
let hour = new Date().getHours();
if (hour < 20 && hour >= 6) {
if (that.currentTime == that.copyTime) {
that.currentTime = that.currentTime + ' ' + (hour + 1) + ':00';
that.currentTime2 = that.currentTime2 + ' ' + (hour + 1) + ':00';
}
} else if (hour >= 20) {
if (that.currentTime == that.copyTime) {
that.currentTime = that.currentTime + ' ' + '19:30';
that.currentTime2 = that.currentTime2 + ' ' + '19:30';
}
} else if (hour < 6) {
if (that.currentTime == that.copyTime) {
that.currentTime = that.currentTime + ' ' + '6:00';
that.currentTime2 = that.currentTime2 + ' ' + '6:00';
}
}
this.setData({
currentTime: that.currentTime,
currentTime2: that.currentTime2
});
var obj = dateTimePicker.dateTimePicker(this.startYear, this.endYear, this.currentTime);
console.log(obj);
console.log(obj.dateTimeArray);
for (let index = 0; index < obj.dateTimeArray[0].length; index++) {
obj.dateTimeArray[0][index] = obj.dateTimeArray[0][index] + '年';
}
for (let index = 0; index < obj.dateTimeArray[1].length; index++) {
obj.dateTimeArray[1][index] = obj.dateTimeArray[1][index] + '月';
}
for (let index = 0; index < obj.dateTimeArray[2].length; index++) {
obj.dateTimeArray[2][index] = obj.dateTimeArray[2][index] + '日';
}
if (that.storeJobId) {
that.getPolicyByStoreJobId(that.storeJobId).then(function () {
console.log(that.policy);
let data = {
currentTime: that.currentTime,
currentTime2: that.currentTime2,
storeJobId: that.storeJobId,
jobName: that.jobName,
agentName: that.agentName,
policy: that.policy
};
console.log(data);
uni.setStorage({
key: 'townsManInfoJob',
data
});
});
}
console.log(app.globalData.loginUserInfo);
this.setData({
managerRoleClassify: app.globalData.loginUserInfo.managerRoleClassify,
corpUserFlag: app.globalData.loginUserInfo.corpUserFlag,
dateTimeArray: obj.dateTimeArray,
dateTime: obj.dateTime,
dateTimeArray2: obj.dateTimeArray,
dateTime2: obj.dateTime,
ageArray: that.ageArray
});
console.log();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function (e) {
console.log('isHide');
console.log(e);
},
// tabbar点击监听
onTabItemTap(e) {
console.log(e);
let that = this;
if (!app.globalData.isLogin) {
if (e.index == 1) {
uni.redirectTo({
url: '/pages/login/index'
});
}
} else {
console.log('1250', app.globalData.loginUserInfo.agencyStatus);
if (app.globalData.loginUserInfo.agencyStatus != 1) {
uni.redirectTo({
url: '/pages/tobeAgency/index'
});
}
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
console.log('isonUnload');
this.setData({
userInfo: {
name: '',
address: '',
age: '',
nationality: '',
sex: '',
num: '',
idCardImageUrl: ''
}
});
uni.removeStorageSync('townsManInfo');
// wx.removeStorageSync("townsManInfo");
// wx.switchTab({
// url: "../firstBill/index",
// });
// console.log(wx.getStorageSync("townsManInfo"));
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
methods: {
preventTouchMove() {},
bindPickerChangeAge(e) {
console.log('picker发送选择改变携带值为', e.detail.value);
this.setData({
ageIndex: e.detail.value,
['userInfo.age']: parseInt(e.detail.value) + 16
});
},
ifZhedie() {
this.setData({
zhedie: false
});
},
ifZhankai() {
this.setData({
zhedie: true
});
},
copyClose() {
var that = this;
console.log(that.userInfo);
var text = '';
if (that.userInfo.name != '') {
text =
'姓名:' +
that.userInfo.name +
'/' +
((that.userInfo.sex == 1 || that.userInfo.sex) == '男' ? '男' : '女') +
'/' +
(that.userInfo.age == '' ? '' : that.userInfo.age + '岁') +
(that.userInfo.nationality == '族' ? '' : '/' + that.userInfo.nationality) +
'\n电话' +
(that.userInfo.tel == '' ? '-' : that.userInfo.tel) +
'\n身份证号' +
(that.userInfo.num == '' ? '-' : that.userInfo.num) +
'\n家庭住址' +
(that.userInfo.address == '' ? '-' : that.userInfo.address) +
'\n报名岗位' +
(that.jobName == '' ? '-' : that.jobName) +
'\n面试时间' +
that.currentTime +
'\n接待时间' +
that.currentTime2 +
'\n政策' +
(that.policy == '' ? '-' : that.policy);
} else {
text =
'\u59D3\u540D\uFF1A-\n\u7535\u8BDD\uFF1A' +
(that.userInfo.tel == '' ? '-' : that.userInfo.tel) +
'\n身份证号' +
(that.userInfo.num == '' ? '-' : that.userInfo.num) +
'\n家庭住址' +
(that.userInfo.address == '' ? '-' : that.userInfo.address) +
'\n报名岗位' +
(that.jobName == '' ? '-' : that.jobName) +
'\n面试时间' +
that.currentTime +
'\n接待时间' +
that.currentTime2 +
'\n政策' +
(that.policy == '' ? '-' : that.policy);
}
uni.setClipboardData({
data: text,
success(res) {
uni.getClipboardData({
success(res) {
console.log(res.data); // data
uni.showToast({
title: '内容已复制',
icon: 'none',
duration: 1500
});
that.close1();
}
});
}
});
},
showInfo() {
this.setData({
iosDialog1: true
});
},
close1: function () {
console.log('close');
this.setData({
iosDialog1: false
});
},
shrink() {
// wx.navigateBack({
// delta: -1,
// })
var that = this;
let from = uni.getStorageSync('BILLFROM');
console.log(from);
uni.navigateBack({
delta: -1
});
// wx.switchTab({
// url: `/pages/${from}/index`,
// });
// if (that.data.pageFrom == 1) {
// wx.switchTab({
// url: "../../firstBill/index",
// });
// }
// else {
// wx.switchTab({
// url: "../../workBench/index",
// });
// }
},
chooseMedia() {
var that = this;
uni.chooseMedia({
count: 1,
mediaType: ['image', 'video'],
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success(res) {
// tempFilePath可以作为 img 标签的 src 属性显示图片
uni.showLoading({
title: '上传中...'
});
console.log(res);
const tempFilePaths = res.tempFiles;
tempFilePaths.forEach((item, index) => {
uni.uploadFile({
url: app.globalData.ip + '/imgs/uploadImage',
method: 'post',
// data:currData,
// name: "uploadFile",
filePath: tempFilePaths[index].tempFilePath,
name: 'uploadFile',
header: app.globalData.headers,
success: function (res) {
that.files.push({
url: JSON.parse(res.data).data,
id: new Date().getTime()
});
that.setData({
files: that.files
});
that.pushImg();
setTimeout(() => {
uni.hideLoading();
}, 2000);
// that.updateImgs(currData.type,currData.fkId,currData.data.data);
},
fail: function (res) {
console.log(res);
setTimeout(() => {
uni.hideLoading();
}, 2000);
}
});
setTimeout(() => {
uni.hideLoading();
}, 2000);
});
},
fail(res) {
if (res['errMsg']) {
}
console.log(res);
}
});
},
delImgs(e) {
var that = this;
var url = e.currentTarget.dataset.url;
var id = e.currentTarget.dataset.id;
uni.showModal({
title: '提示',
content: '确定要删除该图片?',
confirmColor: '#ff4400',
success(res) {
if (res.confirm) {
that.files.forEach((item, index) => {
if (id == item.id) {
that.files.splice(index, 1);
// that.data.newAddImg.splice(index, 1);
}
});
that.pushImg();
that.setData({
files: that.files
// newAddImg: that.data.newAddImg,
});
if (id != -999) {
uni.request({
url: app.globalData.ip + '/imgs/del/' + id,
header: app.globalData.header,
// data:currData,
method: 'get',
success: function (res) {
console.log(res.data);
},
fail: function (res) {
console.log(res);
}
});
}
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
pushImg() {
var that = this;
console.log(that.files);
that.urls = [];
// that.data.files.forEach(item=>{
// that.data.urls.push(item.url)
// })
let curr = [];
that.files.forEach((item) => {
curr.push({
url: item.url,
id: item.id
});
});
that.setData({
urls: curr
});
},
showImgs(e) {
var that = this;
console.log(e);
console.log(that.urls);
let curr = [];
that.urls.forEach((item) => {
curr.push(item.url);
});
uni.previewImage({
current: e.currentTarget.dataset.url,
// 当前显示图片的 http 链接
urls: curr // 需要预览的图片 http 链接列表
});
},
radioChange: function (e) {
const sex = this.sex;
let currentSex = '';
for (let i = 0, len = sex.length; i < len; ++i) {
sex[i].checked = sex[i].id == e.detail.value;
if (sex[i].checked) {
currentSex = sex[i].value;
}
}
this.setData({
['userInfo.sex']: currentSex,
sex
});
console.log(e.detail.value);
},
chooseIdCard() {
var that = this;
console.log('ischoise');
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success(res) {
console.log(res);
// debugger;
that.uploadIdcardImg(res);
}
});
},
uploadIdcardImg(imgPath) {
let that = this;
// tempFilePath可以作为img标签的src属性显示图片
let filePath;
console.log(imgPath);
if (imgPath.tempFilePaths) {
filePath = imgPath.tempFilePaths[0];
} else {
filePath = imgPath;
}
console.log(filePath);
uni.showLoading({
title: '识别中...'
});
uni.uploadFile({
// url: app.globalData.ip + '/commons/idCardOcrRecognize',
url: app.globalData.ip + '/commons/idCardOcrRecognizeAndUploadToAliyunOss',
filePath,
name: 'uploadFile',
header: app.globalData.headers,
success: function (res) {
console.log(res);
var idcard = JSON.parse(res.data);
idcard.data['tel'] = that.tel;
if (idcard.status == 200) {
if (
idcard.data.nationality.substr(idcard.data.nationality.length - 1, 1) != '族' &&
idcard.data.nationality.substr(idcard.data.nationality.length - 1, 1) != ''
) {
idcard.data.nationality = idcard.data.nationality + '族';
}
that.setData({
userInfo: idcard.data,
ageIndex: parseInt(idcard.data.age) - 16,
showUpload: false,
idCardImg: idcard.data['idCardImageUrl'],
currentImg: imgPath.tempFilePaths ? imgPath.tempFilePaths[0] : imgPath
});
that.setStorage();
console.log(that.userInfo);
that.nationArray.forEach((item, index) => {
if (item.name.includes(that.userInfo.nationality)) {
that.setData({
nationIndex: index
});
}
});
if (that.userInfo.sex == '男') {
that.sex[0].checked = true;
} else {
that.sex[1].checked = true;
}
// that.data.files.push({'url':tempFilePaths[0]})
// console.log(that.data.files);
that.setData({
// files: that.data.files,
sex: that.sex
});
// that.data.files.push({ url: idcard.data.idCardImageUrl, id: -999 });
// that.data.newAddImg.push(idcard.data.idCardImageUrl);
that.setData({
// files: that.data.files,
// newAddImg: that.data.newAddImg,
});
that.pushImg();
} else {
uni.showToast({
duration: 2000,
title: '身份证未识别',
icon: 'none',
mask: true
});
// console.log(1);
//app.showTips(that, res.data.msg);
}
uni.hideLoading();
},
fail: function (res) {
console.log(res);
setTimeout(() => {
uni.hideLoading();
}, 2000);
}
});
},
toJobAndAgencySelect(e) {
console.log(e);
var that = this;
console.log(this.userInfo);
this.setStorage().then(() => {
console.log('--------', 'isIntonavigation');
uni.navigateTo({
url: `../../recordChoice/index?type=${e.currentTarget.dataset.type}&applyType=${that.pageFrom}`
});
});
},
showImg() {
uni.previewImage({
current: this.currentImg,
// 当前显示图片的 http 链接
urls: [this.currentImg] // 需要预览的图片 http 链接列表
});
},
deleteImg(e, _dataset) {
/* ---处理dataset begin--- */
this.handleDataset(e, _dataset);
/* ---处理dataset end--- */
var that = this;
console.log(e);
that.files.forEach((item, index) => {
if (item.id == e.currentTarget.dataset.id) {
that.files.splice(index, 1);
}
});
that.setData({
files: that.files
});
},
bothwayBind(e) {
console.log(e);
let type = `userInfo.${e.currentTarget.dataset.type}`;
this.setData({
[type]: e.detail.value
});
},
beforeFormSubmit: function (e) {
var that = this;
console.log(e);
console.log(that.files);
that.setData({
loading: true
});
let time1 = new Date(that.currentTime).getTime();
let time2 = new Date(that.currentTime2).getTime();
let currentTime = new Date().getTime();
if (time1 < time2) {
uni.showToast({
duration: 2000,
title: '面试时间不能早于预计到达时间',
icon: 'none',
mask: true
});
that.setData({
loading: false
});
return;
}
if (time1 < currentTime || time2 < currentTime) {
if (time1 < currentTime) {
uni.showToast({
duration: 2000,
title: '面试时间不能早于现在的时间',
icon: 'none',
mask: true
});
} else if (time2 < currentTime) {
uni.showToast({
duration: 2000,
title: '到达时间不能早于现在的时间',
icon: 'none',
mask: true
});
}
that.setData({
loading: false
});
return;
}
if (app.globalData.isEmptyCheck(e.detail.value.userName)) {
uni.showToast({
duration: 2000,
title: '请输入姓名',
icon: 'none',
mask: true
});
that.setData({
loading: false
});
} else if (app.globalData.isEmptyCheck(e.detail.value.sex)) {
uni.showToast({
duration: 2000,
title: '请选择性别',
icon: 'none',
mask: true
});
that.setData({
loading: false
});
} else if (that.ageIndex == -1) {
uni.showToast({
duration: 2000,
title: '请选择年龄',
icon: 'none',
mask: true
});
that.setData({
loading: false
});
} else if (app.globalData.isEmptyCheck(uni.getStorageSync('townsManInfoJob'))) {
uni.showToast({
duration: 2000,
title: '请补全岗位信息',
icon: 'none',
mask: true
});
that.setData({
loading: false
});
} else if (app.globalData.isEmptyCheck(e.detail.value.idCard)) {
uni.showToast({
duration: 2000,
title: '请输入身份证号',
icon: 'none',
mask: true
});
that.setData({
loading: false
});
} else {
setTimeout(() => {
that.formSubmit(e);
}, 1);
e.detail.value['idCardImageUrl'] = that.userInfo.idCardImageUrl;
}
},
getTel(e) {
let tel = e.detail.value;
this.setData({
tel: e.detail.value
});
},
setStorage() {
let that = this;
console.log(uni.getStorageSync('townsManInfo'));
console.log(this.userInfo.tel);
return new Promise((resolve, reject) => {
console.log('写入缓存');
console.log(that.userInfo.tel);
// if(app.isNotEmptyCheck(that.data.tel)){
// userInfo['tel'] = that.data.tel;
// that.setData({
// tel:this.data.userInfo.tel,
// userInfo:
// })
// }
console.log(that.storeJobId);
let data = {
...that.userInfo,
currentImg: that.currentImg,
imgs: that.files,
tel: that.userInfo.tel
};
// currentTime: that.data.currentTime,currentTime2: that.data.currentTime2, storeJobId: that.data.storeJobId, jobName: that.data.jobName, agentName: that.data.agentName,policy:that.data.policy
console.log(data);
uni.setStorage({
key: 'townsManInfo',
data
});
if (that.storeJobId) {
let data2 = {
currentTime: that.currentTime,
currentTime2: that.currentTime2,
storeJobId: that.storeJobId,
jobName: that.jobName,
agentId: that.agentId,
agentName: that.agentName,
policy: that.policy
};
uni.setStorage({
key: 'townsManInfoJob',
data: data2
});
}
console.log(uni.getStorageSync('townsManInfoJob'));
console.log(uni.getStorageSync('townsManInfo'));
resolve();
});
},
formSubmit: function (e) {
var that = this;
console.log(e);
that.setData({
loading: true
});
uni.showLoading({
title: '提交中...',
mask: true
});
let userInfo = uni.getStorageSync('townsManInfo');
let jobInfo = uni.getStorageSync('townsManInfoJob');
// wx.showLoading({
// title: "提交中...",
// mask: true,
// });
// if (that.data.index == -1) {
// wx.showToast({
// duration: 2000,
// title: '请选择代理',
// icon: 'none',
// mask: true
// })
// that.setData({
// loading: false
// })
// } else
// if (that.data.jobIndex == -1) {
// wx.showToast({
// duration: 2000,
// title: "请选择岗位",
// icon: "none",
// mask: true,
// });
// that.setData({
// loading: false,
// });
// } else {
console.log(that.userInfo);
new Promise(function (resolve, reject) {
var paramData = that.userInfo;
paramData['userName'] = e.detail.value.userName;
paramData['sex'] = e.detail.value.sex;
paramData['age'] = that.userInfo.age;
paramData['nation'] = that.userInfo.nationality;
paramData['idCard'] = e.detail.value.idCard;
paramData['num'] = e.detail.value.idCard;
paramData['tel'] = e.detail.value.tel;
paramData['idCardImageUrl'] = that.userInfo.idCardImageUrl;
paramData['address'] = e.detail.value.address;
paramData['desp'] = e.detail.value.desp;
// if(app.isNotEmptyCheck(userInfo.imgs)){
// paramData["imgs"] = userInfo.imgs.toString();
// }
paramData['agencyId'] = '3087';
paramData['jobId'] = jobInfo.storeJobId;
paramData['policy'] = jobInfo.policy;
paramData['interviewTime'] = jobInfo.currentTime;
paramData['receptionTime'] = jobInfo.currentTime2;
let urlss = [];
if (app.globalData.isNotEmptyCheck(that.files)) {
that.files.forEach((item) => {
urlss.push(item.url);
});
}
paramData['imgs'] = urlss.toString();
resolve(paramData);
}).then((paramData) => {
console.log(paramData);
uni.request({
url: app.globalData.ip + '/yishoudan/common/order/add',
header: app.globalData.headers,
data: paramData,
method: 'POST',
success: function (res) {
// wx.removeStorageSync('townsManInfo')
// wx.removeStorageSync('townsManInfoJob')
console.log(res);
if (res.data.status == 200) {
console.log(that.pageFrom + '1首页 2报名页');
setTimeout(function () {
// wx.navigateBack({
// delta: -1,
// });
// wx.setStorageSync('comeFromPage','')
uni.navigateTo({
url: `/pages/returnMessage/index?from=bill&type=success&msg=报名成功`
});
// if (that.data.pageFrom == 1) {
// wx.switchTab({
// url: "../../firstBill/index",
// });
// } else {
// wx.switchTab({
// url: "../../workBench/index",
// });
// }
}, 100);
// wx.showToast({
// duration: 2000,
// title: "报名成功",
// icon: "success",
// mask: true,
// });
} else {
uni.navigateTo({
url: `/pages/returnMessage/index?from=bill&type=fail&msg=报名已提交&status${res.data.status}`
});
// wx.showToast({
// duration: 2000,
// title: res.data.msg,
// icon: "none",
// mask: true,
// });
}
that.setData({
loading: false
});
setTimeout(() => {
uni.hideLoading();
}, 2000);
},
fail(err) {
console.log(err);
uni.showToast({
duration: 2000,
title: err,
icon: 'none',
mask: true
});
setTimeout(() => {
uni.hideLoading();
that.setData({
loading: false
});
}, 2000);
}
});
});
// wx.navigateBack({
// delta: -1,
// })
// });
// }
},
inputTyping: function (e) {
this.setData({
inputVal: e.detail.value
});
if (e.detail.value.length > 0) {
this.setData({
searchListShow: true
});
this.getStoreList(e.detail.value);
} else {
this.setData({
searchListShow: false
});
}
},
getStoreList: function (searchKeys) {
console.log(searchKeys);
var that = this;
that.searchKeys = searchKeys;
// 60秒后重新获取验证码
uni.request({
url: app.globalData.ip + '/store/getAllStoreAliasName',
data: {
keys: searchKeys
},
header: app.globalData.headers,
method: 'GET',
success: function (res) {
console.log(res);
if (res.data.status == 200) {
that.setData({
storeArray: res.data.data
});
}
},
fail: function (res) {}
});
},
setValue: function (e) {
let str = e.currentTarget.dataset.name;
let storeId = e.currentTarget.dataset.id;
console.log(storeId);
this.setData({
inputVal: str,
storeId: storeId,
searchListShow: false
});
this.getJobList(storeId);
},
getJobList: function (storeId) {
var that = this;
return new Promise((resolve, reject) => {
uni.request({
url: app.globalData.ip + '/store/job/getJobNameByStoreId',
data: {
storeId: storeId
},
header: app.globalData.headers,
method: 'GET',
success: function (res) {
console.log(res);
if (res.data.status == 200) {
that.setData({
jobArray: res.data.data
});
resolve();
}
},
fail: function (res) {}
});
});
},
// bindPickerChangeJob: function (e) {
// var that = this;
// console.log("picker发送选择改变携带值为", e.detail.value);
// var storeJobId = that.data.jobArray[e.detail.value].id;
// console.log(storeJobId);
// that.getPolicyByStoreJobId(storeJobId);
// this.setData({
// jobIndex: e.detail.value,
// });
// },
bindPickerChangeNation(e) {
let that = this;
console.log('picker发送选择改变携带值为', e.detail.value);
var nationName = that.nationArray[e.detail.value].name;
this.setData({
nationIndex: e.detail.value,
['userInfo.nationality']: nationName
});
},
getPolicyByStoreJobId: function (storeJobId) {
var that = this;
return new Promise((resolve, reject) => {
uni.request({
url: app.globalData.ip + '/store/job/getPolicyByStoreJobId',
data: {
storeJobId: storeJobId ? storeJobId : ''
},
header: app.globalData.headers,
method: 'GET',
success: function (res) {
console.log(res);
if (res.data.status == 200) {
that.setData({
policy: res.data.data,
isShowZhedie: true
});
resolve();
}
},
fail: function (res) {
console.log(res);
reject();
}
});
});
},
changeDateTime(e) {
var dateTimeArray = this.dateTimeArray;
var dateTime = e.detail.value;
this.setData({
// dateTime: e.detail.value,
currentTime:
dateTimeArray[0][dateTime[0]].replace('年', '') +
'-' +
dateTimeArray[1][dateTime[1]].replace('月', '') +
'-' +
dateTimeArray[2][dateTime[2]].replace('日', '') +
' ' +
dateTimeArray[3][dateTime[3]]
});
console.log(this.dateTimeArray);
console.log(uni.getStorageSync('townsManInfoJob'));
let result = uni.getStorageSync('townsManInfoJob');
result.currentTime = this.currentTime;
uni.setStorageSync('townsManInfoJob', result);
},
changeDateTimeColumn(e) {
console.log(e);
var arr = this.dateTime;
var dateArr = this.dateTimeArray;
arr[e.detail.column] = e.detail.value;
console.log('aaaaaa');
console.log(dateArr[0][arr[0]], dateArr[1][arr[1]]);
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("日",'')
this.setData({
dateTimeArray: dateArr,
dateTime: arr
});
},
changeDateTime2(e) {
var dateTimeArray = this.dateTimeArray;
var dateTime = e.detail.value;
this.setData({
// dateTime: e.detail.value,
currentTime2:
dateTimeArray[0][dateTime[0]].replace('年', '') +
'-' +
dateTimeArray[1][dateTime[1]].replace('月', '') +
'-' +
dateTimeArray[2][dateTime[2]].replace('日', '') +
' ' +
dateTimeArray[3][dateTime[3]]
});
console.log(this.dateTimeArray);
console.log(uni.getStorageSync('townsManInfoJob'));
let result = uni.getStorageSync('townsManInfoJob');
result.currentTime2 = this.currentTime2;
uni.setStorageSync('townsManInfoJob', result);
},
changeDateTimeColumn2(e) {
var arr = this.dateTime2;
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("日",'')
this.setData({
dateTimeArray: dateArr,
dateTime2: arr
});
},
// getAgencyList: function (searchKeys) {
// var that = this;
// that.data.searchKeysA = searchKeys;
// // 60秒后重新获取验证码
// wx.request({
// url: app.globalData.ip + "/agency/getByPmdUserId",
// data: {
// agencyName: searchKeys,
// // pmdUserId: 101125
// },
// header: app.globalData.headers,
// method: "GET",
// success: function (res) {
// console.log(res);
// if (res.data.status == 200) {
// that.setData({
// agentArray: res.data.data,
// });
// }
// },
// fail: function (res) {},
// });
// },
/**
* 生命周期函数--监听页面显示
*/
getImgs(userId) {
var that = this;
uni.request({
url: app.globalData.ip + '/imgs/list/' + userId + '?type=20',
header: app.globalData.headers,
method: 'GET',
success: function (res) {
console.log(res);
// if (res.data.status == 200) {
let currFils = [];
let regs = /\.(jpg|jpeg|png)(\?.*)?$/;
// res.data.data.storeImage.forEach((item) => {
// item.isImg = regs.test(item.url.toLowerCase());
// if(app.isEmptyCheck(item.recordState)){
// item.recordState = 1
// }
// });
if (app.globalData.isNotEmptyCheck(res.data.data.userImgs)) {
res.data.data.userImgs.forEach((item) => {
if (regs.test(item.url.toLowerCase())) {
currFils.push({
url: item.url,
id: item.id
});
}
});
}
that.setData({
files: currFils,
urls: currFils
});
// }
},
fail: function (res) {
console.log(res);
}
});
},
switch1Change: function (e) {
console.log('radio发生change事件携带value值为', e.detail.value);
console.log(e.detail.value);
var check = this.switch1Checked;
if (check) {
this.switch1Checked = false;
console.log('已取消选中');
uni.showToast({
title: '请先阅读并同意《服务协议》及《隐私政策》',
icon: 'none',
duration: 2000
});
} else {
this.switch1Checked = true;
console.log('已选中');
}
this.setData({
switch1Checked: this.switch1Checked
});
// if(!e.detail.value){
// }
},
/**
* 预览身份证图片
*
*
*/
previewImage(e) {
let that = this;
console.log(e);
uni.previewImage({
current: that.idCardImg,
// 当前显示图片的 http 链接
urls: [that.idCardImg] // 需要预览的图片 http 链接列表
});
},
/**
* 预览附件图片
*
*
*/
previewImg() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage1: function () {},
toJobAndAgencySelect(e) {
console.log(e);
var that = this;
console.log(this.userInfo);
this.setStorage().then(() => {
console.log('--------', 'isIntonavigation');
uni.navigateTo({
url: `../../recordChoice/index?type=${e.currentTarget.dataset.type}&applyType=${that.pageFrom}`
});
});
}
}
};
</script>
<style>
@import './index.css';
</style>