const state = {
  checkMyBenfits: 0, // 是否是从个人中心去注册会员页，默认值0 0-不是 1-是
  // 用户分享信息
  userShareConfig: {
    share: false, // 是否有权限分享(true是false无)
    id: '', // 用户ID
    userName: '', // 用户名称
    userImgUrl: '' // 用户头像
  },
  recommendedProduct: [], // 贷款计算器所推荐的产品
  userInfo: {} // 用户信息
}

const getters = {
  checkMyBenfits (state) {
    return state.checkMyBenfits
  },
  userShareConfig (state) {
    return state.userShareConfig
  }
}

const mutations = {
  UPDATE_CHECKMYBENFITS_VALUE (state, value) {
    state.checkMyBenfits = value
  },
  UPDATE_USERSHARECONFIG (state, value) {
    state.userShareConfig = value
  },
  UPDATE_RECOMMENDEDPRODUCT (state, value) {
    state.recommendedProduct = value
  },
  UPDATE_USERINFO (state, value) {
    state.userInfo = value
  }
}

export default {
  namespaced: true,
  state,
  getters,
  mutations
}
