Merge branch 'YOUFANGAPP1.1' of 192.168.0.27:dev0/youfang-app into xh-youfangApp1.1
This commit is contained in:
@@ -175,32 +175,7 @@ em.down{color:#88D053;}
|
||||
.bar-tab:before{background-color:#DCDCDC;transform:scaleY(1);}
|
||||
.bar-tab .tab-item .icon ~ .tab-label{top:0.05rem;}
|
||||
|
||||
/* 登录 */
|
||||
.icon-login01{width:14px;height:20px;background:url(../images/icon-login01.png) no-repeat center center;background-size:100%;vertical-align:text-bottom;}
|
||||
.icon-login02{width:15px;height:19px;background:url(../images/icon-login02.png) no-repeat center center;background-size:100%;vertical-align:text-bottom;}
|
||||
.icon-login03{width:15px;height:18px;background:url(../images/icon-login03.png) no-repeat center center;background-size:100%;vertical-align:text-bottom;}
|
||||
.icon-loginMode01{width:30px;height:24px;background:url(../images/icon-loginMode01.png) no-repeat center center;background-size:100%;}
|
||||
.icon-loginMode02{width:30px;height:24px;background:url(../images/icon-loginMode02.png) no-repeat center center;background-size:100%;}
|
||||
.icon-loginMode03{width:22px;height:24px;background:url(../images/icon-loginMode03.png) no-repeat center center;background-size:100%;}
|
||||
#input_phoneNumber,#input_codeSms,#input_password{left:24px;width:80%;}
|
||||
#input_phoneNumber{width:50%;}
|
||||
#input_feedback{width:100%;height:100px;}
|
||||
.list-block .item-after .icon-eye-grey{width:0.9rem;height:0.65rem;margin-right:0;margin-top:0.25rem;}
|
||||
.list-block .item-after .icon-eye-orange{width:0.9rem;height:0.65rem;margin-right:0;margin-top:0.25rem;}
|
||||
.sendCode{padding:0 8px;height:27px;background:#fff;border:solid 1px #2db0fc;border-radius:3px;color:#2db0fc;text-align:center;line-height:26px;font-size:0.7rem;float:right;margin-top:-2px;}
|
||||
.waiting{padding:0 8px;height:27px;background:#0a8ddf;border:solid 1px #0a8ddf;border-radius:3px;color:#fff;text-align:center;line-height:26px;font-size:0.7rem;float:right;margin-top:-2px;}
|
||||
.agreement{font-size:0.65rem;color:#666;margin-left:0.75rem;}
|
||||
.agreement a{font-size:0.65rem;}
|
||||
.check{width:18px;height:18px;border:solid 1px #D7D7D7;border-radius:0.05rem;display:inline-block;vertical-align:middle;margin-right:0.2rem;position:relative;}
|
||||
.checkImg{width:10px;height:7px;position:absolute;top:5px;left:3px;}
|
||||
.loginBox p{text-align:center;margin:0;}
|
||||
.loginBox p .button{margin-top:2rem;margin-bottom:0.5rem;}
|
||||
.loginBox p a{font-size:0.65rem;color:#AA907A;}
|
||||
.loginMode{width:100%;position:absolute;bottom:4.5rem;}
|
||||
.loginMode p{font-size:0.65rem;color:#999;text-align:center;}
|
||||
.loginMode p a:nth-child(2){margin:0 2rem;}
|
||||
.line{width:100%;height:1px;background:#e5e5e5;margin-bottom:1.5rem;position:relative;}
|
||||
.line span{position:absolute;top:-10px;left:50%;margin-left:-57.5px;display:block;background:#fff;padding:0 25px;font-size:0.65rem;color:#999;}
|
||||
|
||||
/* 首页 */
|
||||
.totalValue{padding:1rem 0;overflow:hidden;}
|
||||
.totalValue div:first-child{float:left;margin-left:0.75rem;}
|
||||
|
||||
@@ -3,7 +3,8 @@ axios.defaults.headers.post['Content-Type'] = 'application/json';
|
||||
|
||||
// 添加请求拦截器
|
||||
axios.interceptors.request.use(function (config) {
|
||||
config.headers.Authorization = '111111111'
|
||||
var token = localStorage.getItem("user_token");
|
||||
config.headers.Authorization = token
|
||||
return config;
|
||||
}, function (error) {
|
||||
return Promise.reject(error);
|
||||
|
||||
@@ -61,20 +61,26 @@ $("#login_btn").on("click", function () {
|
||||
var phoneNum = $("#input_phoneNumber").val();
|
||||
var code = $("#input_codeSms").val();
|
||||
var protocal = $(".check").find(".checkImg").css("display");
|
||||
if(phoneNum == ""){
|
||||
$.toast("请输入手机号码");
|
||||
return false;
|
||||
}
|
||||
if(code == ""){
|
||||
$.toast("请输入验证码");
|
||||
return false;
|
||||
}
|
||||
if(protocal != "block"){
|
||||
$.toast("请同意服务协议");
|
||||
return false;
|
||||
}
|
||||
axios.post("/rest/user/sendMobileCode", {mobile: mobile})
|
||||
.then(function (response) {
|
||||
|
||||
})
|
||||
if(checkPhoneNum(phoneNum)){
|
||||
if(code == ""){
|
||||
$.toast("请输入验证码");
|
||||
return false;
|
||||
}
|
||||
if(protocal != "block"){
|
||||
$.toast("请同意服务协议");
|
||||
return false;
|
||||
}
|
||||
axios.post("/rest/user/smsLogin", {mobile: phoneNum,smsCode:code})
|
||||
.then(function (response) {
|
||||
var resData = response.data;
|
||||
if (resData.status) {
|
||||
// 用户登录成功的TOKEN
|
||||
var token = resData.data;
|
||||
localStorage.setItem("user_token", token);
|
||||
$.toast(resData.message);
|
||||
} else {
|
||||
$.toast(resData.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
var auths = {}
|
||||
function plusReady() {
|
||||
plus.oauth.getServices(function(services) {
|
||||
alert("111111111111111111111111")
|
||||
auths = services;
|
||||
}, function(e) {
|
||||
alert("获取登录服务列表失败:" + e.message + " - " + e.code);
|
||||
});
|
||||
}
|
||||
document.addEventListener('plusready',plusReady,false);
|
||||
// 登录认证
|
||||
function webChatLogin(){
|
||||
var auth=auths['weixin'];
|
||||
if(auth){
|
||||
var w=null;
|
||||
if(plus.os.name=="Android"){
|
||||
w=plus.nativeUI.showWaiting();
|
||||
}
|
||||
document.addEventListener("pause",function(){
|
||||
setTimeout(function(){
|
||||
w&&w.close();w=null;
|
||||
},2000);
|
||||
}, false );
|
||||
auth.login(function(){
|
||||
w&&w.close();w=null;
|
||||
userinfo(auth);
|
||||
},function(e){
|
||||
w&&w.close();w=null;
|
||||
$.toast("登录认证失败:["+e.code+"]:"+e.message);
|
||||
});
|
||||
}else{
|
||||
$.toast("无效的登录认证通道!");
|
||||
$.toast("无效的登录认证通道!",null,"登录");
|
||||
}
|
||||
}
|
||||
|
||||
function authLogin(type) {
|
||||
console.log("hhhhhhhhhhhhhhhhhhh")
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
|
||||
<link rel="stylesheet" href="../../css/sm.css">
|
||||
<link rel="stylesheet" href="../../css/main.css">
|
||||
<link rel="stylesheet" href="../../css/theme-orange.css">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="page-group">
|
||||
<div class="page page-current">
|
||||
<header class="bar bar-nav">
|
||||
<button class="button button-link button-nav pull-left" onclick="history.go(-1)">
|
||||
<button class="button button-link button-nav pull-left" onclick="back(),plus.nativeUI.closeWaiting();">
|
||||
<span class="icon icon-left"></span>
|
||||
</button>
|
||||
<h1 class="title">快捷登录</h1>
|
||||
@@ -63,17 +63,17 @@
|
||||
我已阅读并接受<a href="05_mine05_set03_agreement.html">《服务协议》</a>
|
||||
</p>
|
||||
<div class="content-block loginBox">
|
||||
<p><a href="05_mine01_index.html" class="button button-big button-fill theme" id="login_btn">登录</a></p>
|
||||
<p><a href="05_mine00_login02_password.html">账号密码登录</a></p>
|
||||
<p><a class="button button-big button-fill theme" id="login_btn">登录</a></p>
|
||||
<p><a onclick="clicked('passLogin.html', true)">账号密码登录</a></p>
|
||||
</div>
|
||||
<div class="content-block loginMode">
|
||||
<p class="line">
|
||||
<span>第三方登录</span>
|
||||
</p>
|
||||
<p>
|
||||
<a href="05_mine00_login04_set.html" class="icon icon-loginMode01"></a>
|
||||
<a class="icon icon-loginMode01" id="wxLogin" onclick="webChatLogin()"></a>
|
||||
<a href="05_mine00_login04_set.html" class="icon icon-loginMode02"></a>
|
||||
<a href="05_mine00_login04_set.html" class="icon icon-loginMode03"></a>
|
||||
<a href="05_mine00_login04_set.html" class="icon icon-loginMode03" id="qqLogin"></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -92,15 +92,17 @@ $.config = {router: false}
|
||||
<script type="text/javascript" src="../../js/vue.js"></script>
|
||||
<script type="text/javascript" src="../../js/light7.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="../../js/cn.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="../../js/mui.min.js" charset="utf-8"></script>
|
||||
<script src="../../config.js"></script>
|
||||
<script type="text/javascript" src="../../js/axios.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/axiosPlugin.js"></script>
|
||||
<script type="text/javascript" src="../../js/login/codeSms.js" ></script>
|
||||
<script type="text/javascript" src="../../js/login/wxLogin.js" ></script>
|
||||
<script type="text/javascript" src="../../js/common.js" ></script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
/* 勾选-已阅读 */
|
||||
$(".check").on("click", function () {
|
||||
var a = $(this).find(".checkImg").css("display");
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>账号密码登录</title>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<link rel="stylesheet" href="../../css/sm.css">
|
||||
<link rel="stylesheet" href="../../css/main.css">
|
||||
<link rel="stylesheet" href="../../css/theme-orange.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="page-group" id="app">
|
||||
<div class="page page-current">
|
||||
<header class="bar bar-nav">
|
||||
<button class="button button-link button-nav pull-left" onclick="back(),plus.nativeUI.closeWaiting();">
|
||||
<span class="icon icon-left"></span>
|
||||
</button>
|
||||
<h1 class="title">账号密码登录</h1>
|
||||
</header>
|
||||
<div class="content">
|
||||
<div class="list-block media-list">
|
||||
<ul>
|
||||
<li>
|
||||
<a class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title-row">
|
||||
<div class="item-title"><i class="icon icon-login01"></i></div>
|
||||
<div class="item-after">
|
||||
<input type="number" v-model="mobile" id="input_phoneNumber" class="textAlignLeft" placeholder="请输入手机号码">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title-row">
|
||||
<div class="item-title"><i class="icon icon-login03"></i></div>
|
||||
<div class="item-after">
|
||||
<input type="password" v-model="pass" id="input_password" class="textAlignLeft" placeholder="请输入密码">
|
||||
<i class="icon icon-eye-grey" @click="show"></i>
|
||||
<i class="icon icon-eye-orange dn" @click="hide"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-block loginBox">
|
||||
<p><a class="button button-big button-fill theme" id="login_btn" @click="passLogin">登录</a></p>
|
||||
<p><a @click="openSmsLoginPage">快捷登录</a></p>
|
||||
</div>
|
||||
<div class="content-block loginMode">
|
||||
<p class="line">
|
||||
<span>第三方登录</span>
|
||||
</p>
|
||||
<p>
|
||||
<a href="05_mine00_login04_set.html" class="icon icon-loginMode01"></a>
|
||||
<a href="05_mine00_login04_set.html" class="icon icon-loginMode02"></a>
|
||||
<a href="05_mine00_login04_set.html" class="icon icon-loginMode03"></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="../../js/zepto.js" charset="utf-8"></script>
|
||||
|
||||
<script>
|
||||
|
||||
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
|
||||
Zepto = $
|
||||
$.config = {router: false}
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="../../js/light7.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="../../js/cn.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="../../js/vue.js" ></script>
|
||||
<script type="text/javascript" src="../../js/zepto.md5.js" ></script>
|
||||
<script type="text/javascript" src="../../config.js"></script>
|
||||
<script type="text/javascript" src="../../js/axios.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/axiosPlugin.js"></script>
|
||||
<script type="text/javascript" src="../../js/plus.info.js" ></script>
|
||||
<script type="text/javascript" src="../../js/common.js" ></script>
|
||||
|
||||
<script>
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
mobile: '',
|
||||
pass: ''
|
||||
},
|
||||
methods: {
|
||||
// 手机号码检查
|
||||
checkMobile: function() {
|
||||
if(this.mobile == ""){
|
||||
$.toast("请输入手机号码");
|
||||
return false;
|
||||
}
|
||||
var mobile_reg = /^1\d{10}$/
|
||||
if (!mobile_reg.test(this.mobile)) {
|
||||
$.toast("手机号码格式错误");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// 密码登录
|
||||
passLogin: function() {
|
||||
if (this.checkMobile()) {
|
||||
if (this.pass == '') {
|
||||
$.toast("请输入密码");
|
||||
return;
|
||||
}
|
||||
axios.post("/rest/user/passLogin", {mobile:this.mobile, pass: $.md5(this.pass), pushClientId:getPushInfo()})
|
||||
.then(function (response) {
|
||||
var resData = response.data;
|
||||
if (resData.status) {
|
||||
// 用户登录成功的TOKEN
|
||||
var token = resData.data;
|
||||
localStorage.setItem("user_token", token);
|
||||
$.toast(resData.message);
|
||||
} else {
|
||||
$.toast(resData.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
$.toast(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
/* 密码显示&隐藏 */
|
||||
show: function() {
|
||||
$(".list-block .item-after .icon-eye-grey").hide();
|
||||
$(".list-block .item-after .icon-eye-orange").show();
|
||||
$("#input_password").attr("type","text");
|
||||
},
|
||||
hide: function() {
|
||||
$(".list-block .item-after .icon-eye-orange").hide();
|
||||
$(".list-block .item-after .icon-eye-grey").show();
|
||||
$("#input_password").attr("type","password");
|
||||
},
|
||||
// 打开验证码登录页面
|
||||
openSmsLoginPage: function() {
|
||||
back(),plus.nativeUI.closeWaiting();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user