| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <!DOCTYPE html>
- <html class="h100p">
- <head>
- <meta charset="utf-8">
- <title>登录-爽客邦</title>
- <meta name="keywords" content="登录-爽客邦">
- <meta name="description" content="登录-爽客邦">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="登录-爽客邦">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="bgc-back h100p nopb login">
- <div class="rel h100p" id="app">
- <div class="logo tc"><img src="./static/images/logo-text.png" alt=""></div>
- <div class="login-box" v-cloak>
- <van-field class="mb12" v-model="username" @input="checkLogin" placeholder="请输入登录手机号"></van-field>
- <van-field v-model="password" @input="checkLogin" :type="isShowPwd ? 'text' : 'password'" placeholder="请输入密码">
- <template #button>
- <van-button class="fr" @click="showPwd()"><img class="fr" :src="isShowPwd ? './static/images/show-icon@3x.png' : './static/images/noshow-icon@3x.png'" alt=""></van-button>
- </template>
- </van-field>
- <div class="df pt16">
- <van-checkbox v-model="autoLogin" icon-size=".426667rem" checked-color="#ec5e3b"><span class="f12 c999">记住密码</span></van-checkbox>
- <div class="f12 c999 flex1 tr" @click="forgetpwd">忘记密码?</div>
- </div>
- <div class="pt16">
- <van-button type="primary" block :disabled="canLogin ? false : true" color="#FF502A" @click="login">登录</van-button>
- </div>
- <div class="login-tip tc">
- <div class="f12 c999">还没有账号?<span class="more" @click="regist">立即注册 ></span></div>
- </div>
- </div>
- <div class="login-bottom tc abs">
- <div class="f12 caaa pb8 van-hairline--bottom">登录即表示同意<span @click="goservice">「爽客邦服务协议」</span></div>
- <div class="f12 caaa pt8">客服热线:4001363866</div>
- </div>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- username: '',
- password: '',
- isShowPwd: false,
- autoLogin: false,
- canLogin: false,
- };
- },
- created() {
- this.gettoken();
- this.username = PublicLib.getCookieInfo('userName');
- if(PublicLib.getCookieInfo('userPassword').length >= 6) this.password = PublicLib.getCookieInfo('userPassword');
- this.checkLogin();
- this.autoLogin = Boolean(PublicLib.getCookieInfo('userautologin'));
- console.log(this.autoLogin)
- console.log(Boolean(PublicLib.getCookieInfo('userautologin')))
- },
- methods: {
- //- giveToast(){
- //- vant.Toast('提示');
- //- },
- showPwd(){
- this.isShowPwd = !this.isShowPwd;
- },
- checkLogin(){
- this.canLogin = (this.username !== '' && this.password !== '') ? true : false;
- },
- //- 注册
- regist(){
- PublicLib.Goto({Url:'user-regist'});
- },
- //- 获取token
- async gettoken(){
- const res = await getRequest('/api/systemset/appchecktest',JSON.stringify({"uuid":"123456","salt":"123456"}));
- PublicLib.putCookieInfo('token', res.data.Token);
- },
- //- 登录
- async login(){
- PublicLib.putCookieInfo('userName', this.username);
- PublicLib.putCookieInfo('userPassword', '');
- PublicLib.putCookieInfo('userautologin', '');
- if(this.autoLogin) {
- PublicLib.putCookieInfo('userPassword', this.password);
- PublicLib.putCookieInfo('userautologin', this.autoLogin);
- };
- //- 验证手机号码是否正确
- if(!verificationphonenumber(this.username)){
- return tips('手机号码格式错误');
- };
- if(verificationpassword(this.password)) return;
- const value = JSON.stringify({Mobile:this.username,LoginPwd:this.password});
- const res = await getRequest('/api/v1/users/login',value);
- if(res.status !== '1') return tips(res.info);
- if(PublicLib.getCookieInfo('step') === '2'){
- PublicLib.Goto({Url:'gesture-inputpassword'});
- }else if(PublicLib.getCookieInfo('step') === undefined){
- PublicLib.Goto({Url:'gesture-setpassword'});
- }else {
- PublicLib.Goto({Url:'index'});
- };
- //- 存储用户ID
- PublicLib.putCookieInfo('userId', res.data.Id);
- },
- forgetpwd(){
- PublicLib.Goto({Url:'user-forgetpwd'});
- },
- goservice(){
- PublicLib.Goto({Url:'user-servce-agreement'});
- }
- }
- });
- </script>
- </body>
- </html>
|