Authored by 陶雨

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

... ... @@ -66,6 +66,7 @@ var Bll = {
a.brandIco = common.util.__joinImg("brandLogo", a.brand_ico)
Brands2.push(a);
}else{
item.brandIco=common.util.__template(item.brandIco,{width:110,height:150});
Brands2.push(item);
}
... ... @@ -135,10 +136,14 @@ Bll.__render("#panel-body","tempalte1",ViewModel);
Bll.Brdata=ViewModel.brandList||[];
Bll.renderBrandPic(Bll.Brdata);
/*渲染标签*/
Bll.Tags=(ViewModel.tag||"").split(',');
Bll.Tags=ViewModel.tag?ViewModel.tag.split(','):[];
Bll.__render("#taglist","template4",{tags:Bll.Tags});
/*内容渲染->对象转数组*/
// Bll.contentDatas=ENUM.contentData;
// Bll.contentDatas=ENUM.articleContent;
ViewModel.contentData.forEach(function(item,index){
item.contentData=common.util.__ObjToArray(JSON.parse(item.contentData));
Bll.contentDatas.push(item);
});
new common.dropDown({
... ... @@ -308,8 +313,9 @@ $("#content_btns").html(common.util.__template2($("#template_content_btns").html
$(document).on("click", ".add_btn", function() {
var item = Button[$(this).data("index")];
Bll.module = $.extend(true, {}, item);
Bll.toast(-1, Bll.module);
Bll.module={};
Bll.module.contentData = $.extend(true, {}, item);
Bll.toast(-1, Bll.module);
});
$(document).on("click", ".del", function() {
Bll.contentDatas.splice($(this).data("index"), 1);
... ... @@ -365,7 +371,7 @@ var goodsgird = new common.grid({
else {
item.images_url = "";
}
return "<img width=120 height=60 src='" + item.images_url + "'/>";
return "<img width=120 height=60 src='" + item.images_url + "?imageView/2/w/100/h/100'/>";
}
}, {
display: "产品名称",
... ... @@ -490,7 +496,9 @@ $(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);
option.data.tag = Bll.Tags.join(',');
... ... @@ -514,12 +522,3 @@ $(document).on("click", "#submit", function() {
/*交互部分*/
/*测试*/
var AAA={};
AAA=common.util.__buildobj("0.b",".",AAA,function(obj,name){
obj[name]="1";
});
AAA=common.util.__buildobj("1.b",".",AAA,function(obj,name){
obj[name]="1";
});
console.log(AAA);
\ No newline at end of file
... ...
... ... @@ -126,15 +126,11 @@ $(document).on("click", ".edit", function() {
/*第五步 绑定监听事件*/
$(document).on("change", ".observe", function() {
var $this = $(this);
var name = $this.data("field"),
index = $this.data("index");
var module = (index == undefined) ? Bll.module.contentData.data : Bll.module.contentData.data[index];
console.log(module);
common.util.__buildobj(name, '.', module, function(obj, name) {
var name = $this.data("field");
Bll.module.contentData.data=common.util.__buildobj(name, '.', Bll.module.contentData.data, function(obj, name) {
obj[name] = $this.val();
console.log(module);
});
});
}
$(document).on("click", '#multiLabelImage-addImage', function() {
Bll.module.contentData.data.image.push({
... ...
... ... @@ -12,22 +12,20 @@ var config = {
'development': {
redis: null,
apiKey: 'sd4H1ecAqlp',
//domain:'http://172.16.6.140:8088/platform', // Object
//domain: 'http://172.16.6.236:8088/platform',// 钱军
//domain:'http://172.16.6.140:8088/platform', // Object
//domain: 'http://172.16.6.236:8088/platform',// 钱军
// domain:'http://172.16.6.240:8088/platform',// 王书生
// domain:'http://192.168.102.216:8080/platform',
// domain: 'http://172.16.6.240:8088/platform',
// domain:'http://172.16.6.176:8088/platform',// 王书生
// domain: 'http://172.16.6.214:8088/platform',//陈超
//http://172.16.6.124:8088/platform/product/queryAllProductAttr
//domain: 'http://172.16.6.146:8088/platform', //玛丽
domain:'http://172.16.6.157:8080/yohobuy-platform-web',//葛超
//domain:'http://172.16.6.157:8080/yohobuy-platform-web',//葛超
domain: 'http://192.168.102.202:8088/platform',
//domain: 'http://172.16.6.239:8080', //孙杰翔
//domain:'http://172.16.6.189:8088/platform', //李健1
//domain:'http://192.168.102.216:8180/platform', //李健2
//domain: 'http://172.16.6.243:8088/platform', //谭玲
yohoSearch:'http://192.168.10.64:8080/yohosearch',
yohoSearch: 'http://192.168.102.208:8087/yohosearch',
loggers: {
api: {
level: 'verbose'
... ... @@ -47,7 +45,7 @@ var config = {
},
apiKey: 'sd4H1ecAqlp',
domain: 'http://192.168.102.202:8088/platform',
yohoSearch:'http://192.168.10.64:8080/yohosearch',
yohoSearch: 'http://192.168.102.208:8087/yohosearch',
logsFile: '/Data/logs/node/yohobuy-portal-log/',
loggers: {
api: {
... ... @@ -68,7 +66,7 @@ var config = {
},
apiKey: 'sd4H1ecAqlp',
domain: 'http://192.168.102.202:8081/platform',
yohoSearch:'http://192.168.10.64:8080/yohosearch',
yohoSearch: 'http://192.168.102.208:8087/yohosearch',
logsFile: '/Data/logs/node/yohobuy-portal-log/',
loggers: {
api: {
... ... @@ -89,7 +87,7 @@ var config = {
},
apiKey: 'sd4H1ecAqlp',
domain: 'http://192.168.81.6:8189/yoho-admin-portal',
yohoSearch:'http://182.92.99.119:8080/yohosearch',
yohoSearch: 'http://192.168.102.208:8087/yohosearch',
logsFile: '/Data/logs/node/yohobuy-portal-log/',
loggers: {
api: {
... ...
... ... @@ -4,8 +4,8 @@ var fs = require('fs');
var searchDomain = require('../../config/common.js').yohoSearch;
exports.brandlist = function (req, res) {
request.get("http://x.yohobuy.com/yohosearch/brand/list.json").pipe(res);
}
request.get(searchDomain+"/brand/list.json").pipe(res);
};
exports.search = function (req, res) {
var size = 10;//每页数据量
... ... @@ -14,8 +14,8 @@ exports.search = function (req, res) {
if (req.body.page) {
page = req.body.page;
}
var url = "http://x.yohobuy.com//yohosearch/search.json?viewNum=" + size + "&query=" + req.body.query + "&page=" + page+"&price="+price;
console.log(url);
var url = searchDomain+"/search.json?viewNum=" + size + "&query=" + req.body.query + "&page=" + page+"&price="+price;
console.log("请求url",url);
request({url: url}, function (error, response, body) {
var data = {};
data.list = [];
... ... @@ -36,7 +36,7 @@ exports.search = function (req, res) {
data.page = body.data.page;//页码
data.totalPage = body.data.page_total;
data.nums = data.list.length;//记录每一页数据量
console.log("最终data", data);
//console.log("最终data", data);
res.json({data: {data: data}});
});
};
... ...
... ... @@ -214,7 +214,7 @@
<li class="cover-image-item image-list" data-index="2">
<div class="goods-img">
<a class="fileinput-button-icon" href="javascript:void(0);">
<img src="[[brand.brandIco]]">
<img src="[[brand.brandIco]]?imageView/2/w/100/h/100">
</a>
<i class="remove-item-btn remove1 glyphicon glyphicon-remove-circle" data-index="[[index]]"></i>
</div>
... ... @@ -268,13 +268,13 @@
<div class="con">[[module.data.text]]</div>
[[else if module.template_name=='singleImage']]
<div class="list">
<img src="[[module.data[0].src]]" title="[[module.data[0].title]]">
<img src="[[module.data[0].src]]?imageView/2/w/100/h/100" title="[[module.data[0].title]]">
</div>
[[else if module.template_name=='smallPic']]
<div class="small-pic">
<ul class="small-pic-list">
[[each module.data as item i]]
<img src="[[item.src]]" title="[[item.title]]">
<img src="[[item.src]]?imageView/2/w/100/h/100" title="[[item.title]]">
[[/each]]
</ul>
</div>
... ... @@ -282,7 +282,7 @@
<div class="small-pic">
<ul class="small-pic-list">
[[each module.data as item i]]
<img src="[[item.src]]" title="[[item.id]]">
<img src="[[item.src]]?imageView/2/w/100/h/100" title="[[item.id]]">
[[/each]]
</ul>
</div>
... ... @@ -295,13 +295,13 @@
<div class="small-pic-list2">
[[each module.data as items i]]
<img src="[[items.cover.cover]]" >
<img src="[[items.cover.cover]]?imageView/2/w/100/h/100" >
[[/each]]
</div>
<div class="small-pic-list">
[[each module.data[0].list as item index]]
<img src="[[item.src]]" title="[[item.id]]">
<img src="[[item.src]]?imageView/2/w/100/h/100" title="[[item.id]]">
[[/each]]
</ul>
... ... @@ -360,7 +360,7 @@
<li class="cover-image-item image-list" data-index="2">
<div class="goods-img">
<a class="fileinput-button-icon" href="javascript:void(0);">
<img src="[[item.src]]">
<img src="[[item.src]]?imageView/2/w/100/h/100">
</a>
<i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i>
</div>
... ... @@ -383,7 +383,7 @@
<li class="cover-image-item image-list" data-index="2">
<div class="goods-img">
<a class="fileinput-button-icon" href="javascript:void(0);">
<img src="[[data.src]]">
<img src="[[data.src]]?imageView/2/w/100/h/100">
</a>
<i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i>
</div>
... ... @@ -428,7 +428,7 @@
<li class="cover-image-item image-list" data-index="2">
<div class="goods-img">
<a class="fileinput-button-icon" href="javascript:void(0);">
<img src="[[item.src]]">
<img src="[[item.src]]?imageView/2/w/100/h/100">
</a>
<i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i>
</div>
... ... @@ -461,7 +461,7 @@
<li class="cover-image-item image-list" data-index="2">
<div class="goods-img">
<a class="fileinput-button-icon" href="javascript:void(0);">
<img src="[[item.src]]">
<img src="[[item.src]]?imageView/2/w/100/h/100">
</a>
<i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i>
</div>
... ...