add search list

This commit is contained in:
lh_wang
2015-08-09 16:13:34 +08:00
parent 4f0e17eaff
commit 4fe66d415f
3 changed files with 49 additions and 17 deletions
+27 -6
View File
@@ -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();
});