cyl/master-0804
wangxia 4 months ago
parent f070accea5
commit 2038246520

@ -978,9 +978,20 @@ export default {
if (!this.attention) { if (!this.attention) {
return false; return false;
} }
// isfans 1 0 let params = {
jobId: this.jobDetail.id,
jobName: this.jobDetail.jobName,
title: "报名",
type: that.jobDetail.jobType,
agencyId: that.jobDetail.agencyId,
};
if (that.isFans !== false) {
params.isFans = that.isFans;
}
that.shareUserId && (params.agencyUserId = that.shareUserId);
that.shareUserAgencyId && (params.shareUserAgencyId = that.shareUserAgencyId);
uni.navigateTo({ uni.navigateTo({
url: `/root/home/quickApplication?jobId=${this.jobDetail.id}&jobName=${this.jobDetail.jobName}&title=报名&type=${that.jobDetail.jobType}&agencyId=${that.jobDetail.agencyId}${that.isFans === false ? '' : `&isFans=${that.isFans }`}`, url: `/root/home/quickApplication?params=${JSON.stringify(params)}`,
}); });
// if (this.jobDetail.recruitment == 1) { // if (this.jobDetail.recruitment == 1) {
// this.formInfo = { // this.formInfo = {

@ -147,21 +147,22 @@ export default {
}, },
onLoad(options) { onLoad(options) {
let that = this; let that = this;
console.log("options", options);
console.log("options.jobId", options.jobId); console.log("options.jobId", options.jobId);
if (options.jobId) { let params = options.params ? JSON.parse(options.params) : {};
this.updateInfo.jobId = options.jobId; if (params.jobId) {
this.updateInfo.jobName = options.jobName; this.updateInfo.jobId = params.jobId;
this.updateInfo.jobName = params.jobName;
} }
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: options.title ? options.title : "报名", title: params.title ? params.title : "报名",
}); });
if (options.type == 1 || options.type == 2) { if (params.type == 1 || params.type == 2) that.jobType = params.type;
that.jobType = options.type; if (params.agencyId) that.updateInfo.upAgencyId = params.agencyId;
}
if (options.agencyId) { params.isFans && (that.isFans = params.isFans);
that.updateInfo.upAgencyId = options.agencyId; params.agencyUserId && (that.updateInfo.agencyUserId = params.agencyUserId); // id
} params.shareUserAgencyId && (that.updateInfo.agencyId = params.shareUserAgencyId); // id
options.isFans && (that.isFans = options.isFans);
this.updateInfo.interviewTimeStr = ""; this.updateInfo.interviewTimeStr = "";
setTimeout(() => { setTimeout(() => {
that.IS_CREATOR = uni.getStorageSync("IS_CREATOR") == 1 ? true : false; that.IS_CREATOR = uni.getStorageSync("IS_CREATOR") == 1 ? true : false;

@ -1,50 +1,50 @@
<template> <template>
<view class="p-login-index"> <view class="p-login-index">
<!-- 15936360682 --> <!-- 15936360682 -->
<view class="g_h_70"></view> <view class="g_h_70"></view>
<view class="g_flex_row_center g_mb_10"> <view class="g_flex_row_center g_mb_10">
<img :src="v3BaseImg + 'bmzz.svg'" alt class="g_w_56 g_h_56 g_radius_8" /> <img :src="v3BaseImg + 'bmzz.svg'" alt class="g_w_56 g_h_56 g_radius_8" />
</view> </view>
<view style="font-size: 18px; font-weight: 400; color: #919191; line-height: 25px; margin-bottom: 60px; text-align: center">劳务上下游收发单工具</view> <view style="font-size: 18px; font-weight: 400; color: #919191; line-height: 25px; margin-bottom: 60px; text-align: center">劳务上下游收发单工具</view>
<view class="m-form g_mb_50 g_pl_40 g_pr_40"> <view class="m-form g_mb_50 g_pl_40 g_pr_40">
<view class="g_bg_f_5 g_radius_6 g_pl_16 g_pr_16 g_flex_column_center g_pt_10 g_pb_10 g_mb_20"> <view class="g_bg_f_5 g_radius_6 g_pl_16 g_pr_16 g_flex_column_center g_pt_10 g_pb_10 g_mb_20">
<u-input maxlength="11" v-model="form.tel" type="number" class="g_fs_16" placeholder="请输入手机号" placeholder-style="color:#999999;font-size:32rpx;line-height:1" /> <u-input maxlength="11" v-model="form.tel" type="number" class="g_fs_16" placeholder="请输入手机号" placeholder-style="color:#999999;font-size:32rpx;line-height:1" />
</view> </view>
<view class="g_bg_f_5 g_radius_6 g_pl_16 g_flex_column_center g_position_rela" v-if="isLoginCode"> <view class="g_bg_f_5 g_radius_6 g_pl_16 g_flex_column_center g_position_rela" v-if="isLoginCode">
<view class="g_flex_row_between"> <view class="g_flex_row_between">
<view class="g_flex_1 g_mr_20 g_pt_10 g_pb_10"> <view class="g_flex_1 g_mr_20 g_pt_10 g_pb_10">
<u-input maxlength="4" v-model="msgCode.code" @input="hideKeyboard" type="number" class="g_fs_16" placeholder="请输入验证码" placeholder-style="color:#999999;font-size:32rpx;line-height:1" /> <u-input maxlength="4" v-model="msgCode.code" @input="hideKeyboard" type="number" class="g_fs_16" placeholder="请输入验证码" placeholder-style="color:#999999;font-size:32rpx;line-height:1" />
</view> </view>
<view class="btn-text g_flex_column_center g_bg_f_5 g_radius_6 g_flex_none g_pt_8 g_pb_8" @click="handleSendMsg"> <view class="btn-text g_flex_column_center g_bg_f_5 g_radius_6 g_flex_none g_pt_8 g_pb_8" @click="handleSendMsg">
<button :class="form.tel.length == 11 ? (msgCode.countdown > 0 ? 'g_c_9' : 'g_c_main') : 'g_c_9'" class="btn-con g_w_126 g_flex_row_center" style="font-size: 32rpx">{{ msgCode.btnText }}</button> <button :class="form.tel.length == 11 ? (msgCode.countdown > 0 ? 'g_c_9' : 'g_c_main') : 'g_c_9'" class="btn-con g_w_126 g_flex_row_center" style="font-size: 32rpx">{{ msgCode.btnText }}</button>
</view> </view>
</view> </view>
</view> </view>
<view v-if="!isLoginCode" class="g_bg_f_5 g_radius_6 g_pl_16 g_pr_16 g_flex_column_center g_pt_10 g_pb_10"> <view v-if="!isLoginCode" class="g_bg_f_5 g_radius_6 g_pl_16 g_pr_16 g_flex_column_center g_pt_10 g_pb_10">
<u-input v-model="form.pwd" type="password" class="g_fs_16" placeholder="请输入密码" placeholder-style="color:#999999;font-size:32rpx;line-height:1" /> <u-input v-model="form.pwd" type="password" class="g_fs_16" placeholder="请输入密码" placeholder-style="color:#999999;font-size:32rpx;line-height:1" />
</view> </view>
<view class="g_fs_14 g_pl_16 g_mt_8" style="color: #576b95" @click="isLoginCode = !isLoginCode" v-if="false">{{ isLoginCode ? "" : "" }}</view> <view class="g_fs_14 g_pl_16 g_mt_8" style="color: #576b95" @click="isLoginCode = !isLoginCode" v-if="false">{{ isLoginCode ? "" : "" }}</view>
</view> </view>
<view> <view>
<view class="g_flex_row_center"> <view class="g_flex_row_center">
<g-button btnText="登录/注册" type="primary" @clickBtn="goHome" width="260" height="48" /> <g-button btnText="登录/注册" type="primary" @clickBtn="goHome" width="260" height="48" />
</view> </view>
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view class="g_flex_row_center g_mt_24 g_mb_24"> <view class="g_flex_row_center g_mt_24 g_mb_24">
<view class="g_flex_column_center"> <view class="g_flex_column_center">
<view class="bor g_w_90 g_h_1 g_border_e_b"></view> <view class="bor g_w_90 g_h_1 g_border_e_b"></view>
</view> </view>
<view class="g_flex_column_center g_fs_15 g_c_9 g_ml_9 g_mr_9"></view> <view class="g_flex_column_center g_fs_15 g_c_9 g_ml_9 g_mr_9"></view>
<view class="g_flex_column_center"> <view class="g_flex_column_center">
<view class="bor g_w_90 g_h_1 g_border_e_b"></view> <view class="bor g_w_90 g_h_1 g_border_e_b"></view>
</view> </view>
</view> </view>
<view class="g_mt_24 g_flex_row_center"> <view class="g_mt_24 g_flex_row_center">
<g-button width="260" height="48" btnText="一键免密登录" type="default" openType="getPhoneNumber" @clickTel="getphonenumber" /> <g-button width="260" height="48" btnText="一键免密登录" type="default" openType="getPhoneNumber" @clickTel="getphonenumber" />
</view> </view>
<!-- #endif --> <!-- #endif -->
</view> </view>
<!-- <view class="g_flex_column_between g_flex_1 g_pb_24"> <!-- <view class="g_flex_column_between g_flex_1 g_pb_24">
<view class="g_fs_12 g_c_9 g_flex_row_center g_mb_32" style="align-items: center; margin-top: 16px"> <view class="g_fs_12 g_c_9 g_flex_row_center g_mb_32" style="align-items: center; margin-top: 16px">
@ -57,350 +57,353 @@
<navigator url="/root/person/agreePrive" class="g_c_sub">隐私政策</navigator> <navigator url="/root/person/agreePrive" class="g_c_sub">隐私政策</navigator>
</view> </view>
</view> --> </view> -->
</view> </view>
</template> </template>
<script> <script>
export default { export default {
onShareAppMessage() { onShareAppMessage() {
return this.G.shareFun() return this.G.shareFun();
}, },
data() { data() {
return { return {
switchChecked: false, switchChecked: false,
localBaseImg: this.G.store().localBaseImg, localBaseImg: this.G.store().localBaseImg,
v3BaseImg: this.G.store().v3BaseImg, v3BaseImg: this.G.store().v3BaseImg,
isLoginCode: false, isLoginCode: false,
form: { form: {
tel: '', tel: "",
pwd: '', pwd: "",
}, },
path: '', path: "",
level: '', level: "",
msgCode: { msgCode: {
// //
code: '', code: "",
btnText: '获取验证码', // 6s btnText: "获取验证码", // 6s
countdown: 0, countdown: 0,
timer: null, timer: null,
}, },
fromPageType: '', fromPageType: "",
currentId: null, currentId: null,
} };
}, },
onLoad(options) { onLoad(options) {
console.log('登录页:', options) console.log("登录页:", options);
this.path = options.path ? options.path : '' this.path = options.path ? options.path : "";
this.level = options.level ? options.level : '' this.level = options.level ? options.level : "";
if (options.type) { if (options.type) {
this.setOptions(options) this.setOptions(options);
} }
console.log('123') console.log("123");
this.getCode((res) => { this.getCode((res) => {
uni.setStorageSync('apply-code', res) uni.setStorageSync("apply-code", res);
}) });
}, },
onShow() { onShow() {
this.G.clearLocalStorage() this.G.clearLocalStorage();
}, },
onHide() { onHide() {
if (this.msgCode.timer) { if (this.msgCode.timer) {
clearInterval(this.msgCode.timer) clearInterval(this.msgCode.timer);
} }
}, },
methods: { methods: {
switchChange() { switchChange() {
console.log('switchChecked', this.switchChecked); console.log("switchChecked", this.switchChecked);
console.log(this.switchChecked); console.log(this.switchChecked);
this.switchChecked = !this.switchChecked; this.switchChecked = !this.switchChecked;
}, },
hideKeyboard(e) { hideKeyboard(e) {
console.log(e) console.log(e);
if (e.length >= 4) { if (e.length >= 4) {
console.log('123123123') console.log("123123123");
uni.hideKeyboard() uni.hideKeyboard();
} }
}, },
setOptions(options) { setOptions(options) {
console.log('options', options) console.log("options", options);
this.fromPageType = options.type this.fromPageType = options.type;
if (options.type == 'detail') { if (options.type == "detail") {
this.currentId = options.scene this.currentId = options.scene;
} }
}, },
goHome() { goHome() {
let that = this, let that = this,
url = '', url = "",
params = {} params = {};
if (that.form.tel == '') { if (that.form.tel == "") {
uni.showToast({ uni.showToast({
title: '请输入手机号', title: "请输入手机号",
icon: 'none', icon: "none",
}) });
return false return false;
} }
if (!/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(that.form.tel)) { if (!/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(that.form.tel)) {
uni.showToast({ uni.showToast({
title: '请输入正确的手机号', title: "请输入正确的手机号",
icon: 'none', icon: "none",
}) });
return false return false;
} }
if (that.isLoginCode) { if (that.isLoginCode) {
// //
if (that.msgCode.code == '') { if (that.msgCode.code == "") {
uni.showToast({ uni.showToast({
title: '请输入验证码', title: "请输入验证码",
icon: 'none', icon: "none",
}) });
return false return false;
} }
url = that.api.login_code url = that.api.login_code;
params = { params = {
tel: that.form.tel, tel: that.form.tel,
code: that.msgCode.code, code: that.msgCode.code,
loginType: 'login', loginType: "login",
wxCode: '', wxCode: "",
} createFakerAgency: 1,
} else { };
// } else {
if (that.form.pwd == '') { //
uni.showToast({ if (that.form.pwd == "") {
title: '请输入密码', uni.showToast({
icon: 'none', title: "请输入密码",
}) icon: "none",
return false });
} return false;
url = that.api.login_user }
params = { url = that.api.login_user;
tel: that.form.tel, params = {
password: that.form.pwd, tel: that.form.tel,
loginType: 'password', password: that.form.pwd,
wxCode: '', loginType: "password",
} wxCode: "",
} createFakerAgency: 1,
uni.showLoading({ };
title: '登录中...', }
mask: true, uni.showLoading({
}) title: "登录中...",
// #ifdef MP-WEIXIN mask: true,
uni.checkSession({ });
success() { // #ifdef MP-WEIXIN
//session_key uni.checkSession({
that.loginAccount(url, params) success() {
}, //session_key
fail() { that.loginAccount(url, params);
// session_key },
that.getCode((res) => { fail() {
uni.setStorageSync('apply-code', res) // session_key
setTimeout(() => { that.getCode((res) => {
that.loginAccount(url, params) uni.setStorageSync("apply-code", res);
}, 300) setTimeout(() => {
}) that.loginAccount(url, params);
}, }, 300);
}) });
// #endif },
// #ifdef H5 || APP-PLUS || MP-TOUTIAO || MP-KUAISHOU });
that.loginAccount(url, params) // #endif
// #endif // #ifdef H5 || APP-PLUS || MP-TOUTIAO || MP-KUAISHOU
}, that.loginAccount(url, params);
// #endif
},
loginAccount(url, params) { loginAccount(url, params) {
let that = this, let that = this,
_params = {} _params = {};
params.wxCode = uni.getStorageSync('apply-code') params.wxCode = uni.getStorageSync("apply-code");
_params = Object.assign(params, { _params = Object.assign(params, {
path: that.path, path: that.path,
}) });
console.log('登录参数:', _params, ' 获取分享参数:', uni.getStorageSync('apply-jobdetail-id')) console.log("登录参数:", _params, " 获取分享参数:", uni.getStorageSync("apply-jobdetail-id"));
that.G.Get(url, _params, (res) => { that.G.Get(url, _params, (res) => {
console.log('登录成功:', res) console.log("登录成功:", res);
that.setToken(res) that.setToken(res);
}) });
}, },
getCode(callback = () => {}) { getCode(callback = () => {}) {
uni.login({ uni.login({
success(wxRes) { success(wxRes) {
callback(wxRes.code) callback(wxRes.code);
}, },
fail(res) { fail(res) {
console.log(res) console.log(res);
}, },
}) });
}, },
getphonenumber(e) { getphonenumber(e) {
let that = this let that = this;
if (e.detail.code) { if (e.detail.code) {
// buttontoken // buttontoken
uni.checkSession({ uni.checkSession({
success() { success() {
//session_key //session_key
that.loginWX(e) that.loginWX(e);
}, },
fail() { fail() {
// session_key // session_key
that.getCode((res) => { that.getCode((res) => {
uni.setStorageSync('apply-code', res) uni.setStorageSync("apply-code", res);
setTimeout(() => { setTimeout(() => {
that.loginWX(e) that.loginWX(e);
}, 300) }, 300);
}) });
}, },
}) });
} else { } else {
// //
} }
}, },
loginWX(e) { loginWX(e) {
let that = this let that = this;
that.G.Get( that.G.Get(
that.api.login_getWxInfo, that.api.login_getWxInfo,
{ {
code: uni.getStorageSync('apply-code'), code: uni.getStorageSync("apply-code"),
btnCode: e.detail.code, btnCode: e.detail.code,
iv: e.detail.iv, iv: e.detail.iv,
encryptedData: e.detail.encryptedData, encryptedData: e.detail.encryptedData,
}, },
(wxRes) => { (wxRes) => {
that.G.Get( that.G.Get(
that.api.login_wechat, that.api.login_wechat,
{ {
openId: wxRes.openId, openId: wxRes.openId,
tel: wxRes.phoneNumber, tel: wxRes.phoneNumber,
unionid: wxRes.unionid, unionid: wxRes.unionid,
}, createFakerAgency: 1,
(res) => { },
that.setToken(res) (res) => {
} that.setToken(res);
) }
} );
) }
}, );
// token },
// token
setToken($data) { setToken($data) {
let that = this let that = this;
console.log('获取登录用户信息:', $data) console.log("获取登录用户信息:", $data);
uni.hideLoading() uni.hideLoading();
uni.setStorageSync('apply-userinfo', $data) // , uni.setStorageSync("apply-userinfo", $data); // ,
uni.setStorageSync('apply-userinfo-copy', JSON.stringify($data)) // uni.setStorageSync("apply-userinfo-copy", JSON.stringify($data)); //
uni.setStorageSync('apply-avatar', $data.imgSrc) // -- 便 uni.setStorageSync("apply-avatar", $data.imgSrc); // -- 便
uni.setStorageSync('apply-username', $data.userName) // -- 便 uni.setStorageSync("apply-username", $data.userName); // -- 便
uni.setStorageSync('apply-tel', $data.tel) // -- 便 uni.setStorageSync("apply-tel", $data.tel); // -- 便
uni.setStorageSync('apply-token', $data.token) // -- token便 uni.setStorageSync("apply-token", $data.token); // -- token便
uni.setStorageSync('apply-agencyId', $data.user.agencyId) // -- id便 uni.setStorageSync("apply-agencyId", $data.user.agencyId); // -- id便
uni.setStorageSync('apply-uid', $data.user.id) // -- 便 uni.setStorageSync("apply-uid", $data.user.id); // -- 便
uni.setStorageSync('apply-supplierAccount', $data.supplierAccount) // -- 便 0. 1. uni.setStorageSync("apply-supplierAccount", $data.supplierAccount); // -- 便 0. 1.
uni.$emit('isGlogin', { uni.$emit("isGlogin", {
uid: $data.user.id, uid: $data.user.id,
}) });
if (!that.path) { if (!that.path) {
uni.switchTab({ uni.switchTab({
url: '/pages/home/index', url: "/pages/home/index",
}) });
} else if (that.fromPageType == 'detail') { } else if (that.fromPageType == "detail") {
uni.reLaunch({ uni.reLaunch({
url: `${that.path}?scene=${that.currentId}`, url: `${that.path}?scene=${that.currentId}`,
}) });
// uni.navigateBack({ // uni.navigateBack({
// delta: 1, // delta: 1,
// }) // })
return return;
} else { } else {
// //
uni.reLaunch({ uni.reLaunch({
url: that.path, url: that.path,
}) });
} }
// if ($data.agencyStatus == 1) { // if ($data.agencyStatus == 1) {
that.G.Get(that.api.login_agencyInfo, {}, (aRes) => { that.G.Get(that.api.login_agencyInfo, {}, (aRes) => {
console.log('获取团队信息:', aRes) console.log("获取团队信息:", aRes);
uni.setStorageSync('agencyInfo', aRes.agency) // 1 2 uni.setStorageSync("agencyInfo", aRes.agency); // 1 2
uni.setStorageSync('IS_CREATOR', aRes.agency.userId == $data.user.id || $data.admin == true ? 1 : 2) // 1 2 uni.setStorageSync("IS_CREATOR", aRes.agency.userId == $data.user.id || $data.admin == true ? 1 : 2); // 1 2
// //
uni.setStorageSync('SHOW_INVITE', 1) uni.setStorageSync("SHOW_INVITE", 1);
}) });
// } // }
}, },
// //
handleSendMsg() { handleSendMsg() {
let that = this let that = this;
if (this.msgCode.countdown > 0) { if (this.msgCode.countdown > 0) {
return false return false;
} }
if (that.form.tel == '') { if (that.form.tel == "") {
uni.showToast({ uni.showToast({
title: '请输入手机号后再获取', title: "请输入手机号后再获取",
icon: 'none', icon: "none",
}) });
return false return false;
} }
if (!/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(that.form.tel)) { if (!/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(that.form.tel)) {
uni.showToast({ uni.showToast({
title: '请输入正确的手机号', title: "请输入正确的手机号",
icon: 'none', icon: "none",
}) });
return false return false;
} }
that.G.Get( that.G.Get(
that.api.login_sendMsg, that.api.login_sendMsg,
{ {
tel: that.form.tel, tel: that.form.tel,
type:"assistant", type: "assistant",
}, },
(res) => { (res) => {
that.msgCode.countdown = 60 that.msgCode.countdown = 60;
that.msgCode.btnText = that.msgCode.countdown + 's' that.msgCode.btnText = that.msgCode.countdown + "s";
clearInterval(that.msgCode.timer) clearInterval(that.msgCode.timer);
that.msgCode.timer = setInterval(() => { that.msgCode.timer = setInterval(() => {
if (that.msgCode.countdown > 0) { if (that.msgCode.countdown > 0) {
that.msgCode.countdown-- that.msgCode.countdown--;
that.msgCode.btnText = that.msgCode.countdown + 's' that.msgCode.btnText = that.msgCode.countdown + "s";
} else { } else {
clearInterval(that.msgCode.timer) clearInterval(that.msgCode.timer);
that.msgCode.timer = null that.msgCode.timer = null;
that.msgCode.btnText = '获取验证码' that.msgCode.btnText = "获取验证码";
} }
}, 1000) }, 1000);
} }
) );
}, },
}, },
} };
</script> </script>
<style lang="scss"> <style lang="scss">
.p-login-index { .p-login-index {
/* #ifdef MP-TOUTIAO || MP-KUAISHOU */ /* #ifdef MP-TOUTIAO || MP-KUAISHOU */
min-height: 100%; min-height: 100%;
background-color: #fff; background-color: #fff;
/* #endif */ /* #endif */
.btn-text { .btn-text {
.btn-con { .btn-con {
border-left: 2rpx solid #e5e5e5; border-left: 2rpx solid #e5e5e5;
padding: 0 32rpx; padding: 0 32rpx;
background-color: transparent; background-color: transparent;
border-radius: 0; border-radius: 0;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
} }
} }
.tel-btn { .tel-btn {
width: 500rpx; width: 500rpx;
height: 84rpx; height: 84rpx;
border: 2rpx solid #00b666; border: 2rpx solid #00b666;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
top: 0; top: 0;
border-radius: 48rpx; border-radius: 48rpx;
opacity: 0; opacity: 0;
} }
} }
</style> </style>

Loading…
Cancel
Save