PageSourceSearch

https://jandan.net/new/js/Message-DBfLJ95o.js

js jandan.net collected 2026-10-02 04:27:15 UTC 3,622 bytes, 1 lines download raw bytes

1import{B as t}from"./Breadcrumb-D19IZBWm.js";import{M as e}from"./MemberNav-CCgO0tET.js";import{b as s}from"./vendor-x_n3Z6bY.js";import{n as a}from"./index-BnngR_Ko.js";const i="forum";const r=a({name:"MessagePage",components:{Breadcrumb:t,MemberNav:e},data:()=>({breadcrumbData:[{name:"主页",url:"/"},{name:"消息中心"}],notifications:[],total:0,itemsPerPage:20,currentPage:1,totalPages:1}),created:function(){this.loadData()},computed:{visiblePageNumbers(){const t=Math.max(this.currentPage-2,1),e=Math.min(this.currentPage+2,this.totalPages),s=[];for(let a=t;a<=e;a++)s.push(a);return s},showFirstItem(){return 1!==this.visiblePageNumbers[0]},showLastItem(){return this.visiblePageNumbers[this.visiblePageNumbers.length-1]!==this.totalPages},showPrevEllipsis(){return this.visiblePageNumbers[0]>2},showNextEllipsis(){return this.visiblePageNumbers[this.visiblePageNumbers.length-1]<this.totalPages-1},showNextBtn(){return this.currentPage<this.totalPages},showPrevBtn(){return this.currentPage>2}},methods:{loadData(){s.get("/api/member/notifications?page="+this.currentPage).then(t=>{if(0!==t.data.code)return;this.notifications=t.data.data.list,this.total=t.data.data.total;let e=[];for(let s=0,a=this.notifications.length;s<a;s++)this.notifications[s].is_read||e.push(this.notifications[s].id);e.length>0&&s.post("/api/member/read_notices",{unread_ids:e}).then(function(t){}),this.totalPages=Math.ceil(this.total/this.itemsPerPage)}).catch(()=>{})},readAll(){s.post("/api/member/clear_notices",{}).then(t=>{this.$toast.success("已标记全部消息已读"),this.loadData()})},setCurrentPage(t,e=!1){this.currentPage=t,this.loadData()},goNextPage(t=!1){this.currentPage++,this.loadData()},getNoticeLink:t=>t.type===i?"/new/forum/topic/"+t.content_id:"/t/"+t.content_id,goPrevPage(t=!1){this.currentPage--,this.loadData()}}},function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-fluid"},[e("div",{staticClass:"row"},[e("Breadcrumb",{attrs:{"breadcrumb-data":t.breadcrumbData}})],1),e("div",{staticClass:"container my-4"},[e("div",{staticClass:"member-container row"},[e("member-nav",{attrs:{current:"message"}}),e("div",{staticClass:"col-lg-9 col-xl-9 main-content"},[e("div",{staticClass:"row"},[e("div",[t._m(0),e("hr"),e("div",[e("button",{staticClass:"btn btn-sm btn-secondary",on:{click:t.readAll}},[e("i",{staticClass:"bi bi-envelope-open"}),t._v(" 全部标记已读")])]),t._l(t.notifications,function(s,a){return e("div",{staticClass:"notice-row"},[e("div",[0==s.is_read?e("span",{staticClass:"text-primary"},[e("b",[t._v("[新消息]")])]):t._e(),t._v(" "+t._s(t.$timeFromNow(s.created_at))+" "),e("a",{attrs:{href:t.getNoticeLink(s)}},[t._v(t._s(s.title)+":")])]),e("div",[t._v(t._s(s.content))])])}),e("div",{staticClass:"page-nav p-2"},[e("ul",[t.showFirstItem?e("li",[e("button",{on:{click:function(e){return t.setCurrentPage(1,!0)}}},[t._v("1")])]):t._e(),t.showPrevEllipsis?e("li",[t._v("...")]):t._e(),t.showPrevBtn?e("li",[e("button",{attrs:{type:"button"},on:{click:function(e){return t.goPrevPage(!0)}}},[t._v("<")])]):t._e(),t._l(t.visiblePageNumbers,function(s){return e("li",{key:s},[e("button",{class:{active:s===t.currentPage},on:{click:function(e){return t.setCurrentPage(s,!0)}}},[t._v(t._s(s))])])}),t.showNextBtn?e("li",[e("button",{attrs:{type:"button"},on:{click:function(e){return t.goNextPage(!0)}}},[t._v(">")])]):t._e(),t.showNextEllipsis?e("li",[t._v("...")]):t._e()],2)])],2)])])],1)])])},[function(){var t=this._self._c;return t("h1",[t("i",{staticClass:"bi bi-chat-left"}),this._v(" 消息中心")])}],!1,null,"530cfe1f").exports;export{r as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.