Bladeren bron

Merge branch 'master' of https://git.nanodreamtech.com/Boss/yizhizan-h5

7 maanden geleden
bovenliggende
commit
2b13c72029

+ 1 - 1
my/setting/customer.vue

@@ -109,7 +109,7 @@
 			//统一登录跳转
 			//统一登录跳转
 			goLoginInfo() {
 			goLoginInfo() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url: '/pages/public/loginphone'
+					url: "/pages/public/loginphone?type=1"
 				});
 				});
 			},
 			},
 		}
 		}

+ 2 - 1
pages/my/index.vue

@@ -14,7 +14,8 @@
 						v-if="token && XCXIsSelect != '否'">
 						v-if="token && XCXIsSelect != '否'">
 						<image src="@/static/images/jobApplicant/qiehuan.svg" mode="scaleToFill"
 						<image src="@/static/images/jobApplicant/qiehuan.svg" mode="scaleToFill"
 							style="margin-top: 40rpx;margin-right:30rpx" @click="goNav('switchRoles')" />
 							style="margin-top: 40rpx;margin-right:30rpx" @click="goNav('switchRoles')" />
-						<u-icon @click="goNav('/pages/my/setup')" color="#ffffff" top="16rpx" size="34rpx" name="setting"></u-icon>
+							<image src="@/static/images/jobApplicant/shezhi.svg" mode="scaleToFill"
+								style="margin-top: 40rpx;" @click="goNav('/pages/my/setup')" />
 						<!-- <image
 						<!-- <image
               src="../../static/images/my/icon/selectUser.png"
               src="../../static/images/my/icon/selectUser.png"
               style="width: 40rpx; height: 100%; margin-right: 40rpx"
               style="width: 40rpx; height: 100%; margin-right: 40rpx"

+ 1 - 1
pages/my/jobApplicant/registerSuccess.vue

@@ -48,7 +48,7 @@ export default {
 		//     url: "/pages/index/index",
 		//     url: "/pages/index/index",
 		//   });
 		//   });
 		// }
 		// }
-        uni.navigateTo({ url: '/pages/my/jobApplicant/loginInput?type=1' })
+        uni.navigateTo({ url: "/pages/public/loginphone?type=1" })
     },
     },
   },
   },
 };
 };

+ 2 - 2
pages/my/onlineResume.vue

@@ -340,7 +340,7 @@
 			},
 			},
 			goToBasicInfo() {
 			goToBasicInfo() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url: '/package/jobIntention/basicInfo?resumesStatus='+this.detail.resumeList.resumesStatus+'&birthday='+this.detail.resumeList.birthday+'&ifExp='+this.detail.resumeList.ifExp+'&resumesPhone='+this.detail.resumeList.resumesPhone
+					url: '/package/jobIntention/basicInfo?resumesStatus='+(this.detail.resumeList&&this.detail.resumeList.resumesStatus||0)+'&birthday='+(this.detail.resumeList&&this.detail.resumeList.birthday||'')+'&ifExp='+(this.detail.resumeList&&this.detail.resumeList.ifExp||0)+'&resumesPhone='+(this.detail.resumeList&&this.detail.resumeList.resumesPhone||'')
 				})
 				})
 			},
 			},
 			getBusinessTypes() {
 			getBusinessTypes() {
@@ -355,7 +355,7 @@
 			setResume() {
 			setResume() {
 				let data={
 				let data={
 					ifExp:this.hasEcommerceExperience?1:0,
 					ifExp:this.hasEcommerceExperience?1:0,
-					adv:this.detail.resumeList.adv,
+					adv:this.detail.resumeList&&this.detail.resumeList.adv||'',
 				}
 				}
 			  uni.showLoading({ title: "提交中..." });
 			  uni.showLoading({ title: "提交中..." });
 			  this.$Request.postJson("/app/userFirst/regist", data).then((res) => {
 			  this.$Request.postJson("/app/userFirst/regist", data).then((res) => {

+ 156 - 113
pages/public/login.vue

@@ -45,7 +45,7 @@
         手机号登录
         手机号登录
       </button> -->
       </button> -->
 			<!-- #ifdef APP -->
 			<!-- #ifdef APP -->
-			<view class="login-btn wechat" :class="{ disabled: !checked }" :disabled="checked" @click="login">
+			<view class="login-btn wechat" :class="{ disabled: !checked }" :disabled="checked" @click="wxAppLogin">
 				<image src="@/static/images/jobApplicant/wx.svg" mode="scaleToFill" />微信登录
 				<image src="@/static/images/jobApplicant/wx.svg" mode="scaleToFill" />微信登录
 			</view>
 			</view>
 			<!-- #endif -->
 			<!-- #endif -->
@@ -348,31 +348,119 @@
 					}
 					}
 				}
 				}
 			},
 			},
-			wxGetUserInfo(e) {
-				if (this.checked) {
-					wx.getUserProfile({
-						desc: "业务需要",
-						success: (infoRes) => {
-							console.log(
-								"infoRes.encryptedData__________:" + JSON.stringify(infoRes.userInfo)
-							);
-							let nickName = infoRes.userInfo.nickName; //昵称
-							let avatarUrl = infoRes.userInfo.avatarUrl; //头像
-							let sex = infoRes.userInfo.gender; //头像
-							try {
-								this.$queue.showLoading("正在登录中...");
-								this.login(nickName, avatarUrl, sex);
-							} catch (e) {}
-						},
-					});
-				} else {
+			// wxGetUserInfo(e) {
+			// 	if (this.checked) {
+			// 		wx.getUserProfile({
+			// 			desc: "业务需要",
+			// 			success: (infoRes) => {
+			// 				console.log(
+			// 					"infoRes.encryptedData__________:" + JSON.stringify(infoRes.userInfo)
+			// 				);
+			// 				let nickName = infoRes.userInfo.nickName; //昵称
+			// 				let avatarUrl = infoRes.userInfo.avatarUrl; //头像
+			// 				let sex = infoRes.userInfo.gender; //头像
+			// 				try {
+			// 					this.$queue.showLoading("正在登录中...");
+			// 					this.login(nickName, avatarUrl, sex);
+			// 				} catch (e) {}
+			// 			},
+			// 		});
+			// 	} else {
+			// 		uni.showToast({
+			// 			title: "请阅读并同意《隐私协议》和《用户服务协议》",
+			// 			icon: "none",
+			// 		});
+			// 	}
+			// },
+			// APP微信登录
+			wxAppLogin() {
+				if (!this.checked) {
 					uni.showToast({
 					uni.showToast({
 						title: "请阅读并同意《隐私协议》和《用户服务协议》",
 						title: "请阅读并同意《隐私协议》和《用户服务协议》",
 						icon: "none",
 						icon: "none",
 					});
 					});
+					return;
 				}
 				}
+				let that = this;
+				uni.login({
+					provider: "weixin",
+					success: function(loginRes) {
+						console.log(loginRes);
+						uni.setStorageSync("openId", loginRes.authResult.openid)
+						uni.setStorageSync("unionId", loginRes.authResult.unionid)
+						let data = {
+							wxOpenId: loginRes.authResult.openid,
+							token: loginRes.authResult.access_token
+						};
+						that.$Request.postT("/app/Login/wxAppLogin", data)
+							.then((res) => {
+								console.log(res)
+								if (res.code == 0) {
+									that.$queue.setData("userId", res.user.userId);
+									that.$queue.setData("token", res.token);
+									that.$queue.setData("phone", res.user.phone);
+									that.$queue.setData("userName", res.user.userName);
+									that.$queue.setData("avatar", res.user.avatar);
+									that.$queue.setData("invitationCode", res.user.invitationCode);
+									that.$queue.setData("inviterCode", res.user.inviterCode);
+									that.getIsVip();
+									uni.hideLoading();
+									that.$queue.setData("userType", res.user.userType);
+									//判断是否开启身份选择 是/否
+									that.$Request.get("/app/common/type/339").then((rest) => {
+										if (rest.code == 0) {
+											if (rest.data.value == "是") {
+												// 这里是跳转到选择职场身份的界面
+												uni.reLaunch({
+													url: "/pages/public/selectIdentity/selectIdentity",
+												});
+											} else {
+												if (res.user.userType == 2) { //企业
+													// 原有的。判断第一次根据userType  ==null
+													uni.reLaunch({
+														url: "/pages/my/index",
+													});
+												} else if (res.user.userType == 1) {
+													uni.reLaunch({
+														url: "/pages/my/index",
+													});
+												} else {
+													//表示是第一次进来,走引导页
+													uni.navigateTo({
+														url: "/pages/my/jobApplicant/guidePage",
+													});
+												}
+											}
+										} else {
+											if (res.user.userType == 2) { //企业
+												// 原有的。判断第一次根据userType  ==null
+												uni.reLaunch({
+													url: "/pages/my/index",
+												});
+								
+											} else if (res.user.userType == 1) {
+												uni.reLaunch({
+													url: "/pages/my/index",
+												});
+								
+											} else {
+												//表示是第一次进来,走引导页
+												uni.navigateTo({
+													url: "/pages/my/jobApplicant/guidePage",
+												});
+											}
+										}
+									});
+									
+								} else {
+									uni.hideLoading();
+									that.$queue.showToast(res.msg);
+								}
+							})
+					},
+				});
 			},
 			},
-			//登录
+			//小程序登录
 			login(nickName, avatarUrl, sex) {
 			login(nickName, avatarUrl, sex) {
 				if (!this.checked) {
 				if (!this.checked) {
 					uni.showToast({
 					uni.showToast({
@@ -392,48 +480,40 @@
 							code: loginRes.code,
 							code: loginRes.code,
 						};
 						};
 						that.$Request.get("/app/Login/wxLogin", data)
 						that.$Request.get("/app/Login/wxLogin", data)
-						.then((res) => {
-							if (res.code == 0) {
-								uni.hideLoading();
-								uni.setStorageSync("openId", res.data.open_id);
-								uni.setStorageSync("unionId", res.data.unionId);
-								that.sessionkey = res.data.session_key;
-								let sendData = {
-									openId: uni.getStorageSync("openId"),
-									unionId: uni.getStorageSync("unionId"),
-									userName: "游客",
-									avatar: "",
-									sex: "1", //性别
-									inviterCode: that.$queue.getData(
-									"inviterCode"), //别人登录进来携带你的邀请码
-								};
-								that.sendDataList = sendData;
-								that.flag = res.data.flag;
-								// 第一次登录获取手机号
-								// console.log(that.phoneNum,'**********************1')
-								// console.log(that.flag,'**********************2')
-								if (that.flag == "2" && that.phoneNum) {
-									that.weixinPhone = true;
+							.then((res) => {
+								if (res.code == 0) {
+									uni.hideLoading();
+									uni.setStorageSync("openId", res.data.open_id);
+									uni.setStorageSync("unionId", res.data.unionId);
+									that.sessionkey = res.data.session_key;
+									let sendData = {
+										openId: uni.getStorageSync("openId"),
+										unionId: uni.getStorageSync("unionId"),
+										userName: "游客",
+										avatar: "",
+										sex: "1", //性别
+										inviterCode: that.$queue.getData(
+											"inviterCode"), //别人登录进来携带你的邀请码
+									};
+									that.sendDataList = sendData;
+									that.flag = res.data.flag;
+									// 第一次登录获取手机号
+									// console.log(that.phoneNum,'**********************1')
+									// console.log(that.flag,'**********************2')
+									if (that.flag == "2" && that.phoneNum) {
+										that.weixinPhone = true;
+									} else {
+										that.getWeixinInfo(sendData);
+									}
 								} else {
 								} else {
-									that.getWeixinInfo(sendData);
+									uni.showToast({
+										icon: "none",
+										title: res.msg,
+										duration: 2000,
+									});
+									console.log(res, "失败");
 								}
 								}
-							} else {
-								uni.showToast({
-									icon: "none",
-									title: res.msg,
-									duration: 2000,
-								});
-								console.log(res, "失败");
-							}
-						}).catch((err) => {
-							uni.hideLoading();
-							console.error("微信登录接口异常:", err);
-							uni.showToast({
-								icon: "none",
-								title: "微信登录接口异常,请稍后再试",
-								duration: 2000,
-							});
-						});
+							})
 					},
 					},
 				});
 				});
 			},
 			},
@@ -468,6 +548,15 @@
 					}
 					}
 				});
 				});
 			},
 			},
+			getIsVip() {
+				this.$Request.get("/app/UserVip/isUserVip").then((res) => {
+					if (res.code == 0) {
+						// this.isVip = res.data
+						console.log(res.data);
+						this.$queue.setData("isVip", res.data);
+					}
+				});
+			},
 			//获取个人信息
 			//获取个人信息
 			getWeixinInfo(sendData) {
 			getWeixinInfo(sendData) {
 				let that = this;
 				let that = this;
@@ -511,67 +600,21 @@
 										url: "/pages/public/selectIdentity/selectIdentity",
 										url: "/pages/public/selectIdentity/selectIdentity",
 									});
 									});
 								} else {
 								} else {
-									if (res.user.userType == 2) {
-										// 这里判断一下看是否是第一次登录如果是就跳到引导页,如果不是就正常跳
-										let firstLogin = uni.getStorageSync("firstLogin") || false;
-										if (!firstLogin) {
-											uni.navigateTo({
-												url: "/pages/my/jobApplicant/guidePage",
-											});
-										} else {
-											uni.reLaunch({
-												url: "/pages/my/index",
-											});
-										}
-									} else {
-										// 这里判断一下看是否是第一次登录如果是就跳到引导页,如果不是就正常跳
-										let firstLogin = uni.getStorageSync("firstLogin") || false;
-										if (!firstLogin) {
-											uni.navigateTo({
-												url: "/pages/my/jobApplicant/guidePage",
-											});
-										} else {
-											uni.reLaunch({
-												url: "/pages/my/index",
-											});
-										}
-									}
+									uni.navigateBack();
 								}
 								}
 							} else {
 							} else {
-								if (res.user.userType == 2) {
-									// 这里判断一下看是否是第一次登录如果是就跳到引导页,如果不是就正常跳
-									let firstLogin = uni.getStorageSync("firstLogin") || false;
-									if (!firstLogin) {
-										uni.navigateTo({
-											url: "/pages/my/jobApplicant/guidePage",
-										});
-									} else {
-										uni.reLaunch({
-											url: "/pages/my/index",
-										});
-									}
-								} else {
-									// 这里判断一下看是否是第一次登录如果是就跳到引导页,如果不是就正常跳
-									let firstLogin = uni.getStorageSync("firstLogin") || false;
-									if (!firstLogin) {
-										uni.navigateTo({
-											url: "/pages/my/jobApplicant/guidePage",
-										});
-									} else {
-										uni.reLaunch({
-											url: "/pages/my/index",
-										});
-									}
-								}
+								uni.navigateBack();
 							}
 							}
 						});
 						});
 					} else {
 					} else {
-						uni.hideLoading();
-						this.$queue.showToast(res.msg);
+						uni.showModal({
+							showCancel: false,
+							title: "登录失败",
+							content: res.msg,
+						});
 					}
 					}
 				});
 				});
 			},
 			},
-
 			forget() {
 			forget() {
 				uni.navigateTo({
 				uni.navigateTo({
 					url: "/pages/public/pwd",
 					url: "/pages/public/pwd",

+ 4 - 3
pages/public/loginphone.vue

@@ -122,7 +122,6 @@
 			},
 			},
 			toLogin() {
 			toLogin() {
 				this.$queue.loginClear();
 				this.$queue.loginClear();
-				let openid = this.$queue.getData("openid");
 				const {
 				const {
 					phone,
 					phone,
 					password,
 					password,
@@ -144,7 +143,7 @@
 					this.$queue.showLoading("正在登录中...");
 					this.$queue.showLoading("正在登录中...");
 					let params = {
 					let params = {
 						phone: phone,
 						phone: phone,
-						openId: this.$queue.getData("openid"),
+						wxOpenId: this.$queue.getData("openId") || '',
 					}
 					}
 					if (this.type == 1) {
 					if (this.type == 1) {
 						params = {
 						params = {
@@ -238,7 +237,6 @@
 												url: "/pages/my/jobApplicant/guidePage",
 												url: "/pages/my/jobApplicant/guidePage",
 											});
 											});
 										}
 										}
-
 									}
 									}
 								});
 								});
 
 
@@ -249,6 +247,9 @@
 								uni.hideLoading();
 								uni.hideLoading();
 								this.$queue.showToast(res.msg);
 								this.$queue.showToast(res.msg);
 							}
 							}
+						}).catch((err) => {
+							uni.hideLoading();
+							console.error("微信登录接口异常:", err);
 						});
 						});
 				}
 				}
 			},
 			},

+ 2 - 2
pages/public/register.vue

@@ -314,7 +314,7 @@ export default {
             userName: phone,
             userName: phone,
             password: password,
             password: password,
             phone: phone,
             phone: phone,
-            openId: this.$queue.getData("openid") ? this.$queue.getData("openid") : "",
+            wxOpenId: this.$queue.getData("openId") ? this.$queue.getData("openId") : "",
             // invitation: this.invitation,
             // invitation: this.invitation,
             platform: this.platform,
             platform: this.platform,
             msg: code,
             msg: code,
@@ -364,7 +364,7 @@ export default {
    //          userName: userName,
    //          userName: userName,
    //          password: password,
    //          password: password,
    //          phone: phone,
    //          phone: phone,
-   //          openId: this.$queue.getData("openid") ? this.$queue.getData("openid") : "",
+   //          openId: this.$queue.getData("openId") ? this.$queue.getData("openId") : "",
    //          invitation: this.invitation,
    //          invitation: this.invitation,
    //          platform: this.platform,
    //          platform: this.platform,
    //        })
    //        })

+ 6 - 0
static/images/jobApplicant/shezhi.svg

@@ -0,0 +1,6 @@
+<svg viewBox="0 0 16.1611 16.1611" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.161133" height="16.161133" fill="none" customFrame="#000000">
+	<g id="Group">
+		<path id="Vector" d="M6.08073 3.41406L3.41406 3.41406L3.41406 6.08073L1.41406 8.08073L3.41406 10.0807L3.41406 12.7474L6.08073 12.7474L8.08073 14.7474L10.0807 12.7474L12.7474 12.7474L12.7474 10.0807L14.7474 8.08073L12.7474 6.08073L12.7474 3.41406L10.0807 3.41406L8.08073 1.41406L6.08073 3.41406Z" fill-rule="nonzero" stroke="rgb(255,255,255)" stroke-width="2" />
+		<path id="Vector" d="M8.08105 10.0811C6.97649 10.0811 6.08105 9.18562 6.08105 8.08105C6.08105 6.97649 6.97649 6.08105 8.08105 6.08105C9.18562 6.08105 10.0811 6.97649 10.0811 8.08105C10.0811 9.18562 9.18562 10.0811 8.08105 10.0811Z" stroke="rgb(255,255,255)" stroke-width="2" />
+	</g>
+</svg>