Merge branch 'develop' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into develop
Showing
5 changed files
with
39 additions
and
46 deletions
@@ -66,6 +66,7 @@ var Bll = { | @@ -66,6 +66,7 @@ var Bll = { | ||
66 | a.brandIco = common.util.__joinImg("brandLogo", a.brand_ico) | 66 | a.brandIco = common.util.__joinImg("brandLogo", a.brand_ico) |
67 | Brands2.push(a); | 67 | Brands2.push(a); |
68 | }else{ | 68 | }else{ |
69 | + item.brandIco=common.util.__template(item.brandIco,{width:110,height:150}); | ||
69 | Brands2.push(item); | 70 | Brands2.push(item); |
70 | } | 71 | } |
71 | 72 | ||
@@ -135,10 +136,14 @@ Bll.__render("#panel-body","tempalte1",ViewModel); | @@ -135,10 +136,14 @@ Bll.__render("#panel-body","tempalte1",ViewModel); | ||
135 | Bll.Brdata=ViewModel.brandList||[]; | 136 | Bll.Brdata=ViewModel.brandList||[]; |
136 | Bll.renderBrandPic(Bll.Brdata); | 137 | Bll.renderBrandPic(Bll.Brdata); |
137 | /*渲染标签*/ | 138 | /*渲染标签*/ |
138 | -Bll.Tags=(ViewModel.tag||"").split(','); | 139 | +Bll.Tags=ViewModel.tag?ViewModel.tag.split(','):[]; |
139 | Bll.__render("#taglist","template4",{tags:Bll.Tags}); | 140 | Bll.__render("#taglist","template4",{tags:Bll.Tags}); |
140 | /*内容渲染->对象转数组*/ | 141 | /*内容渲染->对象转数组*/ |
141 | -// Bll.contentDatas=ENUM.contentData; | 142 | +// Bll.contentDatas=ENUM.articleContent; |
143 | +ViewModel.contentData.forEach(function(item,index){ | ||
144 | + item.contentData=common.util.__ObjToArray(JSON.parse(item.contentData)); | ||
145 | + Bll.contentDatas.push(item); | ||
146 | +}); | ||
142 | 147 | ||
143 | 148 | ||
144 | new common.dropDown({ | 149 | new common.dropDown({ |
@@ -308,8 +313,9 @@ $("#content_btns").html(common.util.__template2($("#template_content_btns").html | @@ -308,8 +313,9 @@ $("#content_btns").html(common.util.__template2($("#template_content_btns").html | ||
308 | 313 | ||
309 | $(document).on("click", ".add_btn", function() { | 314 | $(document).on("click", ".add_btn", function() { |
310 | var item = Button[$(this).data("index")]; | 315 | var item = Button[$(this).data("index")]; |
311 | - Bll.module = $.extend(true, {}, item); | ||
312 | - Bll.toast(-1, Bll.module); | 316 | + Bll.module={}; |
317 | + Bll.module.contentData = $.extend(true, {}, item); | ||
318 | + Bll.toast(-1, Bll.module); | ||
313 | }); | 319 | }); |
314 | $(document).on("click", ".del", function() { | 320 | $(document).on("click", ".del", function() { |
315 | Bll.contentDatas.splice($(this).data("index"), 1); | 321 | Bll.contentDatas.splice($(this).data("index"), 1); |
@@ -365,7 +371,7 @@ var goodsgird = new common.grid({ | @@ -365,7 +371,7 @@ var goodsgird = new common.grid({ | ||
365 | else { | 371 | else { |
366 | item.images_url = ""; | 372 | item.images_url = ""; |
367 | } | 373 | } |
368 | - return "<img width=120 height=60 src='" + item.images_url + "'/>"; | 374 | + return "<img width=120 height=60 src='" + item.images_url + "?imageView/2/w/100/h/100'/>"; |
369 | } | 375 | } |
370 | }, { | 376 | }, { |
371 | display: "产品名称", | 377 | display: "产品名称", |
@@ -490,7 +496,9 @@ $(document).on("click", "#submit", function() { | @@ -490,7 +496,9 @@ $(document).on("click", "#submit", function() { | ||
490 | }); | 496 | }); |
491 | 497 | ||
492 | }); | 498 | }); |
499 | + | ||
493 | console.log("Bll.contentDatas", Bll.Brdata); | 500 | console.log("Bll.contentDatas", Bll.Brdata); |
501 | + | ||
494 | option.data.contentData = JSON.stringify(option.data.contentData); | 502 | option.data.contentData = JSON.stringify(option.data.contentData); |
495 | option.data.brands = JSON.stringify(Bll.Brdata); | 503 | option.data.brands = JSON.stringify(Bll.Brdata); |
496 | option.data.tag = Bll.Tags.join(','); | 504 | option.data.tag = Bll.Tags.join(','); |
@@ -514,12 +522,3 @@ $(document).on("click", "#submit", function() { | @@ -514,12 +522,3 @@ $(document).on("click", "#submit", function() { | ||
514 | /*交互部分*/ | 522 | /*交互部分*/ |
515 | 523 | ||
516 | 524 | ||
517 | -/*测试*/ | ||
518 | -var AAA={}; | ||
519 | -AAA=common.util.__buildobj("0.b",".",AAA,function(obj,name){ | ||
520 | - obj[name]="1"; | ||
521 | -}); | ||
522 | -AAA=common.util.__buildobj("1.b",".",AAA,function(obj,name){ | ||
523 | - obj[name]="1"; | ||
524 | -}); | ||
525 | -console.log(AAA); |
@@ -126,15 +126,11 @@ $(document).on("click", ".edit", function() { | @@ -126,15 +126,11 @@ $(document).on("click", ".edit", function() { | ||
126 | /*第五步 绑定监听事件*/ | 126 | /*第五步 绑定监听事件*/ |
127 | $(document).on("change", ".observe", function() { | 127 | $(document).on("change", ".observe", function() { |
128 | var $this = $(this); | 128 | var $this = $(this); |
129 | - var name = $this.data("field"), | ||
130 | - index = $this.data("index"); | ||
131 | - var module = (index == undefined) ? Bll.module.contentData.data : Bll.module.contentData.data[index]; | ||
132 | - console.log(module); | ||
133 | - common.util.__buildobj(name, '.', module, function(obj, name) { | 129 | + var name = $this.data("field"); |
130 | + Bll.module.contentData.data=common.util.__buildobj(name, '.', Bll.module.contentData.data, function(obj, name) { | ||
134 | obj[name] = $this.val(); | 131 | obj[name] = $this.val(); |
135 | - console.log(module); | ||
136 | }); | 132 | }); |
137 | -}); | 133 | +} |
138 | 134 | ||
139 | $(document).on("click", '#multiLabelImage-addImage', function() { | 135 | $(document).on("click", '#multiLabelImage-addImage', function() { |
140 | Bll.module.contentData.data.image.push({ | 136 | Bll.module.contentData.data.image.push({ |
@@ -12,22 +12,20 @@ var config = { | @@ -12,22 +12,20 @@ var config = { | ||
12 | 'development': { | 12 | 'development': { |
13 | redis: null, | 13 | redis: null, |
14 | apiKey: 'sd4H1ecAqlp', | 14 | apiKey: 'sd4H1ecAqlp', |
15 | - | ||
16 | - //domain:'http://172.16.6.140:8088/platform', // Object | ||
17 | - //domain: 'http://172.16.6.236:8088/platform',// 钱军 | 15 | + //domain:'http://172.16.6.140:8088/platform', // Object |
16 | + //domain: 'http://172.16.6.236:8088/platform',// 钱军 | ||
18 | // domain:'http://172.16.6.240:8088/platform',// 王书生 | 17 | // domain:'http://172.16.6.240:8088/platform',// 王书生 |
19 | - // domain:'http://192.168.102.216:8080/platform', | ||
20 | - // domain: 'http://172.16.6.240:8088/platform', | ||
21 | // domain:'http://172.16.6.176:8088/platform',// 王书生 | 18 | // domain:'http://172.16.6.176:8088/platform',// 王书生 |
22 | // domain: 'http://172.16.6.214:8088/platform',//陈超 | 19 | // domain: 'http://172.16.6.214:8088/platform',//陈超 |
23 | //http://172.16.6.124:8088/platform/product/queryAllProductAttr | 20 | //http://172.16.6.124:8088/platform/product/queryAllProductAttr |
24 | //domain: 'http://172.16.6.146:8088/platform', //玛丽 | 21 | //domain: 'http://172.16.6.146:8088/platform', //玛丽 |
25 | - domain:'http://172.16.6.157:8080/yohobuy-platform-web',//葛超 | 22 | + //domain:'http://172.16.6.157:8080/yohobuy-platform-web',//葛超 |
23 | + domain: 'http://192.168.102.202:8088/platform', | ||
26 | //domain: 'http://172.16.6.239:8080', //孙杰翔 | 24 | //domain: 'http://172.16.6.239:8080', //孙杰翔 |
27 | //domain:'http://172.16.6.189:8088/platform', //李健1 | 25 | //domain:'http://172.16.6.189:8088/platform', //李健1 |
28 | //domain:'http://192.168.102.216:8180/platform', //李健2 | 26 | //domain:'http://192.168.102.216:8180/platform', //李健2 |
29 | //domain: 'http://172.16.6.243:8088/platform', //谭玲 | 27 | //domain: 'http://172.16.6.243:8088/platform', //谭玲 |
30 | - yohoSearch:'http://192.168.10.64:8080/yohosearch', | 28 | + yohoSearch: 'http://192.168.102.208:8087/yohosearch', |
31 | loggers: { | 29 | loggers: { |
32 | api: { | 30 | api: { |
33 | level: 'verbose' | 31 | level: 'verbose' |
@@ -47,7 +45,7 @@ var config = { | @@ -47,7 +45,7 @@ var config = { | ||
47 | }, | 45 | }, |
48 | apiKey: 'sd4H1ecAqlp', | 46 | apiKey: 'sd4H1ecAqlp', |
49 | domain: 'http://192.168.102.202:8088/platform', | 47 | domain: 'http://192.168.102.202:8088/platform', |
50 | - yohoSearch:'http://192.168.10.64:8080/yohosearch', | 48 | + yohoSearch: 'http://192.168.102.208:8087/yohosearch', |
51 | logsFile: '/Data/logs/node/yohobuy-portal-log/', | 49 | logsFile: '/Data/logs/node/yohobuy-portal-log/', |
52 | loggers: { | 50 | loggers: { |
53 | api: { | 51 | api: { |
@@ -68,7 +66,7 @@ var config = { | @@ -68,7 +66,7 @@ var config = { | ||
68 | }, | 66 | }, |
69 | apiKey: 'sd4H1ecAqlp', | 67 | apiKey: 'sd4H1ecAqlp', |
70 | domain: 'http://192.168.102.202:8081/platform', | 68 | domain: 'http://192.168.102.202:8081/platform', |
71 | - yohoSearch:'http://192.168.10.64:8080/yohosearch', | 69 | + yohoSearch: 'http://192.168.102.208:8087/yohosearch', |
72 | logsFile: '/Data/logs/node/yohobuy-portal-log/', | 70 | logsFile: '/Data/logs/node/yohobuy-portal-log/', |
73 | loggers: { | 71 | loggers: { |
74 | api: { | 72 | api: { |
@@ -89,7 +87,7 @@ var config = { | @@ -89,7 +87,7 @@ var config = { | ||
89 | }, | 87 | }, |
90 | apiKey: 'sd4H1ecAqlp', | 88 | apiKey: 'sd4H1ecAqlp', |
91 | domain: 'http://192.168.81.6:8189/yoho-admin-portal', | 89 | domain: 'http://192.168.81.6:8189/yoho-admin-portal', |
92 | - yohoSearch:'http://182.92.99.119:8080/yohosearch', | 90 | + yohoSearch: 'http://192.168.102.208:8087/yohosearch', |
93 | logsFile: '/Data/logs/node/yohobuy-portal-log/', | 91 | logsFile: '/Data/logs/node/yohobuy-portal-log/', |
94 | loggers: { | 92 | loggers: { |
95 | api: { | 93 | api: { |
@@ -4,8 +4,8 @@ var fs = require('fs'); | @@ -4,8 +4,8 @@ var fs = require('fs'); | ||
4 | var searchDomain = require('../../config/common.js').yohoSearch; | 4 | var searchDomain = require('../../config/common.js').yohoSearch; |
5 | 5 | ||
6 | exports.brandlist = function (req, res) { | 6 | exports.brandlist = function (req, res) { |
7 | - request.get("http://x.yohobuy.com/yohosearch/brand/list.json").pipe(res); | ||
8 | -} | 7 | + request.get(searchDomain+"/brand/list.json").pipe(res); |
8 | +}; | ||
9 | 9 | ||
10 | exports.search = function (req, res) { | 10 | exports.search = function (req, res) { |
11 | var size = 10;//每页数据量 | 11 | var size = 10;//每页数据量 |
@@ -14,8 +14,8 @@ exports.search = function (req, res) { | @@ -14,8 +14,8 @@ exports.search = function (req, res) { | ||
14 | if (req.body.page) { | 14 | if (req.body.page) { |
15 | page = req.body.page; | 15 | page = req.body.page; |
16 | } | 16 | } |
17 | - var url = "http://x.yohobuy.com//yohosearch/search.json?viewNum=" + size + "&query=" + req.body.query + "&page=" + page+"&price="+price; | ||
18 | - console.log(url); | 17 | + var url = searchDomain+"/search.json?viewNum=" + size + "&query=" + req.body.query + "&page=" + page+"&price="+price; |
18 | + console.log("请求url",url); | ||
19 | request({url: url}, function (error, response, body) { | 19 | request({url: url}, function (error, response, body) { |
20 | var data = {}; | 20 | var data = {}; |
21 | data.list = []; | 21 | data.list = []; |
@@ -36,7 +36,7 @@ exports.search = function (req, res) { | @@ -36,7 +36,7 @@ exports.search = function (req, res) { | ||
36 | data.page = body.data.page;//页码 | 36 | data.page = body.data.page;//页码 |
37 | data.totalPage = body.data.page_total; | 37 | data.totalPage = body.data.page_total; |
38 | data.nums = data.list.length;//记录每一页数据量 | 38 | data.nums = data.list.length;//记录每一页数据量 |
39 | - console.log("最终data", data); | 39 | + //console.log("最终data", data); |
40 | res.json({data: {data: data}}); | 40 | res.json({data: {data: data}}); |
41 | }); | 41 | }); |
42 | }; | 42 | }; |
@@ -214,7 +214,7 @@ | @@ -214,7 +214,7 @@ | ||
214 | <li class="cover-image-item image-list" data-index="2"> | 214 | <li class="cover-image-item image-list" data-index="2"> |
215 | <div class="goods-img"> | 215 | <div class="goods-img"> |
216 | <a class="fileinput-button-icon" href="javascript:void(0);"> | 216 | <a class="fileinput-button-icon" href="javascript:void(0);"> |
217 | - <img src="[[brand.brandIco]]"> | 217 | + <img src="[[brand.brandIco]]?imageView/2/w/100/h/100"> |
218 | </a> | 218 | </a> |
219 | <i class="remove-item-btn remove1 glyphicon glyphicon-remove-circle" data-index="[[index]]"></i> | 219 | <i class="remove-item-btn remove1 glyphicon glyphicon-remove-circle" data-index="[[index]]"></i> |
220 | </div> | 220 | </div> |
@@ -268,13 +268,13 @@ | @@ -268,13 +268,13 @@ | ||
268 | <div class="con">[[module.data.text]]</div> | 268 | <div class="con">[[module.data.text]]</div> |
269 | [[else if module.template_name=='singleImage']] | 269 | [[else if module.template_name=='singleImage']] |
270 | <div class="list"> | 270 | <div class="list"> |
271 | - <img src="[[module.data[0].src]]" title="[[module.data[0].title]]"> | 271 | + <img src="[[module.data[0].src]]?imageView/2/w/100/h/100" title="[[module.data[0].title]]"> |
272 | </div> | 272 | </div> |
273 | [[else if module.template_name=='smallPic']] | 273 | [[else if module.template_name=='smallPic']] |
274 | <div class="small-pic"> | 274 | <div class="small-pic"> |
275 | <ul class="small-pic-list"> | 275 | <ul class="small-pic-list"> |
276 | [[each module.data as item i]] | 276 | [[each module.data as item i]] |
277 | - <img src="[[item.src]]" title="[[item.title]]"> | 277 | + <img src="[[item.src]]?imageView/2/w/100/h/100" title="[[item.title]]"> |
278 | [[/each]] | 278 | [[/each]] |
279 | </ul> | 279 | </ul> |
280 | </div> | 280 | </div> |
@@ -282,7 +282,7 @@ | @@ -282,7 +282,7 @@ | ||
282 | <div class="small-pic"> | 282 | <div class="small-pic"> |
283 | <ul class="small-pic-list"> | 283 | <ul class="small-pic-list"> |
284 | [[each module.data as item i]] | 284 | [[each module.data as item i]] |
285 | - <img src="[[item.src]]" title="[[item.id]]"> | 285 | + <img src="[[item.src]]?imageView/2/w/100/h/100" title="[[item.id]]"> |
286 | [[/each]] | 286 | [[/each]] |
287 | </ul> | 287 | </ul> |
288 | </div> | 288 | </div> |
@@ -295,13 +295,13 @@ | @@ -295,13 +295,13 @@ | ||
295 | 295 | ||
296 | <div class="small-pic-list2"> | 296 | <div class="small-pic-list2"> |
297 | [[each module.data as items i]] | 297 | [[each module.data as items i]] |
298 | - <img src="[[items.cover.cover]]" > | 298 | + <img src="[[items.cover.cover]]?imageView/2/w/100/h/100" > |
299 | [[/each]] | 299 | [[/each]] |
300 | </div> | 300 | </div> |
301 | <div class="small-pic-list"> | 301 | <div class="small-pic-list"> |
302 | 302 | ||
303 | [[each module.data[0].list as item index]] | 303 | [[each module.data[0].list as item index]] |
304 | - <img src="[[item.src]]" title="[[item.id]]"> | 304 | + <img src="[[item.src]]?imageView/2/w/100/h/100" title="[[item.id]]"> |
305 | [[/each]] | 305 | [[/each]] |
306 | 306 | ||
307 | </ul> | 307 | </ul> |
@@ -360,7 +360,7 @@ | @@ -360,7 +360,7 @@ | ||
360 | <li class="cover-image-item image-list" data-index="2"> | 360 | <li class="cover-image-item image-list" data-index="2"> |
361 | <div class="goods-img"> | 361 | <div class="goods-img"> |
362 | <a class="fileinput-button-icon" href="javascript:void(0);"> | 362 | <a class="fileinput-button-icon" href="javascript:void(0);"> |
363 | - <img src="[[item.src]]"> | 363 | + <img src="[[item.src]]?imageView/2/w/100/h/100"> |
364 | </a> | 364 | </a> |
365 | <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i> | 365 | <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i> |
366 | </div> | 366 | </div> |
@@ -383,7 +383,7 @@ | @@ -383,7 +383,7 @@ | ||
383 | <li class="cover-image-item image-list" data-index="2"> | 383 | <li class="cover-image-item image-list" data-index="2"> |
384 | <div class="goods-img"> | 384 | <div class="goods-img"> |
385 | <a class="fileinput-button-icon" href="javascript:void(0);"> | 385 | <a class="fileinput-button-icon" href="javascript:void(0);"> |
386 | - <img src="[[data.src]]"> | 386 | + <img src="[[data.src]]?imageView/2/w/100/h/100"> |
387 | </a> | 387 | </a> |
388 | <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i> | 388 | <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i> |
389 | </div> | 389 | </div> |
@@ -428,7 +428,7 @@ | @@ -428,7 +428,7 @@ | ||
428 | <li class="cover-image-item image-list" data-index="2"> | 428 | <li class="cover-image-item image-list" data-index="2"> |
429 | <div class="goods-img"> | 429 | <div class="goods-img"> |
430 | <a class="fileinput-button-icon" href="javascript:void(0);"> | 430 | <a class="fileinput-button-icon" href="javascript:void(0);"> |
431 | - <img src="[[item.src]]"> | 431 | + <img src="[[item.src]]?imageView/2/w/100/h/100"> |
432 | </a> | 432 | </a> |
433 | <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i> | 433 | <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i> |
434 | </div> | 434 | </div> |
@@ -461,7 +461,7 @@ | @@ -461,7 +461,7 @@ | ||
461 | <li class="cover-image-item image-list" data-index="2"> | 461 | <li class="cover-image-item image-list" data-index="2"> |
462 | <div class="goods-img"> | 462 | <div class="goods-img"> |
463 | <a class="fileinput-button-icon" href="javascript:void(0);"> | 463 | <a class="fileinput-button-icon" href="javascript:void(0);"> |
464 | - <img src="[[item.src]]"> | 464 | + <img src="[[item.src]]?imageView/2/w/100/h/100"> |
465 | </a> | 465 | </a> |
466 | <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i> | 466 | <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i> |
467 | </div> | 467 | </div> |
-
Please register or login to post a comment