You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Sports/pages/login/index.vue

182 lines
3.6 KiB

<template>
<view class="login">
<image src="@/static/bg (4).png" class="logimg"></image>
<view class="custom-navigation-bar">
<view class="left-button" @click="handleBack">
<uni-icons type="left" color="#fff" size="30"></uni-icons>
</view>
<view class="title">
{{ title }}
</view>
</view>
<view class="logtext">弹射者|震东风华田径巡回赛</view>
<view class="btn" @click="toLogin">点击授权登录</view>
<view class="btn1" @click="toLogin">返回</view>
</view>
</template>
<script>
export default {
data() {
return {
title:'授权登录',
isClick: false,
Username: "",
Password: "",
Type: 1
};
},
onLoad() {
if (uni.getStorageSync("loginInfo")) {
this.isClick = true;
console.log(uni.getStorageSync("loginInfo"))
this.Username = uni.getStorageSync("loginInfo").Username;
this.Password = uni.getStorageSync("loginInfo").Password;
this.Type = uni.getStorageSync("loginInfo").Type;
} else {
this.isClick = false;
}
},
methods: {
handleBack(){},
toToggle() {
this.isClick = !this.isClick;
},
toLogin() {
console.log(1233);
uni.switchTab({
url: "/pages/index/index"
})
// if (!this.Username) {
// uni.showToast({
// title: "用户名不能为空!",
// icon: "none"
// })
// return;
// }
// if (!this.Password) {
// uni.showToast({
// title: "密码不能为空!",
// icon: "none"
// })
// return;
// }
// const {
// errorcode,
// data,
// message
// } = await this.$api.api_login({
// Username: this.Username,
// Password: this.Password,
// Type: this.Type,
// });
// if (errorcode == 200) {
// if (this.isClick) {
// uni.setStorageSync("loginInfo", {
// Username: this.Username,
// Password: this.Password,
// Type: this.Type,
// })
// }
// uni.setStorageSync("userInfo", data)
// uni.showToast({
// title: "登录成功"
// })
// setTimeout(() => {
// uni.reLaunch({
// url: "/pages/index/index"
// })
// }, 2000)
// } else {
// uni.showToast({
// title: message,
// icon: "none",
// })
// }
},
openPage(index) {
if (index == 1) {
uni.navigateTo({
url: "/pages/login/register"
})
} else if (index == 2) {
uni.navigateTo({
url: "/pages/login/forget"
})
}
},
tabItem(index) {
this.Type = index
}
}
}
</script>
<style lang="scss" scoped>
.custom-navigation-bar {
display: flex;
align-items: center;
justify-content: space-between;
height: 220rpx;
/* #ifdef MP-WEIXIN */
margin-top: -230rpx;
/* #endif */
position: absolute;
top: 264rpx;
}
.left-button,
.right-button {
padding: 0 12px;
}
.title {
flex: 1;
// text-align: center;
color: #fff;
font-size: 18px;
font-weight: bold;
}
.login {
min-height: 100vh;
background-color: #dcdcdc;
.logimg{
width: 100%;
height: 99vh;
}
.logtext{
position: absolute;
top: 30%;
left: 10%;
font-family: DFZongYiGB Std;
font-weight: normal;
font-size: 48rpx;
color: #FFFFFF;
}
.btn{
text-align: center;
width: 660rpx;
height: 98rpx;
background: #FFFFFF;
border-radius: 49rpx;
position: absolute;
bottom: 20%;
left: 6%;
line-height: 98rpx;
}
.btn1{
text-align: center;
width: 661rpx;
height: 99rpx;
background: rgba(255,255,255,0);
border-radius: 49rpx;
border: 1px solid #FFFFFF;
position: absolute;
bottom: 10%;
left: 6%;
line-height: 98rpx;
color: #fff;
}
}
</style>