Skip to content
切换导航面板
项目
群组
代码片段
帮助
zhangtai
/
zzhnc
当前项目
正在载入...
登录
切换导航面板
转到一个项目
项目
版本库
问题
0
合并请求
0
流水线
维基
设置
活动
图像
图表
创建新的问题
作业
提交
问题看板
文件
提交
分支
标签
贡献者
图像
比较
图表
Commit d31346d5
由
沈姿.前端(已离职)
编写于
Dec 27, 2017
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge branch 'shenzi'
2 个父辈
e07e06e4
e5339c7d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
93 行增加
和
70 行删除
WebContent/WEB-INF/jsp/pc/autoresponse/autoresponse.jsp
WebContent/WEB-INF/jsp/pc/goods/goodsEdit.jsp
WebContent/WEB-INF/jsp/pc/goods/goodsList.jsp
WebContent/WEB-INF/jsp/pc/autoresponse/autoresponse.jsp
查看文件 @
d31346d
...
...
@@ -77,8 +77,8 @@
//查询条件
var
queryObj
=
{
page
:
1
,
keyword
:
null
,
isRedirectStaff
:
null
size
:
10
,
keyword
:
null
}
//页面初始化
...
...
@@ -107,17 +107,16 @@
$
(
"#tablelist"
).
html
(
str
);
laypage
({
cont
:
'page'
,
pages
:
data
.
totalPages
,
laypage
.
render
({
elem
:
'page'
,
count
:
data
.
totalPages
,
limit
:
queryObj
.
size
,
curr
:
queryObj
.
page
,
skip
:
true
,
jump
:
function
(
obj
,
first
)
{
if
(
!
first
)
{
queryObj
.
page
=
obj
.
curr
initdata
(
queryObj
);
}
}
});
...
...
@@ -140,15 +139,13 @@
$
(
"input[name=keyword]"
).
val
(
""
);
form
.
render
();
queryObj
.
keyword
=
null
;
queryObj
.
isRedirectStaff
=
null
;
queryObj
.
projectId
=
null
,
initdata
(
queryObj
);
initdata
(
queryObj
);
})
//发布操作
$
(
".publicBtn"
).
on
(
"click"
,
function
()
{
$
.
get
(
"/zzhnc/autoreply/publish"
,
function
(
data
)
{
var
data
=
JSON
.
parse
(
data
)
console
.
log
(
data
)
if
(
data
.
code
==
0
)
{
top
.
layer
.
msg
(
"发布成功!"
);
}
else
{
...
...
@@ -195,6 +192,8 @@
layer
.
close
(
index
);
queryObj
.
page
=
1
;
initdata
(
queryObj
);
$
(
"[name=keywords]"
).
val
(
""
);
$
(
"[name=content]"
).
val
(
""
);
}
});
form
.
render
();
...
...
@@ -244,14 +243,7 @@
});
form
.
render
();
},
btn2
:
function
(
index
,
layero
)
{
layer
.
close
(
index
);
},
cancel
:
function
(
index
,
layero
)
{
layer
.
close
(
index
);
},
success
:
function
(){
//获取当前需修改的关键字信息
$
.
post
(
"/zzhnc/autoreply/getAutoReply"
,
{
id
:
id
},
function
(
data
)
{
...
...
@@ -277,7 +269,7 @@
if
(
data
.
code
==
0
)
{
top
.
layer
.
msg
(
"删除成功"
);
queryObj
.
page
=
1
;
initdata
(
queryObj
)
initdata
(
queryObj
)
;
layer
.
close
(
index
);
}
else
{
top
.
layer
.
msg
(
data
.
msg
);
...
...
WebContent/WEB-INF/jsp/pc/goods/goodsEdit.jsp
查看文件 @
d31346d
...
...
@@ -15,6 +15,12 @@
color
:
red
;
margin-right
:
5px
;
}
.layui-form-label
{
width
:
100px
;
}
#container
{
margin-left
:
20px
;
}
</style>
<body
class=
"wrap"
>
...
...
@@ -48,9 +54,22 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><i
class=
"red"
>
*
</i>
所属商家
</label>
<label
class=
"layui-form-label"
><i
class=
"red"
>
*
</i>
商品原价
</label>
<div
class=
"layui-input-inline"
style=
"width: 100px;"
>
<input
type=
"number"
name=
"subtitle"
lay-verify=
"title"
placeholder=
"商品原价"
class=
"layui-input"
>
</div>
<div
class=
"layui-form-mid"
>
元
</div>
<label
class=
"layui-form-label"
><i
class=
"red"
>
*
</i>
商品现价
</label>
<div
class=
"layui-input-inline"
style=
"width: 100px;"
>
<input
type=
"number"
name=
"subtitle"
lay-verify=
"title"
placeholder=
"商品现价"
class=
"layui-input"
>
</div>
<div
class=
"layui-form-mid"
>
元
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><i
class=
"red"
>
*
</i>
商家名称
</label>
<div
class=
"layui-input-inline"
style=
"width: 390px;"
>
<input
type=
"text"
name=
"subtitle"
lay-verify=
"title"
placeholder=
"商
品所属商家
"
class=
"layui-input"
>
<input
type=
"text"
name=
"subtitle"
lay-verify=
"title"
placeholder=
"商
家名称
"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-form-item"
>
...
...
@@ -60,6 +79,12 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><i
class=
"red"
>
*
</i>
商家电话
</label>
<div
class=
"layui-input-inline"
style=
"width: 390px;"
>
<input
type=
"text"
name=
"subtitle"
lay-verify=
"title"
placeholder=
"商家电话"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><i
class=
"red"
>
*
</i>
详细信息
</label>
<div
class=
"layui-input-block"
>
<!-- 加载编辑器的容器 -->
...
...
WebContent/WEB-INF/jsp/pc/goods/goodsList.jsp
查看文件 @
d31346d
...
...
@@ -9,6 +9,13 @@
<title>
商品列表
</title>
<link
rel=
"stylesheet"
href=
"/zzhnc/res/plugins/layui/css/layui.css"
>
<link
rel=
"stylesheet"
href=
"/zzhnc/res/css/basic.css"
>
<style>
.imgUrl
{
width
:
50px
;
height
:
50px
;
display
:
block
;
}
</style>
</head>
<body
class=
"wrap"
>
<div
class=
"layui-form"
>
...
...
@@ -57,28 +64,15 @@
var
queryObj
=
{
page
:
1
,
page
size
:
10
,
keyword
:
''
size
:
10
,
sellerId
:
0
};
function
initdata
(
queryObj
)
{
$
.
post
(
"/zzhnc/article/getArticlesList"
,
queryObj
,
function
(
data
)
{
function
initData
(
queryObj
)
{
$
.
get
(
"/zzhnc/goods/search"
,
queryObj
,
function
(
data
)
{
data
=
data
.
data
;
console
.
log
(
data
)
laypage
.
render
({
elem
:
'page'
,
pages
:
data
.
totalPages
,
//总页数
curr
:
queryObj
.
page
,
skip
:
true
,
jump
:
function
(
obj
,
first
)
{
if
(
!
first
)
{
queryObj
.
page
=
obj
.
curr
initdata
(
queryObj
);
}
}
});
var
str
=
""
;
if
(
data
.
rows
.
length
<
1
)
{
$
(
".nodata"
).
show
();
...
...
@@ -87,9 +81,11 @@
for
(
var
i
=
0
;
i
<
data
.
rows
.
length
;
i
++
)
{
str
+=
'<tr data-id='
+
data
.
rows
[
i
].
id
+
'>'
+
'<td>'
+
((
data
.
page
-
1
)
*
data
.
pageSize
+
i
+
1
)
+
'</td>'
+
'<td style="text-align:left;">'
+
data
.
rows
[
i
].
title
+
'</td>'
+
'<td>'
+
data
.
rows
[
i
].
imgurl
+
'</td>'
+
'<td>'
+
toTime_G
(
data
.
rows
[
i
].
createdtime
)
+
'</td>'
+
'<td><img class="imgUrl" src="'
+
data
.
rows
[
i
].
bannerUrl
+
'" /></td>'
+
'<td>'
+
data
.
rows
[
i
].
name
+
'</td>'
+
'<td>'
+
data
.
rows
[
i
].
description
+
'</td>'
+
'<td>'
+
data
.
rows
[
i
].
sellerId
+
'</td>'
+
'<td>'
+
data
.
rows
[
i
].
sellerId
+
'</td>'
+
'<td>'
+
'<a href="#" class="layui-btn layui-btn-mini updataBtn">修改</a>'
+
'<a href="#" class="layui-btn layui-btn-mini deleteBtn">删除</a>'
+
...
...
@@ -100,70 +96,80 @@
$
(
"#tablelist"
).
html
(
str
);
toNull_G
();
laypage
.
render
({
elem
:
'page'
,
count
:
data
.
totalPages
,
curr
:
queryObj
.
page
,
jump
:
function
(
obj
,
first
)
{
if
(
!
first
)
{
queryObj
.
page
=
obj
.
curr
initData
(
queryObj
);
}
}
});
})
}
initdata
(
queryObj
);
//初始化数据
initData
(
queryObj
);
//查询
form
.
on
(
'submit(querybtn)'
,
function
(
data
)
{
queryObj
.
keyword
=
$
(
"[name=keyword]"
).
val
();
queryObj
.
page
=
1
;
init
d
ata
(
queryObj
)
init
D
ata
(
queryObj
)
});
//重置
$
(
".resetBtn"
).
on
(
"click"
,
function
()
{
$
(
"[name=keyword]"
).
val
(
""
)
queryObj
=
{
page
:
1
,
pagesize
:
10
,
keyword
:
""
};
initdata
(
queryObj
)
$
(
"[name=keyword]"
).
val
(
""
);
queryObj
.
page
=
1
;
queryObj
.
sellerId
=
0
;
initData
(
queryObj
)
return
false
})
//初始化数据
initdata
(
queryObj
);
//添加文章
//添加商品
$
(
document
).
on
(
"click"
,
".createBtn"
,
function
()
{
if
(
parent
.
tab
.
exists
(
"添加
文章
"
)
>
0
)
{
var
tabid
=
parent
.
tab
.
getTabId
(
"添加
文章
"
);
if
(
parent
.
tab
.
exists
(
"添加
商品
"
)
>
0
)
{
var
tabid
=
parent
.
tab
.
getTabId
(
"添加
商品
"
);
parent
.
tab
.
deleteTab
(
tabid
);
}
parent
.
tab
.
tabAdd
({
href
:
"/zzhnc/
article/article
Edit"
,
href
:
"/zzhnc/
goods/goods
Edit"
,
icon
:
"fa-cubes"
,
title
:
"添加
文章
"
title
:
"添加
商品
"
});
})
//修改文章
//修改商品
$
(
document
).
on
(
"click"
,
".updataBtn"
,
function
()
{
var
id
=
$
(
this
).
parents
(
"tr"
).
attr
(
"data-id"
);
if
(
parent
.
tab
.
exists
(
"修改
文章
"
)
>
0
)
{
var
tabid
=
parent
.
tab
.
getTabId
(
"修改
文章
"
);
if
(
parent
.
tab
.
exists
(
"修改
商品
"
)
>
0
)
{
var
tabid
=
parent
.
tab
.
getTabId
(
"修改
商品
"
);
parent
.
tab
.
deleteTab
(
tabid
);
}
parent
.
tab
.
tabAdd
({
href
:
"/zzhnc/
article/article
Edit?id="
+
id
,
href
:
"/zzhnc/
goods/goods
Edit?id="
+
id
,
icon
:
"fa-cubes"
,
title
:
"修改
文章
"
title
:
"修改
商品
"
});
})
//删除文章
//删除商品
$
(
document
).
on
(
"click"
,
".deleteBtn"
,
function
()
{
var
id
=
$
(
this
).
parents
(
"tr"
).
attr
(
"data-id"
);
layer
.
confirm
(
'您确定要删除该
文章
吗?'
,
{
btn
:
[
'确定'
,
'取消'
]
//按钮
layer
.
confirm
(
'您确定要删除该
爆款商品
吗?'
,
{
btn
:
[
'确定'
,
'取消'
]
},
function
(
index
,
layero
)
{
$
.
post
(
"/zzhnc/
article/deleteArticl
e"
,
{
$
.
post
(
"/zzhnc/
goods/updat
e"
,
{
id
:
id
},
function
(
data
)
{
console
.
log
(
data
)
if
(
data
.
code
==
0
)
{
top
.
layer
.
msg
(
"删除成功"
);
init
d
ata
(
queryObj
);
init
D
ata
(
queryObj
);
layer
.
close
(
index
);
}
else
{
top
.
layer
.
msg
(
data
.
msg
);
...
...
编写
预览
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
请先完成此消息的编辑!
取消
请
注册
或
登录
后发表评论