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

@ -978,9 +978,20 @@ export default {
if (!this.attention) {
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({
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) {
// this.formInfo = {

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

@ -63,7 +63,7 @@
<script>
export default {
onShareAppMessage() {
return this.G.shareFun()
return this.G.shareFun();
},
data() {
return {
@ -72,195 +72,197 @@ export default {
v3BaseImg: this.G.store().v3BaseImg,
isLoginCode: false,
form: {
tel: '',
pwd: '',
tel: "",
pwd: "",
},
path: '',
level: '',
path: "",
level: "",
msgCode: {
//
code: '',
btnText: '获取验证码', // 6s
code: "",
btnText: "获取验证码", // 6s
countdown: 0,
timer: null,
},
fromPageType: '',
fromPageType: "",
currentId: null,
}
};
},
onLoad(options) {
console.log('登录页:', options)
this.path = options.path ? options.path : ''
this.level = options.level ? options.level : ''
console.log("登录页:", options);
this.path = options.path ? options.path : "";
this.level = options.level ? options.level : "";
if (options.type) {
this.setOptions(options)
this.setOptions(options);
}
console.log('123')
console.log("123");
this.getCode((res) => {
uni.setStorageSync('apply-code', res)
})
uni.setStorageSync("apply-code", res);
});
},
onShow() {
this.G.clearLocalStorage()
this.G.clearLocalStorage();
},
onHide() {
if (this.msgCode.timer) {
clearInterval(this.msgCode.timer)
clearInterval(this.msgCode.timer);
}
},
methods: {
switchChange() {
console.log('switchChecked', this.switchChecked);
console.log("switchChecked", this.switchChecked);
console.log(this.switchChecked);
this.switchChecked = !this.switchChecked;
},
hideKeyboard(e) {
console.log(e)
console.log(e);
if (e.length >= 4) {
console.log('123123123')
uni.hideKeyboard()
console.log("123123123");
uni.hideKeyboard();
}
},
setOptions(options) {
console.log('options', options)
this.fromPageType = options.type
if (options.type == 'detail') {
this.currentId = options.scene
console.log("options", options);
this.fromPageType = options.type;
if (options.type == "detail") {
this.currentId = options.scene;
}
},
goHome() {
let that = this,
url = '',
params = {}
if (that.form.tel == '') {
url = "",
params = {};
if (that.form.tel == "") {
uni.showToast({
title: '请输入手机号',
icon: 'none',
})
return false
title: "请输入手机号",
icon: "none",
});
return false;
}
if (!/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(that.form.tel)) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
})
return false
title: "请输入正确的手机号",
icon: "none",
});
return false;
}
if (that.isLoginCode) {
//
if (that.msgCode.code == '') {
if (that.msgCode.code == "") {
uni.showToast({
title: '请输入验证码',
icon: 'none',
})
return false
title: "请输入验证码",
icon: "none",
});
return false;
}
url = that.api.login_code
url = that.api.login_code;
params = {
tel: that.form.tel,
code: that.msgCode.code,
loginType: 'login',
wxCode: '',
}
loginType: "login",
wxCode: "",
createFakerAgency: 1,
};
} else {
//
if (that.form.pwd == '') {
if (that.form.pwd == "") {
uni.showToast({
title: '请输入密码',
icon: 'none',
})
return false
title: "请输入密码",
icon: "none",
});
return false;
}
url = that.api.login_user
url = that.api.login_user;
params = {
tel: that.form.tel,
password: that.form.pwd,
loginType: 'password',
wxCode: '',
}
loginType: "password",
wxCode: "",
createFakerAgency: 1,
};
}
uni.showLoading({
title: '登录中...',
title: "登录中...",
mask: true,
})
});
// #ifdef MP-WEIXIN
uni.checkSession({
success() {
//session_key
that.loginAccount(url, params)
that.loginAccount(url, params);
},
fail() {
// session_key
that.getCode((res) => {
uni.setStorageSync('apply-code', res)
uni.setStorageSync("apply-code", res);
setTimeout(() => {
that.loginAccount(url, params)
}, 300)
})
that.loginAccount(url, params);
}, 300);
});
},
})
});
// #endif
// #ifdef H5 || APP-PLUS || MP-TOUTIAO || MP-KUAISHOU
that.loginAccount(url, params)
that.loginAccount(url, params);
// #endif
},
loginAccount(url, params) {
let that = this,
_params = {}
params.wxCode = uni.getStorageSync('apply-code')
_params = {};
params.wxCode = uni.getStorageSync("apply-code");
_params = Object.assign(params, {
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) => {
console.log('登录成功:', res)
that.setToken(res)
})
console.log("登录成功:", res);
that.setToken(res);
});
},
getCode(callback = () => {}) {
uni.login({
success(wxRes) {
callback(wxRes.code)
callback(wxRes.code);
},
fail(res) {
console.log(res)
console.log(res);
},
})
});
},
getphonenumber(e) {
let that = this
let that = this;
if (e.detail.code) {
// buttontoken
uni.checkSession({
success() {
//session_key
that.loginWX(e)
that.loginWX(e);
},
fail() {
// session_key
that.getCode((res) => {
uni.setStorageSync('apply-code', res)
uni.setStorageSync("apply-code", res);
setTimeout(() => {
that.loginWX(e)
}, 300)
})
that.loginWX(e);
}, 300);
});
},
})
});
} else {
//
}
},
loginWX(e) {
let that = this
let that = this;
that.G.Get(
that.api.login_getWxInfo,
{
code: uni.getStorageSync('apply-code'),
code: uni.getStorageSync("apply-code"),
btnCode: e.detail.code,
iv: e.detail.iv,
encryptedData: e.detail.encryptedData,
@ -272,81 +274,82 @@ export default {
openId: wxRes.openId,
tel: wxRes.phoneNumber,
unionid: wxRes.unionid,
createFakerAgency: 1,
},
(res) => {
that.setToken(res)
that.setToken(res);
}
)
);
}
)
);
},
// token
setToken($data) {
let that = this
console.log('获取登录用户信息:', $data)
uni.hideLoading()
uni.setStorageSync('apply-userinfo', $data) // ,
uni.setStorageSync('apply-userinfo-copy', JSON.stringify($data)) //
uni.setStorageSync('apply-avatar', $data.imgSrc) // -- 便
uni.setStorageSync('apply-username', $data.userName) // -- 便
uni.setStorageSync('apply-tel', $data.tel) // -- 便
uni.setStorageSync('apply-token', $data.token) // -- token便
uni.setStorageSync('apply-agencyId', $data.user.agencyId) // -- id便
uni.setStorageSync('apply-uid', $data.user.id) // -- 便
uni.setStorageSync('apply-supplierAccount', $data.supplierAccount) // -- 便 0. 1.
uni.$emit('isGlogin', {
let that = this;
console.log("获取登录用户信息:", $data);
uni.hideLoading();
uni.setStorageSync("apply-userinfo", $data); // ,
uni.setStorageSync("apply-userinfo-copy", JSON.stringify($data)); //
uni.setStorageSync("apply-avatar", $data.imgSrc); // -- 便
uni.setStorageSync("apply-username", $data.userName); // -- 便
uni.setStorageSync("apply-tel", $data.tel); // -- 便
uni.setStorageSync("apply-token", $data.token); // -- token便
uni.setStorageSync("apply-agencyId", $data.user.agencyId); // -- id便
uni.setStorageSync("apply-uid", $data.user.id); // -- 便
uni.setStorageSync("apply-supplierAccount", $data.supplierAccount); // -- 便 0. 1.
uni.$emit("isGlogin", {
uid: $data.user.id,
})
});
if (!that.path) {
uni.switchTab({
url: '/pages/home/index',
})
} else if (that.fromPageType == 'detail') {
url: "/pages/home/index",
});
} else if (that.fromPageType == "detail") {
uni.reLaunch({
url: `${that.path}?scene=${that.currentId}`,
})
});
// uni.navigateBack({
// delta: 1,
// })
return
return;
} else {
//
uni.reLaunch({
url: that.path,
})
});
}
// if ($data.agencyStatus == 1) {
that.G.Get(that.api.login_agencyInfo, {}, (aRes) => {
console.log('获取团队信息:', aRes)
uni.setStorageSync('agencyInfo', aRes.agency) // 1 2
uni.setStorageSync('IS_CREATOR', aRes.agency.userId == $data.user.id || $data.admin == true ? 1 : 2) // 1 2
console.log("获取团队信息:", aRes);
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('SHOW_INVITE', 1)
})
uni.setStorageSync("SHOW_INVITE", 1);
});
// }
},
//
handleSendMsg() {
let that = this
let that = this;
if (this.msgCode.countdown > 0) {
return false
return false;
}
if (that.form.tel == '') {
if (that.form.tel == "") {
uni.showToast({
title: '请输入手机号后再获取',
icon: 'none',
})
return false
title: "请输入手机号后再获取",
icon: "none",
});
return false;
}
if (!/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(that.form.tel)) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
})
return false
title: "请输入正确的手机号",
icon: "none",
});
return false;
}
that.G.Get(
that.api.login_sendMsg,
@ -355,24 +358,24 @@ export default {
type: "assistant",
},
(res) => {
that.msgCode.countdown = 60
that.msgCode.btnText = that.msgCode.countdown + 's'
clearInterval(that.msgCode.timer)
that.msgCode.countdown = 60;
that.msgCode.btnText = that.msgCode.countdown + "s";
clearInterval(that.msgCode.timer);
that.msgCode.timer = setInterval(() => {
if (that.msgCode.countdown > 0) {
that.msgCode.countdown--
that.msgCode.btnText = that.msgCode.countdown + 's'
that.msgCode.countdown--;
that.msgCode.btnText = that.msgCode.countdown + "s";
} else {
clearInterval(that.msgCode.timer)
that.msgCode.timer = null
that.msgCode.btnText = '获取验证码'
clearInterval(that.msgCode.timer);
that.msgCode.timer = null;
that.msgCode.btnText = "获取验证码";
}
}, 1000)
}, 1000);
}
)
);
},
},
}
};
</script>
<style lang="scss">

Loading…
Cancel
Save