Authored by 陶雨

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

@@ -34,6 +34,10 @@ var ENUM = { @@ -34,6 +34,10 @@ var ENUM = {
34 '3': 0, 34 '3': 0,
35 '4': 0, 35 '4': 0,
36 'all': 0 36 'all': 0
  37 + },
  38 + isVIP: {
  39 + 'N': '否',
  40 + 'Y': '是'
37 } 41 }
38 }; 42 };
39 43
@@ -176,7 +180,7 @@ var g = new common.grid({ @@ -176,7 +180,7 @@ var g = new common.grid({
176 }, { 180 }, {
177 display: '售价', 181 display: '售价',
178 render: function(item) { 182 render: function(item) {
179 - var vip = item.isVIP ? item.isVIP : '', 183 + var vip = item.isVIP ? ENUM.isVIP[item.isVIP] : '',
180 retailPrice = item.retailPrice ? item.retailPrice : '', 184 retailPrice = item.retailPrice ? item.retailPrice : '',
181 salesPrice = item.salesPrice ? item.salesPrice : ''; 185 salesPrice = item.salesPrice ? item.salesPrice : '';
182 return '<p><strong>吊牌价:</strong>' + retailPrice + '</p>' + 186 return '<p><strong>吊牌价:</strong>' + retailPrice + '</p>' +
@@ -261,7 +265,7 @@ var g = new common.grid({ @@ -261,7 +265,7 @@ var g = new common.grid({
261 display: '缺失信息', 265 display: '缺失信息',
262 hidden: true, 266 hidden: true,
263 render: function(item) { 267 render: function(item) {
264 - return item.missInfo; 268 + return '<p style="color: red;">' + item.missInfo + '</p>'
265 } 269 }
266 }, { 270 }, {
267 display: '操作', 271 display: '操作',
@@ -73,8 +73,22 @@ $('#goods-table').html(common.util.__template2($('#goodsList').html(), { @@ -73,8 +73,22 @@ $('#goods-table').html(common.util.__template2($('#goodsList').html(), {
73 //上架必填 73 //上架必填
74 productExtBo.renderType = $('.contentpanel').data('type'); 74 productExtBo.renderType = $('.contentpanel').data('type');
75 productExtBo.sellChannels = productExtBo.sellChannels ? productExtBo.sellChannels.replace(/,/g, "|") : ''; 75 productExtBo.sellChannels = productExtBo.sellChannels ? productExtBo.sellChannels.replace(/,/g, "|") : '';
76 -$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo)); 76 +productExtBo.shopIds = productExtBo.shopIdList ? productExtBo.shopIdList.join('|') : '';
  77 +//productExtBo.shopList =
  78 +
77 79
  80 +common.util.__ajax({
  81 + url: '/goods/ShopsRest/queryShopsByBrandId',
  82 + data: {
  83 + brandId: basicInfo.brandId
  84 + }
  85 +}, function(res) {
  86 + productExtBo.shopList = res.data;
  87 + $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
  88 + e.init();
  89 +}, true);
  90 +
  91 +$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
78 92
79 93
80 if ($('.contentpanel').data('type') == 'info') { 94 if ($('.contentpanel').data('type') == 'info') {
@@ -105,6 +119,7 @@ GOLABDATA.on("LYbasicInfo", function() { @@ -105,6 +119,7 @@ GOLABDATA.on("LYbasicInfo", function() {
105 var list = option.data.sellChannels.split('|').join(','); 119 var list = option.data.sellChannels.split('|').join(',');
106 option.data.productSkn = $('#productSkn').val(); 120 option.data.productSkn = $('#productSkn').val();
107 option.data.sellChannels = list; 121 option.data.sellChannels = list;
  122 + option.data.shopIds = $('#shopIds').val() ? $('#shopIds').val().split('|').join(',') : '';
108 option.debug = true; 123 option.debug = true;
109 }); 124 });
110 }); 125 });
@@ -217,7 +217,6 @@ var goodsList = {}; @@ -217,7 +217,6 @@ var goodsList = {};
217 if (window.NETSALEDATA && window.NETSALEDATA.goodsList) { 217 if (window.NETSALEDATA && window.NETSALEDATA.goodsList) {
218 goodsList = window.NETSALEDATA.goodsList; 218 goodsList = window.NETSALEDATA.goodsList;
219 } 219 }
220 -console.log("封面设置", goodsList);  
221 $("#fenmianWrap").html(common.util.__template2($("#fenmianTemp").html(), { 220 $("#fenmianWrap").html(common.util.__template2($("#fenmianTemp").html(), {
222 goodsList: goodsList 221 goodsList: goodsList
223 })); 222 }));
@@ -302,6 +301,4 @@ GOLABDATA.on("fenmian", function() { @@ -302,6 +301,4 @@ GOLABDATA.on("fenmian", function() {
302 return { 301 return {
303 "goodsImagesReq": JSON.stringify(map) 302 "goodsImagesReq": JSON.stringify(map)
304 } 303 }
305 -});  
306 -  
307 - 304 +});
@@ -426,6 +426,14 @@ exports.res = [ @@ -426,6 +426,14 @@ exports.res = [
426 isJsonRaw: true 426 isJsonRaw: true
427 } 427 }
428 } 428 }
  429 + }, {
  430 + route: '/goods/ShopsRest/queryShopsByBrandId',
  431 + method: 'POST',
  432 + url: '/ShopsRest/queryShopsByBrandId',
  433 + params: [{
  434 + name: 'brandId',
  435 + type: 'number'
  436 + }]
429 }, 437 },
430 /* { 438 /* {
431 //网销信息 -> 查询制作工艺列表 439 //网销信息 -> 查询制作工艺列表
@@ -571,7 +579,7 @@ exports.res = [ @@ -571,7 +579,7 @@ exports.res = [
571 name: 'param', 579 name: 'param',
572 type: 'Number' 580 type: 'Number'
573 }] 581 }]
574 - },{ 582 + }, {
575 //单个变价接口 583 //单个变价接口
576 route: '/goods/updatePrice', 584 route: '/goods/updatePrice',
577 method: 'POST', 585 method: 'POST',
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 65
66 <div class="footpanel" style="text-align: center;"> 66 <div class="footpanel" style="text-align: center;">
67 <a id="saveAllInfo" href="javascript:;" class="btn btn-primary btn-lg">保存</a> 67 <a id="saveAllInfo" href="javascript:;" class="btn btn-primary btn-lg">保存</a>
68 - <a id="backBtn" href="history.go(-1)" class="btn btn-default btn-lg">返回</a> 68 + <a id="backBtn" href="javascript:;" onclick="history.go(-1)" class="btn btn-default btn-lg">返回</a>
69 </div> 69 </div>
70 70
71 <div class="floatnav"> 71 <div class="floatnav">
@@ -154,4 +154,15 @@ @@ -154,4 +154,15 @@
154 [[/if]] 154 [[/if]]
155 天下架</div> 155 天下架</div>
156 </div> 156 </div>
  157 + [[if shopList]]
  158 + <div class="form-group">
  159 + <div class="col-sm-12">
  160 + <label>展示店铺:</label>
  161 + [[each shopList as a index]]
  162 + <label style="cursor: pointer;"><input type="checkbox" name="shopIds" value="[[a.shopsId]]">[[a.shopName]]</label>
  163 + [[/each]]
  164 + <input id="shopIds" value="[[shopIds]]" type="hidden" for="checkbox">
  165 + </div>
  166 + </div>
  167 + [[/if]]
157 </script> 168 </script>
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 11
12 </div> 12 </div>
13 <div class="panel-footer"> 13 <div class="panel-footer">
14 - <button class="btn btn-pass" id="fenMainSave">保存</button> 14 + <button class="btn btn-primary" id="fenMainSave">保存</button>
15 </div> 15 </div>
16 </div> 16 </div>
17 <script type="text/template" id="fenmianTemp"> 17 <script type="text/template" id="fenmianTemp">
@@ -84,6 +84,7 @@ @@ -84,6 +84,7 @@
84 </div> 84 </div>
85 </div> 85 </div>
86 [[/each]] 86 [[/each]]
  87 +
87 </script> 88 </script>
88 <script type="text/template" id="fenmianImgTemp"> 89 <script type="text/template" id="fenmianImgTemp">
89 <li class="cover-image-item fileinput-button" data-index=[[__index]]> 90 <li class="cover-image-item fileinput-button" data-index=[[__index]]>