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
28 KiB
1 lines
28 KiB
import{_ as t}from"./u-navbar.CwZJfInl.js";import{ag as e,ah as s,ai as i,n as a,aj as n,ak as r,o,c as l,w as h,f as c,F as d,g as p,M as u,m,k as g,al as f,e as y,t as b,d as x,v,j as k,i as _,am as w,an as T,ao as $,ap as N,aq as L,ar as S,O,r as C,as as I,b as j,u as R}from"./index-DkGewvWo.js";import{o as A,r as z}from"./uni-app.es.Bo01BzMV.js";import{_ as B}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{c as E}from"./car.CcI8AEaV.js";import"./u-status-bar.DDNs5qwz.js";import"./u-icon.x7ElsZU9.js";var V={abbr:!0,b:!0,big:!0,code:!0,del:!0,em:!0,i:!0,ins:!0,label:!0,q:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0};const q={isInline:function(t,e){return V[t]||-1!==(e||"").indexOf("display:inline")}},F=t=>{t.$wxs||(t.$wxs=[]),t.$wxs.push("handler"),t.mixins||(t.mixins=[]),t.mixins.push({beforeCreate(){this.handler=q}})},P={name:"node",options:{},data:()=>({ctrl:{}}),props:{name:String,attrs:{type:Object,default:()=>({})},childs:Array,opts:Array},components:{},mounted(){if(this.$nextTick((()=>{for(this.root=this.$parent;"u-parse"!==this.root.$options.name;this.root=this.root.$parent);})),this.opts[0]){let t;for(t=this.childs.length;t--&&"img"!==this.childs[t].name;);-1!==t&&(this.observer=e(this).relativeToViewport({top:500,bottom:500}),this.observer.observe("._img",(t=>{t.intersectionRatio&&(this.$set(this.ctrl,"load",1),this.observer.disconnect())})))}},beforeDestroy(){this.observer&&this.observer.disconnect()},methods:{play(t){if(this.root.$emit("play"),this.root.pauseVideo){let e=!1;const i=t.target.id;for(let t=this.root._videos.length;t--;)this.root._videos[t].id===i?e=!0:this.root._videos[t].pause();if(!e){const t=s(i,this);t.id=i,this.root.playbackRate&&t.playbackRate(this.root.playbackRate),this.root._videos.push(t)}}},imgTap(t){const e=this.childs[t.currentTarget.dataset.i];e.a?this.linkTap(e.a):e.attrs.ignore||(e.attrs.src=e.attrs.src||e.attrs["data-src"],this.root.$emit("imgTap",e.attrs),this.root.previewImg&&i({current:parseInt(e.attrs.i),urls:this.root.imgList}))},imgLongTap(t){},imgLoad(t){const e=t.currentTarget.dataset.i;(this.opts[1]&&!this.ctrl[e]||-1===this.ctrl[e])&&this.$set(this.ctrl,e,1),this.checkReady()},checkReady(){this.root.lazyLoad||(this.root._unloadimgs-=1,this.root._unloadimgs||setTimeout((()=>{this.root.getRect().then((t=>{this.root.$emit("ready",t)})).catch((()=>{this.root.$emit("ready",{})}))}),350))},linkTap(t){const e=t.currentTarget?this.childs[t.currentTarget.dataset.i]:{},s=e.attrs||t,i=s.href;this.root.$emit("linkTap",Object.assign({innerText:this.root.getText(e.children||[])},s)),i&&("#"===i[0]?this.root.navigateTo(i.substring(1)).catch((()=>{})):i.split("?")[0].includes("://")?this.root.copyLink&&window.open(i):a({url:i,fail(){n({url:i,fail(){}})}}))},mediaError(t){const e=t.currentTarget.dataset.i,s=this.childs[e];if("video"===s.name||"audio"===s.name){let t=(this.ctrl[e]||0)+1;if(t>s.src.length&&(t=0),t<s.src.length)return void this.$set(this.ctrl,e,t)}else if("img"===s.name){if(this.opts[0]&&!this.ctrl.load)return;this.opts[2]&&this.$set(this.ctrl,e,-1),this.checkReady()}this.root&&this.root.$emit("error",{source:s.name,attrs:s.attrs})}}};F(P);const D=B(P,[["render",function(t,e,s,i,a,n){const $=v,N=k,L=r("node",!0),S=_,O=w,C=T;return o(),l(S,{id:s.attrs.id,class:g("_block _"+s.name+" "+s.attrs.class),style:u(s.attrs.style)},{default:h((()=>[(o(!0),c(d,null,p(s.childs,((i,r)=>(o(),c(d,{key:r},["img"===i.name&&!i.t&&(s.opts[1]&&!a.ctrl[r]||a.ctrl[r]<0)?(o(),l($,{key:0,class:"_img",style:u(i.attrs.style),src:a.ctrl[r]<0?s.opts[2]:s.opts[1],mode:"widthFix"},null,8,["style","src"])):m("",!0),"img"===i.name?(o(),c("img",{key:1,id:i.attrs.id,class:g("_img "+i.attrs.class),style:u((-1===a.ctrl[r]?"display:none;":"")+i.attrs.style),src:i.attrs.src||(a.ctrl.load?i.attrs["data-src"]:""),"data-i":r,onLoad:e[0]||(e[0]=(...t)=>n.imgLoad&&n.imgLoad(...t)),onError:e[1]||(e[1]=(...t)=>n.mediaError&&n.mediaError(...t)),onClick:e[2]||(e[2]=f(((...t)=>n.imgTap&&n.imgTap(...t)),["stop"])),onLongpress:e[3]||(e[3]=(...t)=>n.imgLongTap&&n.imgLongTap(...t))},null,46,["id","src","data-i"])):i.text?(o(),l(N,{key:2,decode:""},{default:h((()=>[y(b(i.text),1)])),_:2},1024)):"br"===i.name?(o(),l(N,{key:3},{default:h((()=>[y("\\n")])),_:1})):"a"===i.name?(o(),l(S,{key:4,id:i.attrs.id,class:g((i.attrs.href?"_a ":"")+i.attrs.class),"hover-class":"_hover",style:u("display:inline;"+i.attrs.style),"data-i":r,onClick:f(n.linkTap,["stop"])},{default:h((()=>[x(L,{name:"span",childs:i.children,opts:s.opts,style:{display:"inherit"}},null,8,["childs","opts"])])),_:2},1032,["id","class","style","data-i","onClick"])):"video"===i.name?(o(),l(O,{key:5,id:i.attrs.id,class:g(i.attrs.class),style:u(i.attrs.style),autoplay:i.attrs.autoplay,controls:i.attrs.controls,loop:i.attrs.loop,muted:i.attrs.muted,"object-fit":i.attrs["object-fit"],poster:i.attrs.poster,src:i.src[a.ctrl[r]||0],"data-i":r,onPlay:n.play,onError:n.mediaError},null,8,["id","class","style","autoplay","controls","loop","muted","object-fit","poster","src","data-i","onPlay","onError"])):"iframe"===i.name?(o(),c("iframe",{key:6,style:u(i.attrs.style),allowfullscreen:i.attrs.allowfullscreen,frameborder:i.attrs.frameborder,src:i.attrs.src},null,12,["allowfullscreen","frameborder","src"])):"embed"===i.name?(o(),c("embed",{key:7,style:u(i.attrs.style),src:i.attrs.src},null,12,["src"])):"table"===i.name&&i.c||"li"===i.name?(o(),l(S,{key:8,id:i.attrs.id,class:g("_"+i.name+" "+i.attrs.class),style:u(i.attrs.style)},{default:h((()=>["li"===i.name?(o(),l(L,{key:0,childs:i.children,opts:s.opts},null,8,["childs","opts"])):(o(!0),c(d,{key:1},p(i.children,((t,e)=>(o(),l(S,{key:e,class:g("_"+t.name+" "+t.attrs.class),style:u(t.attrs.style)},{default:h((()=>["td"===t.name||"th"===t.name?(o(),l(L,{key:0,childs:t.children,opts:s.opts},null,8,["childs","opts"])):(o(!0),c(d,{key:1},p(t.children,((t,e)=>(o(),c(d,{key:e},["td"===t.name||"th"===t.name?(o(),l(S,{key:0,class:g("_"+t.name+" "+t.attrs.class),style:u(t.attrs.style)},{default:h((()=>[x(L,{childs:t.children,opts:s.opts},null,8,["childs","opts"])])),_:2},1032,["class","style"])):(o(),l(S,{key:1,class:g("_"+t.name+" "+t.attrs.class),style:u(t.attrs.style)},{default:h((()=>[(o(!0),c(d,null,p(t.children,((t,e)=>(o(),l(S,{key:e,class:g("_"+t.name+" "+t.attrs.class),style:u(t.attrs.style)},{default:h((()=>[x(L,{childs:t.children,opts:s.opts},null,8,["childs","opts"])])),_:2},1032,["class","style"])))),128))])),_:2},1032,["class","style"]))],64)))),128))])),_:2},1032,["class","style"])))),128))])),_:2},1032,["id","class","style"])):i.c||t.handler.isInline(i.name,i.attrs.style)?2===i.c?(o(),l(S,{key:10,id:i.attrs.id,class:g("_block _"+i.name+" "+i.attrs.class),style:u(i.f+";"+i.attrs.style)},{default:h((()=>[(o(!0),c(d,null,p(i.children,((t,e)=>(o(),l(L,{key:e,style:u(t.f),name:t.name,attrs:t.attrs,childs:t.children,opts:s.opts},null,8,["style","name","attrs","childs","opts"])))),128))])),_:2},1032,["id","class","style"])):(o(),l(L,{key:11,style:u(i.f),name:i.name,attrs:i.attrs,childs:i.children,opts:s.opts},null,8,["style","name","attrs","childs","opts"])):(o(),l(C,{key:9,id:i.attrs.id,style:u(i.f),"user-select":s.opts[4],nodes:[i]},null,8,["id","style","user-select","nodes"]))],64)))),128))])),_:1},8,["id","class","style"])}],["__scopeId","data-v-0cff2660"]]),U={trustTags:H("a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,ruby,rt,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video"),blockTags:H("address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section"),ignoreTags:H("area,base,canvas,embed,frame,head,iframe,input,link,map,meta,param,rp,script,source,style,textarea,title,track,wbr"),voidTags:H("area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr"),entities:{lt:"<",gt:">",quot:'"',apos:"'",ensp:" ",emsp:" ",nbsp:" ",semi:";",ndash:"–",mdash:"—",middot:"·",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",hellip:"…",larr:"←",uarr:"↑",rarr:"→",darr:"↓"},tagStyle:{address:"font-style:italic",big:"display:inline;font-size:1.2em",caption:"display:table-caption;text-align:center",center:"text-align:center",cite:"font-style:italic",dd:"margin-left:40px",mark:"background-color:yellow",pre:"font-family:monospace;white-space:pre",s:"text-decoration:line-through",small:"display:inline;font-size:0.8em",strike:"text-decoration:line-through",u:"text-decoration:underline"},svgDict:{animatetransform:"animateTransform",lineargradient:"linearGradient",viewbox:"viewBox",attributename:"attributeName",repeatcount:"repeatCount",repeatdur:"repeatDur"}},M={},{windowWidth:Z}=$(),G=H(" ,\r,\n,\t,\f");let W=0;function H(t){const e=Object.create(null),s=t.split(",");for(let i=s.length;i--;)e[s[i]]=!0;return e}function J(t,e){let s=t.indexOf("&");for(;-1!==s;){const i=t.indexOf(";",s+3);let a;if(-1===i)break;"#"===t[s+1]?(a=parseInt(("x"===t[s+2]?"0":"")+t.substring(s+2,i)),isNaN(a)||(t=t.substr(0,s)+String.fromCharCode(a)+t.substr(i+1))):(a=t.substring(s+1,i),(U.entities[a]||"amp"===a&&e)&&(t=t.substr(0,s)+(U.entities[a]||"&")+t.substr(i+1))),s=t.indexOf("&",s+1)}return t}function K(t){let e=t.length-1;for(let s=e;s>=-1;s--)(-1===s||t[s].c||!t[s].name||"div"!==t[s].name&&"p"!==t[s].name&&"h"!==t[s].name[0]||(t[s].attrs.style||"").includes("inline"))&&(e-s>=5&&t.splice(s+1,e-s,{name:"div",attrs:{},children:t.slice(s+1,e+1)}),e=s-1)}function Q(t){this.options=t||{},this.tagStyle=Object.assign({},U.tagStyle,this.options.tagStyle),this.imgList=t.imgList||[],this.imgList._unloadimgs=0,this.plugins=t.plugins||[],this.attrs=Object.create(null),this.stack=[],this.nodes=[],this.pre=(this.options.containerStyle||"").includes("white-space")&&this.options.containerStyle.includes("pre")?2:0}function X(t){this.handler=t}U.ignoreTags.iframe=void 0,U.trustTags.iframe=!0,U.ignoreTags.embed=void 0,U.trustTags.embed=!0,Q.prototype.parse=function(t){for(let e=this.plugins.length;e--;)this.plugins[e].onUpdate&&(t=this.plugins[e].onUpdate(t,U)||t);for(new X(this).parse(t);this.stack.length;)this.popNode();return this.nodes.length>50&&K(this.nodes),this.nodes},Q.prototype.expose=function(){for(let t=this.stack.length;t--;){const e=this.stack[t];if(e.c||"a"===e.name||"video"===e.name||"audio"===e.name)return;e.c=1}},Q.prototype.hook=function(t){for(let e=this.plugins.length;e--;)if(this.plugins[e].onParse&&!1===this.plugins[e].onParse(t,this))return!1;return!0},Q.prototype.getUrl=function(t){const e=this.options.domain;return"/"===t[0]?"/"===t[1]?t=(e?e.split("://")[0]:"http")+":"+t:e&&(t=e+t):t.includes("data:")||t.includes("://")||e&&(t=e+"/"+t),t},Q.prototype.parseStyle=function(t){const e=t.attrs,s=(this.tagStyle[t.name]||"").split(";").concat((e.style||"").split(";")),i={};let a="";e.id&&!this.xml&&(this.options.useAnchor?this.expose():"img"!==t.name&&"a"!==t.name&&"video"!==t.name&&"audio"!==t.name&&(e.id=void 0)),e.width&&(i.width=parseFloat(e.width)+(e.width.includes("%")?"%":"px"),e.width=void 0),e.height&&(i.height=parseFloat(e.height)+(e.height.includes("%")?"%":"px"),e.height=void 0);for(let n=0,r=s.length;n<r;n++){const t=s[n].split(":");if(t.length<2)continue;const e=t.shift().trim().toLowerCase();let r=t.join(":").trim();if("-"===r[0]&&r.lastIndexOf("-")>0||r.includes("safe"))a+=`;${e}:${r}`;else if(!i[e]||r.includes("import")||!i[e].includes("import")){if(r.includes("url")){let t=r.indexOf("(")+1;if(t){for(;'"'===r[t]||"'"===r[t]||G[r[t]];)t++;r=r.substr(0,t)+this.getUrl(r.substr(t))}}else r.includes("rpx")&&(r=r.replace(/[0-9.]+\s*rpx/g,(t=>parseFloat(t)*Z/750+"px")));i[e]=r}}return t.attrs.style=a,i},Q.prototype.onTagName=function(t){this.tagName=this.xml?t:t.toLowerCase(),"svg"===this.tagName&&(this.xml=(this.xml||0)+1)},Q.prototype.onAttrName=function(t){"data-"===(t=this.xml?t:t.toLowerCase()).substr(0,5)?"data-src"!==t||this.attrs.src?"img"===this.tagName||"a"===this.tagName?this.attrName=t:this.attrName=void 0:this.attrName="src":(this.attrName=t,this.attrs[t]="T")},Q.prototype.onAttrVal=function(t){const e=this.attrName||"";"style"===e||"href"===e?this.attrs[e]=J(t,!0):e.includes("src")?this.attrs[e]=this.getUrl(J(t,!0)):e&&(this.attrs[e]=t)},Q.prototype.onOpenTag=function(t){const e=Object.create(null);e.name=this.tagName,e.attrs=this.attrs,this.options.nodes.length&&(e.type="node"),this.attrs=Object.create(null);const s=e.attrs,i=this.stack[this.stack.length-1],a=i?i.children:this.nodes,n=this.xml?t:U.voidTags[e.name];if(M[e.name]&&(s.class=M[e.name]+(s.class?" "+s.class:"")),"embed"===e.name&&this.expose(),"video"!==e.name&&"audio"!==e.name||("video"!==e.name||s.id||(s.id="v"+W++),s.controls||s.autoplay||(s.controls="T"),e.src=[],s.src&&(e.src.push(s.src),s.src=void 0),this.expose()),n){if(!this.hook(e)||U.ignoreTags[e.name])return void("base"!==e.name||this.options.domain?"source"===e.name&&i&&("video"===i.name||"audio"===i.name)&&s.src&&i.src.push(s.src):this.options.domain=s.href);const t=this.parseStyle(e);if("img"===e.name){if(s.src&&(s.src.includes("webp")&&(e.webp="T"),s.src.includes("data:")&&!s["original-src"]&&(s.ignore="T"),!s.ignore||e.webp||s.src.includes("cloud://"))){for(let a=this.stack.length;a--;){const i=this.stack[a];"a"===i.name&&(e.a=i.attrs),"table"!==i.name||e.webp||s.src.includes("cloud://")||(!t.display||t.display.includes("inline")?e.t="inline-block":e.t=t.display,t.display=void 0),i.c=1}s.i=this.imgList.length.toString();let i=s["original-src"]||s.src;this.imgList.push(i),e.t||(this.imgList._unloadimgs+=1),this.options.lazyLoad&&(s["data-src"]=s.src,s.src=void 0)}"inline"===t.display&&(t.display=""),s.ignore&&(t["max-width"]=t["max-width"]||"100%",s.style+=";-webkit-touch-callout:none"),parseInt(t.width)>Z&&(t.height=void 0),isNaN(parseInt(t.width))||(e.w="T"),!isNaN(parseInt(t.height))&&(!t.height.includes("%")||i&&(i.attrs.style||"").includes("height"))&&(e.h="T")}else if("svg"===e.name)return a.push(e),this.stack.push(e),void this.popNode();for(const e in t)t[e]&&(s.style+=`;${e}:${t[e].replace(" !important","")}`);s.style=s.style.substr(1)||void 0}else("pre"===e.name||(s.style||"").includes("white-space")&&s.style.includes("pre"))&&2!==this.pre&&(this.pre=e.pre=1),e.children=[],this.stack.push(e);a.push(e)},Q.prototype.onCloseTag=function(t){let e;for(t=this.xml?t:t.toLowerCase(),e=this.stack.length;e--&&this.stack[e].name!==t;);if(-1!==e)for(;this.stack.length>e;)this.popNode();else if("p"===t||"br"===t){(this.stack.length?this.stack[this.stack.length-1].children:this.nodes).push({name:t,attrs:{class:M[t]||"",style:this.tagStyle[t]||""}})}},Q.prototype.popNode=function(){const t=this.stack.pop();let e=t.attrs;const s=t.children,i=this.stack[this.stack.length-1],a=i?i.children:this.nodes;if(!this.hook(t)||U.ignoreTags[t.name])return"title"===t.name&&s.length&&"text"===s[0].type&&this.options.setTitle&&N({title:s[0].text}),void a.pop();if(t.pre&&2!==this.pre){this.pre=t.pre=void 0;for(let t=this.stack.length;t--;)this.stack[t].pre&&(this.pre=1)}const n={};if("svg"===t.name){if(this.xml>1)return void this.xml--;let s="";const i=e.style;return e.style="",e.xmlns="http://www.w3.org/2000/svg",function t(e){if("text"===e.type)return void(s+=e.text);const i=U.svgDict[e.name]||e.name;s+="<"+i;for(const a in e.attrs){const t=e.attrs[a];t&&(s+=` ${U.svgDict[a]||a}="${t}"`)}if(e.children){s+=">";for(let s=0;s<e.children.length;s++)t(e.children[s]);s+="</"+i+">"}else s+="/>"}(t),t.name="img",t.attrs={src:"data:image/svg+xml;utf8,"+s.replace(/#/g,"%23"),style:i,ignore:"T"},t.children=void 0,void(this.xml=!1)}if(e.align&&("table"===t.name?"center"===e.align?n["margin-inline-start"]=n["margin-inline-end"]="auto":n.float=e.align:n["text-align"]=e.align,e.align=void 0),e.dir&&(n.direction=e.dir,e.dir=void 0),"font"===t.name&&(e.color&&(n.color=e.color,e.color=void 0),e.face&&(n["font-family"]=e.face,e.face=void 0),e.size)){let t=parseInt(e.size);isNaN(t)||(t<1?t=1:t>7&&(t=7),n["font-size"]=["x-small","small","medium","large","x-large","xx-large","xxx-large"][t-1]),e.size=void 0}if((e.class||"").includes("align-center")&&(n["text-align"]="center"),Object.assign(n,this.parseStyle(t)),"table"!==t.name&&parseInt(n.width)>Z&&(n["max-width"]="100%",n["box-sizing"]="border-box"),U.blockTags[t.name]?t.name="div":U.trustTags[t.name]||this.xml||(t.name="span"),"a"===t.name||"ad"===t.name||"iframe"===t.name)this.expose();else if("video"===t.name)(n.height||"").includes("auto")&&(n.height=void 0);else if("ul"!==t.name&&"ol"!==t.name||!t.c){if("table"===t.name){let i=parseFloat(e.cellpadding),a=parseFloat(e.cellspacing);const r=parseFloat(e.border),o=n["border-color"],l=n["border-style"];if(t.c&&(isNaN(i)&&(i=2),isNaN(a)&&(a=2)),r&&(e.style+=`;border:${r}px ${l||"solid"} ${o||"gray"}`),t.flag&&t.c){n.display="grid",a?(n["grid-gap"]=a+"px",n.padding=a+"px"):r&&(e.style+=";border-left:0;border-top:0");const h=[],c=[],d=[],p={};!function t(e){for(let s=0;s<e.length;s++)"tr"===e[s].name?c.push(e[s]):t(e[s].children||[])}(s);for(let t=1;t<=c.length;t++){let e=1;for(let s=0;s<c[t-1].children.length;s++){const n=c[t-1].children[s];if("td"===n.name||"th"===n.name){for(;p[t+"."+e];)e++;let s=n.attrs.style||"",c=s.indexOf("width")?s.indexOf(";width"):0;if(-1!==c){let t=s.indexOf(";",c+6);-1===t&&(t=s.length),n.attrs.colspan||(h[e]=s.substring(c?c+7:6,t)),s=s.substr(0,c)+s.substr(t)}if(s+=";display:flex",c=s.indexOf("vertical-align"),-1!==c){const t=s.substr(c+15,10);t.includes("middle")?s+=";align-items:center":t.includes("bottom")&&(s+=";align-items:flex-end")}else s+=";align-items:center";if(c=s.indexOf("text-align"),-1!==c){const t=s.substr(c+11,10);t.includes("center")?s+=";justify-content: center":t.includes("right")&&(s+=";justify-content: right")}if(s=(r?`;border:${r}px ${l||"solid"} ${o||"gray"}`+(a?"":";border-right:0;border-bottom:0"):"")+(i?`;padding:${i}px`:"")+";"+s,n.attrs.colspan&&(s+=`;grid-column-start:${e};grid-column-end:${e+parseInt(n.attrs.colspan)}`,n.attrs.rowspan||(s+=`;grid-row-start:${t};grid-row-end:${t+1}`),e+=parseInt(n.attrs.colspan)-1),n.attrs.rowspan){s+=`;grid-row-start:${t};grid-row-end:${t+parseInt(n.attrs.rowspan)}`,n.attrs.colspan||(s+=`;grid-column-start:${e};grid-column-end:${e+1}`);for(let s=1;s<n.attrs.rowspan;s++)for(let i=0;i<(n.attrs.colspan||1);i++)p[t+s+"."+(e-i)]=1}s&&(n.attrs.style=s),d.push(n),e++}}if(1===t){let t="";for(let s=1;s<e;s++)t+=(h[s]?h[s]:"auto")+" ";n["grid-template-columns"]=t}}t.children=d}else t.c&&(n.display="table"),isNaN(a)||(n["border-spacing"]=a+"px"),(r||i)&&function t(e){for(let s=0;s<e.length;s++){const a=e[s];"th"===a.name||"td"===a.name?(r&&(a.attrs.style=`border:${r}px ${l||"solid"} ${o||"gray"};${a.attrs.style||""}`),i&&(a.attrs.style=`padding:${i}px;${a.attrs.style||""}`)):a.children&&t(a.children)}}(s);if(this.options.scrollTable&&!(e.style||"").includes("inline")){const s=Object.assign({},t);t.name="div",t.attrs={style:"overflow:auto"},t.children=[s],e=s.attrs}}else if("td"!==t.name&&"th"!==t.name||!e.colspan&&!e.rowspan)if("ruby"===t.name){t.name="span";for(let t=0;t<s.length-1;t++)"text"===s[t].type&&"rt"===s[t+1].name&&(s[t]={name:"div",attrs:{style:"display:inline-block;text-align:center"},children:[{name:"div",attrs:{style:"font-size:50%;"+(s[t+1].attrs.style||"")},children:s[t+1].children},s[t]]},s.splice(t+1,1))}else t.c&&function(t){t.c=2;for(let e=t.children.length;e--;){const s=t.children[e];s.c&&"table"!==s.name||(t.c=1)}}(t);else for(let o=this.stack.length;o--;)if("table"===this.stack[o].name){this.stack[o].flag=1;break}}else{const t={a:"lower-alpha",A:"upper-alpha",i:"lower-roman",I:"upper-roman"};t[e.type]&&(e.style+=";list-style-type:"+t[e.type],e.type=void 0);for(let e=s.length;e--;)"li"===s[e].name&&(s[e].c=1)}if((n.display||"").includes("flex")&&!t.c)for(let o=s.length;o--;){const t=s[o];t.f&&(t.attrs.style=(t.attrs.style||"")+t.f,t.f=void 0)}const r=i&&((i.attrs.style||"").includes("flex")||(i.attrs.style||"").includes("grid"))&&!t.c;r&&(t.f=";max-width:100%"),s.length>=50&&t.c&&!(n.display||"").includes("flex")&&K(s);for(const o in n)if(n[o]){const s=`;${o}:${n[o].replace(" !important","")}`;r&&(o.includes("flex")&&"flex-direction"!==o||"align-self"===o||o.includes("grid")||"-"===n[o][0]||o.includes("width")&&s.includes("%"))?(t.f+=s,"width"===o&&(e.style+=";width:100%")):e.style+=s}e.style=e.style.substr(1)||void 0},Q.prototype.onText=function(t){if(!this.pre){let e,s="";for(let i=0,a=t.length;i<a;i++)G[t[i]]?(" "!==s[s.length-1]&&(s+=" "),"\n"!==t[i]||e||(e=!0)):s+=t[i];if(" "===s){if(e)return;{const t=this.stack[this.stack.length-1];if(t&&"t"===t.name[0])return}}t=s}const e=Object.create(null);if(e.type="text",e.text=J(t),this.hook(e)){(this.stack.length?this.stack[this.stack.length-1].children:this.nodes).push(e)}},X.prototype.parse=function(t){this.content=t||"",this.i=0,this.start=0,this.state=this.text;for(let e=this.content.length;-1!==this.i&&this.i<e;)this.state()},X.prototype.checkClose=function(t){const e="/"===this.content[this.i];return!!(">"===this.content[this.i]||e&&">"===this.content[this.i+1])&&(t&&this.handler[t](this.content.substring(this.start,this.i)),this.i+=e?2:1,this.start=this.i,this.handler.onOpenTag(e),"script"===this.handler.tagName?(this.i=this.content.indexOf("</",this.i),-1!==this.i&&(this.i+=2,this.start=this.i),this.state=this.endTag):this.state=this.text,!0)},X.prototype.text=function(){if(this.i=this.content.indexOf("<",this.i),-1===this.i)return void(this.start<this.content.length&&this.handler.onText(this.content.substring(this.start,this.content.length)));const t=this.content[this.i+1];if(t>="a"&&t<="z"||t>="A"&&t<="Z")this.start!==this.i&&this.handler.onText(this.content.substring(this.start,this.i)),this.start=++this.i,this.state=this.tagName;else if("/"===t||"!"===t||"?"===t){this.start!==this.i&&this.handler.onText(this.content.substring(this.start,this.i));const e=this.content[this.i+2];if("/"===t&&(e>="a"&&e<="z"||e>="A"&&e<="Z"))return this.i+=2,this.start=this.i,void(this.state=this.endTag);let s="--\x3e";"!"===t&&"-"===this.content[this.i+2]&&"-"===this.content[this.i+3]||(s=">"),this.i=this.content.indexOf(s,this.i),-1!==this.i&&(this.i+=s.length,this.start=this.i)}else this.i++},X.prototype.tagName=function(){if(G[this.content[this.i]]){for(this.handler.onTagName(this.content.substring(this.start,this.i));G[this.content[++this.i]];);this.i<this.content.length&&!this.checkClose()&&(this.start=this.i,this.state=this.attrName)}else this.checkClose("onTagName")||this.i++},X.prototype.attrName=function(){let t=this.content[this.i];if(G[t]||"="===t){this.handler.onAttrName(this.content.substring(this.start,this.i));let e="="===t;const s=this.content.length;for(;++this.i<s;)if(t=this.content[this.i],!G[t]){if(this.checkClose())return;if(e)return this.start=this.i,void(this.state=this.attrVal);if("="!==this.content[this.i])return this.start=this.i,void(this.state=this.attrName);e=!0}}else this.checkClose("onAttrName")||this.i++},X.prototype.attrVal=function(){const t=this.content[this.i],e=this.content.length;if('"'===t||"'"===t){if(this.start=++this.i,this.i=this.content.indexOf(t,this.i),-1===this.i)return;this.handler.onAttrVal(this.content.substring(this.start,this.i))}else for(;this.i<e;this.i++){if(G[this.content[this.i]]){this.handler.onAttrVal(this.content.substring(this.start,this.i));break}if(this.checkClose("onAttrVal"))return}for(;G[this.content[++this.i]];);this.i<e&&!this.checkClose()&&(this.start=this.i,this.state=this.attrName)},X.prototype.endTag=function(){const t=this.content[this.i];if(G[t]||">"===t||"/"===t){if(this.handler.onCloseTag(this.content.substring(this.start,this.i)),">"!==t&&(this.i=this.content.indexOf(">",this.i),-1===this.i))return;this.start=++this.i,this.state=this.text}else this.i++};const Y=[];const tt=B({name:"u-parse",data:()=>({nodes:[]}),props:{containerStyle:{type:String,default:""},content:{type:String,default:""},copyLink:{type:[Boolean,String],default:!0},domain:String,errorImg:{type:String,default:""},lazyLoad:{type:[Boolean,String],default:!1},loadingImg:{type:String,default:""},pauseVideo:{type:[Boolean,String],default:!0},previewImg:{type:[Boolean,String],default:!0},scrollTable:[Boolean,String],selectable:[Boolean,String],setTitle:{type:[Boolean,String],default:!0},showImgMenu:{type:[Boolean,String],default:!0},tagStyle:Object,useAnchor:[Boolean,Number]},emits:["load","ready","imgTap","linkTap","play","error"],components:{node:D},watch:{content(t){this.setContent(t)}},created(){this.plugins=[];for(let t=Y.length;t--;)this.plugins.push(new Y[t](this))},mounted(){this.content&&!this.nodes.length&&this.setContent(this.content)},beforeUnmount(){this._hook("onDetached")},methods:{in(t,e,s){t&&e&&s&&(this._in={page:t,selector:e,scrollTop:s})},navigateTo(t,e){return new Promise(((s,i)=>{if(!this.useAnchor)return void i(Error("Anchor is disabled"));e=e||parseInt(this.useAnchor)||0;const a=L().in(this._in?this._in.page:this).select((this._in?this._in.selector:"._root")+(t?` #${t}`:"")).boundingClientRect();this._in?a.select(this._in.selector).scrollOffset().select(this._in.selector).boundingClientRect():a.selectViewport().scrollOffset(),a.exec((t=>{if(!t[0])return void i(Error("Label not found"));const a=t[1].scrollTop+t[0].top-(t[2]?t[2].top:0)+e;this._in?this._in.page[this._in.scrollTop]=a:S({scrollTop:a,duration:300}),s()}))}))},getText(t){let e="";return function t(s){for(let i=0;i<s.length;i++){const a=s[i];if("text"===a.type)e+=a.text.replace(/&/g,"&");else if("br"===a.name)e+="\n";else{const s="p"===a.name||"div"===a.name||"tr"===a.name||"li"===a.name||"h"===a.name[0]&&a.name[1]>"0"&&a.name[1]<"7";s&&e&&"\n"!==e[e.length-1]&&(e+="\n"),a.children&&t(a.children),s&&"\n"!==e[e.length-1]?e+="\n":"td"!==a.name&&"th"!==a.name||(e+="\t")}}}(t||this.nodes),e},getRect(){return new Promise(((t,e)=>{L().in(this).select("#_root").boundingClientRect().exec((s=>s[0]?t(s[0]):e(Error("Root label not found"))))}))},pauseMedia(){for(let t=(this._videos||[]).length;t--;)this._videos[t].pause()},setPlaybackRate(t){this.playbackRate=t;for(let e=(this._videos||[]).length;e--;)this._videos[e].playbackRate(t)},setContent(t,e){e&&this.imgList||(this.imgList=[]);const s=new Q(this).parse(t);if(this.$set(this,"nodes",e?(this.nodes||[]).concat(s):s),this._videos=[],this.$nextTick((()=>{this._hook("onLoad"),this.$emit("load")})),this.lazyLoad||this.imgList._unloadimgs<this.imgList.length/2){let t=0;const e=s=>{s&&s.height||(s={}),s.height===t?this.$emit("ready",s):(t=s.height,setTimeout((()=>{this.getRect().then(e).catch(e)}),350))};this.getRect().then(e).catch(e)}else this.imgList._unloadimgs||this.getRect().then((t=>{this.$emit("ready",t)})).catch((()=>{this.$emit("ready",{})}))},_hook(t){for(let e=Y.length;e--;)this.plugins[e][t]&&this.plugins[e][t]()}}},[["render",function(t,e,s,i,a,n){const c=r("node"),d=_;return o(),l(d,{id:"_root",class:g((s.selectable?"_select ":"")+"_root"),style:u(s.containerStyle)},{default:h((()=>[a.nodes[0]?(o(),l(c,{key:1,childs:a.nodes,opts:[s.lazyLoad,s.loadingImg,s.errorImg,s.showImgMenu,s.selectable],name:"span"},null,8,["childs","opts"])):O(t.$slots,"default",{key:0},void 0,!0)])),_:3},8,["class","style"])}],["__scopeId","data-v-78f68b4b"]]),et=B({__name:"examIntroduction",setup(e){let s=E();C(!1);const i=C(0),a=C("");let n={img:"max-width:100%;height:auto",p:"font-size:32rpx"};A((t=>{t.tab&&(i.value=t.tab),async function(){const{data:t}=await I(s.carInfo.stepType);if(!t.length)return;u.value=t,a.value=t[i.value]?t[i.value].content:"<p>暂无内容</p>"}()}));const r=C([{name:"考试简介",id:0},{name:"考试准备",id:1},{name:"考试流程",id:2},{name:"注意事项",id:3}]),u=C([]);return(e,s)=>{const m=z(j("up-navbar"),t),f=_,v=z(j("u-parse"),tt);return o(),l(f,{class:"content"},{default:h((()=>[x(m,{leftText:" ",leftIconColor:"#fff",safeAreaInsetTop:!0,autoBack:!0,fixed:!1,bgColor:"transparent",title:"考试",titleStyle:{color:"#fff"}}),x(f,{class:"padding"},{default:h((()=>[x(f,{class:"tabs flex-b"},{default:h((()=>[(o(!0),c(d,null,p(r.value,((t,e)=>(o(),l(f,{class:g(["btn",{active:i.value==e}]),onClick:t=>function(t,e){i.value=e,console.log(e),console.log(u.value[e]),a.value=u.value[e]?u.value[e].content:"<p>暂无内容</p>"}(0,e),key:e},{default:h((()=>[y(b(t.name),1)])),_:2},1032,["onClick","class"])))),128))])),_:1}),x(f,{class:"card"},{default:h((()=>[x(f,{class:"title"},{default:h((()=>[x(f,{class:"titlebg"},{default:h((()=>{var t;return[y(b(null==(t=r.value[i.value])?void 0:t.name),1)]})),_:1})])),_:1}),x(v,{content:a.value,tagStyle:R(n)},null,8,["content","tagStyle"])])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-0353f16e"]]);export{et as default};
|