add info module

This commit is contained in:
lh_wang
2015-08-07 14:49:02 +08:00
parent 5b7068b03a
commit 2899f69c5d
5 changed files with 111 additions and 114 deletions
+24 -23
View File
@@ -24,8 +24,8 @@
<file leaf-file-name="index.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/index.html">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-8.125">
<caret line="13" column="64" selection-start-line="13" selection-start-column="64" selection-end-line="13" selection-end-column="64" />
<state vertical-scroll-proportion="-18.5">
<caret line="104" column="37" selection-start-line="104" selection-start-column="37" selection-end-line="104" selection-end-column="37" />
<folding />
</state>
</provider>
@@ -34,8 +34,8 @@
<file leaf-file-name="info.js" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/js/home/info.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.8547718">
<caret line="77" column="0" selection-start-line="77" selection-start-column="0" selection-end-line="77" selection-end-column="0" />
<state vertical-scroll-proportion="0.62655604">
<caret line="75" column="0" selection-start-line="75" selection-start-column="0" selection-end-line="75" selection-end-column="0" />
<folding />
</state>
</provider>
@@ -47,9 +47,10 @@
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/js/home/tools.js" />
<option value="$PROJECT_DIR$/js/home/info.js" />
<option value="$PROJECT_DIR$/index.html" />
<option value="$PROJECT_DIR$/js/home/map.js" />
<option value="$PROJECT_DIR$/css/main.css" />
<option value="$PROJECT_DIR$/index.html" />
<option value="$PROJECT_DIR$/js/home/info.js" />
</list>
</option>
</component>
@@ -247,13 +248,13 @@
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="820" extended-state="6" />
<editor active="false" />
<editor active="true" />
<layout>
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.18888889" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.18888889" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
@@ -276,14 +277,6 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/js/home/map.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/home/tools.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.5809129">
@@ -300,26 +293,34 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/index.html">
<entry file="file://$PROJECT_DIR$/js/home/map.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-8.125">
<caret line="13" column="64" selection-start-line="13" selection-start-column="64" selection-end-line="13" selection-end-column="64" />
<state vertical-scroll-proportion="0.20746888">
<caret line="10" column="22" selection-start-line="10" selection-start-column="22" selection-end-line="10" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/css/main.css">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.31120333">
<caret line="70" column="4" selection-start-line="70" selection-start-column="4" selection-end-line="70" selection-end-column="4" />
<state vertical-scroll-proportion="0.42047027">
<caret line="201" column="11" selection-start-line="201" selection-start-column="11" selection-end-line="201" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/index.html">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-18.5">
<caret line="104" column="37" selection-start-line="104" selection-start-column="37" selection-end-line="104" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/home/info.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.8547718">
<caret line="77" column="0" selection-start-line="77" selection-start-column="0" selection-end-line="77" selection-end-column="0" />
<state vertical-scroll-proportion="0.62655604">
<caret line="75" column="0" selection-start-line="75" selection-start-column="0" selection-end-line="75" selection-end-column="0" />
<folding />
</state>
</provider>
+2 -1
View File
@@ -116,6 +116,7 @@ html body {
top: 60px;
width: 50px;
min-height: 50px;
z-index:10001;
}
.tools>div {
width: 40px;
@@ -198,7 +199,7 @@ html body {
.router{
position:absolute;
left:10px;
top:120px;
top:105px;
width:45px;
min-height:220px;
background-color:#fff;
+2 -2
View File
@@ -43,7 +43,7 @@
<input placeholder="请输入产品路线"/>
</div>
<button class="fl search_btn">
<i class="fa fa-microphone" style="font-size:20px;color:#FFFFFF;"></i>
<i class="fa fa-search" style="font-size:20px;color:#FFFFFF;"></i>
</button>
</div>
<!--描述:其他功能-->
@@ -102,7 +102,7 @@
<% for(var i = 0; i < list.length; i++) { %>
<div style="width:<%=width%>px; height:130px;float:left;">
<h1><%=i%></h1>
<h1>我们哈哈哈</h1>
<h1><%=list[i].name%></h1>
</div>
<% } %>
</script>
+75 -80
View File
@@ -1,85 +1,80 @@
define('home/info', function (require, exports, module) {
var _ = require('lib/underscore');
var $ = require('lib/zepto_pj');
//渲染数据
var width = document.body.clientWidth;
var wrapper = $('.SN_info_wrapper');
var tpl = $('#tpl').html();
var data = {
width: width,
list: [
{
name: '苏州'
},
{
name: '上海'
},
{
name: '南京'
}
]
};
var html = _.template(tpl)(data);
wrapper.html(html);
//动画特效
var wholeLength = width * data.list.length;
wrapper.css('width', wholeLength);
//记录初始位置
var startX = 0;
wrapper.on('touchstart', function (e) {
startX = e.changedTouches[0].clientX;
});
wrapper.on('touchend', function (e) {
var dis = e.changedTouches[0].clientX - startX;
//获取当前translate3d的位置
var transform = wrapper.css('transform') || wrapper.css('-webkit-transform');
var currentPos = parseInt(transform.split(',')[0].split('(')[1]);
//移动
if (Math.abs(dis) > 20) {
//左移
if (dis < -20) {
var w = 0;
var handle = setInterval(function () {
if (w <= width && Math.abs(currentPos) < (wholeLength - width - 10)) {
var newX = (currentPos - w);
wrapper.css('transform', 'translate3d(' + newX + 'px, 0px, 0px)');
wrapper.css('-webkit-transform', 'translate3d(' + newX + 'px, 0px, 0px)');
} else {
clearInterval(handle);
}
w += 80;
}, 70);
}
//右移
if (dis > 20) {
var w = 0;
var handle = setInterval(function () {
if (w <= width && Math.abs(currentPos) > 10) {
var newX = (currentPos + w);
wrapper.css('transform', 'translate3d(' + newX + 'px, 0px, 0px)');
wrapper.css('-webkit-transform', 'translate3d(' + newX + 'px, 0px, 0px)');
} else {
clearInterval(handle);
}
w += 80;
}, 70);
}
}
});
define('home/info', function(require, exports, module){
var _ = require('lib/underscore');
var $ = require('lib/zepto_pj');
//渲染数据
var width = document.body.clientWidth;
var wrapper = $('.SN_info_wrapper');
var tpl = $('#tpl').html();
var data = {
width: width,
list:[
{
name: 'ss'
},
{
name: 'ss'
},
{
name: 'ss'
}
]
};
var html = _.template(tpl)(data);
wrapper.html(html);
//动画特效
var wholeLength = width * data.list.length;
wrapper.css('width', wholeLength);
//记录初始位置
var startX = 0;
wrapper.on('touchstart', function(e){
startX = e.changedTouches[0].clientX;
});
wrapper.on('touchend', function(e){
var dis = e.changedTouches[0].clientX - startX;
//获取当前translate3d的位置
var transform = wrapper.css('transform') || wrapper.css('-webkit-transform');
var currentPos = parseInt(transform.split(',')[0].split('(')[1]);
//移动
if(Math.abs(dis) > 30){
//左移
if(dis < -30){
var w = 0;
var handle = setInterval(function(){
if(w <= width && Math.abs(currentPos) < (wholeLength - width - 10)){
var newX = (currentPos - w);
wrapper.css('transform', 'translate3d(' + newX + 'px, 0px, 0px)');
wrapper.css('-webkit-transform', 'translate3d(' + newX + 'px, 0px, 0px)');
}else{
clearInterval(handle);
}
w += 80;
}, 70);
}
//右移
if(dis > 30){
var w = 0;
var handle = setInterval(function(){
if(w <= width && Math.abs(currentPos) > 10){
var newX = (currentPos + w);
wrapper.css('transform', 'translate3d(' + newX + 'px, 0px, 0px)');
wrapper.css('-webkit-transform', 'translate3d(' + newX + 'px, 0px, 0px)');
}else{
clearInterval(handle);
}
w += 80;
}, 70);
}
}
});
});
+8 -8
View File
@@ -4,11 +4,11 @@ define('home/map', function(require, exports, module){
//获取路线数据
var router = require('common/data').router;
//初始化地图
var map = new AMap.Map('map', {
mapStyle: 'fresh',
resizeEnable: true,
//初始化地图
var map = new AMap.Map('map', {
mapStyle: 'fresh',
resizeEnable: true,
});
//途经点
@@ -25,15 +25,15 @@ define('home/map', function(require, exports, module){
//
var contents = [];
return {
return {
map: map,
wayPointer: wayPoints,
origin: origin,
destination: destination,
routes: routes,
hasRoutes: hasRoutes,
contents: contents
contents: contents
}
});