Merge branch 'release/1.6' of git.dev.yoho.cn:platform/yohobuy-portal-fe into release/1.6
Showing
5 changed files
with
33 additions
and
30 deletions
@@ -51,7 +51,6 @@ var g = new common.grid({ | @@ -51,7 +51,6 @@ var g = new common.grid({ | ||
51 | display: "尺码", | 51 | display: "尺码", |
52 | name: "sizeRelationsList", | 52 | name: "sizeRelationsList", |
53 | render: function (item1) { | 53 | render: function (item1) { |
54 | - | ||
55 | return common.util.__template2($("#sizeinfo-template").html(), item1); | 54 | return common.util.__template2($("#sizeinfo-template").html(), item1); |
56 | } | 55 | } |
57 | }, | 56 | }, |
@@ -59,7 +58,13 @@ var g = new common.grid({ | @@ -59,7 +58,13 @@ var g = new common.grid({ | ||
59 | display: "到货时间", | 58 | display: "到货时间", |
60 | name: "", | 59 | name: "", |
61 | render: function (item1) { | 60 | render: function (item1) { |
62 | - return Bll.getLocalTime(item1.expectArrivalTime); | 61 | + if(item1.expectArrivalTime){ |
62 | + return Bll.getLocalTime(item1.expectArrivalTime); | ||
63 | + } | ||
64 | + else{ | ||
65 | + return "" | ||
66 | + } | ||
67 | + | ||
63 | } | 68 | } |
64 | }, | 69 | }, |
65 | { | 70 | { |
@@ -145,6 +145,7 @@ function attributeOp(prefix, url, item) { | @@ -145,6 +145,7 @@ function attributeOp(prefix, url, item) { | ||
145 | return a.submit(url, function (option) { | 145 | return a.submit(url, function (option) { |
146 | option.data.categoryId = item.categoryId; | 146 | option.data.categoryId = item.categoryId; |
147 | option.data.attributeId = item.attributeId; | 147 | option.data.attributeId = item.attributeId; |
148 | + option.data.shopsId = common.util.__input("shopsId"); | ||
148 | option.success = function (res) { | 149 | option.success = function (res) { |
149 | res = res.data; | 150 | res = res.data; |
150 | if (res.code == "200") { | 151 | if (res.code == "200") { |
@@ -67,7 +67,7 @@ g.init("/shotManage/proPhoto/index2"); | @@ -67,7 +67,7 @@ g.init("/shotManage/proPhoto/index2"); | ||
67 | var Bll = { | 67 | var Bll = { |
68 | pictureBoList: [], | 68 | pictureBoList: [], |
69 | selectedBoId: [], | 69 | selectedBoId: [], |
70 | - clonePics:[], | 70 | + clonePics: [], |
71 | //重新渲染图片列表 | 71 | //重新渲染图片列表 |
72 | rendBoList: function (pictureBoList) { | 72 | rendBoList: function (pictureBoList) { |
73 | $(".image-list").html(''); | 73 | $(".image-list").html(''); |
@@ -78,9 +78,9 @@ var Bll = { | @@ -78,9 +78,9 @@ var Bll = { | ||
78 | )); | 78 | )); |
79 | }, | 79 | }, |
80 | //获取编辑时新增的图片 | 80 | //获取编辑时新增的图片 |
81 | - getNewPics:function(pictureBoList){ | ||
82 | - var newPic=[]; | ||
83 | - if(pictureBoList.length>0){ | 81 | + getNewPics: function (pictureBoList) { |
82 | + var newPic = []; | ||
83 | + if (pictureBoList.length > 0) { | ||
84 | for (var i = 0; i < pictureBoList.length; i++) { | 84 | for (var i = 0; i < pictureBoList.length; i++) { |
85 | if (!pictureBoList[i].id) { | 85 | if (!pictureBoList[i].id) { |
86 | newPic.push(pictureBoList[i]) | 86 | newPic.push(pictureBoList[i]) |
@@ -91,7 +91,7 @@ var Bll = { | @@ -91,7 +91,7 @@ var Bll = { | ||
91 | }, | 91 | }, |
92 | //模态 | 92 | //模态 |
93 | toast: function (url, item, datacall) { | 93 | toast: function (url, item, datacall) { |
94 | - Bll.pictureBoList = item.pictureBoList||[]; | 94 | + Bll.pictureBoList = item.pictureBoList || []; |
95 | Bll.selectedBoId = []; | 95 | Bll.selectedBoId = []; |
96 | var a = new common.dialog({ | 96 | var a = new common.dialog({ |
97 | title: "图片", | 97 | title: "图片", |
@@ -100,31 +100,27 @@ var Bll = { | @@ -100,31 +100,27 @@ var Bll = { | ||
100 | button: [ | 100 | button: [ |
101 | { | 101 | { |
102 | value: "提交", callback: function () { | 102 | value: "提交", callback: function () { |
103 | - var data={}; | ||
104 | - if(item.__state=='add'){ | 103 | + var data = {}; |
104 | + if (item.__state == 'add') { | ||
105 | data = datacall && datacall(Bll.clonePics, Bll.selectedBoId); | 105 | data = datacall && datacall(Bll.clonePics, Bll.selectedBoId); |
106 | - }else{ | 106 | + } else { |
107 | data = datacall && datacall(Bll.getNewPics(Bll.clonePics), Bll.selectedBoId); | 107 | data = datacall && datacall(Bll.getNewPics(Bll.clonePics), Bll.selectedBoId); |
108 | } | 108 | } |
109 | - console.log("最终提交数据data",data); | 109 | + console.log("最终提交数据data", data); |
110 | common.util.__ajax({ | 110 | common.util.__ajax({ |
111 | url: url, | 111 | url: url, |
112 | data: data | 112 | data: data |
113 | }, function (res) { | 113 | }, function (res) { |
114 | - | ||
115 | if (res.code == '200') { | 114 | if (res.code == '200') { |
116 | - g.reload(); | ||
117 | - a.close(); | ||
118 | - } | ||
119 | - else{ | ||
120 | - console.log("res",res); | ||
121 | - if(res.data.length>0){ | ||
122 | - var mess="失败列表:"; | ||
123 | - for(var i=0;i<res.data.length;i++){ | ||
124 | - mess=mess+res.data[i].originalName+";" | 115 | + if (res.data.length > 0) { |
116 | + var mess = "失败列表:"; | ||
117 | + for (var i = 0; i < res.data.length; i++) { | ||
118 | + mess =mess + '<p>'+res.data[i].originalName + ';'+'</p>'; | ||
125 | } | 119 | } |
126 | common.util.__tip(mess, 'warning'); | 120 | common.util.__tip(mess, 'warning'); |
127 | } | 121 | } |
122 | + g.reload(); | ||
123 | + a.close(); | ||
128 | } | 124 | } |
129 | }); | 125 | }); |
130 | return false; | 126 | return false; |
@@ -145,13 +141,13 @@ var Bll = { | @@ -145,13 +141,13 @@ var Bll = { | ||
145 | valid_extensions: ['png', 'jpg', 'jpeg'], | 141 | valid_extensions: ['png', 'jpg', 'jpeg'], |
146 | onComplete: function (response) { | 142 | onComplete: function (response) { |
147 | if (response.status && response.code == 200) { | 143 | if (response.status && response.code == 200) { |
148 | - for(var i=0;i<response.data.length;i++){ | 144 | + for (var i = 0; i < response.datas.length; i++) { |
149 | Bll.pictureBoList.push({ | 145 | Bll.pictureBoList.push({ |
150 | - "fileName": response.data[i], | 146 | + "fileName": response.datas[i], |
151 | "originalName": response.names[i] | 147 | "originalName": response.names[i] |
152 | }); | 148 | }); |
153 | Bll.clonePics.push({ | 149 | Bll.clonePics.push({ |
154 | - "fileName": response.data[i], | 150 | + "fileName": response.datas[i], |
155 | "originalName": response.names[i] | 151 | "originalName": response.names[i] |
156 | }) | 152 | }) |
157 | } | 153 | } |
@@ -169,7 +165,7 @@ $('#upload-btn').on('click', function () { | @@ -169,7 +165,7 @@ $('#upload-btn').on('click', function () { | ||
169 | var item = { | 165 | var item = { |
170 | __state: "add" | 166 | __state: "add" |
171 | }; | 167 | }; |
172 | - Bll.clonePics=[]; | 168 | + Bll.clonePics = []; |
173 | Bll.toast('/shotManage/proPhoto/add', item, function (pictureBoList, selectedBoId) { | 169 | Bll.toast('/shotManage/proPhoto/add', item, function (pictureBoList, selectedBoId) { |
174 | return { | 170 | return { |
175 | productPhotoAddStrList: JSON.stringify(pictureBoList) | 171 | productPhotoAddStrList: JSON.stringify(pictureBoList) |
@@ -181,8 +177,8 @@ $('#upload-btn').on('click', function () { | @@ -181,8 +177,8 @@ $('#upload-btn').on('click', function () { | ||
181 | $(document).on('click', '.update', function () { | 177 | $(document).on('click', '.update', function () { |
182 | var item = g.rows[$(this).data("index")]; | 178 | var item = g.rows[$(this).data("index")]; |
183 | item.__state = "update"; | 179 | item.__state = "update"; |
184 | - Bll.clonePics=[]; | ||
185 | - Array.prototype.push.apply(Bll.clonePics,item.pictureBoList); | 180 | + Bll.clonePics = []; |
181 | + Array.prototype.push.apply(Bll.clonePics, item.pictureBoList); | ||
186 | Bll.toast('/shotManage/proPhoto/add', item, function (pictureBoList, selectedBoId) { | 182 | Bll.toast('/shotManage/proPhoto/add', item, function (pictureBoList, selectedBoId) { |
187 | return { | 183 | return { |
188 | productSkn: item.productSkn, | 184 | productSkn: item.productSkn, |
@@ -195,7 +191,7 @@ $(document).on('click', '.update', function () { | @@ -195,7 +191,7 @@ $(document).on('click', '.update', function () { | ||
195 | //删除单张图片 | 191 | //删除单张图片 |
196 | $(document).on('click', '.remove1', function () { | 192 | $(document).on('click', '.remove1', function () { |
197 | var index = $(this).data("index"); | 193 | var index = $(this).data("index"); |
198 | - if(Bll.clonePics[index].id){ | 194 | + if (Bll.clonePics[index].id) { |
199 | Bll.selectedBoId.push(Bll.clonePics[index].id); | 195 | Bll.selectedBoId.push(Bll.clonePics[index].id); |
200 | } | 196 | } |
201 | Bll.clonePics.splice(index, 1); | 197 | Bll.clonePics.splice(index, 1); |
@@ -99,7 +99,8 @@ exports.uploadFile = function (req, res) { | @@ -99,7 +99,8 @@ exports.uploadFile = function (req, res) { | ||
99 | } | 99 | } |
100 | res.json({ | 100 | res.json({ |
101 | code: 200, | 101 | code: 200, |
102 | - data: flag?datas:datas[0], | 102 | + data: datas[0], |
103 | + datas:datas, | ||
103 | names: req.body.fileNames, | 104 | names: req.body.fileNames, |
104 | message: '上传成功', | 105 | message: '上传成功', |
105 | status: true | 106 | status: true |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <div class="media-body"> | 7 | <div class="media-body"> |
8 | <ul class="breadcrumb"> | 8 | <ul class="breadcrumb"> |
9 | <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li> | 9 | <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li> |
10 | - <li><a href="">拍摄</a></li> | 10 | + <li><a href="">拍摄复尺</a></li> |
11 | <li>拍摄上传</li> | 11 | <li>拍摄上传</li> |
12 | </ul> | 12 | </ul> |
13 | <div> | 13 | <div> |
-
Please register or login to post a comment