demingshangjia/pages/login/login.vue

354 lines
6.3 KiB
Vue
Raw Normal View History

2020-06-12 17:42:23 +08:00
<template>
<!-- login页面 -->
<view>
<view class="login">
2020-06-15 09:02:17 +08:00
<image class="images" src=""></image>
2020-06-12 17:42:23 +08:00
<view class="backes"></view>
<view class="content">
<view class="title_top">德铭阳光在线-商家端</view>
<view class="title">账号登录</view>
<view class="labales">
2020-06-15 09:02:17 +08:00
<image src=""></image>
2020-07-16 11:20:59 +08:00
<input v-model="zhanghao" type="tel" placeholder="请输入账号" />
2020-06-12 17:42:23 +08:00
</view>
<view class="labales">
2020-06-15 09:02:17 +08:00
<image src=""></image>
2020-07-16 11:20:59 +08:00
<input v-model="mima" type="password" placeholder="请输入密码" />
2020-06-12 17:42:23 +08:00
</view>
</view>
<!-- denglu QQ weixin -->
2020-07-16 11:20:59 +08:00
<u-button @click="logins">{{login}}</u-button>
<u-toast ref="uToast" />
2020-06-12 17:42:23 +08:00
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [{
checked: false,
disabled: false
}],
value: '',
login: '登录',
show: false,
2020-07-16 11:20:59 +08:00
zhanghao:"",
mima:""
2020-06-12 17:42:23 +08:00
};
},
methods: {
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
//console.log(e);
},
// 选中任一checkbox时由checkbox-group触发
checkboxGroupChange(e) {
// console.log(e);
},
mask_u(){
this.show = !this.show
},
// 获取验证码倒计时
getCode(){
console.log("11")
this.loading()
},
loading(){
2020-07-16 11:20:59 +08:00
},
logins(){
this.$u.api.login({member_name:this.zhanghao,member_password:this.mima}).then((res)=>{
console.log(res)
if(res.errCode != 0){
this.$refs.uToast.show({
title: res.message,
type: 'error'
})
}else{
uni.setStorageSync("token",res.data.token)
uni.setStorageSync("userinfo",res.data)
this.$u.route({
url:"/pages/index/index",
type:"switchTab"
})
}
})
}
},
onLoad(){
let token = uni.getStorageSync('token');
if(token != undefined && token){
this.$u.route({
url:"/pages/index/index"
})
2020-06-12 17:42:23 +08:00
}
}
};
</script>
<style lang="scss" scoped>
.login {
// background: url(../../static/pageA/loginbackground.png) no-repeat!important;
.images {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: -1;
}
.backes {
background: rgba(0, 0, 0, 0.4);
position: fixed;
width: 100%;
height: 100%;
z-index: -1;
}
text {
z-index: 9;
color: #fff;
}
.more_Login {
overflow: hidden;
zoom: 1;
width: 630rpx;
margin: 0 auto;
}
.more_Login text {
display: inline-block;
width: 50%;
float: left;
font-size: 30rpx;
color: rgba(255, 255, 255, 1);
line-height: 36px;
margin: 97rpx 0;
}
.more_Login .other {
text-align: right;
}
}
.title {
font-size: 36rpx;
font-weight: bold;
margin-bottom: 150rpx;
color: #fff;
letter-spacing: 3rpx;
}
.content {
width: 630rpx;
z-index: 99999;
margin: 0 auto;
padding-top: 300rpx;
.labales text {
font-size: 30rpx;
}
.labales {
border-bottom: 1px #fff solid;
margin-bottom: 180rpx;
height: 70rpx;
line-height: 70rpx;
position: relative;
input{
width: 80%;
margin-left: 60rpx;
color: #fff;
letter-spacing: 2rpx;
background-color: none;
}
}
.labales image{
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 39rpx;
height: 40rpx;
}
.labales:nth-child(3) {
position: relative;
margin-bottom: 60rpx;
}
.identifying {
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto;
font-size: 30rpx;
font-weight: 500;
color: rgba(255, 120, 15, 1);
line-height: 20px;
}
}
.uni-input-input, .uni-input-placeholder{
color:#fff!important;
letter-spacing: 2rpx;
}
.pact text {
font-size: 22rpx;
font-weight: 400;
color: rgba(255, 255, 255, 1);
line-height: 36px;
}
.pact_text {
font-size: 22px;
font-weight: 400;
color: rgba(129, 188, 253, 1) !important;
line-height: 36px;
}
//单选框的样式
.pact {
position: relative;
padding-left: 40rpx;
overflow:hidden; //超出的文本隐藏
text-overflow:ellipsis; //溢出用省略号显示
white-space:nowrap; //溢出不换行
}
.u-checkbox-group {
position: absolute;
left: 0;
top: 0;
bottom: 0;
margin: auto;
}
.u-checkbox__icon--square {
border-radius: 50rpx !important;
width: 22rpx;
height: 22rpx;
}
.u-btn {
width: 628rpx;
height: 98rpx;
background: rgba(255, 120, 15, 1) !important;
border-radius: 49rpx;
margin: 0 auto;
font-size: 36rpx;
color: rgba(255, 255, 255, 1) !important;
line-height: 36px;
border: 1px #ff780f solid;
outline: none;
border-color: rgba(255, 120, 15, 1) !important;
}
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.rect {
width: 558rpx;
height: 300rpx;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
zoom: 1;
position: relative;
display: flex;
flex-wrap:wrap;
display: -webkit-flex; /* Safari */
.rect_view{
width: 100rpx;
height: 100rpx;
.image{
width: 45rpx;
height: 53rpx;
display: inline-block;
}
flex:1;
margin-top: 77rpx;
}
.rect_view:nth-child(2) image{
width: 57rpx;
height: 45rpx;
}
.rect_butoon{
width: 100%;
position: absolute;
bottom: 0;
height: 85rpx;
text-align: center;
line-height: 85rpx;
border-top: 1px #999999 solid;
}
view{
color: #666;
font-size:24rpx;
margin-top: 30rpx;
}
}
.rect_view:nth-child(1) image,.rect_view:nth-child(1) view{
float: right;
}
.rect_view:nth-child(1) image{
margin-right: 20rpx;
}
.rect_view:nth-child(1){
position: relative;
margin-right: 79rpx;
}
.rect_view:nth-child(1) view{
position: absolute;
bottom: 0;
right: 0;
}
.rect_view:nth-child(2) image,.rect_view:nth-child(2) view{
float: left;
}
.rect_view:nth-child(2) image{
margin-left: 20rpx;
}
.rect_view:nth-child(2){
position: relative;
}
.rect_view:nth-child(2) view{
position: absolute;
bottom: 0;
left: 0;
}
.title_top {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
margin: auto;
font-size:36rpx;
color:rgba(255,255,255,1);
text-align: center;
width: 100%;
/* 如果您想让slot内容占满整个导航栏的宽度 */
/* flex: 1; */
/* 如果您想让slot内容与导航栏左右有空隙 */
/* padding: 0 30rpx; */
background: none;
letter-spacing: 4rpx;
}
</style>