免登录

This commit is contained in:
2024-10-09 10:38:59 +08:00
parent 14070f5402
commit 6bd1235e97
5 changed files with 1629 additions and 135 deletions

View File

@@ -153,7 +153,15 @@
<button @click="onSubmit" class="active" v-if="btnShow"> </button>
<button v-else> </button>
</view>
<view class="loginHelp" v-if="submitClickNum > 0">
<!-- <view class="loginHelp"> -->
<text>登录遇到问题</text
><text
class="link"
@click="onPageJump('/pages/homePage/index/workOrder', 'login')"
>去反馈问题</text
>
</view>
<!-- <view class="third_party_login_box">
<view class="third_party_title"><text>第三方登录</text></view>
<view class="third_party_content">
@@ -178,6 +186,9 @@
>
</view>
</view>
<view class="youKeL" style="margin-bottom: 40rpx" v-if="isAndorid">
<view @click="onPageJump('/pages/user/visitor')">免登陆体验</view>
</view>
<!-- <view class="youKeL" style="margin-bottom: 80rpx">
<view
@@ -249,16 +260,8 @@
@close="yhxyShow = false"
>
<view class="tanchu">
<view
class="dp_title"
v-html="yhxyText.title
"
></view>
<view
class="dp_content"
v-html="yhxyText.content
"
></view>
<view class="dp_title" v-html="yhxyText.title"></view>
<view class="dp_content" v-html="yhxyText.content"></view>
<!-- <yhxyPage></yhxyPage> -->
</view>
</u-popup>
@@ -269,17 +272,9 @@
:round="10"
@close="yszcShow = false"
>
<view class="tanchu" >
<view
class="dp_title"
v-html="yszcText.title
"
></view>
<view
class="dp_content"
v-html="yszcText.content
"
></view>
<view class="tanchu">
<view class="dp_title" v-html="yszcText.title"></view>
<view class="dp_content" v-html="yszcText.content"></view>
<!-- <yszcPage></yszcPage> -->
</view>
</u-popup>
@@ -352,6 +347,8 @@ export default {
sendEmailcode: "common/user/getMailCaptcha", //密码登录
apiLogin: "app/phone.do?loginV2",
},
isAndorid: true,
submitClickNum:0, // 登陆按钮点击次数
};
},
@@ -378,7 +375,7 @@ export default {
this.brand = 3000;
this.loginForm = {};
this.getOS();
// #endif
},
created() {
@@ -387,8 +384,8 @@ export default {
//页面显示
onShow() {
console.log("at line 362:", uni.getStorageSync("userInfo"));
this.getSettlement(101,'yszcText');
this.getSettlement(100,'yhxyText');
this.getSettlement(101, "yszcText");
this.getSettlement(100, "yhxyText");
//this.closeMusic()
},
onReady() {
@@ -407,7 +404,16 @@ export default {
methods: {
...mapMutations(["setUserInfo"]),
...mapMutations(["setHealthMes"]),
getOS() {
let oprateOs = "";
oprateOs = uni.getSystemInfoSync().platform;
// console.log(oprateOs)
if (oprateOs == "android") {
this.isAndorid = true;
} else {
this.isAndorid = false;
}
},
changeType(val) {
this.loginForm = {};
this.type = 2000;
@@ -469,26 +475,22 @@ export default {
});
},
// 获取协议内容
async getSettlement(id,type) {
//隐私策略
async getSettlement(id, type) {
//隐私策略
var data = await this.$commonJS.getAgreement(id);
if (data.content) {
data.content = data.content.replace(
/<h5>/g,
'<view style="font-weight: bold;font-size: 32rpx;margin-top: 20rpx;margin-bottom: 20rpx;">'
);
data.content = data.content.replace(
/<\/h5>/g,
"</view>"
);
data.content = data.content.replace(/<\/h5>/g, "</view>");
}
if (type == "yszcText") {
this.yszcText = data;
}
if (type == "yhxyText") {
this.yhxyText = data;
}
if(type=='yszcText'){
this.yszcText=data
}
if(type=='yhxyText'){
this.yhxyText=data
}
//用户协议
// this.yhxyText = await this.$commonJS.getAgreement(108);
@@ -515,11 +517,12 @@ this.yhxyText=data
});
},
onPageJump(url) {
uni.navigateTo({
url: url,
});
},
onPageJump(url,name) {
console.log('点击了');
uni.navigateTo({
url: `${url}?name=${name}`
});
},
onInput() {
// this.clearTime && clearTimeout(this.clearTime)
// this.clearTime = setTimeout(() => {
@@ -580,6 +583,7 @@ this.yhxyText=data
if (this.loginForm.quCode == null || this.loginForm.quCode == 86) {
// 如果没选择国家code默认是中国大陆
if (!this.$base.phoneRegular.test(this.loginForm.phone)) {
this.submitClickNum += 1
uni.showToast({
title: "手机格式不正确",
icon: "none",
@@ -677,6 +681,7 @@ this.yhxyText=data
}
if (this.loginForm.quCode == null || this.loginForm.quCode == 86) {
if (!this.$base.phoneRegular.test(this.loginForm.phone)) {
this.submitClickNum += 1
this.$commonJS.showToast("手机格式不正确");
return;
@@ -706,10 +711,13 @@ this.yhxyText=data
await this.$http
.get(this.urlList.registerOrLogin, httpData)
.then(async (res) => {
this.submitClickNum = 0
res.userInfo.token = res.token.token;
await this.setUserInfo(res.userInfo);
console.log("res.userInfo哈哈红红火火恍恍惚惚 at line 593:", res.token);
console.log(
"res.userInfo哈哈红红火火恍恍惚惚 at line 593:",
res.token
);
uni.setStorageSync("token", res.token.token);
// socket.init();
uni.showToast({
@@ -717,7 +725,7 @@ this.yhxyText=data
});
setTimeout(() => {
uni.setStorageSync('isJump', 'false')
uni.setStorageSync("isJump", "false");
uni.switchTab({
url: "/pages/homePage/index/index",
success: function () {
@@ -727,7 +735,13 @@ this.yhxyText=data
},
});
}, 100);
});
}).catch(e => {
uni.showToast({
title:'登陆失败',
icon:'none'
})
this.submitClickNum += 1
});
} else {
if (!this.loginForm.phoneEmail) {
uni.showToast({
@@ -749,6 +763,7 @@ this.yhxyText=data
await this.$http
.post(this.urlList.passwordLogin, httpData)
.then(async (res) => {
this.submitClickNum = 0
console.log("res.userInfo at line 593:", res.token);
res.userInfo.token = res.token.token;
await this.setUserInfo(res.userInfo);
@@ -767,7 +782,13 @@ this.yhxyText=data
},
});
}, 500);
});
}).catch(e => {
uni.showToast({
title:'登陆失败',
icon:'none'
})
this.submitClickNum += 1
});
}
},
@@ -1432,5 +1453,8 @@ this.yhxyText=data
border-radius: 10rpx;
padding: 5rpx 15rpx;
}
}
}.loginHelp{border: 1px solid #f5dab1; margin-top: 16rpx; font-size: 26rpx; text-align: center;
padding: 10rpx; background-color: #fdf6ec; border-radius: 15rpx;
.link{color: #e6a23c;}
}
</style>

1450
pages/user/visitor.vue Normal file

File diff suppressed because it is too large Load Diff