From c73e9c0f9ea99804825997f58a3027fabe72df09 Mon Sep 17 00:00:00 2001 From: Jafeng <2998840497@qq.com> Date: Mon, 2 Feb 2026 11:20:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E6=88=91=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 34 +- pages/common/agreement.vue | 18 + pages/common/privacy.vue | 18 + pages/mine/contact.vue | 26 + pages/mine/mine.vue | 153 +++ static/tabbar/cart.png | Bin 1276 -> 0 bytes static/tabbar/cart_selected.png | Bin 2018 -> 0 bytes static/tabbar/center.png | Bin 1081 -> 0 bytes static/tabbar/center_selected.png | Bin 1826 -> 0 bytes static/tabbar/consult.png | Bin 0 -> 2661 bytes static/tabbar/consult_selected.png | Bin 0 -> 3296 bytes static/tabbar/home.png | Bin 884 -> 2317 bytes static/tabbar/home_selected.png | Bin 2000 -> 3135 bytes static/tabbar/mine.png | Bin 0 -> 2454 bytes static/tabbar/mine_selected.png | Bin 0 -> 3193 bytes uni_modules/Sansnn-uQRCode/LICENSE.md | 201 +++ uni_modules/Sansnn-uQRCode/README.md | 392 ++++++ uni_modules/Sansnn-uQRCode/changelog.md | 12 + uni_modules/Sansnn-uQRCode/common/cache.js | 1 + uni_modules/Sansnn-uQRCode/common/queue.js | 41 + .../Sansnn-uQRCode/common/types/cache.d.ts | 3 + .../Sansnn-uQRCode/common/types/queue.d.ts | 4 + .../components/u-qrcode/u-qrcode.vue | 1131 ++++++++++++++++ .../components/uqrcode/uqrcode.vue | 1131 ++++++++++++++++ .../js_sdk/gcanvas/bridge/bridge-weex.js | 241 ++++ .../context-2d/FillStyleLinearGradient.js | 18 + .../gcanvas/context-2d/FillStylePattern.js | 8 + .../context-2d/FillStyleRadialGradient.js | 17 + .../gcanvas/context-2d/RenderingContext.js | 666 +++++++++ .../gcanvas/context-webgl/ActiveInfo.js | 11 + .../js_sdk/gcanvas/context-webgl/Buffer.js | 21 + .../gcanvas/context-webgl/Framebuffer.js | 21 + .../js_sdk/gcanvas/context-webgl/GLenum.js | 298 +++++ .../js_sdk/gcanvas/context-webgl/GLmethod.js | 142 ++ .../js_sdk/gcanvas/context-webgl/GLtype.js | 23 + .../js_sdk/gcanvas/context-webgl/Program.js | 21 + .../gcanvas/context-webgl/Renderbuffer.js | 21 + .../gcanvas/context-webgl/RenderingContext.js | 1191 +++++++++++++++++ .../js_sdk/gcanvas/context-webgl/Shader.js | 22 + .../context-webgl/ShaderPrecisionFormat.js | 11 + .../js_sdk/gcanvas/context-webgl/Texture.js | 22 + .../gcanvas/context-webgl/UniformLocation.js | 22 + .../gcanvas/context-webgl/classUtils.js | 3 + .../js_sdk/gcanvas/env/canvas.js | 74 + .../js_sdk/gcanvas/env/image.js | 96 ++ .../Sansnn-uQRCode/js_sdk/gcanvas/env/tool.js | 24 + .../Sansnn-uQRCode/js_sdk/gcanvas/index.js | 39 + .../Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js | 34 + uni_modules/Sansnn-uQRCode/package.json | 79 ++ 49 files changed, 6288 insertions(+), 2 deletions(-) create mode 100644 pages/common/agreement.vue create mode 100644 pages/common/privacy.vue create mode 100644 pages/mine/contact.vue create mode 100644 pages/mine/mine.vue delete mode 100644 static/tabbar/cart.png delete mode 100644 static/tabbar/cart_selected.png delete mode 100644 static/tabbar/center.png delete mode 100644 static/tabbar/center_selected.png create mode 100644 static/tabbar/consult.png create mode 100644 static/tabbar/consult_selected.png create mode 100644 static/tabbar/mine.png create mode 100644 static/tabbar/mine_selected.png create mode 100644 uni_modules/Sansnn-uQRCode/LICENSE.md create mode 100644 uni_modules/Sansnn-uQRCode/README.md create mode 100644 uni_modules/Sansnn-uQRCode/changelog.md create mode 100644 uni_modules/Sansnn-uQRCode/common/cache.js create mode 100644 uni_modules/Sansnn-uQRCode/common/queue.js create mode 100644 uni_modules/Sansnn-uQRCode/common/types/cache.d.ts create mode 100644 uni_modules/Sansnn-uQRCode/common/types/queue.d.ts create mode 100644 uni_modules/Sansnn-uQRCode/components/u-qrcode/u-qrcode.vue create mode 100644 uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode.vue create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/bridge/bridge-weex.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStyleLinearGradient.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStylePattern.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStyleRadialGradient.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/RenderingContext.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/ActiveInfo.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Buffer.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Framebuffer.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLenum.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLmethod.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLtype.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Program.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Renderbuffer.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/RenderingContext.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Shader.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/ShaderPrecisionFormat.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Texture.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/UniformLocation.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/classUtils.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/canvas.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/image.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/tool.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/index.js create mode 100644 uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js create mode 100644 uni_modules/Sansnn-uQRCode/package.json diff --git a/pages.json b/pages.json index 10f7eac..a81b95a 100644 --- a/pages.json +++ b/pages.json @@ -97,6 +97,30 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path": "pages/mine/mine", + "style": { + "navigationBarTitleText": "我的" + } + }, + { + "path": "pages/mine/contact", + "style": { + "navigationBarTitleText": "联系客服" + } + }, + { + "path": "pages/common/privacy", + "style": { + "navigationBarTitleText": "隐私政策" + } + }, + { + "path": "pages/common/agreement", + "style": { + "navigationBarTitleText": "用户协议" + } } ], "globalStyle": { @@ -119,9 +143,15 @@ }, { "pagePath": "pages/message/message", - "iconPath": "static/tabbar/cart.png", - "selectedIconPath": "static/tabbar/cart_selected.png", + "iconPath": "static/tabbar/consult.png", + "selectedIconPath": "static/tabbar/consult_selected.png", "text": "咨询" + }, + { + "pagePath": "pages/mine/mine", + "iconPath": "static/tabbar/mine.png", + "selectedIconPath": "static/tabbar/mine_selected.png", + "text": "我的" } ] }, diff --git a/pages/common/agreement.vue b/pages/common/agreement.vue new file mode 100644 index 0000000..5b68f1d --- /dev/null +++ b/pages/common/agreement.vue @@ -0,0 +1,18 @@ + + + + + diff --git a/pages/common/privacy.vue b/pages/common/privacy.vue new file mode 100644 index 0000000..dae1845 --- /dev/null +++ b/pages/common/privacy.vue @@ -0,0 +1,18 @@ + + + + + diff --git a/pages/mine/contact.vue b/pages/mine/contact.vue new file mode 100644 index 0000000..b8ee937 --- /dev/null +++ b/pages/mine/contact.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue new file mode 100644 index 0000000..8a4a6a8 --- /dev/null +++ b/pages/mine/mine.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/static/tabbar/cart.png b/static/tabbar/cart.png deleted file mode 100644 index 94bb532f75538a2c78433c7e5fe3bda1139a8a1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1276 zcmVPx(wn;=mR9HvNm|tjHbri?Xx%Z|^Nt=o?20DBYMQ{%aRxS7bk{YZ;^Pu?9LZL;4 zsxSuAienaWkqHIsUS#?picYG+20ly(DB!j>t7NVNl8EEW&M<8jvOktlu)ElJYbnx-v=*)#A- zL_8iO3D@}#A;jHLHfEbbp|CHROnwajIRNO7>IVR8k|a&5s=5^9gG)!kj zrd{d~V#nMtD3WQKe*pkzx>wdkMEo!eSZ|g^50GC81U3vKkBBFF0Md(Kg#k|@;#V!I z$DaNkL_8M;`~)JN1%P|^lqz_$4I+9a4ER15_|YB#z9h@?L?EzR{J#Z&7kUJEUI;N4 z2+WYCX?_3zZ}kE&BC49E{TK>t7{<6Oi>@*w;$=r~*stStiF{57G2ar{l|{EZ z-Zey=Xj}_IGwcF)yW^c#6lHp3WWGzJ~Y$4*+QmJ$!pU*pO0S9!vGeU@$ItAK}UrP-KbiB47rQ3mQE5mH; z)A6iowfgW*L3raRisIC2H7k?J{OuP%QigS1KNyR}t~UkPt@j;k)^Z%@xZl(%60n=) z3)^@Jck*X^Q!Eyz+dg!Som^Rb7B<1@geu5~h`y*-iJ6Xp-JxMtlBA<9w6v3e-dIGm zF3a)}RaJj&-XpRk8jiZI-=Qc9k4|?DxWB)D-P_&Tt`ZFguE|3~L$47L&v_pNfSW|b zbKW!Uj%E2ED~iGsqAB+u`waljTb8w$%jLM!`L4(rX4rv&fy0s{@x64PCmK&Tf3j`+ znRGh67DXn7LLoUgICvHjc^u}A#U1WgrB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T`;`)4H5Mlt1QNKL~;x5@!8&}r%AMqHJ`YN zaBaIV|Da@#gzR?3@KCUMM3V~;9CRyc7qu#ansx8%TQT*m`5o4|32{iniA6gOu?8V0 zssR4}L1qWnC;Klq1xkAj1qxG@dsH0@fZS)vvAYz0N$5W~(vwd;@v_}F(>K{Ce%F+$ z(zyCQb8jPH0|ncL1m-2Xd$syoxE;^d6hgUB3m!1U2@9XfTvH17MIb5wa<>N(1zK1sUJvfP-pXQEfQN#WLp7bd zW(~yI;m>yoUG*i8**qBCI+#K&%s~26hAl#AtF#D}Q$bU6YM|JI-tp^GeQ%^ecLmrC z%0E$hndT&%Iu|uujD#|hERLePgLq<28{B3oZa;3SthMlkQcwSbJ5M@4#r&D|5t7ft z+>M20RdhNFMZdW+YdE>4>&Ti1OG@unkIUYOq3$;8-YQd_i_dHUZ$^G-DLn0h_NAUg~EK5O13)tkFd2UnASz9Wn zS672QwsyERz$YY|FOy1g0KU-bir1vEh<>y@v-{awVmLQZe2C!lgeZ|%^WCAwO46S*#OQWmu{T)G zuUB#liuj5v9zJ@kZ)Z{o=DfCr( zUsk}UAjtR~&(K{3)l-#Hey*KTbREOi=?Tf^28u?~j*0MI5=D@gMB_qrw$Sndx?Mc? zjjw#1lKD1CQ>NY}z#EGCV!2j*4nMtnqusdw0kTywA4g&DY5)KL07*qoM6N<$f+@Pw A@Bjb+ diff --git a/static/tabbar/center.png b/static/tabbar/center.png deleted file mode 100644 index 8b7da3770824c1fc2bd907302eda4fd182553ce1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1081 zcmV-91jhS`P)Px&^GQTOR9HvtnN4U^R}{z3xpNaCnT$}-P!JSsRt+u!!X$Iwi?gbvJ3*nK5HQ^c zr5_+PV(CB&f?xw8E-HdjSBhlSfe=FEeUNNgXs8RJg_H(d6j}(AMM&N~&XJd495b1B z-n;|~-eu<8|M|T?_v4%!gf2%IhQma31`*E^(T4zVf+dM)4H5r9#Mvl{p1H2O(q*dG z(=n~c^73+Fdwcsb5q*k?9{@m48?9{s_>+hp5Yc_tb^l45Gc|A+h9`;WCjc0gBuB(w z0pRld{QOF#Qn8Y`JF#MimzI`JL{W4H06tEW5CDEb#K}^r^n055BH(JZdZweEUrtTMZjSgUW}K5G|z7FUm0U&q(X^-=Mg0#F#PWxl~64%;G^1OxNr4Zvo(t zG+7+aH{6WlIIJTcVqmV=^7;G~rPOyRuIWu{?R2eHyE`#4u_>la+i}EY<|GkaN5o?Z z6Th_9&eUqP+i77rkJ#a6xN5ap7#JA1iil?bfN!h<0H`>II|^Q_T#YSlZEf8um&q=f5kZ{^CZoeyY4!SXfv~+Y+^scLc6fDr$Uu{5`Gp zaivthwRXqBZq4G4+K8fPHHxDD%H=XQs~yLlzhT__R*X2PBJ~f_bt*48{V%xR;7BII$*4mpybp9YHTXPW6 z91&e}U6(JYx5gX5?5tAiX}4W*w;#%zRcq~xj*hOj-E{HU%9labZBSbN2U_dTTb}|N z4tt*Wky46l-fruJw1BPi*6U7BwKk~@;2;QY0KnH-Wy?tCkul~{vsN?kZvb#AqeNNB ztk)k~4z~lYr6^{y0&A~8{00000NkvXXu0mjf-KzmT diff --git a/static/tabbar/center_selected.png b/static/tabbar/center_selected.png deleted file mode 100644 index 8a1d755cc922a925b65633d52c51c2a15fbedd8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1826 zcmV+-2i^FIP)Px*+(|@1R9Hv7SWRpcWf*?m>28;9|7@iNlA=xUCVJDLiHau;9*ra>Xe7wR#QKv| z+vUdz6gQMelWIteA;Hv(5ar~-6CO04kk|+b2ND8Rz{agzwx!$M&MV*Vd^0;O?KbNi zHksL(?|t6qd)~i~u+D4i3EsX0>?Fd=3_MPRN5LQfHwm}~#(4lgO%2lII!(#X#lm%6 z-9C4;v|%5Z_XF6*M9p?VW`OL{Rc5~C5uK?v>%kh zfx#gTA_jAOZH9+Sv_$*{KS;jJ z#JIRbwD-;+{n2p1kBxJtw7?e#{0v}WN*okt*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B zmeBvlbDBv`;&d&U-I&iN4H+9cCnj=zb@{d00c`4r+qc2xyM4Ot(REARb%DcSa6cLeKqw zI$9P|`>nT2s=Jm|Nv0)#%l%RRz%$0jJVsK3yE^jGSBi2kPk%ROV07*qoM6N<$f``U;bN~PV diff --git a/static/tabbar/consult.png b/static/tabbar/consult.png new file mode 100644 index 0000000000000000000000000000000000000000..f0edf61b63b7c40ec9eba2480688bba3a4144edd GIT binary patch literal 2661 zcmV-r3YztaP)4?DQ!rL>ZlKthnj}6yP)C_2{87q*E|AIoF-u< zq_|QDws*bPPA~$=w3uB(lc+R7qK#WoNK+-PP@sweDJlt8Y?UM!s@mRrC*N6n*LR;@ zzc7ioI%ghd&di)|-ZNLDFZg!@;OD)AZ}i}e9=y(5U_yuJeLi22yQXrnySnPW6*X10 zt{P99)8{z>{{r~`U^T=NzTonC-g4D=_pR_%JtcYEn>-7pjEQWs2>~cZIX8ON7PHx^ zNDC{C!y56kFmyFDErDMOE&|6%!llG?Cy`pCG4GH(%A#RVZ^tTzNdcHrC8A zpvdj@-s!CIw3e{h&5Bx4*lLuw5Ih|`T9Q1AHASlc{I@9ctgFTok~*ZW(H0ihhfVQd z{{An0z8NrJm(r~;6Rkzg32AMVW2f1Oc%+UJWo-w@G1W0DfT*O%Ra3QQfXz3haw7gF zrGFogqLUCC7L!*|bZLLTb!)HEZwdzt7DjlQiuT>6S=POxBf5&{1pE)dDTF#SRf`5a z?e=*#hz%(UIiq<49O|`NA`TGI?cfwr=g^zKRwlcmq`Lsb+tFwkk-&?`UutPN|7tLJ zIi3OGzKF5sYY z)Q3(NTKaNS_ZP4Q7IMJGZF4Sl{Zt~EI4eLVCE#Q)isi#xI8Ube4CY#5HH;-(L+3ZL z5?j`ju*JU0&QnUO$!11IfUb>Iaw56QmZ{IO)aGzg%U^A>DG7#Q0~R+ADo@NuOrvEh zs;lhl1d<0S4Pb1Kv9x4m#YeBOfKJiAHBzQWZyoRzCWPUcPQmc1IWt437-;kPZ6CVz3)s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iln8k^r8>(ZYJB3FFU0Jb-@obL!4FGQM*J?%}+uSk3} zCy-o5k0x!>0FK6p$<)08a57srsq9ILeBpcWGXMYp|Nm5VX}16X00v1!K~w_(!QjZA T#pThc00000NkvXXu0mjfthWNf literal 0 HcmV?d00001 diff --git a/static/tabbar/consult_selected.png b/static/tabbar/consult_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..07f842a1d11388a1a13e7893daf23606f8da82d7 GIT binary patch literal 3296 zcmV<63?K7}P)^o1&wuqib|cfQZxqRmKX%;5@J9|1i=W%o`4{zl%+_95X+XxE>MPw zwgqW5AQ*^HgcwB=1>8`eV4)pmpfey0EnVh)=lJ{I`(CL7v%Jz8ByHyOo_p?D{{M6C z_r2F?&EDdFwh{b)AMmybZkynnyaU^==$m{%qr%&w6YT7~ul>wLPw#g2qTYSZTD0<% zvljMTd*;Gt9+hzTXE;sq`u#^=v*N*{uU>h~QCIX% zZh_BhTsNEGnLq9MLaJLA;4Y5vk9e7mu{Tt$Q6?5iw#v&2XLAn=w_=Y75q6-7Y>wd^ zeb36`>UwQ(!Pl=`zBk94_0uxJGZy#kI_IYDOKTp#itq#6qn)8NCSq213xO0N0nZ{n zVfaL1pYU(^$Yx~^DeRE9BKSjcJn}`4+I@#!w(`P*FMD#=R#~=0P*<|1saZOa!Um=+ z1z4EY2qwcgUOkKAgTW&i4M7SC`D@R$lr5w;^U?@xiba&q{4|U9uKhZfO=^YYmej%D{CdJ5A78CKRUll=pO}F@5u_ z=QEuf@!R3^xd}UryZgY4mw$AuB*#RsbK<TXXU`?!cv%)pw3eE?JhQUE^NohgQK zF0#Q|^b*G&ClSz|cnDy_9|H0Xjw3e?lH|t5xs2|r^YO5B?N}!{D#5en_fCGr)-53a zUfuu>s9-7um~5_22hU$%E4l#UZxR6~#*olnQfvY)@`#t05Oz&dL~^VLXOW^F78Pq1 zRwMT(ZM*gb`^{Z8>Kk@cf`e`T4FJtTjIOJ=6|4>~~c3j>T1XF0|r z1OG1@zTT7^Pt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36Z?y>-=XZ=ptm>Mvkeur`t+6@!79-d!E>Ms1-SD56PrGN?<0{gXs;r$8X?%X#e#y4qA1?jNdi$z0q}x6MQ{Dniza^{VcDp zX>na)#1(!r!sgU#et6%MX(N8Ge7)SG*|s{titpJ>$lQ6Uco-AoirRpCx`*p~TK|OF z9{pW2F8TL7KHEC=oBYurw|2hO3Bu2u&l0AnPlBi1?UIOe*t(j1t$)gguCOaR-tcoa z66LK=Fsg^6ULBYQ+jd@c{frOvcg>jH*ERjlm*-9Ix2-TS8}etX6YQV2d+&4ecVGJK zk2;3^&DRi2TXehC32sren~`iA!Odven<`}61pjB_*h+=o@)P_I00030|7e0y-~a#s e21!IgR09A@y!s`RWNuaf0000 literal 0 HcmV?d00001 diff --git a/static/tabbar/home.png b/static/tabbar/home.png index 7e5e6dfcd6c606cb406e94c324afd10b795a64a1..3a28280c85836a8cf405b1ceb45e5083c581cf04 100644 GIT binary patch literal 2317 zcmV+o3G()dP)R>~PL4{Tdv{faLf}r$+EA?qwT$oVJ13#7I4O`t zNF<_a;=gMbQt`)u#&>S|=K~d=VpWk68Wm{Ow5kYFM6H&@NlN2b;?8&b`kTF7d-v{a z-`RJvTX{9J@4b05^XB*F?c0BfKHj-^*E6`D!8JYu6)(~6#$t7$p2)UPEc&Bx zymKfVi@p|)M?VB>hu;mwx=w}S(Lz!*1!U2105 zEll)NCOsOog2|?Iax2&&-2mA=Bx7hkCS!i~ z>eN%Po%7=;E?SfYu{$FvBvc5reCqvzl1l>45L*E zA=66n5E1ti(KhgMsZl9Pq%-xu-h<`8l#@jPiUX$Hi=-(IM|EJAvYO~`q`6mF*8N$X z`C_u)WMMt4ziMgvK56&G^v{X1;XAi9{^Z2q$i&HkW0S5N?|L~zy|8M?-ozQ}eTClr?Iy=A6 z8t=TjwI{lLcP#exckAlZSg-kZvd`?&iti_)xk-?^rPPC|KJ$@h`-b0eK|x+b6NZsJ z(K~W6*=rg)OZP(IG+1Im0n+s2|EF(`qE?bh0{lTNCd;S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N1di0v;)RJosu$IA><9i)oIkU8ub=EVuma|h%Y-=ZjPx&E=fc|R9HvtnNMibP#nj9zr4^1b;XN^!486m;4bQ^E-&38j7q_s+({3@E}|f) zC^{WP{4){UKtxZ1;$X@^VM4JN(_5^dpF_>w6LL6(WuU zz(7mPKLC)fR4S)qvDj~~`8)%gra1`!_p2&es&*Pbi0HB`%kR8Ey9U-YO%z4(Bmg`{ z#9=28MD&X>cCk<>yjK*(vP{>*6>ut*3WvktI{-h_a_`F;$-;Kp$o83S=23A#7n3$M21OP9I=x8@dI?VmV7@JO| zQtPU!R-D9i44lbijx)v{0l;A=fxDRVrCcsw8yg$@=wyv8u%>CdL!r@t8lH%E+JwR0K{%HdYoTE#7wbRJf|qihV8bty1F`5sZ<^Uz&?+OJuSD2j35YC zB}sbS9H^nNRk=c;&?zFC2Y?|@+5B6)iHI}BVsWuv85_XaZ1yY>Jpq8QfBAfgw7r8! zlC)?=YXF<3sZ~!^)@iFBN1Ai4v;tESAK3AWWEh5uh&SDKdU^<4BBBSf zEYI!$wk}o}W2&1*wbiBB+S(dPBob{qkI7^*GB`N+)kU?dH@?;Sh0c!N+S=M$q*N+d zrSuE{9CO%Swf5cx&iP6wJJl|4uGiw)InSz=pAm7HG4`Ul1^X9&eT6s_jv5dE0000< KMNUMnLSTZa8kC#> diff --git a/static/tabbar/home_selected.png b/static/tabbar/home_selected.png index 667db627e434812ca1538209c99374447fff1232..12be9cba5936c720ebc6635e5455e074f6f1b56e 100644 GIT binary patch literal 3135 zcmV-F48Ze=P)~yIZy?k|jON z%$YOiJkNRNec#)b>^=V9G{OIOfu|LmR`6Zkf$1yyE*I#K@D5ACm7Dt(th#^j(<|>E zSas6_gHNyAJTSmKe($~kzj4z*FZTHL_w-$N-8}=#SFHZ$j7BI{{ATyu&aU3&E7tXY z^Qv|Ik6hi=|Ke3$eg5^k`~1qaeXo9XP2ZDO{Ic(s%kS#F_$#Xi7dFZ>o`2E=S3S7% z;!?)h6 z?XDt}?&Zww9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2VO!kU9mZz&R2?DzQOA z#WI)2eXKW`UIGf~0m4}XB-6Q&MzRj6Q-A{UX7bRVSf_Ye(V_G*oYtGnG3f!~iFI-c zp+?@vy2ey@3XpzHy31sLi8Yn30~A7Zng(AZ>P~-*>2L-4uA#5?NyH;BQResI4(GQ+ zfPB&NSNo;R9ik&;hX6_cji<{1du<7ODA2cl1^*8K0RR76b+`!t000I_L_t&o0O7?b Ut-AkcX8-^I07*qoM6N<$f?jH+v;Y7A literal 0 HcmV?d00001 diff --git a/static/tabbar/mine_selected.png b/static/tabbar/mine_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..9983a0c39efe49f723d05ada8fd1e6c24d51867b GIT binary patch literal 3193 zcmV-<42JWGP)bz$d+&ShP{QZ@=ODrVcYzNocu>IuyaM}Wi?+3`EiZa}^YIH;cg|V3x@*OPRb9{D z@MzbL>mTh(uX&_Pu3ou$=lm6&FVA1zxvcf!&be1Sw5jsLd)gbZAASa%;E#X3X}q5} z@m5IP6M$P41@j_sY5)!mQOc16F}mg$G2KU8j);d4OHWjrnwDI4f7dh&^3R|VT=2-h z$1Ga2<+c#&)-mzxeUwQdqA>)4C(M#5=fF95fsnAUT~B*l404GN;kCI-H{LPtz769B zi|3#ayz#Lulk3V@MRl$rmqr2<3M6QtTF|i|qT`ay3A*P=Fl!6Q+Fk9_x>a-T?wBwb zBnM1z;p#1O#Kq^B{7fcV9|BAP6I{4r%Q!Ek6-@GIs>DPk2aFh#b*3hh<-G9BAp|OBP#-E5h3bi; zqKp9;Lr4zmkB$NNoqOBcWBN<7-voU*wzBXuwDMF3B*DZiDc6%I&y>zsHAyDS&+bSjmcu;jNozQ|CHcW%e$sg9la^bnh43M0tzN8N>(_}wh@LZN0roa zOw>BYsHHFakt#;B>@$W8c@F8zc0_|0H-C0p|1O=v3hDv$m^h(|5mZ*Fl0X&C;yIuBI`fZkT#s$gPeI=ZNd@Nxj4gcO z6ej4UG%X0mD-l8nuup{mYf~!zT5_roNg+@zO`fW_+y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n0h2~G7};Tbi{V?C5mL2Ed}{L$$M@Ab zOg^d}Q|Wum;bqj@7EsN+E!S62KFfNU~HicPqEhNGjnp zaVDT!jDT3*6v&j*J_&J7vN>L_iI1wHOFdN#svLBlidl@d6;^~q3zAA>2=1pXJKGEY z$7o@KNws`Q5^zB^doWmGA@tl(h3x#WpI6_KSD$Py5gnH-wnrhGucgp&Ld-W;&sBZY zBDy4znbEr&vyIpHe+v;jyRE%B38hw6zDZT1GNyzQQdM}9Y9E}-;G?R5#0#Nh?E-Sz zS7ps|8=Cc^;|lt!zd`scq*R&yBpSbc)TQmC`%VuiL@+ItTWdayu6mJbB7C4Jq6!dH zBoPv#WzwAIc>>1;Y)h5rk#VXts=R5nC{$9nt>}E#7w!h=yv1=$)x_Q;a$Qk0?-9QM zm%UowSCV}uc-oEaBWpg)X07Ef8%v1H1+O`n3T95XyPW!+Zdz583%zo%BgZwva3p*Iqa z^#yxZpU^qz3ifru1I@3`3La>Q_cfn`1p8X41J&=qQE)$1=yOl-zW@LL|Nk)wf2RNd f00v1!K~w_( 在`uni-app`中,我们更推荐使用组件方式来生成二维码,组件方式大大提高了页面的可读性以及避开了一些平台容易出问题的地方,当组件无法满足需求的时候,再考虑切换成原生方式。 + +官方文档:[https://uqrcode.cn/doc](https://uqrcode.cn/doc)。 + +github地址:[https://github.com/Sansnn/uQRCode](https://github.com/Sansnn/uQRCode)。 + +npm地址:[https://www.npmjs.com/package/uqrcodejs](https://www.npmjs.com/package/uqrcodejs)。 + +uni-app插件市场地址:[https://ext.dcloud.net.cn/plugin?id=1287](https://ext.dcloud.net.cn/plugin?id=1287)。 + +## 原生方式 + +原生方式仅需要获取`uqrcode.js`文件便可使用。详细配置请移步到:文档 > [原生](https://uqrcode.cn/doc/document/native.html)。 + +### 安装 + +1. 通过`npm`安装,成功后即可使用`import`或`require`进行引用。 +``` bash +# npm安装 +npm install uqrcodejs +# 或者 +npm install @uqrcode/js +``` + +2. 通过项目开源地址获取`uqrcode.js`,下载`uqrcode.js`后,将其复制到您项目指定目录,在页面中引入`uqrcode.js`文件即可开始使用。 + +### 引入 + +- 通过`import`引入。 +``` javascript +// npm安装 +import UQRCode from 'uqrcodejs'; // npm install uqrcodejs +// 或者 +import UQRCode from '@uqrcode/js'; // npm install @uqrcode/js +``` + +- `Node.js`通过`require`引入。 +``` javascript +// npm安装 +const UQRCode = require('uqrcodejs'); // npm install uqrcodejs +// 或者 +const UQRCode = require('@uqrcode/js'); // npm install @uqrcode/js +``` + +- 原生浏览器环境,在js脚本加载时添加到`window`。 +``` html + + +``` + +### 简单用法 + +`uQRCode`基于`Canvas API`封装了一套方法,建议开发者使用`canvas`生成,一键调用,非常方便。以下是示例: + +- HTML示例 + - DOM部分 + ``` html + + ``` + + - JS部分 + ``` javascript + // 获取uQRCode实例 + var qr = new UQRCode(); + // 设置二维码内容 + qr.data = "https://uqrcode.cn/doc"; + // 设置二维码大小,必须与canvas设置的宽高一致 + qr.size = 200; + // 调用制作二维码方法 + qr.make(); + // 获取canvas元素 + var canvas = document.getElementById("qrcode"); + // 获取canvas上下文 + var canvasContext = canvas.getContext("2d"); + // 设置uQRCode实例的canvas上下文 + qr.canvasContext = canvasContext; + // 调用绘制方法将二维码图案绘制到canvas上 + qr.drawCanvas(); + ``` + +- uni-app示例 + - Template部分 + ``` html + + ``` + + - JS部分 + ``` javascript + onReady() { + // 获取uQRCode实例 + var qr = new UQRCode(); + // 设置二维码内容 + qr.data = "https://uqrcode.cn/doc"; + // 设置二维码大小,必须与canvas设置的宽高一致 + qr.size = 200; + // 调用制作二维码方法 + qr.make(); + // 获取canvas上下文 + var canvasContext = uni.createCanvasContext('qrcode', this); // 如果是组件,this必须传入 + // 设置uQRCode实例的canvas上下文 + qr.canvasContext = canvasContext; + // 调用绘制方法将二维码图案绘制到canvas上 + qr.drawCanvas(); + } + ``` + +- 微信小程序,推荐使用Canvas 2D,关于Canvas 2D的使用请参考微信开放文档。 + +### 高级用法 + +考虑到部分平台可能不支持`canvas`,所以`uQRCode`并没有强制要求和`canvas`一起使用,您还可以选择其他方式来生成二维码,例如使用`js`操作`dom`进行绘制或是使用`svg`绘制等。以下是示例: + +- uni-app v-for+view + +```html + + + +``` + +- js操作dom + +``` html + + + + + uQRCode二维码生成 + + +
+ + + + +``` + +- svg +``` html + + + + + uQRCode二维码生成 + + + + + + + +``` + +> 更多用法大家自行探索咯,期待分享哟~ + +### 导出临时文件路径 + +原生方式基于`Canvas`的,请自行参阅各平台`Canvas`的导出方式。以下是部分示例: + +- uni-app +```javascript +// 通过uni.createCanvasContext方式创建绘制上下文的,对应导出API为uni.canvasToTempFilePath +// 调用完ctx.draw()方法后不能第一时间导出,否则会异常,需要有一定的延时 +setTimeout(() => { + uni.canvasToTempFilePath( + { + canvasId: this.canvasId, + fileType: this.fileType, + width: this.canvasWidth, + height: this.canvasHeight, + success: res => { + console.log(res); + }, + fail: err => { + console.log(err); + } + }, + // this // 组件内使用必传当前实例 + ); +}, 300); +``` + +- Canvas2D +```javascript +// 得到base64 +console.log(canvas.toDataURL()); +// 得到buffer +console.log(canvas.toBuffer()); +``` + +### 保存二维码到本地相册 + +必须在导出临时文件路径成功后再执行保存。uni-app通用保存方式(H5除外): +```javascript +uni.saveImageToPhotosAlbum({ + filePath: tempFilePath, + success: res => { + console.log(res); + }, + fail: err => { + console.log(err); + } +}); +``` + +H5可以通过设置``标签`href`属性的方式进行保存: +```javascript +const aEle = document.createElement('a'); +aEle.download = 'uQRCode'; // 设置下载的文件名,默认是'下载' +aEle.href = tempFilePath; +document.body.appendChild(aEle); +aEle.click(); +aEle.remove(); // 下载之后把创建的元素删除 +``` +经过测试,PC端浏览器可以下载,部分安卓自带或第三方浏览器可以下载,安卓微信浏览器不适用,移动端iOS所有浏览器均不适用,差异较大,还是推荐各位导出文件给图片组件显示,然后提示用户通过长按图片进行保存这种方式。 + +## uni-app组件方式 + +### 安装 + +通过uni-app插件市场地址安装:[https://ext.dcloud.net.cn/plugin?id=1287](https://ext.dcloud.net.cn/plugin?id=1287)。详细配置请移步到:文档 > [uni-app组件](https://uqrcode.cn/doc/document/uni-app.html)。 + +### 引入 + +uni-app默认为easycom模式,可直接键入``标签。 + +### 简单用法 + +安装`uqrcode`组件后,在`template`中键入``。设置`ref`属性可使用组件内部方法,`canvas-id`属性为组件内部的canvas组件标识,`value`属性为二维码生成对应内容,`options`为配置选项,可配置二维码样式,绘制Logo等,详见:[options](https://uqrcode.cn/doc/document/uni-app.html#options) 。 + +``` html + +``` + +### 导出临时文件路径 + +为了保证方法调用成功,请在 [complete](https://uqrcode.cn/doc/document/uni-app.html#complete) 事件返回`success=true`后调用。 + +```javascript +// uqrcode为组件的ref名称 +this.$refs.uqrcode.toTempFilePath({ + success: res => { + console.log(res); + } +}); +``` + +### 保存二维码到本地相册 + +为了保证方法调用成功,请在 [complete](https://uqrcode.cn/doc/document/uni-app.html#complete) 事件返回`success=true`后调用。 + +```javascript +// uqrcode为组件的ref名称 +this.$refs.uqrcode.save({ + success: () => { + uni.showToast({ + icon: 'success', + title: '保存成功' + }); + } +}); +``` + +## 更多使用说明请前往官方文档查看:[https://uqrcode.cn/doc](https://uqrcode.cn/doc)。 \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/changelog.md b/uni_modules/Sansnn-uQRCode/changelog.md new file mode 100644 index 0000000..74a6e4c --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/changelog.md @@ -0,0 +1,12 @@ +## 4.0.6(2022-12-12) +修复`getDrawModules`,第一次获取结果正常,后续获取`tile`模块不存在的问题; +修复安卓type:normal因Canvas API使用了小数或为0的参数导致生成异常的问题(注:安卓非2d Canvas部分API参数不支持携带小数,部分API参数必须大于0)。 +## 4.0.1(2022-11-28) +优化组件loading属性的表现; +新增组件type选项normal,以便于在某些条件编译初始为type=2d时还可以选择使用非2d组件类型; +修复组件条件编译在其他编辑器语法提示报错; +修复原生对es5的支持。 +## 4.0.0(2022-11-21) +v4版本源代码全面开放,开源地址:[https://github.com/Sansnn/uQRCode](https://github.com/Sansnn/uQRCode); + +升级说明:v4为大版本更新,虽然已尽可能兼容上一代版本,但不可避免的还是存在一些细节差异,若更新后出现问题,请参考对照[v3 文档](https://uqrcode.cn/doc/v3),[v4 文档](https://uqrcode.cn/doc)进行修改。 diff --git a/uni_modules/Sansnn-uQRCode/common/cache.js b/uni_modules/Sansnn-uQRCode/common/cache.js new file mode 100644 index 0000000..d897d26 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/common/cache.js @@ -0,0 +1 @@ +export const cacheImageList = []; \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/common/queue.js b/uni_modules/Sansnn-uQRCode/common/queue.js new file mode 100644 index 0000000..be6b1d2 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/common/queue.js @@ -0,0 +1,41 @@ +function Queue() { + let waitingQueue = this.waitingQueue = []; + let isRunning = this.isRunning = false; // 记录是否有未完成的任务 + + function execute(task, resolve, reject) { + task() + .then((data) => { + resolve(data); + }) + .catch((e) => { + reject(e); + }) + .finally(() => { + // 等待任务队列中如果有任务,则触发它;否则设置isRunning = false,表示无任务状态 + if (waitingQueue.length) { + const next = waitingQueue.shift(); + execute(next.task, next.resolve, next.reject); + } else { + isRunning = false; + } + }); + } + this.exec = function(task) { + return new Promise((resolve, reject) => { + if (isRunning) { + waitingQueue.push({ + task, + resolve, + reject + }); + } else { + isRunning = true; + execute(task, resolve, reject); + } + }); + } +} + +/* 队列实例,某些平台一起使用多个组件时需要通过队列逐一绘制,否则部分绘制方法异常,nvue端的iOS gcanvas尤其明显,在不通过队列绘制时会出现图片丢失的情况 */ +export const queueDraw = new Queue(); +export const queueLoadImage = new Queue(); \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/common/types/cache.d.ts b/uni_modules/Sansnn-uQRCode/common/types/cache.d.ts new file mode 100644 index 0000000..9b6c3ce --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/common/types/cache.d.ts @@ -0,0 +1,3 @@ +declare module '*/common/cache' { + export const cacheImageList: Array; +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/common/types/queue.d.ts b/uni_modules/Sansnn-uQRCode/common/types/queue.d.ts new file mode 100644 index 0000000..f81ab97 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/common/types/queue.d.ts @@ -0,0 +1,4 @@ +declare module '*/common/queue' { + export const queueDraw: any; + export const queueLoadImage: any; +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/components/u-qrcode/u-qrcode.vue b/uni_modules/Sansnn-uQRCode/components/u-qrcode/u-qrcode.vue new file mode 100644 index 0000000..4fefaac --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/components/u-qrcode/u-qrcode.vue @@ -0,0 +1,1131 @@ + + + + + diff --git a/uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode.vue b/uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode.vue new file mode 100644 index 0000000..4fefaac --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode.vue @@ -0,0 +1,1131 @@ + + + + + diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/bridge/bridge-weex.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/bridge/bridge-weex.js new file mode 100644 index 0000000..27086ec --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/bridge/bridge-weex.js @@ -0,0 +1,241 @@ +const isWeex = typeof WXEnvironment !== 'undefined'; +const isWeexIOS = isWeex && /ios/i.test(WXEnvironment.platform); +const isWeexAndroid = isWeex && !isWeexIOS; + +import GLmethod from '../context-webgl/GLmethod'; + +const GCanvasModule = + (typeof weex !== 'undefined' && weex.requireModule) ? (weex.requireModule('gcanvas')) : + (typeof __weex_require__ !== 'undefined') ? (__weex_require__('@weex-module/gcanvas')) : {}; + +let isDebugging = false; + +let isComboDisabled = false; + +const logCommand = (function () { + const methodQuery = []; + Object.keys(GLmethod).forEach(key => { + methodQuery[GLmethod[key]] = key; + }) + const queryMethod = (id) => { + return methodQuery[parseInt(id)] || 'NotFoundMethod'; + } + const logCommand = (id, cmds) => { + const mId = cmds.split(',')[0]; + const mName = queryMethod(mId); + console.log(`=== callNative - componentId:${id}; method: ${mName}; cmds: ${cmds}`); + } + return logCommand; +})(); + +function joinArray(arr, sep) { + let res = ''; + for (let i = 0; i < arr.length; i++) { + if (i !== 0) { + res += sep; + } + res += arr[i]; + } + return res; +} + +const commandsCache = {} + +const GBridge = { + + callEnable: (ref, configArray) => { + + commandsCache[ref] = []; + + return GCanvasModule.enable({ + componentId: ref, + config: configArray + }); + }, + + callEnableDebug: () => { + isDebugging = true; + }, + + callEnableDisableCombo: () => { + isComboDisabled = true; + }, + + callSetContextType: function (componentId, context_type) { + GCanvasModule.setContextType(context_type, componentId); + }, + + callReset: function(id){ + GCanvasModule.resetComponent && canvasModule.resetComponent(componentId); + }, + + render: isWeexIOS ? function (componentId) { + return GCanvasModule.extendCallNative({ + contextId: componentId, + type: 0x60000001 + }); + } : function (componentId) { + return callGCanvasLinkNative(componentId, 0x60000001, 'render'); + }, + + render2d: isWeexIOS ? function (componentId, commands, callback) { + + if (isDebugging) { + console.log('>>> >>> render2d ==='); + console.log('>>> commands: ' + commands); + } + + GCanvasModule.render([commands, callback?true:false], componentId, callback); + + } : function (componentId, commands,callback) { + + if (isDebugging) { + console.log('>>> >>> render2d ==='); + console.log('>>> commands: ' + commands); + } + + callGCanvasLinkNative(componentId, 0x20000001, commands); + if(callback){ + callback(); + } + }, + + callExtendCallNative: isWeexIOS ? function (componentId, cmdArgs) { + + throw 'should not be here anymore ' + cmdArgs; + + } : function (componentId, cmdArgs) { + + throw 'should not be here anymore ' + cmdArgs; + + }, + + + flushNative: isWeexIOS ? function (componentId) { + + const cmdArgs = joinArray(commandsCache[componentId], ';'); + commandsCache[componentId] = []; + + if (isDebugging) { + console.log('>>> >>> flush native ==='); + console.log('>>> commands: ' + cmdArgs); + } + + const result = GCanvasModule.extendCallNative({ + "contextId": componentId, + "type": 0x60000000, + "args": cmdArgs + }); + + const res = result && result.result; + + if (isDebugging) { + console.log('>>> result: ' + res); + } + + return res; + + } : function (componentId) { + + const cmdArgs = joinArray(commandsCache[componentId], ';'); + commandsCache[componentId] = []; + + if (isDebugging) { + console.log('>>> >>> flush native ==='); + console.log('>>> commands: ' + cmdArgs); + } + + const result = callGCanvasLinkNative(componentId, 0x60000000, cmdArgs); + + if (isDebugging) { + console.log('>>> result: ' + result); + } + + return result; + }, + + callNative: function (componentId, cmdArgs, cache) { + + if (isDebugging) { + logCommand(componentId, cmdArgs); + } + + commandsCache[componentId].push(cmdArgs); + + if (!cache || isComboDisabled) { + return GBridge.flushNative(componentId); + } else { + return undefined; + } + }, + + texImage2D(componentId, ...args) { + if (isWeexIOS) { + if (args.length === 6) { + const [target, level, internalformat, format, type, image] = args; + GBridge.callNative( + componentId, + GLmethod.texImage2D + ',' + 6 + ',' + target + ',' + level + ',' + internalformat + ',' + format + ',' + type + ',' + image.src + ) + } else if (args.length === 9) { + const [target, level, internalformat, width, height, border, format, type, image] = args; + GBridge.callNative( + componentId, + GLmethod.texImage2D + ',' + 9 + ',' + target + ',' + level + ',' + internalformat + ',' + width + ',' + height + ',' + border + ',' + + + format + ',' + type + ',' + (image ? image.src : 0) + ) + } + } else if (isWeexAndroid) { + if (args.length === 6) { + const [target, level, internalformat, format, type, image] = args; + GCanvasModule.texImage2D(componentId, target, level, internalformat, format, type, image.src); + } else if (args.length === 9) { + const [target, level, internalformat, width, height, border, format, type, image] = args; + GCanvasModule.texImage2D(componentId, target, level, internalformat, width, height, border, format, type, (image ? image.src : 0)); + } + } + }, + + texSubImage2D(componentId, target, level, xoffset, yoffset, format, type, image) { + if (isWeexIOS) { + if (arguments.length === 8) { + GBridge.callNative( + componentId, + GLmethod.texSubImage2D + ',' + 6 + ',' + target + ',' + level + ',' + xoffset + ',' + yoffset, + ',' + format + ',' + type + ',' + image.src + ) + } + } else if (isWeexAndroid) { + GCanvasModule.texSubImage2D(componentId, target, level, xoffset, yoffset, format, type, image.src); + } + }, + + bindImageTexture(componentId, src, imageId) { + GCanvasModule.bindImageTexture([src, imageId], componentId); + }, + + perloadImage([url, id], callback) { + GCanvasModule.preLoadImage([url, id], function (image) { + image.url = url; + image.id = id; + callback(image); + }); + }, + + measureText(text, fontStyle, componentId) { + return GCanvasModule.measureText([text, fontStyle], componentId); + }, + + getImageData (componentId, x, y, w, h, callback) { + GCanvasModule.getImageData([x, y,w,h],componentId,callback); + }, + + putImageData (componentId, data, x, y, w, h, callback) { + GCanvasModule.putImageData([x, y,w,h,data],componentId,callback); + }, + + toTempFilePath(componentId, x, y, width, height, destWidth, destHeight, fileType, quality, callback){ + GCanvasModule.toTempFilePath([x, y, width,height, destWidth, destHeight, fileType, quality], componentId, callback); + } +} + +export default GBridge; \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStyleLinearGradient.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStyleLinearGradient.js new file mode 100644 index 0000000..3e7f03a --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStyleLinearGradient.js @@ -0,0 +1,18 @@ +class FillStyleLinearGradient { + + constructor(x0, y0, x1, y1) { + this._start_pos = { _x: x0, _y: y0 }; + this._end_pos = { _x: x1, _y: y1 }; + this._stop_count = 0; + this._stops = [0, 0, 0, 0, 0]; + } + + addColorStop = function (pos, color) { + if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) { + this._stops[this._stop_count] = { _pos: pos, _color: color }; + this._stop_count++; + } + } +} + +export default FillStyleLinearGradient; \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStylePattern.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStylePattern.js new file mode 100644 index 0000000..6e4f646 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStylePattern.js @@ -0,0 +1,8 @@ +class FillStylePattern { + constructor(img, pattern) { + this._style = pattern; + this._img = img; + } +} + +export default FillStylePattern; \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStyleRadialGradient.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStyleRadialGradient.js new file mode 100644 index 0000000..7790596 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/FillStyleRadialGradient.js @@ -0,0 +1,17 @@ +class FillStyleRadialGradient { + constructor(x0, y0, r0, x1, y1, r1) { + this._start_pos = { _x: x0, _y: y0, _r: r0 }; + this._end_pos = { _x: x1, _y: y1, _r: r1 }; + this._stop_count = 0; + this._stops = [0, 0, 0, 0, 0]; + } + + addColorStop(pos, color) { + if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) { + this._stops[this._stop_count] = { _pos: pos, _color: color }; + this._stop_count++; + } + } +} + +export default FillStyleRadialGradient; \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/RenderingContext.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/RenderingContext.js new file mode 100644 index 0000000..e6b8f48 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-2d/RenderingContext.js @@ -0,0 +1,666 @@ +import FillStylePattern from './FillStylePattern'; +import FillStyleLinearGradient from './FillStyleLinearGradient'; +import FillStyleRadialGradient from './FillStyleRadialGradient'; +import GImage from '../env/image.js'; +import { + ArrayBufferToBase64, + Base64ToUint8ClampedArray +} from '../env/tool.js'; + +export default class CanvasRenderingContext2D { + + _drawCommands = ''; + + _globalAlpha = 1.0; + + _fillStyle = 'rgb(0,0,0)'; + _strokeStyle = 'rgb(0,0,0)'; + + _lineWidth = 1; + _lineCap = 'butt'; + _lineJoin = 'miter'; + + _miterLimit = 10; + + _globalCompositeOperation = 'source-over'; + + _textAlign = 'start'; + _textBaseline = 'alphabetic'; + + _font = '10px sans-serif'; + + _savedGlobalAlpha = []; + + timer = null; + componentId = null; + + _notCommitDrawImageCache = []; + _needRedrawImageCache = []; + _redrawCommands = ''; + _autoSaveContext = true; + // _imageMap = new GHashMap(); + // _textureMap = new GHashMap(); + + constructor() { + this.className = 'CanvasRenderingContext2D'; + //this.save() + } + + setFillStyle(value) { + this.fillStyle = value; + } + + set fillStyle(value) { + this._fillStyle = value; + + if (typeof(value) == 'string') { + this._drawCommands = this._drawCommands.concat("F" + value + ";"); + } else if (value instanceof FillStylePattern) { + const image = value._img; + if (!image.complete) { + image.onload = () => { + var index = this._needRedrawImageCache.indexOf(image); + if (index > -1) { + this._needRedrawImageCache.splice(index, 1); + CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id); + this._redrawflush(true); + } + } + this._notCommitDrawImageCache.push(image); + } else { + CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id); + } + + //CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id); + this._drawCommands = this._drawCommands.concat("G" + image._id + "," + value._style + ";"); + } else if (value instanceof FillStyleLinearGradient) { + var command = "D" + value._start_pos._x.toFixed(2) + "," + value._start_pos._y.toFixed(2) + "," + + value._end_pos._x.toFixed(2) + "," + value._end_pos._y.toFixed(2) + "," + + value._stop_count; + for (var i = 0; i < value._stop_count; ++i) { + command += ("," + value._stops[i]._pos + "," + value._stops[i]._color); + } + this._drawCommands = this._drawCommands.concat(command + ";"); + } else if (value instanceof FillStyleRadialGradient) { + var command = "H" + value._start_pos._x.toFixed(2) + "," + value._start_pos._y.toFixed(2) + "," + value._start_pos._r + .toFixed(2) + "," + + value._end_pos._x.toFixed(2) + "," + value._end_pos._y.toFixed(2) + "," + value._end_pos._r.toFixed(2) + "," + + value._stop_count; + for (var i = 0; i < value._stop_count; ++i) { + command += ("," + value._stops[i]._pos + "," + value._stops[i]._color); + } + this._drawCommands = this._drawCommands.concat(command + ";"); + } + } + + get fillStyle() { + return this._fillStyle; + } + + get globalAlpha() { + return this._globalAlpha; + } + + setGlobalAlpha(value) { + this.globalAlpha = value; + } + + set globalAlpha(value) { + this._globalAlpha = value; + this._drawCommands = this._drawCommands.concat("a" + value.toFixed(2) + ";"); + } + + + get strokeStyle() { + return this._strokeStyle; + } + + setStrokeStyle(value) { + this.strokeStyle = value; + } + + set strokeStyle(value) { + + this._strokeStyle = value; + + if (typeof(value) == 'string') { + this._drawCommands = this._drawCommands.concat("S" + value + ";"); + } else if (value instanceof FillStylePattern) { + CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id); + this._drawCommands = this._drawCommands.concat("G" + image._id + "," + value._style + ";"); + } else if (value instanceof FillStyleLinearGradient) { + var command = "D" + value._start_pos._x.toFixed(2) + "," + value._start_pos._y.toFixed(2) + "," + + value._end_pos._x.toFixed(2) + "," + value._end_pos._y.toFixed(2) + "," + + value._stop_count; + + for (var i = 0; i < value._stop_count; ++i) { + command += ("," + value._stops[i]._pos + "," + value._stops[i]._color); + } + this._drawCommands = this._drawCommands.concat(command + ";"); + } else if (value instanceof FillStyleRadialGradient) { + var command = "H" + value._start_pos._x.toFixed(2) + "," + value._start_pos._y.toFixed(2) + "," + value._start_pos._r + .toFixed(2) + "," + + value._end_pos._x.toFixed(2) + "," + value._end_pos._y + ",".toFixed(2) + value._end_pos._r.toFixed(2) + "," + + value._stop_count; + + for (var i = 0; i < value._stop_count; ++i) { + command += ("," + value._stops[i]._pos + "," + value._stops[i]._color); + } + this._drawCommands = this._drawCommands.concat(command + ";"); + } + } + + get lineWidth() { + return this._lineWidth; + } + + setLineWidth(value) { + this.lineWidth = value; + } + + set lineWidth(value) { + this._lineWidth = value; + this._drawCommands = this._drawCommands.concat("W" + value + ";"); + } + + get lineCap() { + return this._lineCap; + } + + setLineCap(value) { + this.lineCap = value; + } + + set lineCap(value) { + this._lineCap = value; + this._drawCommands = this._drawCommands.concat("C" + value + ";"); + } + + get lineJoin() { + return this._lineJoin; + } + + setLineJoin(value) { + this.lineJoin = value + } + + set lineJoin(value) { + this._lineJoin = value; + this._drawCommands = this._drawCommands.concat("J" + value + ";"); + } + + get miterLimit() { + return this._miterLimit; + } + + setMiterLimit(value) { + this.miterLimit = value + } + + set miterLimit(value) { + this._miterLimit = value; + this._drawCommands = this._drawCommands.concat("M" + value + ";"); + } + + get globalCompositeOperation() { + return this._globalCompositeOperation; + } + + set globalCompositeOperation(value) { + + this._globalCompositeOperation = value; + let mode = 0; + switch (value) { + case "source-over": + mode = 0; + break; + case "source-atop": + mode = 5; + break; + case "source-in": + mode = 0; + break; + case "source-out": + mode = 2; + break; + case "destination-over": + mode = 4; + break; + case "destination-atop": + mode = 4; + break; + case "destination-in": + mode = 4; + break; + case "destination-out": + mode = 3; + break; + case "lighter": + mode = 1; + break; + case "copy": + mode = 2; + break; + case "xor": + mode = 6; + break; + default: + mode = 0; + } + + this._drawCommands = this._drawCommands.concat("B" + mode + ";"); + } + + get textAlign() { + return this._textAlign; + } + + setTextAlign(value) { + this.textAlign = value + } + + set textAlign(value) { + + this._textAlign = value; + let Align = 0; + switch (value) { + case "start": + Align = 0; + break; + case "end": + Align = 1; + break; + case "left": + Align = 2; + break; + case "center": + Align = 3; + break; + case "right": + Align = 4; + break; + default: + Align = 0; + } + + this._drawCommands = this._drawCommands.concat("A" + Align + ";"); + } + + get textBaseline() { + return this._textBaseline; + } + + setTextBaseline(value) { + this.textBaseline = value + } + + set textBaseline(value) { + this._textBaseline = value; + let baseline = 0; + switch (value) { + case "alphabetic": + baseline = 0; + break; + case "middle": + baseline = 1; + break; + case "top": + baseline = 2; + break; + case "hanging": + baseline = 3; + break; + case "bottom": + baseline = 4; + break; + case "ideographic": + baseline = 5; + break; + default: + baseline = 0; + break; + } + + this._drawCommands = this._drawCommands.concat("E" + baseline + ";"); + } + + get font() { + return this._font; + } + + setFontSize(size) { + var str = this._font; + var strs = str.trim().split(/\s+/); + for (var i = 0; i < strs.length; i++) { + var values = ["normal", "italic", "oblique", "normal", "small-caps", "normal", "bold", + "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", + "normal", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", + "semi-expanded", "expanded", "extra-expanded", "ultra-expanded" + ]; + + if (-1 == values.indexOf(strs[i].trim())) { + if (typeof size === 'string') { + strs[i] = size; + } else if (typeof size === 'number') { + strs[i] = String(size) + 'px'; + } + break; + } + } + this.font = strs.join(" "); + } + + set font(value) { + this._font = value; + this._drawCommands = this._drawCommands.concat("j" + value + ";"); + } + + setTransform(a, b, c, d, tx, ty) { + this._drawCommands = this._drawCommands.concat("t" + + (a === 1 ? "1" : a.toFixed(2)) + "," + + (b === 0 ? "0" : b.toFixed(2)) + "," + + (c === 0 ? "0" : c.toFixed(2)) + "," + + (d === 1 ? "1" : d.toFixed(2)) + "," + tx.toFixed(2) + "," + ty.toFixed(2) + ";"); + } + + transform(a, b, c, d, tx, ty) { + this._drawCommands = this._drawCommands.concat("f" + + (a === 1 ? "1" : a.toFixed(2)) + "," + + (b === 0 ? "0" : b.toFixed(2)) + "," + + (c === 0 ? "0" : c.toFixed(2)) + "," + + (d === 1 ? "1" : d.toFixed(2)) + "," + tx + "," + ty + ";"); + } + + resetTransform() { + this._drawCommands = this._drawCommands.concat("m;"); + } + + scale(a, d) { + this._drawCommands = this._drawCommands.concat("k" + a.toFixed(2) + "," + + d.toFixed(2) + ";"); + } + + rotate(angle) { + this._drawCommands = this._drawCommands + .concat("r" + angle.toFixed(6) + ";"); + } + + translate(tx, ty) { + this._drawCommands = this._drawCommands.concat("l" + tx.toFixed(2) + "," + ty.toFixed(2) + ";"); + } + + save() { + this._savedGlobalAlpha.push(this._globalAlpha); + this._drawCommands = this._drawCommands.concat("v;"); + } + + restore() { + this._drawCommands = this._drawCommands.concat("e;"); + this._globalAlpha = this._savedGlobalAlpha.pop(); + } + + createPattern(img, pattern) { + if (typeof img === 'string') { + var imgObj = new GImage(); + imgObj.src = img; + img = imgObj; + } + return new FillStylePattern(img, pattern); + } + + createLinearGradient(x0, y0, x1, y1) { + return new FillStyleLinearGradient(x0, y0, x1, y1); + } + + createRadialGradient = function(x0, y0, r0, x1, y1, r1) { + return new FillStyleRadialGradient(x0, y0, r0, x1, y1, r1); + }; + + createCircularGradient = function(x0, y0, r0) { + return new FillStyleRadialGradient(x0, y0, 0, x0, y0, r0); + }; + + strokeRect(x, y, w, h) { + this._drawCommands = this._drawCommands.concat("s" + x + "," + y + "," + w + "," + h + ";"); + } + + + clearRect(x, y, w, h) { + this._drawCommands = this._drawCommands.concat("c" + x + "," + y + "," + w + + "," + h + ";"); + } + + clip() { + this._drawCommands = this._drawCommands.concat("p;"); + } + + resetClip() { + this._drawCommands = this._drawCommands.concat("q;"); + } + + closePath() { + this._drawCommands = this._drawCommands.concat("o;"); + } + + moveTo(x, y) { + this._drawCommands = this._drawCommands.concat("g" + x.toFixed(2) + "," + y.toFixed(2) + ";"); + } + + lineTo(x, y) { + this._drawCommands = this._drawCommands.concat("i" + x.toFixed(2) + "," + y.toFixed(2) + ";"); + } + + quadraticCurveTo = function(cpx, cpy, x, y) { + this._drawCommands = this._drawCommands.concat("u" + cpx + "," + cpy + "," + x + "," + y + ";"); + } + + bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, ) { + this._drawCommands = this._drawCommands.concat( + "z" + cp1x.toFixed(2) + "," + cp1y.toFixed(2) + "," + cp2x.toFixed(2) + "," + cp2y.toFixed(2) + "," + + x.toFixed(2) + "," + y.toFixed(2) + ";"); + } + + arcTo(x1, y1, x2, y2, radius) { + this._drawCommands = this._drawCommands.concat("h" + x1 + "," + y1 + "," + x2 + "," + y2 + "," + radius + ";"); + } + + beginPath() { + this._drawCommands = this._drawCommands.concat("b;"); + } + + + fillRect(x, y, w, h) { + this._drawCommands = this._drawCommands.concat("n" + x + "," + y + "," + w + + "," + h + ";"); + } + + rect(x, y, w, h) { + this._drawCommands = this._drawCommands.concat("w" + x + "," + y + "," + w + "," + h + ";"); + } + + fill() { + this._drawCommands = this._drawCommands.concat("L;"); + } + + stroke(path) { + this._drawCommands = this._drawCommands.concat("x;"); + } + + arc(x, y, radius, startAngle, endAngle, anticlockwise) { + + let ianticlockwise = 0; + if (anticlockwise) { + ianticlockwise = 1; + } + + this._drawCommands = this._drawCommands.concat( + "y" + x.toFixed(2) + "," + y.toFixed(2) + "," + + radius.toFixed(2) + "," + startAngle + "," + endAngle + "," + ianticlockwise + + ";" + ); + } + + fillText(text, x, y) { + let tmptext = text.replace(/!/g, "!!"); + tmptext = tmptext.replace(/,/g, "!,"); + tmptext = tmptext.replace(/;/g, "!;"); + this._drawCommands = this._drawCommands.concat("T" + tmptext + "," + x + "," + y + ",0.0;"); + } + + strokeText = function(text, x, y) { + let tmptext = text.replace(/!/g, "!!"); + tmptext = tmptext.replace(/,/g, "!,"); + tmptext = tmptext.replace(/;/g, "!;"); + this._drawCommands = this._drawCommands.concat("U" + tmptext + "," + x + "," + y + ",0.0;"); + } + + measureText(text) { + return CanvasRenderingContext2D.GBridge.measureText(text, this.font, this.componentId); + } + + isPointInPath = function(x, y) { + throw new Error('GCanvas not supported yet'); + } + + drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh) { + if (typeof image === 'string') { + var imgObj = new GImage(); + imgObj.src = image; + image = imgObj; + } + if (image instanceof GImage) { + if (!image.complete) { + imgObj.onload = () => { + var index = this._needRedrawImageCache.indexOf(image); + if (index > -1) { + this._needRedrawImageCache.splice(index, 1); + CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id); + this._redrawflush(true); + } + } + this._notCommitDrawImageCache.push(image); + } else { + CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id); + } + var srcArgs = [image, sx, sy, sw, sh, dx, dy, dw, dh]; + var args = []; + for (var arg in srcArgs) { + if (typeof(srcArgs[arg]) != 'undefined') { + args.push(srcArgs[arg]); + } + } + this.__drawImage.apply(this, args); + //this.__drawImage(image,sx, sy, sw, sh, dx, dy, dw, dh); + } + } + + __drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh) { + const numArgs = arguments.length; + + function drawImageCommands() { + + if (numArgs === 3) { + const x = parseFloat(sx) || 0.0; + const y = parseFloat(sy) || 0.0; + + return ("d" + image._id + ",0,0," + + image.width + "," + image.height + "," + + x + "," + y + "," + image.width + "," + image.height + ";"); + } else if (numArgs === 5) { + const x = parseFloat(sx) || 0.0; + const y = parseFloat(sy) || 0.0; + const width = parseInt(sw) || image.width; + const height = parseInt(sh) || image.height; + + return ("d" + image._id + ",0,0," + + image.width + "," + image.height + "," + + x + "," + y + "," + width + "," + height + ";"); + } else if (numArgs === 9) { + sx = parseFloat(sx) || 0.0; + sy = parseFloat(sy) || 0.0; + sw = parseInt(sw) || image.width; + sh = parseInt(sh) || image.height; + dx = parseFloat(dx) || 0.0; + dy = parseFloat(dy) || 0.0; + dw = parseInt(dw) || image.width; + dh = parseInt(dh) || image.height; + + return ("d" + image._id + "," + + sx + "," + sy + "," + sw + "," + sh + "," + + dx + "," + dy + "," + dw + "," + dh + ";"); + } + } + this._drawCommands += drawImageCommands(); + } + + _flush(reserve, callback) { + const commands = this._drawCommands; + this._drawCommands = ''; + CanvasRenderingContext2D.GBridge.render2d(this.componentId, commands, callback); + this._needRender = false; + } + + _redrawflush(reserve, callback) { + const commands = this._redrawCommands; + CanvasRenderingContext2D.GBridge.render2d(this.componentId, commands, callback); + if (this._needRedrawImageCache.length == 0) { + this._redrawCommands = ''; + } + } + + draw(reserve, callback) { + if (!reserve) { + this._globalAlpha = this._savedGlobalAlpha.pop(); + this._savedGlobalAlpha.push(this._globalAlpha); + this._redrawCommands = this._drawCommands; + this._needRedrawImageCache = this._notCommitDrawImageCache; + if (this._autoSaveContext) { + this._drawCommands = ("v;" + this._drawCommands); + this._autoSaveContext = false; + } else { + this._drawCommands = ("e;X;v;" + this._drawCommands); + } + } else { + this._needRedrawImageCache = this._needRedrawImageCache.concat(this._notCommitDrawImageCache); + this._redrawCommands += this._drawCommands; + if (this._autoSaveContext) { + this._drawCommands = ("v;" + this._drawCommands); + this._autoSaveContext = false; + } + } + this._notCommitDrawImageCache = []; + if (this._flush) { + this._flush(reserve, callback); + } + } + + getImageData(x, y, w, h, callback) { + CanvasRenderingContext2D.GBridge.getImageData(this.componentId, x, y, w, h, function(res) { + res.data = Base64ToUint8ClampedArray(res.data); + if (typeof(callback) == 'function') { + callback(res); + } + }); + } + + putImageData(data, x, y, w, h, callback) { + if (data instanceof Uint8ClampedArray) { + data = ArrayBufferToBase64(data); + CanvasRenderingContext2D.GBridge.putImageData(this.componentId, data, x, y, w, h, function(res) { + if (typeof(callback) == 'function') { + callback(res); + } + }); + } + } + + toTempFilePath(x, y, width, height, destWidth, destHeight, fileType, quality, callback) { + CanvasRenderingContext2D.GBridge.toTempFilePath(this.componentId, x, y, width, height, destWidth, destHeight, + fileType, quality, + function(res) { + if (typeof(callback) == 'function') { + callback(res); + } + }); + } +} diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/ActiveInfo.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/ActiveInfo.js new file mode 100644 index 0000000..b495129 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/ActiveInfo.js @@ -0,0 +1,11 @@ +export default class WebGLActiveInfo { + className = 'WebGLActiveInfo'; + + constructor({ + type, name, size + }) { + this.type = type; + this.name = name; + this.size = size; + } +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Buffer.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Buffer.js new file mode 100644 index 0000000..4800f67 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Buffer.js @@ -0,0 +1,21 @@ +import {getTransferedObjectUUID} from './classUtils'; + +const name = 'WebGLBuffer'; + +function uuid(id) { + return getTransferedObjectUUID(name, id); +} + +export default class WebGLBuffer { + className = name; + + constructor(id) { + this.id = id; + } + + static uuid = uuid; + + uuid() { + return uuid(this.id); + } +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Framebuffer.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Framebuffer.js new file mode 100644 index 0000000..28b46d3 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Framebuffer.js @@ -0,0 +1,21 @@ +import {getTransferedObjectUUID} from './classUtils'; + +const name = 'WebGLFrameBuffer'; + +function uuid(id) { + return getTransferedObjectUUID(name, id); +} + +export default class WebGLFramebuffer { + className = name; + + constructor(id) { + this.id = id; + } + + static uuid = uuid; + + uuid() { + return uuid(this.id); + } +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLenum.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLenum.js new file mode 100644 index 0000000..ac5544d --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLenum.js @@ -0,0 +1,298 @@ +export default { + "DEPTH_BUFFER_BIT": 256, + "STENCIL_BUFFER_BIT": 1024, + "COLOR_BUFFER_BIT": 16384, + "POINTS": 0, + "LINES": 1, + "LINE_LOOP": 2, + "LINE_STRIP": 3, + "TRIANGLES": 4, + "TRIANGLE_STRIP": 5, + "TRIANGLE_FAN": 6, + "ZERO": 0, + "ONE": 1, + "SRC_COLOR": 768, + "ONE_MINUS_SRC_COLOR": 769, + "SRC_ALPHA": 770, + "ONE_MINUS_SRC_ALPHA": 771, + "DST_ALPHA": 772, + "ONE_MINUS_DST_ALPHA": 773, + "DST_COLOR": 774, + "ONE_MINUS_DST_COLOR": 775, + "SRC_ALPHA_SATURATE": 776, + "FUNC_ADD": 32774, + "BLEND_EQUATION": 32777, + "BLEND_EQUATION_RGB": 32777, + "BLEND_EQUATION_ALPHA": 34877, + "FUNC_SUBTRACT": 32778, + "FUNC_REVERSE_SUBTRACT": 32779, + "BLEND_DST_RGB": 32968, + "BLEND_SRC_RGB": 32969, + "BLEND_DST_ALPHA": 32970, + "BLEND_SRC_ALPHA": 32971, + "CONSTANT_COLOR": 32769, + "ONE_MINUS_CONSTANT_COLOR": 32770, + "CONSTANT_ALPHA": 32771, + "ONE_MINUS_CONSTANT_ALPHA": 32772, + "BLEND_COLOR": 32773, + "ARRAY_BUFFER": 34962, + "ELEMENT_ARRAY_BUFFER": 34963, + "ARRAY_BUFFER_BINDING": 34964, + "ELEMENT_ARRAY_BUFFER_BINDING": 34965, + "STREAM_DRAW": 35040, + "STATIC_DRAW": 35044, + "DYNAMIC_DRAW": 35048, + "BUFFER_SIZE": 34660, + "BUFFER_USAGE": 34661, + "CURRENT_VERTEX_ATTRIB": 34342, + "FRONT": 1028, + "BACK": 1029, + "FRONT_AND_BACK": 1032, + "TEXTURE_2D": 3553, + "CULL_FACE": 2884, + "BLEND": 3042, + "DITHER": 3024, + "STENCIL_TEST": 2960, + "DEPTH_TEST": 2929, + "SCISSOR_TEST": 3089, + "POLYGON_OFFSET_FILL": 32823, + "SAMPLE_ALPHA_TO_COVERAGE": 32926, + "SAMPLE_COVERAGE": 32928, + "NO_ERROR": 0, + "INVALID_ENUM": 1280, + "INVALID_VALUE": 1281, + "INVALID_OPERATION": 1282, + "OUT_OF_MEMORY": 1285, + "CW": 2304, + "CCW": 2305, + "LINE_WIDTH": 2849, + "ALIASED_POINT_SIZE_RANGE": 33901, + "ALIASED_LINE_WIDTH_RANGE": 33902, + "CULL_FACE_MODE": 2885, + "FRONT_FACE": 2886, + "DEPTH_RANGE": 2928, + "DEPTH_WRITEMASK": 2930, + "DEPTH_CLEAR_VALUE": 2931, + "DEPTH_FUNC": 2932, + "STENCIL_CLEAR_VALUE": 2961, + "STENCIL_FUNC": 2962, + "STENCIL_FAIL": 2964, + "STENCIL_PASS_DEPTH_FAIL": 2965, + "STENCIL_PASS_DEPTH_PASS": 2966, + "STENCIL_REF": 2967, + "STENCIL_VALUE_MASK": 2963, + "STENCIL_WRITEMASK": 2968, + "STENCIL_BACK_FUNC": 34816, + "STENCIL_BACK_FAIL": 34817, + "STENCIL_BACK_PASS_DEPTH_FAIL": 34818, + "STENCIL_BACK_PASS_DEPTH_PASS": 34819, + "STENCIL_BACK_REF": 36003, + "STENCIL_BACK_VALUE_MASK": 36004, + "STENCIL_BACK_WRITEMASK": 36005, + "VIEWPORT": 2978, + "SCISSOR_BOX": 3088, + "COLOR_CLEAR_VALUE": 3106, + "COLOR_WRITEMASK": 3107, + "UNPACK_ALIGNMENT": 3317, + "PACK_ALIGNMENT": 3333, + "MAX_TEXTURE_SIZE": 3379, + "MAX_VIEWPORT_DIMS": 3386, + "SUBPIXEL_BITS": 3408, + "RED_BITS": 3410, + "GREEN_BITS": 3411, + "BLUE_BITS": 3412, + "ALPHA_BITS": 3413, + "DEPTH_BITS": 3414, + "STENCIL_BITS": 3415, + "POLYGON_OFFSET_UNITS": 10752, + "POLYGON_OFFSET_FACTOR": 32824, + "TEXTURE_BINDING_2D": 32873, + "SAMPLE_BUFFERS": 32936, + "SAMPLES": 32937, + "SAMPLE_COVERAGE_VALUE": 32938, + "SAMPLE_COVERAGE_INVERT": 32939, + "COMPRESSED_TEXTURE_FORMATS": 34467, + "DONT_CARE": 4352, + "FASTEST": 4353, + "NICEST": 4354, + "GENERATE_MIPMAP_HINT": 33170, + "BYTE": 5120, + "UNSIGNED_BYTE": 5121, + "SHORT": 5122, + "UNSIGNED_SHORT": 5123, + "INT": 5124, + "UNSIGNED_INT": 5125, + "FLOAT": 5126, + "DEPTH_COMPONENT": 6402, + "ALPHA": 6406, + "RGB": 6407, + "RGBA": 6408, + "LUMINANCE": 6409, + "LUMINANCE_ALPHA": 6410, + "UNSIGNED_SHORT_4_4_4_4": 32819, + "UNSIGNED_SHORT_5_5_5_1": 32820, + "UNSIGNED_SHORT_5_6_5": 33635, + "FRAGMENT_SHADER": 35632, + "VERTEX_SHADER": 35633, + "MAX_VERTEX_ATTRIBS": 34921, + "MAX_VERTEX_UNIFORM_VECTORS": 36347, + "MAX_VARYING_VECTORS": 36348, + "MAX_COMBINED_TEXTURE_IMAGE_UNITS": 35661, + "MAX_VERTEX_TEXTURE_IMAGE_UNITS": 35660, + "MAX_TEXTURE_IMAGE_UNITS": 34930, + "MAX_FRAGMENT_UNIFORM_VECTORS": 36349, + "SHADER_TYPE": 35663, + "DELETE_STATUS": 35712, + "LINK_STATUS": 35714, + "VALIDATE_STATUS": 35715, + "ATTACHED_SHADERS": 35717, + "ACTIVE_UNIFORMS": 35718, + "ACTIVE_ATTRIBUTES": 35721, + "SHADING_LANGUAGE_VERSION": 35724, + "CURRENT_PROGRAM": 35725, + "NEVER": 512, + "LESS": 513, + "EQUAL": 514, + "LEQUAL": 515, + "GREATER": 516, + "NOTEQUAL": 517, + "GEQUAL": 518, + "ALWAYS": 519, + "KEEP": 7680, + "REPLACE": 7681, + "INCR": 7682, + "DECR": 7683, + "INVERT": 5386, + "INCR_WRAP": 34055, + "DECR_WRAP": 34056, + "VENDOR": 7936, + "RENDERER": 7937, + "VERSION": 7938, + "NEAREST": 9728, + "LINEAR": 9729, + "NEAREST_MIPMAP_NEAREST": 9984, + "LINEAR_MIPMAP_NEAREST": 9985, + "NEAREST_MIPMAP_LINEAR": 9986, + "LINEAR_MIPMAP_LINEAR": 9987, + "TEXTURE_MAG_FILTER": 10240, + "TEXTURE_MIN_FILTER": 10241, + "TEXTURE_WRAP_S": 10242, + "TEXTURE_WRAP_T": 10243, + "TEXTURE": 5890, + "TEXTURE_CUBE_MAP": 34067, + "TEXTURE_BINDING_CUBE_MAP": 34068, + "TEXTURE_CUBE_MAP_POSITIVE_X": 34069, + "TEXTURE_CUBE_MAP_NEGATIVE_X": 34070, + "TEXTURE_CUBE_MAP_POSITIVE_Y": 34071, + "TEXTURE_CUBE_MAP_NEGATIVE_Y": 34072, + "TEXTURE_CUBE_MAP_POSITIVE_Z": 34073, + "TEXTURE_CUBE_MAP_NEGATIVE_Z": 34074, + "MAX_CUBE_MAP_TEXTURE_SIZE": 34076, + "TEXTURE0": 33984, + "TEXTURE1": 33985, + "TEXTURE2": 33986, + "TEXTURE3": 33987, + "TEXTURE4": 33988, + "TEXTURE5": 33989, + "TEXTURE6": 33990, + "TEXTURE7": 33991, + "TEXTURE8": 33992, + "TEXTURE9": 33993, + "TEXTURE10": 33994, + "TEXTURE11": 33995, + "TEXTURE12": 33996, + "TEXTURE13": 33997, + "TEXTURE14": 33998, + "TEXTURE15": 33999, + "TEXTURE16": 34000, + "TEXTURE17": 34001, + "TEXTURE18": 34002, + "TEXTURE19": 34003, + "TEXTURE20": 34004, + "TEXTURE21": 34005, + "TEXTURE22": 34006, + "TEXTURE23": 34007, + "TEXTURE24": 34008, + "TEXTURE25": 34009, + "TEXTURE26": 34010, + "TEXTURE27": 34011, + "TEXTURE28": 34012, + "TEXTURE29": 34013, + "TEXTURE30": 34014, + "TEXTURE31": 34015, + "ACTIVE_TEXTURE": 34016, + "REPEAT": 10497, + "CLAMP_TO_EDGE": 33071, + "MIRRORED_REPEAT": 33648, + "FLOAT_VEC2": 35664, + "FLOAT_VEC3": 35665, + "FLOAT_VEC4": 35666, + "INT_VEC2": 35667, + "INT_VEC3": 35668, + "INT_VEC4": 35669, + "BOOL": 35670, + "BOOL_VEC2": 35671, + "BOOL_VEC3": 35672, + "BOOL_VEC4": 35673, + "FLOAT_MAT2": 35674, + "FLOAT_MAT3": 35675, + "FLOAT_MAT4": 35676, + "SAMPLER_2D": 35678, + "SAMPLER_CUBE": 35680, + "VERTEX_ATTRIB_ARRAY_ENABLED": 34338, + "VERTEX_ATTRIB_ARRAY_SIZE": 34339, + "VERTEX_ATTRIB_ARRAY_STRIDE": 34340, + "VERTEX_ATTRIB_ARRAY_TYPE": 34341, + "VERTEX_ATTRIB_ARRAY_NORMALIZED": 34922, + "VERTEX_ATTRIB_ARRAY_POINTER": 34373, + "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING": 34975, + "IMPLEMENTATION_COLOR_READ_TYPE": 35738, + "IMPLEMENTATION_COLOR_READ_FORMAT": 35739, + "COMPILE_STATUS": 35713, + "LOW_FLOAT": 36336, + "MEDIUM_FLOAT": 36337, + "HIGH_FLOAT": 36338, + "LOW_INT": 36339, + "MEDIUM_INT": 36340, + "HIGH_INT": 36341, + "FRAMEBUFFER": 36160, + "RENDERBUFFER": 36161, + "RGBA4": 32854, + "RGB5_A1": 32855, + "RGB565": 36194, + "DEPTH_COMPONENT16": 33189, + "STENCIL_INDEX8": 36168, + "DEPTH_STENCIL": 34041, + "RENDERBUFFER_WIDTH": 36162, + "RENDERBUFFER_HEIGHT": 36163, + "RENDERBUFFER_INTERNAL_FORMAT": 36164, + "RENDERBUFFER_RED_SIZE": 36176, + "RENDERBUFFER_GREEN_SIZE": 36177, + "RENDERBUFFER_BLUE_SIZE": 36178, + "RENDERBUFFER_ALPHA_SIZE": 36179, + "RENDERBUFFER_DEPTH_SIZE": 36180, + "RENDERBUFFER_STENCIL_SIZE": 36181, + "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE": 36048, + "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME": 36049, + "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL": 36050, + "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE": 36051, + "COLOR_ATTACHMENT0": 36064, + "DEPTH_ATTACHMENT": 36096, + "STENCIL_ATTACHMENT": 36128, + "DEPTH_STENCIL_ATTACHMENT": 33306, + "NONE": 0, + "FRAMEBUFFER_COMPLETE": 36053, + "FRAMEBUFFER_INCOMPLETE_ATTACHMENT": 36054, + "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT": 36055, + "FRAMEBUFFER_INCOMPLETE_DIMENSIONS": 36057, + "FRAMEBUFFER_UNSUPPORTED": 36061, + "FRAMEBUFFER_BINDING": 36006, + "RENDERBUFFER_BINDING": 36007, + "MAX_RENDERBUFFER_SIZE": 34024, + "INVALID_FRAMEBUFFER_OPERATION": 1286, + "UNPACK_FLIP_Y_WEBGL": 37440, + "UNPACK_PREMULTIPLY_ALPHA_WEBGL": 37441, + "CONTEXT_LOST_WEBGL": 37442, + "UNPACK_COLORSPACE_CONVERSION_WEBGL": 37443, + "BROWSER_DEFAULT_WEBGL": 37444 +}; \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLmethod.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLmethod.js new file mode 100644 index 0000000..f2659be --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLmethod.js @@ -0,0 +1,142 @@ +let i = 1; + +const GLmethod = {}; + +GLmethod.activeTexture = i++; //1 +GLmethod.attachShader = i++; +GLmethod.bindAttribLocation = i++; +GLmethod.bindBuffer = i++; +GLmethod.bindFramebuffer = i++; +GLmethod.bindRenderbuffer = i++; +GLmethod.bindTexture = i++; +GLmethod.blendColor = i++; +GLmethod.blendEquation = i++; +GLmethod.blendEquationSeparate = i++; //10 +GLmethod.blendFunc = i++; +GLmethod.blendFuncSeparate = i++; +GLmethod.bufferData = i++; +GLmethod.bufferSubData = i++; +GLmethod.checkFramebufferStatus = i++; +GLmethod.clear = i++; +GLmethod.clearColor = i++; +GLmethod.clearDepth = i++; +GLmethod.clearStencil = i++; +GLmethod.colorMask = i++; //20 +GLmethod.compileShader = i++; +GLmethod.compressedTexImage2D = i++; +GLmethod.compressedTexSubImage2D = i++; +GLmethod.copyTexImage2D = i++; +GLmethod.copyTexSubImage2D = i++; +GLmethod.createBuffer = i++; +GLmethod.createFramebuffer = i++; +GLmethod.createProgram = i++; +GLmethod.createRenderbuffer = i++; +GLmethod.createShader = i++; //30 +GLmethod.createTexture = i++; +GLmethod.cullFace = i++; +GLmethod.deleteBuffer = i++; +GLmethod.deleteFramebuffer = i++; +GLmethod.deleteProgram = i++; +GLmethod.deleteRenderbuffer = i++; +GLmethod.deleteShader = i++; +GLmethod.deleteTexture = i++; +GLmethod.depthFunc = i++; +GLmethod.depthMask = i++; //40 +GLmethod.depthRange = i++; +GLmethod.detachShader = i++; +GLmethod.disable = i++; +GLmethod.disableVertexAttribArray = i++; +GLmethod.drawArrays = i++; +GLmethod.drawArraysInstancedANGLE = i++; +GLmethod.drawElements = i++; +GLmethod.drawElementsInstancedANGLE = i++; +GLmethod.enable = i++; +GLmethod.enableVertexAttribArray = i++; //50 +GLmethod.flush = i++; +GLmethod.framebufferRenderbuffer = i++; +GLmethod.framebufferTexture2D = i++; +GLmethod.frontFace = i++; +GLmethod.generateMipmap = i++; +GLmethod.getActiveAttrib = i++; +GLmethod.getActiveUniform = i++; +GLmethod.getAttachedShaders = i++; +GLmethod.getAttribLocation = i++; +GLmethod.getBufferParameter = i++; //60 +GLmethod.getContextAttributes = i++; +GLmethod.getError = i++; +GLmethod.getExtension = i++; +GLmethod.getFramebufferAttachmentParameter = i++; +GLmethod.getParameter = i++; +GLmethod.getProgramInfoLog = i++; +GLmethod.getProgramParameter = i++; +GLmethod.getRenderbufferParameter = i++; +GLmethod.getShaderInfoLog = i++; +GLmethod.getShaderParameter = i++; //70 +GLmethod.getShaderPrecisionFormat = i++; +GLmethod.getShaderSource = i++; +GLmethod.getSupportedExtensions = i++; +GLmethod.getTexParameter = i++; +GLmethod.getUniform = i++; +GLmethod.getUniformLocation = i++; +GLmethod.getVertexAttrib = i++; +GLmethod.getVertexAttribOffset = i++; +GLmethod.isBuffer = i++; +GLmethod.isContextLost = i++; //80 +GLmethod.isEnabled = i++; +GLmethod.isFramebuffer = i++; +GLmethod.isProgram = i++; +GLmethod.isRenderbuffer = i++; +GLmethod.isShader = i++; +GLmethod.isTexture = i++; +GLmethod.lineWidth = i++; +GLmethod.linkProgram = i++; +GLmethod.pixelStorei = i++; +GLmethod.polygonOffset = i++; //90 +GLmethod.readPixels = i++; +GLmethod.renderbufferStorage = i++; +GLmethod.sampleCoverage = i++; +GLmethod.scissor = i++; +GLmethod.shaderSource = i++; +GLmethod.stencilFunc = i++; +GLmethod.stencilFuncSeparate = i++; +GLmethod.stencilMask = i++; +GLmethod.stencilMaskSeparate = i++; +GLmethod.stencilOp = i++; //100 +GLmethod.stencilOpSeparate = i++; +GLmethod.texImage2D = i++; +GLmethod.texParameterf = i++; +GLmethod.texParameteri = i++; +GLmethod.texSubImage2D = i++; +GLmethod.uniform1f = i++; +GLmethod.uniform1fv = i++; +GLmethod.uniform1i = i++; +GLmethod.uniform1iv = i++; +GLmethod.uniform2f = i++; //110 +GLmethod.uniform2fv = i++; +GLmethod.uniform2i = i++; +GLmethod.uniform2iv = i++; +GLmethod.uniform3f = i++; +GLmethod.uniform3fv = i++; +GLmethod.uniform3i = i++; +GLmethod.uniform3iv = i++; +GLmethod.uniform4f = i++; +GLmethod.uniform4fv = i++; +GLmethod.uniform4i = i++; //120 +GLmethod.uniform4iv = i++; +GLmethod.uniformMatrix2fv = i++; +GLmethod.uniformMatrix3fv = i++; +GLmethod.uniformMatrix4fv = i++; +GLmethod.useProgram = i++; +GLmethod.validateProgram = i++; +GLmethod.vertexAttrib1f = i++; //new +GLmethod.vertexAttrib2f = i++; //new +GLmethod.vertexAttrib3f = i++; //new +GLmethod.vertexAttrib4f = i++; //new //130 +GLmethod.vertexAttrib1fv = i++; //new +GLmethod.vertexAttrib2fv = i++; //new +GLmethod.vertexAttrib3fv = i++; //new +GLmethod.vertexAttrib4fv = i++; //new +GLmethod.vertexAttribPointer = i++; +GLmethod.viewport = i++; + +export default GLmethod; \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLtype.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLtype.js new file mode 100644 index 0000000..695abcb --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/GLtype.js @@ -0,0 +1,23 @@ +const GLtype = {}; + +[ + "GLbitfield", + "GLboolean", + "GLbyte", + "GLclampf", + "GLenum", + "GLfloat", + "GLint", + "GLintptr", + "GLsizei", + "GLsizeiptr", + "GLshort", + "GLubyte", + "GLuint", + "GLushort" +].sort().map((typeName, i) => GLtype[typeName] = 1 >> (i + 1)); + +export default GLtype; + + + diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Program.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Program.js new file mode 100644 index 0000000..6f5691c --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Program.js @@ -0,0 +1,21 @@ +import {getTransferedObjectUUID} from './classUtils'; + +const name = 'WebGLProgram'; + +function uuid(id) { + return getTransferedObjectUUID(name, id); +} + +export default class WebGLProgram { + className = name; + + constructor(id) { + this.id = id; + } + + static uuid = uuid; + + uuid() { + return uuid(this.id); + } +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Renderbuffer.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Renderbuffer.js new file mode 100644 index 0000000..d3182ae --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Renderbuffer.js @@ -0,0 +1,21 @@ +import {getTransferedObjectUUID} from './classUtils'; + +const name = 'WebGLRenderBuffer'; + +function uuid(id) { + return getTransferedObjectUUID(name, id); +} + +export default class WebGLRenderbuffer { + className = name; + + constructor(id) { + this.id = id; + } + + static uuid = uuid; + + uuid() { + return uuid(this.id); + } +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/RenderingContext.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/RenderingContext.js new file mode 100644 index 0000000..5f9608f --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/RenderingContext.js @@ -0,0 +1,1191 @@ +import GLenum from './GLenum'; +import ActiveInfo from './ActiveInfo'; +import Buffer from './Buffer'; +import Framebuffer from './Framebuffer'; +import Renderbuffer from './Renderbuffer'; +import Texture from './Texture'; +import Program from './Program'; +import Shader from './Shader'; +import ShaderPrecisionFormat from './ShaderPrecisionFormat'; +import UniformLocation from './UniformLocation'; +import GLmethod from './GLmethod'; + +const processArray = (array, checkArrayType = false) => { + + function joinArray(arr, sep) { + let res = ''; + for (let i = 0; i < arr.length; i++) { + if (i !== 0) { + res += sep; + } + res += arr[i]; + } + return res; + } + + let type = 'Float32Array'; + if (checkArrayType) { + if (array instanceof Uint8Array) { + type = 'Uint8Array' + } else if (array instanceof Uint16Array) { + type = 'Uint16Array'; + } else if (array instanceof Uint32Array) { + type = 'Uint32Array'; + } else if (array instanceof Float32Array) { + type = 'Float32Array'; + } else { + throw new Error('Check array type failed. Array type is ' + typeof array); + } + } + + const ArrayTypes = { + Uint8Array: 1, + Uint16Array: 2, + Uint32Array: 4, + Float32Array: 14 + }; + return ArrayTypes[type] + ',' + btoa(joinArray(array, ',')) +} + +export default class WebGLRenderingContext { + + // static GBridge = null; + + className = 'WebGLRenderingContext'; + + constructor(canvas, type, attrs) { + this._canvas = canvas; + this._type = type; + this._version = 'WebGL 1.0'; + this._attrs = attrs; + this._map = new Map(); + + Object.keys(GLenum) + .forEach(name => Object.defineProperty(this, name, { + value: GLenum[name] + })); + } + + get canvas() { + return this._canvas; + } + + activeTexture = function (textureUnit) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.activeTexture + ',' + textureUnit, + true + ); + } + + attachShader = function (progarm, shader) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.attachShader + ',' + progarm.id + ',' + shader.id, + true + ); + } + + bindAttribLocation = function (program, index, name) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.bindAttribLocation + ',' + program.id + ',' + index + ',' + name, + true + ) + } + + bindBuffer = function (target, buffer) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.bindBuffer + ',' + target + ',' + (buffer ? buffer.id : 0), + true + ); + } + + bindFramebuffer = function (target, framebuffer) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.bindFramebuffer + ',' + target + ',' + (framebuffer ? framebuffer.id : 0), + true + ) + } + + bindRenderbuffer = function (target, renderBuffer) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.bindRenderbuffer + ',' + target + ',' + (renderBuffer ? renderBuffer.id : 0), + true + ) + } + + bindTexture = function (target, texture) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.bindTexture + ',' + target + ',' + (texture ? texture.id : 0), + true + ) + } + + blendColor = function (r, g, b, a) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.blendColor + ',' + target + ',' + r + ',' + g + ',' + b + ',' + a, + true + ) + } + + blendEquation = function (mode) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.blendEquation + ',' + mode, + true + ) + } + + blendEquationSeparate = function (modeRGB, modeAlpha) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.blendEquationSeparate + ',' + modeRGB + ',' + modeAlpha, + true + ) + } + + + blendFunc = function (sfactor, dfactor) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.blendFunc + ',' + sfactor + ',' + dfactor, + true + ); + } + + blendFuncSeparate = function (srcRGB, dstRGB, srcAlpha, dstAlpha) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.blendFuncSeparate + ',' + srcRGB + ',' + dstRGB + ',' + srcAlpha + ',' + dstAlpha, + true + ); + } + + bufferData = function (target, data, usage) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.bufferData + ',' + target + ',' + processArray(data, true) + ',' + usage, + true + ) + } + + bufferSubData = function (target, offset, data) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.bufferSubData + ',' + target + ',' + offset + ',' + processArray(data, true), + true + ) + } + + checkFramebufferStatus = function (target) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.checkFramebufferStatus + ',' + target + ); + return Number(result); + } + + clear = function (mask) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.clear + ',' + mask + ); + this._canvas._needRender = true; + } + + clearColor = function (r, g, b, a) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.clearColor + ',' + r + ',' + g + ',' + b, + true + ) + } + + clearDepth = function (depth) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.clearDepth + ',' + depth, + true + ) + } + + clearStencil = function (s) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.clearStencil + ',' + s + ); + } + + colorMask = function (r, g, b, a) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.colorMask + ',' + r + ',' + g + ',' + b + ',' + a + ) + } + + compileShader = function (shader) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.compileShader + ',' + shader.id, + true + ) + } + + compressedTexImage2D = function (target, level, internalformat, width, height, border, pixels) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.compressedTexImage2D + ',' + target + ',' + level + ',' + internalformat + ',' + + width + ',' + height + ',' + border + ',' + processArray(pixels), + true + ) + } + + compressedTexSubImage2D = function (target, level, xoffset, yoffset, width, height, format, pixels) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.compressedTexSubImage2D + ',' + target + ',' + level + ',' + xoffset + ',' + yoffset + ',' + + width + ',' + height + ',' + format + ',' + processArray(pixels), + true + ) + } + + + copyTexImage2D = function (target, level, internalformat, x, y, width, height, border) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.copyTexImage2D + ',' + target + ',' + level + ',' + internalformat + ',' + x + ',' + y + ',' + + width + ',' + height + ',' + border, + true + ); + } + + copyTexSubImage2D = function (target, level, xoffset, yoffset, x, y, width, height) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.copyTexSubImage2D + ',' + target + ',' + level + ',' + xoffset + ',' + yoffset + ',' + x + ',' + y + ',' + + width + ',' + height + ); + } + + createBuffer = function () { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.createBuffer + '' + ); + const buffer = new Buffer(result); + this._map.set(buffer.uuid(), buffer); + return buffer; + } + + createFramebuffer = function () { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.createFramebuffer + '' + ); + const framebuffer = new Framebuffer(result); + this._map.set(framebuffer.uuid(), framebuffer); + return framebuffer; + } + + + createProgram = function () { + const id = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.createProgram + '' + ); + const program = new Program(id); + this._map.set(program.uuid(), program); + return program; + } + + createRenderbuffer = function () { + const id = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.createRenderbuffer + '' + ) + const renderBuffer = new Renderbuffer(id); + this._map.set(renderBuffer.uuid(), renderBuffer); + return renderBuffer; + } + + createShader = function (type) { + const id = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.createShader + ',' + type + ) + const shader = new Shader(id, type); + this._map.set(shader.uuid(), shader); + return shader; + } + + createTexture = function () { + const id = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.createTexture + '' + ); + const texture = new Texture(id); + this._map.set(texture.uuid(), texture); + return texture; + } + + cullFace = function (mode) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.cullFace + ',' + mode, + true + ) + } + + + deleteBuffer = function (buffer) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.deleteBuffer + ',' + buffer.id, + true + ) + } + + deleteFramebuffer = function (framebuffer) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.deleteFramebuffer + ',' + framebuffer.id, + true + ) + } + + deleteProgram = function (program) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.deleteProgram + ',' + program.id, + true + ) + } + + deleteRenderbuffer = function (renderbuffer) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.deleteRenderbuffer + ',' + renderbuffer.id, + true + ) + } + + deleteShader = function (shader) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.deleteShader + ',' + shader.id, + true + ) + } + + deleteTexture = function (texture) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.deleteTexture + ',' + texture.id, + true + ) + } + + depthFunc = function (func) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.depthFunc + ',' + func + ) + } + + depthMask = function (flag) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.depthMask + ',' + Number(flag), + true + ) + } + + depthRange = function (zNear, zFar) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.depthRange + ',' + zNear + ',' + zFar, + true + ) + } + + detachShader = function (program, shader) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.detachShader + ',' + program.id + ',' + shader.id, + true + ) + } + + disable = function (cap) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.disable + ',' + cap, + true + ) + } + + disableVertexAttribArray = function (index) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.disableVertexAttribArray + ',' + index, + true + ); + } + + drawArrays = function (mode, first, count) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.drawArrays + ',' + mode + ',' + first + ',' + count + ) + this._canvas._needRender = true; + } + + drawElements = function (mode, count, type, offset) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.drawElements + ',' + mode + ',' + count + ',' + type + ',' + offset + ';' + ); + this._canvas._needRender = true; + } + + enable = function (cap) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.enable + ',' + cap, + true + ); + } + + enableVertexAttribArray = function (index) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.enableVertexAttribArray + ',' + index, + true + ) + } + + + flush = function () { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.flush + '' + ) + } + + framebufferRenderbuffer = function (target, attachment, textarget, texture, level) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.framebufferRenderbuffer + ',' + target + ',' + attachment + ',' + textarget + ',' + (texture ? texture.id : 0) + ',' + level, + true + ) + } + + framebufferTexture2D = function (target, attachment, textarget, texture, level) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.framebufferTexture2D + ',' + target + ',' + attachment + ',' + textarget + ',' + (texture ? texture.id : 0) + ',' + level, + true + ) + } + + frontFace = function (mode) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.frontFace + ',' + mode, + true + ) + } + + generateMipmap = function (target) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.generateMipmap + ',' + target, + true + ) + } + + getActiveAttrib = function (progarm, index) { + const resultString = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getActiveAttrib + ',' + progarm.id + ',' + index + ) + const [type, size, name] = resultString.split(','); + return new ActiveInfo({ + type: Number(type), + size: Number(size), + name + }); + } + + getActiveUniform = function (progarm, index) { + const resultString = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getActiveUniform + ',' + progarm.id + ',' + index + ); + const [type, size, name] = resultString.split(','); + return new ActiveInfo({ + type: Number(type), + size: Number(size), + name + }) + } + + getAttachedShaders = function (progarm) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getAttachedShaders + ',' + progarm.id + ); + const [type, ...ids] = result; + return ids.map(id => this._map.get(Shader.uuid(id))); + } + + getAttribLocation = function (progarm, name) { + return WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getAttribLocation + ',' + progarm.id + ',' + name + ) + } + + getBufferParameter = function (target, pname) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getBufferParameter + ',' + target + ',' + pname + ); + const [type, res] = getBufferParameter; + return res; + } + + getError = function () { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getError + '' + ) + return result; + } + + getExtension = function (name) { + return null; + } + + getFramebufferAttachmentParameter = function (target, attachment, pname) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getFramebufferAttachmentParameter + ',' + target + ',' + attachment + ',' + pname + ) + switch (pname) { + case GLenum.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: + return this._map.get(Renderbuffer.uuid(result)) || this._map.get(Texture.uuid(result)) || null; + default: + return result; + } + } + + getParameter = function (pname) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getParameter + ',' + pname + ) + switch (pname) { + case GLenum.VERSION: + return this._version; + case GLenum.ARRAY_BUFFER_BINDING: // buffer + case GLenum.ELEMENT_ARRAY_BUFFER_BINDING: // buffer + return this._map.get(Buffer.uuid(result)) || null; + case GLenum.CURRENT_PROGRAM: // program + return this._map.get(Program.uuid(result)) || null; + case GLenum.FRAMEBUFFER_BINDING: // framebuffer + return this._map.get(Framebuffer.uuid(result)) || null; + case GLenum.RENDERBUFFER_BINDING: // renderbuffer + return this._map.get(Renderbuffer.uuid(result)) || null; + case GLenum.TEXTURE_BINDING_2D: // texture + case GLenum.TEXTURE_BINDING_CUBE_MAP: // texture + return this._map.get(Texture.uuid(result)) || null; + case GLenum.ALIASED_LINE_WIDTH_RANGE: // Float32Array + case GLenum.ALIASED_POINT_SIZE_RANGE: // Float32Array + case GLenum.BLEND_COLOR: // Float32Array + case GLenum.COLOR_CLEAR_VALUE: // Float32Array + case GLenum.DEPTH_RANGE: // Float32Array + case GLenum.MAX_VIEWPORT_DIMS: // Int32Array + case GLenum.SCISSOR_BOX: // Int32Array + case GLenum.VIEWPORT: // Int32Array + case GLenum.COMPRESSED_TEXTURE_FORMATS: // Uint32Array + default: + const [type, ...res] = result.split(','); + if (res.length === 1) { + return Number(res[0]); + } else { + return res.map(Number); + } + } + } + + getProgramInfoLog = function (progarm) { + return WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getProgramInfoLog + ',' + progarm.id + ) + } + + getProgramParameter = function (program, pname) { + const res = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getProgramParameter + ',' + program.id + ',' + pname + ); + + const [type, result] = res.split(',').map(i => parseInt(i)); + + if (type === 1) { + return Boolean(result); + } else if (type === 2) { + return result; + } else { + throw new Error('Unrecongized program paramater ' + res + ', type: ' + typeof res); + } + } + + + getRenderbufferParameter = function (target, pname) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getRenderbufferParameter + ',' + target + ',' + pname + ) + return result; + } + + + getShaderInfoLog = function (shader) { + return WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getShaderInfoLog + ',' + shader.id + ); + } + + getShaderParameter = function (shader, pname) { + return WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getShaderParameter + ',' + shader.id + ',' + pname + ) + } + + getShaderPrecisionFormat = function (shaderType, precisionType) { + const [rangeMin, rangeMax, precision] = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getShaderPrecisionFormat + ',' + shaderType + ',' + precisionType + ); + const shaderPrecisionFormat = new ShaderPrecisionFormat({ + rangeMin: Number(rangeMin), + rangeMax: Number(rangeMax), + precision: Number(precision) + }); + return shaderPrecisionFormat; + } + + getShaderSource = function (shader) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getShaderSource + ',' + shader.id + ); + return result; + } + + getSupportedExtensions = function () { + return Object.keys({}); + } + + getTexParameter = function (target, pname) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getTexParameter + ',' + target + ',' + pname + ) + return result; + } + + getUniformLocation = function (program, name) { + const id = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getUniformLocation + ',' + program.id + ',' + name + ); + if (id === -1) { + return null; + } else { + return new UniformLocation(Number(id)); + } + } + + getVertexAttrib = function (index, pname) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getVertexAttrib + ',' + index + ',' + pname + ); + switch (pname) { + case GLenum.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: + return this._map.get(Buffer.uuid(result)) || null; + case GLenum.CURRENT_VERTEX_ATTRIB: // Float32Array + default: + return result; + } + } + + getVertexAttribOffset = function (index, pname) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.getVertexAttribOffset + ',' + index + ',' + pname + ) + return Number(result); + } + + isBuffer = function (buffer) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.isBuffer + ',' + buffer.id + ) + return Boolean(result); + } + + isContextLost = function () { + return false; + } + + isEnabled = function (cap) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.isEnabled + ',' + cap + ) + return Boolean(result); + } + + isFramebuffer = function (framebuffer) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.isFramebuffer + ',' + framebuffer.id + ) + return Boolean(result); + } + + isProgram = function (program) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.isProgram + ',' + program.id + ) + return Boolean(result); + } + + isRenderbuffer = function (renderBuffer) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.isRenderbuffer + ',' + renderbuffer.id + ) + return Boolean(result); + } + + isShader = function (shader) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.isShader + ',' + shader.id + ) + return Boolean(result); + } + + isTexture = function (texture) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.isTexture + ',' + texture.id + ); + return Boolean(result); + } + + lineWidth = function (width) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.lineWidth + ',' + width, + true + ) + } + + linkProgram = function (program) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.linkProgram + ',' + program.id, + true + ); + } + + + pixelStorei = function (pname, param) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.pixelStorei + ',' + pname + ',' + Number(param) + ) + } + + polygonOffset = function (factor, units) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.polygonOffset + ',' + factor + ',' + units + ) + } + + readPixels = function (x, y, width, height, format, type, pixels) { + const result = WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.readPixels + ',' + x + ',' + y + ',' + width + ',' + height + ',' + format + ',' + type + ) + return result; + } + + renderbufferStorage = function (target, internalFormat, width, height) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.renderbufferStorage + ',' + target + ',' + internalFormat + ',' + width + ',' + height, + true + ) + } + + sampleCoverage = function (value, invert) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.sampleCoverage + ',' + value + ',' + Number(invert), + true + ) + } + + scissor = function (x, y, width, height) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.scissor + ',' + x + ',' + y + ',' + width + ',' + height, + true + ) + } + + shaderSource = function (shader, source) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.shaderSource + ',' + shader.id + ',' + source + ) + } + + stencilFunc = function (func, ref, mask) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.stencilFunc + ',' + func + ',' + ref + ',' + mask, + true + ) + } + + stencilFuncSeparate = function (face, func, ref, mask) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.stencilFuncSeparate + ',' + face + ',' + func + ',' + ref + ',' + mask, + true + ) + } + + stencilMask = function (mask) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.stencilMask + ',' + mask, + true + ) + } + + stencilMaskSeparate = function (face, mask) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.stencilMaskSeparate + ',' + face + ',' + mask, + true + ) + } + + stencilOp = function (fail, zfail, zpass) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.stencilOp + ',' + fail + ',' + zfail + ',' + zpass + ) + } + + stencilOpSeparate = function (face, fail, zfail, zpass) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.stencilOp + ',' + face + ',' + fail + ',' + zfail + ',' + zpass, + true + ) + } + + texImage2D = function (...args) { + WebGLRenderingContext.GBridge.texImage2D(this._canvas.id, ...args); + } + + + texParameterf = function (target, pname, param) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.texParameterf + ',' + target + ',' + pname + ',' + param, + true + ) + } + + texParameteri = function (target, pname, param) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.texParameteri + ',' + target + ',' + pname + ',' + param + ) + } + + texSubImage2D = function (...args) { + WebGLRenderingContext.GBridge.texSubImage2D(this._canvas.id, ...args); + } + + uniform1f = function (location, v0) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform1f + ',' + location.id + ',' + v0 + ) + } + + uniform1fv = function (location, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform1fv + ',' + location.id + ',' + processArray(value), + true + ) + } + + uniform1i = function (location, v0) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform1i + ',' + location.id + ',' + v0, + // true + ) + } + + uniform1iv = function (location, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform1iv + ',' + location.id + ',' + processArray(value), + true + ) + } + + uniform2f = function (location, v0, v1) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform2f + ',' + location.id + ',' + v0 + ',' + v1, + true + ) + } + + uniform2fv = function (location, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform2fv + ',' + location.id + ',' + processArray(value), + true + ) + } + + uniform2i = function (location, v0, v1) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform2i + ',' + location.id + ',' + v0 + ',' + v1, + true + ) + } + + uniform2iv = function (location, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform2iv + ',' + location.id + ',' + processArray(value), + true + ) + } + + uniform3f = function (location, v0, v1, v2) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform3f + ',' + location.id + ',' + v0 + ',' + v1 + ',' + v2, + true + ) + } + + uniform3fv = function (location, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform3fv + ',' + location.id + ',' + processArray(value), + true + ) + } + + uniform3i = function (location, v0, v1, v2) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform3i + ',' + location.id + ',' + v0 + ',' + v1 + ',' + v2, + true + ) + } + + uniform3iv = function (location, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform3iv + ',' + location.id + ',' + processArray(value), + true + ) + } + + uniform4f = function (location, v0, v1, v2, v3) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform4f + ',' + location.id + ',' + v0 + ',' + v1 + ',' + v2 + ',' + v3, + true + ) + } + + uniform4fv = function (location, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform4fv + ',' + location.id + ',' + processArray(value), + true + ) + } + + uniform4i = function (location, v0, v1, v2, v3) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform4i + ',' + location.id + ',' + v0 + ',' + v1 + ',' + v2 + ',' + v3, + true + ) + } + + uniform4iv = function (location, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniform4iv + ',' + location.id + ',' + processArray(value, true), + true + ) + } + + uniformMatrix2fv = function (location, transpose, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniformMatrix2fv + ',' + location.id + ',' + Number(transpose) + ',' + processArray(value), + true + ) + } + + uniformMatrix3fv = function (location, transpose, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniformMatrix3fv + ',' + location.id + ',' + Number(transpose) + ',' + processArray(value), + true + ) + } + + uniformMatrix4fv = function (location, transpose, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.uniformMatrix4fv + ',' + location.id + ',' + Number(transpose) + ',' + processArray(value), + true + ); + } + + useProgram = function (progarm) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.useProgram + ',' + progarm.id + '', + true + ) + } + + + validateProgram = function (program) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.validateProgram + ',' + program.id, + true + ) + } + + vertexAttrib1f = function (index, v0) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.vertexAttrib1f + ',' + index + ',' + v0, + true + ) + } + + vertexAttrib2f = function (index, v0, v1) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.vertexAttrib2f + ',' + index + ',' + v0 + ',' + v1, + true + ) + } + + vertexAttrib3f = function (index, v0, v1, v2) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.vertexAttrib3f + ',' + index + ',' + v0 + ',' + v1 + ',' + v2, + true + ) + } + + vertexAttrib4f = function (index, v0, v1, v2, v3) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.vertexAttrib4f + ',' + index + ',' + v0 + ',' + v1 + ',' + v2 + ',' + v3, + true + ) + } + + vertexAttrib1fv = function (index, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.vertexAttrib1fv + ',' + index + ',' + processArray(value), + true + ) + } + + vertexAttrib2fv = function (index, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.vertexAttrib2fv + ',' + index + ',' + processArray(value), + true + ) + } + + vertexAttrib3fv = function (index, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.vertexAttrib3fv + ',' + index + ',' + processArray(value), + true + ) + } + + vertexAttrib4fv = function (index, value) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.vertexAttrib4fv + ',' + index + ',' + processArray(value), + true + ) + } + + vertexAttribPointer = function (index, size, type, normalized, stride, offset) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.vertexAttribPointer + ',' + index + ',' + size + ',' + type + ',' + Number(normalized) + ',' + stride + ',' + offset, + true + ) + } + + viewport = function (x, y, width, height) { + WebGLRenderingContext.GBridge.callNative( + this._canvas.id, + GLmethod.viewport + ',' + x + ',' + y + ',' + width + ',' + height, + true + ) + } +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Shader.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Shader.js new file mode 100644 index 0000000..a763886 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Shader.js @@ -0,0 +1,22 @@ +import {getTransferedObjectUUID} from './classUtils'; + +const name = 'WebGLShader'; + +function uuid(id) { + return getTransferedObjectUUID(name, id); +} + +export default class WebGLShader { + className = name; + + constructor(id, type) { + this.id = id; + this.type = type; + } + + static uuid = uuid; + + uuid() { + return uuid(this.id); + } +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/ShaderPrecisionFormat.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/ShaderPrecisionFormat.js new file mode 100644 index 0000000..208d6c1 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/ShaderPrecisionFormat.js @@ -0,0 +1,11 @@ +export default class WebGLShaderPrecisionFormat { + className = 'WebGLShaderPrecisionFormat'; + + constructor({ + rangeMin, rangeMax, precision + }) { + this.rangeMin = rangeMin; + this.rangeMax = rangeMax; + this.precision = precision; + } +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Texture.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Texture.js new file mode 100644 index 0000000..de4d806 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/Texture.js @@ -0,0 +1,22 @@ +import {getTransferedObjectUUID} from './classUtils'; + +const name = 'WebGLTexture'; + +function uuid(id) { + return getTransferedObjectUUID(name, id); +} + +export default class WebGLTexture { + className = name; + + constructor(id, type) { + this.id = id; + this.type = type; + } + + static uuid = uuid; + + uuid() { + return uuid(this.id); + } +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/UniformLocation.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/UniformLocation.js new file mode 100644 index 0000000..f5e99dc --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/UniformLocation.js @@ -0,0 +1,22 @@ +import {getTransferedObjectUUID} from './classUtils'; + +const name = 'WebGLUniformLocation'; + +function uuid(id) { + return getTransferedObjectUUID(name, id); +} + +export default class WebGLUniformLocation { + className = name; + + constructor(id, type) { + this.id = id; + this.type = type; + } + + static uuid = uuid; + + uuid() { + return uuid(this.id); + } +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/classUtils.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/classUtils.js new file mode 100644 index 0000000..88716be --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/context-webgl/classUtils.js @@ -0,0 +1,3 @@ +export function getTransferedObjectUUID(name, id) { + return `${name.toLowerCase()}-${id}`; +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/canvas.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/canvas.js new file mode 100644 index 0000000..a8d9bb9 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/canvas.js @@ -0,0 +1,74 @@ +import GContext2D from '../context-2d/RenderingContext'; +import GContextWebGL from '../context-webgl/RenderingContext'; + +export default class GCanvas { + + // static GBridge = null; + + id = null; + + _needRender = true; + + constructor(id, { disableAutoSwap }) { + this.id = id; + + this._disableAutoSwap = disableAutoSwap; + if (disableAutoSwap) { + this._swapBuffers = () => { + GCanvas.GBridge.render(this.id); + } + } + } + + getContext(type) { + + let context = null; + + if (type.match(/webgl/i)) { + context = new GContextWebGL(this); + + context.componentId = this.id; + + if (!this._disableAutoSwap) { + const render = () => { + if (this._needRender) { + GCanvas.GBridge.render(this.id); + this._needRender = false; + } + } + setInterval(render, 16); + } + + GCanvas.GBridge.callSetContextType(this.id, 1); // 0 for 2d; 1 for webgl + } else if (type.match(/2d/i)) { + context = new GContext2D(this); + + context.componentId = this.id; + +// const render = ( callback ) => { +// +// const commands = context._drawCommands; +// context._drawCommands = ''; +// +// GCanvas.GBridge.render2d(this.id, commands, callback); +// this._needRender = false; +// } +// //draw方法触发 +// context._flush = render; +// //setInterval(render, 16); + + GCanvas.GBridge.callSetContextType(this.id, 0); + } else { + throw new Error('not supported context ' + type); + } + + return context; + + } + + reset() { + GCanvas.GBridge.callReset(this.id); + } + + +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/image.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/image.js new file mode 100644 index 0000000..9499a51 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/image.js @@ -0,0 +1,96 @@ +let incId = 1; + +const noop = function () { }; + +class GImage { + + static GBridge = null; + + constructor() { + this._id = incId++; + this._width = 0; + this._height = 0; + this._src = undefined; + this._onload = noop; + this._onerror = noop; + this.complete = false; + } + + get width() { + return this._width; + } + set width(v) { + this._width = v; + } + + get height() { + return this._height; + } + + set height(v) { + this._height = v; + } + + get src() { + return this._src; + } + + set src(v) { + + if (v.startsWith('//')) { + v = 'http:' + v; + } + + this._src = v; + + GImage.GBridge.perloadImage([this._src, this._id], (data) => { + if (typeof data === 'string') { + data = JSON.parse(data); + } + if (data.error) { + var evt = { type: 'error', target: this }; + this.onerror(evt); + } else { + this.complete = true; + this.width = typeof data.width === 'number' ? data.width : 0; + this.height = typeof data.height === 'number' ? data.height : 0; + var evt = { type: 'load', target: this }; + this.onload(evt); + } + }); + } + + addEventListener(name, listener) { + if (name === 'load') { + this.onload = listener; + } else if (name === 'error') { + this.onerror = listener; + } + } + + removeEventListener(name, listener) { + if (name === 'load') { + this.onload = noop; + } else if (name === 'error') { + this.onerror = noop; + } + } + + get onload() { + return this._onload; + } + + set onload(v) { + this._onload = v; + } + + get onerror() { + return this._onerror; + } + + set onerror(v) { + this._onerror = v; + } +} + +export default GImage; \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/tool.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/tool.js new file mode 100644 index 0000000..d3fb398 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/env/tool.js @@ -0,0 +1,24 @@ + +export function ArrayBufferToBase64 (buffer) { + var binary = ''; + var bytes = new Uint8ClampedArray(buffer); + for (var len = bytes.byteLength, i = 0; i < len; i++) { + binary += String.fromCharCode(bytes[i]); + } + return btoa(binary); +} + +export function Base64ToUint8ClampedArray(base64String) { + const padding = '='.repeat((4 - base64String.length % 4) % 4); + const base64 = (base64String + padding) + .replace(/\-/g, '+') + .replace(/_/g, '/'); + + const rawData = atob(base64); + const outputArray = new Uint8ClampedArray(rawData.length); + + for (let i = 0; i < rawData.length; ++i) { + outputArray[i] = rawData.charCodeAt(i); + } + return outputArray; +} \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/index.js b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/index.js new file mode 100644 index 0000000..a34ad58 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/gcanvas/index.js @@ -0,0 +1,39 @@ +import GCanvas from './env/canvas'; +import GImage from './env/image'; + +import GWebGLRenderingContext from './context-webgl/RenderingContext'; +import GContext2D from './context-2d/RenderingContext'; + +import GBridgeWeex from './bridge/bridge-weex'; + +export let Image = GImage; + +export let WeexBridge = GBridgeWeex; + +export function enable(el, { bridge, debug, disableAutoSwap, disableComboCommands } = {}) { + + const GBridge = GImage.GBridge = GCanvas.GBridge = GWebGLRenderingContext.GBridge = GContext2D.GBridge = bridge; + + GBridge.callEnable(el.ref, [ + 0, // renderMode: 0--RENDERMODE_WHEN_DIRTY, 1--RENDERMODE_CONTINUOUSLY + -1, // hybridLayerType: 0--LAYER_TYPE_NONE 1--LAYER_TYPE_SOFTWARE 2--LAYER_TYPE_HARDWARE + false, // supportScroll + false, // newCanvasMode + 1, // compatible + 'white',// clearColor + false // sameLevel: newCanvasMode = true && true => GCanvasView and Webview is same level + ]); + + if (debug === true) { + GBridge.callEnableDebug(); + } + if (disableComboCommands) { + GBridge.callEnableDisableCombo(); + } + + var canvas = new GCanvas(el.ref, { disableAutoSwap }); + canvas.width = el.style.width; + canvas.height = el.style.height; + + return canvas; +}; \ No newline at end of file diff --git a/uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js b/uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js new file mode 100644 index 0000000..2290ab3 --- /dev/null +++ b/uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js @@ -0,0 +1,34 @@ +//--------------------------------------------------------------------- +// uQRCode二维码生成插件 v4.0.6 +// +// uQRCode是一款基于Javascript环境开发的二维码生成插件,适用所有Javascript运行环境的前端应用和Node.js。 +// +// Copyright (c) Sansnn uQRCode All rights reserved. +// +// Licensed under the Apache License, Version 2.0. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// github地址: +// https://github.com/Sansnn/uQRCode +// +// npm地址: +// https://www.npmjs.com/package/uqrcodejs +// +// uni-app插件市场地址: +// https://ext.dcloud.net.cn/plugin?id=1287 +// +// 复制使用请保留本段注释,感谢支持开源! +// +//--------------------------------------------------------------------- + +//--------------------------------------------------------------------- +// 当前文件格式为 es,将 bundle 保留为 ES 模块文件,适用于其他打包工具以及支持