123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- var M = {
- ver : 1,
- os : 5,
- channel : "web",
- domain : "http://ms-api.duowan.com",
- //获取搜索列表
- getSearchList : function(key){
- var url = M.domain+"/home/search.do";
- var data = {
- channel: M.channel,
- ver: M.ver,
- os: M.os,
- keyword : key
- };
- $.ajax({
- url: url,
- dataType: 'jsonp',
- data: data,
- success: function(ret){
- ret.data.role = "all";
- V.renderGameList(ret.data,key);
- },
- error: function(ret){
- M.getSearchList();
- }
- });
- }
- }
- var V = {
- init : function(){
- commonUtil.initHezi();
- M.os = commonUtil.checkPlatform();
- M.getSearchList(commonUtil.getParam("key"));
- },
- renderGameList : function(data,key){
- var bannerTpl = __inline('../../tpl/simulatorGameList.tmpl');
- var dom = bannerTpl({
- data : data
- });
- key = key?key:"";
- $("#gameWrap").html(dom);
- $("#searchKey").html("搜索 “<span>"+key+"</span>” 结果");
- $("[name=key]").val(key);
- var PageTurn = new commonUtil.PageTurn({
- element : '[data-role='+data.role+']',
- showNum : 18
- });
- }
- }
- var C = {
- init : function(){
-
- }
- }
- V.init();
- C.init();
-
|