新增首页介绍

pull/30/head
taoshihan1991 4 years ago
parent 2a5077869b
commit 45edd52e8d

@ -6,7 +6,7 @@ import (
"net/http" "net/http"
) )
func Index(c *gin.Context) { func Index(c *gin.Context) {
c.Redirect(302,"/main") c.Redirect(302,"/index")
} }
//首页跳转 //首页跳转
func ActionIndex(w http.ResponseWriter, r *http.Request) { func ActionIndex(w http.ResponseWriter, r *http.Request) {

@ -30,6 +30,7 @@ func main() {
engine.Static("/static", "./static") engine.Static("/static", "./static")
//首页 //首页
engine.GET("/", controller.Index) engine.GET("/", controller.Index)
engine.GET("/index", tmpl.PageIndex)
//登陆界面 //登陆界面
engine.GET("/login", tmpl.PageLogin) engine.GET("/login", tmpl.PageLogin)
//咨询界面 //咨询界面

@ -6,9 +6,6 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>GO-FLY - 极简强大的Golang在线客服系统</title> <title>GO-FLY - 极简强大的Golang在线客服系统</title>
<meta name="description" content="GO-FLY一套为PHP工程师、Golang工程师准备的基于 Vue CDN的在线客服即时通讯系统" /> <meta name="description" content="GO-FLY一套为PHP工程师、Golang工程师准备的基于 Vue CDN的在线客服即时通讯系统" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.min.js"></script> <script src="https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.min.js"></script>
<style> <style>
@ -58,6 +55,7 @@
margin: 0; margin: 0;
line-height: 48px; line-height: 48px;
color: #555; color: #555;
font-weight: 500;
font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,SimSun,sans-serif; font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,SimSun,sans-serif;
} }
.banner p{ .banner p{
@ -76,7 +74,26 @@
width: 100%; width: 100%;
padding: 40px 150px; padding: 40px 150px;
box-sizing: border-box; box-sizing: border-box;
height: 340px; }
.try{
display: inline-block;
padding: 10px 20px;
background: #519eff;
color: #fff;
border-radius: 5px;
cursor: pointer;
margin-right: 20px;
text-decoration: none;
}
.try:hover {
transform: translateY(-1px);
background: #318cff;
box-shadow: 0 7px 14px rgba(50,50,50,.1), 0 3px 6px rgba(0,0,0,.1);
}
.copyright{
color: #6c757d;
text-align: center;
margin: 60px 0;
} }
</style> </style>
</head> </head>
@ -92,9 +109,31 @@
<div class="jumbotron"> <div class="jumbotron">
<img src="/static/images/intro1.jpg"/> <img src="/static/images/intro1.jpg"/>
</div> </div>
<div class="try">
</div>
<footer class="footer">
<footer class="footer">
<div class="container">
<a class="try" href="/docs/index.html" target="_blank">接口文档</a>
<a class="try" id="visitorBtn">访客入口</a>
<a class="try" href="/login" target="_blank">客服入口</a>
</div>
<div class="copyright">
陶士涵的菜地版权所有&copy; 2020
</div>
</footer> </footer>
<script>
$("#visitorBtn").click(function(){
layer.open({
type: 2,
title: '在线咨询',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['550px', '520px'],
content: ['/chat_page','no'],
end: function(){
$(".chatBtn").show();
}
});
});
</script>
</html> </html>

@ -40,6 +40,10 @@ func (obj *CommonHtml) Display(file string, data interface{}) {
t, _ := template.New(file).Parse(main) t, _ := template.New(file).Parse(main)
t.Execute(obj.Rw, data) t.Execute(obj.Rw, data)
} }
//客服界面
func PageIndex(c *gin.Context) {
c.HTML(http.StatusOK, "index.html", nil)
}
//登陆界面 //登陆界面
func PageMain(c *gin.Context) { func PageMain(c *gin.Context) {

Loading…
Cancel
Save