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("/basegoods/queryProductColors","basegoods_queryProductColors");
app.post("/product/queryProductInfoBySkns","basegoods_queryProductInfoBySkns");
app.post("/product/searchProductDetail","basegoods_searchProductDetail");
app.post("/basegoods/queryProductColors","basegoods_queryProductColors");
}
\ 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,14 +175,15 @@
<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]]
</select>
<select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="list.[[index]].url.action">
[[layout action_template]]
</select>
</div>
<div class="form-group">
<input placeholder="url" value="[[item.url.url]]" class="observe form-control" data-field="list.[[index]].url.url"/>
<input placeholder="url" value="[[item.url.url]]" class="observe form-control" data-field="list.[[index]].url.url"/>
</div>
[[/if]]
</td>
... ...
... ... @@ -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();
}
\ No newline at end of file
$("#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,
... ... @@ -461,17 +461,17 @@ $(document).on("change", ".observe", function () {
var urlName = $this.attr("placeholder");
//如果属性不存在,会报错
if(typeof (urlName) !='undefined'){
if(platformName.toLocaleLowerCase().indexOf("web")==-1&&httpsEnable=='true'){
console.log("限制https")
if(urlName.indexOf("url")!=-1||urlName.indexOf("链接")!=-1||urlName.indexOf("地址")!=-1){
var urlVal = $this.val();
if(urlVal.toLowerCase().indexOf("https")!=0){
common.util.__tip("url必须以https开头!", "warning");
$this.val('');
if(platformName.toLocaleLowerCase().indexOf("web")==-1&&httpsEnable=='true'){
console.log("限制https")
if(urlName.indexOf("url")!=-1||urlName.indexOf("链接")!=-1||urlName.indexOf("地址")!=-1){
var urlVal = $this.val();
if(urlVal.toLowerCase().indexOf("https")!=0){
common.util.__tip("url必须以https开头!", "warning");
$this.val('');
}
}
}
}
}
var name = $this.data("field");
// 以 .. 开头的,赋值到 contentData
if (name.indexOf("..") == 0) {
... ... @@ -505,11 +505,11 @@ $(document).on("change", ".observe", function () {
window.onbeforeunload = function(){
if(lock_type==1){
common.util.__ajax({
url: "/resources/updateLock",
data: {id: param,
status:0}
}, function () {
});
url: "/resources/updateLock",
data: {id: param,
status:0}
}, function () {
});
}
}
/*删除*/
... ... @@ -539,23 +539,23 @@ $(document).on("click", ".edit", function () {
if(item.contentData.template_name=='shopRecommend'){
var list = item.contentData.data.list;
for(var i = 0; i < list.length; i++) {
if(typeof(list[i].goods2) == 'undefined'){
var goods2 = {
"src":"",
"url":{
"url":"",
"action":""
}
};
list[i].goods2 = goods2;
}
if(typeof(list[i].goods2) == 'undefined'){
var goods2 = {
"src":"",
"url":{
"url":"",
"action":""
}
};
list[i].goods2 = goods2;
}
}
Bll.module = $.extend(true, {}, item);
Bll.renderDialog("shopRecommend-template");
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++){
... ... @@ -754,7 +754,7 @@ $(document).on("click", '.isShopRecommend', function () {
Bll.module.contentData.isShopRecommend = _isShopRecommend;
//Bll.renderDialog("shopRecommend-template");
//切换到推荐
changeShopRecommendDivShow(_isShopRecommend)
changeShopRecommendDivShow(_isShopRecommend)
});
$(document).on("change", '.shopChannelId', function () {
Bll.module.contentData.shopChannelId = $(this).val();
... ... @@ -1155,7 +1155,7 @@ $(document).on("click", "#goodsSelectBtn", function () {
// 线上bug修改,商品个数不超过150个
var datas = Bll.module.contentData.data.concat(gs);
if (datas.length > 150) {
common.util.__tip('选择商品失败,您选择的商品总数超过150个。', 'warning');
common.util.__tip('选择商品失败,您选择的商品总数超过150个。', 'warning');
return;
}
... ...