# 歡迎頁
目錄結構
```
├─html
│ ├─welcome
│ │ ├─welcome_frame_1.html 歡迎頁面1
│ │ ├─welcome_frame_2.html 歡迎頁面2
│ │ ├─welcome_frame_3.html 歡迎頁面3
│ │ ├─welcome_frame_4.html 歡迎頁面4
├─image
│ ├─welcome
│ │ ├─1.png 歡迎圖片1
│ │ ├─2.png 歡迎圖片2
│ │ ├─3.png 歡迎圖片3
│ │ ├─4.png 歡迎圖片4
│ │ ├─arrow.png 跳過箭頭圖片
├─welcome.html
```
* * * * *
模塊下載:http://pan.baidu.com/s/1nvnPWk5 密碼:hm0k
視頻教程:http://pan.baidu.com/s/1slrL4rb 密碼:4swi
* * * * *

* * * * *
代碼如下:
### welcome.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"/>
<title>title</title>
<link rel="stylesheet" type="text/css" href="./css/api.css"/>
<style>
body {
}
</style>
</head>
<body></body>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript">
apiready = function() {
var welcomeShowed = $api.getStorage('welcomeShowed');
if (welcomeShowed) {
//如果已經有存儲,打開main
api.openWin({
name : 'main',
url : 'html/main.html'
});
} else {
//如果沒有存儲,打開歡迎引導頁
api.openFrameGroup({
name : 'welcomeFrames',
scrollEnabled : true,
rect : {
x : 0,
y : 0,
w : 'auto',
h : 'auto'
},
index : 0,
frames : [{
name : 'welcome_frame_1',
url : 'html/welcome/welcome_frame_1.html',
bgColor: './image/welcome/1.png',
bounces: false,
vScrollBarEnabled: false,
hScrollBarEnabled: false
}, {
name : 'welcome_frame_2',
url : 'html/welcome/welcome_frame_2.html',
bgColor: './image/welcome/2.png',
bounces: false,
vScrollBarEnabled: false,
hScrollBarEnabled: false
}, {
name : 'welcome_frame_3',
url : 'html/welcome/welcome_frame_3.html',
bgColor: './image/welcome/3.png',
bounces: false,
vScrollBarEnabled: false,
hScrollBarEnabled: false
}, {
name : 'welcome_frame_4',
url : 'html/welcome/welcome_frame_4.html',
bgColor: './image/welcome/4.png',
bounces: false,
vScrollBarEnabled: false,
hScrollBarEnabled: false
}]
}, function(ret, err) {
var index = ret.index;
var name = ret.name;
});
//引導頁完成后,建立存儲
$api.setStorage('welcomeShowed',1);
}
};
</script>
</html>
```
### welcome_frame_1.html \ welcome_frame_2.html \ welcome_frame_3.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"/>
<title>title</title>
<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
<style>
html,body {
height: 100%; background: transparent;}
header {
height: 50px;
position: relative;
}
.skip {
position: absolute; bottom: 0px; right: 15px;
width: 90px; height: 38px; line-height: 38px;
border: solid rgb(211,211,211) 1px;
border-radius: 38px;
color: #000; font-size: 16px;
}
.skip>span {
padding-left:20px;
}
.skip>img {
padding-top: 12px; vertical-align: top;
height: 13px;
}
</style>
</head>
<body>
<header>
<div class="skip" tapmode onclick="fnSkip();">
<span>跳過</span>
<img src="../../image/welcome/arrow.png" />
</div>
</header>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript">
function fnSkip () {
api.setFrameGroupAttr({
name: 'welcomeFrames',
hidden: true
});
api.openWin({
name: 'main',
url: '../main.html',
bounces: false,
pageParam: {key : ''},
animation: {
type: 'none'
}
});
}
apiready = function(){
var header = $api.dom('header');
$api.fixIos7Bar(header);
};
</script>
</html>
```
### welcome_frame_4.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"/>
<title>title</title>
<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
<style>
html,body {
height: 100%; background: transparent;
}
.start {
position: absolute; left: 50%; bottom: 44px;
width: 124px; height: 44px;
background-color: rgb(230,92,53);
border: solid rgb(229,84,40) 1px;
border-radius: 6px;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
line-height: 44px;
color: #fff; font-size: 16px; text-align: center;
}
</style>
</head>
<body>
<div class="start" tapmode onclick="fnStart();">立即啟動</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript">
function fnStart () {
api.setFrameGroupAttr({
name: 'welcomeFrames',
hidden: true
});
api.openWin({
name: 'main',
url: '../main.html',
bounces: false,
pageParam: {key : ''},
animation: {
type: 'none'
}
});
}
apiready = function(){
var header = $api.dom('header');
$api.fixIos7Bar(header);
};
</script>
</html>
```
- APP模塊
- 歡迎頁
- 頭部模塊
- 底部模塊
- 圖文列表
- 商品展示
- 文字列表
- 內容頁一
- 評論頁
- N宮格
- 獲得上一級的欄目名稱
- 搜索模塊
- 圖標
- 幻燈模塊
- 消息頁
- 個人中心
- 個人中心—我的收藏
- 個人中心—資料修改
- 個人中心—我的錢包(賬戶)
- 咨詢頁面
- APP模板
- 注冊 頁面一
- 注冊 頁面二
- 登錄 頁面一
- 登錄 頁面二
- 忘記密碼 頁面一
- 會員中心 首頁一
- 會員中心 首頁二
- 會員中心 首頁三
- 會員中心 資料修改
- 申請審核步驟
- 商品訂單一
- 游戲頁面
- 新聞列表頁
- 圖文列表頁
- 商品列表頁
- 商品詳情頁
- 聊天
- 消息列表
- 聊天界面
- 發布需求
- 前端框架
- CSS Framework
- trim 字符處理
- dom 選擇器
- 樣式
- evt 事件
- 選擇元素
- 屬性
- 文本
- 位置
- json
- 設置
- 提示
- AJAX
- storage 本地存儲
- API對象
- 常用函數
- openWin()
- closeWin()
- apiready
- fixStatusBar(header)
- api.setRefreshHeaderInfo
- api.openFrame
- randomSwitchBtn(index,name)
- APP常用圖片
- asd