224 lines
4.6 KiB
Vue
224 lines
4.6 KiB
Vue
<template>
|
||
<view class="page">
|
||
<view class="title">
|
||
<image src="/static/image/hesu.png" mode=""></image>
|
||
</view>
|
||
|
||
<view class="form">
|
||
<view class="inputs_button">
|
||
<view class="inputs">
|
||
<view class="account">
|
||
<input type="text" v-model="email" placeholder="账号" />
|
||
</view>
|
||
<view class="password">
|
||
<u--input
|
||
type="password"
|
||
placeholder="密码"
|
||
v-model="password"
|
||
border="none"
|
||
></u--input>
|
||
</view>
|
||
</view>
|
||
<view class="forgot-password">
|
||
<text @click="forgotPassword">忘记密码?</text>
|
||
</view>
|
||
<view class="button">
|
||
<view @click="login">
|
||
登录
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="three">
|
||
<u-divider text="第三方登录" style="padding: 0px 40px;"></u-divider>
|
||
<u-grid :border="false" @click="click" align="center">
|
||
<u-grid-item>
|
||
<image src="/static/image/login/fenshu.png" mode=""></image>
|
||
<text class="grid-text">飞书</text>
|
||
</u-grid-item>
|
||
<u-grid-item>
|
||
<image src="/static/image/login/emali.png" mode=""></image>
|
||
<text class="grid-text">邮箱</text>
|
||
</u-grid-item>
|
||
<u-grid-item>
|
||
<image src="/static/image/login/phone.png" mode=""></image>
|
||
<text class="grid-text">手机</text>
|
||
</u-grid-item>
|
||
</u-grid>
|
||
</view>
|
||
<view class="pact">
|
||
<radio :checked="pactChecked" activeBackgroundColor="#3264ed" activeBorderColor="#3264ed"
|
||
borderColor="#3264ed" color="#fff" @click="pactChange" />
|
||
<view>我已经阅读并同意<text @click="toPact">《用户协议》</text>和<text @click="toPact">《隐私协议》</text></view>
|
||
</view>
|
||
</view>
|
||
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import { request,showToast } from '@/api/apiT.js'
|
||
export default {
|
||
data() {
|
||
return {
|
||
email: "1696136552@qq.com",
|
||
password: "123456",
|
||
pactChecked: false,
|
||
}
|
||
},
|
||
onLoad() {
|
||
|
||
},
|
||
methods: {
|
||
pactChange() {
|
||
this.pactChecked = !this.pactChecked
|
||
},
|
||
login() {
|
||
if(this.email==''){
|
||
uni.showToast({
|
||
title:'邮箱不能为空',
|
||
icon: 'none'
|
||
});
|
||
return false
|
||
}
|
||
if(this.password==''){
|
||
uni.showToast({
|
||
title:'密码不能为空',
|
||
icon: 'none'
|
||
});
|
||
return false
|
||
}
|
||
if(!this.pactChecked){
|
||
uni.showToast({
|
||
title:'请先勾选同意用户服务协议以及隐私政策',
|
||
icon: 'none'
|
||
});
|
||
return false
|
||
}
|
||
request({
|
||
url:'user/login',
|
||
method:'POST',
|
||
data:{
|
||
email: this.email,
|
||
password: this.password,
|
||
}
|
||
}).then(res => {
|
||
console.log(res.data.data)
|
||
if (res.data.code == -1) {
|
||
uni.showToast({
|
||
title: res.data.msg,
|
||
icon: 'none'
|
||
});token
|
||
|
||
} else if (res.data.code == 0) {
|
||
//存取session
|
||
uni.setStorageSync('token', res.data.data.token);
|
||
//返回数据接收成功
|
||
uni.reLaunch({
|
||
url: '/pages/index/index',// 替换为你要跳转的页面路径
|
||
});
|
||
}
|
||
})
|
||
},
|
||
toPact() {
|
||
uni.showToast({
|
||
title: "协议",
|
||
icon: 'none'
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.page {
|
||
min-height: 100vh;
|
||
background-image: url("../../static/image/login/loginbg.png");
|
||
background-size: 100%;
|
||
background-repeat: no-repeat;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-between;
|
||
|
||
.title {
|
||
padding-top: 220rpx;
|
||
text-align: center;
|
||
image{
|
||
width: 160px;
|
||
height: 37px;
|
||
}
|
||
}
|
||
|
||
.form {
|
||
flex: 1;
|
||
margin: 0 76rpx;
|
||
overflow: hidden;
|
||
|
||
.inputs_button {
|
||
.inputs {
|
||
padding: 150rpx 0px 0;
|
||
margin-bottom: 20rpx;
|
||
.account,
|
||
.password{
|
||
height: 80rpx;
|
||
border-radius: 50px;
|
||
padding: 0 48rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
background-color: #F6F6F6;
|
||
|
||
input {
|
||
flex: 1;
|
||
}
|
||
}
|
||
|
||
.account {
|
||
margin-bottom: 48rpx;
|
||
}
|
||
}
|
||
|
||
.button {
|
||
padding: 0 32rpx;
|
||
|
||
view {
|
||
line-height: 80rpx;
|
||
border-radius: 50px;
|
||
text-align: center;
|
||
font-size: 32rpx;
|
||
background: linear-gradient(to right, #3471FF, #6776FF);
|
||
color: #fff;
|
||
}
|
||
}
|
||
}
|
||
.three{
|
||
margin: 40rpx 0px;
|
||
padding: 20rpx 40rpx;
|
||
image{
|
||
width: 100rpx;
|
||
height: 100rpx;
|
||
}
|
||
}
|
||
}
|
||
.forgot-password {
|
||
text-align: right;
|
||
margin-bottom: 20px;
|
||
}
|
||
.pact {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 24rpx;
|
||
|
||
text {
|
||
color: #3264ed;
|
||
}
|
||
|
||
radio {
|
||
:deep(.uni-radio-input) {
|
||
border: 1rpx solid #3264ed;
|
||
}
|
||
|
||
transform:scale(0.6)
|
||
}
|
||
}
|
||
}
|
||
</style> |