From 168084029a26d4ce6713544f9bc02f0a5e2d07a7 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Sun, 5 Oct 2025 18:05:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E5=8F=B7?= =?UTF-8?q?=E3=80=81=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=9F=A5=E7=9C=8Bdebug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ env/.env | 11 ++++--- env/.env.production | 2 +- src/App.vue | 4 +++ src/api/login.ts | 55 ++++++++++++++++++++----------- src/hooks/echarts.min.js | 1 - src/hooks/useWeiXin.ts | 56 ++++++++++++++++++++++++++++++++ src/pages.json | 6 ++-- src/pages/index/index.vue | 27 ++++++++++------ src/pages/login/login.vue | 66 ++++++++++++++++++++++++++++++++------ src/pages/login/mobile.vue | 3 +- 11 files changed, 184 insertions(+), 49 deletions(-) delete mode 100644 src/hooks/echarts.min.js create mode 100644 src/hooks/useWeiXin.ts diff --git a/.gitignore b/.gitignore index 34ddbdf..5e70629 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ dist # Editor directories and files .idea +.history *.suo *.ntvs* *.njsproj @@ -29,6 +30,7 @@ docs/.vitepress/cache src/types + # lock 文件还是不要了,我主要的版本写死就好了 # pnpm-lock.yaml # package-lock.json diff --git a/env/.env b/env/.env index 4f89f3b..7b46a62 100644 --- a/env/.env +++ b/env/.env @@ -5,18 +5,21 @@ VITE_UNI_APPID = '__UNI__D1E5001' VITE_WX_APPID = 'wxa2abb91f64032a2b' # h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base -VITE_APP_PUBLIC_BASE=/ +VITE_APP_PUBLIC_BASE = '/h5' # 登录页面 VITE_LOGIN_URL = '/pages/login/login' # 第一个请求地址 -VITE_SERVER_BASEURL = 'https://mnp.zhuzhuda.cn' +VITE_SERVER_BASEURL = 'https://cz.stnav.com/gzhapi' -VITE_UPLOAD_BASEURL = 'https://mnp.zhuzhuda.cn/upload' +VITE_UPLOAD_BASEURL = 'https://cz.stnav.com/upload' # h5是否需要配置代理 VITE_APP_PROXY=false VITE_APP_PROXY_PREFIX = '/api' # 第二个请求地址 (目前alova中可以使用) -VITE_API_SECONDARY_URL = 'https://mnp.zhuzhuda.cn' \ No newline at end of file +VITE_API_SECONDARY_URL = 'https://cz.stnav.com' + +# 公众号APPID +VITE_WX_SERVICE_ACCOUNT_APPID = 'wx0224f558e3b3f499' diff --git a/env/.env.production b/env/.env.production index 8a1b50c..49d64c1 100644 --- a/env/.env.production +++ b/env/.env.production @@ -1,6 +1,6 @@ # 变量必须以 VITE_ 为前缀才能暴露给外部读取 NODE_ENV = 'development' # 是否去除console 和 debugger -VITE_DELETE_CONSOLE = true +VITE_DELETE_CONSOLE = false # 是否开启sourcemap VITE_SHOW_SOURCEMAP = false diff --git a/src/App.vue b/src/App.vue index bef4050..9d1c6ad 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,6 +2,7 @@ import { onHide, onLaunch, onShow } from '@dcloudio/uni-app' import { navigateToInterceptor } from '@/router/interceptor' import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only' + import {snsapiBaseAuthorize} from '@/hooks/useWeiXin' onLaunch((options) => { // 处理直接进入页面路由的情况:如h5直接输入路由、微信小程序分享后进入等 @@ -13,6 +14,9 @@ else { navigateToInterceptor.invoke({ url: '/' }) } + + // 微信静默授权 + snsapiBaseAuthorize() }) onShow((options) => { console.log('App Show', options) diff --git a/src/api/login.ts b/src/api/login.ts index de4266d..1a75c66 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -1,14 +1,31 @@ import type { ICaptcha, IUpdateInfo, IUpdatePassword, IUserInfoVo, IUserLogin } from './types/login' -import { http } from '@/http/http' +// import { http } from '@/http/http' +import { API_DOMAINS, http } from '@/http/alova' + + +/** + * 微信静默授权登录参数 + */ +export interface IWxSnsapiBaseLoginForm { + code: string +} + +/** + * 微信静默授权登录 + */ +export function wxSnsapiBaseLogin(loginForm: IWxSnsapiBaseLoginForm) { + return http.Get('/login/oaLogin', {params: loginForm}) +} + /** * 登录表单 */ export interface ILoginForm { - username: string - password: string - code: string - uuid: string + username: string + password: string + code: string + uuid: string } /** @@ -16,7 +33,7 @@ export interface ILoginForm { * @returns ICaptcha 验证码 */ export function getCode() { - return http.get('/user/getCode') + return http.Get('/user/getCode') } /** @@ -24,35 +41,35 @@ export function getCode() { * @param loginForm 登录表单 */ export function login(loginForm: ILoginForm) { - return http.post('/user/login', loginForm) + return http.Post('/user/login', loginForm) } /** * 获取用户信息 */ export function getUserInfo() { - return http.get('/user/info') + return http.Get('/user/info') } /** * 退出登录 */ export function logout() { - return http.get('/user/logout') + return http.Get('/user/logout') } /** * 修改用户信息 */ export function updateInfo(data: IUpdateInfo) { - return http.post('/user/updateInfo', data) + return http.Get('/user/updateInfo', data) } /** * 修改用户密码 */ export function updateUserPassword(data: IUpdatePassword) { - return http.post('/user/updatePassword', data) + return http.Post('/user/updatePassword', data) } /** @@ -60,13 +77,13 @@ export function updateUserPassword(data: IUpdatePassword) { * @returns Promise 包含微信登录凭证(code) */ export function getWxCode() { - return new Promise((resolve, reject) => { - uni.login({ - provider: 'weixin', - success: res => resolve(res), - fail: err => reject(new Error(err)), - }) - }) + return new Promise((resolve, reject) => { + uni.login({ + provider: 'weixin', + success: res => resolve(res), + fail: err => reject(new Error(err)), + }) + }) } /** @@ -79,5 +96,5 @@ export function getWxCode() { * @returns Promise 包含登录结果 */ export function wxLogin(data: { code: string }) { - return http.post('/user/wxLogin', data) + return http.Post('/user/wxLogin', data) } diff --git a/src/hooks/echarts.min.js b/src/hooks/echarts.min.js deleted file mode 100644 index 2d54eb4..0000000 --- a/src/hooks/echarts.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).echarts={})}(this,function(t){"use strict";var x=function(t,e){return(x=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))(t,e)};function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}x(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var w=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},b=new function(){this.browser=new w,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(b.wxa=!0,b.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?b.worker=!0:!b.hasGlobalWindow||"Deno"in window||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&-1>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}e.clearMarkers=function(){B(n,function(t){t.parentNode&&t.parentNode.removeChild(t)})}}return n}(e,o),o,r);if(e)return e(t,n,i),!0}return!1}function _e(t){return"CANVAS"===t.nodeName.toUpperCase()}var xe=/([&<>"'])/g,we={"&":"&","<":"<",">":">",'"':""","'":"'"};function be(t){return null==t?"":(t+"").replace(xe,function(t,e){return we[e]})}var Se=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Me=[],Te=b.browser.firefox&&+b.browser.version.split(".")[0]<39;function Ce(t,e,n,i){return n=n||{},i?ke(t,e,n):Te&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):ke(t,e,n),n}function ke(t,e,n){if(b.domSupported&&t.getBoundingClientRect){var i,r=e.clientX,e=e.clientY;if(_e(t))return i=t.getBoundingClientRect(),n.zrX=r-i.left,void(n.zrY=e-i.top);if(ve(Me,t,r,e))return n.zrX=Me[0],void(n.zrY=Me[1])}n.zrX=n.zrY=0}function Ie(t){return t||window.event}function De(t,e,n){var i;return null==(e=Ie(e)).zrX&&((i=e.type)&&0<=i.indexOf("touch")?(i=("touchend"!==i?e.targetTouches:e.changedTouches)[0])&&Ce(t,i,e,n):(Ce(t,e,e,n),i=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,t=t.deltaY;return null!=n&&null!=t?3*(0!==t?Math.abs(t):Math.abs(n))*(0=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},rn.prototype.contain=function(t,e){return rn.contain(this,t,e)},rn.prototype.clone=function(){return new rn(this.x,this.y,this.width,this.height)},rn.prototype.copy=function(t){rn.copy(this,t)},rn.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},rn.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},rn.prototype.isZero=function(){return 0===this.width||0===this.height},rn.create=function(t){return new rn(t.x,t.y,t.width,t.height)},rn.copy=function(t,e){return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t},rn.applyTransform=function(t,e,n){var i,r,o,a;n?n[1]<1e-5&&-1e-5t.getWidth()||n<0||n>t.getHeight()}B(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){vn.prototype[a]=function(t){var e,n,i=t.zrX,r=t.zrY,o=wn(this,i,r);if("mouseup"===a&&o||(n=(e=this.findHover(i,r)).target),"mousedown"===a)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===a)this._upEl=n;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4>>1])<0?l=o:s=1+o;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function In(A,L){var P,O,R=Sn,B=0,N=[];function e(t){var e=P[t],n=O[t],i=P[t+1],r=O[t+1],t=(O[t]=n+r,t===B-3&&(P[t+1]=P[t+2],O[t+1]=O[t+2]),B--,kn(A[i],A,e,n,0,L));if(e+=t,0!=(n-=t)&&0!==(r=Cn(A[e+n-1],A,i,r,r-1,L)))if(n<=r){var o=e,a=n,t=i,s=r,l=0;for(l=0;lO[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(r);do{}while((o=Mn(t,n,i,e))=this._maxSize&&0>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===i?parseInt(n.slice(4),16)/15:1),Ci(t,e),e):void bi(e,0,0,0,1):7===i||9===i?0<=(r=parseInt(n.slice(1,7),16))&&r<=16777215?(bi(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===i?parseInt(n.slice(7),16)/255:1),Ci(t,e),e):void bi(e,0,0,0,1):void 0;var r=n.indexOf("("),o=n.indexOf(")");if(-1!==r&&o+1===i){var i=n.substr(0,r),a=n.substr(r+1,o-(r+1)).split(","),s=1;switch(i){case"rgba":if(4!==a.length)return 3===a.length?bi(e,+a[0],+a[1],+a[2],1):bi(e,0,0,0,1);s=_i(a.pop());case"rgb":return 3<=a.length?(bi(e,vi(a[0]),vi(a[1]),vi(a[2]),3===a.length?s:_i(a[3])),Ci(t,e),e):void bi(e,0,0,0,1);case"hsla":return 4!==a.length?void bi(e,0,0,0,1):(a[3]=_i(a[3]),Ii(a,e),Ci(t,e),e);case"hsl":return 3!==a.length?void bi(e,0,0,0,1):(Ii(a,e),Ci(t,e),e);default:return}}bi(e,0,0,0,1)}}function Ii(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=_i(t[1]),r=_i(t[2]),i=r<=.5?r*(i+1):r+i-r*i,r=2*r-i;return bi(e=e||[],yi(255*xi(r,i,n+1/3)),yi(255*xi(r,i,n)),yi(255*xi(r,i,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Di(t,e){var n=ki(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,255e);g++);g=f(g-1,h-2)}i=u[g+1],n=u[g]}n&&i&&(this._lastFr=g,this._lastFrP=e,d=i.percent-n.percent,r=0==d?1:f((e-n.percent)/d,1),i.easingFunc&&(r=i.easingFunc(r)),f=a?this._additiveValue:p?qi:t[c],(Yi(l)||p)&&(f=f||(this._additiveValue=[])),this.discrete?t[c]=(r<1?n:i).rawValue:Yi(l)?(1===l?Vi:function(t,e,n,i){for(var r=e.length,o=r&&e[0].length,a=0;athis._sleepAfterStill)&&this.animation.stop()},po.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},po.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},po.prototype.refreshHover=function(){this._needsRefreshHover=!0},po.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},po.prototype.resize=function(t){this._disposed||(this.painter.resize((t=t||{}).width,t.height),this.handler.resize())},po.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},po.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},po.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},po.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},po.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},po.prototype.on=function(t,e,n){return this._disposed||this.handler.on(t,e,n),this},po.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},po.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},po.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e=n.maxIterations){e+=n.ellipsis;break}var s=0===a?function(t,e,n){for(var i=0,r=0,o=t.length;rh){k=o.lines.length;0i.width&&(o=e.split("\n"),c=!0),i.accumWidth=s):(s=Ba(e,t,i.width,i.breakAll,i.accumWidth),i.accumWidth=s.accumWidth+n,a=s.linesWidths,o=s.lines)),o=o||e.split("\n"),Nr(t)),d=0;dthis._ux||i>this._uy;return this.addData(Y.L,t,e),this._ctx&&r&&this._ctx.lineTo(t,e),r?(this._xi=t,this._yi=e,this._pendingPtDist=0):(r=n*n+i*i)>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=r),this},o.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this._drawPendingPt(),this.addData(Y.C,t,e,n,i,r,o),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,o),this._xi=r,this._yi=o,this},o.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Y.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},o.prototype.arc=function(t,e,n,i,r,o){this._drawPendingPt(),ws[0]=i,ws[1]=r,s=o,(l=bs((a=ws)[0]))<0&&(l+=_s),h=l-a[0],u=a[1],u+=h,!s&&_s<=u-l?u=l+_s:s&&_s<=l-u?u=l-_s:!s&&uu.length&&(this._expandData(),u=this.data);for(var h=0;hn||ms(y)>i||c===e-1)&&(f=Math.sqrt(k*k+y*y),r=g,o=_);break;case Y.C:var m=t[c++],v=t[c++],g=t[c++],_=t[c++],x=t[c++],w=t[c++],f=function(t,e,n,i,r,o,a,s,l){for(var u=t,h=e,c=0,p=1/l,d=1;d<=l;d++){var f=d*p,g=jn(t,n,r,a,f),f=jn(e,i,o,s,f),y=g-u,m=f-h;c+=Math.sqrt(y*y+m*m),u=g,h=f}return c}(r,o,m,v,g,_,x,w,10),r=x,o=w;break;case Y.Q:f=function(t,e,n,i,r,o,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var p=c*h,d=ei(t,n,r,p),p=ei(e,i,o,p),f=d-s,g=p-l;u+=Math.sqrt(f*f+g*g),s=d,l=p}return u}(r,o,m=t[c++],v=t[c++],g=t[c++],_=t[c++],10),r=g,o=_;break;case Y.A:var x=t[c++],w=t[c++],b=t[c++],S=t[c++],M=t[c++],T=t[c++],C=T+M;c+=1,d&&(a=gs(M)*b+x,s=ys(M)*S+w),f=fs(b,S)*ds(_s,Math.abs(T)),r=gs(C)*b+x,o=ys(C)*S+w;break;case Y.R:a=r=t[c++],s=o=t[c++];f=2*t[c++]+2*t[c++];break;case Y.Z:var k=a-r,y=s-o;f=Math.sqrt(k*k+y*y),r=a,o=s}0<=f&&(u+=l[h++]=f)}return this._pathLen=u},o.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h=this.data,N=this._ux,z=this._uy,E=this._len,c=e<1,p=0,d=0,f=0;if(!c||(this._pathSegLen||this._calculateLength(),a=this._pathSegLen,s=e*this._pathLen))t:for(var g=0;g=Ps[i=0]+t&&a<=Ps[1]+t?h:0;rMath.PI/2&&c<1.5*Math.PI?-h:h)}return l}(y,m,_,x,x+w,b,T,r);u=Math.cos(x+w)*v+y,h=Math.sin(x+w)*_+m;break;case Ds.R:c=u=a[d++],p=h=a[d++];if(S=c+a[d++],M=p+a[d++],n){if(Ms(c,p,S,p,e,i,r)||Ms(S,p,S,M,e,i,r)||Ms(S,M,c,M,e,i,r)||Ms(c,M,c,p,e,i,r))return!0}else l=(l+=Is(S,p,S,M,i,r))+Is(c,M,c,p,i,r);break;case Ds.Z:if(n){if(Ms(u,h,c,p,e,i,r))return!0}else l+=Is(u,h,c,p,i,r);u=c,h=p}}return n||(t=h,o=p,Math.abs(t-o)n,i=(r=r.slice(0,n)).length*c),t&&u&&null!=f)for(var y=ka(f,l,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),m={},v=0;vQh.len()&&(swo(i[1])?0':'':{renderMode:r,content:"{"+(t.markerId||"markerX")+"|} ",style:"subItem"===i?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}:""}function gd(t,e){return e=e||"transparent",V(t)?t:H(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function yd(t,e){var n;"_blank"===e||"blank"===e?((n=window.open()).opener=null,n.location.href=t):window.open(t,e)}var md={},vd={},_d=(xd.prototype.create=function(i,r){function t(t){var n=[];return B(t,function(t,e){t=t.create(i,r);n=n.concat(t||[])}),n}this._nonSeriesBoxMasterList=t(md),this._normalMasterList=t(vd)},xd.prototype.update=function(e,n){B(this._normalMasterList,function(t){t.update&&t.update(e,n)})},xd.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},xd.register=function(t,e){"matrix"===t||"calendar"===t?md[t]=e:vd[t]=e},xd.get=function(t){return vd[t]||md[t]},xd);function xd(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}var wd={coord:1,coord2:2},bd=O();var Sd={none:0,dataCoordSys:1,boxCoordSys:2};function Md(t){var e=t.getShallow("coordinateSystem"),n=t.getShallow("coordinateSystemUsage",!0),i=Sd.none;return e&&(t="series"===t.mainType,"data"===(n=null==n?t?"data":"box":n)?(i=Sd.dataCoordSys,t||(i=Sd.none)):"box"===n&&(i=Sd.boxCoordSys,t||md[e]||(i=Sd.none))),{coordSysType:e,kind:i}}var Td=B,Cd=["left","right","top","bottom","width","height"],kd=[["width","left","right"],["height","top","bottom"]];function Id(a,s,l,u,h){var c=0,p=0,d=(null==u&&(u=1/0),null==h&&(h=1/0),0);s.eachChild(function(t,e){var n,i,r,o=t.getBoundingRect(),e=s.childAt(e+1),e=e&&e.getBoundingRect();d="horizontal"===a?(i=o.width+(e?-e.x+o.x:0),u<(n=c+i)||t.newline?(c=0,n=i,p+=d+l,o.height):Math.max(d,o.height)):(i=o.height+(e?-e.y+o.y:0),h<(r=p+i)||t.newline?(c+=d+l,p=0,r=i,o.width):Math.max(d,o.width)),t.newline||(t.x=c,t.y=p,t.markRedraw(),"horizontal"===a?c=n+l:p=r+l)})}var Dd=Id;function Ad(t,e,n){n=ud(n||0);var i=e.width,r=e.height,o=So(t.left,i),a=So(t.top,r),s=So(t.right,i),l=So(t.bottom,r),u=So(t.width,i),h=So(t.height,r),c=n[2]+n[0],p=n[1]+n[3],d=t.aspect;switch(isNaN(u)&&(u=i-s-p-o),isNaN(h)&&(h=r-l-c-a),null!=d&&(isNaN(u)&&isNaN(h)&&(i/re)return t[i];return t[n-1]}var mf,vf="\0_ec_inner",_f=(u(s,mf=_p),s.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new _p(i),this._locale=new _p(r),this._optionManager=o},s.prototype.setOption=function(t,e,n){e=bf(e);this._optionManager.setOption(t,n,e),this._resetOption(null,e)},s.prototype.resetOption=function(t,e){return this._resetOption(t,bf(e))},s.prototype._resetOption=function(t,e){var n,i=!1,r=this._optionManager;return t&&"recreate"!==t||(n=r.mountOption("recreate"===t),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(n,e)):pf(this,n),i=!0),"timeline"!==t&&"media"!==t||this.restoreData(),t&&"recreate"!==t&&"timeline"!==t||(n=r.getTimelineOption(this))&&(i=!0,this._mergeOption(n,e)),t&&"recreate"!==t&&"media"!==t||(n=r.getMediaOption(this)).length&&B(n,function(t){i=!0,this._mergeOption(t,e)},this),i},s.prototype.mergeOption=function(t){this._mergeOption(t,null)},s.prototype._mergeOption=function(i,t){var r=this.option,h=this._componentsMap,c=this._componentsCount,n=[],o=O(),p=t&&t.replaceMergeMainTypeMap;of(this).datasetMap=O(),B(i,function(t,e){null!=t&&(g.hasClass(e)?e&&(n.push(e),o.set(e,!0)):r[e]=null==r[e]?y(t):d(r[e],t,!0))}),p&&p.each(function(t,e){g.hasClass(e)&&!o.get(e)&&(n.push(e),o.set(e,!0))}),g.topologicalTravel(n,g.getAllClassMainTypes(),function(o){var a,t=function(t,e,n){return(e=(e=uf.get(e))&&e(t))?n.concat(e):n}(this,o,Wo(i[o])),e=h.get(o),n=e?p&&p.get(o)?"replaceMerge":"normalMerge":"replaceAll",e=Yo(e,t,n),s=(Qo(e,o,g),r[o]=null,h.set(o,null),c.set(o,0),[]),l=[],u=0;B(e,function(t,e){var n=t.existing,i=t.newOption;if(i){var r=g.getClass(o,t.keyInfo.subType,!("series"===o));if(!r)return;if("tooltip"===o){if(a)return;a=!0}n&&n.constructor===r?(n.name=t.keyInfo.name,n.mergeOption(i,this),n.optionUpdated(i,!1)):(e=P({componentIndex:e},t.keyInfo),P(n=new r(i,this,this,e),e),t.brandNew&&(n.__requireNewView=!0),n.init(i,this,this),n.optionUpdated(null,!0))}else n&&(n.mergeOption({},this),n.optionUpdated({},!1));n?(s.push(n.option),l.push(n),u++):(s.push(void 0),l.push(void 0))},this),r[o]=s,h.set(o,l),c.set(o,u),"series"===o&&hf(this)},this),this._seriesIndices||hf(this)},s.prototype.getOption=function(){var a=y(this.option);return B(a,function(t,e){if(g.hasClass(e)){for(var n=Wo(t),i=n.length,r=!1,o=i-1;0<=o;o--)n[o]&&!$o(n[o])?r=!0:(n[o]=null,r||i--);n.length=i,a[e]=n}}),delete a[vf],a},s.prototype.setTheme=function(t){this._theme=new _p(t),this._resetOption("recreate",null)},s.prototype.getTheme=function(){return this._theme},s.prototype.getLocaleModel=function(){return this._locale},s.prototype.setUpdatePayload=function(t){this._payload=t},s.prototype.getUpdatePayload=function(){return this._payload},s.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){t=n[e||0];if(t)return t;if(null==e)for(var i=0;ig[1]&&(g[1]=f)}return{start:a,end:this._rawCount=this._count=s}},l.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=E(o,function(t){return t.property}),u=0;uf[1]&&(f[1]=g)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},l.prototype.count=function(){return this._count},l.prototype.get=function(t,e){return 0<=e&&e=this._rawCount||t<0)){if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}}return-1},l.prototype.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array)for(var i=new e(n),r=0;rt[S][1])&&(w=!1)}w&&(a[s++]=e.getRawIndex(f))}return sy[1]&&(y[1]=g)}}}},l.prototype.lttbDownSample=function(t,e){var n,i=this.clone([t],!0),r=i._chunks[t],o=this.count(),a=0,s=Math.floor(1/e),l=this.getRawIndex(0),u=new(oy(this._rawCount))(Math.min(2*(Math.ceil(o/s)+2),o));u[a++]=l;for(var h=1;hh[1]&&(h[1]=y),c[p++]=m}return r._count=p,r._indices=c,r._updateGetRawIdx(),r},l.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,r=0,o=this.count();r'+be(u)+""+h,t))}function My(t,e,n,i){var r,o,a,s,l,u=t.renderMode,h=e.noName,c=e.noValue,p=!e.markerType,d=e.name,f=t.useUTC,g=e.valueFormatter||t.valueFormatter||function(t){return E(t=F(t)?t:[t],function(t,e){return hd(t,F(o)?o[e]:o,f)})};if(!h||!c)return r=p?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||v.color.secondary,u),d=h?"":hd(d,"ordinal",f),o=e.valueType,g=c?[]:g(e.value,e.dataIndex),e=!p||!h,a=!p&&h,l=my(i,u),s=l.nameStyle,l=l.valueStyle,"richText"===u?(p?"":r)+(h?"":ky(t,d,s))+(c?"":function(t,e,n,i,r){r=[r],i=i?10:20;return n&&r.push({padding:[0,0,0,i],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(F(e)?e.join(" "):e,r)}(t,g,e,a,l)):Cy(i,(p?"":r)+(h?"":''+be(d)+"")+(c?"":function(t,e,n,i){n=n?"10px":"20px",e=e?"float:right;margin-left:"+n:"";return t=F(t)?t:[t],''+E(t,be).join("  ")+""}(g,e,a,l)),n)}function Ty(t,e,n,i,r,o){if(t)return by(t)({useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,o)}function Cy(t,e,n){return'
'+e+'
'}function ky(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function Iy(t,e){t=t.get("padding");return null!=t?t:"richText"===e?[8,10]:10}Ay.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},Ay.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,e=fd({color:e,type:t,renderMode:n,markerId:i});return V(e)?e:(this.richTextStyles[i]=e.style,e.content)},Ay.prototype.wrapRichTextStyle=function(t,e){var n={},e=(F(e)?B(e,function(t){return P(n,t)}):P(n,e),this._generateStyleName());return this.richTextStyles[e]=n,"{"+e+"|"+t+"}"};var Dy=Ay;function Ay(){this.richTextStyles={},this._nextStyleNameId=Eo()}function Ly(t){var e,n,i,r,o,a,s,l,u,h,c,p=t.series,d=t.dataIndex,t=t.multipleSeries,f=p.getData(),g=f.mapDimensionsAll("defaultedTooltip"),y=g.length,m=p.getRawValue(d),v=F(m),_=(_=d,gd((w=p).getData().getItemVisual(_,"style")[w.visualDrawType]));function x(t,e){e=s.getDimensionInfo(e);e&&!1!==e.otherDims.tooltip&&(l?c.push(xy("nameValue",{markerType:"subItem",markerColor:a,name:e.displayName,value:t,valueType:e.type})):(u.push(t),h.push(e.type)))}1this.getShallow("animationThreshold")?!1:t)},h.prototype.restoreData=function(){this.dataTask.dirty()},h.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel;return ff.prototype.getColorFromPalette.call(this,t,e,n)||i.getColorFromPalette(t,e,n)},h.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},h.prototype.getProgressive=function(){return this.get("progressive")},h.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},h.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},h.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,r=this.getData(e);if("series"===i||"all"===n)this.option.selectedMap={},this._selectedDataIndicesMap={};else for(var o=0;oe.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Vy(e,n){B(zt(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(t){e.wrapMethod(t,dt(Hy,n))})}function Hy(t,e){t=Wy(t);return t&&t.setOutputEnd((e||this).count()),e}function Wy(t){var e,n=(t.ecModel||{}).scheduler,n=n&&n.getPipeline(t.uid);if(n)return(n=n.currentTask)&&(e=n.agentStubMap)?e.get(t.uid):n}at(By,yp),at(By,ff),pa(By,g);Uy.prototype.init=function(t,e){},Uy.prototype.render=function(t,e,n,i){},Uy.prototype.dispose=function(t,e){},Uy.prototype.updateView=function(t,e,n,i){},Uy.prototype.updateLayout=function(t,e,n,i){},Uy.prototype.updateVisual=function(t,e,n,i){},Uy.prototype.toggleBlurSeries=function(t,e,n){},Uy.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)};var Gy=Uy;function Uy(){this.group=new ao,this.uid=bp("viewComponent")}function Xy(){var o=ta();return function(t){var e=o(t),t=t.pipelineContext,n=!!e.large,i=!!e.progressiveRender,r=e.large=!(!t||!t.large),e=e.progressiveRender=!(!t||!t.progressiveRender);return!(n==r&&i==e)&&"reset"}}ca(Gy),ya(Gy);var Yy=ta(),qy=Xy(),Zy=(jy.prototype.init=function(t,e){},jy.prototype.render=function(t,e,n,i){},jy.prototype.highlight=function(t,e,n,i){t=t.getData(i&&i.dataType);t&&$y(t,i,"emphasis")},jy.prototype.downplay=function(t,e,n,i){t=t.getData(i&&i.dataType);t&&$y(t,i,"normal")},jy.prototype.remove=function(t,e){this.group.removeAll()},jy.prototype.dispose=function(t,e){},jy.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},jy.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},jy.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},jy.prototype.eachRendered=function(t){Vc(this.group,t)},jy.markUpdateMethod=function(t,e){Yy(t).updateMethod=e},jy.protoInitialize=void(jy.prototype.type="chart"),jy);function jy(){this.group=new ao,this.uid=bp("viewChart"),this.renderTask=Sg({plan:Qy,reset:Jy}),this.renderTask.context={view:this}}function Ky(t,e,n){t&&fu(t)&&("emphasis"===e?Ql:Jl)(t,n)}function $y(e,t,n){var i,r=Jo(e,t),o=t&&null!=t.highlightKey?(t=t.highlightKey,i=null==(i=Sl[t])&&bl<=32?Sl[t]=bl++:i):null;null!=r?B(Wo(r),function(t){Ky(e.getItemGraphicEl(t),n,o)}):e.eachItemGraphicEl(function(t){Ky(t,n,o)})}function Qy(t){return qy(t.model)}function Jy(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,t=t.view,a=r&&Yy(r).updateMethod,o=o?"incrementalPrepareRender":a&&t[a]?a:"render";return"render"!==o&&t[o](e,n,i,r),tm[o]}ca(Zy),ya(Zy);var tm={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},em="\0__throttleOriginMethod",nm="\0__throttleRate",im="\0__throttleType";function rm(t,r,o){var a,s,l,u,h,c=0,p=0,d=null;function f(){p=(new Date).getTime(),d=null,t.apply(l,u||[])}r=r||0;function e(){for(var t=[],e=0;en.blockIndex?n.step:null,modBy:null!=(t=i&&i.modDataCount)?Math.ceil(t/e):null,modDataCount:t}},gm.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},gm.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),e=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,r=t.get("large")&&i>=t.get("largeThreshold"),i="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:e,modDataCount:i,large:r}},gm.prototype.restorePipelines=function(t){var i=this,r=i._pipelineMap=O();t.eachSeries(function(t){var e=t.getProgressive(),n=t.uid;r.set(n,{id:n,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),i._pipe(t,t.dataTask)})},gm.prototype.prepareStageTasks=function(){var n=this._stageTaskMap,i=this.api.getModel(),r=this.api;B(this._allHandlers,function(t){var e=n.get(t.uid)||n.set(t.uid,{});kt(!(t.reset&&t.overallReset),""),t.reset&&this._createSeriesStageTask(t,e,i,r),t.overallReset&&this._createOverallStageTask(t,e,i,r)},this)},gm.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},gm.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},gm.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},gm.prototype._performStageTasks=function(t,s,l,u){u=u||{};var h=!1,c=this;function p(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}B(t,function(i,t){var e,n,r,o,a;u.visualType&&u.visualType!==i.visualType||(e=(n=c._stageTaskMap.get(i.uid)).seriesTaskMap,(n=n.overallTask)?((o=n.agentStubMap).each(function(t){p(u,t)&&(t.dirty(),r=!0)}),r&&n.dirty(),c.updatePayload(n,l),a=c.getPerformArgs(n,u.block),o.each(function(t){t.perform(a)}),n.perform(a)&&(h=!0)):e&&e.each(function(t,e){p(u,t)&&t.dirty();var n=c.getPerformArgs(t,u.block);n.skip=!i.performRawSeries&&s.isSeriesFiltered(t.context.model),c.updatePayload(t,l),t.perform(n)&&(h=!0)}))}),this.unfinished=h||this.unfinished},gm.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},gm.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}}while(e=e.getUpstream())})},gm.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},gm.prototype._createSeriesStageTask=function(n,t,i,r){var o=this,a=t.seriesTaskMap,s=t.seriesTaskMap=O(),t=n.seriesType,e=n.getTargetSeries;function l(t){var e=t.uid,e=s.set(e,a&&a.get(e)||Sg({plan:xm,reset:wm,count:Mm}));e.context={model:t,ecModel:i,api:r,useClearVisual:n.isVisual&&!n.isLayout,plan:n.plan,reset:n.reset,scheduler:o},o._pipe(t,e)}n.createOnAllSeries?i.eachRawSeries(l):t?i.eachRawSeriesByType(t,l):e&&e(i,r).each(l)},gm.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||Sg({reset:ym}),a=(o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r},o.agentStubMap),s=o.agentStubMap=O(),e=t.seriesType,l=t.getTargetSeries,u=!0,h=!1;function c(t){var e=t.uid,e=s.set(e,a&&a.get(e)||(h=!0,Sg({reset:mm,onDirty:_m})));e.context={model:t,overallProgress:u},e.agent=o,e.__block=u,r._pipe(t,e)}kt(!t.createOnAllSeries,""),e?n.eachRawSeriesByType(e,c):l?l(n,i).each(c):(u=!1,B(n.getSeries(),c)),h&&o.dirty()},gm.prototype._pipe=function(t,e){t=t.uid,t=this._pipelineMap.get(t);t.head||(t.head=e),t.tail&&t.tail.pipe(e),(t.tail=e).__idxInPipeline=t.count++,e.__pipeline=t},gm.wrapStageHandler=function(t,e){return(t=N(t)?{overallReset:t,seriesType:function(t){Tm=null;try{t(Cm,km)}catch(t){}return Tm}(t)}:t).uid=bp("stageHandler"),e&&(t.visualType=e),t};var fm=gm;function gm(t,e,n,i){this._stageTaskMap=O(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}function ym(t){t.overallReset(t.ecModel,t.api,t.payload)}function mm(t){return t.overallProgress&&vm}function vm(){this.agent.dirty(),this.getDownstream().dirty()}function _m(){this.agent&&this.agent.dirty()}function xm(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function wm(t){t.useClearVisual&&t.data.clearAllVisual();t=t.resetDefines=Wo(t.reset(t.model,t.ecModel,t.api,t.payload));return 1'+t.dom+""}),f.painter.getSvgRoot().innerHTML=g,i.connectedBackgroundColor&&f.painter.setBackgroundColor(i.connectedBackgroundColor),f.refreshImmediately(),f.painter.toDataURL()):(i.connectedBackgroundColor&&f.add(new rl({shape:{x:0,y:0,width:t,height:n},style:{fill:i.connectedBackgroundColor}})),B(p,function(t){t=new js({style:{x:t.left*e-l,y:t.top*e-u,image:t.dom}});f.add(t)}),f.refreshImmediately(),d.toDataURL("image/"+(i&&i.type||"png")))):this.getDataURL(i);this.id},p.prototype.convertToPixel=function(t,e,n){return W0(this,"convertToPixel",t,e,n)},p.prototype.convertToLayout=function(t,e,n){return W0(this,"convertToLayout",t,e,n)},p.prototype.convertFromPixel=function(t,e,n){return W0(this,"convertFromPixel",t,e,n)},p.prototype.containPixel=function(t,i){var r;if(!this._disposed)return B(na(this._model,t),function(t,n){0<=n.indexOf("Models")&&B(t,function(t){var e=t.coordinateSystem;e&&e.containPoint?r=r||!!e.containPoint(i):"seriesModels"===n&&(e=this._chartsMap[t.__viewId])&&e.containPoint&&(r=r||e.containPoint(i,t))},this)},this),!!r;this.id},p.prototype.getVisual=function(t,e){var t=na(this._model,t,{defaultMainType:"series"}),n=t.seriesModel.getData(),t=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?n.indexOfRawIndex(t.dataIndex):null;if(null!=t){var i=n,r=t,o=e;switch(o){case"color":return i.getItemVisual(r,"style")[i.getVisual("drawType")];case"opacity":return i.getItemVisual(r,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return i.getItemVisual(r,o)}}else{var a=n,s=e;switch(s){case"color":return a.getVisual("style")[a.getVisual("drawType")];case"opacity":return a.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return a.getVisual(s)}}},p.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},p.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},p.prototype._initEvents=function(){var n,i,s=this,r=(B(hv,function(a){function t(t){var n,e,i,r=s.getModel(),o=t.target;"globalout"===a?n={}:o&&Bm(o,function(t){var e,t=G(t);return t&&null!=t.dataIndex?(e=t.dataModel||r.getSeriesByIndex(t.seriesIndex),n=e&&e.getDataParams(t.dataIndex,t.dataType,o)||{},1):t.eventData&&(n=P({},t.eventData),1)},!0),n&&(e=n.componentType,i=n.componentIndex,"markLine"!==e&&"markPoint"!==e&&"markArea"!==e||(e="series",i=n.seriesIndex),i=(e=e&&null!=i&&r.getComponent(e,i))&&s["series"===e.mainType?"_chartsMap":"_componentsMap"][e.__viewId],n.event=t,n.type=a,s._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:e,view:i},s.trigger(a,n))}t.zrEventfulCallAtLast=!0,s._zr.on(a,t,s)}),this._messageCenter);B(dv,function(t,e){r.on(e,function(t){s.trigger(e,t)})}),i=(n=this)._api,r.on("selectchanged",function(t){var e=i.getModel();t.isFromClick?(Rm("map","selectchanged",n,e,t),Rm("pie","selectchanged",n,e,t)):"select"===t.fromAction?(Rm("map","selected",n,e,t),Rm("pie","selected",n,e,t)):"unselect"===t.fromAction&&(Rm("map","unselected",n,e,t),Rm("pie","unselected",n,e,t))})},p.prototype.isDisposed=function(){return this._disposed},p.prototype.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},p.prototype.dispose=function(){var t,e,n;this._disposed?this.id:(this._disposed=!0,this.getDom()&&aa(this.getDom(),Sv,""),e=(t=this)._api,n=t._model,B(t._componentsViews,function(t){t.dispose(n,e)}),B(t._chartsViews,function(t){t.dispose(n,e)}),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete _v[t.id])},p.prototype.resize=function(t){if(!this[C0])if(this._disposed)this.id;else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var e=e.resetOption("media"),n=t&&t.silent;this[I0]&&(null==n&&(n=this[I0].silent),e=!0,this[I0]=null),this[C0]=!0,nv(this);try{e&&E0(this),H0.update.call(this,{type:"resize",animation:P({duration:0},t&&t.animation)})}catch(t){throw this[C0]=!1,t}this[C0]=!1,X0.call(this,n),Y0.call(this,n)}}},p.prototype.showLoading=function(t,e){this._disposed?this.id:(H(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),vv[t]&&(t=vv[t](this._api,e),e=this._zr,this._loadingFX=t,e.add(t)))},p.prototype.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},p.prototype.makeActionFromEvent=function(t){var e=P({},t);return e.type=pv[t.type],e},p.prototype.dispatchAction=function(t,e){var n;this._disposed?this.id:(H(e)||(e={silent:!!e}),cv[t.type]&&this._model&&(this[C0]?this._pendingActions.push(t):(n=e.silent,U0.call(this,t,n),(t=e.flush)?this._zr.flush():!1!==t&&b.browser.weChat&&this._throttledZrFlush(),X0.call(this,n),Y0.call(this,n))))},p.prototype.updateLabelLayout=function(){M0.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},p.prototype.appendData=function(t){var e;this._disposed?this.id:(e=t.seriesIndex,this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp())},p.internalField=(E0=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),F0(t,!0),F0(t,!1),e.plan()},F0=function(t,r){for(var o=t._model,a=t._scheduler,s=r?t._componentsViews:t._chartsViews,l=r?t._componentsMap:t._chartsMap,u=t._zr,h=t._api,e=0;es.get("hoverLayerThreshold")&&!b.node&&!b.worker&&s.eachSeries(function(t){t.preventUsingHoverLayer||(t=i._chartsMap[t.__viewId]).__alive&&t.eachRendered(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})}),M0.trigger("series:afterupdate",t,e,n)},tv=function(t){t[D0]=!0,t.getZr().wakeUp()},nv=function(t){t[k0]=(t[k0]+1)%1e3},ev=function(t){t[D0]&&(t.getZr().storage.traverse(function(t){lc(t)||av(t)}),t[D0]=!1)},Q0=function(n){return u(t,e=Sf),t.prototype.getCoordinateSystems=function(){return n._coordSysMgr.getCoordinateSystems()},t.prototype.getComponentByElement=function(t){for(;t;){var e=t.__ecComponentInfo;if(null!=e)return n._model.getComponent(e.mainType,e.index);t=t.parent}},t.prototype.enterEmphasis=function(t,e){Ql(t,e),tv(n)},t.prototype.leaveEmphasis=function(t,e){Jl(t,e),tv(n)},t.prototype.enterBlur=function(t){Yl(t,Hl),tv(n)},t.prototype.leaveBlur=function(t){tu(t),tv(n)},t.prototype.enterSelect=function(t){eu(t),tv(n)},t.prototype.leaveSelect=function(t){nu(t),tv(n)},t.prototype.getModel=function(){return n.getModel()},t.prototype.getViewOfComponentModel=function(t){return n.getViewOfComponentModel(t)},t.prototype.getViewOfSeriesModel=function(t){return n.getViewOfSeriesModel(t)},t.prototype.getMainProcessVersion=function(){return n[k0]},new t(n);function t(){return null!==e&&e.apply(this,arguments)||this}var e},void(J0=function(i){function r(t,e){for(var n=0;nr[1]&&(r[0]=r[1]),o}function k_(t){var e=Math.pow(10,Ro(t)),t=t/e;return t?2===t?t=3:3===t?t=5:t*=2:t=1,To(t*e)}function I_(t){return Co(t)+2}function D_(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function A_(t,e){return t>=e[0]&&t<=e[1]}P_.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=pt(t.normalize,t),this.scale=pt(t.scale,t)):(this.normalize=O_,this.scale=R_)};var L_=P_;function P_(){this.normalize=O_,this.scale=R_}function O_(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function R_(t,e){return t*(e[1]-e[0])+e[0]}function B_(t,e,n){t=Math.log(t);return[Math.log(n?e[0]:Math.max(0,e[0]))/t,Math.log(n?e[1]:Math.max(0,e[1]))/t]}z_.prototype.getSetting=function(t){return this._setting[t]},z_.prototype._innerUnionExtent=function(t){var e=this._extent;this._innerSetExtent((t[0]e[1]?t:e)[1])},z_.prototype.unionExtentFromData=function(t,e){this._innerUnionExtent(t.getApproximateExtent(e))},z_.prototype.getExtent=function(){return this._extent.slice()},z_.prototype.setExtent=function(t,e){this._innerSetExtent(t,e)},z_.prototype._innerSetExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e),this._brkCtx&&this._brkCtx.update(n)},z_.prototype.setBreaksFromOption=function(t){},z_.prototype._innerSetBreak=function(t){this._brkCtx&&(this._brkCtx.setBreaks(t),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},z_.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},z_.prototype.hasBreaks=function(){return!!this._brkCtx&&this._brkCtx.hasBreaks()},z_.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},z_.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},z_.prototype.isBlank=function(){return this._isBlank},z_.prototype.setBlank=function(t){this._isBlank=t};var N_=z_;function z_(t){this._calculator=new L_,this._setting=t||{},this._extent=[1/0,-1/0]}ya(N_);var E_=0,F_=(V_.createByAxisModel=function(t){var t=t.option,e=t.data,e=e&&E(e,H_);return new V_({categories:e,needCollect:!e,deduplication:!1!==t.dedplication})},V_.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},V_.prototype.parseAndCollect=function(t){var e,n,i=this._needCollect;return V(t)||i?(i&&!this._deduplication?(n=this.categories.length,this.categories[n]=t,this._onCollect&&this._onCollect(t,n)):null==(n=(e=this._getOrCreateMap()).get(t))&&(i?(n=this.categories.length,this.categories[n]=t,e.set(t,n),this._onCollect&&this._onCollect(t,n)):n=NaN),n):t},V_.prototype._getOrCreateMap=function(){return this._map||(this._map=O(this.categories))},V_);function V_(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++E_,this._onCollect=t.onCollect}function H_(t){return H(t)&&null!=t.value?t.value:t+""}u(U_,W_=N_),U_.prototype.parse=function(t){return null==t?NaN:V(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},U_.prototype.contain=function(t){return A_(t,this._extent)&&0<=t&&t=t},U_.prototype.getOrdinalMeta=function(){return this._ordinalMeta},U_.prototype.calcNiceTicks=function(){},U_.prototype.calcNiceExtent=function(){},U_.type="ordinal";var W_,G_=U_;function U_(t){var t=W_.call(this,t)||this,e=(t.type="ordinal",t.getSetting("ordinalMeta"));return F(e=e||new F_({}))&&(e=new F_({categories:E(e,function(t){return H(t)?t.value:t})})),t._ordinalMeta=e,t._extent=t.getSetting("extent")||[0,e.categories.length-1],t}N_.registerClass(G_);var X_,Y_=To,q_=(u(Z_,X_=N_),Z_.prototype.parse=function(t){return null==t||""===t?NaN:Number(t)},Z_.prototype.contain=function(t){return A_(t,this._extent)},Z_.prototype.normalize=function(t){return this._calculator.normalize(t,this._extent)},Z_.prototype.scale=function(t){return this._calculator.scale(t,this._extent)},Z_.prototype.getInterval=function(){return this._interval},Z_.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=I_(t)},Z_.prototype.getTicks=function(t){t=t||{};var n=this._interval,e=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=Lp,a=[];if(n)if("only_break"===t.breakTicks&&o)o.addBreaksToTicks(a,this._brkCtx.breaks,this._extent);else{e[0]h&&(t.expandToNicedExtent?a.push({value:Y_(h+n,r)}):a.push({value:e[1]})),"none"!==t.breakTicks&&o&&o.addBreaksToTicks(a,this._brkCtx.breaks,this._extent)}return a},Z_.prototype.getMinorTicks=function(t){for(var e=this.getTicks({expandToNicedExtent:!0}),n=[],i=this.getExtent(),r=1;ri[0]&&cx));)g[r](g[i]()+t),f=g.getTime(),y&&0<(p=y.calcNiceTickMultiple(f,d))&&(g[r](g[i]()+p*t),f=g.getTime());a.push({value:f,notAdd:!0})}function i(t,e,n){var i,r,o,a,s=[],l=!e.length;if(i=Up(t),r=_[0],o=_[1],a=v,qp(new Date(r),i,a).getTime()!==qp(new Date(o),i,a).getTime()){l&&(e=[{value:function(t,e,n){e=Math.max(0,I(Vp,e)-1);return qp(new Date(t),Vp[e],n).getTime()}(_[0],t,v)},{value:_[1]}]);for(var u,h,c=0;c=_[0]&&p<=_[1]&&b(f,p,d,g,y,0,s),"year"===t&&1=_[0]&&d<=_[1]&&a++)}u=e/m;if(1.5*u=_[0]&&t.value<=_[1]&&!t.notAdd})}),function(t){return 0n&&(this._approxInterval=n),hx.length),t=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]>1^-(1&s),l=(l=t.charCodeAt(a+1)-64)>>1^-(1&l);i.push([(r=s+=r)/n,(o=l+=o)/n])}return i}function r1(t,o){var e,n,r;return E(ut((t=(e=t).UTF8Encoding?(null==(r=(n=e).UTF8Scale)&&(r=1024),B(n.features,function(t){var e=t.geometry,n=e.encodeOffsets,i=e.coordinates;if(n)switch(e.type){case"LineString":e.coordinates=i1(i,n,r);break;case"Polygon":case"MultiLineString":n1(i,n,r);break;case"MultiPolygon":B(i,function(t,e){return n1(t,n[e],r)})}}),n.UTF8Encoding=!1,n):e).features,function(t){return t.geometry&&t.properties&&0l&&(l=s[h],u=h);++o[u],s[u]=0,++a}return E(o,function(t){return t/i})}(t,n)[e]||0},getPixelPrecision:Io,getPrecision:Co,getPrecisionSafe:ko,isNumeric:zo,isRadianAroundZero:Ao,linearMap:bo,nice:Bo,numericToNumber:No,parseDate:Po,parsePercent:So,quantile:function(t,e){var e=(t.length-1)*e+1,n=Math.floor(e),i=+t[n-1];return(e=e-n)?i+e*(t[n]-i):i},quantity:Oo,quantityExponent:Ro,reformIntervals:function(t){t.sort(function(t,e){return function t(e,n,i){return e.interval[i]=e[0]&&t<=e[1]}),function(t){var e={value:t};return{formattedLabel:i(e),rawLabel:n.scale.getLabel(e),tickValue:t,time:void 0,break:void 0}})}):"category"===n.type?(s=t,a=(t=n).getLabelModel(),s=p1(t,a,s),!a.get("show")||t.scale.isBlank()?{labels:[]}:s):(a=(r=n).scale.getTicks(),o=Ax(r),{labels:E(a,function(t,e){return{formattedLabel:o(t,e),rawLabel:r.scale.getLabel(t),tickValue:t.value,time:t.time,break:t.break}})})}function c1(t,e,n){var i,r,o,a,s,l,u=t.getTickModel().get("customValues");return u?(i=t.scale.getExtent(),{ticks:ut(u1(t,u),function(t){return t>=i[0]&&t<=i[1]})}):"category"===t.type?(u=e,a=d1(e=t),s=Px(u),(l=y1(a,s))||(u.get("show")&&!e.scale.isBlank()||(r=[]),r=N(s)?w1(e,s,!0):"auto"===s?(l=p1(e,e.getLabelModel(),l1(s1.determine)),o=l.labelCategoryInterval,E(l.labels,function(t){return t.tickValue})):x1(e,o=s,!0),m1(a,s,{ticks:r,tickCategoryInterval:o}))):{ticks:E(t.scale.getTicks(n),function(t){return t.value})}}function p1(t,e,n){var i,r=f1(t),o=Px(e),e=n.kind===s1.estimate;if(!e){var a=y1(r,o);if(a)return a}var s={labels:N(o)?w1(t,o):x1(t,i="auto"===o?function(t,e){{var n;if(e.kind===s1.estimate)return n=t.calculateCategoryInterval(e),e.out.noPxChangeTryDetermine.push(function(){return a1(t).autoInterval=n,!0}),n}var i=a1(t).autoInterval;return null!=i?i:a1(t).autoInterval=t.calculateCategoryInterval(e)}(t,n):o),labelCategoryInterval:i};return e?n.out.noPxChangeTryDetermine.push(function(){return m1(r,o,s),!0}):m1(r,o,s),s}var d1=g1("axisTick"),f1=g1("axisLabel");function g1(e){return function(t){return a1(t)[e]||(a1(t)[e]={list:[]})}}function y1(t,e){for(var n=0;nl[1],h(n[0].coord,l[0])&&(t?n[0].coord=l[0]:n.shift()),t&&h(l[0],n[0].coord)&&n.unshift({coord:l[0],onBand:!0}),h(l[1],i.coord)&&(t?i.coord=l[1]:n.pop()),t)&&h(i.coord,l[1])&&n.push({coord:l[1],onBand:!0}),u},S1.prototype.getMinorTicksCoords=function(){var t;return"ordinal"===this.scale.type?[]:(t=this.model.getModel("minorTick").get("splitNumber"),E(this.scale.getMinorTicks(t=0=u}}for(var o,a=this.__startIndex;ar[0]){for(l=0;lt);l++);s=i[r[l]]}r.splice(l+1,0,t),(i[t]=e).virtual||(s?(n=s.dom).nextSibling?a.insertBefore(e.dom,n.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.painter||(e.painter=this)}},_.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;ie&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?0<=i.height?"bottom":"top":0<=i.width?"right":"left"),h=function(t,e){for(var n={normal:t.getModel(e=e||"label")},i=0;iMath.PI/2&&n<1.5*Math.PI&&(n-=Math.PI),t.setTextConfig({rotation:n})}}(t,"outside"===a?u:a,Qw(o),n.get(["label","rotate"]))),u=l,a=h,o=r.getRawValue(e),l=function(t){var e=s,n=t,i=e.mapDimensionsAll("defaultedLabel");if(!F(n))return n+"";for(var r=[],o=0;oe[1]&&e.reverse(),e},Ib.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},Ib.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)};var Cb,kb=Ib;function Ib(t,e,n,i,r){t=Cb.call(this,t,e,n)||this;return t.index=0,t.type=i||"value",t.position=r||"bottom",t}var Db="expandAxisBreak",Ab=Math.PI,Lb=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],Pb=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Ob=ta(),Rb=ta(),Bb=(Nb.prototype.ensureRecord=function(t){var e=t.axis.dim,t=t.componentIndex,n=this.recordMap,n=n[e]||(n[e]=[]);return n[t]||(n[t]={ready:{}})},Nb);function Nb(t){this.recordMap={},this.resolveAxisNameOverlap=t}function zb(t,e,n,i,r,o){var a,s;Rx(t.nameLocation)?(t=o.stOccupiedRect)&&Vb((a={},t=t,s=o.transGroup.transform,a.transform=Gc(a.transform,s),a.localRect=Wc(a.localRect,t),a.rect=Wc(a.rect,t),s&&a.rect.applyTransform(s),a.axisAligned=Hc(s),a.obb=void 0,(a.label=a.label||{}).ignore=!1,a),i,r):Hb(o.labelInfoList,o.dirVec,i,r)}var Eb=Be(),Fb=new X(0,0,0,0);function Vb(t,e,n){var i=new M;J1(t,e,i,{direction:Math.atan2(n.y,n.x),bidirectional:!1,touchThreshold:.05})&&(t=i,n=e)&&(n.label.x+=t.x,n.label.y+=t.y,n.label.markRedraw(),(i=n.transform)&&(i[4]+=t.x,i[5]+=t.y),(e=n.rect)&&(e.x+=t.x,e.y+=t.y),e=n.obb)&&e.fromBoundingRect(n.localRect,i)}function Hb(t,e,n,i){for(var r=0<=M.dot(i,e),o=0,a=t.length;oi[1],i="start"===e&&!t||"start"!==e&&t;e=Ao(n-Ab/2)?(r=i?"bottom":"top","center"):Ao(n-1.5*Ab)?(r=i?"top":"bottom","center"):(r="middle",n<1.5*Ab&&Ab/2s[0]&&isFinite(c)&&isFinite(s[0]);)h=k_(h),c=s[1]-h*a;else{t=(h=au[1]&&u.reverse(),(s=null==s||s>u[1]?u[1]:s)n[r],f=[-c.x,-c.y],e=(e||(f[i]=l[s]),[0,0]),s=[-p.x,-p.y],g=W(t.get("pageButtonGap",!0),t.get("itemGap",!0)),f=(d&&("end"===t.get("pageButtonPosition",!0)?s[i]+=n[r]-p[r]:e[i]+=p[r]+g),s[1-i]+=c[o]/2-p[o]/2,l.setPosition(f),u.setPosition(e),h.setPosition(s),{x:0,y:0}),c=(f[r]=(d?n:c)[r],f[o]=Math.max(c[o],p[o]),f[a]=Math.min(0,p[a]+s[1-i]),u.__rectSize=n[r],d?((e={x:0,y:0})[r]=Math.max(n[r]-p[r]-g,0),e[o]=f[o],u.setClipPath(new rl({shape:e})),u.__rectSize=e[r]):h.eachChild(function(t){t.attr({invisible:!0,silent:!0})}),this._getPageInfo(t));return null!=c.pageIndex&&ac(l,{x:c.contentPosition[0],y:c.contentPosition[1]},d?t:null),this._updatePageInfoView(t,c),f},gM.prototype._pageGo=function(t,e,n){t=this._getPageInfo(e)[t];null!=t&&n.dispatchAction({type:"legendScroll",scrollDataIndex:t,legendId:e.id})},gM.prototype._updatePageInfoView=function(n,i){var r=this._controllerGroup,t=(B(["pagePrev","pageNext"],function(t){var e=null!=i[t+"DataIndex"],t=r.childOfName(t);t&&(t.setStyle("fill",e?n.get("pageIconColor",!0):n.get("pageIconInactiveColor",!0)),t.cursor=e?"pointer":"default")}),r.childOfName("pageText")),e=n.get("pageFormatter"),o=i.pageIndex,o=null!=o?o+1:0,a=i.pageCount;t&&e&&t.setStyle("text",V(e)?e.replace("{current}",null==o?"":o+"").replace("{total}",null==a?"":a+""):e({current:o,total:a}))},gM.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,t=t.getOrient().index,r=pM[t],o=dM[t],e=this._findTargetItemIndex(e),a=n.children(),s=a[e],l=a.length,u=l?1:0,h={contentPosition:[n.x,n.y],pageCount:u,pageIndex:u-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(s){n=g(s);h.contentPosition[t]=-n.s;for(var c=e+1,p=n,d=n,f=null;c<=l;++c)(!(f=g(a[c]))&&d.e>p.s+i||f&&!y(f,p.s))&&(p=d.i>p.i?d:f)&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=p.i),++h.pageCount),d=f;for(c=e-1,p=n,d=n,f=null;-1<=c;--c)(f=g(a[c]))&&y(d,f.s)||!(p.i=e&&t.s<=e+i}},gM.prototype._findTargetItemIndex=function(n){var i,r;return this._showController?(this.getContentGroup().eachChild(function(t,e){t=t.__legendDataIndex;null==r&&null!=t&&(r=e),t===n&&(i=e)}),null!=i?i:r):0},gM.type="legend.scroll",gM);function gM(){var t=null!==hM&&hM.apply(this,arguments)||this;return t.type=gM.type,t.newlineDisabled=!0,t._currentIndex=0,t}Hx(function(t){Hx(oM),t.registerComponentModel(sM),t.registerComponentView(fM),t.registerAction("legendScroll","legendscroll",function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(n)})})});var yM=ta(),mM=y,vM=pt;function _M(){this._dragging=!1,this.animationThreshold=15}function xM(t,e,n,i){!function n(i,t){{var r;return H(i)&&H(t)?(r=!0,B(t,function(t,e){r=r&&n(i[e],t)}),!!r):i===t}}(yM(n).lastProp,i)&&(yM(n).lastProp=i,e?ac(n,i,t):(n.stopAnimation(),n.attr(i)))}function wM(t,e){t[e.get(["label","show"])?"show":"hide"]()}function bM(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function SM(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)})}function MM(t,e,n,i,r){var o=TM(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),n=n.getModel("label"),a=ud(n.get("padding")||0),s=n.getFont(),l=Hr(o,s),u=r.position,h=l.width+a[1]+a[3],l=l.height+a[0]+a[2],c=r.align,c=("right"===c&&(u[0]-=h),"center"===c&&(u[0]-=h/2),r.verticalAlign),i=("bottom"===c&&(u[1]-=l),"middle"===c&&(u[1]-=l/2),r=u,c=h,h=l,i=(l=i).getWidth(),l=l.getHeight(),r[0]=Math.min(r[0]+c,i)-c,r[1]=Math.min(r[1]+h,l)-h,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0),n.get("backgroundColor"));i&&"auto"!==i||(i=e.get(["axisLine","lineStyle","color"])),t.label={x:u[0],y:u[1],style:$c(n,{text:o,font:s,fill:n.getTextColor(),padding:a,backgroundColor:i}),z2:10}}function TM(t,e,n,i,r){t=e.scale.parse(t);var o,a=e.scale.getLabel({value:t},{precision:r.precision}),r=r.formatter;return r&&(o={value:Lx(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]},B(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),t=t.dataIndexInside,e=e&&e.getDataParams(t);e&&o.seriesData.push(e)}),V(r)?a=r.replace("{value}",a):N(r)&&(a=r(o))),a}function CM(t,e,n){var i=Be();return Ve(i,i,n.rotation),Fe(i,i,n.position),Ic([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}_M.prototype.render=function(t,e,n,i){var r,o,a=e.get("value"),s=e.get("status");this._axisModel=t,this._axisPointerModel=e,this._api=n,!i&&this._lastValue===a&&this._lastStatus===s||(this._lastValue=a,this._lastStatus=s,i=this._group,r=this._handle,s&&"hide"!==s?(i&&i.show(),r&&r.show(),this.makeElOption(s={},a,t,e,n),(o=s.graphicKey)!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=o,o=this._moveAnimation=this.determineAnimation(t,e),i?(o=dt(xM,e,o),this.updatePointerEl(i,s,o),this.updateLabelEl(i,s,o,e)):(i=this._group=new ao,this.createPointerEl(i,s,t,e),this.createLabelEl(i,s,t,e),n.getZr().add(i)),SM(i,e,!0),this._renderHandle(a)):(i&&i.hide(),r&&r.hide()))},_M.prototype.remove=function(t){this.clear(t)},_M.prototype.dispose=function(t){this.clear(t)},_M.prototype.determineAnimation=function(t,e){var n,i=e.get("animation"),r=t.axis,o="category"===r.type,e=e.get("snap");return!(!e&&!o)&&("auto"===i||null==i?(n=this.animationThreshold,o&&r.getBandWidth()>n||!!e&&(o=gS(t).seriesDataCount,e=r.getExtent(),Math.abs(e[0]-e[1])/o>n)):!0===i)},_M.prototype.makeElOption=function(t,e,n,i,r){},_M.prototype.createPointerEl=function(t,e,n,i){var r=e.pointer;r&&(r=yM(t).pointerEl=new Yc[r.type](mM(e.pointer)),t.add(r))},_M.prototype.createLabelEl=function(t,e,n,i){e.label&&(e=yM(t).labelEl=new hl(mM(e.label)),t.add(e),wM(e,i))},_M.prototype.updatePointerEl=function(t,e,n){t=yM(t).pointerEl;t&&e.pointer&&(t.setStyle(e.pointer.style),n(t,{shape:e.pointer.shape}))},_M.prototype.updateLabelEl=function(t,e,n,i){t=yM(t).labelEl;t&&(t.setStyle(e.label.style),n(t,{x:e.label.x,y:e.label.y}),wM(t,i))},_M.prototype._renderHandle=function(t){var e,n,i,r,o,a;!this._dragging&&this.updateHandleTransform&&(e=this._axisPointerModel,n=this._api.getZr(),i=this._handle,r=e.getModel("handle"),a=e.get("status"),r.get("show")&&a&&"hide"!==a?(this._handle||(o=!0,i=this._handle=Oc(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Ae(t.event)},onmousedown:vM(this._onHandleDragMove,this,0,0),drift:vM(this._onHandleDragMove,this),ondragend:vM(this._onHandleDragEnd,this)}),n.add(i)),SM(i,e,!1),i.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"])),F(a=r.get("size"))||(a=[a,a]),i.scaleX=a[0]/2,i.scaleY=a[1]/2,om(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,o)):(i&&n.remove(i),this._handle=null))},_M.prototype._moveHandleToValue=function(t,e){xM(this._axisPointerModel,!e&&this._moveAnimation,this._handle,bM(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_M.prototype._onHandleDragMove=function(t,e){var n=this._handle;n&&(this._dragging=!0,t=this.updateHandleTransform(bM(n),[t,e],this._axisModel,this._axisPointerModel),this._payloadInfo=t,n.stopAnimation(),n.attr(bM(t)),yM(n).lastProp=null,this._doDispatchAxisPointer())},_M.prototype._doDispatchAxisPointer=function(){var t,e;this._handle&&(t=this._payloadInfo,e=this._axisModel,this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]}))},_M.prototype._onHandleDragEnd=function(){var t;this._dragging=!1,this._handle&&(t=this._axisPointerModel.get("value"),this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"}))},_M.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var t=t.getZr(),e=this._group,n=this._handle;t&&e&&(this._lastGraphicKey=null,e&&t.remove(e),n&&t.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),am(this,"_doDispatchAxisPointer")},_M.prototype.doClear=function(){},_M.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}};u(DM,kM=_M),DM.prototype.makeElOption=function(t,e,n,i,r){var o,a,s=n.axis,l=s.grid,u=i.get("type"),h=AM(l,s).getOtherAxis(s).getGlobalExtent(),c=s.toGlobalCoord(s.dataToCoord(e,!0)),p=(u&&"none"!==u&&(o=(a=i).get("type"),a=a.getModel(o+"Style"),"line"===o?(p=a.getLineStyle()).fill=null:"shadow"===o&&((p=a.getAreaStyle()).stroke=null),o=p,(a=LM[u](s,c,h)).style=o,t.graphicKey=a.type,t.pointer=a),tS(l.getRect(),n));u=e,s=t,c=p,h=n,o=i,a=r,l=Wb.innerTextLayout(c.rotation,0,c.labelDirection),c.labelMargin=o.get(["label","margin"]),MM(s,h,o,a,{position:CM(h.axis,u,c),align:l.textAlign,verticalAlign:l.textVerticalAlign})},DM.prototype.getHandleTransform=function(t,e,n){var i=tS(e.axis.grid.getRect(),e,{labelInside:!1}),n=(i.labelMargin=n.get(["handle","margin"]),CM(e.axis,t,i));return{x:n[0],y:n[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},DM.prototype.updateHandleTransform=function(t,e,n,i){var n=n.axis,r=n.grid,o=n.getGlobalExtent(!0),r=AM(r,n).getOtherAxis(n).getGlobalExtent(),n="x"===n.dim?0:1,a=[t.x,t.y],e=(a[n]+=e[n],a[n]=Math.min(o[1],a[n]),a[n]=Math.max(o[0],a[n]),(r[1]+r[0])/2),o=[e,e];o[n]=a[n];return{x:a[0],y:a[1],rotation:t.rotation,cursorPoint:o,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][n]}};var kM,IM=DM;function DM(){return null!==kM&&kM.apply(this,arguments)||this}function AM(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var LM={line:function(t,e,n){var i;return i=[e,n[0]],e=[e,n[1]],n=PM(t),{type:"Line",subPixelOptimize:!0,shape:{x1:i[n=n||0],y1:i[1-n],x2:e[n],y2:e[1-n]}}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:(e=[e-i/2,n[0]],n=[i,r],i=PM(t),{x:e[i=i||0],y:e[1-i],width:n[i],height:n[1-i]})}}};function PM(t){return"x"===t.dim?0:1}u(BM,OM=g),BM.type="axisPointer",BM.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:v.color.border,width:1,type:"dashed"},shadowStyle:{color:v.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:v.color.neutral00,padding:[5,7,5,7],backgroundColor:v.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:v.color.accent40,throttle:40}};var OM,RM=BM;function BM(){var t=null!==OM&&OM.apply(this,arguments)||this;return t.type=BM.type,t}var NM=ta(),zM=B;function EM(t,e,n){var i,c,p;function r(t,h){c.on(t,function(e){n=p;var n,i,r={dispatchAction:o,pendings:i={showTip:[],hideTip:[]}};function o(t){var e=i[t.type];e?e.push(t):(t.dispatchAction=o,n.dispatchAction(t))}zM(NM(c).records,function(t){t&&h(t,e,r.dispatchAction)});var t,a=r.pendings,s=p,l=a.showTip.length,u=a.hideTip.length;l?t=a.showTip[l-1]:u&&(t=a.hideTip[u-1]),t&&(t.dispatchAction=null,s.dispatchAction(t))})}b.node||(i=e.getZr(),NM(i).records||(NM(i).records={}),p=e,NM(c=i).initialized||(NM(c).initialized=!0,r("click",dt(VM,"click")),r("mousemove",dt(VM,"mousemove")),r("globalout",FM)),(NM(i).records[t]||(NM(i).records[t]={})).handler=n)}function FM(t,e,n){t.handler("leave",null,n)}function VM(t,e,n,i){e.handler(t,n,i)}function HM(t,e){b.node||(e=e.getZr(),(NM(e).records||{})[t]&&(NM(e).records[t]=null))}u(UM,WM=Gy),UM.prototype.render=function(t,e,n){var e=e.getComponent("tooltip"),i=t.get("triggerOn")||e&&e.get("triggerOn")||"mousemove|click";EM("axisPointer",n,function(t,e,n){"none"!==i&&("leave"===t||0<=i.indexOf(t))&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},UM.prototype.remove=function(t,e){HM("axisPointer",e)},UM.prototype.dispose=function(t,e){HM("axisPointer",e)},UM.type="axisPointer";var WM,GM=UM;function UM(){var t=null!==WM&&WM.apply(this,arguments)||this;return t.type=UM.type,t}function XM(t,e){var n,i,r,o,a=[],s=t.seriesIndex;return null==s||!(e=e.getSeriesByIndex(s))||null==(s=Jo(n=e.getData(),t))||s<0||F(s)?{point:[]}:(i=n.getItemGraphicEl(s),r=e.coordinateSystem,e.getTooltipPosition?a=e.getTooltipPosition(s)||[]:r&&r.dataToPoint?a=t.isStacked?(e=r.getBaseAxis(),t=r.getOtherAxis(e).dim,e=e.dim,t="x"===t||"radius"===t?1:0,e=n.mapDimension(e),(o=[])[t]=n.get(e,s),o[1-t]=n.get(n.getCalculationInfo("stackResultDimension"),s),r.dataToPoint(o)||[]):r.dataToPoint(n.getValues(E(r.dimensions,function(t){return n.mapDimension(t)}),s))||[]:i&&((e=i.getBoundingRect().clone()).applyTransform(i.transform),a=[e.x+e.width/2,e.y+e.height/2]),{point:a,el:i})}var YM=ta();function qM(t,e,n){var o,a,i,s,l,r,u,h,c,p,d,f,g,y,m=t.currTrigger,v=[t.x,t.y],_=t,x=t.dispatchAction||pt(n.dispatchAction,n),w=e.getComponent("axisPointer").coordSysAxesInfo;if(w)return QM(v)&&(v=XM({seriesIndex:_.seriesIndex,dataIndex:_.dataIndex},e).point),o=QM(v),a=_.axesInfo,i=w.axesInfo,s="leave"===m||QM(v),l={},e={list:[],map:{}},u={showPointer:dt(jM,r={}),showTooltip:dt(KM,e)},B(w.coordSysMap,function(t,e){var r=o||t.containPoint(v);B(w.coordSysAxesInfo[e],function(t,e){var n=t.axis,i=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(a,t);s||!r||a&&!i||null!=(i=null!=(i=i&&i.value)||o?i:n.pointToData(v))&&ZM(t,i,u,!1,l)})}),h={},B(i,function(n,t){var i=n.linkGroup;i&&!r[t]&&B(i.axesInfo,function(t,e){var e=r[e];t!==n&&e&&(e=e.value,i.mapper&&(e=n.axis.scale.parse(i.mapper(e,$M(t),$M(n)))),h[n.key]=e)})}),B(h,function(t,e){ZM(i[e],t,u,!0,l)}),c=r,_=i,p=l.axesInfo=[],B(_,function(t,e){var n=t.axisPointerModel.option,e=c[e];e?(t.useHandle||(n.status="show"),n.value=e.value,n.seriesDataIndices=(e.payloadBatch||[]).slice()):t.useHandle||(n.status="hide"),"show"===n.status&&p.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:n.value})}),m=e,_=t,e=x,QM(t=v)||!m.list.length?e({type:"hideTip"}):(x=((m.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{},e({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:_.tooltipOption,position:_.position,dataIndexInside:x.dataIndexInside,dataIndex:x.dataIndex,seriesIndex:x.seriesIndex,dataByCoordSys:m.list})),e=i,_=(t=n).getZr(),x="axisPointerLastHighlights",d=YM(_)[x]||{},f=YM(_)[x]={},B(e,function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&B(n.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;f[e]=t})}),g=[],y=[],B(d,function(t,e){f[e]||y.push(t)}),B(f,function(t,e){d[e]||g.push(t)}),y.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:y}),g.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:g}),l}function ZM(t,e,n,i,r){var o,a,s,l,u,h,c,p,d,f,g=t.axis;!g.scale.isBlank()&&g.containData(e)&&(t.involveSeries?(a=e,s=t.axis,l=s.dim,u=a,h=[],c=Number.MAX_VALUE,p=-1,B(t.seriesModels,function(e,t){var n,i=e.getData().mapDimensionsAll(l);if(e.getAxisTooltipData)var r=e.getAxisTooltipData(i,a,s),o=r.dataIndices,r=r.nestestValue;else{if(!(o=e.indicesOfNearest(l,i[0],a,"category"===s.type?.5:null)).length)return;r=e.getData().get(i[0],o[0])}null!=r&&isFinite(r)&&(i=a-r,(n=Math.abs(i))<=c)&&((n'):""),V(t))o.innerHTML=t+c;else if(t){o.innerHTML="",F(t)||(t=[t]);for(var p,d=0;d"),o=f.join(e);this._showOrMove(i,function(){this._updateContentNotChangedOnAxis(t,p)?this._updatePosition(i,r,n[0],n[1],this._tooltipContent,p):this._showTooltipContent(i,o,p,Math.random()+"",n[0],n[1],r,null,g)})},ST.prototype._showSeriesItemTooltip=function(t,e,n){var i,r,o,a,s,l=this._ecModel,e=G(e),u=e.seriesIndex,h=l.getSeriesByIndex(u),c=e.dataModel||h,p=e.dataIndex,e=e.dataType,d=c.getData(e),f=this._renderMode,g=t.positionDefault,y=MT([d.getItemModel(p),c,h&&(h.coordinateSystem||{}).model],this._tooltipModel,g?{position:g}:null),h=y.get("trigger");null!=h&&"item"!==h||(i=c.getDataParams(p,e),r=new Dy,i.marker=r.makeTooltipMarker("item",gd(i.color),f),g=bg(c.formatTooltip(p,!1,e)),h=y.get("order"),e=y.get("valueFormatter"),o=g.frag,a=o?Ty(e?P({valueFormatter:e},o):o,r,f,h,l.get("useUTC"),y.get("textStyle")):g.text,s="item_"+c.name+"_"+p,this._showOrMove(y,function(){this._showTooltipContent(y,a,i,s,t.offsetX,t.offsetY,t.position,t.target,r)}),n({type:"showTip",dataIndexInside:p,dataIndex:d.getRawIndex(p),seriesIndex:u,from:this.uid}))},ST.prototype._showComponentItemTooltip=function(e,n,t){var i="html"===this._renderMode,r=G(n),o=r.tooltipConfig.option||{},a=o.encodeHTMLContent,a=(V(o)&&(o={content:o,formatter:o},a=!0),a&&i&&o.content&&((o=y(o)).content=be(o.content)),[o]),i=this._ecModel.getComponent(r.componentMainType,r.componentIndex),r=(i&&a.push(i),a.push({formatter:o.content}),e.positionDefault),s=MT(a,this._tooltipModel,r?{position:r}:null),l=s.get("content"),u=Math.random()+"",h=new Dy;this._showOrMove(s,function(){var t=y(s.get("formatterParams")||{});this._showTooltipContent(s,l,t,u,e.offsetX,e.offsetY,e.position,n,h)}),t({type:"showTip",from:this.uid})},ST.prototype._showTooltipContent=function(n,t,i,e,r,o,a,s,l){var u,h,c,p,d;this._ticket="",n.get("showContent")&&n.get("show")&&((u=this._tooltipContent).setEnterable(n.get("enterable")),h=n.get("formatter"),a=a||n.get("position"),t=t,c=this._getNearestPoint([r,o],i,n.get("trigger"),n.get("borderColor"),n.get("defaultBorderColor",!0)).color,h&&(t=V(h)?(p=n.ecModel.get("useUTC"),t=h,dd(t=(d=F(i)?i[0]:i)&&d.axisType&&0<=d.axisType.indexOf("time")?Xp(d.axisValue,t,p):t,i,!0)):N(h)?(d=pt(function(t,e){t===this._ticket&&(u.setContent(e,l,n,c,a),this._updatePosition(n,a,r,o,u,i,s))},this),this._ticket=e,h(i,e,d)):h),u.setContent(t,l,n,c,a),u.show(n,c),this._updatePosition(n,a,r,o,u,i,s))},ST.prototype._getNearestPoint=function(t,e,n,i,r){return"axis"===n||F(e)?{color:i||r}:F(e)?void 0:{color:i||e.color||e.borderColor}},ST.prototype._updatePosition=function(t,e,n,i,r,o,a){var s,l=this._api.getWidth(),u=this._api.getHeight(),h=(e=e||t.get("position"),r.getSize()),c=t.get("align"),p=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();a&&d.applyTransform(a.transform),F(e=N(e)?e([n,i],o,r.el,d,{viewSize:[l,u],contentSize:h.slice()}):e)?(n=So(e[0],l),i=So(e[1],u)):H(e)?((o=e).width=h[0],o.height=h[1],n=(o=Ad(o,{width:l,height:u})).x,i=o.y,p=c=null):i=(n=(s=V(e)&&a?function(t,e,n,i){var r=n[0],o=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-r/2,l=e.y+h/2-o/2;break;case"top":s=e.x+u/2-r/2,l=e.y-o-a;break;case"bottom":s=e.x+u/2-r/2,l=e.y+h+a;break;case"left":s=e.x-r-a,l=e.y+h/2-o/2;break;case"right":s=e.x+u+a,l=e.y+h/2-o/2}return[s,l]}(e,d,h,t.get("borderWidth")):function(t,e,n,i,r,o,a){var n=n.getSize(),s=n[0],n=n[1];null!=o&&(i":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},IT=(DT.prototype.evaluate=function(t){var e=typeof t;return V(e)?this._condVal.test(t):!!gt(e)&&this._condVal.test(t+"")},DT);function DT(t){null==(this._condVal=V(t)?new RegExp(t):wt(t)?t:null)&&f("")}LT.prototype.evaluate=function(){return this.value};var AT=LT;function LT(){}OT.prototype.evaluate=function(){for(var t=this.children,e=0;e { + // 截取url中的code方法 + const url = location.search + // this.winUrl = url; + let theRequest: { [key: string]: string | undefined } = {} + if (url.indexOf('?') != -1) { + let str = url.slice(1) + let strs = str.split('&') + for (let i = 0; i < strs.length; i++) { + theRequest[strs[i].split('=')[0]] = strs[i].split('=')[1] + } + } + return theRequest +} + +/** + * 微信静默授权登录 + */ +export function snsapiBaseAuthorize() { + let local = window.location.href // 获取页面url + let appid = import.meta.env.VITE_WX_SERVICE_ACCOUNT_APPID // 公众号的APPID + console.log("🚀 ~ snsapiBaseAuthorize ~ appid:", appid) + let code = getUrlCode().code // 截取code + // 获取之前的code + let oldCode = uni.getStorageSync('wechatCode') + + if (code == null || code === '' || code == 'undefined' || code == oldCode) { + // 如果没有code,就去请求获取code + console.log('当前没有code,进入授权页面') + let uri = encodeURIComponent(local) + // 设置旧的code为0,避免死循环 + uni.setStorageSync('wechatCode',0) + window.location.href = + `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${uri}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect` + } else { + console.log('存在code,使用code换取用户信息') + // 保存最新code + uni.setStorageSync('wechatCode',code) + console.log("🚀 ~ snsapiBaseAuthorize ~ code:", code) + + // 使用code换取用户信息 + wxSnsapiBaseLogin({code}).then(res=>{ + console.log("🚀 ~ snsapiBaseAuthorize ~ res:", res) + + }).catch(err=>{ + // 失败就重新授权 + uni.setStorageSync('wechatCode',0) + console.log('请求失败', err) + }) + } +} \ No newline at end of file diff --git a/src/pages.json b/src/pages.json index 144ab57..5b91710 100644 --- a/src/pages.json +++ b/src/pages.json @@ -119,8 +119,7 @@ "type": "page", "layout": "default", "style": { - "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#fff" + "navigationStyle": "custom" } }, { @@ -128,8 +127,7 @@ "type": "page", "layout": "default", "style": { - "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#fff" + "navigationStyle": "custom" } }, { diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index f72b575..1912bf8 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -17,7 +17,7 @@ 预约茶艺师 - + @@ -27,7 +27,7 @@ - + @@ -55,7 +55,7 @@ - + 一键约 @@ -77,14 +77,14 @@ class="h-64rpx rounded-12rpx px-24rpx py-12rpx flex items-center justify-center font-400 text-28rpx mr-20rpx" :class="selectedLevel.includes(item.value) ? 'bg-[#4C9F44] text-[#fff]' : 'bg-[#FFF] text-[#606266]'" v-for="(item, index) in TeaSpecialistLevels" :key="index" - @click="Home.handleToggleTeaSpecialistLevel(item.value)"> + @click="Index.handleToggleTeaSpecialistLevel(item.value)"> {{ item.label }} - - + @@ -161,14 +161,16 @@ onLoad(() => { }) - const Home = { - toCity: () => { + const Index = { + // 城市 + handleToCity: () => { uni.navigateTo({ url: '/pages/city/city' }) }, - toSearch: () => { + // 搜索 + handleToSearch: () => { uni.navigateTo({ url: '/pages/search/search' }) @@ -224,6 +226,13 @@ // 如果未选择该等级,则添加选择 selectedLevel.value.push(value); } + }, + + // 跳转到团体预约页面 + handleToGroupReserve: () => { + uni.navigateTo({ + url: '/pages/reservve/group-tea-specialist' + }) } } diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue index 37266bc..11877d7 100644 --- a/src/pages/login/login.vue +++ b/src/pages/login/login.vue @@ -1,8 +1,7 @@ { "layout": "default", "style": { - "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#fff" + "navigationStyle": "custom" } } @@ -19,16 +18,16 @@ - 手机号一键登录 - 其它手机号登录 + 手机号一键登录 + 其它手机号登录 - - + + - - 我已阅读并同意 《服务协议》《隐私政策》,未注册手机号登录后将自动你为您创建账号 + + 我已阅读并同意 《服务协议》《隐私政策》,未注册手机号登录后将自动你为您创建账号 @@ -40,13 +39,62 @@ const agree = ref(false) - const login = { + const Login = { + handleLogin: () => { + uni.login({ + provider: 'weixin', + success: (loginRes) => { + console.log("🚀 ~ loginRes:", loginRes) + // if (!agree.value) { + // uni.showToast({ + // title: '请同意服务协议和隐私政策', + // icon: 'none' + // }) + // return + // } + // // 发送 loginRes.code 到后台换取 openId, sessionKey, unionId + // uni.request({ + // url: 'https://your-backend-api.com/login', // 替换为你的后台登录接口 + // method: 'POST', + // data: { + // code: loginRes.code + // }, + // success: (res) => { + // console.log('登录成功,返回数据:', res.data); + // // 这里可以存储用户信息到本地,或者进行页面跳转等操作 + // }, + // fail: (err) => { + // console.error('登录请求失败:', err); + // uni.showToast({ + // title: '登录失败,请稍后重试', + // icon: 'none' + // }); + // } + // }); + }, + fail: (err) => { + console.error('登录失败:', err); + uni.showToast({ + title: '登录失败,请稍后重试', + icon: 'none' + }); + } + }); + }, + // 获取手机号 handleGetPhoneNumber: (e: object) => { console.log("🚀 ~ e:", e) }, + // 跳转到其他手机号登录页面 + handleToOtherMobileLogin: () => { + uni.navigateTo({ + url: '/pages/login/mobile' + }) + }, + handleAgree: (e: any) => { console.log('e', e) }, diff --git a/src/pages/login/mobile.vue b/src/pages/login/mobile.vue index 301af16..bb1d503 100644 --- a/src/pages/login/mobile.vue +++ b/src/pages/login/mobile.vue @@ -1,8 +1,7 @@ { "layout": "default", "style": { - "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#fff" + "navigationStyle": "custom" } }