export let doubleRcvModule = {

    data() {
        return {
            loginVisible: false,
            doubleRcvCallback: null,
        }
    },

    methods: {

        handleDoubleRcv(params, fn) {
            if (typeof fn !== 'function') {
                alert('handleDoubleRcv第二个参数必须为函数')
                return;
            }
            if (params.rcvLinesDTOList.some(tt => tt.isDoubleReceive == '1')) {
                this.loginVisible = true;
                this.doubleRcvCallback = {
                    params: params,
                    fn: fn
                };
            } else {
                this.doubleRcvCallback = null;
                fn();
            }
        },

        onLogined(res) {
            // console.log('onLogined', res,this.doubleRcvCallback);
            this.doubleRcvCallback.params.rcvHeadersDTO.rcvUserId1 = this.$store.getters.userInfo.userId;
            this.doubleRcvCallback.params.rcvHeadersDTO.rcvUserName1 = this.$store.getters.userInfo.userName;
            this.doubleRcvCallback.params.rcvHeadersDTO.rcvUserId2 = res.userId;
            this.doubleRcvCallback.params.rcvHeadersDTO.rcvUserName2 = res.userName;
            this.doubleRcvCallback.fn();
        },



    }

};
