Authored by liuyue

补全信息apis

... ... @@ -158,7 +158,7 @@ var g = new common.grid({
name: 'picImgUrl',
render: function(item) {
if (item.picImgUrl) {
return '<a href="' + item.productUrl + '"><img src="' + item.picImgUrl + '" width="100" height="60"></a>';
return '<a target="_blank" href="' + item.productUrl + '"><img src="' + item.picImgUrl + '" width="100" height="60"></a>';
} else {
return '';
}
... ... @@ -174,7 +174,7 @@ var g = new common.grid({
middleSortName = item.middleSortName ? item.middleSortName : '',
html = '';
html += '<p><strong>名称:</strong><a href="' + item.productUrl + '">' + productName + '</a></p>';
html += '<p><strong>名称:</strong><a target="_blank" href="' + item.productUrl + '">' + productName + '</a></p>';
html += '<p><strong>品牌:</strong>' + brandName + '</p>';
html += '<p><strong>类目:</strong>' + maxSortName;
if (middleSortName) {
... ...
... ... @@ -73,7 +73,7 @@ GOLABDATA.on("LYaddInfo", function() {
$.ajax({
type: 'POST',
url: '/goods/product/queryAfterSaleInfo',
url: '/goods/product/queryAttributesByConf',
data: {
saleType: 2,
displayPosition: 3,
... ... @@ -105,7 +105,7 @@ $.ajax({
if (NETSALEDATA.attributeProValuesBosTwo) {
$.each(NETSALEDATA.attributeProValuesBosTwo, function(i, value) {
$.each(data.attributes.data, function(i2, value2) {
$.each(data.data, function(i2, value2) {
if (value.attributeId == value2.attributeId) {
value2.selectedValues = value.attributeValueId.replace(/,/g, "|");
}
... ... @@ -113,17 +113,6 @@ $.ajax({
});
}
$.each(data.productComfort.data, function(index, item) {
if (comfort && comfort[index]) {
item.value = comfort[index].value;
} else {
item.value = '';
}
});
$('#addinfo-wrap').html(common.util.__template2($('#addInfoTemp').html(), data));
e.on("bind", function() {
... ...
... ... @@ -4,8 +4,7 @@ exports.domain = require('../config/common.js').domain;
//exports.domain = 'http://172.16.6.162:8088/platform'; //李建
//商品管理路由配置
exports.res = [
{
exports.res = [{
//网销信息 -> 网销信息页面渲染
route: '/goods/netsale/index',
method: 'GET',
... ... @@ -207,8 +206,8 @@ exports.res = [
src: '/goods/netsale-edit',
data: {
type: 'info',
subtitle:"查看",
maintitle:"查看商品信息"
subtitle: "查看",
maintitle: "查看商品信息"
} //,
// params: [{
... ... @@ -225,8 +224,8 @@ exports.res = [
src: '/goods/netsale-edit',
data: {
type: 'edit',
subtitle:"编辑",
maintitle:"编辑商品信息"
subtitle: "编辑",
maintitle: "编辑商品信息"
} //,
// params: [{
... ... @@ -393,44 +392,19 @@ exports.res = [
}]
}, {
//网销信息 -> 查询补全信息
route: '/goods/product/queryAfterSaleInfo',
route: '/goods/product/queryAttributesByConf',
method: 'POST',
apis: {
productStyle: {
url: '/productStyle/queryProductStyles4Select'
},
productComfort: {
url: '/productComfort/queryProductComfortList'
},
productElements: {
url: '/productElements/queryProductElements4Select'
},
makingProcess: {
url: '/product/queryMakingProcess',
params: [{
name: 'categoryId',
type: 'number'
}, {
name: 'displayPosition',
type: 'number'
}],
isJsonRaw: true
},
attributes: {
url: '/product/queryAttributesByConf',
params: [{
name: 'categoryId',
type: 'number'
}, {
name: 'displayPosition',
type: 'number'
}, {
name: 'saleType',
type: 'number'
}],
isJsonRaw: true
}
}
url: '/product/queryAttributesByConf',
params: [{
name: 'categoryId',
type: 'number'
}, {
name: 'displayPosition',
type: 'number'
}, {
name: 'saleType',
type: 'number'
}]
}, {
route: '/goods/ShopsRest/queryShopsByBrandId',
method: 'POST',
... ...
... ... @@ -83,31 +83,27 @@
[[/each]]
</div>-->
<script type="text/template" id="addInfoTemp">
[[each attributes as a index]]
[[if index=="data"]]
[[each a as b index]]
<div class="attribute-group form-group">
<label>[[b.attributeName]]</label>
[[if b.inputType=='select']]
<div style="display: inline-block;width: 280px;">
<select class="form-control" id="[[b.attributeId]]" value="[[b.selectedValues||'']]">
[[each b.idNameList as c index]]
<option value="[[c.id]]">[[c.text]]</option>
[[/each]]
</select>
</div>
[[else]]
<span>
[[each data as b index]]
<div class="attribute-group form-group">
<label>[[b.attributeName]]</label>
[[if b.inputType=='select']]
<div style="display: inline-block;width: 280px;">
<select class="form-control" id="[[b.attributeId]]" value="[[b.selectedValues||'']]">
[[each b.idNameList as c index]]
<label style="cursor: pointer;"><input name="[[b.attributeId]]" type="[[b.inputType]]" value="[[c.id]]">[[c.text]]</label>
<option value="[[c.id]]">[[c.text]]</option>
[[/each]]
</span>
<input id="[[b.attributeId]]" type="hidden" for="[[b.inputType]]" value="[[b.selectedValues||'']]">
[[/if]]
</select>
</div>
[[/each]]
[[/if]]
[[else]]
<span>
[[each b.idNameList as c index]]
<label style="cursor: pointer;"><input name="[[b.attributeId]]" type="[[b.inputType]]" value="[[c.id]]">[[c.text]]</label>
[[/each]]
</span>
<input id="[[b.attributeId]]" type="hidden" for="[[b.inputType]]" value="[[b.selectedValues||'']]">
[[/if]]
</div>
[[/each]]
<div id="brandModelWrap" class="form-group">
<label>品牌款型:</label>
... ...
... ... @@ -39,12 +39,22 @@
[[if b.idNameList && b.idNameList.length>0]]
<div class="goods-param-group form-group">
<label>[[b.attributeName]]</label>
<span>
[[if b.inputType=='select']]
<div style="display: inline-block;width: 280px;">
<select class="form-control" id="[[b.attributeId]]" value="[[b.selectedValues||'']]">
[[each b.idNameList as c index]]
<option value="[[c.id]]">[[c.text]]</option>
[[/each]]
</select>
</div>
[[else]]
<span>
[[each b.idNameList as c index]]
<label style="cursor: pointer;"><input name="[[b.attributeId]]" type="[[b.inputType]]" value="[[c.id]]">[[c.text]]</label>
[[/each]]
</span>
<input id="[[b.attributeId]]" type="hidden" for="[[b.inputType]]" value="[[b.selectedValues]]" [[b.isMust=="N"?"":"required"]] placeholder="[[b.attributeName]]">
</span>
<input id="[[b.attributeId]]" type="hidden" for="[[b.inputType]]" value="[[b.selectedValues||'']]">
[[/if]]
</div>
[[/if]]
[[/each]]
... ...