|
|
|
<html lang="cn">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
|
|
<meta name="description" content="">
|
|
|
|
<meta name="author" content="陶士涵">
|
|
|
|
<title>GO-IMAP网页版邮箱imap工具</title>
|
|
|
|
<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/vue-router/dist/vue-router.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>
|
|
|
|
<style>
|
|
|
|
html,
|
|
|
|
body {
|
|
|
|
height: 100%;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
body {
|
|
|
|
overflow: hidden;
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
}
|
|
|
|
.el-container{
|
|
|
|
margin-top:10px;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
.el-aside{
|
|
|
|
height: 100%;
|
|
|
|
background: #fff;
|
|
|
|
border: solid 1px #e6e6e6;
|
|
|
|
}
|
|
|
|
.el-aside .el-menu{
|
|
|
|
border-right: none;
|
|
|
|
}
|
|
|
|
.mainLogo{
|
|
|
|
font-size: 20px;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
.mainMain{
|
|
|
|
background: #fff;
|
|
|
|
margin-left: 10px;
|
|
|
|
margin-bottom: 60px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<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">写信</el-menu-item>
|
|
|
|
<el-header style="text-align: right; font-size: 12px" class="logout">
|
|
|
|
<a href="/logout">退出</a>
|
|
|
|
</el-header>
|
|
|
|
</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 folderlist.folders" v-bind:key="v" v-on:click="getFolders(1,v)">
|
|
|
|
<i class="el-icon-menu"></i>
|
|
|
|
<span slot="title"><{v}></span>
|
|
|
|
</el-menu-item>
|
|
|
|
</el-menu>
|
|
|
|
</el-aside>
|
|
|
|
|
|
|
|
<el-main class="mainMain">
|
|
|
|
<div class="block">
|
|
|
|
<el-timeline :reverse="true">
|
|
|
|
<el-timeline-item v-for="item in folderlist.mails" v-bind:key="item.Id" :timestamp="item.Date" placement="top">
|
|
|
|
<el-card v-on:click.native="openUrl('/view?fid='+fid+'&id='+item.Id)">
|
|
|
|
<h4><{item.Subject}></h4>
|
|
|
|
<p><{item.From}> 发送于 <{item.Date}></p>
|
|
|
|
</el-card>
|
|
|
|
</el-timeline-item>
|
|
|
|
</el-timeline>
|
|
|
|
</div>
|
|
|
|
<el-pagination
|
|
|
|
background
|
|
|
|
:current-page="page"
|
|
|
|
:page-size="pagesize"
|
|
|
|
@current-change="getFolders"
|
|
|
|
layout="prev, pager, next"
|
|
|
|
:total="mailTotal">
|
|
|
|
</el-pagination>
|
|
|
|
</el-main>
|
|
|
|
<router-view></router-view>
|
|
|
|
|
|
|
|
</el-container>
|
|
|
|
</template>
|
|
|
|
<template id="mailList">
|
|
|
|
<div>aaa</div>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
<script>
|
|
|
|
const list = { template: mailList };
|
|
|
|
const view = { template: '<div>bbb</div>' };
|
|
|
|
const routes = [
|
|
|
|
{ path: '/', component: list },
|
|
|
|
{ path: '/view', component: view }
|
|
|
|
];
|
|
|
|
const router = new VueRouter({
|
|
|
|
routes // (缩写) 相当于 routes: routes
|
|
|
|
})
|
|
|
|
new Vue({
|
|
|
|
router,
|
|
|
|
el: '#app',
|
|
|
|
delimiters:["<{","}>"],
|
|
|
|
data: {
|
|
|
|
fullscreenLoading:true,
|
|
|
|
folderlist:[],
|
|
|
|
mailTotal:0,
|
|
|
|
page:1,
|
|
|
|
pagesize:10,
|
|
|
|
fid:"INBOX",
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
//获取邮件夹
|
|
|
|
getFolders: function (page,fid) {
|
|
|
|
this.fullscreenLoading=true;
|
|
|
|
if(page==""){
|
|
|
|
page=1;
|
|
|
|
}
|
|
|
|
var data={};
|
|
|
|
data.page=page;
|
|
|
|
if(fid!=""){
|
|
|
|
data.fid=fid;
|
|
|
|
this.fid=fid;
|
|
|
|
}
|
|
|
|
let _this = this;
|
|
|
|
$.get('/folders',data, function (rs) {
|
|
|
|
_this.folderlist=rs.result;
|
|
|
|
_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>
|