1 line
306 KiB
JavaScript
1 line
306 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-users-user_brokerage-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(A){this.setContent(A)}},mounted:function(){this.imgList=[],this.imgList.each=function(A){for(var e=0,t=this.length;e<t;e++)this.setItem(e,A(this[e],e,this))},this.imgList.setItem=function(A,e){if(void 0!=A&&e){if(0==e.indexOf("http")&&this.includes(e)){for(var t,n="",a=0;t=e[a];a++){if("/"==t&&"/"!=e[a-1]&&"/"!=e[a+1])break;n+=Math.random()>.5?t.toUpperCase():t}return n+=e.substr(a),this[A]=n}if(this[A]=e,e.includes("data:image")){var i=e.match(/data:image\/(\S+?);(\S+?),(.+)/);if(!i)return}}},this.html&&this.setContent(this.html)},beforeDestroy:function(){this._observer&&this._observer.disconnect(),this.imgList.each((function(A){})),clearInterval(this._timer)},methods:{_Dom2Str:function(A){var e,t="",n=(0,_createForOfIteratorHelper2.default)(A);try{for(n.s();!(e=n.n()).done;){var a=e.value;if("text"==a.type)t+=a.text;else{for(var i in t+="<"+a.name,a.attrs||{})t+=" "+i+'="'+a.attrs[i]+'"';a.children&&a.children.length?t+=">"+this._Dom2Str(a.children)+"</"+a.name+">":t+=">"}}}catch(s){n.e(s)}finally{n.f()}return t},_handleHtml:function(A,e){if("string"!=typeof A&&(A=this._Dom2Str(A.nodes||A)),A.includes("rpx")&&(A=A.replace(/[0-9.]+\s*rpx/g,(function(A){return parseFloat(A)*rpx+"px"}))),!e){var t="<style scoped>@keyframes show{0%{opacity:0}100%{opacity:1}}";for(var n in cfg.userAgentStyles)t+="".concat(n,"{").concat(cfg.userAgentStyles[n],"}");for(n in this.tagStyle)t+="".concat(n,"{").concat(this.tagStyle[n],"}");t+="</style>",A=t+A}return A},setContent:function(A,e){var t=this;if(A){var n=document.createElement("div");e?this.rtf?this.rtf.appendChild(n):this.rtf=n:(this.rtf&&this.rtf.parentNode.removeChild(this.rtf),this.rtf=n),n.innerHTML=this._handleHtml(A,e);for(var a,i=this.rtf.getElementsByTagName("style"),s=0;a=i[s++];)a.innerHTML=a.innerHTML.replace(/body/g,"#rtf"+this._uid),a.setAttribute("scoped","true");!this._observer&&this.lazyLoad&&IntersectionObserver&&(this._observer=new IntersectionObserver((function(A){for(var e,n=0;e=A[n++];)e.isIntersecting&&(e.target.src=e.target.getAttribute("data-src"),e.target.removeAttribute("data-src"),t._observer.unobserve(e.target))}),{rootMargin:"900px 0px 900px 0px"}));var f=this,r=this.rtf.getElementsByTagName("title");r.length&&this.autosetTitle&&uni.setNavigationBarTitle({title:r[0].innerText}),this.imgList.length=0;for(var c,v=this.rtf.getElementsByTagName("img"),o=0,d=0;c=v[o];o++){c.style.maxWidth="100%";var x=c.getAttribute("src");this.domain&&x&&("/"==x[0]?"/"==x[1]?c.src=(this.domain.includes("://")?this.domain.split("://")[0]:"")+":"+x:c.src=this.domain+x:x.includes("://")||(c.src=this.domain+"/"+x)),c.hasAttribute("ignore")||"A"==c.parentElement.nodeName||(c.i=d++,f.imgList.push(c.src||c.getAttribute("data-src")),c.onclick=function(){var A=!0;this.ignore=function(){return A=!1},f.$emit("imgtap",this),A&&uni.previewImage({current:this.i,urls:f.imgList})}),c.onerror=function(){f.$emit("error",{source:"img",target:this})},f.lazyLoad&&this._observer&&c.src&&0!=c.i&&(c.setAttribute("data-src",c.src
|