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.

1 line
8.2 KiB

2 weeks ago
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-message-index"],{1289:function(t,e,a){"use strict";a.r(e);var n=a("6192"),i=a.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(o);e["default"]=i.a},"2e8d":function(t,e,a){"use strict";a.r(e);var n=a("c2c2"),i=a("1289");for(var o in i)["default"].indexOf(o)<0&&function(t){a.d(e,t,(function(){return i[t]}))}(o);a("54ab");var s=a("828b"),r=Object(s["a"])(i["default"],n["b"],n["c"],!1,null,"4572b4fc",null,!1,n["a"],void 0);e["default"]=r.exports},"30f7":function(t,e,a){"use strict";a("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},a("7a76"),a("c9b5")},4733:function(t,e,a){"use strict";a("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if(Array.isArray(t))return(0,n.default)(t)};var n=function(t){return t&&t.__esModule?t:{default:t}}(a("8d0b"))},5285:function(t,e,a){var n=a("94c4");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("967d").default;i("35d29ce9",n,!0,{sourceMap:!1,shadowMode:!1})},"54ab":function(t,e,a){"use strict";var n=a("5285"),i=a.n(n);i.a},6192:function(t,e,a){"use strict";a("6a54");var n=a("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(a("2634")),o=n(a("b7c7")),s=n(a("2fdc"));a("5c47"),a("0506"),a("bf0f"),a("c223");var r=a("96dd"),c=a("7c99"),f={name:"MessagePage",data:function(){return{noticeList:[],isWeixinBrowser:!1,page:1,lastPage:1,loading:!1,hasMore:!0,tagColors:["linear-gradient(90deg, #ffb980 0%, #ffc99a 100%)","linear-gradient(90deg, #217aff 0%, #3b7cff 100%)","linear-gradient(90deg, #ff5c5c 0%, #ff7a7a 100%)","linear-gradient(90deg, #22c58b 0%, #2ed9a3 100%)","#f39c12","#8e44ad","#16a085"]}},onLoad:function(){this.isWeixinBrowser=/MicroMessenger/i.test(navigator.userAgent)},onShow:function(){this.page=1,this.hasMore=!0,this.fetchNotifications(!0)},onPullDownRefresh:function(){this.page=1,this.hasMore=!0,this.fetchNotifications(!0).finally((function(){uni.stopPullDownRefresh()}))},onReachBottom:function(){this.hasMore&&!this.loading&&this.loadMore()},methods:{formatChinaDate:r.base.formatChinaDate,fetchNotifications:function(){var t=arguments,e=this;return(0,s.default)((0,i.default)().mark((function a(){var n,s,r,f;return(0,i.default)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(n=t.length>0&&void 0!==t[0]&&t[0],s=uni.getStorageSync("token"),s){a.next=4;break}return a.abrupt("return");case 4:if(!e.loading){a.next=6;break}return a.abrupt("return");case 6:return e.loading=!0,a.prev=7,a.next=10,new Promise((function(t,a){uni.request({url:"".concat(c.API.NOTIFICATION_LIST,"?token=").concat(s),method:"GET",data:{page:e.page,per_page:5},success:t,fail:a})}));case 10:r=a.sent,r.data&&0===r.data.errcode?(f=Array.isArray(r.data.data.data)?r.data.data.data:[],e.lastPage=r.data.data.last_page||1,e.noticeList=n?f:[].concat((0,o.default)(e.noticeList),(0,o.default)(f)),e.hasMore=e.page<e.lastPage,console.log("当前页:",e.page,"总页数:",e.lastPage,"是否有更多:",e.hasMore)):uni.showToast({title:r.data.errmsg||"获取消息列表失败",icon:"none"}),a.next=18;break;case 14:a.prev=14,a.t0=a["catch"](7),console.error("获取消息列表失败:",a.t0),uni.showToast({title:"网络错误",icon:"none"});case 18:return a.prev=18,e.loading=!1,a.finish(18);case 21:case"end":return a.stop()}}),a,null,[[7,14,18,21]])})))()},loadMore:function(){this.hasMore&&!this.loading&&(this.page+=1,this.fetchNotifications(!1))}}};e.default=f},"94c4":function(t,e,a){var n=a("c86c");e=n(!1),e.push([t.i,".message-page[data-v-4572b4fc]{background:linear-gradient(180deg,#cbe6ff,#f6faff);min-height:100vh;padding-bottom:%?80?%;font-family:SourceHanSansCN,PingFang SC,Microsoft YaHei,sans-serif}.wechat-browser[data-v-4572b4fc]{margin-top:%?-44?%}.header-title[data-v-4572b4fc]{text-align:center;font-s