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 @@ ...@@ -26,7 +26,7 @@
</view> </view>
<view class="login-bottom"> <view class="login-bottom">
<view class="login-bottom-text" @click="back">返回</view> <view class="login-bottom-text" @click="back">返回</view>
<view class="login-bottom-text">忘记密码</view> <!-- <view class="login-bottom-text">忘记密码</view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -65,15 +65,12 @@ ...@@ -65,15 +65,12 @@
let msg = reactive({ let msg = reactive({
Account: "", Account: "",
Password: "", Password: "",
// openId:"",
// uniunId:"",
}); });
let data = reactive({ let data = reactive({
phoneNum: "", phoneNum: "",
openid: "", openid: "",
code: "", code: "",
show: false, show: false,
showVisitor:false,
}); });
let methods = { let methods = {
...@@ -94,8 +91,6 @@ ...@@ -94,8 +91,6 @@
}); });
clearTimeout(); clearTimeout();
}, },
async login() { async login() {
if (msg.Account == "" || !msg.Account) { if (msg.Account == "" || !msg.Account) {
Toast.fail("请输入账号"); Toast.fail("请输入账号");
...@@ -119,102 +114,6 @@ ...@@ -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(() => {}); onMounted(() => {});
let that = methods; let that = methods;
...@@ -225,8 +124,7 @@ ...@@ -225,8 +124,7 @@
}; };
}, },
onLoad() { onLoad() {
//审核用
this.showVisitor=new Date().getTime()> new Date('2022-03-16').getTime()
} }
}; };
</script> </script>
...@@ -234,7 +132,6 @@ ...@@ -234,7 +132,6 @@
<style scoped> <style scoped>
.login-Welcome-title{ .login-Welcome-title{
font-size: 50rpx; font-size: 50rpx;
font-family: PingFang SC;
color: #FFFFFF; color: #FFFFFF;
margin-bottom: 33rpx; margin-bottom: 33rpx;
font-weight: 300; font-weight: 300;
...@@ -259,8 +156,9 @@ ...@@ -259,8 +156,9 @@
top: -261rpx; top: -261rpx;
} }
.login-bottom .login-bottom-text:first-child{ .login-bottom .login-bottom-text:first-child{
border-right: 1rpx solid #E1E1E1; /* border-right: 1rpx solid #E1E1E1;
padding: 0 110rpx 0 0; padding: 0 110rpx 0 0; */
padding: 0 110rpx;
} }
.login-bottom-text{ .login-bottom-text{
padding: 0 0 0 110rpx; padding: 0 0 0 110rpx;
...@@ -322,7 +220,6 @@ ...@@ -322,7 +220,6 @@
margin-bottom: 110rpx; margin-bottom: 110rpx;
background-color: #C91727; background-color: #C91727;
font-size: 30rpx; font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
text-align: center; text-align: center;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="login-background"></view> <view class="login-background"></view>
<view class="login-content"> <view class="login-content">
<view class="login-image"> <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" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653448851000_616.png" />
</view> </view>
<view class="btnBox" @click="login"> <view class="btnBox" @click="login">
...@@ -84,7 +84,6 @@ ...@@ -84,7 +84,6 @@
margin-bottom: 53rpx; margin-bottom: 53rpx;
background-color: #C91727; background-color: #C91727;
font-size: 30rpx; font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
text-align: center; 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