Authored by weiqingting

Merge branch 'develop' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into develop

# Conflicts:
#	server/stub/service/yohosearch.js
... ... @@ -87,7 +87,8 @@ var Bll={
},
__render:function(selecter,templater,data){
$(selecter).html(common.util.__template2($("#"+templater).html(),data) );
}
},
Tags:[]
}
//获取品牌
Bll.getBrands();
... ... @@ -121,12 +122,14 @@ $(document).on("click","#addUrl",function(){
$(document).on("click","#TagsSelectBtn",function(){
common.dialog.confirm("选择标签","<div id='gird'></div>",function(){
$("#taglist").html(common.util.__template2($("#template4").html(),{tags:g.selected}));
});
g.init('/guang/tags/getList');
});
$(document).on("click",".tag a",function(){
g.selected.splice($(this).data("index"),1);
$("#taglist").html(common.util.__template2($("#template4").html(),{tags:g.selected}));
return false;
});
... ... @@ -372,6 +375,10 @@ $(document).on("click","#submit",function(){
console.log("Bll.contentDatas",Bll.Brdata);
option.data.contentData=JSON.stringify(option.data.contentData);
option.data.brands=JSON.stringify(Bll.Brdata);
g.selected.forEach(function(item,index){
Bll.Tags.push(item.id);
});
option.data.tag=Bll.Tags.join(',');
console.log("submit",option.data);
});
... ...
... ... @@ -11,11 +11,28 @@ exports.search=function(req,res){
var url="http://192.168.102.208:8087/yohosearch/search.json?viewNum=15&query=51022754,51178582";
request({url: url}, function (error, response, body) {
var data={};
data.list=[];
body=JSON.parse(body);
data.list=body.data.product_list;
data.totalPage=body.data.total;
var dataList=body.data.product_list;
var goodslist=[];
var goodslist1=[];
for(var m=0;m<dataList.length;m++){
for(var n=0;n<dataList[m].goods_list.length;n++){
goodslist.push({a:dataList[m],b:dataList[m].goods_list[n]})
}
}
for(var i=0;i<goodslist.length;i++){
goodslist1[i]= _.assign({},goodslist[i].a,goodslist[i].b);
}
data.list=goodslist1.concat();
//data.list=body.data.product_list;
data.total=data.list.length;
data.page=body.data.page;
// console.log(data);
data.size=5;
var a = (/^[1-9]\d*$/).test(data.total/data.size);
data.totalPage=a?parseInt(data.total/data.size):parseInt(data.total/data.size)+1;
res.json({data:{data:data}});
});
}
\ No newline at end of file
};
... ...
... ... @@ -98,7 +98,7 @@
<div class="col-sm-8">
<input type="radio" value="1" name="coverImageType">
<label>方形</label>
<input type="radio" value="2" name="coverImageType" checked="">
<input type="radio" value="2" name="coverImageType">
<label>长形</label>
<input type="hidden" id="coverImageType" value="[[coverImageType]]" for="radio" />
</div>
... ...