123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- function showMessage(content) {
- layer.alert(content, {
- skin: 'layui-layer-molv',
- closeBtn: 0,
- shade: 0.5,
- });
- }
- function closeView(time = 0) {
- let index = parent.layer.getFrameIndex(window.name);
- if (time == 0) {
- setTimeout(() => {
- parent.layer.close(index);
- }, 700)
- } else {
- parent.layer.close(index);
- }
- }
- function showLoding() {
- layer.msg('请稍等!', {icon: 16, shade: 0.3, time: false});
- }
- function cancelLoding() {
- let index = layer.msg('请稍等!', {icon: 16, shade: 0.2});
- setTimeout(()=>{
- layer.close(index);
- },300)
- }
- function showToast(title) {
- layer.msg(title, {time: 1500, shade: 0.3, icon: 1});
- }
- function showToastError(title) {
- layer.msg(title, {
- time: 1500,
- icon: 2,
- shade: 0.3
- });
- }
- function sendAjax(url, param, callback) {
- showLoding();
- $.ajax({
- type: "post",
- url: url,
- data: param,
- dataType: "json",
- success: callback,
- error: function () {
- showMessage("服务异常")
- cancelLoding();
- }
- });
- }
|