const user = {
  state: {
    userInfo: {}, //授权信息
    Authorization: null, //是否授权
    location: null, //用户经纬度
    userPhoneInfo: null,
    shopInfo: null, //店铺信息
    orderId: null, //扫码进入时携带的订单id
    systemBarHeight: {} //设备头部高度信息
  },
  mutations: {
    // 保存扫码进入时携带的订单id
    setOrderId(state, orderId) {
      state.orderId = orderId;
    },
    // 保存设备tabHeight信息
    setSystemBar(state, systemBarHeight) {
      state.systemBarHeight = systemBarHeight
    },
    // 设置是否授权
    setAuthorization(state, data) {
      state.Authorization = data;
    },
    // 设置用户允许昵称头像授权时的信息
    setUserInfo(state, userInfo) {
      state.userInfo = userInfo;
    },
    // 授权手机号时允许后的信息
    setUserPhoneInfo(state, userPhoneInfo) {
      state.userPhoneInfo = userPhoneInfo;
    },
    // 保存经纬度
    saveLocation(state, location) {
      state.location = location;
    },
    // 当前店铺信息
    saveShopInfo(state, shopInfo) {
      state.shopInfo = shopInfo;
    },
  },

  actions: {},
};

export default user;
