zx/public/static/js/pages-users-user_grade-inde...

1 line
129 KiB
JavaScript
Raw Permalink Normal View History

2024-07-02 15:32:59 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-users-user_grade-index"],{"0d43":function(module,exports,__webpack_require__){"use strict";__webpack_require__("6a54");var _interopRequireDefault=__webpack_require__("f5bd").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _createForOfIteratorHelper2=_interopRequireDefault(__webpack_require__("3471"));__webpack_require__("5ef2"),__webpack_require__("4626"),__webpack_require__("5ac7"),__webpack_require__("5c47"),__webpack_require__("2c10"),__webpack_require__("a1c1"),__webpack_require__("e838"),__webpack_require__("c223"),__webpack_require__("aa9c");var rpx=uni.getSystemInfoSync().screenWidth/750,cfg=__webpack_require__("dc04"),_default={name:"parser",data:function(){return{uid:this._uid,scaleAm:"",showAm:"",imgs:[],nodes:[]}},props:{html:null,autopause:{type:Boolean,default:!0},autosetTitle:{type:Boolean,default:!0},domain:String,gestureZoom:Boolean,lazyLoad:Boolean,selectable:Boolean,tagStyle:Object,showWithAnimation:Boolean,useAnchor:Boolean},watch:{html:function(e){this.setContent(e)}},mounted:function(){this.imgList=[],this.imgList.each=function(e){for(var t=0,a=this.length;t<a;t++)this.setItem(t,e(this[t],t,this))},this.imgList.setItem=function(e,t){if(void 0!=e&&t){if(0==t.indexOf("http")&&this.includes(t)){for(var a,i="",r=0;a=t[r];r++){if("/"==a&&"/"!=t[r-1]&&"/"!=t[r+1])break;i+=Math.random()>.5?a.toUpperCase():a}return i+=t.substr(r),this[e]=i}if(this[e]=t,t.includes("data:image")){var n=t.match(/data:image\/(\S+?);(\S+?),(.+)/);if(!n)return}}},this.html&&this.setContent(this.html)},beforeDestroy:function(){this._observer&&this._observer.disconnect(),this.imgList.each((function(e){})),clearInterval(this._timer)},methods:{_Dom2Str:function(e){var t,a="",i=(0,_createForOfIteratorHelper2.default)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;if("text"==r.type)a+=r.text;else{for(var n in a+="<"+r.name,r.attrs||{})a+=" "+n+'="'+r.attrs[n]+'"';r.children&&r.children.length?a+=">"+this._Dom2Str(r.children)+"</"+r.name+">":a+=">"}}}catch(s){i.e(s)}finally{i.f()}return a},_handleHtml:function(e,t){if("string"!=typeof e&&(e=this._Dom2Str(e.nodes||e)),e.includes("rpx")&&(e=e.replace(/[0-9.]+\s*rpx/g,(function(e){return parseFloat(e)*rpx+"px"}))),!t){var a="<style scoped>@keyframes show{0%{opacity:0}100%{opacity:1}}";for(var i in cfg.userAgentStyles)a+="".concat(i,"{").concat(cfg.userAgentStyles[i],"}");for(i in this.tagStyle)a+="".concat(i,"{").concat(this.tagStyle[i],"}");a+="</style>",e=a+e}return e},setContent:function(e,t){var a=this;if(e){var i=document.createElement("div");t?this.rtf?this.rtf.appendChild(i):this.rtf=i:(this.rtf&&this.rtf.parentNode.removeChild(this.rtf),this.rtf=i),i.innerHTML=this._handleHtml(e,t);for(var r,n=this.rtf.getElementsByTagName("style"),s=0;r=n[s++];)r.innerHTML=r.innerHTML.replace(/body/g,"#rtf"+this._uid),r.setAttribute("scoped","true");!this._observer&&this.lazyLoad&&IntersectionObserver&&(this._observer=new IntersectionObserver((function(e){for(var t,i=0;t=e[i++];)t.isIntersecting&&(t.target.src=t.target.getAttribute("data-src"),t.target.removeAttribute("data-src"),a._observer.unobserve(t.target))}),{rootMargin:"900px 0px 900px 0px"}));var u=this,o=this.rtf.getElementsByTagName("title");o.length&&this.autosetTitle&&uni.setNavigationBarTitle({title:o[0].innerText}),this.imgList.length=0;for(var d,l=this.rtf.getElementsByTagName("img"),c=0,v=0;d=l[c];c++){d.style.maxWidth="100%";var f=d.getAttribute("src");this.domain&&f&&("/"==f[0]?"/"==f[1]?d.src=(this.domain.includes("://")?this.domain.split("://")[0]:"")+":"+f:d.src=this.domain+f:f.includes("://")||(d.src=this.domain+"/"+f)),d.hasAttribute("ignore")||"A"==d.parentElement.nodeName||(d.i=v++,u.imgList.push(d.src||d.getAttribute("data-src")),d.onclick=function(){var e=!0;this.ignore=function(){return e=!1},u.$emit("imgtap",this),e&&uni.previewImage({current:this.i,urls:u.imgList})}),d.onerror=function(){u.$emit("error",{source:"img",target:this})},u.lazyLoad&&this._observer&&d.src&&0!=d.i&&(d.setAttribute("data-src",d.src),d.