Authored by 姜敏

资源位-界面小bug修复

... ... @@ -470,7 +470,7 @@ $(document).on("click", "#goodsSelectBtn", function () {
callback: function () {
Bll.module.contentData.data = goodsgird.selected.map(function (item, index) {
return {
src: item.images_url,
src: item.images_url+'?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90',
id: item.product_skn,
product_skc: item.product_skc
}
... ... @@ -504,7 +504,7 @@ $(document).on("click", ".goodsSelectBtn", function () {
callback: function () {
goodsgird.selected.forEach(function (item, i) {
Bll.module.contentData.data[index].list[i] = {
src: item.images_url,
src: item.images_url+'?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90',
id: item.product_skn,
product_skc: item.product_skc,
maxSortId: item.max_sort_id
... ...
... ... @@ -52,7 +52,7 @@ var Button = [
"src": "",
"alt": "",
"url": {},
"bgColor": "",
"bgColor": ""
}
],
focus_type: "1"
... ...
... ... @@ -55,11 +55,11 @@ var Bll = {
button: [{
value: "保存",
callback: function () {
//if (Validate[module.contentData.template_name]) {
// Validate[module.contentData.template_name].forEach(function (item) {
// edit.on("validate", function(){item.fn(module.contentData)})
// })
//}
if (Validate[module.contentData.template_name]) {
Validate[module.contentData.template_name].forEach(function (item) {
edit.on("validate", item.fn(module.contentData))
})
}
if (edit.validate()) {
//TODO
if (resourceObj[module.contentData.template_name]) {
... ... @@ -372,19 +372,45 @@ $(document).on("click", "#sub_btn", function () {
var contentData = Bll.contentDatas[i].contentData;
var action;
var url;
var goodsSrc="imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90";
addSuffix(contentData);
delete contentData.button_name;
delete contentData.dialog;
//kids推荐品牌
if (contentData.template_name == "kidsBrands") {
action = contentData.data.params.more_url.action || "";
url = contentData.data.params.more_url.url || "";
contentData.data.params.more_url = "{\"action\":\"" + action + "\",\"url\":\"" + url + "\"}";
}
//标题标签
if (contentData.template_name == "title") {
action = contentData.data.more_link.action || "";
url = contentData.data.more_link.url || "";
contentData.data.more_link = "{\"action\":\"" + action + "\",\"url\":\"" + url + "\"}";
}
//商品
if (contentData.template_name == "goods") {
for(var j=0;j<contentData.data.length;j++){
if(contentData.data[j].src){
var a=contentData.data[j].src.split("?");
a[1]=goodsSrc;
contentData.data[j].src= a.join("?");
}
}
}
//商品组
if (contentData.template_name == "goodsGroup") {
for(var m=0;m<contentData.data.length;m++){
if(contentData.data[m].list){
for(var n=0;n<contentData.data[m].list.length;n++){
var b=contentData.data[m].list[n].src.split("?");
b[1]=goodsSrc;
contentData.data[m].list[n].src= b.join("?");
}
}
}
}
data.content[i] = JSON.stringify(common.util.__ArrayToObj(contentData));
data.content[i] = JSON.stringify(common.util.__ArrayToObj(Bll.contentDatas[i].contentData));
if (Bll.contentDatas[i].id) {
... ... @@ -394,6 +420,7 @@ $(document).on("click", "#sub_btn", function () {
data.rId = param;
data.content = JSON.stringify(data.content);
data.data_id = JSON.stringify(data.data_id);
//console.log("最终保存data",data);
common.util.__ajax({
url: "/resources/addResContent",
data: data
... ... @@ -539,6 +566,7 @@ $(document).on("click", ".goodsSelectBtn", function () {
//删除图片按钮
$(document).on("click", ".removepic", function () {
Bll.module.contentData.data.splice($(this).data("index"), 1);
console.log("Bll.module.contentData.data",Bll.module.contentData.data);
$("#goodspic").html(common.util.__template2($("#template_dialog_goodsimgs").html(), {
datas: Bll.module.contentData.data
}));
... ...
... ... @@ -9,15 +9,11 @@ exports.brandlist = function (req, res) {
exports.search = function (req, res) {
var size = 10;//每页数据量
// var page = 1;
// var price=req.body.price;
// if (req.body.page) {
// page = req.body.page;
// }
var params = [];
for (var key in req.body) {
params.push(key + "=" + req.body[key]);
}
console.log("params",params);
var url = searchDomain+"/search.json?viewNum=" + size + "&"+params.join('&');
console.log("请求url",url);
request({url: url}, function (error, response, body) {
... ...
... ... @@ -45,7 +45,7 @@
[[/if]]
</td>
<td>
<a class="btn btn-danger delBtn" data-event="icon.data" data_index="[[index]]">删除</a>
<a class="btn btn-danger delBtn" data-event="icon.data" data-index="[[index]]">删除</a>
</td>
</tr>
[[/each]]
... ... @@ -183,7 +183,7 @@
</div>
</td>
<td>
<a class="btn btn-danger delBtn" data-event="brands.list" data_index="[[index]]">删除</a>
<a class="btn btn-danger delBtn" data-event="brands.list" data-index="[[index]]">删除</a>
</td>
</tr>
[[/each]]
... ...
... ... @@ -38,7 +38,7 @@
<img src="[[item.src]]" title="[[item.id]]">
</div>
[[/each]]
</div>
{{> resource/taoyu2}}
[[/if]]
... ... @@ -56,7 +56,7 @@
<!-- 文本弹层 -->
<script type="text/template" id="template_dialog_text">
<div class="rows">
<textarea rows="2" class="form-control observe" placeholder="文章摘要" data-field="text" >[[contentData.data.text]]</textarea>
<textarea rows="2" class="form-control observe" placeholder="文章摘要" data-field="text" style="resize: none">[[contentData.data.text]]</textarea>
</div>
</script>
... ... @@ -88,7 +88,7 @@
<div class="form-group">
<div class="col-sm-10">
<textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="[[index]].url.url">[[item.url.url]]</textarea>
<textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="[[index]].url.url" style="resize: none">[[item.url.url]]</textarea>
</div>
</div>
... ... @@ -161,7 +161,6 @@
<input type="number" id="beginPrice" name="begin_price" class="form-control"
placeholder="起始价" value="" >
</div>
<div class="panel-col">
<input type="number" id="endPrice" name="end_price" class="form-control"
placeholder="结束价" value="" >
... ... @@ -250,7 +249,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">跳转地址:</label>
<div class="col-sm-8">
<textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="0.url.url" >[[contentData.data[0].url.url]]</textarea>
<textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="0.url.url" style="resize: none;">[[contentData.data[0].url.url]]</textarea>
</div>
</div>
... ... @@ -259,7 +258,6 @@
<script type="text/template" id="template_default_1">
<option value="">选择跳转目的</option>
<option value="">选择跳转目标</option>
<option value="go.brand">品牌列表页</option>
<option value="go.productDetail">商品详情页</option>
... ...