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
Plain Diff
Browse Files
Authored by
liuyue
9 years ago
Commit
cbbbda8083b91795d0fb0e575349837fc78dd87b
2 parents
6fd6930f
0023b9f8
Merge branch 'develop' of git.dev.yoho.cn:platform/yohobuy-portal-fe into develop
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
36 deletions
client/js/goods/netsale-edit.js
client/js/goods/partials/editor_recommend.js
client/js/goods/partials/netsale-ty.js
server/interface/netSaleWq.js
server/mid/grayroute.js
server/views/partials/netsale/close-match.html
client/js/goods/netsale-edit.js
View file @
cbbbda8
...
...
@@ -23,12 +23,25 @@ window.GOLABDATA={
},
fire
:
function
(
key
){
var
that
=
this
;
if
(
!
this
.
registerEvent
||
!
this
.
registerEvent
[
key
])
return
;
var
listeners
=
that
.
registerEvent
[
key
];
var
args
=
[].
slice
.
call
(
arguments
,
1
);
for
(
var
i
in
listeners
){
return
listeners
[
i
].
apply
(
this
,
args
);
if
(
!
this
.
registerEvent
)
return
;
if
(
key
){
if
(
!
this
.
registerEvent
[
key
])
return
;
var
listeners
=
that
.
registerEvent
[
key
];
var
args
=
[].
slice
.
call
(
arguments
,
1
);
for
(
var
i
in
listeners
){
return
listeners
[
i
].
apply
(
this
,
args
);
}
}
else
{
var
map
=
{},
args
=
[].
slice
.
call
(
arguments
,
1
);
for
(
var
key
in
that
.
registerEvent
){
var
listeners
=
that
.
registerEvent
[
key
];
for
(
var
i
in
listeners
){
map
[
key
]
=
listeners
[
i
].
apply
(
this
,
args
);
}
}
return
map
;
}
}
};
...
...
client/js/goods/partials/editor_recommend.js
View file @
cbbbda8
...
...
@@ -47,6 +47,13 @@ $(document).on("click","#btn-recommand",function(){
return
false
;
});
GOLABDATA
.
on
(
"bianjiqi"
,
function
(){
return
{
recommend
:
UMrecommender
.
getContent
(),
productDesc
:
UMdescriptioner
.
getContent
()
}
});
/*搭配*/
var
g
=
new
common
.
grid
({
...
...
@@ -188,6 +195,13 @@ $(document).on("click","#dapeiTable .edit",function(){
// Bll.toast("添加搭配",item,"/netSale/updateCollocation");
});
// GOLABDATA.on("bianjiqi",function(){
// // return {
// // recommend:UMrecommender.getContent(),
// // productDesc:UMdescriptioner.getContent()
// // }
// });
/*封面设置*/
var
goodsImagesList
=
{};
if
(
window
.
NETSALEDATA
&&
window
.
NETSALEDATA
.
goodsImagesList
){
...
...
client/js/goods/partials/netsale-ty.js
View file @
cbbbda8
...
...
@@ -50,11 +50,11 @@ if(window.NETSALEDATA) {
});
$
(
document
).
on
(
'change'
,
'.washTips'
,
function
()
{
var
items
=
$
(
"#washTips"
).
val
().
split
(
"|"
);
for
(
var
i
=
0
;
i
<
items
.
length
;
i
++
)
{
washTipsList
[
i
]
=
{
"sortId"
:
parseInt
(
items
[
i
])};
}
});
var
items
=
$
(
"#washTips"
).
val
().
split
(
"|"
);
for
(
var
i
=
0
;
i
<
items
.
length
;
i
++
)
{
washTipsList
[
i
]
=
{
"sortId"
:
parseInt
(
items
[
i
])};
}
});
$
(
document
).
on
(
'click'
,
"#propertySave"
,
function
()
{
...
...
@@ -72,7 +72,18 @@ if(window.NETSALEDATA) {
// body...
});
});
window
.
GOLABDATA
.
on
(
'TYcaizhi'
,
function
()
{
var
washTips
=
$
(
"#washTips"
).
val
()
||
""
;
var
productMaterial
=
$
(
"#material"
).
val
()
||
""
;
return
{
"washTips"
:
washTips
.
replace
(
/
\|
/g
,
","
),
"productMaterial"
:
productMaterial
.
replace
(
/
\|
/g
,
","
)
};
});
}
{
//搜索关键词
var
searchKeys
=
""
;
if
(
window
.
NETSALEDATA
.
productExtBo
)
{
...
...
@@ -118,7 +129,17 @@ if(window.NETSALEDATA) {
});
});
window
.
GOLABDATA
.
on
(
'TYsearchKey'
,
function
()
{
var
washTips
=
$
(
"#washTips"
).
val
()
||
""
;
var
productMaterial
=
$
(
"#material"
).
val
()
||
""
;
return
{
"searchKeys"
:
searchKeys
};
});
}
{
//尺寸信息
var
sizeInfo
=
{};
if
(
window
.
NETSALEDATA
.
sizeInfo
)
{
...
...
@@ -126,6 +147,8 @@ if(window.NETSALEDATA) {
}
$
(
"#body"
).
html
(
common
.
util
.
__template2
(
$
(
"#sizeifo-template"
).
html
(),
sizeInfo
));
}
{
//搜索优先级
var
searchSortList
=
[];
if
(
window
.
NETSALEDATA
.
searchSortList
)
{
...
...
@@ -160,27 +183,38 @@ if(window.NETSALEDATA) {
}
}
window
.
NETSALEDATA
.
searchSortList
=
item
;
searchSortList
=
item
;
$
(
'#sort-save'
).
on
(
'click'
,
function
()
{
common
.
util
.
__ajax
({
url
:
'/netSale/saveSearchSort'
,
data
:{
searchSortList
:
JSON
.
stringify
(
window
.
NETSALEDATA
.
searchSortList
)}
data
:{
searchSortList
:
JSON
.
stringify
(
searchSortList
)}
},
function
()
{
});
});
$
(
"#sort0"
).
on
(
'change'
,
function
()
{
window
.
NETSALEDATA
.
searchSortList
[
0
].
intValue
=
parseInt
(
$
(
"#sort0"
).
val
());
searchSortList
[
0
].
intValue
=
parseInt
(
$
(
"#sort0"
).
val
());
});
$
(
"#sort1"
).
on
(
'change'
,
function
()
{
window
.
NETSALEDATA
.
searchSortList
[
1
].
intValue
=
parseInt
(
$
(
"#sort1"
).
val
());
searchSortList
[
1
].
intValue
=
parseInt
(
$
(
"#sort1"
).
val
());
});
$
(
"#sort2"
).
on
(
'change'
,
function
()
{
window
.
NETSALEDATA
.
searchSortList
[
2
].
intValue
=
parseInt
(
$
(
"#sort2"
).
val
());
searchSortList
[
2
].
intValue
=
parseInt
(
$
(
"#sort2"
).
val
());
});
window
.
GOLABDATA
.
on
(
'TYsearchSort'
,
function
()
{
if
(
!
searchSortList
[
0
]
||
!
searchSortList
[
1
]
||
!
searchSortList
[
2
])
return
"请将搜索排序填写完整!"
;
return
{
"searchSortList"
:
JSON
.
stringify
(
searchSortList
)
};
});
}
}
\ No newline at end of file
}
...
...
server/interface/netSaleWq.js
View file @
cbbbda8
exports
.
domain
=
require
(
'../config/common.js'
).
domain
;
// exports.domain = require('../config/common.js').domain;
exports
.
domain
=
'http://172.16.6.227:8083/yohobuy-platform-web'
;
exports
.
res
=
[
//商品描述
{
...
...
server/mid/grayroute.js
View file @
cbbbda8
...
...
@@ -45,6 +45,7 @@ module.exports = function(proxyRoute) {
}
//删除提交内容长度,代理会改变长度
delete
options
.
headers
[
'content-length'
];
delete
options
.
headers
[
"accept-encoding"
];
//设置代理host
options
.
headers
[
'host'
]
=
config
.
url
.
replace
(
'http://'
,
''
);
if
(
!
req
.
session
.
gray
)
{
...
...
@@ -56,13 +57,14 @@ module.exports = function(proxyRoute) {
logger
.
log
(
'info'
,
'grayroute: request options: %j'
,
options
,{});
//发起代理请求
if
(
req
.
is
(
'html'
)
)
{
if
(
req
.
headers
[
'accept'
].
indexOf
(
'text/html'
)
>-
1
)
{
request
(
options
,
function
(
err
,
res
,
body
)
{
if
(
err
)
{
logger
.
log
(
'error'
,
'grayroute: request error:'
,
err
);
ress
.
status
(
500
).
send
(
''
);
}
else
{
setGrayCookie
(
req
,
res
);
var
ContentType
=
res
.
caseless
.
get
(
'Content-Type'
);
ress
.
append
(
'Content-Type'
,
ContentType
);
ress
.
status
(
res
.
statusCode
).
send
(
body
);
}
});
...
...
@@ -85,19 +87,4 @@ module.exports = function(proxyRoute) {
next
();
}
}
}
/**
* 灰度cookie设置
* @param {Object} req express request
* @param {Object} res request的响应
*/
function
setGrayCookie
(
req
,
res
)
{
//cookie透传到老系统
var
cookie
=
res
.
caseless
.
get
(
'set-cookie'
);
//如果没有设置到session
if
(
cookie
&&
cookie
.
length
>
0
&&
!
req
.
session
.
gray
)
{
req
.
session
.
gray
=
cookie
[
0
];
}
return
cookie
;
}
\ No newline at end of file
...
...
server/views/partials/netsale/close-match.html
View file @
cbbbda8
...
...
@@ -12,7 +12,7 @@
</div>
<div
class=
"panel-footer"
>
<button
class=
"btn btn-primary"
id=
"dapeiadd"
>
添加搭配
</button>
<
button
class=
"btn btn-primary"
id=
"dapeisave"
>
保存
</button
>
<
!-- <button class="btn btn-primary" id="dapeisave">保存</button> --
>
</div>
</form>
</div>
...
...
Please
register
or
login
to post a comment