[内网]文化云交易前端H5
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
13 KiB

"use strict";function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj}}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}}return _typeof(obj)}!function(global,factory){(typeof exports==="undefined"?"undefined":_typeof(exports))==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=global||self,global.Dreamer=factory())}(void 0,function(){"use strict";var msgWrapper=c({className:"dream-msg-stage"});function c(args,children){var el=document.createElement("div");for(var key in args){var element=args[key];if(key=="className"){key="class";el.setAttribute(key,element)}else if(key[0]=="_"){el.addEventListener(key.slice(1),element)}}if(typeof children=="string"){el.innerHTML=children}else if(_typeof(children)=="object"&&children.tagName){el.appendChild(children)}else if(children){for(var i=0;i<children.length;i++){var child=children[i];el.appendChild(child)}}return el}function addAnimationEnd(el,fn){["a","webkitA"].forEach(function(prefix){var name=prefix+"nimationEnd";el.addEventListener(name,function(){fn()})})}function css(el,css){for(var key in css){el.style[key]=css[key]}if(el.getAttribute("style")===""){el.removeAttribute("style")}}function addClass(el,s){var c=el.className||"";if(!hasClass(c,s)){var arr=c.split(/\s+/);arr.push(s);el.className=arr.join(" ")}}function hasClass(c,s){return c.indexOf(s)>-1?!0:!1}function removeClass(el,s){var c=el.className||"";if(hasClass(c,s)){var arr=c.split(/\s+/);var i=arr.indexOf(s);arr.splice(i,1);el.className=arr.join(" ")}if(el.className===""){el.removeAttribute("class")}}var initArgs={msg:"",duration:2000,showClose:false};var Dreamer={info:function info(){initConfig(arguments,"info")},success:function success(){initConfig(arguments,"success")},warning:function warning(){initConfig(arguments,"warning")},error:function error(){initConfig(arguments,"error")},loading:function loading(){return initConfig(arguments,"loading")},destroyAll:function destroyAll(){_destroyAll()},config:function config(obj){for(var key in obj){if(Object.hasOwnProperty.call(obj,key)){if(obj[key]!==undefined){initArgs[key]=obj[key]}}}}};function initConfig(obj,type){var args={};for(var key in initArgs){args[key]=initArgs[key]}for(var i=0;i<obj.length;i++){var it=obj[i];if(it!==undefined){if(typeof it=="string"||_typeof(it)=="object"){args.msg=it}else if(typeof it=="boolean"){args.showClose=it}else if(typeof it=="function"){args.onClose=it}else if(typeof it=="number"){args.duration=it}if(it==true){errorSound()}}}args.type=type;return createMsgEl(args)}function createMsgEl(args){var type=args.type,duration=args.duration,msg=args.msg,showClose=args.showClose,onClose=args.onClose;var closable=duration===0;var iconObj=getIconObj();if(type=="loading"){msg=msg===""?"正在加载中,请稍等片刻...":msg;closable=showClose;duration=0}var el=c({className:"dream-msg-wrapper"},[c({className:"dream-msg dream-msg-fade-in "+type},[c({className:"dream-msg-icon"},iconObj[type]),c({className:"dream-msg-content"},msg),c({className:"dream-msg-wait "+(closable?"dream-msg-pointer":""),_click:function _click(){if(closable){closeMsg(el,onClose)}}},getMsgRight(closable))])]);var anm=el.querySelector(".dream-msg__circle");if(anm){css(anm,{animation:"dream-msg_"+type+" "+duration+"ms linear"});if("onanimationend"in window){addAnimationEnd(anm,function(){closeMsg(el,onClose)})}else{setTimeout(function(){closeMsg(el,onClose)},duration)}}if(type=="loading"&&duration!==0){setTimeout(function(){closeMsg(el,onClose)},duration)}if(!msgWrapper.children.length){document.body.appendChild(msgWrapper)}msgWrapper.appendChild(el);css(el,{height:el.offsetHeight+"px"});setTimeout(function(){removeClass(el.children[0],"dream-msg-fade-in")},300);if(type=="loading"){return function(){closeMsg(el,onClose)}}}function getMsgRight(showClose){if(showClose){return"\n <svg class=\"dream-msg-close\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5514\"><path d=\"M810 274l-238 238 238 238-60 60-238-238-238 238-60-60 238-238-238-238 60-60 238 238 238-238z\" p-id=\"5515\"></path></svg>\n "}else{return"<svg class=\"dream-msg-progress\" viewBox=\"0 0 33.83098862 33.83098862\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle class=\"dream-msg__background\" cx=\"16.9\" cy=\"16.9\" r=\"15.9\"></circle>\n <circle class=\"dream-msg__circle\" stroke-dasharray=\"100,100\" cx=\"16.9\" cy=\"16.9\" r=\"15.9\"></circle>\n </svg>\n "}}function closeMsg(el,cb){if(!el)return;css(el,{padding:0,height:0});addClass(el.children[0],"dream-msg-fade-out");cb&&cb();setTimeout(function(){if(!el)return;var has=false;for(var i=0;i<msgWrapper.children.length;i++){if(msgWrapper.children[i]===el){has=true}}has&&removeChild(el);el=null;if(!msgWrapper.children.length){has&&removeChild(msgWrapper)}},300)}function getIconObj(){return{info:"<svg t=\"1624242937335\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"17848\" width='10' height='10'><path d=\"M847 733.1l-77.5-154.8c-0.8-1.7-1.3-3.5-1.3-5.4l-0.2-171.4c-0.1-96.7-65.6-178.1-154.5-202.4v-0.1c0-55.6-45.1-100.7-100.7-100.7-55.5 0-100.5 44.9-100.7 100.4C322.2 222.6 255.9 304.6 256 402l0.2 171.4c0 1.9-0.4 3.7-1.3 5.4l-77.4 154.6c-22.6 45.2 10.3 98.5 60.9 98.4l547.9-0.4c50.5 0.1 83.4-53.1 60.7-98.3zM421.5 860.8c-10.1 0-15.6 11.7-9.3 19.6 23.4 29.2 59.4 47.9 99.7 47.9 40.4 0 76.4-18.7 99.9-48 6.3-7.9 0.8-19.6-9.3-19.5h-181z\" p-id=\"17849\" fill=\"#ffffff\"></path></svg>",success:"<svg t=\"1609781242911\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"1807\"><path d=\"M455.42 731.04c-8.85 0-17.75-3.05-24.99-9.27L235.14 553.91c-16.06-13.81-17.89-38.03-4.09-54.09 13.81-16.06 38.03-17.89 54.09-4.09l195.29 167.86c16.06 13.81 17.89 38.03 4.09 54.09-7.58 8.83-18.31 13.36-29.1 13.36z\" p-id=\"1808\" fill=\"#ffffff\"></path><path d=\"M469.89 731.04c-8.51 0-17.07-2.82-24.18-8.6-16.43-13.37-18.92-37.53-5.55-53.96L734.1 307.11c13.37-16.44 37.53-18.92 53.96-5.55 16.43 13.37 18.92 37.53 5.55 53.96L499.67 716.89c-7.58 9.31-18.64 14.15-29.78 14.15z\" p-id=\"1809\" fill=\"#ffffff\"></path></svg>\n ",warning:"<svg t=\"1609776406944\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"18912\"><path d=\"M468.114286 621.714286c7.314286 21.942857 21.942857 36.571429 43.885714 36.571428s36.571429-14.628571 43.885714-36.571428L585.142857 219.428571c0-43.885714-36.571429-73.142857-73.142857-73.142857-43.885714 0-73.142857 36.571429-73.142857 80.457143l29.257143 394.971429zM512 731.428571c-43.885714 0-73.142857 29.257143-73.142857 73.142858s29.257143 73.142857 73.142857 73.142857 73.142857-29.257143 73.142857-73.142857-29.257143-73.142857-73.142857-73.142858z\" p-id=\"18913\" fill=\"#ffffff\"></path></svg>\n ",error:"<svg t=\"1609810716933\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5514\"><path d=\"M810 274l-238 238 238 238-60 60-238-238-238 238-60-60 238-238-238-238 60-60 238 238 238-238z\" p-id=\"5515\" fill=\"#ffffff\"></path></svg>\n ",loading:"<div class=\"dream-msg_loading\">\n <svg class=\"dream-msg-circular\" viewBox=\"25 25 50 50\">\n <circle class=\"dream-msg-path\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"4\" stroke-miterlimit=\"10\"/>\n </svg>\n </div>\n "}}function removeChild(el){el&&el.parentNode.removeChild(el)}function _destroyAll(){for(var i=0;i<msgWrapper.children.length;i++){var element=msgWrapper.children[i];closeMsg(element)}}window.addEventListener('DOMContentLoaded',function(){insertCssInHead()});function insertCssInHead(){var doc=document;if(doc&&doc.head){var head=doc.head;var _css=doc.createElement('style');var cssStr="\n\n[class|=dream],[class|=dream]::after,[class|=dream]::before{box-sizing:border-box;outline:0}.dream-msg-progress{width:13px;height:13px}.dream-msg__circle{stroke-width:2;stroke-linecap:square;fill:none;transform:rotate(-90deg);transform-origin:center}.dream-msg-stage:hover .dream-msg__circle{-webkit-animation-play-state:paused!important;animation-play-state:paused!important}.dream-msg__background{stroke-width:2;fill:none}.dream-msg-stage{position:fixed;top:20px;left:50%;width:auto;transform:translate(-50%,0);z-index:3000}.dream-msg-wrapper{position:relative;left:50%;transform:translate(-50%,0);transform:translate3d(-50%,0,0);transition:height .3s ease,padding .3s ease;padding:6px 0;will-change:transform,opacity}.dream-msg{padding:10px 21px;border-radius:4px;box-shadow:0 4px 12px rgba(0,0,0,0.15);position:relative;left:50%;transform:translate(-50%,0);transform:translate3d(-50%,0,0);display:flex;align-items:center}.dream-msg-content,.dream-msg-icon,.dream-msg-wait{display:inline-block}.dream-msg-icon{position:relative;width:15px;height:15px;border-radius:100%;display:flex;justify-content:center;align-items:center}.dream-msg-icon svg{position:absolute;top:50%;left:53%;transform:translate(-50%,-50%);width:12px;height:12px}.dream-msg-wait{width:20px;height:20px;position:relative;fill:#4eb127}.dream-msg-wait svg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.dream-msg-close{width:14px;height:14px}.dream-msg-content{margin:0 10px;min-width:240px;text-align:left;font-size:14px;font-weight:500;font-family:-apple-system,Microsoft Yahei,sans-serif;text-shadow:0 0 1px rgba(0,0,0,.01)}.dream-msg.info{color:#0fafad;background-color:#e7fdfc;box-shadow:0 0 2px 0 rgba(0,1,1,.01),0 0 0 1px #c0faf9}.dream-msg.info .dream-msg-icon{background-color:#0fafad}.dream-msg.success{color:#4ebb23;background-color:#f3ffe8;box-shadow:0 0 2px 0 rgba(0,1,0,.01),0 0 0 1px #d9f8bb}.dream-msg.success .dream-msg-icon{background-color:#4ebb23}.dream-msg.warning{color:#f1b306;background-color:#fff9eb;box-shadow:0 0 2px 0 rgba(1,1,0,.01),0 0 0 1px #fcf2cd}.dream-msg.warning .dream-msg-icon{background-color:#f1b306}.dream-msg.error{color:#f34b51;background-color:#fff7f7;box-shadow:0 0 2px 0 rgba(1,0,0,.01),0 0 0 1px #ffe3e3}.dream-msg.error .dream-msg-icon{background-color:#f34b51}.dream-msg.loading{color:#0B69E3;background-color:#DEEEFC;box-shadow:0 0 2px 0 rgba(0,1,1,.01),0 0 0 1px #DEEEFC}.dream-msg_loading{flex-shrink:0;width:20px;height:20px;position:relative}.dream-msg-circular{-webkit-animation:dream-msg-rotate 2s linear infinite both;animation:dream-msg-rotate 2s linear infinite both;transform-origin:center center;height:18px!important;width:18px!important}.dream-msg-path{stroke-dasharray:1,200;stroke-dashoffset:0;stroke:#0B69E3;-webkit-animation:dream-msg-dash 1.5s ease-in-out infinite;animation:dream-msg-dash 1.5s ease-in-out infinite;stroke-linecap:round}@-webkit-keyframes dream-msg-rotate{100%{transform:translate(-50%,-50%) rotate(360deg)}}@keyframes dream-msg-rotate{100%{transform:translate(-50%,-50%) rotate(360deg)}}@-webkit-keyframes dream-msg-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes dream-msg-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}.dream-msg.info .dream-msg-wait{fill:#0fafad}.dream-msg.success .dream-msg-wait{fill:#4ebb23}.dream-msg.warning .dream-msg-wait{fill:#f1b306}.dream-msg.error .dream-msg-wait{fill:#f34b51}.dream-msg.loading .dream-msg-wait{fill:#0fafad}.dream-msg-pointer{cursor:pointer}@-webkit-keyframes dream-msg_info{0%{stroke:#0fafad}to{stroke:#0fafad;stroke-dasharray:0 100}}@keyframes dream-msg_info{0%{stroke:#0fafad}to{stroke:#0fafad;stroke-dasharray:0 100}}@-webkit-keyframes dream-msg_success{0%{stroke:#4eb127}to{stroke:#4eb127;stroke-dasharray:0 100}}@keyframes dream-msg_success{0%{stroke:#4eb127}to{stroke:#4eb127;stroke-dasharray:0 100}}@-webkit-keyframes dream-msg_warning{0%{stroke:#fcbc0b}to{stroke:#fcbc0b;stroke-dasharray:0 100}}@keyframes dream-msg_warning{0%{stroke:#fcbc0b}to{stroke:#fcbc0b;stroke-dasharray:0 100}}@-webkit-keyframes dream-msg_error{0%{stroke:#eb262d}to{stroke:#eb262d;stroke-dasharray:0 100}}@keyframes dream-msg_error{0%{stroke:#eb262d}to{stroke:#eb262d;stroke-dasharray:0 100}}.dream-msg-fade-in{-webkit-animation:dream-msg-fade .2s ease-out both;animation:dream-msg-fade .2s ease-out both}.dream-msg-fade-out{animation:dream-msg-fade .3s linear reverse both}@-webkit-keyframes dream-msg-fade{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,-80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0,0)}}@keyframes dream-msg-fade{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,-80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0,0)}}\n ";_css.innerHTML=cssStr;if(head.children.length){head.insertBefore(_css,head.children[0])}else{head.appendChild(_css)}}}return Dreamer});function errorSound(){var audio=document.createElement('audio');audio.setAttribute('src','https://cdn.jsdelivr.net/gh/iGaoWei/Dream-Msg/lib/wav/tip.mp3');audio.setAttribute('autoplay','autoplay')}