binxie
2023-06-26 dd004276162a2bf9d042ff0aaa569dc30a95d827
force-app/main/default/lwc/lexAgencyInfo/lexAgencyInfo.js
@@ -17,7 +17,7 @@
    init() {
        this.showSpinner = true;
        initAgency()
            .then(result => {
            .then((result) => {
                this.showPage = true;
                this.isNoteStay = result.isNoteStay;
                if (result.result == 'Success') {
@@ -26,15 +26,23 @@
                    this.showSpinner = false;
                } else {
                    this.showSpinner = false;
                    console.log("Error:" + result.errorMsg);
                    this.showMyToast('初始化页面失败', result.errorMsg, 'error');
                    console.log('Error:' + result.errorMsg);
                    this.showMyToast(
                        '初始化页面失败',
                        result.errorMsg,
                        'error'
                    );
                }
            })
            .catch(error => {
            .catch((error) => {
                this.showSpinner = false;
                console.log("Error:" + error);
                this.showMyToast('初始化页面失败', JSON.stringify(error), 'error');
            })
                console.log('Error:' + error);
                this.showMyToast(
                    '初始化页面失败',
                    JSON.stringify(error),
                    'error'
                );
            });
    }
    showMyToast(title, message, variant) {
@@ -47,12 +55,18 @@
           iconName = 'utility:error';
        }
        if(message != ''){
           content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>';
            content =
                '<h2><strong>' +
                title +
                '<strong/></h2><h5>' +
                message +
                '</h5>';
        }else{
           content = '<h2><strong>'+title+'<strong/></h2>';
        }
        this.template.querySelector('c-common-toast').
        showToast(variant,content,iconName,10000);
        this.template
            .querySelector('c-common-toast')
            .showToast(variant, content, iconName, 10000);
        // var mode;
        // if(this.isNoteStay){
        //     mode ='sticky';