2.5.1 先省略微信授權(quán)登錄模塊(放到后臺(tái)時(shí)候做)屯远,直接做微信授權(quán)登錄之后的頁面
js/common.js
先封裝一些apicloud的接口蜓肆,具體接口文檔請(qǐng)參照API對(duì)象
function OpenWin(win_name,win_url,win_pageparam) {
api.openWin({
name: win_name,
url: win_url,
pageParam:win_pageparam,
vScrollBarEnabled:false,
hScrollBarEnabled:false,
animation:{
type:"push",
subType:"from_right",
duration:300
},
softInputBarEnabled:false
});
}
function CloseWin() {
api.closeWin({
animation:{
type:"push",
subType:"from_left",
duration:300
},
});
}
function CloseToWin(win_name) {
api.closeToWin({
name: name,
animation:{
type:"push",
subType:"from_left",
duration:300
},
});
}
html/user/login_body.html
修改之前寫的一部分代碼
<div class="H-horizontal-center" style="padding: 80px 0;">
<div class="H-text-align-center">
<!--知識(shí)點(diǎn):加入tapmode=""解決移動(dòng)端點(diǎn)擊300ms延遲的問題-->
<img onclick="OpenWin('phone_head','./phone_head.html')" tapmode="" src="../../image/weixin.png" class="H-border-radius-12 H-margin-vertical-top-10"
style="width:70px;height:70px;">
<div class="H-font-size-14">微信登錄</div>
</div>
</div>
<!--引入封裝之后的js-->
<script src="../../script/common.js" type="text/javascript"></script>
2.5.2 去iconfont添加我們所需圖標(biāo)
css/style.css
.icon-arrow-left{
color: #929292
}
.icon-arrow-left:active{
color: #e8e8e8;
}
html/user/phone_head.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>app開發(fā)筆記</title>
<link rel="stylesheet" type="text/css" href="../../css/Hui.css"/>
<link rel="stylesheet" type="text/css" href="../../css/iconfont/iconfont.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
</head>
<body>
<header class="H-header" id="header" style="background-color: #232427">
<span onclick="CloseWin()" class="H-icon H-position-relative H-display-inline-block H-float-left H-vertical-middle H-padding-horizontal-left-5 H-z-index-100">
<i class="iconfont icon-arrow-left H-font-size-20 H-vertical-middle"></i>
</span>
<div class="H-header-title H-center-all H-font-size-14 H-text-show-row-1 H-position-absolute H-width-100-percent"
style="color: #e7e7e8">帳號(hào)安全認(rèn)證
</div>
</header>
<script src="../../script/api.js" type="text/javascript"></script>
<script src="../../script/common.js" type="text/javascript"></script>
<script type="text/javascript">
apiready = function () {
$api.fixStatusBar($api.byId('header'));
api.openFrame({
name: 'phone_body',
url: './phone_body.html',
rect: {
x: 0,
y: $api.byId('header').offsetHeight,
w: api.winWidth,
h: api.frameHeight - $api.byId('header').offsetHeight
}
});
};
</script>
</body>
</html>
html/user/phone_body.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>app開發(fā)筆記</title>
<link rel="stylesheet" type="text/css" href="../../css/Hui.css"/>
<link rel="stylesheet" type="text/css" href="../../css/iconfont/iconfont.css"/>
<style type="text/css">
button {
background: #e7511a;
border: 1px solid #e7511a;
}
button:active {
background: #f6d8cd;
border-color: #f6d8cd;
}
::-webkit-input-placeholder {
color:#c7c7cd;
}
:-moz-placeholder {
color:#c7c7cd;
}
::-moz-placeholder {
color:#c7c7cd;
}
:-ms-input-placeholder {
color:#c7c7cd;
}
</style>
</head>
<body>
<div class="H-text-align-center H-padding-vertical-both-25 H-font-size-14" style="color: #4a4a4a">綁定手機(jī)能保證你的帳號(hào)安全</div>
<div style="padding: 20px 40px;">
<div class="H-flexbox-horizontal" style="border: 1px solid #efeff4;">
<span class="H-icon H-vertical-middle H-padding-horizontal-both-20 H-font-size-14 H-theme-background-color-white" style="color: #aaaaaa;border-right: 1px solid #efeff4">
+86
</span>
<input id="phone" type="tel" maxlength="11" class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-16 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-8" placeholder="手機(jī)號(hào)">
</div>
<div class="H-flexbox-horizontal H-margin-vertical-both-10" style="border: 1px solid #efeff4;">
<input id="password" type="password" class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-16 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-8" placeholder="短信驗(yàn)證碼">
<div class="H-vertical-middle H-padding-horizontal-both-15 H-theme-background-color-white H-theme-font-color-333 H-font-size-12" style="border-left: 1px solid #efeff4">獲取驗(yàn)證碼</div>
</div>
<div class="H-text-align-center H-padding-vertical-both-20">
<div style="color: #bcbcbc" class="H-font-size-12">點(diǎn)擊“立即綁定”即表示你同意并愿意遵守糖水</div>
<div tapmode="" onclick="OpenWin('agreement_head','./agreement_head.html')" style="color: #629fe5" class="H-font-size-12">用戶協(xié)議</div>
</div>
<button tapmode="" onclick="OpenWin('password_head','./password_head.html')" class="H-button H-width-100-percent H-font-size-15 H-outline-none H-padding-vertical-both-8 H-padding-horizontal-both-20 H-theme-font-color-white">
立即綁定
</button>
</div>
<script src="../../script/api.js" type="text/javascript"></script>
<script src="../../script/common.js" type="text/javascript"></script>
</body>
</html>
html/user/password_head.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>app開發(fā)筆記</title>
<link rel="stylesheet" type="text/css" href="../../css/Hui.css"/>
<link rel="stylesheet" type="text/css" href="../../css/iconfont/iconfont.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
</head>
<body>
<header class="H-header" id="header" style="background-color: #232427">
<span onclick="CloseWin()" tapmode="" class="H-icon H-position-relative H-display-inline-block H-float-left H-vertical-middle H-padding-horizontal-left-5 H-z-index-100">
<i class="iconfont icon-arrow-left H-font-size-20 H-vertical-middle"></i>
</span>
<div class="H-header-title H-center-all H-font-size-14 H-text-show-row-1 H-position-absolute H-width-100-percent"
style="color: #e7e7e8">帳號(hào)安全認(rèn)證
</div>
</header>
<script src="../../script/api.js" type="text/javascript"></script>
<script src="../../script/common.js" type="text/javascript"></script>
<script type="text/javascript">
apiready = function () {
$api.fixStatusBar($api.byId('header'));
api.openFrame({
name: 'password_body',
url: './password_body.html',
rect: {
x: 0,
y: $api.byId('header').offsetHeight,
w: api.winWidth,
h: api.frameHeight - $api.byId('header').offsetHeight
}
});
};
</script>
</body>
</html>
html/user/password_body.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>app開發(fā)筆記</title>
<link rel="stylesheet" type="text/css" href="../../css/Hui.css"/>
<link rel="stylesheet" type="text/css" href="../../css/iconfont/iconfont.css"/>
<style type="text/css">
button {
background: #e7511a;
border: 1px solid #e7511a;
}
button:active {
background: #f6d8cd;
border-color: #f6d8cd;
}
::-webkit-input-placeholder {
color:#c7c7cd;
}
:-moz-placeholder {
color:#c7c7cd;
}
::-moz-placeholder {
color:#c7c7cd;
}
:-ms-input-placeholder {
color:#c7c7cd;
}
</style>
</head>
<body>
<div class="H-text-align-center H-padding-vertical-both-25 H-font-size-14" style="color: #4a4a4a">設(shè)置密碼后,你可以通過手機(jī)號(hào)和密碼登錄糖水</div>
<div style="padding: 20px 40px;">
<div class="H-flexbox-horizontal" style="border: 1px solid #efeff4;">
<input id="password" type="password" maxlength="11" class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-16 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-8" placeholder="請(qǐng)輸入密碼(6-20位字符)">
</div>
<button tapmode="" onclick="OpenWin('add_friends_head','./add_friends_head.html')" class="H-button H-margin-vertical-top-20 H-width-100-percent H-font-size-15 H-outline-none H-padding-vertical-both-8 H-padding-horizontal-both-20 H-theme-font-color-white">
完成
</button>
</div>
<script src="../../script/api.js" type="text/javascript"></script>
<script src="../../script/common.js" type="text/javascript"></script>
</body>
</html>
html/user/agreement_head.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>app開發(fā)筆記</title>
<link rel="stylesheet" type="text/css" href="../../css/Hui.css"/>
<link rel="stylesheet" type="text/css" href="../../css/iconfont/iconfont.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
</head>
<body>
<header class="H-header" id="header" style="background-color: #fafafa">
<span onclick="CloseWin()" tapmode="" class="H-icon H-position-relative H-display-inline-block H-float-left H-vertical-middle H-padding-horizontal-left-5 H-z-index-100">
<i class="iconfont icon-arrow-left H-font-size-20 H-vertical-middle"></i>
</span>
<div class="H-header-title H-center-all H-font-size-14 H-text-show-row-1 H-position-absolute H-width-100-percent"
style="color: #4a4a4a">用戶協(xié)議
</div>
</header>
<script src="../../script/api.js" type="text/javascript"></script>
<script src="../../script/common.js" type="text/javascript"></script>
<script type="text/javascript">
apiready = function() {
$api.fixStatusBar($api.byId('header'));
api.openFrame({
name: 'agreement_body',
url: './agreement_body.html',
rect: {
x: 0,
y: $api.byId('header').offsetHeight,
w: api.winWidth,
h: api.frameHeight - $api.byId('header').offsetHeight
}
});
};
</script>
</body>
</html>
html/user/agreement_body.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>app開發(fā)筆記</title>
<link rel="stylesheet" type="text/css" href="../../css/Hui.css"/>
</head>
<body>
用戶協(xié)議
</body>
</html>