riku
2024-08-13 1a0e4972f80278bfa9e53283374b745b6c968341
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
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;
      });
    }
  },
});