mutations.js 1.06 KB
Newer Older
程默 committed
1
const mutations = {
chenhui committed
2 3 4
  setSpokesman(state, obj) {
    for (let [key, val] of Object.entries(obj)) {
      state[key] = val;
程默 committed
5
    }
chenhui committed
6
  },
李嘉林 committed
7 8 9
  setSpokesmanInfo(state, obj) {
    state.spokemanInfo = obj;
  },
chenhui committed
10 11
  setSubscribeMessageObj(state, subscribeMessageObj) {
    state.subscribeMessageObj = subscribeMessageObj;
12 13 14 15 16
  },
  setOfflineShopCode(state, code) {
    state.offlineShopCode = code;
  },

程智春 committed
17 18 19 20 21 22 23 24
  //设置登录状态
  setLoginStatus(state,val){
    wx.setStorage({
        key: "isLogin",
        data: val
    });
    state.isLogin = val;
  },
25 26 27 28
  // 设置商城登录用户信息
  setShopUserInfo(state, val) {
    state.shopUserInfo = val;
  },
程智春 committed
29 30 31 32 33 34 35 36 37 38 39 40 41
  //设置用户信息
  setUserInfo(state,obj){
      wx.setStorage({
          key: "userInfo",
          data: JSON.stringify(obj)
      });
      state.userInfo = obj;
  },
  //退出登录
  logout(state){
      wx.clearStorage()
      state.isLogin = 0;
      state.userInfo = null;
程智春 committed
42 43 44
  },
  setExtConfig(state,obj){
    state.mixid = obj
程智春 committed
45 46 47
  },
  setExtConfigInfo(state,obj){
    state.extConfig = obj
程智春 committed
48 49
  }

chenhui committed
50
};
程默 committed
51
export default mutations