k94314517
2023-08-18 eee82fc63bf8b0b48bda5d6c89a491974a20bc97
minipro_standard/store/index.js
@@ -1,5 +1,6 @@
import Vue from 'vue'
import Vuex from 'vuex'
import Vuex from 'vuex'
import { pageCount } from '@/util/api/index.js'
Vue.use(Vuex) // vue的插件机制
@@ -19,7 +20,12 @@
      token: token || null,
      menuButtonWidth: menuButtonWidth || '0',
      statusbarHeight: statusbarHeight || '0',
      navHeight: navHeight || '0',
      navHeight: navHeight || '0',
      // 待办数量
      upcomingNum: {
         d: 0,
         y: 0
      },
   },
   mutations: {
      setHeight(state, val) {
@@ -37,6 +43,10 @@
      SETUSERINFO(state, val) {
         state.userInfo = val
         uni.setStorageSync('userInfo', val);
      },
      SETNUM(state, val) {
         state.upcomingNum.d = val.d
         state.upcomingNum.y = val.y
      }
   },
   actions: {
@@ -56,6 +66,12 @@
            menuButtonWidth
         })
      },
      async getUpcomingNum() {
         let res = await pageCount({})
         if (res.code === 200) {
            content.commit('SETNUM', { d: res.data.startNum, y: res.data.endNum })
         }
      }
   }
})