From 4fe66d415f2855054535e2451960a764b4f9a8e0 Mon Sep 17 00:00:00 2001 From: lh_wang Date: Sun, 9 Aug 2015 16:13:34 +0800 Subject: [PATCH] add search list --- meitu/css/main.css | 13 ++++++------- meitu/index.html | 20 ++++++++++++++++---- meitu/js/home/search.js | 33 +++++++++++++++++++++++++++------ 3 files changed, 49 insertions(+), 17 deletions(-) diff --git a/meitu/css/main.css b/meitu/css/main.css index cd6a3d2..98d8e08 100644 --- a/meitu/css/main.css +++ b/meitu/css/main.css @@ -398,15 +398,14 @@ html body { /*--------------------搜索自动补全---------------------------*/ .auto_complete{ position:absolute; - top:45px; - left:40px; - right:55px; - /*height:100px;*/ + top:50px; + left:0px; + right:0px; + min-height:110px; background-color:#fff; z-index:10091; - /*opacity:0.9; - -webkit-opacity:0.9; - -moz-opacity: 0.9;*/ + border-top:1px solid #ccc; + display:none; } diff --git a/meitu/index.html b/meitu/index.html index 39c52ee..1c64808 100644 --- a/meitu/index.html +++ b/meitu/index.html @@ -31,7 +31,6 @@ - @@ -49,9 +48,22 @@ -
- -
+ + + +
diff --git a/meitu/js/home/search.js b/meitu/js/home/search.js index c96289c..909b605 100644 --- a/meitu/js/home/search.js +++ b/meitu/js/home/search.js @@ -2,16 +2,37 @@ define('home/search', function(require, exports, module){ var $ = require('lib/zepto_pj'); var input = $('#search_input_text'); - var router = [ - '上海 到 扬州 两日游', - '上海 到 常州 一日游', - '上海 到 衢州 一日游' - ]; + var tpl = $('#tpl_search').html(); + var container = $('#SEARCH_TPL'); + var data = { + items:[ + { + router: '上海到扬州', + desc: '两日游' + }, + { + router: '上海到常州', + desc: '一日游' + }, + { + router: '上海到衢州', + desc: '两日游' + }, + { + router: '郑州到青岛', + desc: '三日游' + } + ] + }; + + //focus事件 input.on('focus', function(){ - + var html = _.template(tpl)(data); + container.html(html); + container.fadeIn(); });