import { fetchNotice, fetchUnReadNoticeNum } from '../../services/notice/fetchNotice'; /** * 通知相关信息获取逻辑 */ export const useNotice = Behavior({ data: { noticeList: [], unReadNoiceCount: 0, }, methods: { _fetchNotice(page) { return fetchNotice({ per_page: 3 }).then(res => { this.setData({ noticeList: res.data, }); return res.head; }); }, _fetchUnReadNoticeNum(page){ return fetchUnReadNoticeNum().then(res => { this.setData({ unReadNoiceCount: res }); return res; }); } }, });