Authored by 马力

Merge branch 'dev_5.6' into test5.6

# Conflicts:
#	code/apps/goods/controllers/basegoods.js
#	code/apps/resource/views/__partail/jiangming.html
#	code/static/js.jquery/module/resource/resourceManage/ContentManage.js
... ... @@ -154,7 +154,19 @@ module.exports = {
}
return callback(null, result);
});
} else {
}else if (req.body.bucket === 'staticFile') {
req.body.file = fs.createReadStream(req.files[req.body.filename].path);
request.post({
url: config.domain + '/fileupload/uploadStaticFile',
formData: req.body
}, function optionalCallback(error, httpResponse, rebody) {
if (!error && httpResponse.statusCode == 200) {
result = JSON.parse(rebody);
result.status = true;
}
return callback(null, result);
});
}else {
req.body.file = fs.createReadStream(req.files[req.body.filename].path);
request.post({
url: config.domain + '/fileupload/upload',
... ...
... ... @@ -119,10 +119,11 @@ module.exports=function(app) {
app.post("/product/queryProductPicBySkn","basegoods_queryProductPicBySkn");
app.post("/product/queryProductInfoBySkns","basegoods_queryProductInfoBySkns");
app.post("/product/searchProductDetail","basegoods_searchProductDetail");
app.post("/basegoods/queryProductColors","basegoods_queryProductColors");
app.post("/product/queryProductInfoBySkns","basegoods_queryProductInfoBySkns");
app.post("/product/searchProductDetail","basegoods_searchProductDetail");
}
\ No newline at end of file
... ...
... ... @@ -14,7 +14,7 @@ module.exports={
{name: 'pageTitle', type: 'String'},
{name: 'keyWord', type: 'String'},
{name: 'pageDesc', type: 'String'},
{name: 'content', type: 'String'}
{name: 'zip', type: 'String'}
]
},
deleteById:{
... ...
... ... @@ -48,6 +48,17 @@
<script type="text/template" id="template">
<input type="text" hidden="true" id="id" value="[[id]]"/>
[[if !modifyFlag]]
<div class="form-group">
<label class="col-sm-2 control-label">上传文件</label>
<div class="col-sm-10">
<input type="hidden" name="zip" id="zip" class="form-control" required prompt="图片包">
<input id="uploadBox" name="图片包" type="file"
style="position: absolute; top: 0;left: 0;z-index: -999">
<div id="chooseFile" class="file-name btn btn-success">上传图片包</div>
</div>
</div>
[[/if]]
<div class="form-group">
<label for="fileType" class="col-sm-2 control-label">静态文件类型:</label>
... ... @@ -83,9 +94,9 @@
</div>
</div>
<div class="rows">
<div class="rows" [[if modifyFlag==0]]hidden="hidden"[[/if]]>
<label for="content" class="col-sm-2 control-label">内容:</label>
<script id="content" style="width: 100%;" name="content" type="text/plain"></script>
<script id="content" style="width: 100%;" name="content" type="text/plain"/>
</div>
... ...
... ... @@ -175,7 +175,8 @@
<input class="form-control observe" type="text" value="[[item.name]]" data-field="list.[[index]].name">
[[/if]]
</div>
[[if contentData.template_name=='appHotBrands']]
[[if contentData.template_name=='appHotBrands'||contentData.template_name=='customBrands']]
<div class="form-group">
<select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="list.[[index]].url.action">
[[layout action_template]]
... ...
... ... @@ -143,6 +143,7 @@ $(document).on('click', '#filter', function () {
//编辑
$(document).on('click', '.info-modify', function () {
var item = g.rows[$(this).data("index")];
item.modifyFlag = 1;
staticFileOP("编辑", '/staticFileManage/update', item);
});
... ... @@ -151,7 +152,7 @@ function staticFileOP(prefix, url, item) {
var a = new common.edit(".confirm", {
//"bucket" : "author"
});
console.log(item);
var dialog = new common.dialog({
width: '70%',
title: prefix + '静态文件',
... ... @@ -168,7 +169,8 @@ function staticFileOP(prefix, url, item) {
pageTitle: $('#pageTitle').val(),
keyWord: $('#keyWord').val(),
pageDesc: $('#pageDesc').val(),
content: baidu.getContent()
content: baidu.getContent(),
zip:$('#zip').val()
}
}, function (res) {
//res=res.data;
... ... @@ -206,4 +208,26 @@ function staticFileOP(prefix, url, item) {
a.init();
$("#uploadBox").ajaxfileupload({
'action': '/ajax/upload',
'params': {
bucket: "staticFile",
__type: "upload"
},
onComplete: function (response) {
if (response.status && response.code == 200) {
if(response.data){
common.util.__tip(response.message, "success");
$("#zip").val(response.data);
}
} else {
common.util.__tip(response.message);
}
},
valid_extensions: ["zip"]
});
}
$(document).on("click", "#chooseFile", function () {
$("#uploadBox").click();
});
... ...
... ... @@ -284,7 +284,7 @@ var Bll = {
"id": Brands2[i].id,
"title": Brands2[i].brand_name
};
} else if(Bll.module.contentData.template_name == "appHotBrands"){
} else if(Bll.module.contentData.template_name == "appHotBrands"||Bll.module.contentData.template_name == "customBrands"){
pic = {
"src": Brands2[i].brandIco,
"id": Brands2[i].id,
... ... @@ -555,7 +555,7 @@ $(document).on("click", ".edit", function () {
Bll.toast(index, Bll.module);
var _shopRecommendFlag = item.contentData.isShopRecommend==''?"N":item.contentData.isShopRecommend;
changeShopRecommendDivShow(_shopRecommendFlag);
}else if(item.contentData.template_name=='appHotBrands'){
}else if(item.contentData.template_name=='appHotBrands'||item.contentData.template_name=='customBrands'){
//热门品牌兼容老版本,url设置空值
var list = item.contentData.data.list;
for(var i=0;i<list.length;i++){
... ...