Showing
6 changed files
with
42 additions
and
20 deletions
@@ -470,7 +470,7 @@ $(document).on("click", "#goodsSelectBtn", function () { | @@ -470,7 +470,7 @@ $(document).on("click", "#goodsSelectBtn", function () { | ||
470 | callback: function () { | 470 | callback: function () { |
471 | Bll.module.contentData.data = goodsgird.selected.map(function (item, index) { | 471 | Bll.module.contentData.data = goodsgird.selected.map(function (item, index) { |
472 | return { | 472 | return { |
473 | - src: item.images_url, | 473 | + src: item.images_url+'?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90', |
474 | id: item.product_skn, | 474 | id: item.product_skn, |
475 | product_skc: item.product_skc | 475 | product_skc: item.product_skc |
476 | } | 476 | } |
@@ -504,7 +504,7 @@ $(document).on("click", ".goodsSelectBtn", function () { | @@ -504,7 +504,7 @@ $(document).on("click", ".goodsSelectBtn", function () { | ||
504 | callback: function () { | 504 | callback: function () { |
505 | goodsgird.selected.forEach(function (item, i) { | 505 | goodsgird.selected.forEach(function (item, i) { |
506 | Bll.module.contentData.data[index].list[i] = { | 506 | Bll.module.contentData.data[index].list[i] = { |
507 | - src: item.images_url, | 507 | + src: item.images_url+'?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90', |
508 | id: item.product_skn, | 508 | id: item.product_skn, |
509 | product_skc: item.product_skc, | 509 | product_skc: item.product_skc, |
510 | maxSortId: item.max_sort_id | 510 | maxSortId: item.max_sort_id |
@@ -55,11 +55,11 @@ var Bll = { | @@ -55,11 +55,11 @@ var Bll = { | ||
55 | button: [{ | 55 | button: [{ |
56 | value: "保存", | 56 | value: "保存", |
57 | callback: function () { | 57 | callback: function () { |
58 | - //if (Validate[module.contentData.template_name]) { | ||
59 | - // Validate[module.contentData.template_name].forEach(function (item) { | ||
60 | - // edit.on("validate", function(){item.fn(module.contentData)}) | ||
61 | - // }) | ||
62 | - //} | 58 | + if (Validate[module.contentData.template_name]) { |
59 | + Validate[module.contentData.template_name].forEach(function (item) { | ||
60 | + edit.on("validate", item.fn(module.contentData)) | ||
61 | + }) | ||
62 | + } | ||
63 | if (edit.validate()) { | 63 | if (edit.validate()) { |
64 | //TODO | 64 | //TODO |
65 | if (resourceObj[module.contentData.template_name]) { | 65 | if (resourceObj[module.contentData.template_name]) { |
@@ -372,19 +372,45 @@ $(document).on("click", "#sub_btn", function () { | @@ -372,19 +372,45 @@ $(document).on("click", "#sub_btn", function () { | ||
372 | var contentData = Bll.contentDatas[i].contentData; | 372 | var contentData = Bll.contentDatas[i].contentData; |
373 | var action; | 373 | var action; |
374 | var url; | 374 | var url; |
375 | + var goodsSrc="imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90"; | ||
375 | addSuffix(contentData); | 376 | addSuffix(contentData); |
376 | delete contentData.button_name; | 377 | delete contentData.button_name; |
377 | delete contentData.dialog; | 378 | delete contentData.dialog; |
379 | + //kids推荐品牌 | ||
378 | if (contentData.template_name == "kidsBrands") { | 380 | if (contentData.template_name == "kidsBrands") { |
379 | action = contentData.data.params.more_url.action || ""; | 381 | action = contentData.data.params.more_url.action || ""; |
380 | url = contentData.data.params.more_url.url || ""; | 382 | url = contentData.data.params.more_url.url || ""; |
381 | contentData.data.params.more_url = "{\"action\":\"" + action + "\",\"url\":\"" + url + "\"}"; | 383 | contentData.data.params.more_url = "{\"action\":\"" + action + "\",\"url\":\"" + url + "\"}"; |
382 | } | 384 | } |
385 | + //标题标签 | ||
383 | if (contentData.template_name == "title") { | 386 | if (contentData.template_name == "title") { |
384 | action = contentData.data.more_link.action || ""; | 387 | action = contentData.data.more_link.action || ""; |
385 | url = contentData.data.more_link.url || ""; | 388 | url = contentData.data.more_link.url || ""; |
386 | contentData.data.more_link = "{\"action\":\"" + action + "\",\"url\":\"" + url + "\"}"; | 389 | contentData.data.more_link = "{\"action\":\"" + action + "\",\"url\":\"" + url + "\"}"; |
387 | } | 390 | } |
391 | + //商品 | ||
392 | + if (contentData.template_name == "goods") { | ||
393 | + for(var j=0;j<contentData.data.length;j++){ | ||
394 | + if(contentData.data[j].src){ | ||
395 | + var a=contentData.data[j].src.split("?"); | ||
396 | + a[1]=goodsSrc; | ||
397 | + contentData.data[j].src= a.join("?"); | ||
398 | + } | ||
399 | + } | ||
400 | + } | ||
401 | + //商品组 | ||
402 | + if (contentData.template_name == "goodsGroup") { | ||
403 | + for(var m=0;m<contentData.data.length;m++){ | ||
404 | + if(contentData.data[m].list){ | ||
405 | + for(var n=0;n<contentData.data[m].list.length;n++){ | ||
406 | + var b=contentData.data[m].list[n].src.split("?"); | ||
407 | + b[1]=goodsSrc; | ||
408 | + contentData.data[m].list[n].src= b.join("?"); | ||
409 | + } | ||
410 | + | ||
411 | + } | ||
412 | + } | ||
413 | + } | ||
388 | data.content[i] = JSON.stringify(common.util.__ArrayToObj(contentData)); | 414 | data.content[i] = JSON.stringify(common.util.__ArrayToObj(contentData)); |
389 | data.content[i] = JSON.stringify(common.util.__ArrayToObj(Bll.contentDatas[i].contentData)); | 415 | data.content[i] = JSON.stringify(common.util.__ArrayToObj(Bll.contentDatas[i].contentData)); |
390 | if (Bll.contentDatas[i].id) { | 416 | if (Bll.contentDatas[i].id) { |
@@ -394,6 +420,7 @@ $(document).on("click", "#sub_btn", function () { | @@ -394,6 +420,7 @@ $(document).on("click", "#sub_btn", function () { | ||
394 | data.rId = param; | 420 | data.rId = param; |
395 | data.content = JSON.stringify(data.content); | 421 | data.content = JSON.stringify(data.content); |
396 | data.data_id = JSON.stringify(data.data_id); | 422 | data.data_id = JSON.stringify(data.data_id); |
423 | + //console.log("最终保存data",data); | ||
397 | common.util.__ajax({ | 424 | common.util.__ajax({ |
398 | url: "/resources/addResContent", | 425 | url: "/resources/addResContent", |
399 | data: data | 426 | data: data |
@@ -539,6 +566,7 @@ $(document).on("click", ".goodsSelectBtn", function () { | @@ -539,6 +566,7 @@ $(document).on("click", ".goodsSelectBtn", function () { | ||
539 | //删除图片按钮 | 566 | //删除图片按钮 |
540 | $(document).on("click", ".removepic", function () { | 567 | $(document).on("click", ".removepic", function () { |
541 | Bll.module.contentData.data.splice($(this).data("index"), 1); | 568 | Bll.module.contentData.data.splice($(this).data("index"), 1); |
569 | + console.log("Bll.module.contentData.data",Bll.module.contentData.data); | ||
542 | $("#goodspic").html(common.util.__template2($("#template_dialog_goodsimgs").html(), { | 570 | $("#goodspic").html(common.util.__template2($("#template_dialog_goodsimgs").html(), { |
543 | datas: Bll.module.contentData.data | 571 | datas: Bll.module.contentData.data |
544 | })); | 572 | })); |
@@ -9,15 +9,11 @@ exports.brandlist = function (req, res) { | @@ -9,15 +9,11 @@ exports.brandlist = function (req, res) { | ||
9 | 9 | ||
10 | exports.search = function (req, res) { | 10 | exports.search = function (req, res) { |
11 | var size = 10;//每页数据量 | 11 | var size = 10;//每页数据量 |
12 | - // var page = 1; | ||
13 | - // var price=req.body.price; | ||
14 | - // if (req.body.page) { | ||
15 | - // page = req.body.page; | ||
16 | - // } | ||
17 | var params = []; | 12 | var params = []; |
18 | for (var key in req.body) { | 13 | for (var key in req.body) { |
19 | params.push(key + "=" + req.body[key]); | 14 | params.push(key + "=" + req.body[key]); |
20 | } | 15 | } |
16 | + console.log("params",params); | ||
21 | var url = searchDomain+"/search.json?viewNum=" + size + "&"+params.join('&'); | 17 | var url = searchDomain+"/search.json?viewNum=" + size + "&"+params.join('&'); |
22 | console.log("请求url",url); | 18 | console.log("请求url",url); |
23 | request({url: url}, function (error, response, body) { | 19 | request({url: url}, function (error, response, body) { |
@@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
45 | [[/if]] | 45 | [[/if]] |
46 | </td> | 46 | </td> |
47 | <td> | 47 | <td> |
48 | - <a class="btn btn-danger delBtn" data-event="icon.data" data_index="[[index]]">删除</a> | 48 | + <a class="btn btn-danger delBtn" data-event="icon.data" data-index="[[index]]">删除</a> |
49 | </td> | 49 | </td> |
50 | </tr> | 50 | </tr> |
51 | [[/each]] | 51 | [[/each]] |
@@ -183,7 +183,7 @@ | @@ -183,7 +183,7 @@ | ||
183 | </div> | 183 | </div> |
184 | </td> | 184 | </td> |
185 | <td> | 185 | <td> |
186 | - <a class="btn btn-danger delBtn" data-event="brands.list" data_index="[[index]]">删除</a> | 186 | + <a class="btn btn-danger delBtn" data-event="brands.list" data-index="[[index]]">删除</a> |
187 | </td> | 187 | </td> |
188 | </tr> | 188 | </tr> |
189 | [[/each]] | 189 | [[/each]] |
@@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
56 | <!-- 文本弹层 --> | 56 | <!-- 文本弹层 --> |
57 | <script type="text/template" id="template_dialog_text"> | 57 | <script type="text/template" id="template_dialog_text"> |
58 | <div class="rows"> | 58 | <div class="rows"> |
59 | - <textarea rows="2" class="form-control observe" placeholder="文章摘要" data-field="text" >[[contentData.data.text]]</textarea> | 59 | + <textarea rows="2" class="form-control observe" placeholder="文章摘要" data-field="text" style="resize: none">[[contentData.data.text]]</textarea> |
60 | </div> | 60 | </div> |
61 | </script> | 61 | </script> |
62 | 62 | ||
@@ -88,7 +88,7 @@ | @@ -88,7 +88,7 @@ | ||
88 | 88 | ||
89 | <div class="form-group"> | 89 | <div class="form-group"> |
90 | <div class="col-sm-10"> | 90 | <div class="col-sm-10"> |
91 | - <textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="[[index]].url.url">[[item.url.url]]</textarea> | 91 | + <textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="[[index]].url.url" style="resize: none">[[item.url.url]]</textarea> |
92 | </div> | 92 | </div> |
93 | </div> | 93 | </div> |
94 | 94 | ||
@@ -161,7 +161,6 @@ | @@ -161,7 +161,6 @@ | ||
161 | <input type="number" id="beginPrice" name="begin_price" class="form-control" | 161 | <input type="number" id="beginPrice" name="begin_price" class="form-control" |
162 | placeholder="起始价" value="" > | 162 | placeholder="起始价" value="" > |
163 | </div> | 163 | </div> |
164 | - | ||
165 | <div class="panel-col"> | 164 | <div class="panel-col"> |
166 | <input type="number" id="endPrice" name="end_price" class="form-control" | 165 | <input type="number" id="endPrice" name="end_price" class="form-control" |
167 | placeholder="结束价" value="" > | 166 | placeholder="结束价" value="" > |
@@ -250,7 +249,7 @@ | @@ -250,7 +249,7 @@ | ||
250 | <div class="form-group"> | 249 | <div class="form-group"> |
251 | <label class="col-sm-2 control-label">跳转地址:</label> | 250 | <label class="col-sm-2 control-label">跳转地址:</label> |
252 | <div class="col-sm-8"> | 251 | <div class="col-sm-8"> |
253 | - <textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="0.url.url" >[[contentData.data[0].url.url]]</textarea> | 252 | + <textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="0.url.url" style="resize: none;">[[contentData.data[0].url.url]]</textarea> |
254 | </div> | 253 | </div> |
255 | 254 | ||
256 | </div> | 255 | </div> |
@@ -259,7 +258,6 @@ | @@ -259,7 +258,6 @@ | ||
259 | 258 | ||
260 | 259 | ||
261 | <script type="text/template" id="template_default_1"> | 260 | <script type="text/template" id="template_default_1"> |
262 | - <option value="">选择跳转目的</option> | ||
263 | <option value="">选择跳转目标</option> | 261 | <option value="">选择跳转目标</option> |
264 | <option value="go.brand">品牌列表页</option> | 262 | <option value="go.brand">品牌列表页</option> |
265 | <option value="go.productDetail">商品详情页</option> | 263 | <option value="go.productDetail">商品详情页</option> |
-
Please register or login to post a comment