8.28 修改事件详情相关概念模块样式,增加股票详情信息来源展示

This commit is contained in:
尚政杰
2025-08-28 17:42:22 +08:00
parent 58b3414bdd
commit bf2388c3ec
403 changed files with 19843 additions and 1602 deletions

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js"),t=require("./utils.js"),s={};class i{constructor(){this.__events={}}on(e,t){if(!e||!t)return;const s=this.__events[e]||[];s.push(t),this.__events[e]=s}emit(e,t){if(e.constructor===Object&&(e=(t=e)&&t.type),!e)return;const s=this.__events[e];s&&s.length&&s.forEach((e=>{e.call(this,t)}))}off(e,t){const s=this.__events,i=s[e];if(i&&i.length)if(t)for(let a=0,r=i.length;a<r;a++)i[a]===t&&(i.splice(a,1),a--);else delete s[e]}}class a{constructor(){this.currentSrc=null,this.naturalHeight=0,this.naturalWidth=0,this.width=0,this.height=0,this.tagName="IMG"}set src(t){this.currentSrc=t,e.index.getImageInfo({src:t,success:e=>{this.naturalWidth=this.width=e.width,this.naturalHeight=this.height=e.height,this.onload()},fail:()=>{this.onerror()}})}get src(){return this.currentSrc}}class r{constructor(e,t,s){this.tagName="canvas",this.com=t,this.canvasId=s,this.ctx=e}set width(e){this.com.offscreenWidth=e}set height(e){this.com.offscreenHeight=e}get width(){return this.com.offscreenWidth||0}get height(){return this.com.offscreenHeight||0}getContext(e){return this.ctx}getImageData(){return new Promise(((t,s)=>{this.com.$nextTick((()=>{e.index.canvasGetImageData({x:0,y:0,width:this.com.offscreenWidth,height:this.com.offscreenHeight,canvasId:this.canvasId,success:e=>{t(e)},fail:e=>{s(e)}},this.com)}))}))}}exports.Canvas=class{constructor(e,t,a,r={}){s[t.canvasId]={ctx:e},this.canvasId=t.canvasId,this.chart=null,this.isNew=a,this.tagName="canvas",this.canvasNode=r,this.com=t,a||this._initStyle(e),this._initEvent(),this._ee=new i}getContext(e){if("2d"===e)return this.ctx}setAttribute(e,t){"aria-label"===e&&(this.com.ariaLabel=t)}setChart(e){this.chart=e}createOffscreenCanvas(t){if(!this.children){this.com.isOffscreenCanvas=!0,this.com.offscreenWidth=t.width||300,this.com.offscreenHeight=t.height||300;const s=this.com,i=this.com.offscreenCanvasId,a=e.index.createCanvasContext(i,this.com);this._initStyle(a),this.children=new r(a,s,i)}return this.children}appendChild(e){console.log("child",e)}dispatchEvent(e,t){return"object"==typeof e?this._ee.emit(e.type,e):this._ee.emit(e,t),!0}attachEvent(){}detachEvent(){}addEventListener(e,t){this._ee.on(e,t)}removeEventListener(e,t){this._ee.off(e,t)}_initCanvas(e,t){}_initStyle(e,s){if(["fillStyle","strokeStyle","fontSize","globalAlpha","opacity","textAlign","textBaseline","shadow","lineWidth","lineCap","lineJoin","lineDash","miterLimit"].forEach((t=>{Object.defineProperty(e,t,{set:s=>{"opacity"!==t?("fillStyle"!==t&&"strokeStyle"!==t||"none"!==s&&null!==s)&&e["set"+t.charAt(0).toUpperCase()+t.slice(1)](s):e.setGlobalAlpha(s)}})})),this.isNew||s||(e.uniDrawImage=e.drawImage,e.drawImage=(...t)=>{t[0]=t[0].src,e.uniDrawImage(...t)}),e.createRadialGradient||(e.createRadialGradient=function(){return e.createCircularGradient(...[...arguments].slice(-3))}),e.strokeText||(e.strokeText=(...t)=>{e.fillText(...t)}),!e.measureText||"harmonyos"==t.getDeviceInfo().osName){e._measureText=e.measureText;const t=e=>{let t=0;for(let s=0;s<e.length;s++)e.charCodeAt(s)>0&&e.charCodeAt(s)<128?t++:t+=2;return t};e.measureText=(s,i)=>{var a;let r=(null==(a=null==e?void 0:e.state)?void 0:a.fontSize)||12;i&&(r=parseInt(i.match(/([\d\.]+)px/)[1])),r/=2;const n=r>=16?1.3:1;return{width:t(s)*r*n}}}}_initEvent(e){this.event={};[{wxName:"touchStart",ecName:"mousedown"},{wxName:"touchMove",ecName:"mousemove"},{wxName:"touchEnd",ecName:"mouseup"},{wxName:"touchEnd",ecName:"click"}].forEach((e=>{this.event[e.wxName]=t=>{const s=t.touches[0];this.chart.getZr().handler.dispatch(e.ecName,{zrX:"tap"===e.wxName?s.clientX:s.x,zrY:"tap"===e.wxName?s.clientY:s.y})}}))}set width(e){this.canvasNode.width=e}set height(e){this.canvasNode.height=e}get width(){return this.canvasNode.width||0}get height(){return this.canvasNode.height||0}get ctx(){return s[this.canvasId].ctx||null}set chart(e){s[this.canvasId].chart=e}get chart(){return s[this.canvasId].chart||null}},exports.dispatch=function(e,{x:t,y:s,wheelDelta:i}){this.dispatch(e,{zrX:t,zrY:s,zrDelta:i,preventDefault:()=>{},stopPropagation:()=>{}})},exports.setCanvasCreator=function(t,{canvas:s,node:i}){if(t&&!t.registerPreprocessor)return console.warn("echarts 版本不对或未传入echartsvue3请使用esm格式");t.registerPreprocessor((e=>{e&&e.series&&(e.series.length>0?e.series.forEach((e=>{e.progressive=0})):"object"==typeof e.series&&(e.series.progressive=0))})),t.setPlatformAPI?t.setPlatformAPI({loadImage:s.setChart?function(e,t,s){let r=null;return i&&i.createImage?(r=i.createImage(),r.onload=t.bind(r),r.onerror=s.bind(r),r.src=e,r):(r=new a,r.onload=t.bind(r),r.onerror=s.bind(r),r.src=e,r)}:null,createCanvas(){const t="createOffscreenCanvas";return e.index.canIUse(t)&&e.index[t]?e.index[t]({type:"2d"}):s}}):t.setCanvasCreator&&t.setCanvasCreator((()=>s))};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view wx:if="{{a}}" class="lime-echart" style="{{C}}" ref="limeEchart" aria-label="{{D}}"><canvas wx:if="{{b}}" class="lime-echart__canvas" type="2d" id="{{c}}" style="{{d}}" disable-scroll="{{e}}" bindtouchstart="{{f}}" bindtouchmove="{{g}}" bindtouchend="{{h}}"/><block wx:else><canvas wx:if="{{r0}}" class="lime-echart__canvas" width="{{i}}" height="{{j}}" style="{{k}}" canvas-id="{{l}}" id="{{m}}" disable-scroll="{{n}}" bindtouchstart="{{o}}" bindtouchmove="{{p}}" bindtouchend="{{q}}"/></block><view wx:if="{{r}}" class="lime-echart__mask" bindmousedown="{{s}}" bindmousemove="{{t}}" bindmouseup="{{v}}" bindtouchstart="{{w}}" bindtouchmove="{{x}}" bindtouchend="{{y}}"></view><canvas wx:if="{{z}}" style="{{A}}" canvas-id="{{B}}"></canvas></view>

View File

@@ -0,0 +1 @@
.lime-echart{position:relative;width:100%;height:100%}.lime-echart__canvas{width:100%;height:100%}.lime-echart__mask{position:absolute;width:100%;height:100%;left:0;top:0;z-index:1}

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js");function n(){return e.index.getDeviceInfo||e.index.canIUse("getDeviceInfo")?e.index.getDeviceInfo():e.index.getSystemInfoSync()}function t(t){const{platform:o}=n();let{SDKVersion:r}=e.index.getAppBaseInfo||e.index.canIUse("getAppBaseInfo")?e.index.getAppBaseInfo():e.index.getSystemInfoSync();return"mac"!==o&&function(e,n){e=e.split("."),n=n.split(".");const t=Math.max(e.length,n.length);for(;e.length<t;)e.push("0");for(;n.length<t;)n.push("0");for(let o=0;o<t;o++){const t=parseInt(e[o],10),r=parseInt(n[o],10);if(t>r)return 1;if(t<r)return-1}return 0}(r,t)>=0}function o(e){return Array.isArray(e)?e:"object"==typeof e&&null!==e?Object.values(e):e}const r=(e.index.getWindowInfo||e.index.canIUse("getWindowInfo")?e.index.getWindowInfo():e.index.getSystemInfoSync()).pixelRatio;exports.canIUseCanvas2d=function(){return t("2.9.0")},exports.convertTouchesToArray=o,exports.devicePixelRatio=r,exports.getDeviceInfo=n,exports.getRect=function(n,t,o){return new Promise(((r,s)=>{const i=e.index.createSelectorQuery().in(t).select(n),c=e=>{e?r(e):s()};o?i.fields({node:!0,size:!0,rect:!0},c).exec():i.boundingClientRect(c).exec()}))},exports.sleep=function(e){return new Promise((n=>{setTimeout((()=>{n(!0)}),e)}))},exports.wrapTouch=function(e){e.touches=o(e.touches);for(let n=0;n<e.touches.length;++n){const t=e.touches[n];t.offsetX=t.x,t.offsetY=t.y}return e};