Template
移动端更新
This commit is contained in:
1 parent
7f8e68bb0a
commit
c0d27be99b
432 files changed
+100843
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
"use strict";function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,o)}return r}function e(e){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?t(Object(i),!0).forEach(function(t){r(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function r(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t){var e=i(t,"string");return"symbol"==n(e)?e:e+""}function i(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=s(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,n=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw n}}}}function s(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=Array(e);r<e;r++)o[r]=t[r];return o}Component({data:{ctrl:{},nodes:[]},properties:{childs:{type:Array,value:[],observer:function(t){function e(t,o,i){var s=t.length;if(0===s||0===o.length)return void(r[i]=o);for(;s>o.length;)0!==Object.keys(t[s-1]).length&&(r[i+"["+(s-1)+"]"]={}),s-=1;for(;s<o.length;)r[i+"["+s+"]"]=o[s],s+=1;for(var c=0;c<Math.min(t.length,o.length);c++){var l,u=new Set(Object.keys(t[c]).concat(Object.keys(o[c]))),f=a(u);try{for(f.s();!(l=f.n()).done;){var h=l.value;if(void 0===t[c][h]||void 0===o[c][h]||"object"!==n(o[c][h])&&t[c][h]!==o[c][h]){r[i+"["+c+"]"]=o[c];break}}}catch(t){f.e(t)}finally{f.f()}if(!(i+"["+c+"]"in r)){var d,g=a(u);try{for(g.s();!(d=g.n()).done;){var p=d.value;if(Array.isArray(o[c][p]))e(t[c][p],o[c][p],i+"["+c+"]."+p);else{var y,v=a(Object.keys(t[c][p]).concat(Object.keys(o[c][p])));try{for(v.s();!(y=v.n()).done;){var b=y.value;if(t[c][p][b]!==o[c][p][b]){r[i+"["+c+"]."+p]=o[c][p];break}}}catch(t){v.e(t)}finally{v.f()}}}}catch(t){g.e(t)}finally{g.f()}}}}var r={};e(this.data.nodes,t,"nodes"),0!==Object.keys(r).length&&this.setData(r)}},opts:Array},options:{addGlobalClass:!0},attached:function(){this.triggerEvent("add",this,{bubbles:!0,composed:!0})},methods:{noop:function(){},getNode:function(t){try{for(var e=t.split("_"),r=this.data.childs[e[0]],o=1;o<e.length;o++)r=r.children[e[o]];return r}catch(t){return{text:"",attrs:{},children:[]}}},play:function(t){var r=t.target.dataset.i,o=this.getNode(r);if(this.root.triggerEvent("play",{source:o.name,attrs:e(e({},o.attrs),{},{src:o.src[this.data.ctrl[r]||0]})}),this.root.data.pauseVideo){for(var i=!1,n=t.target.id,a=this.root._videos.length;a--;)this.root._videos[a].id===n?i=!0:this.root._videos[a].pause();if(!i){var s=qq.createVideoContext(n,this);s.id=n,this.root.playbackRate&&s.playbackRate(this.root.playbackRate),this.root._videos.push(s)}}},mediaEvent:function(t){var r=t.target.dataset.i,o=this.getNode(r);this.root.triggerEvent(t.type,e(e({},t.detail),{},{source:o.name,attrs:e(e({},o.attrs),{},{src:o.src[this.data.ctrl[r]||0]})}))},imgTap:function(t){var e=this.getNode(t.target.dataset.i);if(e.a)return this.linkTap(e.a);if(!e.attrs.ignore&&(this.root.triggerEvent("imgtap",e.attrs),this.root.data.previewImg)){var r=this.root.imgList[e.i];qq.previewImage({current:r,urls:this.root.imgList})}},imgLoad:function(t){var e,o=t.target.dataset.i,i=this.getNode(o);i.w?(this.data.opts[1]&&!this.data.ctrl[o]||-1===this.data.ctrl[o])&&(e=1):e=t.detail.width,e&&this.setData(r({},"ctrl."+o,e)),this.checkReady()},checkReady:function(){var t=this;this.root.data.lazyLoad||(this.root.imgList._unloadimgs-=1,this.root.imgList._unloadimgs||setTimeout(function(){t.root.getRect().then(function(e){t.root.triggerEvent("ready",e)})Line truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"component":true,"usingComponents":{"node":"./node"}}
|
||||
+1
@@ -0,0 +1 @@
|
||||
<qs module="isInline">var e={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};module.exports=function(n,i){return e[n]||-1!==(i||"").indexOf("inline")};</qs><template name="el"><block qq:if="{{n.name==='img'}}"><rich-text qq:if="{{n.t}}" style="display:{{n.t}}" nodes="<img class='_img' style='{{n.attrs.style}}' src='{{n.attrs.src}}'>" data-i="{{i}}" catchtap="imgTap"/><block qq:else><image qq:if="{{(opts[1]&&!ctrl[i])||ctrl[i]<0}}" class="_img" style="{{n.attrs.style}}" src="{{ctrl[i]<0?opts[2]:opts[1]}}" mode="widthFix"/><image id="{{n.attrs.id}}" class="_img {{n.attrs.class}}" style="{{ctrl[i]===-1?'display:none;':''}}width:{{ctrl[i]||1}}px;height:1px;{{n.attrs.style}}" src="{{n.attrs.src}}" mode="{{!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))}}" lazy-load="{{opts[0]}}" data-i="{{i}}" bindload="imgLoad" binderror="mediaError" catchtap="imgTap" bindlongpress="noop"/></block></block><text qq:elif="{{n.text}}" decode>{{n.text}}</text><text qq:elif="{{n.name==='br'}}">{{'\n'}}</text><view qq:elif="{{n.name==='a'}}" id="{{n.attrs.id}}" class="{{n.attrs.href?'_a ':''}}{{n.attrs.class}}" hover-class="_hover" style="display:inline;{{n.attrs.style}}" data-i="{{i}}" catchtap="linkTap"><node childs="{{n.children}}" opts="{{opts}}" style="display:inherit"/></view><video qq:elif="{{n.name==='video'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" autoplay="{{n.attrs.autoplay}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" muted="{{n.attrs.muted}}" object-fit="{{n.attrs['object-fit']}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" bindpause="mediaEvent" bindfullscreenchange="mediaEvent" binderror="mediaError"/><audio qq:elif="{{n.name==='audio'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" author="{{n.attrs.author}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" name="{{n.attrs.name}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" bindpause="mediaEvent" binderror="mediaError"/><rich-text qq:else id="{{n.attrs.id}}" style="{{n.f}}" nodes="{{[n]}}"/></template><block qq:for="{{nodes}}" qq:for-item="n1" qq:for-index="i1" qq:key="i1"><template qq:if="{{!n1.c&&(!n1.children||n1.name==='a'||!isInline(n1.name,n1.attrs.style))}}" is="el" data="{{n:n1,i:''+i1,opts:opts,ctrl:ctrl}}"/><view qq:else id="{{n1.attrs.id}}" class="_{{n1.name}} {{n1.attrs.class}}" style="{{n1.attrs.style}}"><block qq:for="{{n1.children}}" qq:for-item="n2" qq:for-index="i2" qq:key="i2"><template qq:if="{{!n2.c&&(!n2.children||n2.name==='a'||!isInline(n2.name,n2.attrs.style))}}" is="el" data="{{n:n2,i:i1+'_'+i2,opts:opts,ctrl:ctrl}}"/><view qq:else id="{{n2.attrs.id}}" class="_{{n2.name}} {{n2.attrs.class}}" style="{{n2.attrs.style}}"><block qq:for="{{n2.children}}" qq:for-item="n3" qq:for-index="i3" qq:key="i3"><template qq:if="{{!n3.c&&(!n3.children||n3.name==='a'||!isInline(n3.name,n3.attrs.style))}}" is="el" data="{{n:n3,i:i1+'_'+i2+'_'+i3,opts:opts,ctrl:ctrl}}"/><view qq:else id="{{n3.attrs.id}}" class="_{{n3.name}} {{n3.attrs.class}}" style="{{n3.attrs.style}}"><block qq:for="{{n3.children}}" qq:for-item="n4" qq:for-index="i4" qq:key="i4"><template qq:if="{{!n4.c&&(!n4.children||n4.name==='a'||!isInline(n4.name,n4.attrs.style))}}" is="el" data="{{n:n4,i:i1+'_'+i2+'_'+i3+'_'+i4,opts:opts,ctrl:ctrl}}"/><view qq:else id="{{n4.attrs.id}}" class="_{{n4.name}} {{n4.attrs.class}}" style="{{n4.attrs.style}}"><block qq:for="{{n4.children}}" qq:for-item="n5" qq:for-index="i5" qq:key="i5"><template qq:if="{{!n5.c&&(!n5.children||n5.name==='a'||!isInline(n5.name,n5.attrs.style))}}" is="el" data="{{n:n5,i:i1+'_'+i2+'_'+i3+'_'+i4+'_'+i5,opts:opts,ctrl:ctrl}}"/><node qq:else id="{{n5.attrs.id}}" class="_{{n5.name}} {{n5.attrs.class}}" style="{{n5.attrs.style}}" childs="{{n5.children}}" opts="{{opts}}"/></block></view></block></view></block></view></block></view></block>
|
||||
+1
@@ -0,0 +1 @@
|
||||
._a{padding:1.5px 0 1.5px 0;color:#366092;word-break:break-all}._hover{text-decoration:underline;opacity:.7}._img{max-width:100%;-webkit-touch-callout:none}._b,._strong{font-weight:700}._code{font-family:monospace}._del{text-decoration:line-through}._em,._i{font-style:italic}._h1{font-size:2em}._h2{font-size:1.5em}._h3{font-size:1.17em}._h5{font-size:.83em}._h6{font-size:.67em}._h1,._h2,._h3,._h4,._h5,._h6{display:block;font-weight:700}._ins{text-decoration:underline}._li{display:list-item}._ol{list-style-type:decimal}._ol,._ul{display:block;padding-left:40px;margin:1em 0}._q::before{content:'"'}._q::after{content:'"'}._sub{font-size:smaller;vertical-align:sub}._sup{font-size:smaller;vertical-align:super}._tbody,._tfoot,._thead{display:table-row-group}._tr{display:table-row}._td,._th{display:table-cell;vertical-align:middle}._th{font-weight:700;text-align:center}._ul{list-style-type:disc}._ul ._ul{margin:0;list-style-type:circle}._ul ._ul ._ul{list-style-type:square}._abbr,._b,._code,._del,._em,._i,._ins,._label,._q,._span,._strong,._sub,._sup{display:inline}._blockquote,._div,._p{display:block}
|
||||
Reference in new issue
Block a user