Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-portal-fe
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
liuyue
9 years ago
Commit
e5a75f4ab957be4dda8b1420cd26056e2117bacf
1 parent
65be27d6
补全信息apis
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
83 deletions
client/js/goods/netsale.js
client/js/goods/partials/add-info.js
server/interface/goods.js
server/views/partials/netsale/add-info.html
server/views/partials/netsale/goods-params.html
client/js/goods/netsale.js
View file @
e5a75f4
...
...
@@ -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
)
{
...
...
client/js/goods/partials/add-info.js
View file @
e5a75f4
...
...
@@ -73,7 +73,7 @@ GOLABDATA.on("LYaddInfo", function() {
$
.
ajax
({
type
:
'POST'
,
url
:
'/goods/product/queryA
fterSaleInfo
'
,
url
:
'/goods/product/queryA
ttributesByConf
'
,
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
()
{
...
...
server/interface/goods.js
View file @
e5a75f4
...
...
@@ -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/queryA
fterSaleInfo
'
,
route
:
'/goods/product/queryA
ttributesByConf
'
,
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'
,
...
...
server/views/partials/netsale/add-info.html
View file @
e5a75f4
...
...
@@ -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
>
...
...
server/views/partials/netsale/goods-params.html
View file @
e5a75f4
...
...
@@ -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]
]
...
...
Please
register
or
login
to post a comment