123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <template>
- <view class="container">
- <view class="wjmm" style="text-align: right;padding-right: 30rpx;font-size: 36rpx;" @click="zc()">
- 注冊
- </view>
- <view class="tit" style="padding-top:120rpx;">
- 郵箱
- </view>
- <input type="text" class="shuru" placeholder="請翰入郵箱" v-model="email">
- <view class="tit">
- 密碼
- </view>
- <input type="password" class="shuru" placeholder="請翰入密碼" v-model="lpwd" >
- <view class="" style="padding:20rpx 48rpx;">
- <view class="wjmm" @click="wjmm()">
- 忘記密碼?
- </view>
- </view>
- <view class="flex" style="justify-content: flex-end;padding: 0 48rpx;">
- <view class="gologin" @click="gologin">
- 登錄
- </view>
- </view>
-
- <!-- <view class="login_text">
- <view class="login_input flex">
- <view class="login_img">
- <image src="/static/icon/img03.png"></image>
- </view>
- <view class="login_name"><input class="uni-input" v-model="username" focus placeholder="请输入手机号" />
- </view>
- </view>
- <view class="login_input flex">
- <view class="login_img">
- <image src="/static/icon/img04.png"></image>
- </view>
- <view class="login_name"><input class="uni-input" type="password" v-model="passward" focus
- placeholder="请输入密码" /></view>
- </view>
- <view><button type="green" class="uni-button uni-button-green" @click="toLogin">登录</button></view>
- <view><button type="green" class="uni-button uni-button-green uni-button-green-plain" plain="true"
- hover-class="none" @click="register">注册</button></view>
- <navigator url="./forget">
- <view class="forget">忘记密码</view>
- </navigator>
- <view class="flex other">
- <view class="fenge"></view>
- <view class="qita">其他方式登录</view>
- <view class="fenge"></view>
- </view>
- </view> -->
- </view>
- </template>
- <script>
- import {
- loginWx,
- gologin
- } from '@/api/login.js';
- export default {
- data() {
- return {
- email: '',
- lpwd: ''
- };
- },
- onLoad() {
-
- },
- methods: {
- zc() {
- uni.navigateTo({
- url: '/pages/public/register',
- })
- },
- wjmm() {
- uni.navigateTo({
- url: '/pages/public/forget',
- })
- },
- gologin() {
- let obj = this
- if(obj.loadingType == 'loading') {
- return
- }
- if(!obj.isEmailAvailable(obj.email)) {
- return obj.$api.msg('請輸入正確的郵箱!')
- }
- obj.loadingType = 'loading'
- gologin({
- email: obj.email,
- lpwd: obj.lpwd
- }).then(res => {
- console.log(res)
- obj.loadingType = 'no'
- }).catch(err => {
- console.log(err)
- obj.loadingType = 'no'
- })
- },
-
- isEmailAvailable(obj) {
- let email = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
- if (!email.test(obj)) {
- return false;
- }
- return true;
- },
- }
- };
- </script>
- <style lang="scss">
- page {
- height: 100%;
- background-color: #fff;
- font-size: 32rpx;
- }
- .container {
- width: 100%;
- height: 100%;
- background-size: 100%;
- }
- .shuru {
- display: block;
- background-color: #f5f5f5;
- width: 673rpx;
- height: 95rpx;
- margin: auto;
- padding-left: 30rpx;
- text-align: 95rpx;
- }
- .tit {
- padding:60rpx 48rpx 20rpx;
- }
- .gologin {
- width: 204rpx;
- height: 98rpx;
- line-height: 98rpx;
- background-color: #fcd535;
- text-align: center;
- border-radius: 20rpx;
- }
- .wjmm {
- color: #fcd535;
- }
- </style>
|