import personalDetail, {OpenType} from '$utils/control/personal-detail';

import roomList from '$utils/control/roomList';

export default <LibMixins>{

    methods:{

        fetch(obj){

            roomList.getRequestList({
                ...this.options,
                tid:this.tid
            },obj.data).then((data)=>{
                return obj.success(data.data);
            }).catch(obj.fail);
        },

        openDetail(item){
            return personalDetail.openDetail(item,OpenType.room);
        }

    },

    created(){
        if (this.options.collect) {
            roomList.on('view-room',{
                vm:this
            });
        }
    },
    beforeUnmount() {
        if (this.options.collect) {
            roomList.off('view-room');
        }
    }

}