优化写信页

pull/30/head
陶士涵 5 years ago
parent 5b5ff2c779
commit 821c7c7eaa

@ -25,6 +25,12 @@ func ActionFolder(w http.ResponseWriter, r *http.Request){
render.Fid = fid
tmpl.RenderList(w, render)
}
//写信界面
func ActionWrite(w http.ResponseWriter, r *http.Request){
render:=tmpl.NewRender(w)
render.SetLeft("mail_left")
render.Display("write",nil)
}
//获取邮件夹接口
func FolderDir(w http.ResponseWriter, r *http.Request){
fid:=tools.GetUrlArg(r,"fid")

@ -30,7 +30,7 @@ func main() {
//详情界面
http.HandleFunc("/view", view)
//写信界面
http.HandleFunc("/write", write)
http.HandleFunc("/write", controller.ActionWrite)
//框架界面
http.HandleFunc("/main", controller.ActionMain)
//设置界面
@ -74,12 +74,6 @@ func view(w http.ResponseWriter, r *http.Request) {
tmpl.RenderView(w, render)
}
//写信界面
func write(w http.ResponseWriter, r *http.Request) {
render:=new(tmpl.CommonHtml)
tmpl.RenderWrite(w, render)
}
//邮件接口
func mail(w http.ResponseWriter, r *http.Request) {

@ -0,0 +1,11 @@
<el-menu
:default-active="fid">
<el-menu-item v-on:click="openUrl('/write')">
<i class="el-icon-edit"></i>
<span slot="title">写信</span>
</el-menu-item>
<el-menu-item :index="v" v-for="(f,v) in folders" v-bind:key="v" v-on:click="openUrl('/list?fid='+v)">
<i class="el-icon-menu"></i>
<span slot="title"><{v}></span>
</el-menu-item>
</el-menu>

@ -4,13 +4,7 @@
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
<el-aside>
<el-menu
:default-active="fid">
<el-menu-item :index="v" v-for="(f,v) in folders" v-bind:key="v" v-on:click="openUrl('/list?fid='+v)">
<i class="el-icon-menu"></i>
<span slot="title"><{v}></span>
</el-menu-item>
</el-menu>
{{.Left}}
</el-aside>
<el-main class="mainMain">

@ -31,6 +31,9 @@ func (obj *CommonHtml)SetBottom(file string){
obj.Bottom=template.HTML(str)
}
func (obj *CommonHtml)Display(file string,data interface{}){
if data==nil{
data=obj
}
main := tools.FileGetContent("html/"+file+".html")
t, _ := template.New(file).Parse(main)
t.Execute(obj.Rw, data)

@ -1,9 +1 @@
package tmpl
import (
"net/http"
)
func RenderWrite(w http.ResponseWriter, data interface{}) {
render:=NewRender(w)
render.Display("write",render)
}

Loading…
Cancel
Save