xinyb_
2021-12-31 edf548c46c8bbafed01fcbc3ad79a9b4e155f8be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
//检查系统是否停止使用 Added by Johns Wang ,2017-05-26
var maintaince={
    dbid:null,
    isStop:null,
    checkSysIsExpired:function(){
        if (!maintaince.dbid || maintaince.dbid == "" || maintaince.dbid == "null") {
            location.reload();
            return ;
        }
        $.post("/shopping/maintaince/maintaince.do?m=info&data_base_id="+maintaince.dbid,
            function(data){
                var isSystemStop = data["isstop"] ;
                var redirect = data["redirect"];
                //处理重定向到 login.jsp 页面
                if(isSystemStop && maintaince.isStop && maintaince.isStop != isSystemStop && redirect){
                    location = redirect;
                    return ;
                }
 
 
 
            },"json")
    }
}
var messagehint={
//获取系统级提示消息
    popupMessageHint:function(){
        $.post("/messagehint.do",
            function(data){
                for (i in data["warning"]) {
                    if (data["warning"][i]["messagetxt"]) {
                        var messageType = data["warning"][i]["messagetype"] ;
                        var myMessages = data["warning"][i]["messagetxt"]  ;
                        //myMessages += data["warning"][i]["topic"] + "<hr/>" ;
 
                        //替换所有的制表符
                        myMessages = myMessages.replace(/\t/g,"&nbsp;&nbsp;");
 
                        //替换所有的换行符
                        myMessages = myMessages.replace(/\r\n/g,"<br>")
                        myMessages = myMessages.replace(/\n/g,"<br>");
 
                        //替换所有的空格(中文空格、英文空格都会被替换)
                        myMessages = myMessages.replace(/\s/g,"&nbsp;");
 
                        myMessages +="<br/><br/><hr/>" ;
                        myMessages += data["warning"][i]["createusername"] + "&nbsp;&nbsp;"
                            + data["warning"][i]["createtime"] ;
                        /*
                        //显示提示框
                        $().toastmessage('showToast', {
                             inEffectDuration:600,
                             stayTime:  100000000,   //停留10秒(10000),然后关闭 ,
                             text     : myMessages,
                             sticky   : false,
                             position : 'top-right',
                             type     : messageType
                         });
                        */
                        openToast(myMessages,data["warning"][i]["topic"],messageType);
                        // $.toast({
                        //     text: myMessages, // Text that is to be shown in the toast
                        //     heading: data["warning"][i]["topic"] , // Optional heading to be shown on the toast
                        //
                        //     showHideTransition: 'plain', // fade, slide or plain
                        //     allowToastClose: true, // Boolean value true or false
                        //     hideAfter: false, // false to make it sticky or number representing the miliseconds as time after which toast needs to be hidden
                        //     stack: 5, // false if there should be only one toast at a time or a number representing the maximum number of toasts to be shown at a time
                        //     position: 'top-right', // bottom-left or bottom-right or bottom-center or top-left or top-right or top-center or mid-center or an object representing the left, right, top, bottom values
                        //
                        //     bgColor: '#444444',  // Background color of the toast
                        //     textColor: '#eeeeee',  // Text color of the toast
                        //     textAlign: 'left',  // Text alignment i.e. left, right or center
                        //     loader: true,  // Whether to show loader or not. True by default
                        //     loaderBg: '#9ec600',  // Background color of the toast loader
                        //     beforeShow: function () {}, // will be triggered before the toast is shown
                        //     afterShown: function () {}, // will be triggered after the toat has been shown
                        //     beforeHide: function () {}, // will be triggered before the toast gets hidden
                        //     afterHidden: function () {}  // will be triggered after the toast has been hidden
                        // });
 
                    }
                }
            },"json")
    }
}
var maintainPay={
    noticeRemind:function(){
        //获取提醒数
        $.ajax({//加载
            url: "/Maintain/remind.do",
            type: "get",
            dataType: "json",
            async: true,
            contentType: 'application/json;charset=UTF-8',
            success: function (res) {
                if (res != null && res.code == 0) {
                    let list = res.data;
                    if (list != null && list > 0) {
                        $(".tixings").html(list);
                    }else{
                        $(".tixings").html("");
                    }
                }
            }, error: function () {
                $(".tixings").html("");
            }
        });
    }
}
//打开通知消息显示
function openToast(message,title,type){
    let t=$.toast({
        text: message, // 消息提示框的内容。
        heading: "<div style='text-align: center'>"+title+"</div>" , // 消息提示框的标题
        showHideTransition: 'plain', //消息提示框的动画效果。可取值:plain,fade,slide。
        allowToastClose: true, // 是否显示关闭按钮。(true 显示,false 不显示)
        hideAfter: false, // 设置为false则消息提示框不自动关闭.设置为一个数值则在指定的毫秒之后自动关闭消息提框
        stack: 5, // 消息栈。同时允许的提示框数量
        position: 'top-right', // 消息提示框的位置:bottom-left, bottom-right,bottom-center,top-left,top-right,top-center,mid-center。
        bgColor: '#444444',  // 背景颜色。
        textColor: '#eeeeee',  // 文字颜色。
        textAlign: 'left',  // 文本对齐:left, right, center。
        // icon:'success',//消息提示框的图标样式:success,info,error,warning
        loader: true,  // 是否显示加载条
        loaderBg: '#9ec600',  // 加载条的背景颜色。
        isHied:false,//是否隐藏触发
        beforeShow: function () {}, // 会在toast即将出现之前触发
        afterShown: function () {}, // 会在toast出现后触发
        beforeHide: function (evn) {
            this.isHied=true;//是隐藏触发则为true
        }, // 会在toast藏起来之前触发
        afterHidden: function () {}, // 会在toast藏起来后被触发
        onClick:function (evn) {//单击触发事件
            if (type == "maintenanceFee" && !this.isHied) {//维护费支付类型
                $(".icon-tixing").trigger("click");
                evn.hide();
            }
        }
    });
    return t;
}