|
@@ -1,27 +1,23 @@
|
|
|
<template>
|
|
|
- <view id="login" class="section">
|
|
|
- <view class="bg">
|
|
|
- <image class="bgImage" :src="useStore.$state.loginBg" v-if="useStore.$state.loginBg" />
|
|
|
- </view>
|
|
|
+ <view id="login-container" class="login-container">
|
|
|
+ <image class="bgImage" :src="useStore.$state.loginBg" v-if="useStore.$state.loginBg" />
|
|
|
|
|
|
<view class="middle">
|
|
|
- <view class="top">
|
|
|
+ <view class="middle-top">
|
|
|
<image class="logo" mode="heightFix" :src="useStore.$state.loginLogo" v-if="useStore.$state.loginLogo" />
|
|
|
- <!-- <image class="logo" mode="heightFix" src="@/static/logo200.png" v-else /> -->
|
|
|
<text class="title" :style="{ color: useStore.$state.loginBg ? '#FFFFFF' : '#000000' }" v-if="useStore.$state.loginTitle">{{ useStore.$state.loginTitle }}</text>
|
|
|
- <!-- <text class="title" v-else>移动端登录</text> -->
|
|
|
</view>
|
|
|
|
|
|
- <view class="content">
|
|
|
+ <view class="middle-content">
|
|
|
<text class="title" :style="{ color: useStore.$state.loginBg ? '#FFFFFF' : '#000000' }">请登录</text>
|
|
|
|
|
|
- <!-- #ifdef APP-PLUS || MP-WEIXIN -->
|
|
|
- <view id="okay" v-if="!linkUrl">首次账号登录请先配置服务器</view>
|
|
|
+ <!-- #ifdef APP-PLUS || MP-WEIXIN -->
|
|
|
+ <view class="prompt" v-if="!linkUrl">首次账号登录请先配置服务器</view>
|
|
|
<view class="setting" @tap="goSeverConfig"> 配置服务器 </view>
|
|
|
<!--#endif-->
|
|
|
</view>
|
|
|
|
|
|
- <view id="login-input" v-if="switchText == '账号密码登录'">
|
|
|
+ <view class="middle-input" v-if="switchText == '账号密码登录'">
|
|
|
<u-input v-model="phone" prefixIcon="phone" placeholder="请输入手机号码" />
|
|
|
|
|
|
<u-input v-model="verify" prefixIcon="email" placeholder="请输入验证码" :maxlength="6">
|
|
@@ -31,7 +27,7 @@
|
|
|
</u-input>
|
|
|
</view>
|
|
|
|
|
|
- <view id="login-input" v-if="switchText == '验证码登录'">
|
|
|
+ <view class="middle-input" v-if="switchText == '验证码登录'">
|
|
|
<u-input type="text" v-model="username" prefixIcon="account" placeholder="请输入账号" />
|
|
|
|
|
|
<u-input v-model="password" prefixIcon="lock" placeholder="请输入密码" :password="inputIconBool">
|
|
@@ -41,24 +37,28 @@
|
|
|
</u-input>
|
|
|
</view>
|
|
|
|
|
|
- <button class="submit" @click="submitRes">登 录</button>
|
|
|
+ <button class="middle-submit" @click="submitRes">登 录</button>
|
|
|
|
|
|
- <view class="switchText">
|
|
|
- <text @click="switchMode">{{ switchText }}</text>
|
|
|
+ <view class="middle-switch">
|
|
|
+ <text class="switch-loginMethod" @click="switchMode(1)">{{ switchText }}</text>
|
|
|
+ <div style="margin: auto"></div>
|
|
|
+ <text class="switch-register" @click="switchMode(2)">注册账号</text>
|
|
|
</view>
|
|
|
|
|
|
<!-- #ifdef APP-PLUS || MP-WEIXIN -->
|
|
|
- <view class="xieyi text-center">
|
|
|
+ <view class="middle-agreed text-center">
|
|
|
<u-checkbox-group v-model="userChecked">
|
|
|
<u-checkbox :name="true" shape="circle" inactiveColor="#0081ff" size="13"></u-checkbox>
|
|
|
</u-checkbox-group>
|
|
|
- <text>我已阅读并同意</text>
|
|
|
+ <text>登录即已代表阅读并同意</text>
|
|
|
+ <!-- <text>我已阅读并同意</text> -->
|
|
|
<text @click="handleUserAgrement" class="text-blue">用户协议</text>
|
|
|
<text>和</text>
|
|
|
<text @click="handlePrivacy" class="text-blue">隐私协议</text>
|
|
|
</view>
|
|
|
<!--#endif-->
|
|
|
</view>
|
|
|
+
|
|
|
<view class="bottom">
|
|
|
<div class="title">{{ useStore.$state.loginBottomTitle }}</div>
|
|
|
</view>
|
|
@@ -102,11 +102,11 @@ function goSeverConfig() {
|
|
|
/**
|
|
|
* @登录方式切换
|
|
|
*/
|
|
|
-function switchMode() {
|
|
|
- if (switchText.value == "验证码登录") {
|
|
|
- switchText.value = "账号密码登录";
|
|
|
- } else {
|
|
|
- switchText.value = "验证码登录";
|
|
|
+function switchMode(value) {
|
|
|
+ if (value == 1) {
|
|
|
+ switchText.value == "验证码登录" ? (switchText.value = "账号密码登录") : (switchText.value = "验证码登录");
|
|
|
+ } else if (value == 2) {
|
|
|
+ proxy.$tab.navigateTo("/pages/register");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -242,14 +242,16 @@ function handlePrivacy() {
|
|
|
}
|
|
|
|
|
|
onShow(() => {
|
|
|
- init();
|
|
|
+ setTimeout(() => {
|
|
|
+ init();
|
|
|
+ }, 50);
|
|
|
});
|
|
|
|
|
|
onLoad((options) => {});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.section {
|
|
|
+.login-container {
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
@@ -260,18 +262,14 @@ onLoad((options) => {});
|
|
|
height: 100vh;
|
|
|
background-color: $uni-bg-color;
|
|
|
|
|
|
- .bg {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
+ .bgImage {
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
z-index: 0;
|
|
|
- .bgImage {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
|
|
|
.middle {
|
|
@@ -282,7 +280,7 @@ onLoad((options) => {});
|
|
|
margin: auto;
|
|
|
margin-top: 30%;
|
|
|
|
|
|
- .top {
|
|
|
+ &-top {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
@@ -304,7 +302,7 @@ onLoad((options) => {});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .content {
|
|
|
+ &-content {
|
|
|
display: flex;
|
|
|
position: relative;
|
|
|
margin: 30px 0 30px 0;
|
|
@@ -314,16 +312,12 @@ onLoad((options) => {});
|
|
|
font-size: 18px;
|
|
|
}
|
|
|
|
|
|
- .icons {
|
|
|
- margin: auto 5px auto 0;
|
|
|
- }
|
|
|
-
|
|
|
.setting {
|
|
|
color: #2a98ff;
|
|
|
margin: auto 0;
|
|
|
}
|
|
|
|
|
|
- #okay {
|
|
|
+ .prompt {
|
|
|
position: absolute;
|
|
|
top: -35px;
|
|
|
right: 0px;
|
|
@@ -348,7 +342,7 @@ onLoad((options) => {});
|
|
|
}
|
|
|
|
|
|
// 登录页-服务器配置样式 开始
|
|
|
- #login-input {
|
|
|
+ &-input {
|
|
|
:deep(.u-input) {
|
|
|
height: 45px;
|
|
|
border: 0 !important;
|
|
@@ -384,28 +378,24 @@ onLoad((options) => {});
|
|
|
background-image: none;
|
|
|
transition: background-color 50000s ease-in-out 0s; //背景色透明 生效时长 过渡效果 启用时延迟的时间
|
|
|
}
|
|
|
-
|
|
|
- .verify {
|
|
|
- color: #2a98ff;
|
|
|
- font-size: 14px;
|
|
|
- padding-left: 0px;
|
|
|
- padding-right: 0px;
|
|
|
- background-color: transparent;
|
|
|
-
|
|
|
- &::after {
|
|
|
- border: 0px;
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- .switchText {
|
|
|
- color: #96a6b5;
|
|
|
+ &-switch {
|
|
|
width: 100%;
|
|
|
- display: block;
|
|
|
+ display: flex;
|
|
|
margin-top: 20px;
|
|
|
+ color: #96a6b5;
|
|
|
+
|
|
|
+ &-loginMethod {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-register {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- .submit {
|
|
|
+ &-submit {
|
|
|
height: 45px;
|
|
|
line-height: 45px;
|
|
|
border-radius: 24px;
|
|
@@ -414,7 +404,7 @@ onLoad((options) => {});
|
|
|
border: 0px;
|
|
|
}
|
|
|
|
|
|
- .xieyi {
|
|
|
+ &-agreed {
|
|
|
color: #96a6b5;
|
|
|
margin-top: 30px;
|
|
|
display: flex;
|