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
2a7b6b756fcd47d177daf049dfb1416786657e20
1 parent
bf4fe117
编辑器全屏,关联店铺全选
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
93 additions
and
66 deletions
client/js/common/umeditor.config.js
client/js/goods/netsale-edit.js
client/js/goods/netsale.js
client/js/goods/partials/basic-info.js
client/js/goods/partials/editor_recommend.js
client/sass/common/global.scss
server/views/pages/goods/netsale.html
server/views/partials/netsale/add-info.html
client/js/common/umeditor.config.js
View file @
2a7b6b7
...
...
@@ -10,7 +10,7 @@
**************************提示********************************/
(
function
()
{
(
function
()
{
/**
* 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。
* 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。
...
...
@@ -19,8 +19,8 @@
* 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。
* window.UMEDITOR_HOME_URL = "/xxxx/xxxx/";
*/
window
.
UMEDITOR_HOME_URL
=
"http://"
+
location
.
host
+
"/"
;
var
URL
=
window
.
UMEDITOR_HOME_URL
||
(
function
(){
window
.
UMEDITOR_HOME_URL
=
"http://"
+
location
.
host
+
"/"
;
var
URL
=
window
.
UMEDITOR_HOME_URL
||
(
function
()
{
function
PathStack
()
{
...
...
@@ -34,83 +34,83 @@
this
.
path
=
this
.
documentURL
;
this
.
stack
=
[];
this
.
push
(
this
.
documentURL
);
this
.
push
(
this
.
documentURL
);
}
PathStack
.
isParentPath
=
function
(
path
)
{
PathStack
.
isParentPath
=
function
(
path
)
{
return
path
===
'..'
;
};
PathStack
.
hasProtocol
=
function
(
path
){
return
!!
PathStack
.
getProtocol
(
path
);
PathStack
.
hasProtocol
=
function
(
path
)
{
return
!!
PathStack
.
getProtocol
(
path
);
};
PathStack
.
getProtocol
=
function
(
path
)
{
PathStack
.
getProtocol
=
function
(
path
)
{
var
protocol
=
/^
[^
:
]
*:
\/
*/
.
exec
(
path
);
var
protocol
=
/^
[^
:
]
*:
\/
*/
.
exec
(
path
);
return
protocol
?
protocol
[
0
]
:
null
;
};
PathStack
.
prototype
=
{
push
:
function
(
path
)
{
push
:
function
(
path
)
{
this
.
path
=
path
;
update
.
call
(
this
);
parse
.
call
(
this
);
update
.
call
(
this
);
parse
.
call
(
this
);
return
this
;
},
getPath
:
function
(){
getPath
:
function
()
{
return
this
+
""
;
},
toString
:
function
(){
return
this
.
protocol
+
(
this
.
stack
.
concat
(
[
''
]
)
).
join
(
this
.
separator
);
toString
:
function
()
{
return
this
.
protocol
+
(
this
.
stack
.
concat
([
''
])).
join
(
this
.
separator
);
}
};
function
update
()
{
var
protocol
=
PathStack
.
getProtocol
(
this
.
path
||
''
);
var
protocol
=
PathStack
.
getProtocol
(
this
.
path
||
''
);
if
(
protocol
)
{
if
(
protocol
)
{
//根协议
this
.
protocol
=
protocol
;
//local
this
.
localSeparator
=
/
\\
|
\/
/
.
exec
(
this
.
path
.
replace
(
protocol
,
''
)
)[
0
];
this
.
localSeparator
=
/
\\
|
\/
/
.
exec
(
this
.
path
.
replace
(
protocol
,
''
)
)[
0
];
this
.
stack
=
[];
}
else
{
protocol
=
/
\\
|
\/
/
.
exec
(
this
.
path
);
protocol
=
/
\\
|
\/
/
.
exec
(
this
.
path
);
protocol
&&
(
this
.
localSeparator
=
protocol
[
0
]);
}
}
function
parse
(){
function
parse
()
{
var
parsedStack
=
this
.
path
.
replace
(
this
.
currentDirPattern
,
''
);
var
parsedStack
=
this
.
path
.
replace
(
this
.
currentDirPattern
,
''
);
if
(
PathStack
.
hasProtocol
(
this
.
path
)
)
{
parsedStack
=
parsedStack
.
replace
(
this
.
protocol
,
''
);
if
(
PathStack
.
hasProtocol
(
this
.
path
))
{
parsedStack
=
parsedStack
.
replace
(
this
.
protocol
,
''
);
}
parsedStack
=
parsedStack
.
split
(
this
.
localSeparator
);
parsedStack
=
parsedStack
.
split
(
this
.
localSeparator
);
parsedStack
.
length
=
parsedStack
.
length
-
1
;
for
(
var
i
=
0
,
tempPath
,
l
=
parsedStack
.
length
,
root
=
this
.
stack
;
i
<
l
;
i
++
)
{
for
(
var
i
=
0
,
tempPath
,
l
=
parsedStack
.
length
,
root
=
this
.
stack
;
i
<
l
;
i
++
)
{
tempPath
=
parsedStack
[
i
];
if
(
tempPath
){
if
(
PathStack
.
isParentPath
(
tempPath
)
)
{
if
(
tempPath
)
{
if
(
PathStack
.
isParentPath
(
tempPath
))
{
root
.
pop
();
}
else
{
root
.
push
(
tempPath
);
root
.
push
(
tempPath
);
}
}
...
...
@@ -121,9 +121,9 @@
var
currentPath
=
document
.
getElementsByTagName
(
'script'
);
currentPath
=
currentPath
[
currentPath
.
length
-
1
].
src
;
currentPath
=
currentPath
[
currentPath
.
length
-
1
].
src
;
return
new
PathStack
().
push
(
currentPath
)
+
""
;
return
new
PathStack
().
push
(
currentPath
)
+
""
;
})();
...
...
@@ -134,21 +134,24 @@
window
.
UMEDITOR_CONFIG
=
{
//为编辑器实例添加一个路径,这个不能被注释
UMEDITOR_HOME_URL
:
URL
UMEDITOR_HOME_URL
:
URL
//图片上传配置区
,
imageUrl
:
URL
+
"ajax/ueditor"
//图片上传提交地址
,
imagePath
:
""
//图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置
,
imageFieldName
:
"upfile"
//图片数据的key,若此处修改,需要在后台对应文件修改对应参数
,
imageUrl
:
URL
+
"ajax/ueditor"
//图片上传提交地址
,
imagePath
:
""
//图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置
,
imageFieldName
:
"upfile"
//图片数据的key,若此处修改,需要在后台对应文件修改对应参数
//工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义
,
toolbar
:[
,
toolbar
:
[
'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |'
,
'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize'
,
'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize'
,
'| justifyleft justifycenter justifyright justifyjustify |'
,
'link unlink | emotion image video | map'
,
'| horizontal print preview fullscreen'
,
'drafts'
,
'formula'
'link unlink | emotion image video | map'
,
'drafts'
,
'formula'
]
//语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件:
...
...
@@ -203,9 +206,9 @@
//fontfamily
//字体设置
// ,'fontfamily':[
// { name: 'songti', val: '宋体,SimSun'},
// ]
// ,'fontfamily':[
// { name: 'songti', val: '宋体,SimSun'},
// ]
//fontsize
//字号
...
...
@@ -247,4 +250,4 @@
//填写过滤规则
//,filterRules: {}
};
})();
})();
\ No newline at end of file
...
...
client/js/goods/netsale-edit.js
View file @
2a7b6b7
...
...
@@ -33,9 +33,11 @@ window.GOLABDATA = {
}
}
else
{
var
map
=
{},
args
=
[].
slice
.
call
(
arguments
,
1
);
args
=
[].
slice
.
call
(
arguments
,
1
),
listeners
=
null
;
for
(
var
key
in
that
.
registerEvent
)
{
var
listeners
=
that
.
registerEvent
[
key
];
listeners
=
that
.
registerEvent
[
key
];
for
(
var
i
in
listeners
)
{
map
[
key
]
=
listeners
[
i
].
apply
(
this
,
args
);
}
...
...
@@ -101,7 +103,9 @@ if ($('.contentpanel').data('type') == 'info') {
var
e
=
new
common
.
edit
(
'#netsaleAllInfo'
);
$
(
document
).
on
(
"click"
,
"#saveAllInfo"
,
function
()
{
var
data
=
{};
$
.
each
(
GOLABDATA
.
fire
(),
function
(
key
,
value
)
{
var
allData
=
GOLABDATA
.
fire
();
$
.
each
(
allData
,
function
(
key
,
value
)
{
if
(
typeof
value
==
'string'
)
{
data
=
value
;
return
;
...
...
@@ -109,15 +113,6 @@ $(document).on("click", "#saveAllInfo", function() {
$
.
extend
(
data
,
value
,
true
);
});
/*common.util.__ajax({
url: '/goods/product/saveNetSaleAllInfo',
data: data
}, function(res) {
});*/
e
.
submit
(
'/goods/product/saveNetSaleAllInfo'
,
function
(
option
)
{
option
.
data
=
data
;
option
.
success
=
function
(
res
)
{
...
...
@@ -131,7 +126,7 @@ $(document).on("click", "#saveAllInfo", function() {
}
return
false
;
}
})
})
;
})
...
...
@@ -202,4 +197,11 @@ $('.floatnav').on('mouseenter', function() {
$
(
'.floatnav'
).
addClass
(
'show'
);
}).
on
(
'mouseleave'
,
function
()
{
$
(
'.floatnav'
).
removeClass
(
'show'
);
});
\ No newline at end of file
});
if
(
location
.
hash
)
{
var
hashPos
=
location
.
hash
.
substring
(
1
);
setTimeout
(
function
()
{
$
(
'.floatnav'
).
find
(
'li[name="'
+
hashPos
+
'"]'
).
trigger
(
'click'
);
},
500
);
}
\ No newline at end of file
...
...
client/js/goods/netsale.js
View file @
2a7b6b7
...
...
@@ -75,6 +75,8 @@ var t = new common.tab({
if
(
columnname
==
1
||
columnname
==
2
)
{
editPostion
=
'#position9'
;
}
else
{
editPostion
=
''
;
}
g
.
init
(
$
(
"#gridurl"
).
val
());
...
...
@@ -339,7 +341,12 @@ function shelveModal(title, html) {
g
.
reload
();
},
'growl-success'
);
}
else
{
e
.
$tip
(
res
.
data
.
message
);
//e.$tip(res.data.message);
var
html
=
''
;
$
.
each
(
res
.
data
.
data
,
function
(
key
,
value
)
{
html
+=
key
+
':'
+
value
+
'<br>'
;
});
e
.
$tip
(
html
);
}
}
});
...
...
client/js/goods/partials/basic-info.js
View file @
2a7b6b7
...
...
@@ -123,7 +123,7 @@ suppledTable.init(NETSALEDATA.goodsList, 'goodsSizeList')
//上架必填
productExtBo
.
renderType
=
$
(
'.contentpanel'
).
data
(
'type'
);
productExtBo
.
sellChannels
=
productExtBo
.
sellChannels
?
productExtBo
.
sellChannels
.
replace
(
/,/g
,
"|"
)
:
''
;
productExtBo
.
shopIds
=
productExtBo
.
shopIdList
?
productExtBo
.
shopIdList
.
join
(
'|'
)
:
''
;
//productExtBo.shopList =
common
.
util
.
__ajax
({
url
:
'/goods/ShopsRest/queryShopsByBrandId'
,
...
...
@@ -132,12 +132,23 @@ common.util.__ajax({
}
},
function
(
res
)
{
productExtBo
.
shopList
=
res
.
data
;
productExtBo
.
shopIds
=
''
;
if
(
productExtBo
.
shopIdList
&&
productExtBo
.
shopIdList
.
length
>
0
)
{
//如有选择店铺
productExtBo
.
shopIds
=
productExtBo
.
shopIdList
?
productExtBo
.
shopIdList
.
join
(
'|'
)
:
''
;
}
else
if
(
res
.
data
.
length
>
0
)
{
//如没有已选择店铺,默认选择全部
$
.
each
(
res
.
data
,
function
(
i
,
value
)
{
productExtBo
.
shopIds
+=
value
.
shopsId
+
'|'
;
});
}
//
$
(
'#product-ext'
).
html
(
common
.
util
.
__template2
(
$
(
'#productExtBoTemp'
).
html
(),
productExtBo
));
e
.
init
();
},
true
);
$
(
'#product-ext'
).
html
(
common
.
util
.
__template2
(
$
(
'#productExtBoTemp'
).
html
(),
productExtBo
));
//如果是info页,所有input btn置灰
if
(
$
(
'.contentpanel'
).
data
(
'type'
)
==
'info'
)
{
$
(
'.contentpanel'
).
find
(
'input'
).
prop
(
'disabled'
,
true
);
$
(
'.contentpanel'
).
find
(
'.btn'
).
addClass
(
'disabled'
);
...
...
@@ -146,6 +157,7 @@ if ($('.contentpanel').data('type') == 'info') {
var
e
=
new
common
.
edit
(
'#basicInfoWrap'
);
e
.
init
();
//保存基本信息
$
(
'#saveBasicInfo'
).
on
(
'click'
,
function
()
{
e
.
submit
(
'/goods/product/saveNetSaleBaseInfo'
,
function
(
option
)
{
option
.
data
=
GOLABDATA
.
fire
(
"LYbasicInfo"
);;
...
...
@@ -177,6 +189,5 @@ GOLABDATA.on("LYbasicInfo", function() {
data
[
key
]
=
$
(
this
).
val
().
split
(
'|'
).
join
(
','
);
}
});
console
.
log
(
data
);
return
data
;
});
\ No newline at end of file
...
...
client/js/goods/partials/editor_recommend.js
View file @
2a7b6b7
...
...
@@ -35,11 +35,12 @@ $(document).on("click", "#btn-descriptioner", function() {
return
false
;
});
window
.
UMrecommender
=
UM
.
getEditor
(
'edit-recommender'
);
/*小编推荐*/
window
.
UMrecommender
=
UM
.
getEditor
(
'edit-recommender'
);
if
(
window
.
NETSALEDATA
&&
window
.
NETSALEDATA
.
productExtBo
&&
window
.
NETSALEDATA
.
productExtBo
.
recommend
)
{
UMrecommender
.
setContent
(
window
.
NETSALEDATA
.
productExtBo
.
recommend
);
}
$
(
document
).
on
(
"click"
,
"#btn-recommand"
,
function
()
{
common
.
util
.
__ajax
({
url
:
'/netSale/saveNetSaleRecommend'
,
...
...
@@ -355,7 +356,7 @@ $(document).on('click', '.remove-item-btn', function() {
$
(
document
).
on
(
"click"
,
"#fenMainSave"
,
function
()
{
var
data
=
GOLABDATA
.
fire
(
"fenmian"
);
if
(
typeof
data
==
"undefined"
)
{
if
(
typeof
data
==
"undefined"
)
{
return
false
;
}
common
.
util
.
__ajax
({
...
...
client/sass/common/global.scss
View file @
2a7b6b7
...
...
@@ -420,7 +420,10 @@ ul {
padding
:
0
38px
0
10px
;
color
:
#333
;
z-index
:
99
;
white-space
:
nowrap
width
:
100%
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
.citySelect
.cityboxbtn
:hover
{
...
...
server/views/pages/goods/netsale.html
View file @
2a7b6b7
...
...
@@ -142,8 +142,8 @@
</div>
<div
class=
"row"
style=
"margin: 0 0 0 -5px;"
>
<a
id=
"onshelve"
href=
"javascript:;"
class=
"btn btn-info disabled"
>
上架
</a>
<a
id=
"offshelve"
href=
"javascript:;"
class=
"btn btn-info disabled"
>
下架
</a>
<a
id=
"onshelve"
href=
"javascript:;"
class=
"btn btn-info"
>
上架
</a>
<a
id=
"offshelve"
href=
"javascript:;"
class=
"btn btn-info"
>
下架
</a>
<a
id=
"export-btn"
href=
"javascript:;"
class=
"btn btn-info"
>
导出
</a>
<a
id=
"import-btn"
href=
"/goods/netsale/batch"
class=
"btn btn-info"
>
批量(排序、款型系列)
</a>
</div>
...
...
server/views/partials/netsale/add-info.html
View file @
2a7b6b7
...
...
@@ -141,7 +141,7 @@
<
input
id
=
"salesPhrase"
class
=
"form-control"
type
=
"text"
value
=
"[[salesPhrase]]"
style
=
"display: inline-block;width: 280px;"
>
<
/div
>
<
div
class
=
"form-group"
>
<
label
>
是否
促
销:
<
/label
>
<
label
>
是否
热
销:
<
/label
>
<
span
>
<
label
class
=
"radio-inline"
><
input
type
=
"radio"
name
=
"isHostsell"
value
=
"Y"
>
是
<
/label
>
<
label
class
=
"radio-inline"
><
input
type
=
"radio"
name
=
"isHostsell"
value
=
"N"
>
否
<
/label
>
...
...
Please
register
or
login
to post a comment