This commit is contained in:
liuyuan
2025-06-10 17:52:06 +08:00
parent 3b86ad9ed8
commit a26581fd81
96 changed files with 11316 additions and 367 deletions

View File

@@ -73,8 +73,7 @@
<span class="highlight" @click="yszcShow = true">隐私协议</span>
</view>
<view class="btn_box">
<button @click="onSubmit" v-if="btnShow"> </button>
<button v-else> </button>
<button @click="onSubmit"> </button>
</view>
<view class="loginHelp" v-if="submitClickNum > 0">
<text>登录遇到问题</text><text class="link"
@@ -129,10 +128,8 @@ export default {
codeText: "获取验证码",
//验证码已发
readonly: false,
btnShow: true,
agree: false,
isIos: true,
isWeixin: true,
system: 13,
clearTime: null,
HealthOpen: false,
@@ -168,10 +165,6 @@ export default {
this.isIos = plus.os.name == "iOS";
let systemInfo = uni.getSystemInfoSync();
this.system = parseFloat(systemInfo["system"].replace(/[a-zA-Z]/g, ""));
this.isWeixin = plus.runtime.isApplicationExist({
pname: "com.tencent.mm",
action: "weixin://",
});
this.type = 2000;
this.brand = 3000;
@@ -205,19 +198,6 @@ export default {
this.loginForm.quCode = this.quCodeList[0].value;
this.brand = val;
},
closeMusic() {
this.$music.setCloseBgm(); // 关闭音频
uni.setStorage({
key: "playVisible",
data: false,
success: function() {
console.log("success");
},
});
this.setUserInfo({
playVisible: false,
});
},
// 获取国家区域编码
getCountyCode() {
this.$http
@@ -270,13 +250,6 @@ export default {
quChange(e) {
console.log(e, "e");
},
// 修改密码
resetPassWord() {
uni.navigateTo({
url: "",
});
},
onPageJump(url, name) {
if(name){
uni.navigateTo({
@@ -380,24 +353,6 @@ export default {
});
}
},
loginAPP() {
this.$http.post(this.urlList.apiLogin, this.appForm).then((res) => {
this.$store.commit("setUserInfo", res.obj);
uni.setStorageSync("token", res.obj.token);
uni.setStorageSync("customerOid", res.obj.customerOid);
this.setUserInfo(res.obj);
uni.showToast({
title: "登录成功",
duration: 1000,
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/home/index",
});
}, 1000);
});
return;
},
// 手机密码登录
async onSubmit() {
if (!this.agree) {
@@ -514,188 +469,7 @@ export default {
});
}
},
// 一路健康APP登录进入
onSubmit_Health() {
if (!this.health_phone) {
this.$commonJS.showToast("请输入一路健康账号");
return;
}
if (!this.health_password) {
this.$commonJS.showToast("请输入密码");
return;
}
let healthData = {};
healthData.phone = this.health_phone;
healthData.password = this.health_password;
this.$http.post("book/user/getEverhealthInfo", healthData).then((res) => {
this.setHealthMes(res.everhealthInfo);
if (res.userInfo) {
res.userInfo.token = res.token.token;
this.setUserInfo(res.userInfo);
uni.showToast({
title: "登录成功",
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/home/index"
});
}, 500);
} else {
setTimeout(() => {
uni.navigateTo({
url: "",
});
}, 600);
uni.showToast({
title: "账号验证成功",
duration: 600,
});
}
});
},
// 一路健康APP登录
onHealthLogin() {
if (!this.agree) {
this.$commonJS.showToast("请先同意《用户协议》和《隐私协议》");
return;
}
this.HealthOpen = true;
},
// 微信APP登录
onWxAppLogin() {
uni.login({
provider: "weixin",
success: (res) => {
uni.getUserInfo({
success: (info) => {
this.userInfo = info.userInfo;
if (res.authResult.openid && res.authResult.unionid) {
this.$http
.post("api/open/v1/login", {
wxAppOpenId: res.authResult.openid,
unionid: res.authResult.unionid,
nickname: this.userInfo.nickName,
headImg: this.userInfo.avatarUrl,
})
.then((data) => {
this.setUserInfo({
openId: res.authResult.openid,
unionid: res.authResult.unionid,
...data,
});
if (data.thirdLoginSuccess) {
socket.init();
uni.showToast({
title: "登录成功",
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/home/index"
});
}, 500);
} else {
uni.showModal({
title: "提示",
content: "您还未绑定手机号,请先绑定~",
confirmText: "去绑定",
cancelText: "再逛会",
success: (res) => {
if (res.confirm) {
uni.redirectTo({
url: "",
});
}
},
});
}
});
} else {
uni.showToast({
title: "点击无效,请再次点击",
icon: "none",
});
}
},
fail: () => {
console.log("未授权");
},
});
},
fail(err) {
console.log(err);
},
});
},
// 苹果登录
onAppleLogin() {
uni.login({
provider: "apple",
success: (loginRes) => {
uni.getUserInfo({
provider: "apple",
success: (userInfoRes) => {
if (userInfoRes.userInfo.identityToken) {
this.$http
.post("api/open/v1/ios_login", {
identityToken: userInfoRes.userInfo.identityToken,
})
.then((data) => {
this.setUserInfo(data);
if (data.thirdLoginSuccess) {
socket.init();
uni.showToast({
title: "登录成功",
duration: 2000,
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/home/index"
});
}, 500);
} else {
uni.showModal({
title: "提示",
content: "您还未绑定手机号,请先绑定~",
confirmText: "去绑定",
cancelText: "再逛会",
success: (res) => {
if (res.confirm) {
uni.redirectTo({
url: "",
});
}
},
});
}
});
}
},
});
},
fail: (err) => {
uni.showToast({
title: "登录失败",
icon: "none",
});
},
});
},
},
//页面隐藏
onHide() {},
//页面卸载
onUnload() {},
//页面下来刷新
onPullDownRefresh() {},
//页面上拉触底
onReachBottom() {},
};
</script>
<style lang="scss" scoped>