user.js 1.17 KB
Newer Older
zhangcheng committed
1 2 3 4 5

const user = {
    state: {
        userInfo: null, //授权信息
        Authorization: null, //是否授权
zhangcheng committed
6 7
        location:null,//用户经纬度
        userPhoneInfo:null,
8 9
        shopInfo:null,//店铺信息
        orderId:null//扫码进入时携带的订单id
zhangcheng committed
10 11
    },
    mutations: {
12 13 14 15
        // 保存扫码进入时携带的订单id
        setOrderId(state, orderId) {
            state.orderId = orderId;
        },
zhangcheng committed
16 17 18 19 20
        // 设置是否授权
        setAuthorization(state, data) {
            console.log(data,665)
                state.Authorization = data;
            },
zhangcheng committed
21
        // 设置用户允许昵称头像授权时的信息
zhangcheng committed
22 23 24
        setUserInfo(state, userInfo) {
            state.userInfo = userInfo;
        },
zhangcheng committed
25 26 27 28 29 30 31 32 33 34 35 36
        // 授权手机号时允许后的信息
        setUserPhoneInfo(state, userPhoneInfo) {
           state.userPhoneInfo = userPhoneInfo;
        },
        // 保存经纬度
        saveLocation(state, location) {
           state.location = location;
        },
        // 当前店铺信息
        saveShopInfo(state, shopInfo) {
            state.shopInfo = shopInfo;
        }
zhangcheng committed
37 38 39 40 41 42 43 44
    },

    actions: {
        
    }
}

export default user