Authored by liuyue

网销

@@ -148,21 +148,40 @@ var g = new common.grid({ @@ -148,21 +148,40 @@ var g = new common.grid({
148 display: '图片', 148 display: '图片',
149 name: 'picImgUrl', 149 name: 'picImgUrl',
150 render: function(item) { 150 render: function(item) {
151 - return '<img src="' + item.picImgUrl + '">'; 151 + if (item.picImgUrl) {
  152 + return '<img src="' + item.picImgUrl + '" width="100" height="60">';
  153 + } else {
  154 + return '';
  155 + }
  156 +
152 } 157 }
153 }, { 158 }, {
154 display: '商品信息', 159 display: '商品信息',
155 render: function(item) { 160 render: function(item) {
156 - return '<p><strong>名称:</strong>' + item.productName + '</p>' +  
157 - '<p><strong>品牌:</strong>' + item.brandName + '</p>' +  
158 - '<p><strong>类目:</strong>' + item.maxSortName + '/' + item.middleSortName + '</p>'; 161 + var productName = item.productName ? item.productName : '',
  162 + brandName = item.brandName ? item.brandName : '',
  163 + maxSortName = item.maxSortName ? item.maxSortName : '',
  164 + middleSortName = item.middleSortName ? item.middleSortName : '',
  165 + html = '';
  166 +
  167 + html += '<p><strong>名称:</strong>' + productName + '</p>';
  168 + html += '<p><strong>品牌:</strong>' + brandName + '</p>';
  169 + html += '<p><strong>类目:</strong>' + maxSortName;
  170 + if (middleSortName) {
  171 + html += '/' + middleSortName;
  172 + }
  173 +
  174 + return html + '</p>';
159 } 175 }
160 }, { 176 }, {
161 display: '售价', 177 display: '售价',
162 render: function(item) { 178 render: function(item) {
163 - return '<p><strong>吊牌价:</strong>' + item.retailPrice + '</p>' +  
164 - '<p><strong>销售价:</strong>' + item.salesPrice + '</p>' +  
165 - '<p><strong>是否VIP:</strong>' + item.isVIP + '</p>'; 179 + var vip = item.isVIP ? item.isVIP : '',
  180 + retailPrice = item.retailPrice ? item.retailPrice : '',
  181 + salesPrice = item.salesPrice ? item.salesPrice : '';
  182 + return '<p><strong>吊牌价:</strong>' + retailPrice + '</p>' +
  183 + '<p><strong>销售价:</strong>' + salesPrice + '</p>' +
  184 + '<p><strong>是否VIP:</strong>' + vip + '</p>';
166 /*'<p style="color: #ccc;"><strong>yoho币:</strong>' + item.returnCoin + '</p>';*/ 185 /*'<p style="color: #ccc;"><strong>yoho币:</strong>' + item.returnCoin + '</p>';*/
167 } 186 }
168 }, { 187 }, {
@@ -170,24 +189,43 @@ var g = new common.grid({ @@ -170,24 +189,43 @@ var g = new common.grid({
170 name: 'stock' 189 name: 'stock'
171 }, { 190 }, {
172 display: '年龄层/性别', 191 display: '年龄层/性别',
173 - name: 'vip_discount_type',  
174 render: function(item) { 192 render: function(item) {
175 - return ENUM.ageLevel[item.ageLevel] + '/' + ENUM.gender[item.gender]; 193 + var html = '';
  194 +
  195 + if (item.ageLevel) {
  196 + html += ENUM.ageLevel[item.ageLevel];
  197 + if (item.gender) {
  198 + html += '/';
  199 + }
  200 + }
  201 + if (item.gender) {
  202 + html += ENUM.gender[item.gender]
  203 + }
  204 + return html;
176 } 205 }
177 }, { 206 }, {
178 display: '商品类别', 207 display: '商品类别',
179 name: 'attribute', //商品属性(1普通、2赠品等) 商品类别 208 name: 'attribute', //商品属性(1普通、2赠品等) 商品类别
180 render: function(item) { 209 render: function(item) {
181 - return ENUM.attribute[item.attribute]; 210 + if (item.attribute) {
  211 + return ENUM.attribute[item.attribute];
  212 + } else {
  213 + return '';
  214 + }
  215 +
182 } 216 }
183 }, { 217 }, {
184 display: '搜索/标签', 218 display: '搜索/标签',
185 hidden: true, 219 hidden: true,
186 render: function(item) { 220 render: function(item) {
187 - return '关键词:' + item.searchAndLabel + '<br>' +  
188 - '风格:' + item.style + '<br>' +  
189 - '纹理:' + item.pattern + '<br>' +  
190 - '工艺:' + item.makeCrafts + '<br>'; 221 + var searchAndLabel = item.searchAndLabel ? item.searchAndLabel : '',
  222 + style = item.style ? item.style : '',
  223 + pattern = item.pattern ? item.pattern : '',
  224 + makeCrafts = item.makeCrafts ? item.makeCrafts : '';
  225 + return '关键词:' + searchAndLabel + '<br>' +
  226 + '风格:' + style + '<br>' +
  227 + '纹理:' + pattern + '<br>' +
  228 + '工艺:' + makeCrafts + '<br>';
191 } 229 }
192 }, { 230 }, {
193 display: '操作信息', 231 display: '操作信息',
@@ -208,7 +246,9 @@ var g = new common.grid({ @@ -208,7 +246,9 @@ var g = new common.grid({
208 name: 'status', // -1待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过。 246 name: 'status', // -1待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过。
209 render: function(item) { 247 render: function(item) {
210 var html = ''; 248 var html = '';
211 - html += ENUM.status[item.status]; 249 + if (ENUM.status[item.status]) {
  250 + html += ENUM.status[item.status];
  251 + }
212 if (item.shelveTime) { 252 if (item.shelveTime) {
213 html += '<br>上架时间:' + item.shelveTime; 253 html += '<br>上架时间:' + item.shelveTime;
214 } 254 }
1 exports.domain = require('../config/common.js').domain; 1 exports.domain = require('../config/common.js').domain;
2 -// exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //马力 2 +//exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //马力
3 //exports.domain = 'http://172.16.6.236:8080/platform'; //钱军 3 //exports.domain = 'http://172.16.6.236:8080/platform'; //钱军
4 //exports.domain = 'http://172.16.6.162:8088/platform'; //李建 4 //exports.domain = 'http://172.16.6.162:8088/platform'; //李建
5 5
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 <div class="form-group"> 35 <div class="form-group">
36 <label class="col-sm-2 control-label">商品名称<span class="red">*</span></label> 36 <label class="col-sm-2 control-label">商品名称<span class="red">*</span></label>
37 <div class="col-sm-8"> 37 <div class="col-sm-8">
38 - <input type="text" id="productName" placeholder="商品名称" class="form-control" required maxlength="30" value="{{productName}}"> 38 + <input type="text" id="productName" placeholder="商品名称" class="form-control" required value="{{productName}}">
39 </div> 39 </div>
40 </div> 40 </div>
41 <div class="form-group"> 41 <div class="form-group">
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 [[each productStyle as a index]] 21 [[each productStyle as a index]]
22 [[if index=="data"]] 22 [[if index=="data"]]
23 [[each a as b index]] 23 [[each a as b index]]
24 - <label style="cursor: pointer;"><input type="checkbox" name="style" value="[[b.id]]">[[b.text]]</label> 24 + <label style="cursor: pointer;"><input type="checkbox" name="style" value="[[b.text]]">[[b.text]]</label>
25 [[/each]] 25 [[/each]]
26 [[/if]] 26 [[/if]]
27 [[/each]] 27 [[/each]]
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 [[each productElements as a index]] 34 [[each productElements as a index]]
35 [[if index=="data"]] 35 [[if index=="data"]]
36 [[each a as b index]] 36 [[each a as b index]]
37 - <label style="cursor: pointer;"><input type="checkbox" name="pattern" value="[[b.id]]">[[b.text]]</label> 37 + <label style="cursor: pointer;"><input type="checkbox" name="pattern" value="[[b.text]]">[[b.text]]</label>
38 [[/each]] 38 [[/each]]
39 [[/if]] 39 [[/if]]
40 [[/each]] 40 [[/each]]