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.
101 lines
3.5 KiB
101 lines
3.5 KiB
4 years ago
|
{{template "header" }}
|
||
5 years ago
|
<div id="app" style="width:100%">
|
||
|
<template>
|
||
|
<el-container v-loading.fullscreen.lock="fullscreenLoading">
|
||
|
<el-aside>
|
||
|
<el-menu
|
||
5 years ago
|
:default-active="fid">
|
||
5 years ago
|
<el-menu-item v-on:click="openUrl('/write')">
|
||
|
<i class="el-icon-edit"></i>
|
||
|
<span slot="title">写信</span>
|
||
|
</el-menu-item>
|
||
5 years ago
|
<el-menu-item :index="v" v-for="(f,v) in folders" v-bind:key="v" v-on:click="getFolders(1,v,true)">
|
||
5 years ago
|
<i class="el-icon-message"></i>
|
||
5 years ago
|
<span slot="title"><{v}></span>
|
||
|
</el-menu-item>
|
||
|
</el-menu>
|
||
|
</el-aside>
|
||
|
|
||
|
<el-main class="mainMain">
|
||
|
<div class="block">
|
||
5 years ago
|
<el-timeline :reverse="true">
|
||
5 years ago
|
<el-timeline-item v-for="item in mails" v-bind:key="item.Id" :timestamp="item.Date" placement="top">
|
||
5 years ago
|
<el-card v-on:click.native="openUrl('/view?fid='+fid+'&id='+item.Id)">
|
||
5 years ago
|
<h4><{item.Subject}></h4>
|
||
5 years ago
|
<p><{item.From}> 发送于 <{item.Date}></p>
|
||
5 years ago
|
</el-card>
|
||
|
</el-timeline-item>
|
||
|
</el-timeline>
|
||
|
</div>
|
||
5 years ago
|
<el-pagination
|
||
|
background
|
||
|
:current-page="page"
|
||
5 years ago
|
:page-size="pagesize"
|
||
5 years ago
|
@current-change="getFolders"
|
||
|
layout="prev, pager, next"
|
||
|
:total="mailTotal">
|
||
|
</el-pagination>
|
||
5 years ago
|
</el-main>
|
||
5 years ago
|
|
||
5 years ago
|
</el-container>
|
||
|
</template>
|
||
5 years ago
|
|
||
5 years ago
|
</div>
|
||
|
</body>
|
||
|
<script>
|
||
|
new Vue({
|
||
|
el: '#app',
|
||
|
delimiters:["<{","}>"],
|
||
|
data: {
|
||
|
fullscreenLoading:true,
|
||
5 years ago
|
folders:[],
|
||
|
mails:[],
|
||
5 years ago
|
mailTotal:0,
|
||
|
page:1,
|
||
5 years ago
|
pagesize:10,
|
||
5 years ago
|
fid:"",
|
||
5 years ago
|
},
|
||
|
methods: {
|
||
5 years ago
|
//获取邮件夹
|
||
5 years ago
|
getFolders: function (page,fid,isLeft) {
|
||
5 years ago
|
this.fullscreenLoading=true;
|
||
5 years ago
|
if(typeof(page)=="undefined" || page==""){
|
||
5 years ago
|
page=1;
|
||
5 years ago
|
}else{
|
||
|
this.page=page;
|
||
5 years ago
|
}
|
||
5 years ago
|
let data={};
|
||
5 years ago
|
data.page=page;
|
||
5 years ago
|
if(typeof(fid)!="undefined" && fid!=""){
|
||
5 years ago
|
data.fid=fid;
|
||
|
this.fid=fid;
|
||
5 years ago
|
}else if(this.fid!=""){
|
||
|
data.fid=this.fid;
|
||
5 years ago
|
}
|
||
5 years ago
|
let _this = this;
|
||
5 years ago
|
$.get('/folders',data, function (rs) {
|
||
5 years ago
|
if(!isLeft){
|
||
|
_this.folders=rs.result.folders;
|
||
|
}
|
||
|
_this.mails=rs.result.mails
|
||
5 years ago
|
_this.mailTotal=rs.result.total;
|
||
5 years ago
|
_this.pagesize=rs.result.pagesize;
|
||
|
_this.fid=rs.result.fid;
|
||
5 years ago
|
_this.fullscreenLoading=false;
|
||
5 years ago
|
}).then(()=>{
|
||
|
_this.fullscreenLoading=false;
|
||
|
});
|
||
5 years ago
|
},
|
||
|
//跳转
|
||
|
openUrl(url){
|
||
|
window.location.href=url;
|
||
5 years ago
|
},
|
||
|
},
|
||
|
created: function () {
|
||
4 years ago
|
this.getFolders(1,"INBOX");
|
||
5 years ago
|
}
|
||
|
})
|
||
|
|
||
|
</script>
|
||
|
</html>
|