优化界面布局

pull/30/head
陶士涵 4 years ago
parent 2d14d6dbd5
commit ea9d8fc457

@ -0,0 +1,10 @@
package controller
import (
"github.com/taoshihan1991/imaptool/tmpl"
"net/http"
)
func ActionMain(w http.ResponseWriter, r *http.Request){
render:=tmpl.NewRender(w)
render.Display("main",render)
}

@ -0,0 +1,11 @@
package controller
import (
"github.com/taoshihan1991/imaptool/tmpl"
"net/http"
)
func ActionSetting(w http.ResponseWriter, r *http.Request){
render:=tmpl.NewRender(w)
render.Display("setting",render)
}

@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"fmt"
"github.com/taoshihan1991/imaptool/controller"
"github.com/taoshihan1991/imaptool/tmpl"
"github.com/taoshihan1991/imaptool/tools"
"io/ioutil"
@ -32,6 +33,10 @@ func main() {
http.HandleFunc("/view", view)
//写信界面
http.HandleFunc("/write", write)
//框架界面
http.HandleFunc("/main", controller.ActionMain)
//设置界面
http.HandleFunc("/setting", controller.ActionSetting)
//发送邮件接口
http.HandleFunc("/send", send)
//监听端口
@ -113,6 +118,7 @@ func write(w http.ResponseWriter, r *http.Request) {
render:=new(tmpl.CommonHtml)
tmpl.RenderWrite(w, render)
}
//验证接口
func check(w http.ResponseWriter, r *http.Request) {
email := r.PostFormValue("email")

@ -41,6 +41,10 @@
margin-left: 10px;
margin-bottom: 60px;
}
.mainIframe{
width: 100%;
height: 100%;
}
.el-card__body{
cursor: pointer;
}

@ -2,15 +2,6 @@
<body class="text-center">
<div id="app" style="width:100%">
<template>
<el-menu
default-active="2"
mode="horizontal">
<el-menu-item index="1" class="mainLogo" v-on:click="getFolders(1)">GO-IMAP</el-menu-item>
<el-menu-item index="2" v-on:click="getFolders(1,fid)">收信<el-badge class="mark" :value="mailTotal" style="margin-bottom: 20px;"/>
</el-menu-item>
<el-menu-item index="3" v-on:click="openUrl('/write')">写信</el-menu-item>
<el-menu-item index="4" v-on:click="openUrl('/logout')">退出</el-menu-item>
</el-menu>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
<el-aside>
<el-menu

@ -0,0 +1,28 @@
{{.Header}}
<body>
<div id="app">
<template>
{{.Nav}}
<iframe class="mainIframe" v-bind:src="iframeUrl" frameborder="0"></iframe>
</template>
</div>
</body>
<script>
new Vue({
el: '#app',
delimiters:["<{","}>"],
data: {
iframeUrl:"/setting",
mailTotal:0,
},
methods: {
openIframeUrl(url){
this.iframeUrl=url;
}
},
created: function () {
}
})
</script>
</html>

@ -1,9 +1,10 @@
<el-menu
default-active=""
default-active="1"
mode="horizontal">
<el-menu-item index="1" class="mainLogo" v-on:click="openUrl('/list')">GO-IMAP</el-menu-item>
<el-menu-item index="2" v-on:click="openUrl('/list?fid='+fid)">收信<el-badge class="mark" :value="mailTotal" style="margin-bottom: 20px;"/>
<el-menu-item index="1" class="mainLogo" v-on:click="openIframeUrl('/list')">GO-IMAP</el-menu-item>
<el-menu-item index="2" v-on:click="openIframeUrl('/list')">收信<el-badge class="mark" :value="mailTotal" style="margin-bottom: 20px;"/>
</el-menu-item>
<el-menu-item index="3" v-on:click="openUrl('/write')">写信</el-menu-item>
<el-menu-item index="4" v-on:click="openUrl('/logout')">退出</el-menu-item>
<el-menu-item index="3" v-on:click="openIframeUrl('/write')">写信</el-menu-item>
<el-menu-item index="4" v-on:click="openIframeUrl('/setting')">设置</el-menu-item>
<el-menu-item index="10" v-on:click="openIframeUrl('/logout')">退出</el-menu-item>
</el-menu>

@ -0,0 +1,41 @@
{{.Header}}
<body class="text-center">
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
<el-aside>
<el-menu
:default-active="1">
<el-menu-item :index="1">
<i class="el-icon-menu"></i>
<span slot="title">账户中心</span>
</el-menu-item>
</el-menu>
</el-aside>
<el-main class="mainMain">
aaa
</el-main>
</el-container>
</template>
</div>
</body>
<script>
new Vue({
el: '#app',
delimiters:["<{","}>"],
data: {
fullscreenLoading:true,
},
methods: {
},
created: function () {
this.fullscreenLoading=false;
}
})
</script>
</html>

@ -2,7 +2,6 @@
<body class="text-center">
<div id="app" style="width:100%">
<template>
{{.Nav}}
<el-container v-loading.fullscreen.lock="fullscreenLoading">
<el-aside>
<el-menu

@ -2,7 +2,6 @@
<body class="text-center">
<div id="app" style="width:100%">
<template>
{{.Nav}}
<el-container v-loading.fullscreen.lock="fullscreenLoading">
<el-aside>
<el-menu

Loading…
Cancel
Save