From 777ea81517f8b2aecb8c370b84c2349e6a9b8602 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Fri, 16 Oct 2020 13:52:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8F=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/abouts.go | 12 ++++++++++++ static/css/common.css | 38 +------------------------------------- static/css/front.css | 37 +++++++++++++++++++++++++++++++++++++ static/html/chat_page.html | 8 +------- tmpl/common.go | 10 +--------- 5 files changed, 52 insertions(+), 53 deletions(-) create mode 100644 static/css/front.css diff --git a/models/abouts.go b/models/abouts.go index 0f9541a..22d830d 100644 --- a/models/abouts.go +++ b/models/abouts.go @@ -18,6 +18,18 @@ func FindAboutByPage(page interface{}) About { DB.Where("page = ?", page).First(&a) return a } +func FindAboutByPageLanguage(page interface{}, lang string) About { + var a About + if lang == "" { + lang = "cn" + } + if lang == "en" { + DB.Select("css_js,title_en,keywords_en,desc_en,html_en").Where("page = ?", page).First(&a) + } else { + DB.Select("css_js,title_cn,keywords_cn,desc_cn,html_cn").Where("page = ?", page).First(&a) + } + return a +} func UpdateAbout(page string, title_cn string, title_en string, keywords_cn string, keywords_en string, desc_cn string, desc_en string, css_js string, html_cn string, html_en string) { c := &About{ TitleCn: title_cn, diff --git a/static/css/common.css b/static/css/common.css index 9bc50ee..8fb00c0 100644 --- a/static/css/common.css +++ b/static/css/common.css @@ -1,43 +1,7 @@ *{padding:0;margin:0} .floatRight{float: right;} .clear{clear: both;} -::-webkit-scrollbar -{ - width: 5px; - height: 110px; - background-color: #F5F5F5; -} -/*定义滚动条轨道 内阴影+圆角*/ -::-webkit-scrollbar-track -{ - -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); - border-radius: 10px; - background-color: #F5F5F5; -} -/*定义滑块 内阴影+圆角*/ -::-webkit-scrollbar-thumb -{ - border-radius: 10px; - -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3); - background-color: #bdbdbd; -} -/*滑块效果*/ -::-webkit-scrollbar-thumb:hover -{ - border-radius: 5px; - -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2); - background: rgba(0,0,0,0.4); -} -/*IE滚动条颜色*/ -html { - scrollbar-face-color:#bfbfbf;/*滚动条颜色*/ - scrollbar-highlight-color:#000; - scrollbar-3dlight-color:#000; - scrollbar-darkshadow-color:#000; - scrollbar-Shadow-color:#adadad;/*滑块边色*/ - scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/ - scrollbar-track-color:#eeeeee;/*背景颜色*/ -} + .h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { font-family: inherit; font-weight: 500; diff --git a/static/css/front.css b/static/css/front.css new file mode 100644 index 0000000..a9e81c3 --- /dev/null +++ b/static/css/front.css @@ -0,0 +1,37 @@ +::-webkit-scrollbar +{ + width: 5px; + height: 110px; + background-color: #F5F5F5; +} +/*定义滚动条轨道 内阴影+圆角*/ +::-webkit-scrollbar-track +{ + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); + border-radius: 10px; + background-color: #F5F5F5; +} +/*定义滑块 内阴影+圆角*/ +::-webkit-scrollbar-thumb +{ + border-radius: 10px; + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3); + background-color: #bdbdbd; +} +/*滑块效果*/ +::-webkit-scrollbar-thumb:hover +{ + border-radius: 5px; + -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2); + background: rgba(0,0,0,0.4); +} +/*IE滚动条颜色*/ +html { + scrollbar-face-color:#bfbfbf;/*滚动条颜色*/ + scrollbar-highlight-color:#000; + scrollbar-3dlight-color:#000; + scrollbar-darkshadow-color:#000; + scrollbar-Shadow-color:#adadad;/*滑块边色*/ + scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/ + scrollbar-track-color:#eeeeee;/*背景颜色*/ +} \ No newline at end of file diff --git a/static/html/chat_page.html b/static/html/chat_page.html index 98075bf..4c2be06 100644 --- a/static/html/chat_page.html +++ b/static/html/chat_page.html @@ -12,14 +12,8 @@ + - -
diff --git a/tmpl/common.go b/tmpl/common.go index 4828115..7b80b5d 100644 --- a/tmpl/common.go +++ b/tmpl/common.go @@ -48,7 +48,7 @@ func (obj *CommonHtml) Display(file string, data interface{}) { func PageIndex(c *gin.Context) { lang, _ := c.Get("lang") language := config.CreateLanguage(lang.(string)) - about := models.FindAboutByPage("index") + about := models.FindAboutByPageLanguage("index", lang.(string)) cssJs := html.UnescapeString(about.CssJs) title := about.TitleCn keywords := about.KeywordsCn @@ -61,15 +61,7 @@ func PageIndex(c *gin.Context) { content = html.UnescapeString(about.HtmlEn) } c.HTML(http.StatusOK, "index.html", gin.H{ - "Copyright": language.WebCopyRight, - "WebDesc": language.MainIntro, - "SubIntro": language.IndexSubIntro, - "Document": language.IndexDocument, - "VisitorBtn": language.IndexVisitors, - "AgentBtn": language.IndexAgent, "OnlineChat": language.IndexOnlineChat, - "IndexSend": language.Send, - "Maintech": language.Maintech, "Notice": language.Notice, "NowAsk": language.NowAsk, "LaterAsk": language.LaterAsk,