Authored by liuyue

Merge branch 'release/1.6' of git.dev.yoho.cn:platform/yohobuy-portal-fe into release/1.6

... ... @@ -51,7 +51,6 @@ var g = new common.grid({
display: "尺码",
name: "sizeRelationsList",
render: function (item1) {
return common.util.__template2($("#sizeinfo-template").html(), item1);
}
},
... ... @@ -59,7 +58,13 @@ var g = new common.grid({
display: "到货时间",
name: "",
render: function (item1) {
return Bll.getLocalTime(item1.expectArrivalTime);
if(item1.expectArrivalTime){
return Bll.getLocalTime(item1.expectArrivalTime);
}
else{
return ""
}
}
},
{
... ...
... ... @@ -145,6 +145,7 @@ function attributeOp(prefix, url, item) {
return a.submit(url, function (option) {
option.data.categoryId = item.categoryId;
option.data.attributeId = item.attributeId;
option.data.shopsId = common.util.__input("shopsId");
option.success = function (res) {
res = res.data;
if (res.code == "200") {
... ...
... ... @@ -67,7 +67,7 @@ g.init("/shotManage/proPhoto/index2");
var Bll = {
pictureBoList: [],
selectedBoId: [],
clonePics:[],
clonePics: [],
//重新渲染图片列表
rendBoList: function (pictureBoList) {
$(".image-list").html('');
... ... @@ -78,9 +78,9 @@ var Bll = {
));
},
//获取编辑时新增的图片
getNewPics:function(pictureBoList){
var newPic=[];
if(pictureBoList.length>0){
getNewPics: function (pictureBoList) {
var newPic = [];
if (pictureBoList.length > 0) {
for (var i = 0; i < pictureBoList.length; i++) {
if (!pictureBoList[i].id) {
newPic.push(pictureBoList[i])
... ... @@ -91,7 +91,7 @@ var Bll = {
},
//模态
toast: function (url, item, datacall) {
Bll.pictureBoList = item.pictureBoList||[];
Bll.pictureBoList = item.pictureBoList || [];
Bll.selectedBoId = [];
var a = new common.dialog({
title: "图片",
... ... @@ -100,31 +100,27 @@ var Bll = {
button: [
{
value: "提交", callback: function () {
var data={};
if(item.__state=='add'){
var data = {};
if (item.__state == 'add') {
data = datacall && datacall(Bll.clonePics, Bll.selectedBoId);
}else{
} else {
data = datacall && datacall(Bll.getNewPics(Bll.clonePics), Bll.selectedBoId);
}
console.log("最终提交数据data",data);
console.log("最终提交数据data", data);
common.util.__ajax({
url: url,
data: data
}, function (res) {
if (res.code == '200') {
g.reload();
a.close();
}
else{
console.log("res",res);
if(res.data.length>0){
var mess="失败列表:";
for(var i=0;i<res.data.length;i++){
mess=mess+res.data[i].originalName+";"
if (res.data.length > 0) {
var mess = "失败列表:";
for (var i = 0; i < res.data.length; i++) {
mess =mess + '<p>'+res.data[i].originalName + ';'+'</p>';
}
common.util.__tip(mess, 'warning');
}
g.reload();
a.close();
}
});
return false;
... ... @@ -145,13 +141,13 @@ var Bll = {
valid_extensions: ['png', 'jpg', 'jpeg'],
onComplete: function (response) {
if (response.status && response.code == 200) {
for(var i=0;i<response.data.length;i++){
for (var i = 0; i < response.datas.length; i++) {
Bll.pictureBoList.push({
"fileName": response.data[i],
"fileName": response.datas[i],
"originalName": response.names[i]
});
Bll.clonePics.push({
"fileName": response.data[i],
"fileName": response.datas[i],
"originalName": response.names[i]
})
}
... ... @@ -169,7 +165,7 @@ $('#upload-btn').on('click', function () {
var item = {
__state: "add"
};
Bll.clonePics=[];
Bll.clonePics = [];
Bll.toast('/shotManage/proPhoto/add', item, function (pictureBoList, selectedBoId) {
return {
productPhotoAddStrList: JSON.stringify(pictureBoList)
... ... @@ -181,8 +177,8 @@ $('#upload-btn').on('click', function () {
$(document).on('click', '.update', function () {
var item = g.rows[$(this).data("index")];
item.__state = "update";
Bll.clonePics=[];
Array.prototype.push.apply(Bll.clonePics,item.pictureBoList);
Bll.clonePics = [];
Array.prototype.push.apply(Bll.clonePics, item.pictureBoList);
Bll.toast('/shotManage/proPhoto/add', item, function (pictureBoList, selectedBoId) {
return {
productSkn: item.productSkn,
... ... @@ -195,7 +191,7 @@ $(document).on('click', '.update', function () {
//删除单张图片
$(document).on('click', '.remove1', function () {
var index = $(this).data("index");
if(Bll.clonePics[index].id){
if (Bll.clonePics[index].id) {
Bll.selectedBoId.push(Bll.clonePics[index].id);
}
Bll.clonePics.splice(index, 1);
... ...
... ... @@ -99,7 +99,8 @@ exports.uploadFile = function (req, res) {
}
res.json({
code: 200,
data: flag?datas:datas[0],
data: datas[0],
datas:datas,
names: req.body.fileNames,
message: '上传成功',
status: true
... ...
... ... @@ -7,7 +7,7 @@
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">拍摄</a></li>
<li><a href="">拍摄复尺</a></li>
<li>拍摄上传</li>
</ul>
<div>
... ...