当前位置:网站首页>2、 Uni app login function page Jump
2、 Uni app login function page Jump
2022-07-28 18:59:00 【Ming-Afresh】
<template>
<view class="content" style="width: 100%; height: 100%;">
<view style="text-align: center;">
</view>
<text class="title" style="text-align: center; font-size: 40rpx; font-family: PingFangSC-Medium, PingFang SC; font-weight: bolder;">Ming-Afresh</text>
<text class="title" style="text-align: center; font-size: 30rpx; font-family: PingFangSC-Medium, PingFang SC; margin-top: 100rpx;"> Account password login </text>
<view style="padding: 60rpx; position: absolute; top: 350rpx;">
<view>
<input class="input1" placeholder-style='color:#AAAAAA;' v-model='username' placeholder=" Please enter the account name " />
</view>
<view>
<input class="input1" type='password' placeholder-style='color:#AAAAAA' v-model='password' placeholder=" Please input a password " />
</view>
<view style="height: 25rpx; color: #FF5C50; font-size: 26rpx; margin-top: 20rpx;">
<span v-show='error'> The user doesn't exist / Wrong password </span>
// v-show Judge hidden conditions
</view>
<button style="margin-top: 60rpx; background-color: #6CCACF; border-radius: 45rpx; color: #FFFFFF; width: 200rpx;" @click="userLogin"> Sign in </button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
error: false,
username: '',
password: '',
}
},
onLoad() {
let isLogin = uni.getStorageSync('isLogin')
if (isLogin) {
uni.redirectTo({
url: '../home/home'
// Get the specified from the local cache synchronously key:('isLogin') Corresponding content
// And transfer parameters between pages
})
}
},
methods: {
userLogin(e) {
var that = this;
uni.request({
url: 'https://kz.ababjs.com/epkg/testhistorytest/login',
// Back end interface address post Method
method: 'POST',
data: {
username: that.username,
password: that.password,
rememberMe: false
// Take value
},
header: {
'content-type': 'application/json'
},
success(res) {
if (res.data.code == 0) {
that.error = false
uni.setStorageSync('isLogin', true)
uni.setStorageSync('username', that.username)
uni.redirectTo({
url: '../home/home'
// After the click event is triggered successfully, the page route jumps
})
} else {
that.error = true
that.password = ''
}
},
fail(err) {
}
});
},
}
}
</script>
<style>
page {
background-image:linear-gradient(to bottom right,#6CCACF,#FBFCFB);
}
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.text-login {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 20rpx;
background: #ffffff;
margin-top: 80rpx;
width: 660rpx;
height: 1050rpx;
}
.title {
color: black;
position: absolute;
top: 200rpx;
}
.input1 {
height: 80rpx;
width: 500rpx;
padding: 10rpx;
margin: 30rpx;
background-color: #FBFBFB;
border-radius: 45rpx;
}
</style>

边栏推荐
- kotlin:out in
- EasyCVR接入设备后播放视频出现卡顿现象的原因分析及解决
- 零知识证明:具有DDH假设的 ZKP
- LVS manual
- 1.2 queue
- Introduction and advanced level of MySQL (9)
- Swiftui component how to implement textfield of hidden part of phone number mask (tutorial includes source code)
- Introduction and advanced level of MySQL (8)
- 历史上的今天:微软收购 QDOS;模型检测先驱出生;第一张激光照排的中文报纸...
- 2022 Hangdian multi school field 2 1011 DOS card (line segment tree)
猜你喜欢

Configuration tutorial: how does the organizational structure of the new version of easycvr (v2.5.0) cascade to the superior platform?

Introduction and advanced MySQL (III)

Why app uses JSON protocol to interact with server: serialization related knowledge

N32 replaces STM32. Don't ignore these details!

2022年中国企业服务产业市场行情

4 年后,Debian 终夺回“debian.community”域名!

1.1. Sparse array

Introduction and advanced level of MySQL (8)

What if svchost.exe of win11 system has been downloading?

EasyCVR接入设备后播放视频出现卡顿现象的原因分析及解决
随机推荐
注意力机制及代码实现
Gateway入门
Introduction and advanced level of MySQL (9)
Software testing dry goods
微信安装包11年膨胀575倍,UP主:“98%的文件是垃圾”;苹果应用商店被曝大量色情App;四大科技巨头呼吁废除闰秒|极客头条...
Implementation of grayscale publishing with haproxy
Full analysis of warehouse building on the lake: how to build a lake warehouse integrated data platform | deepnova technology collection series open class phase IV
112. 使用自开发的代理服务器解决 SAP UI5 FileUploader 上传文件时遇到的跨域访问错误
十进制转二进制进阶版(可转化负数以及边界值)
Introduction and advanced MySQL (7)
Win11系统svchost.exe一直在下载怎么办?
Can the training software test be employed
使用自开发的代理服务器解决 SAP UI5 FileUploader 上传文件时遇到的跨域访问错误试读版
2022-07-27 study notes of group 4 self-cultivation class (every day)
全新升级!《云原生架构白皮书 2022 版》重磅发布
@The difference between Autowired and @resource
Is the prospect of software testing dead? Has it entered the cold winter?
Easynlp Chinese text and image generation model takes you to become an artist in seconds
专题讲座6 树形dp 学习心得(长期更新)
配置教程:新版本EasyCVR(v2.5.0)组织结构如何级联到上级平台?