binxie
2023-06-26 b5c5eb130ca0848124f9d136af4be142ad5aac07
force-app/main/default/lwc/lexLicenceReminder/lexLicenceReminder.js
@@ -8,37 +8,27 @@
    connectedCallback() {
        initReminder()
            .then((result) => {
        .then(result=>{
                if (result.result == 'Success') {
                    this.days = result.days;
                    this.isShowReminder = result.isShowReminder;
                    if (this.days > 0) {
                        this.msg =
                            '您的医疗器械经营企业许可证还有' +
                            this.days +
                            '天就到期了!';
                    this.msg = '您的医疗器械经营企业许可证还有'+this.days+'天就到期了!';
                    } else if (this.days == 0) {
                        this.msg = '您的医疗器械经营企业许可证今天就到期了!';
                    } else if (this.days < 0) {
                        var days = this.days * -1;
                        this.msg =
                            '您的医疗器械经营企业许可证已经过期' +
                            days +
                            '天了!';
                    var days = this.days * -1
                    this.msg = '您的医疗器械经营企业许可证已经过期'+days+'天了!';
                    }
                } else {
                    console.log('Error:' + result.errorMsg);
                console.log("Error:" + result.errorMsg);
                    this.showMyToast(result.errorMsg, '', 'error');
                }
            })
            .catch((error) => {
                console.log('Error:' + JSON.stringify(error));
                this.showMyToast(
                    '初始化提醒失败',
                    JSON.stringify(error),
                    'error'
                );
            });
        .catch(error => {
            console.log("Error:" + JSON.stringify(error));
            this.showMyToast('初始化提醒失败', JSON.stringify(error), 'error');
        })
    }
    showMyToast(title, message, variant) {
@@ -51,18 +41,12 @@
            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';