Commit b2047a44 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/youjie/thinkapp

# Conflicts:
#	src/pages/index/index.vue
parents efceaef5 1cfb0f4f
This diff is collapsed.
......@@ -26,7 +26,7 @@
</view>
<view class="login-bottom">
<view class="login-bottom-text" @click="back">返回</view>
<view class="login-bottom-text">忘记密码</view>
<!-- <view class="login-bottom-text">忘记密码</view> -->
</view>
</view>
</view>
......@@ -65,15 +65,12 @@
let msg = reactive({
Account: "",
Password: "",
// openId:"",
// uniunId:"",
});
let data = reactive({
phoneNum: "",
openid: "",
code: "",
show: false,
showVisitor:false,
});
let methods = {
......@@ -94,8 +91,6 @@
});
clearTimeout();
},
async login() {
if (msg.Account == "" || !msg.Account) {
Toast.fail("请输入账号");
......@@ -119,102 +114,6 @@
}
})
},
login2() {
uni.login({
provider: 'weixin',
success: async (loginRes) => {
let code = loginRes.code
data.code = code
}
});
},
//获取手机号
getphonenumber(e) {
if (e.detail.encryptedData && e.detail.iv) {
let encryptedData = e.detail.encryptedData;
let iv = e.detail.iv;
that.parsePhoneNum(encryptedData, iv, data.code)
} else {
Toast.fail("授权失败,请重新授权")
}
},
//解密手机号
async parsePhoneNum(encryptedData, iv, code) {
let res = await parsePhone({
encryptedData,
iv,
code
})
if (res && res.Data.phoneNumber) {
data.phoneNum = res.Data.phoneNumber
data.openid = res.Data.openid
that.phoneNumLogin()
} else {
Toast.fail("授权失败,请重新授权")
}
},
//手机号授权登录
async phoneNumLogin() {
let res = await phoneLogin({
Account: data.phoneNum,
OpenId: data.openid
})
if (res) {
res.Data.Account = data.phoneNum;
uni.setStorageSync("userInfo", res.Data);
Toast.success("登录成功");
setTimeout(() => {
let data = uni.getStorageSync("userInfo");
if (data) {
that.jumpPage();
}
}, 1000);
}
},
async login3() { //游客登录
data.show = false
let temporarydh = uni.getStorageSync("temporarydh")
if (temporarydh) {
let msg = {
Account: temporarydh.Account,
OpenId: temporarydh.OpenId,
unionid: temporarydh.unionid,
WeChatName: temporarydh.WeChatName,
WeChatPhoto: temporarydh.WeChatPhoto,
IsVisitor: 1,
}
let res = await phoneLogin(msg)
if (res) {
res.Data.Account = data.phoneNum;
uni.setStorageSync("userInfo", res.Data);
Toast.success("登录成功");
setTimeout(() => {
let data = uni.getStorageSync("userInfo");
if (data) {
that.jumpPage();
}
}, 1000);
}
} else {
uni.showToast({
icon: "none",
title:"未授权电话,请先点击授权按钮",
duration:2000,
})
// setTimeout(()=>{
// uni.reLaunch({
// url: '/pages/index/index' //没有授权登录
// });
// },1500)
}
},
againdata() {
uni.reLaunch({
url: '/pages/index/index'
});
},
};
onMounted(() => {});
let that = methods;
......@@ -225,8 +124,7 @@
};
},
onLoad() {
//审核用
this.showVisitor=new Date().getTime()> new Date('2022-03-16').getTime()
}
};
</script>
......@@ -234,7 +132,6 @@
<style scoped>
.login-Welcome-title{
font-size: 50rpx;
font-family: PingFang SC;
color: #FFFFFF;
margin-bottom: 33rpx;
font-weight: 300;
......@@ -259,8 +156,9 @@
top: -261rpx;
}
.login-bottom .login-bottom-text:first-child{
border-right: 1rpx solid #E1E1E1;
padding: 0 110rpx 0 0;
/* border-right: 1rpx solid #E1E1E1;
padding: 0 110rpx 0 0; */
padding: 0 110rpx;
}
.login-bottom-text{
padding: 0 0 0 110rpx;
......@@ -322,7 +220,6 @@
margin-bottom: 110rpx;
background-color: #C91727;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
text-align: center;
......
......@@ -3,7 +3,7 @@
<view class="login-background"></view>
<view class="login-content">
<view class="login-image">
<van-image width="398rpx" height="398rpx" fit="cover" class="yuqi"
<van-image width="398rpx" height="398rpx" fit="cover"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653448851000_616.png" />
</view>
<view class="btnBox" @click="login">
......@@ -84,7 +84,6 @@
margin-bottom: 53rpx;
background-color: #C91727;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
text-align: center;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment