You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
2.9 KiB
90 lines
2.9 KiB
{{.Header}}
|
|
<body class="text-center">
|
|
<div id="app" style="width:100%">
|
|
<template>
|
|
<el-menu
|
|
default-active="3"
|
|
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>
|
|
<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
|
|
: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>
|
|
</el-aside>
|
|
|
|
<el-main class="mainMain">
|
|
bbb
|
|
</el-main>
|
|
|
|
</el-container>
|
|
</template>
|
|
|
|
</div>
|
|
</body>
|
|
<script>
|
|
new Vue({
|
|
el: '#app',
|
|
delimiters:["<{","}>"],
|
|
data: {
|
|
fullscreenLoading:true,
|
|
folders:[],
|
|
mails:[],
|
|
mailTotal:0,
|
|
page:1,
|
|
pagesize:10,
|
|
fid:"",
|
|
},
|
|
methods: {
|
|
//获取邮件夹
|
|
getFolders: function (page,fid,isLeft) {
|
|
this.fullscreenLoading=true;
|
|
if(typeof(page)=="undefined" || page==""){
|
|
page=1;
|
|
}else{
|
|
this.page=page;
|
|
}
|
|
let data={};
|
|
data.page=page;
|
|
if(typeof(fid)!="undefined" && fid!=""){
|
|
data.fid=fid;
|
|
this.fid=fid;
|
|
}else if(this.fid!=""){
|
|
data.fid=this.fid;
|
|
}
|
|
let _this = this;
|
|
$.get('/folders',data, function (rs) {
|
|
if(!isLeft){
|
|
_this.folders=rs.result.folders;
|
|
}
|
|
_this.mails=rs.result.mails
|
|
_this.mailTotal=rs.result.total;
|
|
_this.pagesize=rs.result.pagesize;
|
|
_this.fid=rs.result.fid;
|
|
_this.fullscreenLoading=false;
|
|
}).then(()=>{
|
|
_this.fullscreenLoading=false;
|
|
});
|
|
},
|
|
//跳转
|
|
openUrl(url){
|
|
window.location.href=url;
|
|
},
|
|
},
|
|
created: function () {
|
|
this.getFolders();
|
|
}
|
|
})
|
|
|
|
</script>
|
|
</html>
|