<template>
<view class="loginbox">
<view class="topbox">
<image src="../../static/logo.png" mode="" class="logoimg"></image>
<view class="inputbox flex_align_center">
<view class="label">账号</view>
<input type="text" class="input" v-model="phoneNumber" placeholder="请输入账号" placeholder-class="placeholderClass"/>
</view>
<view class="inputbox flex_align_center">
<view class="label">密码</view>
<input type="password" class="input" v-model="code" placeholder="请输入您的密码" placeholder-class="placeholderClass"/>
</view>
</view>
<view @click="confirm" class="btn_common btn">登录</view>
</view>
</template>
<script>
export default {
name: "login",
data() {
return {
phoneNumber: '',
code:'',
};
},
onLoad() {
},
onShow() {
},
methods: {
confirm() {
let that = this;
// if (!this.phoneNumber) {
// uni.showToast({
// title: '请输入账号',
// icon: 'none'
// })
// return false;
// }
// if(!/^1[3456789]{1}\d{9}$/gi.test(this.phoneNumber)){
// uni.showToast({
// title:'请检查账号',
// icon:'none'
// })
// return false;
// }
// if (!this.code) {
// uni.showToast({
// title: '请输入密码',
// icon: 'none'
// })
// return false;
// }
// this.post(this.apis.login, {
// data: {
// phone: this.phoneNumber,
// code:this.code,
// }
// }).then(res => {
// if (res.code == 0) {
// uni.showLoading();
// } else {
// uni.showToast({
// title: res.msg,
// icon: 'none'
// })
// }
// });
uni.switchTab({
url:'/pages/index/index'
});
},
}
}
</script>
<style lang="scss" scoped>
.loginbox{
padding: 0 56rpx;
.topbox{
background-color: #fff;
padding-top: 180rpx;
}
.logoimg{
width: 174rpx;
height: 174rpx;
display: block;
margin: 0rpx auto 180rpx;
}
.inputbox{
margin-bottom:40rpx;
padding-bottom: 7rpx;
border-bottom: 2rpx solid #DDDDDD;
.label{
width:132rpx;
text-align: left;
}
.input{
width: 506rpx;
height: 80rpx;
text-indent: 20rpx;
}
uni-button:after{
border: 0rpx solid rgba(0,0,0,0) !important;
}
}
.placeholderClass{
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: $uni-color-gray;
}
.btn{
margin: 180rpx auto 0;
}
}
</style>
【样式,登录,uniapp】账号,密码 登录样式
最新推荐文章于 2024-04-15 18:44:22 发布