Authored by weiqingting

提交

... ... @@ -130,20 +130,36 @@ module.exports={
result={code: "501",message: "用户失效,请重新登录"};
return callback(null, result);
}
req.body.file = fs.createReadStream(req.files.upfile.path);
req.body.files = [fs.createReadStream(req.files.upfile.path)];
req.body.bucket="goodsimg";
request.post({
url: config.domain + '/fileupload/upload',
formData: req.body
formData: {
fileData: req.body.files,
project: req.body.bucket
}
}, function optionalCallback(error, httpResponse, rebody) {
if (!error && httpResponse.statusCode == 200) {
var json = JSON.parse(rebody);
result={};
result.originalName=json.data.substring(json.data.lastIndexOf('/')+1);
result.name=result.originalName;
result.url=json.data;
result.type=json.data.substring(json.data.lastIndexOf('.'));
result.state=json.message=="上传成功"?"SUCCESS":"FAIL";
var ret = JSON.parse(body);
if (ret.code === 200) {
//var imgUrl = ret.data.imagesList[0];
var imgs = ret.data.imagesList || [];
var datas = [];
for (var i = 0; i < imgs.length; i++) {
datas.push(joinimg(imgs[i]))
}
var result={};
if(datas.length>0&&datas[0]){
result.originalName=Date.now();
result.name=Date.now();
result.url=datas[0];
result.type=datas[0].substring(datas[0].lastIndexOf('.'));
result.state="SUCCESS";
}else{
result.state="FAIL";
}
}
}
return callback(null, result);
});
... ...
... ... @@ -54,9 +54,6 @@ module.exports=function(app) {
app.post("/productColor/queryProductColors","basegoods_queryProductColors");
/*获取(非)销售属性*/
app.post("/standard/queryAllBySortId4Html","basegoods_queryAllProductAttr");
app.post("/product/queryMaterialList","basegoods_queryMaterialList");
app.post("/product/querySortBySmallSort","basegoods_querySortBySmallSort");
... ...
... ... @@ -82,6 +82,7 @@ Controller.prototype.__define=function(method,router,view,apis,callback,clientmo
} else {
res.json(model);
}
return;
});
//调用接口获取数据
me.interfaces.require.apply(me.interfaces,[apis].concat(args));
... ...
... ... @@ -158,6 +158,7 @@ Interfacer.prototype.require=function(mos,req,res,cb){
console.error(results);
return cb(err,results,names);
}
console.log(names);
return cb(null, results, names);
});
};
... ...
... ... @@ -66,8 +66,8 @@
margin: 0;
padding:0;
background-repeat: no-repeat;
background-image: url(../images/icons.png);
background-image: url(../images/icons.gif) \9;
background-image: url(assets/images/icons.png);
background-image: url(assets/images/icons.gif) \9;
}
/*状态反射*/
... ... @@ -230,8 +230,8 @@
*zoom:1;
width: 8px;
height: 20px;
background: url(../images/icons.png) -741px 0;
_background: url(../images/icons.gif) -741px 0;
background: url(assets/images/icons.png) -741px 0;
_background: url(assets/images/icons.gif) -741px 0;
}
.edui-btn-toolbar .edui-splitbutton,
... ... @@ -295,8 +295,8 @@
width: 12px;
margin: 0;
padding: 0;
background: url(../images/icons.png) -741px 0;
_background: url(../images/icons.gif) -741px 0;
background: url(assets/images/icons.png) -741px 0;
_background: url(assets/images/icons.gif) -741px 0;
}
.edui-btn-toolbar .edui-combobox.edui-disabled{
opacity: 0.2;
... ... @@ -352,7 +352,7 @@
height: 25px;
background: red;
vertical-align: bottom;
background: url(../images/ok.gif) no-repeat 1000px 1000px;
background: url(assets/images/ok.gif) no-repeat 1000px 1000px;
}
.edui-combobox-menu .edui-combobox-checked .edui-combobox-icon {
... ... @@ -514,7 +514,7 @@
margin-top: 2px;
padding: 1px;
border: 0;
background: url("../images/close.png") no-repeat center center;
background: url("assets/images/close.png") no-repeat center center;
cursor: pointer;
}
.edui-modal-header .edui-close.edui-hover {
... ... @@ -604,7 +604,7 @@
}
.edui-popup{
display: none;
background: url('../images/pop-bg.png') repeat #fff;
background: url('assets/images/pop-bg.png') repeat #fff;
padding: 2px;
}
.edui-popup .edui-popup-body{
... ... @@ -616,10 +616,10 @@
height: 11px;
}
.edui-popup .edui-popup-caret.up{
background:url('../images/caret.png') no-repeat 0 0;
background:url('assets/images/caret.png') no-repeat 0 0;
}
.edui-popup .edui-popup-caret.down{
background:url('../images/caret.png') no-repeat 0 0;
background:url('assets/images/caret.png') no-repeat 0 0;
}
... ... @@ -762,8 +762,8 @@
width: 2px;
height: 20px;
padding: 1px 2px;
background: url(../images/icons.png) -179px 1px;
background: url(../images/icons.gif) -179px 1px \9;
background: url(assets/images/icons.png) -179px 1px;
background: url(assets/images/icons.gif) -179px 1px \9;
display: inline-block ;
vertical-align: top;
*display: inline ;
... ...