export default {

    provide(){
        return {
            triggerChangeGiveUserId:(uid,userInfo:Record<string, any>={})=> this.triggerChangeGiveUserId(uid,userInfo),
        }
    },

    data(){
        return {
            // 赠送用户
            giveUserId:undefined,
            // 赠送用户信息
            giveUser:{}
        }
    },

    methods:{

        triggerChangeGiveUserId(uid,userInfo:Record<string, any>={}){
            if (this.giveUserId !== uid) {
                this.giveUserId = uid;
                if (userInfo && userInfo.uid && this.giveUser.uid !== userInfo.uid) {
                    this.giveUser = userInfo;
                } else {
                    this.giveUser = {};
                }
            }
        }

    }

}
