From 4ee8dde742b5db001b2ed81bbe41a4bbc901add3 Mon Sep 17 00:00:00 2001 From: LLL <15374889135@163.com> Date: Tue, 11 Mar 2025 10:07:18 +0800 Subject: [PATCH] zhjw --- .gitignore | 2 + .idea/.gitignore | 5 + .idea/YongYaoTiXing_Admin.iml | 12 + .../inspectionProfiles/profiles_settings.xml | 5 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + App.vue | 46 + LICENSE | 201 + README.en.md | 36 + api/Search.js | 31 + api/hygl.js | 79 + api/index.js | 18 + api/medication.js | 177 + api/user.js | 175 + common/axios.js | 89 + common/axiosB.js | 89 + common/config.js | 8 + common/mixins.js | 0 common/mixins/shopro-share.js | 23 + common/uqrcode.js | 1380 +++++++ common/util.js | 103 + common/wx_token.js | 140 + common/xcx_auth.vue | 141 + components/CommentList.vue | 240 ++ components/J-skeleton/J-skeleton.vue | 166 + components/J-skeleton/README.md | 77 + components/aui-dialog/aui-dialog.vue | 438 +++ components/aui-dialog/common/aui/css/aui.css | 292 ++ .../common/aui/css/aui.iconfont.css | 1 + components/aui-dialog/common/aui/js/aui.js | 55 + components/coolc-coupon/coolc-coupon.vue | 181 + .../fui-actionsheet/fui-actionsheet.vue | 436 +++ components/firstui/fui-alert/fui-alert.vue | 244 ++ .../firstui/fui-animation/fui-animation.vue | 218 ++ .../firstui/fui-autograph/fui-autograph.vue | 351 ++ .../gcanvas/bridge/bridge-weex.js | 242 ++ .../context-2d/FillStyleLinearGradient.js | 19 + .../gcanvas/context-2d/FillStylePattern.js | 9 + .../context-2d/FillStyleRadialGradient.js | 18 + .../gcanvas/context-2d/RenderingContext.js | 667 ++++ .../gcanvas/context-webgl/ActiveInfo.js | 12 + .../gcanvas/context-webgl/Buffer.js | 22 + .../gcanvas/context-webgl/Framebuffer.js | 22 + .../gcanvas/context-webgl/GLenum.js | 299 ++ .../gcanvas/context-webgl/GLmethod.js | 143 + .../gcanvas/context-webgl/GLtype.js | 23 + .../gcanvas/context-webgl/Program.js | 22 + .../gcanvas/context-webgl/Renderbuffer.js | 22 + .../gcanvas/context-webgl/RenderingContext.js | 1192 ++++++ .../gcanvas/context-webgl/Shader.js | 23 + .../context-webgl/ShaderPrecisionFormat.js | 12 + .../gcanvas/context-webgl/Texture.js | 23 + .../gcanvas/context-webgl/UniformLocation.js | 23 + .../gcanvas/context-webgl/classUtils.js | 4 + .../fui-autograph/gcanvas/env/canvas.js | 75 + .../fui-autograph/gcanvas/env/image.js | 97 + .../firstui/fui-autograph/gcanvas/env/tool.js | 25 + .../firstui/fui-autograph/gcanvas/index.js | 48 + components/firstui/fui-avatar/fui-avatar.vue | 242 ++ .../firstui/fui-backdrop/fui-backdrop.vue | 174 + .../firstui/fui-backtop/fui-backtop.vue | 121 + components/firstui/fui-badge/fui-badge.vue | 217 ++ .../firstui/fui-banner-arc/fui-banner-arc.vue | 160 + components/firstui/fui-barcode/barcode.js | 205 ++ .../firstui/fui-barcode/fui-barcode.vue | 142 + .../fui-barcode/gcanvas/bridge/bridge-weex.js | 242 ++ .../context-2d/FillStyleLinearGradient.js | 19 + .../gcanvas/context-2d/FillStylePattern.js | 9 + .../context-2d/FillStyleRadialGradient.js | 18 + .../gcanvas/context-2d/RenderingContext.js | 667 ++++ .../gcanvas/context-webgl/ActiveInfo.js | 12 + .../gcanvas/context-webgl/Buffer.js | 22 + .../gcanvas/context-webgl/Framebuffer.js | 22 + .../gcanvas/context-webgl/GLenum.js | 299 ++ .../gcanvas/context-webgl/GLmethod.js | 143 + .../gcanvas/context-webgl/GLtype.js | 23 + .../gcanvas/context-webgl/Program.js | 22 + .../gcanvas/context-webgl/Renderbuffer.js | 22 + .../gcanvas/context-webgl/RenderingContext.js | 1192 ++++++ .../gcanvas/context-webgl/Shader.js | 23 + .../context-webgl/ShaderPrecisionFormat.js | 12 + .../gcanvas/context-webgl/Texture.js | 23 + .../gcanvas/context-webgl/UniformLocation.js | 23 + .../gcanvas/context-webgl/classUtils.js | 4 + .../firstui/fui-barcode/gcanvas/env/canvas.js | 75 + .../firstui/fui-barcode/gcanvas/env/image.js | 97 + .../firstui/fui-barcode/gcanvas/env/tool.js | 25 + .../firstui/fui-barcode/gcanvas/index.js | 48 + .../fui-bottom-navbar/fui-bottom-navbar.vue | 276 ++ .../fui-bottom-popup/fui-bottom-popup.vue | 247 ++ .../firstui/fui-bubble-box/fui-bubble-box.vue | 520 +++ components/firstui/fui-button/fui-button.vue | 525 +++ .../firstui/fui-calendar/fui-calendar.vue | 875 +++++ components/firstui/fui-calendar/index.js | 580 +++ components/firstui/fui-card/fui-card.vue | 325 ++ .../firstui/fui-cascader/fui-cascader.vue | 586 +++ .../fui-checkbox-group/fui-checkbox-group.vue | 102 + .../firstui/fui-checkbox/fui-checkbox.vue | 241 ++ components/firstui/fui-circle/fui-circle.vue | 336 ++ .../fui-circle/gcanvas/bridge/bridge-weex.js | 242 ++ .../context-2d/FillStyleLinearGradient.js | 19 + .../gcanvas/context-2d/FillStylePattern.js | 9 + .../context-2d/FillStyleRadialGradient.js | 18 + .../gcanvas/context-2d/RenderingContext.js | 667 ++++ .../gcanvas/context-webgl/ActiveInfo.js | 12 + .../gcanvas/context-webgl/Buffer.js | 22 + .../gcanvas/context-webgl/Framebuffer.js | 22 + .../gcanvas/context-webgl/GLenum.js | 299 ++ .../gcanvas/context-webgl/GLmethod.js | 143 + .../gcanvas/context-webgl/GLtype.js | 23 + .../gcanvas/context-webgl/Program.js | 22 + .../gcanvas/context-webgl/Renderbuffer.js | 22 + .../gcanvas/context-webgl/RenderingContext.js | 1192 ++++++ .../gcanvas/context-webgl/Shader.js | 23 + .../context-webgl/ShaderPrecisionFormat.js | 12 + .../gcanvas/context-webgl/Texture.js | 23 + .../gcanvas/context-webgl/UniformLocation.js | 23 + .../gcanvas/context-webgl/classUtils.js | 4 + .../firstui/fui-circle/gcanvas/env/canvas.js | 75 + .../firstui/fui-circle/gcanvas/env/image.js | 97 + .../firstui/fui-circle/gcanvas/env/tool.js | 25 + .../firstui/fui-circle/gcanvas/index.js | 48 + components/firstui/fui-circle/mpjs.js | 142 + components/firstui/fui-circle/nvue.js | 139 + components/firstui/fui-circle/render.js | 31 + .../firstui/fui-clipboard/clipboard.min.js | 8 + components/firstui/fui-clipboard/index.js | 52 + components/firstui/fui-col/fui-col.vue | 3220 +++++++++++++++++ .../fui-collapse-item/fui-collapse-item.vue | 343 ++ .../firstui/fui-collapse/fui-collapse.vue | 50 + components/firstui/fui-config/index.js | 115 + .../firstui/fui-copy-text/fui-copy-text.vue | 459 +++ .../fui-copy-text/lib/clipboard.min.js | 8 + components/firstui/fui-copy-text/lib/index.js | 52 + .../firstui/fui-count-down/fui-count-down.vue | 360 ++ .../fui-countdown-verify.vue | 264 ++ .../fui-cubic-bezier/fui-cubic-bezier.vue | 225 ++ .../firstui/fui-data-tag/fui-data-tag.vue | 429 +++ .../fui-date-picker/fui-date-picker.vue | 1418 ++++++++ components/firstui/fui-dialog/fui-dialog.vue | 306 ++ .../fui-digital-keyboard.vue | 488 +++ .../fui-digital-roller/fui-digital-roller.vue | 188 + .../firstui/fui-divider/fui-divider.vue | 112 + components/firstui/fui-drag/bindingx.js | 201 + components/firstui/fui-drag/f-drag-item.vue | 209 ++ components/firstui/fui-drag/fui-drag.vue | 373 ++ components/firstui/fui-drag/index.wxs | 290 ++ components/firstui/fui-drag/mpjs.js | 145 + components/firstui/fui-drawer/fui-drawer.vue | 235 ++ .../fui-dropdown-list/fui-dropdown-list.vue | 468 +++ .../fui-dropdown-menu/fui-dropdown-menu.vue | 560 +++ components/firstui/fui-empty/fui-empty.vue | 131 + components/firstui/fui-fab/bindingx.js | 83 + components/firstui/fui-fab/fui-fab.vue | 605 ++++ components/firstui/fui-fab/index.wxs | 120 + components/firstui/fui-fab/mpjs.js | 59 + .../firstui/fui-filter-bar/fui-filter-bar.vue | 224 ++ components/firstui/fui-footer/fui-footer.vue | 221 ++ .../firstui/fui-form-field/fui-form-field.vue | 37 + .../firstui/fui-form-item/fui-form-item.vue | 314 ++ components/firstui/fui-form/fui-form.vue | 253 ++ components/firstui/fui-form/fui-validator.js | 335 ++ .../firstui/fui-gallery/fui-gallery.vue | 268 ++ .../firstui/fui-grid-item/fui-grid-item.vue | 182 + components/firstui/fui-grid/fui-grid.vue | 236 ++ .../firstui/fui-horizontal-scroll/bindingx.js | 42 + .../fui-horizontal-scroll.vue | 260 ++ .../firstui/fui-horizontal-scroll/index.wxs | 39 + .../firstui/fui-horizontal-scroll/mpjs.js | 32 + components/firstui/fui-icon/fui-icon.js | 166 + components/firstui/fui-icon/fui-icon.ttf | Bin 0 -> 39852 bytes components/firstui/fui-icon/fui-icon.vue | 148 + .../firstui/fui-image-cropper/bindingx.js | 282 ++ .../fui-image-cropper/fui-image-cropper.vue | 656 ++++ .../firstui/fui-image-cropper/index.wxs | 342 ++ components/firstui/fui-image-cropper/mpjs.js | 231 ++ .../fui-index-list/f-index-list-item.vue | 256 ++ .../firstui/fui-index-list/fui-index-list.vue | 647 ++++ .../fui-input-number/fui-input-number.vue | 323 ++ components/firstui/fui-input/fui-input.vue | 705 ++++ components/firstui/fui-label/fui-label.vue | 72 + .../firstui/fui-landscape/fui-landscape.vue | 237 ++ .../firstui/fui-lazyload/fui-lazyload.vue | 223 ++ .../fui-license-plate/fui-license-plate.js | 128 + .../fui-license-plate/fui-license-plate.vue | 440 +++ components/firstui/fui-link/fui-link.vue | 148 + .../firstui/fui-list-cell/fui-list-cell.vue | 247 ++ components/firstui/fui-list/fui-list.vue | 195 + .../firstui/fui-load-ani/fui-load-ani.vue | 296 ++ .../firstui/fui-loading/fui-loading.vue | 240 ++ .../firstui/fui-loadmore/fui-loadmore.vue | 242 ++ .../firstui/fui-lottie/fui-lottie-app.js | 10 + .../firstui/fui-lottie/fui-lottie-mp.js | 13 + components/firstui/fui-lottie/fui-lottie.vue | 225 ++ .../firstui/fui-message/fui-message.vue | 219 ++ components/firstui/fui-modal/fui-modal.vue | 405 +++ .../firstui/fui-movable-view/bindingx.js | 103 + .../fui-movable-view/fui-movable-view.vue | 192 + components/firstui/fui-movable-view/index.wxs | 139 + components/firstui/fui-movable-view/mpjs.js | 76 + .../firstui/fui-nav-bar/fui-nav-bar.vue | 292 ++ .../firstui/fui-notice-bar/fui-notice-bar.vue | 403 +++ .../fui-overflow-hidden.vue | 157 + .../firstui/fui-pagination/fui-pagination.vue | 403 +++ components/firstui/fui-panel/fui-panel.vue | 537 +++ components/firstui/fui-picker/fui-picker.vue | 1026 ++++++ .../fui-poster-weex/fui-poster-weex.vue | 649 ++++ .../gcanvas/bridge/bridge-weex.js | 242 ++ .../context-2d/FillStyleLinearGradient.js | 19 + .../gcanvas/context-2d/FillStylePattern.js | 9 + .../context-2d/FillStyleRadialGradient.js | 18 + .../gcanvas/context-2d/RenderingContext.js | 667 ++++ .../gcanvas/context-webgl/ActiveInfo.js | 12 + .../gcanvas/context-webgl/Buffer.js | 22 + .../gcanvas/context-webgl/Framebuffer.js | 22 + .../gcanvas/context-webgl/GLenum.js | 299 ++ .../gcanvas/context-webgl/GLmethod.js | 143 + .../gcanvas/context-webgl/GLtype.js | 23 + .../gcanvas/context-webgl/Program.js | 22 + .../gcanvas/context-webgl/Renderbuffer.js | 22 + .../gcanvas/context-webgl/RenderingContext.js | 1192 ++++++ .../gcanvas/context-webgl/Shader.js | 23 + .../context-webgl/ShaderPrecisionFormat.js | 12 + .../gcanvas/context-webgl/Texture.js | 23 + .../gcanvas/context-webgl/UniformLocation.js | 23 + .../gcanvas/context-webgl/classUtils.js | 4 + .../fui-poster-weex/gcanvas/env/canvas.js | 75 + .../fui-poster-weex/gcanvas/env/image.js | 97 + .../fui-poster-weex/gcanvas/env/tool.js | 25 + .../firstui/fui-poster-weex/gcanvas/index.js | 48 + components/firstui/fui-poster/fui-poster.vue | 167 + components/firstui/fui-poster/index.js | 644 ++++ .../firstui/fui-preview/fui-preview.vue | 516 +++ .../firstui/fui-progress/fui-progress.vue | 207 ++ .../fui-puzzle-verify/fui-puzzle-verify.vue | 422 +++ .../firstui/fui-puzzle-verify/index.wxs | 147 + components/firstui/fui-puzzle-verify/mpjs.js | 68 + components/firstui/fui-puzzle-verify/weex.js | 115 + components/firstui/fui-qrcode/fui-qr/index.js | 17 + .../firstui/fui-qrcode/fui-qr/lib/8BitByte.js | 23 + .../fui-qrcode/fui-qr/lib/BitBuffer.js | 39 + .../fui-qr/lib/ErrorCorrectLevel.js | 7 + .../fui-qrcode/fui-qr/lib/LICENSE-qrcode | 7 + .../fui-qrcode/fui-qr/lib/Polynomial.js | 68 + .../firstui/fui-qrcode/fui-qr/lib/QRCode.js | 438 +++ .../firstui/fui-qrcode/fui-qr/lib/RSBlock.js | 300 ++ .../firstui/fui-qrcode/fui-qr/lib/math.js | 45 + .../firstui/fui-qrcode/fui-qr/lib/mode.js | 7 + .../firstui/fui-qrcode/fui-qr/lib/util.js | 280 ++ components/firstui/fui-qrcode/fui-qrcode.vue | 186 + .../fui-qrcode/gcanvas/bridge/bridge-weex.js | 242 ++ .../context-2d/FillStyleLinearGradient.js | 19 + .../gcanvas/context-2d/FillStylePattern.js | 9 + .../context-2d/FillStyleRadialGradient.js | 18 + .../gcanvas/context-2d/RenderingContext.js | 667 ++++ .../gcanvas/context-webgl/ActiveInfo.js | 12 + .../gcanvas/context-webgl/Buffer.js | 22 + .../gcanvas/context-webgl/Framebuffer.js | 22 + .../gcanvas/context-webgl/GLenum.js | 299 ++ .../gcanvas/context-webgl/GLmethod.js | 143 + .../gcanvas/context-webgl/GLtype.js | 23 + .../gcanvas/context-webgl/Program.js | 22 + .../gcanvas/context-webgl/Renderbuffer.js | 22 + .../gcanvas/context-webgl/RenderingContext.js | 1192 ++++++ .../gcanvas/context-webgl/Shader.js | 23 + .../context-webgl/ShaderPrecisionFormat.js | 12 + .../gcanvas/context-webgl/Texture.js | 23 + .../gcanvas/context-webgl/UniformLocation.js | 23 + .../gcanvas/context-webgl/classUtils.js | 4 + .../firstui/fui-qrcode/gcanvas/env/canvas.js | 75 + .../firstui/fui-qrcode/gcanvas/env/image.js | 97 + .../firstui/fui-qrcode/gcanvas/env/tool.js | 25 + .../firstui/fui-qrcode/gcanvas/index.js | 48 + .../fui-radio-group/fui-radio-group.vue | 97 + components/firstui/fui-radio/fui-radio.vue | 235 ++ components/firstui/fui-rate/fui-rate.vue | 314 ++ components/firstui/fui-request/fui-common.js | 120 + .../firstui/fui-request/fui-taskStore.js | 57 + components/firstui/fui-request/index.js | 179 + components/firstui/fui-result/fui-result.vue | 272 ++ .../fui-rotate-verify/fui-rotate-verify.vue | 411 +++ .../firstui/fui-rotate-verify/index.wxs | 137 + components/firstui/fui-rotate-verify/mpjs.js | 62 + components/firstui/fui-rotate-verify/weex.js | 111 + components/firstui/fui-row/fui-row.vue | 163 + .../firstui/fui-safe-area/fui-safe-area.vue | 72 + .../firstui/fui-search-bar/fui-search-bar.vue | 526 +++ .../firstui/fui-section/fui-section.vue | 205 ++ .../fui-segmented-control.vue | 222 ++ components/firstui/fui-select/fui-select.vue | 765 ++++ .../fui-share-sheet/fui-share-sheet.vue | 571 +++ .../fui-single-input/fui-single-input.vue | 544 +++ .../firstui/fui-skeleton/fui-skeleton.vue | 172 + .../fui-slide-verify/fui-slide-verify.vue | 382 ++ components/firstui/fui-slide-verify/index.wxs | 149 + components/firstui/fui-slide-verify/mpjs.js | 66 + components/firstui/fui-slide-verify/weex.js | 89 + .../fui-slider-captcha/fui-slider-captcha.vue | 724 ++++ .../firstui/fui-slider-captcha/index.wxs | 168 + components/firstui/fui-slider-captcha/mpjs.js | 82 + components/firstui/fui-slider-captcha/weex.js | 131 + components/firstui/fui-slider/bindingx.js | 208 ++ components/firstui/fui-slider/fui-slider.vue | 398 ++ components/firstui/fui-slider/index.wxs | 290 ++ components/firstui/fui-slider/mpjs.js | 168 + components/firstui/fui-spin/fui-spin.vue | 114 + .../firstui/fui-status-bar/fui-status-bar.vue | 59 + components/firstui/fui-steps/fui-steps.vue | 481 +++ components/firstui/fui-sticky/fui-sticky.vue | 188 + .../firstui/fui-swipe-action/bindingx.js | 224 ++ .../fui-swipe-action/fui-swipe-action.vue | 234 ++ components/firstui/fui-swipe-action/index.wxs | 244 ++ components/firstui/fui-swipe-action/mpjs.js | 193 + components/firstui/fui-swipe-action/mpwxs.js | 107 + .../fui-swipeaction-group.vue | 57 + .../firstui/fui-swiper-dot/fui-swiper-dot.vue | 188 + components/firstui/fui-switch/fui-switch.vue | 295 ++ components/firstui/fui-tabbar/fui-tabbar.vue | 382 ++ components/firstui/fui-table/fui-table.vue | 793 ++++ components/firstui/fui-tabs/fui-tabs.vue | 523 +++ components/firstui/fui-tag/fui-tag.vue | 364 ++ components/firstui/fui-text/fui-text.vue | 278 ++ .../firstui/fui-textarea/fui-textarea.vue | 605 ++++ components/firstui/fui-theme/fui-theme.css | 85 + .../fui-timeaxis-node/fui-timeaxis-node.vue | 109 + .../firstui/fui-timeaxis/fui-timeaxis.vue | 76 + components/firstui/fui-timer/fui-timer.vue | 375 ++ components/firstui/fui-toast/fui-toast.vue | 202 ++ .../firstui/fui-top-popup/fui-top-popup.vue | 186 + .../fui-upload-video/fui-upload-video.vue | 572 +++ components/firstui/fui-upload/fui-upload.vue | 603 +++ components/firstui/fui-utils/index.js | 374 ++ .../firstui/fui-validator/fui-validator.js | 335 ++ .../fui-vtabs-content/fui-vtabs-content.vue | 94 + components/firstui/fui-vtabs/fui-vtabs.vue | 526 +++ .../fui-waterfall-item/fui-waterfall-item.vue | 236 ++ .../firstui/fui-waterfall/fui-waterfall.vue | 167 + components/jyf-parser/jyf-parser.vue | 674 ++++ components/jyf-parser/libs/CssHandler.js | 97 + components/jyf-parser/libs/MpHtmlParser.js | 541 +++ components/jyf-parser/libs/config.js | 98 + components/jyf-parser/libs/handler.sjs | 20 + components/jyf-parser/libs/handler.wxs | 20 + components/jyf-parser/libs/trees.vue | 507 +++ components/list-cell/list-cell.vue | 122 + components/modal/modal.vue | 393 ++ components/nomore/nomore.vue | 127 + components/uni-icons/icons.js | 96 + components/uni-icons/uni-icons.vue | 57 + components/uni-nav-bar/uni-nav-bar.vue | 224 ++ components/uni-popup/message.js | 22 + components/uni-popup/popup.js | 25 + components/uni-popup/uni-popup-dialog.vue | 243 ++ components/uni-popup/uni-popup-message.vue | 116 + components/uni-popup/uni-popup-share.vue | 165 + components/uni-popup/uni-popup.vue | 297 ++ components/uni-status-bar/uni-status-bar.vue | 25 + components/uni-transition/uni-transition.vue | 279 ++ config.js | 15 + main.js | 28 + manifest.json | 97 + node_modules/.package-lock.json | 12 + node_modules/firstui-uni/LICENSE | 201 + node_modules/firstui-uni/README.md | 1072 ++++++ .../fui-actionsheet/fui-actionsheet.vue | 433 +++ .../firstui/fui-alert/fui-alert.vue | 243 ++ .../firstui/fui-animation/fui-animation.vue | 217 ++ .../firstui/fui-avatar/fui-avatar.vue | 241 ++ .../firstui/fui-backdrop/fui-backdrop.vue | 178 + .../firstui/fui-badge/fui-badge.vue | 233 ++ .../fui-bottom-popup/fui-bottom-popup.vue | 251 ++ .../firstui/fui-button/fui-button.vue | 524 +++ .../firstui-uni/firstui/fui-card/fui-card.vue | 325 ++ .../fui-checkbox-group/fui-checkbox-group.vue | 101 + .../firstui/fui-checkbox/fui-checkbox.vue | 240 ++ .../firstui-uni/firstui/fui-col/fui-col.vue | 3219 ++++++++++++++++ .../fui-collapse-item/fui-collapse-item.vue | 350 ++ .../firstui/fui-collapse/fui-collapse.vue | 49 + .../firstui-uni/firstui/fui-config/index.js | 114 + .../firstui/fui-dialog/fui-dialog.vue | 305 ++ .../firstui/fui-divider/fui-divider.vue | 111 + .../firstui/fui-drawer/fui-drawer.vue | 249 ++ .../fui-dropdown-list/fui-dropdown-list.vue | 467 +++ .../fui-dropdown-menu/fui-dropdown-menu.vue | 559 +++ .../firstui/fui-empty/fui-empty.vue | 130 + .../firstui/fui-footer/fui-footer.vue | 220 ++ .../firstui/fui-form-field/fui-form-field.vue | 36 + .../firstui/fui-grid-item/fui-grid-item.vue | 181 + .../firstui-uni/firstui/fui-grid/fui-grid.vue | 268 ++ .../firstui-uni/firstui/fui-icon/fui-icon.js | 165 + .../firstui-uni/firstui/fui-icon/fui-icon.ttf | Bin 0 -> 39852 bytes .../firstui-uni/firstui/fui-icon/fui-icon.vue | 147 + .../fui-input-number/fui-input-number.vue | 325 ++ .../firstui/fui-input/fui-input.vue | 715 ++++ .../firstui/fui-label/fui-label.vue | 71 + .../firstui/fui-list-cell/fui-list-cell.vue | 246 ++ .../firstui-uni/firstui/fui-list/fui-list.vue | 194 + .../firstui/fui-loading/fui-loading.vue | 244 ++ .../firstui/fui-loadmore/fui-loadmore.vue | 246 ++ .../firstui/fui-pagination/fui-pagination.vue | 415 +++ .../fui-radio-group/fui-radio-group.vue | 96 + .../firstui/fui-radio/fui-radio.vue | 234 ++ .../firstui-uni/firstui/fui-row/fui-row.vue | 165 + .../firstui/fui-section/fui-section.vue | 204 ++ .../fui-segmented-control.vue | 221 ++ .../firstui/fui-status-bar/fui-status-bar.vue | 58 + .../firstui/fui-swipe-action/bindingx.js | 225 ++ .../fui-swipe-action/fui-swipe-action.vue | 233 ++ .../firstui/fui-swipe-action/index.wxs | 243 ++ .../firstui/fui-swipe-action/mpjs.js | 194 + .../firstui/fui-swipe-action/mpwxs.js | 106 + .../fui-swipeaction-group.vue | 56 + .../firstui/fui-switch/fui-switch.vue | 303 ++ .../firstui-uni/firstui/fui-tabs/fui-tabs.vue | 541 +++ .../firstui-uni/firstui/fui-tag/fui-tag.vue | 367 ++ .../firstui-uni/firstui/fui-text/fui-text.vue | 285 ++ .../firstui/fui-textarea/fui-textarea.vue | 633 ++++ .../firstui/fui-theme/fui-theme.css | 85 + .../firstui/fui-toast/fui-toast.vue | 201 + .../firstui/fui-top-popup/fui-top-popup.vue | 185 + .../firstui-uni/firstui/fui-utils/index.js | 373 ++ node_modules/firstui-uni/package.json | 27 + package-lock.json | 24 + package.json | 11 + pages.json | 91 + pages/student/index/index.vue | 281 ++ pages/student/login/forgot.vue | 141 + pages/student/login/login.vue | 145 + pages/student/my/my.vue | 374 ++ pages/student/timetable/index.vue | 22 + project.config.json | 33 + project.private.config.json | 7 + static/icon-img/delete.png | Bin 0 -> 3690 bytes static/icon-img/empty.png | Bin 0 -> 3282 bytes static/icon-img/guoqi.png | Bin 0 -> 12885 bytes static/icon-img/kkry.png | Bin 0 -> 5836 bytes static/icon-img/liu.png | Bin 0 -> 1620 bytes static/icon-img/notice.png | Bin 0 -> 2005 bytes static/icon-img/tou.png | Bin 0 -> 36567 bytes static/icon-img/uploadImg.png | Bin 0 -> 3801 bytes static/icon-img/used.png | Bin 0 -> 12682 bytes static/icon-img/warn.png | Bin 0 -> 5149 bytes static/icon-img/weixin.png | Bin 0 -> 3678 bytes static/images/common/black_arrow_right.png | Bin 0 -> 349 bytes static/images/common/closex.png | Bin 0 -> 801 bytes static/images/common/clousex-big.png | Bin 0 -> 642 bytes .../images/common/common_icon_jump_gold.png | Bin 0 -> 475 bytes static/images/common/delete.png | Bin 0 -> 1194 bytes static/images/common/edit.png | Bin 0 -> 1323 bytes static/images/common/gift_icon_close_new.png | Bin 0 -> 427 bytes static/images/common/gouxuankuang.png | Bin 0 -> 2738 bytes static/images/common/gray_arrow_down.png | Bin 0 -> 298 bytes static/images/common/icon-close.png | Bin 0 -> 196 bytes static/images/common/icon-drop-down.png | Bin 0 -> 652 bytes static/images/common/icon_about.png | Bin 0 -> 1163 bytes static/images/common/icon_black_back.png | Bin 0 -> 1454 bytes static/images/common/icon_jump_black3.png | Bin 0 -> 422 bytes static/images/common/image-delete.png | Bin 0 -> 561 bytes static/images/common/jump-r-arrow.png | Bin 0 -> 370 bytes static/images/common/menu_icon_empty.png | Bin 0 -> 570 bytes static/images/common/more-arrow-right.png | Bin 0 -> 316 bytes static/images/common/round-black-selected.png | Bin 0 -> 1411 bytes static/images/common/round_add_disabled.png | Bin 0 -> 639 bytes static/images/common/round_add_normal.png | Bin 0 -> 639 bytes static/images/common/round_minus.png | Bin 0 -> 860 bytes static/images/common/search-icon.png | Bin 0 -> 1421 bytes static/images/common/star_normal.png | Bin 0 -> 1971 bytes static/images/home/chaungjian.png | Bin 0 -> 266 bytes static/images/home/tixing.png | Bin 0 -> 1003 bytes static/images/home/wang.png | Bin 0 -> 1548 bytes static/images/home/yong.png | Bin 0 -> 1537 bytes static/images/index/icon_shopping_bag.png | Bin 0 -> 930 bytes static/images/index/manjian.png | Bin 0 -> 3858 bytes static/images/index/me_icon_notification.png | Bin 0 -> 2666 bytes static/images/index/menu_btn_close.png | Bin 0 -> 390 bytes .../index/menu_icon_popup_triangle_normal.png | Bin 0 -> 563 bytes .../index/menupopup_btn_share_normal.png | Bin 0 -> 1308 bytes .../index/menupopup_btn_share_quanzi.png | Bin 0 -> 1449 bytes .../index/menupopup_btn_share_wechat.png | Bin 0 -> 1318 bytes static/images/index/rexiao.png | Bin 0 -> 3852 bytes static/images/index/round-cancel.png | Bin 0 -> 456 bytes static/images/index/round_close_btn.png | Bin 0 -> 2256 bytes static/images/index/shadow_yellow_star.png | Bin 0 -> 595 bytes static/images/index/tuijian.png | Bin 0 -> 3156 bytes static/images/index/xinpin.png | Bin 0 -> 8003 bytes static/images/index/yellow_star.png | Bin 0 -> 647 bytes static/images/login/login1.png | Bin 0 -> 631 bytes static/images/login/login2.png | Bin 0 -> 347 bytes static/images/login/wechat1.png | Bin 0 -> 81796 bytes .../mall/b3d3a98e3c7f450aaa32fbec6aecdfaf.png | Bin 0 -> 5770 bytes static/images/mall/img_pointmall_star.png | Bin 0 -> 12788 bytes static/images/mall/me_img_banner_mall.png | Bin 0 -> 25321 bytes .../images/mall/me_pointmall_img_nogift.png | Bin 0 -> 30561 bytes .../mall/store_brh_home_page_normal.png | Bin 0 -> 415 bytes .../images/mall/store_brh_service_normal.png | Bin 0 -> 807 bytes .../images/member/me_club_task_img_done.png | Bin 0 -> 2543 bytes .../my/b3d3a98e3c7f450aaa32fbec6aecdfaf.png | Bin 0 -> 4633 bytes static/images/my/coupons-empty.png | Bin 0 -> 10726 bytes static/images/my/icon_arrow.png | Bin 0 -> 296 bytes static/images/my/icon_attention.png | Bin 0 -> 918 bytes static/images/my/icon_giftcard.png | Bin 0 -> 1622 bytes static/images/my/icon_rules.png | Bin 0 -> 236 bytes static/images/my/img_giftcard_empty.png | Bin 0 -> 8029 bytes static/images/my/jf.png | Bin 0 -> 7813 bytes static/images/my/me_icon_gift_card.png | Bin 0 -> 3843 bytes static/images/my/me_icon_points.png | Bin 0 -> 7030 bytes static/images/my/me_icon_quan.png | Bin 0 -> 6947 bytes static/images/my/me_icon_wallet.png | Bin 0 -> 4462 bytes .../member_benefits/me_rights_icon_1jia1.png | Bin 0 -> 688 bytes .../me_rights_icon_1jia1_dis.png | Bin 0 -> 667 bytes .../member_benefits/me_rights_icon_2jia1.png | Bin 0 -> 798 bytes .../me_rights_icon_2jia1_dis.png | Bin 0 -> 755 bytes .../member_benefits/me_rights_icon_free.png | Bin 0 -> 881 bytes .../me_rights_icon_free_dis.png | Bin 0 -> 1033 bytes .../me_rights_icon_qingshi.png | Bin 0 -> 1290 bytes .../me_rights_icon_qingshi_dis.png | Bin 0 -> 1594 bytes .../me_rights_icon_waimai_new.png | Bin 0 -> 1012 bytes .../me_rights_icon_waimai_new_dis.png | Bin 0 -> 715 bytes .../me_rights_icon_youxian_new.png | Bin 0 -> 787 bytes .../me_rights_icon_youxian_new_dis.png | Bin 0 -> 644 bytes static/images/my/nocoupon.png | Bin 0 -> 17076 bytes static/images/my/scan-qrcode.png | Bin 0 -> 704 bytes static/images/my/ye.png | Bin 0 -> 4228 bytes static/images/my/yhq.png | Bin 0 -> 3871 bytes static/images/order/batch_invoice_icon.png | Bin 0 -> 452 bytes static/images/order/default_img_order.png | Bin 0 -> 4329 bytes static/images/order/icon_making.png | Bin 0 -> 877 bytes static/images/order/icon_map.png | Bin 0 -> 6071 bytes static/images/order/icon_phone.png | Bin 0 -> 5632 bytes static/images/order/index2.vue | 0 static/images/order/order_cancelpay.png | Bin 0 -> 1428 bytes static/images/order/order_icon_address.png | Bin 0 -> 736 bytes static/images/order/order_icon_change.png | Bin 0 -> 244 bytes static/images/order/order_icon_service.png | Bin 0 -> 730 bytes static/images/order/order_icon_talk2.0.png | Bin 0 -> 943 bytes static/images/order/weixin-pay.png | Bin 0 -> 5907 bytes static/images/pay/error.png | Bin 0 -> 2553 bytes static/images/pay/success.png | Bin 0 -> 3856 bytes static/images/tabbar/home.png | Bin 0 -> 1040 bytes static/images/tabbar/home_selected.png | Bin 0 -> 794 bytes static/images/tabbar/index.png | Bin 0 -> 1409 bytes static/images/tabbar/index_selected.png | Bin 0 -> 1125 bytes static/images/tabbar/mart.png | Bin 0 -> 1020 bytes static/images/tabbar/mart_selected.png | Bin 0 -> 1053 bytes static/images/tabbar/my.png | Bin 0 -> 1370 bytes static/images/tabbar/my_selected.png | Bin 0 -> 1095 bytes static/images/tabbar/order.png | Bin 0 -> 871 bytes static/images/tabbar/order_selected.png | Bin 0 -> 905 bytes static/rate/none.png | Bin 0 -> 2036 bytes static/styles/app.scss | 563 +++ store/index.js | 50 + uni.scss | 95 + 552 files changed, 97480 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/YongYaoTiXing_Admin.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 App.vue create mode 100644 LICENSE create mode 100644 README.en.md create mode 100644 api/Search.js create mode 100644 api/hygl.js create mode 100644 api/index.js create mode 100644 api/medication.js create mode 100644 api/user.js create mode 100644 common/axios.js create mode 100644 common/axiosB.js create mode 100644 common/config.js create mode 100644 common/mixins.js create mode 100644 common/mixins/shopro-share.js create mode 100644 common/uqrcode.js create mode 100644 common/util.js create mode 100644 common/wx_token.js create mode 100644 common/xcx_auth.vue create mode 100644 components/CommentList.vue create mode 100644 components/J-skeleton/J-skeleton.vue create mode 100644 components/J-skeleton/README.md create mode 100644 components/aui-dialog/aui-dialog.vue create mode 100644 components/aui-dialog/common/aui/css/aui.css create mode 100644 components/aui-dialog/common/aui/css/aui.iconfont.css create mode 100644 components/aui-dialog/common/aui/js/aui.js create mode 100644 components/coolc-coupon/coolc-coupon.vue create mode 100644 components/firstui/fui-actionsheet/fui-actionsheet.vue create mode 100644 components/firstui/fui-alert/fui-alert.vue create mode 100644 components/firstui/fui-animation/fui-animation.vue create mode 100644 components/firstui/fui-autograph/fui-autograph.vue create mode 100644 components/firstui/fui-autograph/gcanvas/bridge/bridge-weex.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-2d/FillStyleLinearGradient.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-2d/FillStylePattern.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-2d/FillStyleRadialGradient.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-2d/RenderingContext.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/ActiveInfo.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/Buffer.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/Framebuffer.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/GLenum.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/GLmethod.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/GLtype.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/Program.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/Renderbuffer.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/RenderingContext.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/Shader.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/ShaderPrecisionFormat.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/Texture.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/UniformLocation.js create mode 100644 components/firstui/fui-autograph/gcanvas/context-webgl/classUtils.js create mode 100644 components/firstui/fui-autograph/gcanvas/env/canvas.js create mode 100644 components/firstui/fui-autograph/gcanvas/env/image.js create mode 100644 components/firstui/fui-autograph/gcanvas/env/tool.js create mode 100644 components/firstui/fui-autograph/gcanvas/index.js create mode 100644 components/firstui/fui-avatar/fui-avatar.vue create mode 100644 components/firstui/fui-backdrop/fui-backdrop.vue create mode 100644 components/firstui/fui-backtop/fui-backtop.vue create mode 100644 components/firstui/fui-badge/fui-badge.vue create mode 100644 components/firstui/fui-banner-arc/fui-banner-arc.vue create mode 100644 components/firstui/fui-barcode/barcode.js create mode 100644 components/firstui/fui-barcode/fui-barcode.vue create mode 100644 components/firstui/fui-barcode/gcanvas/bridge/bridge-weex.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-2d/FillStyleLinearGradient.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-2d/FillStylePattern.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-2d/FillStyleRadialGradient.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-2d/RenderingContext.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/ActiveInfo.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/Buffer.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/Framebuffer.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/GLenum.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/GLmethod.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/GLtype.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/Program.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/Renderbuffer.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/RenderingContext.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/Shader.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/ShaderPrecisionFormat.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/Texture.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/UniformLocation.js create mode 100644 components/firstui/fui-barcode/gcanvas/context-webgl/classUtils.js create mode 100644 components/firstui/fui-barcode/gcanvas/env/canvas.js create mode 100644 components/firstui/fui-barcode/gcanvas/env/image.js create mode 100644 components/firstui/fui-barcode/gcanvas/env/tool.js create mode 100644 components/firstui/fui-barcode/gcanvas/index.js create mode 100644 components/firstui/fui-bottom-navbar/fui-bottom-navbar.vue create mode 100644 components/firstui/fui-bottom-popup/fui-bottom-popup.vue create mode 100644 components/firstui/fui-bubble-box/fui-bubble-box.vue create mode 100644 components/firstui/fui-button/fui-button.vue create mode 100644 components/firstui/fui-calendar/fui-calendar.vue create mode 100644 components/firstui/fui-calendar/index.js create mode 100644 components/firstui/fui-card/fui-card.vue create mode 100644 components/firstui/fui-cascader/fui-cascader.vue create mode 100644 components/firstui/fui-checkbox-group/fui-checkbox-group.vue create mode 100644 components/firstui/fui-checkbox/fui-checkbox.vue create mode 100644 components/firstui/fui-circle/fui-circle.vue create mode 100644 components/firstui/fui-circle/gcanvas/bridge/bridge-weex.js create mode 100644 components/firstui/fui-circle/gcanvas/context-2d/FillStyleLinearGradient.js create mode 100644 components/firstui/fui-circle/gcanvas/context-2d/FillStylePattern.js create mode 100644 components/firstui/fui-circle/gcanvas/context-2d/FillStyleRadialGradient.js create mode 100644 components/firstui/fui-circle/gcanvas/context-2d/RenderingContext.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/ActiveInfo.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/Buffer.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/Framebuffer.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/GLenum.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/GLmethod.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/GLtype.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/Program.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/Renderbuffer.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/RenderingContext.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/Shader.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/ShaderPrecisionFormat.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/Texture.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/UniformLocation.js create mode 100644 components/firstui/fui-circle/gcanvas/context-webgl/classUtils.js create mode 100644 components/firstui/fui-circle/gcanvas/env/canvas.js create mode 100644 components/firstui/fui-circle/gcanvas/env/image.js create mode 100644 components/firstui/fui-circle/gcanvas/env/tool.js create mode 100644 components/firstui/fui-circle/gcanvas/index.js create mode 100644 components/firstui/fui-circle/mpjs.js create mode 100644 components/firstui/fui-circle/nvue.js create mode 100644 components/firstui/fui-circle/render.js create mode 100644 components/firstui/fui-clipboard/clipboard.min.js create mode 100644 components/firstui/fui-clipboard/index.js create mode 100644 components/firstui/fui-col/fui-col.vue create mode 100644 components/firstui/fui-collapse-item/fui-collapse-item.vue create mode 100644 components/firstui/fui-collapse/fui-collapse.vue create mode 100644 components/firstui/fui-config/index.js create mode 100644 components/firstui/fui-copy-text/fui-copy-text.vue create mode 100644 components/firstui/fui-copy-text/lib/clipboard.min.js create mode 100644 components/firstui/fui-copy-text/lib/index.js create mode 100644 components/firstui/fui-count-down/fui-count-down.vue create mode 100644 components/firstui/fui-countdown-verify/fui-countdown-verify.vue create mode 100644 components/firstui/fui-cubic-bezier/fui-cubic-bezier.vue create mode 100644 components/firstui/fui-data-tag/fui-data-tag.vue create mode 100644 components/firstui/fui-date-picker/fui-date-picker.vue create mode 100644 components/firstui/fui-dialog/fui-dialog.vue create mode 100644 components/firstui/fui-digital-keyboard/fui-digital-keyboard.vue create mode 100644 components/firstui/fui-digital-roller/fui-digital-roller.vue create mode 100644 components/firstui/fui-divider/fui-divider.vue create mode 100644 components/firstui/fui-drag/bindingx.js create mode 100644 components/firstui/fui-drag/f-drag-item.vue create mode 100644 components/firstui/fui-drag/fui-drag.vue create mode 100644 components/firstui/fui-drag/index.wxs create mode 100644 components/firstui/fui-drag/mpjs.js create mode 100644 components/firstui/fui-drawer/fui-drawer.vue create mode 100644 components/firstui/fui-dropdown-list/fui-dropdown-list.vue create mode 100644 components/firstui/fui-dropdown-menu/fui-dropdown-menu.vue create mode 100644 components/firstui/fui-empty/fui-empty.vue create mode 100644 components/firstui/fui-fab/bindingx.js create mode 100644 components/firstui/fui-fab/fui-fab.vue create mode 100644 components/firstui/fui-fab/index.wxs create mode 100644 components/firstui/fui-fab/mpjs.js create mode 100644 components/firstui/fui-filter-bar/fui-filter-bar.vue create mode 100644 components/firstui/fui-footer/fui-footer.vue create mode 100644 components/firstui/fui-form-field/fui-form-field.vue create mode 100644 components/firstui/fui-form-item/fui-form-item.vue create mode 100644 components/firstui/fui-form/fui-form.vue create mode 100644 components/firstui/fui-form/fui-validator.js create mode 100644 components/firstui/fui-gallery/fui-gallery.vue create mode 100644 components/firstui/fui-grid-item/fui-grid-item.vue create mode 100644 components/firstui/fui-grid/fui-grid.vue create mode 100644 components/firstui/fui-horizontal-scroll/bindingx.js create mode 100644 components/firstui/fui-horizontal-scroll/fui-horizontal-scroll.vue create mode 100644 components/firstui/fui-horizontal-scroll/index.wxs create mode 100644 components/firstui/fui-horizontal-scroll/mpjs.js create mode 100644 components/firstui/fui-icon/fui-icon.js create mode 100644 components/firstui/fui-icon/fui-icon.ttf create mode 100644 components/firstui/fui-icon/fui-icon.vue create mode 100644 components/firstui/fui-image-cropper/bindingx.js create mode 100644 components/firstui/fui-image-cropper/fui-image-cropper.vue create mode 100644 components/firstui/fui-image-cropper/index.wxs create mode 100644 components/firstui/fui-image-cropper/mpjs.js create mode 100644 components/firstui/fui-index-list/f-index-list-item.vue create mode 100644 components/firstui/fui-index-list/fui-index-list.vue create mode 100644 components/firstui/fui-input-number/fui-input-number.vue create mode 100644 components/firstui/fui-input/fui-input.vue create mode 100644 components/firstui/fui-label/fui-label.vue create mode 100644 components/firstui/fui-landscape/fui-landscape.vue create mode 100644 components/firstui/fui-lazyload/fui-lazyload.vue create mode 100644 components/firstui/fui-license-plate/fui-license-plate.js create mode 100644 components/firstui/fui-license-plate/fui-license-plate.vue create mode 100644 components/firstui/fui-link/fui-link.vue create mode 100644 components/firstui/fui-list-cell/fui-list-cell.vue create mode 100644 components/firstui/fui-list/fui-list.vue create mode 100644 components/firstui/fui-load-ani/fui-load-ani.vue create mode 100644 components/firstui/fui-loading/fui-loading.vue create mode 100644 components/firstui/fui-loadmore/fui-loadmore.vue create mode 100644 components/firstui/fui-lottie/fui-lottie-app.js create mode 100644 components/firstui/fui-lottie/fui-lottie-mp.js create mode 100644 components/firstui/fui-lottie/fui-lottie.vue create mode 100644 components/firstui/fui-message/fui-message.vue create mode 100644 components/firstui/fui-modal/fui-modal.vue create mode 100644 components/firstui/fui-movable-view/bindingx.js create mode 100644 components/firstui/fui-movable-view/fui-movable-view.vue create mode 100644 components/firstui/fui-movable-view/index.wxs create mode 100644 components/firstui/fui-movable-view/mpjs.js create mode 100644 components/firstui/fui-nav-bar/fui-nav-bar.vue create mode 100644 components/firstui/fui-notice-bar/fui-notice-bar.vue create mode 100644 components/firstui/fui-overflow-hidden/fui-overflow-hidden.vue create mode 100644 components/firstui/fui-pagination/fui-pagination.vue create mode 100644 components/firstui/fui-panel/fui-panel.vue create mode 100644 components/firstui/fui-picker/fui-picker.vue create mode 100644 components/firstui/fui-poster-weex/fui-poster-weex.vue create mode 100644 components/firstui/fui-poster-weex/gcanvas/bridge/bridge-weex.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-2d/FillStyleLinearGradient.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-2d/FillStylePattern.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-2d/FillStyleRadialGradient.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-2d/RenderingContext.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/ActiveInfo.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/Buffer.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/Framebuffer.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/GLenum.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/GLmethod.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/GLtype.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/Program.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/Renderbuffer.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/RenderingContext.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/Shader.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/ShaderPrecisionFormat.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/Texture.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/UniformLocation.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/context-webgl/classUtils.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/env/canvas.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/env/image.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/env/tool.js create mode 100644 components/firstui/fui-poster-weex/gcanvas/index.js create mode 100644 components/firstui/fui-poster/fui-poster.vue create mode 100644 components/firstui/fui-poster/index.js create mode 100644 components/firstui/fui-preview/fui-preview.vue create mode 100644 components/firstui/fui-progress/fui-progress.vue create mode 100644 components/firstui/fui-puzzle-verify/fui-puzzle-verify.vue create mode 100644 components/firstui/fui-puzzle-verify/index.wxs create mode 100644 components/firstui/fui-puzzle-verify/mpjs.js create mode 100644 components/firstui/fui-puzzle-verify/weex.js create mode 100644 components/firstui/fui-qrcode/fui-qr/index.js create mode 100644 components/firstui/fui-qrcode/fui-qr/lib/8BitByte.js create mode 100644 components/firstui/fui-qrcode/fui-qr/lib/BitBuffer.js create mode 100644 components/firstui/fui-qrcode/fui-qr/lib/ErrorCorrectLevel.js create mode 100644 components/firstui/fui-qrcode/fui-qr/lib/LICENSE-qrcode create mode 100644 components/firstui/fui-qrcode/fui-qr/lib/Polynomial.js create mode 100644 components/firstui/fui-qrcode/fui-qr/lib/QRCode.js create mode 100644 components/firstui/fui-qrcode/fui-qr/lib/RSBlock.js create mode 100644 components/firstui/fui-qrcode/fui-qr/lib/math.js create mode 100644 components/firstui/fui-qrcode/fui-qr/lib/mode.js create mode 100644 components/firstui/fui-qrcode/fui-qr/lib/util.js create mode 100644 components/firstui/fui-qrcode/fui-qrcode.vue create mode 100644 components/firstui/fui-qrcode/gcanvas/bridge/bridge-weex.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-2d/FillStyleLinearGradient.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-2d/FillStylePattern.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-2d/FillStyleRadialGradient.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-2d/RenderingContext.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/ActiveInfo.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/Buffer.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/Framebuffer.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/GLenum.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/GLmethod.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/GLtype.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/Program.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/Renderbuffer.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/RenderingContext.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/Shader.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/ShaderPrecisionFormat.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/Texture.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/UniformLocation.js create mode 100644 components/firstui/fui-qrcode/gcanvas/context-webgl/classUtils.js create mode 100644 components/firstui/fui-qrcode/gcanvas/env/canvas.js create mode 100644 components/firstui/fui-qrcode/gcanvas/env/image.js create mode 100644 components/firstui/fui-qrcode/gcanvas/env/tool.js create mode 100644 components/firstui/fui-qrcode/gcanvas/index.js create mode 100644 components/firstui/fui-radio-group/fui-radio-group.vue create mode 100644 components/firstui/fui-radio/fui-radio.vue create mode 100644 components/firstui/fui-rate/fui-rate.vue create mode 100644 components/firstui/fui-request/fui-common.js create mode 100644 components/firstui/fui-request/fui-taskStore.js create mode 100644 components/firstui/fui-request/index.js create mode 100644 components/firstui/fui-result/fui-result.vue create mode 100644 components/firstui/fui-rotate-verify/fui-rotate-verify.vue create mode 100644 components/firstui/fui-rotate-verify/index.wxs create mode 100644 components/firstui/fui-rotate-verify/mpjs.js create mode 100644 components/firstui/fui-rotate-verify/weex.js create mode 100644 components/firstui/fui-row/fui-row.vue create mode 100644 components/firstui/fui-safe-area/fui-safe-area.vue create mode 100644 components/firstui/fui-search-bar/fui-search-bar.vue create mode 100644 components/firstui/fui-section/fui-section.vue create mode 100644 components/firstui/fui-segmented-control/fui-segmented-control.vue create mode 100644 components/firstui/fui-select/fui-select.vue create mode 100644 components/firstui/fui-share-sheet/fui-share-sheet.vue create mode 100644 components/firstui/fui-single-input/fui-single-input.vue create mode 100644 components/firstui/fui-skeleton/fui-skeleton.vue create mode 100644 components/firstui/fui-slide-verify/fui-slide-verify.vue create mode 100644 components/firstui/fui-slide-verify/index.wxs create mode 100644 components/firstui/fui-slide-verify/mpjs.js create mode 100644 components/firstui/fui-slide-verify/weex.js create mode 100644 components/firstui/fui-slider-captcha/fui-slider-captcha.vue create mode 100644 components/firstui/fui-slider-captcha/index.wxs create mode 100644 components/firstui/fui-slider-captcha/mpjs.js create mode 100644 components/firstui/fui-slider-captcha/weex.js create mode 100644 components/firstui/fui-slider/bindingx.js create mode 100644 components/firstui/fui-slider/fui-slider.vue create mode 100644 components/firstui/fui-slider/index.wxs create mode 100644 components/firstui/fui-slider/mpjs.js create mode 100644 components/firstui/fui-spin/fui-spin.vue create mode 100644 components/firstui/fui-status-bar/fui-status-bar.vue create mode 100644 components/firstui/fui-steps/fui-steps.vue create mode 100644 components/firstui/fui-sticky/fui-sticky.vue create mode 100644 components/firstui/fui-swipe-action/bindingx.js create mode 100644 components/firstui/fui-swipe-action/fui-swipe-action.vue create mode 100644 components/firstui/fui-swipe-action/index.wxs create mode 100644 components/firstui/fui-swipe-action/mpjs.js create mode 100644 components/firstui/fui-swipe-action/mpwxs.js create mode 100644 components/firstui/fui-swipeaction-group/fui-swipeaction-group.vue create mode 100644 components/firstui/fui-swiper-dot/fui-swiper-dot.vue create mode 100644 components/firstui/fui-switch/fui-switch.vue create mode 100644 components/firstui/fui-tabbar/fui-tabbar.vue create mode 100644 components/firstui/fui-table/fui-table.vue create mode 100644 components/firstui/fui-tabs/fui-tabs.vue create mode 100644 components/firstui/fui-tag/fui-tag.vue create mode 100644 components/firstui/fui-text/fui-text.vue create mode 100644 components/firstui/fui-textarea/fui-textarea.vue create mode 100644 components/firstui/fui-theme/fui-theme.css create mode 100644 components/firstui/fui-timeaxis-node/fui-timeaxis-node.vue create mode 100644 components/firstui/fui-timeaxis/fui-timeaxis.vue create mode 100644 components/firstui/fui-timer/fui-timer.vue create mode 100644 components/firstui/fui-toast/fui-toast.vue create mode 100644 components/firstui/fui-top-popup/fui-top-popup.vue create mode 100644 components/firstui/fui-upload-video/fui-upload-video.vue create mode 100644 components/firstui/fui-upload/fui-upload.vue create mode 100644 components/firstui/fui-utils/index.js create mode 100644 components/firstui/fui-validator/fui-validator.js create mode 100644 components/firstui/fui-vtabs-content/fui-vtabs-content.vue create mode 100644 components/firstui/fui-vtabs/fui-vtabs.vue create mode 100644 components/firstui/fui-waterfall-item/fui-waterfall-item.vue create mode 100644 components/firstui/fui-waterfall/fui-waterfall.vue create mode 100644 components/jyf-parser/jyf-parser.vue create mode 100644 components/jyf-parser/libs/CssHandler.js create mode 100644 components/jyf-parser/libs/MpHtmlParser.js create mode 100644 components/jyf-parser/libs/config.js create mode 100644 components/jyf-parser/libs/handler.sjs create mode 100644 components/jyf-parser/libs/handler.wxs create mode 100644 components/jyf-parser/libs/trees.vue create mode 100644 components/list-cell/list-cell.vue create mode 100644 components/modal/modal.vue create mode 100644 components/nomore/nomore.vue create mode 100644 components/uni-icons/icons.js create mode 100644 components/uni-icons/uni-icons.vue create mode 100644 components/uni-nav-bar/uni-nav-bar.vue create mode 100644 components/uni-popup/message.js create mode 100644 components/uni-popup/popup.js create mode 100644 components/uni-popup/uni-popup-dialog.vue create mode 100644 components/uni-popup/uni-popup-message.vue create mode 100644 components/uni-popup/uni-popup-share.vue create mode 100644 components/uni-popup/uni-popup.vue create mode 100644 components/uni-status-bar/uni-status-bar.vue create mode 100644 components/uni-transition/uni-transition.vue create mode 100644 config.js create mode 100644 main.js create mode 100644 manifest.json create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/firstui-uni/LICENSE create mode 100644 node_modules/firstui-uni/README.md create mode 100644 node_modules/firstui-uni/firstui/fui-actionsheet/fui-actionsheet.vue create mode 100644 node_modules/firstui-uni/firstui/fui-alert/fui-alert.vue create mode 100644 node_modules/firstui-uni/firstui/fui-animation/fui-animation.vue create mode 100644 node_modules/firstui-uni/firstui/fui-avatar/fui-avatar.vue create mode 100644 node_modules/firstui-uni/firstui/fui-backdrop/fui-backdrop.vue create mode 100644 node_modules/firstui-uni/firstui/fui-badge/fui-badge.vue create mode 100644 node_modules/firstui-uni/firstui/fui-bottom-popup/fui-bottom-popup.vue create mode 100644 node_modules/firstui-uni/firstui/fui-button/fui-button.vue create mode 100644 node_modules/firstui-uni/firstui/fui-card/fui-card.vue create mode 100644 node_modules/firstui-uni/firstui/fui-checkbox-group/fui-checkbox-group.vue create mode 100644 node_modules/firstui-uni/firstui/fui-checkbox/fui-checkbox.vue create mode 100644 node_modules/firstui-uni/firstui/fui-col/fui-col.vue create mode 100644 node_modules/firstui-uni/firstui/fui-collapse-item/fui-collapse-item.vue create mode 100644 node_modules/firstui-uni/firstui/fui-collapse/fui-collapse.vue create mode 100644 node_modules/firstui-uni/firstui/fui-config/index.js create mode 100644 node_modules/firstui-uni/firstui/fui-dialog/fui-dialog.vue create mode 100644 node_modules/firstui-uni/firstui/fui-divider/fui-divider.vue create mode 100644 node_modules/firstui-uni/firstui/fui-drawer/fui-drawer.vue create mode 100644 node_modules/firstui-uni/firstui/fui-dropdown-list/fui-dropdown-list.vue create mode 100644 node_modules/firstui-uni/firstui/fui-dropdown-menu/fui-dropdown-menu.vue create mode 100644 node_modules/firstui-uni/firstui/fui-empty/fui-empty.vue create mode 100644 node_modules/firstui-uni/firstui/fui-footer/fui-footer.vue create mode 100644 node_modules/firstui-uni/firstui/fui-form-field/fui-form-field.vue create mode 100644 node_modules/firstui-uni/firstui/fui-grid-item/fui-grid-item.vue create mode 100644 node_modules/firstui-uni/firstui/fui-grid/fui-grid.vue create mode 100644 node_modules/firstui-uni/firstui/fui-icon/fui-icon.js create mode 100644 node_modules/firstui-uni/firstui/fui-icon/fui-icon.ttf create mode 100644 node_modules/firstui-uni/firstui/fui-icon/fui-icon.vue create mode 100644 node_modules/firstui-uni/firstui/fui-input-number/fui-input-number.vue create mode 100644 node_modules/firstui-uni/firstui/fui-input/fui-input.vue create mode 100644 node_modules/firstui-uni/firstui/fui-label/fui-label.vue create mode 100644 node_modules/firstui-uni/firstui/fui-list-cell/fui-list-cell.vue create mode 100644 node_modules/firstui-uni/firstui/fui-list/fui-list.vue create mode 100644 node_modules/firstui-uni/firstui/fui-loading/fui-loading.vue create mode 100644 node_modules/firstui-uni/firstui/fui-loadmore/fui-loadmore.vue create mode 100644 node_modules/firstui-uni/firstui/fui-pagination/fui-pagination.vue create mode 100644 node_modules/firstui-uni/firstui/fui-radio-group/fui-radio-group.vue create mode 100644 node_modules/firstui-uni/firstui/fui-radio/fui-radio.vue create mode 100644 node_modules/firstui-uni/firstui/fui-row/fui-row.vue create mode 100644 node_modules/firstui-uni/firstui/fui-section/fui-section.vue create mode 100644 node_modules/firstui-uni/firstui/fui-segmented-control/fui-segmented-control.vue create mode 100644 node_modules/firstui-uni/firstui/fui-status-bar/fui-status-bar.vue create mode 100644 node_modules/firstui-uni/firstui/fui-swipe-action/bindingx.js create mode 100644 node_modules/firstui-uni/firstui/fui-swipe-action/fui-swipe-action.vue create mode 100644 node_modules/firstui-uni/firstui/fui-swipe-action/index.wxs create mode 100644 node_modules/firstui-uni/firstui/fui-swipe-action/mpjs.js create mode 100644 node_modules/firstui-uni/firstui/fui-swipe-action/mpwxs.js create mode 100644 node_modules/firstui-uni/firstui/fui-swipeaction-group/fui-swipeaction-group.vue create mode 100644 node_modules/firstui-uni/firstui/fui-switch/fui-switch.vue create mode 100644 node_modules/firstui-uni/firstui/fui-tabs/fui-tabs.vue create mode 100644 node_modules/firstui-uni/firstui/fui-tag/fui-tag.vue create mode 100644 node_modules/firstui-uni/firstui/fui-text/fui-text.vue create mode 100644 node_modules/firstui-uni/firstui/fui-textarea/fui-textarea.vue create mode 100644 node_modules/firstui-uni/firstui/fui-theme/fui-theme.css create mode 100644 node_modules/firstui-uni/firstui/fui-toast/fui-toast.vue create mode 100644 node_modules/firstui-uni/firstui/fui-top-popup/fui-top-popup.vue create mode 100644 node_modules/firstui-uni/firstui/fui-utils/index.js create mode 100644 node_modules/firstui-uni/package.json create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 pages.json create mode 100644 pages/student/index/index.vue create mode 100644 pages/student/login/forgot.vue create mode 100644 pages/student/login/login.vue create mode 100644 pages/student/my/my.vue create mode 100644 pages/student/timetable/index.vue create mode 100644 project.config.json create mode 100644 project.private.config.json create mode 100644 static/icon-img/delete.png create mode 100644 static/icon-img/empty.png create mode 100644 static/icon-img/guoqi.png create mode 100644 static/icon-img/kkry.png create mode 100644 static/icon-img/liu.png create mode 100644 static/icon-img/notice.png create mode 100644 static/icon-img/tou.png create mode 100644 static/icon-img/uploadImg.png create mode 100644 static/icon-img/used.png create mode 100644 static/icon-img/warn.png create mode 100644 static/icon-img/weixin.png create mode 100644 static/images/common/black_arrow_right.png create mode 100644 static/images/common/closex.png create mode 100644 static/images/common/clousex-big.png create mode 100644 static/images/common/common_icon_jump_gold.png create mode 100644 static/images/common/delete.png create mode 100644 static/images/common/edit.png create mode 100644 static/images/common/gift_icon_close_new.png create mode 100644 static/images/common/gouxuankuang.png create mode 100644 static/images/common/gray_arrow_down.png create mode 100644 static/images/common/icon-close.png create mode 100644 static/images/common/icon-drop-down.png create mode 100644 static/images/common/icon_about.png create mode 100644 static/images/common/icon_black_back.png create mode 100644 static/images/common/icon_jump_black3.png create mode 100644 static/images/common/image-delete.png create mode 100644 static/images/common/jump-r-arrow.png create mode 100644 static/images/common/menu_icon_empty.png create mode 100644 static/images/common/more-arrow-right.png create mode 100644 static/images/common/round-black-selected.png create mode 100644 static/images/common/round_add_disabled.png create mode 100644 static/images/common/round_add_normal.png create mode 100644 static/images/common/round_minus.png create mode 100644 static/images/common/search-icon.png create mode 100644 static/images/common/star_normal.png create mode 100644 static/images/home/chaungjian.png create mode 100644 static/images/home/tixing.png create mode 100644 static/images/home/wang.png create mode 100644 static/images/home/yong.png create mode 100644 static/images/index/icon_shopping_bag.png create mode 100644 static/images/index/manjian.png create mode 100644 static/images/index/me_icon_notification.png create mode 100644 static/images/index/menu_btn_close.png create mode 100644 static/images/index/menu_icon_popup_triangle_normal.png create mode 100644 static/images/index/menupopup_btn_share_normal.png create mode 100644 static/images/index/menupopup_btn_share_quanzi.png create mode 100644 static/images/index/menupopup_btn_share_wechat.png create mode 100644 static/images/index/rexiao.png create mode 100644 static/images/index/round-cancel.png create mode 100644 static/images/index/round_close_btn.png create mode 100644 static/images/index/shadow_yellow_star.png create mode 100644 static/images/index/tuijian.png create mode 100644 static/images/index/xinpin.png create mode 100644 static/images/index/yellow_star.png create mode 100644 static/images/login/login1.png create mode 100644 static/images/login/login2.png create mode 100644 static/images/login/wechat1.png create mode 100644 static/images/mall/b3d3a98e3c7f450aaa32fbec6aecdfaf.png create mode 100644 static/images/mall/img_pointmall_star.png create mode 100644 static/images/mall/me_img_banner_mall.png create mode 100644 static/images/mall/me_pointmall_img_nogift.png create mode 100644 static/images/mall/store_brh_home_page_normal.png create mode 100644 static/images/mall/store_brh_service_normal.png create mode 100644 static/images/member/me_club_task_img_done.png create mode 100644 static/images/my/b3d3a98e3c7f450aaa32fbec6aecdfaf.png create mode 100644 static/images/my/coupons-empty.png create mode 100644 static/images/my/icon_arrow.png create mode 100644 static/images/my/icon_attention.png create mode 100644 static/images/my/icon_giftcard.png create mode 100644 static/images/my/icon_rules.png create mode 100644 static/images/my/img_giftcard_empty.png create mode 100644 static/images/my/jf.png create mode 100644 static/images/my/me_icon_gift_card.png create mode 100644 static/images/my/me_icon_points.png create mode 100644 static/images/my/me_icon_quan.png create mode 100644 static/images/my/me_icon_wallet.png create mode 100644 static/images/my/member_benefits/me_rights_icon_1jia1.png create mode 100644 static/images/my/member_benefits/me_rights_icon_1jia1_dis.png create mode 100644 static/images/my/member_benefits/me_rights_icon_2jia1.png create mode 100644 static/images/my/member_benefits/me_rights_icon_2jia1_dis.png create mode 100644 static/images/my/member_benefits/me_rights_icon_free.png create mode 100644 static/images/my/member_benefits/me_rights_icon_free_dis.png create mode 100644 static/images/my/member_benefits/me_rights_icon_qingshi.png create mode 100644 static/images/my/member_benefits/me_rights_icon_qingshi_dis.png create mode 100644 static/images/my/member_benefits/me_rights_icon_waimai_new.png create mode 100644 static/images/my/member_benefits/me_rights_icon_waimai_new_dis.png create mode 100644 static/images/my/member_benefits/me_rights_icon_youxian_new.png create mode 100644 static/images/my/member_benefits/me_rights_icon_youxian_new_dis.png create mode 100644 static/images/my/nocoupon.png create mode 100644 static/images/my/scan-qrcode.png create mode 100644 static/images/my/ye.png create mode 100644 static/images/my/yhq.png create mode 100644 static/images/order/batch_invoice_icon.png create mode 100644 static/images/order/default_img_order.png create mode 100644 static/images/order/icon_making.png create mode 100644 static/images/order/icon_map.png create mode 100644 static/images/order/icon_phone.png create mode 100644 static/images/order/index2.vue create mode 100644 static/images/order/order_cancelpay.png create mode 100644 static/images/order/order_icon_address.png create mode 100644 static/images/order/order_icon_change.png create mode 100644 static/images/order/order_icon_service.png create mode 100644 static/images/order/order_icon_talk2.0.png create mode 100644 static/images/order/weixin-pay.png create mode 100644 static/images/pay/error.png create mode 100644 static/images/pay/success.png create mode 100644 static/images/tabbar/home.png create mode 100644 static/images/tabbar/home_selected.png create mode 100644 static/images/tabbar/index.png create mode 100644 static/images/tabbar/index_selected.png create mode 100644 static/images/tabbar/mart.png create mode 100644 static/images/tabbar/mart_selected.png create mode 100644 static/images/tabbar/my.png create mode 100644 static/images/tabbar/my_selected.png create mode 100644 static/images/tabbar/order.png create mode 100644 static/images/tabbar/order_selected.png create mode 100644 static/rate/none.png create mode 100644 static/styles/app.scss create mode 100644 store/index.js create mode 100644 uni.scss diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fecf8ae --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.hbuilderx +unpackage \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..10b731c --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ diff --git a/.idea/YongYaoTiXing_Admin.iml b/.idea/YongYaoTiXing_Admin.iml new file mode 100644 index 0000000..0c8867d --- /dev/null +++ b/.idea/YongYaoTiXing_Admin.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..0eefe32 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5366991 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..67cbdc2 --- /dev/null +++ b/App.vue @@ -0,0 +1,46 @@ + + + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..1e9bd0e --- /dev/null +++ b/README.en.md @@ -0,0 +1,36 @@ +# 用药提醒微信小程序 + +#### Description +用药提醒微信小程序 + +#### Software Architecture +Software architecture description + +#### Installation + +1. xxxx +2. xxxx +3. xxxx + +#### Instructions + +1. xxxx +2. xxxx +3. xxxx + +#### Contribution + +1. Fork the repository +2. Create Feat_xxx branch +3. Commit your code +4. Create Pull Request + + +#### Gitee Feature + +1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md +2. Gitee blog [blog.gitee.com](https://blog.gitee.com) +3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) +4. The most valuable open source project [GVP](https://gitee.com/gvp) +5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) +6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/api/Search.js b/api/Search.js new file mode 100644 index 0000000..09833ed --- /dev/null +++ b/api/Search.js @@ -0,0 +1,31 @@ +import http from '../common/axios.js' + +//获取搜索记录 +function search_record(data) { + let url = '/dnseyeapi/Search/record' + return http.get(url,data).then(res => { + return res; + }) +} + +//获取搜索记录 +function delete_record(data) { + let url = '/dnseyeapi/Search/deleterecord' + return http.get(url,data).then(res => { + return res; + }) +} + +//搜索 +function ferret_about(data) { + let url = '/dnseyeapi/Search/ferretabout' + return http.post(url,data).then(res => { + return res; + }) +} + +export default { + search_record, + delete_record, + ferret_about +} diff --git a/api/hygl.js b/api/hygl.js new file mode 100644 index 0000000..aebd81b --- /dev/null +++ b/api/hygl.js @@ -0,0 +1,79 @@ +import httpB from '../common/axiosB.js' + +//微信支付相关接口 + +export default { + test, + getSiteInfo, + getOpenid, + getMiniOpenid, + getUser, + getUserCoupons, + addOrder, + wxMpPay, + wxMiniPay, + getAdvertising, +} + +// 账号密码登录 +function test() { + let url = '/test' + return httpB.get(url) +} + +//获取站点信息 +function getSiteInfo(data) { + let url = '/getSiteInfo' + return httpB.get(url,data) +} + +//获取微信公众号openid +function getOpenid(data) { + let url = '/getOpenid' + return httpB.post(url,data) +} + +//获取微信小程序openid +function getMiniOpenid(data) { + let url = '/getMiniOpenid' + return httpB.post(url,data) +} + + + + +//获取用户信息 +function getUser(data){ + let url = '/getUser' + return httpB.get(url,data) +} + +//获取用户拥有的优惠券 +function getUserCoupons(data){ + let url = '/getUserCoupons' + return httpB.get(url,data) +} + +//创建订单接口 +function addOrder(data){ + let url = '/addOrder' + return httpB.get(url,data) +} + +//微信公众号支付 +function wxMpPay(data){ + let url = '/wxMpPay' + return httpB.post(url,data) +} + +//微信公众号支付 +function wxMiniPay(data){ + let url = '/wxMiniPay' + return httpB.post(url,data) +} + +//获取广告列表 +function getAdvertising(data){ + let url = '/getAdvertising' + return httpB.get(url,data) +} diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..df159e3 --- /dev/null +++ b/api/index.js @@ -0,0 +1,18 @@ + + +const json = { + +} + +export default (name, loading = true) => { + if(loading) { + uni.showLoading() + } + + return new Promise(resolve => { + setTimeout(() => { + uni.hideLoading() + resolve(json[name]) + }, 500) + }) +} \ No newline at end of file diff --git a/api/medication.js b/api/medication.js new file mode 100644 index 0000000..4491303 --- /dev/null +++ b/api/medication.js @@ -0,0 +1,177 @@ +import http from '../common/axios.js' + +// 账号密码登录 +function medication_login(data) { + let url = '/dnseyeapi/Login/login' + return http.post(url, data).then(res => { + return res; + }) +} + +// 发送短信验证码 +function VerificationCode(data) { + let url = '/dnseyeapi/Login/VerificationCode' + return http.post(url, data).then(res => { + return res; + }) +} + +// 短信验证码登录 +function codelogin(data) { + let url = '/dnseyeapi/Login/codelogin' + return http.post(url, data).then(res => { + return res; + }) +} + +// 微信小程序登录 +function wechatminilogin(data) { + let url = '/dnseyeapi/Login/wechatminilogin' + return http.post(url, data).then(res => { + return res; + }) +} + +//创建用药提醒 +function medication_create(data) { + let url = '/dnseyeapi/Medication/add' + return http.post(url, data).then(res => { + return res; + }) +} + +//编辑用药提醒 +function subscribe(data) { + let url = '/dnseyeapi/Medication/subscribe' + return http.post(url, data).then(res => { + return res; + }) +} + +//修改订阅状态 +function medication_edit(data) { + let url = '/dnseyeapi/Medication/edit' + return http.post(url, data).then(res => { + return res; + }) +} + +//提醒记录 +function homelist(data) { + let url = '/dnseyeapi/Medication/homelist' + return http.post(url, data).then(res => { + return res; + }) +} + +//更改是否用药状态 +function updatestatus(data) { + let url = '/dnseyeapi/Medication/updatestatus' + return http.post(url, data).then(res => { + return res; + }) +} + +//更改是否提醒状态 +function enablereminder(data) { + let url = '/dnseyeapi/Medication/enablereminder' + return http.post(url, data).then(res => { + return res; + }) +} + +//更改单条是否提醒状态 +function enablereminders(data) { + let url = '/dnseyeapi/Medication/enablereminders' + return http.post(url, data).then(res => { + return res; + }) +} + +//删除提醒 +function deletereminder(data) { + let url = '/dnseyeapi/Medication/deletereminder' + return http.post(url, data).then(res => { + return res; + }) +} + +//提醒管理 +function remindermanage(data) { + let url = '/dnseyeapi/Medication/remindermanage' + return http.post(url, data).then(res => { + return res; + }) +} + +//搜索结果点击 +function homesingle(data) { + let url = '/dnseyeapi/Medication/homesingle' + return http.post(url, data).then(res => { + return res; + }) +} + +//获取最新提醒 +function getuptodate(data) { + let url = '/dnseyeapi/Myinfo/getuptodate' + return http.post(url, data).then(res => { + return res; + }) +} + +//picker值 +function picker(data) { + let url = '/dnseyeapi/Medication/picker' + return http.post(url, data).then(res => { + return res; + }) +} + +//获取没有订阅的药品名称 +function determine(data) { + let url = '/dnseyeapi/Medication/determine' + return http.post(url, data).then(res => { + return res; + }) +} + +//修改订阅状态 +function determinetype(data) { + let url = '/dnseyeapi/Medication/determinetype' + return http.post(url, data).then(res => { + return res; + }) +} + +//获取分享图片 +function shareimage() { + let url = '/dnseyeapi/Medication/shareimage' + return http.post(url).then(res => { + return res; + }) +} + + +export default { + medication_create, + VerificationCode, + codelogin, + // register, + wechatminilogin, + medication_login, + getuptodate, + medication_edit, + homelist, + updatestatus, + enablereminder, + deletereminder, + remindermanage, + homesingle, + subscribe, + enablereminders, + picker, + determine, + determinetype, + shareimage +} \ No newline at end of file diff --git a/api/user.js b/api/user.js new file mode 100644 index 0000000..f67444d --- /dev/null +++ b/api/user.js @@ -0,0 +1,175 @@ +import http from '../common/axios.js' + +// 发布内容 +function activity_add(data) { + let url = '/dnseyeapi/Activity/add' + return http.post(url, data).then(res => { + return res; + }) +} + +// 查看内容 +function activity_index(data) { + let url = '/dnseyeapi/Activity/index' + return http.post(url,data).then(res => { + return res; + }) +} + +// 查看详情内容 +function coninfo(data) { + let url = '/dnseyeapi/Activity/coninfo' + return http.post(url,data).then(res => { + return res; + }) +} + +// 查看内容 +function activity_like(data) { + let url = '/dnseyeapi/Activity/like' + return http.post(url,data).then(res => { + return res; + }) +} + +// 我的页面计数 +function mycount(data) { + let url = '/dnseyeapi/Activity/mycount' + return http.post(url,data).then(res => { + return res; + }) +} + +// 收藏页面 +function mycollect(data) { + let url = '/dnseyeapi/Activity/mycollect' + return http.post(url,data).then(res => { + return res; + }) +} + +// 获取用户信息 +function getuserinfo(data) { + let url = '/dnseyeapi/Myinfo/getuserinfo' + return http.post(url,data).then(res => { + return res; + }) +} + +// 修改用户信息 +function updateinfo(data) { + let url = '/dnseyeapi/Myinfo/updateinfo' + return http.post(url,data).then(res => { + return res; + }) +} + +// 修改用户通知状态 +function updatestatus(data) { + let url = '/dnseyeapi/Myinfo/updatestatus' + return http.post(url,data).then(res => { + return res; + }) +} + +// 帮助中心 +function helplist() { + let url = '/dnseyeapi/Activity/helplist' + return http.post(url).then(res => { + return res; + }) +} + +//图片验证码 +function verify() { + let url = '/dnseyeapi/Login/verify' + return http.post(url).then(res => { + return res; + }) +} + +//图片验证码 +function forgot(data) { + let url = '/dnseyeapi/Login/forgot' + return http.post(url,data).then(res => { + return res; + }) +} + +//评论 +function comment(data) { + let url = '/dnseyeapi/Activity/comment' + return http.post(url,data).then(res => { + return res; + }) +} + +//评论详情 +function comment_list(data) { + let url = '/dnseyeapi/Activity/comment_list' + return http.post(url,data).then(res => { + return res; + }) +} + +//子评论 +function comments(data) { + let url = '/dnseyeapi/Activity/comments' + return http.post(url,data).then(res => { + return res; + }) +} + +//子评论 +function comments_list(data) { + let url = '/dnseyeapi/Activity/comments_list' + return http.post(url,data).then(res => { + return res; + }) +} + +//获取城市信息 +function locate_information(data) { + let url = '/dnseyeapi/Activity/locate_information' + return http.post(url,data).then(res => { + return res; + }) +} + +//查看用户是否关注公众号 +function is_interest(data) { + let url = '/dnseyeapi/Myinfo/is_interest' + return http.post(url,data).then(res => { + return res; + }) +} + +//获取公众号二维码及文字 +function gzhconfig(data) { + let url = '/dnseyeapi/Myinfo/gzhconfig' + return http.post(url,data).then(res => { + return res; + }) +} + +export default { + activity_add, + activity_index, + activity_like, + mycount, + mycollect, + getuserinfo, + helplist, + verify, + forgot, + updateinfo, + updatestatus, + coninfo, + comments, + comment_list, + comment, + comments_list, + locate_information, + is_interest, + gzhconfig +} \ No newline at end of file diff --git a/common/axios.js b/common/axios.js new file mode 100644 index 0000000..d5f4930 --- /dev/null +++ b/common/axios.js @@ -0,0 +1,89 @@ +import { + Api_url +} from './config' +// import {Token} from './token.js' +// var token = new Token(); + +export default { + async post(url, param, yanci = false) { + // wx.showLoading(); + + // setTimeout(() => { + // wx.hideLoading(); + // }, 3000) + const res = await this.uni_request(url, param, 'post') + + return res; + }, + async get(url, param, yanci = false) { + // wx.showLoading(); + // setTimeout(() => { + // wx.hideLoading(); + // }, 3000) + const res = await this.uni_request(url, param, 'get') + return res; + }, + async put(url, param) { + // wx.showLoading(); + // setTimeout(() => { + // wx.hideLoading(); + // }, 3000) + const res = await this.uni_request(url, param, 'put') + return res; + }, + uni_request(url, param, method, again_quest = false) { + const that = this + uni.showLoading({ + title:'加载中...' + }) + return new Promise((cback, reject) => { + console.log(Api_url + url) + uni.request({ + url: Api_url + url, + data: param, + method: method, + header: { + 'token': uni.getStorageSync("token") + }, + }).then(data => { //data为一个数组,数组第一项为错误信息,第二项为返回数据 + var [error, res] = data; + uni.hideLoading() + var res_code = res.statusCode.toString(); + if (res_code.charAt(0) == 2) { + if (res_code == 200) { + cback(res.data); + } else { + console.log('201', url) + uni.showToast({ + title: res.data.msg, + icon: 'none' + }) + } + } else { + if (res_code == 401) { + //登录失效 + console.log('401', url) + if (again_quest) { + // token.getTokenFromServer(()=>{ + // const again_res=that.uni_request(url,param,method,false) + // //注意这里需要cback,因为是上一个promis的cback + // cback(again_res); + // }); + } else { + console.log('再次登陆仍然失败', url) + } + } else { + console.log('400/500', url, error, res) + uni.showToast({ + title: res.data.msg ? res.data.msg : '请求异常', + icon: 'none' + }) + } + } + }).catch(err => { + console.log('catch:', err); + }) + }) + }, + +} diff --git a/common/axiosB.js b/common/axiosB.js new file mode 100644 index 0000000..9968c69 --- /dev/null +++ b/common/axiosB.js @@ -0,0 +1,89 @@ +import { + Api_url_B +} from './config' +// import {Token} from './token.js' +// var token = new Token(); + +export default { + async post(url, param, yanci = false) { + // wx.showLoading(); + + // setTimeout(() => { + // wx.hideLoading(); + // }, 3000) + const res = await this.uni_request(url, param, 'post') + + return res; + }, + async get(url, param, yanci = false) { + // wx.showLoading(); + // setTimeout(() => { + // wx.hideLoading(); + // }, 3000) + const res = await this.uni_request(url, param, 'get') + return res; + }, + async put(url, param) { + // wx.showLoading(); + // setTimeout(() => { + // wx.hideLoading(); + // }, 3000) + const res = await this.uni_request(url, param, 'put') + return res; + }, + uni_request(url, param, method, again_quest = false) { + const that = this + uni.showLoading({ + title:'加载中...' + }) + return new Promise((cback, reject) => { + console.log(Api_url_B + url) + uni.request({ + url: Api_url_B + url, + data: param, + method: method, + header: { + 'token': uni.getStorageSync("token") + }, + }).then(data => { //data为一个数组,数组第一项为错误信息,第二项为返回数据 + var [error, res] = data; + uni.hideLoading() + var res_code = res.statusCode.toString(); + if (res_code.charAt(0) == 2) { + if (res_code == 200) { + cback(res.data); + } else { + console.log('201', url) + uni.showToast({ + title: res.data.msg, + icon: 'none' + }) + } + } else { + if (res_code == 401) { + //登录失效 + console.log('401', url) + if (again_quest) { + // token.getTokenFromServer(()=>{ + // const again_res=that.uni_request(url,param,method,false) + // //注意这里需要cback,因为是上一个promis的cback + // cback(again_res); + // }); + } else { + console.log('再次登陆仍然失败', url) + } + } else { + console.log('400/500', url, error, res) + uni.showToast({ + title: res.data.msg ? res.data.msg : '请求异常', + icon: 'none' + }) + } + } + }).catch(err => { + console.log('catch:', err); + }) + }) + }, + +} diff --git a/common/config.js b/common/config.js new file mode 100644 index 0000000..ee6ec31 --- /dev/null +++ b/common/config.js @@ -0,0 +1,8 @@ +const Api_url='https://medication.zeyan.wang/' +const img_domian = 'https://medication.zeyan.wang/' +const IsDemo = false + +// const Api_url_B='http://hycrm.zeyan.wang/api/hygl' +const Api_url_B='https://zhifuguanli.zeyan.wang/api/hygl' + +export {Api_url,IsDemo,img_domian,Api_url_B} \ No newline at end of file diff --git a/common/mixins.js b/common/mixins.js new file mode 100644 index 0000000..e69de29 diff --git a/common/mixins/shopro-share.js b/common/mixins/shopro-share.js new file mode 100644 index 0000000..4e089e4 --- /dev/null +++ b/common/mixins/shopro-share.js @@ -0,0 +1,23 @@ + +export default { + data() { + return { + + } + }, + onLoad(options) { + + }, + onShow() { + + }, + methods: { + show_data() {}, + }, + onPullDownRefresh() { + this.show_data(); + setTimeout(function () { + uni.stopPullDownRefresh(); + }, 2000); + }, +} diff --git a/common/uqrcode.js b/common/uqrcode.js new file mode 100644 index 0000000..e21bbb4 --- /dev/null +++ b/common/uqrcode.js @@ -0,0 +1,1380 @@ +//--------------------------------------------------------------------- +// github https://github.com/Sansnn/uQRCode +//--------------------------------------------------------------------- + +let uQRCode = {}; + +(function() { + //--------------------------------------------------------------------- + // QRCode for JavaScript + // + // Copyright (c) 2009 Kazuhiko Arase + // + // URL: http://www.d-project.com/ + // + // Licensed under the MIT license: + // http://www.opensource.org/licenses/mit-license.php + // + // The word "QR Code" is registered trademark of + // DENSO WAVE INCORPORATED + // http://www.denso-wave.com/qrcode/faqpatent-e.html + // + //--------------------------------------------------------------------- + + //--------------------------------------------------------------------- + // QR8bitByte + //--------------------------------------------------------------------- + + function QR8bitByte(data) { + this.mode = QRMode.MODE_8BIT_BYTE; + this.data = data; + } + + QR8bitByte.prototype = { + + getLength: function(buffer) { + return this.data.length; + }, + + write: function(buffer) { + for (var i = 0; i < this.data.length; i++) { + // not JIS ... + buffer.put(this.data.charCodeAt(i), 8); + } + } + }; + + //--------------------------------------------------------------------- + // QRCode + //--------------------------------------------------------------------- + + function QRCode(typeNumber, errorCorrectLevel) { + this.typeNumber = typeNumber; + this.errorCorrectLevel = errorCorrectLevel; + this.modules = null; + this.moduleCount = 0; + this.dataCache = null; + this.dataList = new Array(); + } + + QRCode.prototype = { + + addData: function(data) { + var newData = new QR8bitByte(data); + this.dataList.push(newData); + this.dataCache = null; + }, + + isDark: function(row, col) { + if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) { + throw new Error(row + "," + col); + } + return this.modules[row][col]; + }, + + getModuleCount: function() { + return this.moduleCount; + }, + + make: function() { + // Calculate automatically typeNumber if provided is < 1 + if (this.typeNumber < 1) { + var typeNumber = 1; + for (typeNumber = 1; typeNumber < 40; typeNumber++) { + var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel); + + var buffer = new QRBitBuffer(); + var totalDataCount = 0; + for (var i = 0; i < rsBlocks.length; i++) { + totalDataCount += rsBlocks[i].dataCount; + } + + for (var i = 0; i < this.dataList.length; i++) { + var data = this.dataList[i]; + buffer.put(data.mode, 4); + buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber)); + data.write(buffer); + } + if (buffer.getLengthInBits() <= totalDataCount * 8) + break; + } + this.typeNumber = typeNumber; + } + this.makeImpl(false, this.getBestMaskPattern()); + }, + + makeImpl: function(test, maskPattern) { + + this.moduleCount = this.typeNumber * 4 + 17; + this.modules = new Array(this.moduleCount); + + for (var row = 0; row < this.moduleCount; row++) { + + this.modules[row] = new Array(this.moduleCount); + + for (var col = 0; col < this.moduleCount; col++) { + this.modules[row][col] = null; //(col + row) % 3; + } + } + + this.setupPositionProbePattern(0, 0); + this.setupPositionProbePattern(this.moduleCount - 7, 0); + this.setupPositionProbePattern(0, this.moduleCount - 7); + this.setupPositionAdjustPattern(); + this.setupTimingPattern(); + this.setupTypeInfo(test, maskPattern); + + if (this.typeNumber >= 7) { + this.setupTypeNumber(test); + } + + if (this.dataCache == null) { + this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList); + } + + this.mapData(this.dataCache, maskPattern); + }, + + setupPositionProbePattern: function(row, col) { + + for (var r = -1; r <= 7; r++) { + + if (row + r <= -1 || this.moduleCount <= row + r) continue; + + for (var c = -1; c <= 7; c++) { + + if (col + c <= -1 || this.moduleCount <= col + c) continue; + + if ((0 <= r && r <= 6 && (c == 0 || c == 6)) || + (0 <= c && c <= 6 && (r == 0 || r == 6)) || + (2 <= r && r <= 4 && 2 <= c && c <= 4)) { + this.modules[row + r][col + c] = true; + } else { + this.modules[row + r][col + c] = false; + } + } + } + }, + + getBestMaskPattern: function() { + + var minLostPoint = 0; + var pattern = 0; + + for (var i = 0; i < 8; i++) { + + this.makeImpl(true, i); + + var lostPoint = QRUtil.getLostPoint(this); + + if (i == 0 || minLostPoint > lostPoint) { + minLostPoint = lostPoint; + pattern = i; + } + } + + return pattern; + }, + + createMovieClip: function(target_mc, instance_name, depth) { + + var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth); + var cs = 1; + + this.make(); + + for (var row = 0; row < this.modules.length; row++) { + + var y = row * cs; + + for (var col = 0; col < this.modules[row].length; col++) { + + var x = col * cs; + var dark = this.modules[row][col]; + + if (dark) { + qr_mc.beginFill(0, 100); + qr_mc.moveTo(x, y); + qr_mc.lineTo(x + cs, y); + qr_mc.lineTo(x + cs, y + cs); + qr_mc.lineTo(x, y + cs); + qr_mc.endFill(); + } + } + } + + return qr_mc; + }, + + setupTimingPattern: function() { + + for (var r = 8; r < this.moduleCount - 8; r++) { + if (this.modules[r][6] != null) { + continue; + } + this.modules[r][6] = (r % 2 == 0); + } + + for (var c = 8; c < this.moduleCount - 8; c++) { + if (this.modules[6][c] != null) { + continue; + } + this.modules[6][c] = (c % 2 == 0); + } + }, + + setupPositionAdjustPattern: function() { + + var pos = QRUtil.getPatternPosition(this.typeNumber); + + for (var i = 0; i < pos.length; i++) { + + for (var j = 0; j < pos.length; j++) { + + var row = pos[i]; + var col = pos[j]; + + if (this.modules[row][col] != null) { + continue; + } + + for (var r = -2; r <= 2; r++) { + + for (var c = -2; c <= 2; c++) { + + if (r == -2 || r == 2 || c == -2 || c == 2 || + (r == 0 && c == 0)) { + this.modules[row + r][col + c] = true; + } else { + this.modules[row + r][col + c] = false; + } + } + } + } + } + }, + + setupTypeNumber: function(test) { + + var bits = QRUtil.getBCHTypeNumber(this.typeNumber); + + for (var i = 0; i < 18; i++) { + var mod = (!test && ((bits >> i) & 1) == 1); + this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod; + } + + for (var i = 0; i < 18; i++) { + var mod = (!test && ((bits >> i) & 1) == 1); + this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod; + } + }, + + setupTypeInfo: function(test, maskPattern) { + + var data = (this.errorCorrectLevel << 3) | maskPattern; + var bits = QRUtil.getBCHTypeInfo(data); + + // vertical + for (var i = 0; i < 15; i++) { + + var mod = (!test && ((bits >> i) & 1) == 1); + + if (i < 6) { + this.modules[i][8] = mod; + } else if (i < 8) { + this.modules[i + 1][8] = mod; + } else { + this.modules[this.moduleCount - 15 + i][8] = mod; + } + } + + // horizontal + for (var i = 0; i < 15; i++) { + + var mod = (!test && ((bits >> i) & 1) == 1); + + if (i < 8) { + this.modules[8][this.moduleCount - i - 1] = mod; + } else if (i < 9) { + this.modules[8][15 - i - 1 + 1] = mod; + } else { + this.modules[8][15 - i - 1] = mod; + } + } + + // fixed module + this.modules[this.moduleCount - 8][8] = (!test); + + }, + + mapData: function(data, maskPattern) { + + var inc = -1; + var row = this.moduleCount - 1; + var bitIndex = 7; + var byteIndex = 0; + + for (var col = this.moduleCount - 1; col > 0; col -= 2) { + + if (col == 6) col--; + + while (true) { + + for (var c = 0; c < 2; c++) { + + if (this.modules[row][col - c] == null) { + + var dark = false; + + if (byteIndex < data.length) { + dark = (((data[byteIndex] >>> bitIndex) & 1) == 1); + } + + var mask = QRUtil.getMask(maskPattern, row, col - c); + + if (mask) { + dark = !dark; + } + + this.modules[row][col - c] = dark; + bitIndex--; + + if (bitIndex == -1) { + byteIndex++; + bitIndex = 7; + } + } + } + + row += inc; + + if (row < 0 || this.moduleCount <= row) { + row -= inc; + inc = -inc; + break; + } + } + } + + } + + }; + + QRCode.PAD0 = 0xEC; + QRCode.PAD1 = 0x11; + + QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) { + + var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); + + var buffer = new QRBitBuffer(); + + for (var i = 0; i < dataList.length; i++) { + var data = dataList[i]; + buffer.put(data.mode, 4); + buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber)); + data.write(buffer); + } + + // calc num max data. + var totalDataCount = 0; + for (var i = 0; i < rsBlocks.length; i++) { + totalDataCount += rsBlocks[i].dataCount; + } + + if (buffer.getLengthInBits() > totalDataCount * 8) { + throw new Error("code length overflow. (" + + buffer.getLengthInBits() + + ">" + + totalDataCount * 8 + + ")"); + } + + // end code + if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { + buffer.put(0, 4); + } + + // padding + while (buffer.getLengthInBits() % 8 != 0) { + buffer.putBit(false); + } + + // padding + while (true) { + + if (buffer.getLengthInBits() >= totalDataCount * 8) { + break; + } + buffer.put(QRCode.PAD0, 8); + + if (buffer.getLengthInBits() >= totalDataCount * 8) { + break; + } + buffer.put(QRCode.PAD1, 8); + } + + return QRCode.createBytes(buffer, rsBlocks); + } + + QRCode.createBytes = function(buffer, rsBlocks) { + + var offset = 0; + + var maxDcCount = 0; + var maxEcCount = 0; + + var dcdata = new Array(rsBlocks.length); + var ecdata = new Array(rsBlocks.length); + + for (var r = 0; r < rsBlocks.length; r++) { + + var dcCount = rsBlocks[r].dataCount; + var ecCount = rsBlocks[r].totalCount - dcCount; + + maxDcCount = Math.max(maxDcCount, dcCount); + maxEcCount = Math.max(maxEcCount, ecCount); + + dcdata[r] = new Array(dcCount); + + for (var i = 0; i < dcdata[r].length; i++) { + dcdata[r][i] = 0xff & buffer.buffer[i + offset]; + } + offset += dcCount; + + var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); + var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1); + + var modPoly = rawPoly.mod(rsPoly); + ecdata[r] = new Array(rsPoly.getLength() - 1); + for (var i = 0; i < ecdata[r].length; i++) { + var modIndex = i + modPoly.getLength() - ecdata[r].length; + ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0; + } + + } + + var totalCodeCount = 0; + for (var i = 0; i < rsBlocks.length; i++) { + totalCodeCount += rsBlocks[i].totalCount; + } + + var data = new Array(totalCodeCount); + var index = 0; + + for (var i = 0; i < maxDcCount; i++) { + for (var r = 0; r < rsBlocks.length; r++) { + if (i < dcdata[r].length) { + data[index++] = dcdata[r][i]; + } + } + } + + for (var i = 0; i < maxEcCount; i++) { + for (var r = 0; r < rsBlocks.length; r++) { + if (i < ecdata[r].length) { + data[index++] = ecdata[r][i]; + } + } + } + + return data; + + } + + //--------------------------------------------------------------------- + // QRMode + //--------------------------------------------------------------------- + + var QRMode = { + MODE_NUMBER: 1 << 0, + MODE_ALPHA_NUM: 1 << 1, + MODE_8BIT_BYTE: 1 << 2, + MODE_KANJI: 1 << 3 + }; + + //--------------------------------------------------------------------- + // QRErrorCorrectLevel + //--------------------------------------------------------------------- + + var QRErrorCorrectLevel = { + L: 1, + M: 0, + Q: 3, + H: 2 + }; + + //--------------------------------------------------------------------- + // QRMaskPattern + //--------------------------------------------------------------------- + + var QRMaskPattern = { + PATTERN000: 0, + PATTERN001: 1, + PATTERN010: 2, + PATTERN011: 3, + PATTERN100: 4, + PATTERN101: 5, + PATTERN110: 6, + PATTERN111: 7 + }; + + //--------------------------------------------------------------------- + // QRUtil + //--------------------------------------------------------------------- + + var QRUtil = { + + PATTERN_POSITION_TABLE: [ + [], + [6, 18], + [6, 22], + [6, 26], + [6, 30], + [6, 34], + [6, 22, 38], + [6, 24, 42], + [6, 26, 46], + [6, 28, 50], + [6, 30, 54], + [6, 32, 58], + [6, 34, 62], + [6, 26, 46, 66], + [6, 26, 48, 70], + [6, 26, 50, 74], + [6, 30, 54, 78], + [6, 30, 56, 82], + [6, 30, 58, 86], + [6, 34, 62, 90], + [6, 28, 50, 72, 94], + [6, 26, 50, 74, 98], + [6, 30, 54, 78, 102], + [6, 28, 54, 80, 106], + [6, 32, 58, 84, 110], + [6, 30, 58, 86, 114], + [6, 34, 62, 90, 118], + [6, 26, 50, 74, 98, 122], + [6, 30, 54, 78, 102, 126], + [6, 26, 52, 78, 104, 130], + [6, 30, 56, 82, 108, 134], + [6, 34, 60, 86, 112, 138], + [6, 30, 58, 86, 114, 142], + [6, 34, 62, 90, 118, 146], + [6, 30, 54, 78, 102, 126, 150], + [6, 24, 50, 76, 102, 128, 154], + [6, 28, 54, 80, 106, 132, 158], + [6, 32, 58, 84, 110, 136, 162], + [6, 26, 54, 82, 110, 138, 166], + [6, 30, 58, 86, 114, 142, 170] + ], + + G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0), + G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0), + G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1), + + getBCHTypeInfo: function(data) { + var d = data << 10; + while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) { + d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15))); + } + return ((data << 10) | d) ^ QRUtil.G15_MASK; + }, + + getBCHTypeNumber: function(data) { + var d = data << 12; + while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) { + d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18))); + } + return (data << 12) | d; + }, + + getBCHDigit: function(data) { + + var digit = 0; + + while (data != 0) { + digit++; + data >>>= 1; + } + + return digit; + }, + + getPatternPosition: function(typeNumber) { + return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1]; + }, + + getMask: function(maskPattern, i, j) { + + switch (maskPattern) { + + case QRMaskPattern.PATTERN000: + return (i + j) % 2 == 0; + case QRMaskPattern.PATTERN001: + return i % 2 == 0; + case QRMaskPattern.PATTERN010: + return j % 3 == 0; + case QRMaskPattern.PATTERN011: + return (i + j) % 3 == 0; + case QRMaskPattern.PATTERN100: + return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0; + case QRMaskPattern.PATTERN101: + return (i * j) % 2 + (i * j) % 3 == 0; + case QRMaskPattern.PATTERN110: + return ((i * j) % 2 + (i * j) % 3) % 2 == 0; + case QRMaskPattern.PATTERN111: + return ((i * j) % 3 + (i + j) % 2) % 2 == 0; + + default: + throw new Error("bad maskPattern:" + maskPattern); + } + }, + + getErrorCorrectPolynomial: function(errorCorrectLength) { + + var a = new QRPolynomial([1], 0); + + for (var i = 0; i < errorCorrectLength; i++) { + a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0)); + } + + return a; + }, + + getLengthInBits: function(mode, type) { + + if (1 <= type && type < 10) { + + // 1 - 9 + + switch (mode) { + case QRMode.MODE_NUMBER: + return 10; + case QRMode.MODE_ALPHA_NUM: + return 9; + case QRMode.MODE_8BIT_BYTE: + return 8; + case QRMode.MODE_KANJI: + return 8; + default: + throw new Error("mode:" + mode); + } + + } else if (type < 27) { + + // 10 - 26 + + switch (mode) { + case QRMode.MODE_NUMBER: + return 12; + case QRMode.MODE_ALPHA_NUM: + return 11; + case QRMode.MODE_8BIT_BYTE: + return 16; + case QRMode.MODE_KANJI: + return 10; + default: + throw new Error("mode:" + mode); + } + + } else if (type < 41) { + + // 27 - 40 + + switch (mode) { + case QRMode.MODE_NUMBER: + return 14; + case QRMode.MODE_ALPHA_NUM: + return 13; + case QRMode.MODE_8BIT_BYTE: + return 16; + case QRMode.MODE_KANJI: + return 12; + default: + throw new Error("mode:" + mode); + } + + } else { + throw new Error("type:" + type); + } + }, + + getLostPoint: function(qrCode) { + + var moduleCount = qrCode.getModuleCount(); + + var lostPoint = 0; + + // LEVEL1 + + for (var row = 0; row < moduleCount; row++) { + + for (var col = 0; col < moduleCount; col++) { + + var sameCount = 0; + var dark = qrCode.isDark(row, col); + + for (var r = -1; r <= 1; r++) { + + if (row + r < 0 || moduleCount <= row + r) { + continue; + } + + for (var c = -1; c <= 1; c++) { + + if (col + c < 0 || moduleCount <= col + c) { + continue; + } + + if (r == 0 && c == 0) { + continue; + } + + if (dark == qrCode.isDark(row + r, col + c)) { + sameCount++; + } + } + } + + if (sameCount > 5) { + lostPoint += (3 + sameCount - 5); + } + } + } + + // LEVEL2 + + for (var row = 0; row < moduleCount - 1; row++) { + for (var col = 0; col < moduleCount - 1; col++) { + var count = 0; + if (qrCode.isDark(row, col)) count++; + if (qrCode.isDark(row + 1, col)) count++; + if (qrCode.isDark(row, col + 1)) count++; + if (qrCode.isDark(row + 1, col + 1)) count++; + if (count == 0 || count == 4) { + lostPoint += 3; + } + } + } + + // LEVEL3 + + for (var row = 0; row < moduleCount; row++) { + for (var col = 0; col < moduleCount - 6; col++) { + if (qrCode.isDark(row, col) && + !qrCode.isDark(row, col + 1) && + qrCode.isDark(row, col + 2) && + qrCode.isDark(row, col + 3) && + qrCode.isDark(row, col + 4) && + !qrCode.isDark(row, col + 5) && + qrCode.isDark(row, col + 6)) { + lostPoint += 40; + } + } + } + + for (var col = 0; col < moduleCount; col++) { + for (var row = 0; row < moduleCount - 6; row++) { + if (qrCode.isDark(row, col) && + !qrCode.isDark(row + 1, col) && + qrCode.isDark(row + 2, col) && + qrCode.isDark(row + 3, col) && + qrCode.isDark(row + 4, col) && + !qrCode.isDark(row + 5, col) && + qrCode.isDark(row + 6, col)) { + lostPoint += 40; + } + } + } + + // LEVEL4 + + var darkCount = 0; + + for (var col = 0; col < moduleCount; col++) { + for (var row = 0; row < moduleCount; row++) { + if (qrCode.isDark(row, col)) { + darkCount++; + } + } + } + + var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; + lostPoint += ratio * 10; + + return lostPoint; + } + + }; + + + //--------------------------------------------------------------------- + // QRMath + //--------------------------------------------------------------------- + + var QRMath = { + + glog: function(n) { + + if (n < 1) { + throw new Error("glog(" + n + ")"); + } + + return QRMath.LOG_TABLE[n]; + }, + + gexp: function(n) { + + while (n < 0) { + n += 255; + } + + while (n >= 256) { + n -= 255; + } + + return QRMath.EXP_TABLE[n]; + }, + + EXP_TABLE: new Array(256), + + LOG_TABLE: new Array(256) + + }; + + for (var i = 0; i < 8; i++) { + QRMath.EXP_TABLE[i] = 1 << i; + } + for (var i = 8; i < 256; i++) { + QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ + QRMath.EXP_TABLE[i - 5] ^ + QRMath.EXP_TABLE[i - 6] ^ + QRMath.EXP_TABLE[i - 8]; + } + for (var i = 0; i < 255; i++) { + QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i; + } + + //--------------------------------------------------------------------- + // QRPolynomial + //--------------------------------------------------------------------- + + function QRPolynomial(num, shift) { + + if (num.length == undefined) { + throw new Error(num.length + "/" + shift); + } + + var offset = 0; + + while (offset < num.length && num[offset] == 0) { + offset++; + } + + this.num = new Array(num.length - offset + shift); + for (var i = 0; i < num.length - offset; i++) { + this.num[i] = num[i + offset]; + } + } + + QRPolynomial.prototype = { + + get: function(index) { + return this.num[index]; + }, + + getLength: function() { + return this.num.length; + }, + + multiply: function(e) { + + var num = new Array(this.getLength() + e.getLength() - 1); + + for (var i = 0; i < this.getLength(); i++) { + for (var j = 0; j < e.getLength(); j++) { + num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j))); + } + } + + return new QRPolynomial(num, 0); + }, + + mod: function(e) { + + if (this.getLength() - e.getLength() < 0) { + return this; + } + + var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)); + + var num = new Array(this.getLength()); + + for (var i = 0; i < this.getLength(); i++) { + num[i] = this.get(i); + } + + for (var i = 0; i < e.getLength(); i++) { + num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio); + } + + // recursive call + return new QRPolynomial(num, 0).mod(e); + } + }; + + //--------------------------------------------------------------------- + // QRRSBlock + //--------------------------------------------------------------------- + + function QRRSBlock(totalCount, dataCount) { + this.totalCount = totalCount; + this.dataCount = dataCount; + } + + QRRSBlock.RS_BLOCK_TABLE = [ + + // L + // M + // Q + // H + + // 1 + [1, 26, 19], + [1, 26, 16], + [1, 26, 13], + [1, 26, 9], + + // 2 + [1, 44, 34], + [1, 44, 28], + [1, 44, 22], + [1, 44, 16], + + // 3 + [1, 70, 55], + [1, 70, 44], + [2, 35, 17], + [2, 35, 13], + + // 4 + [1, 100, 80], + [2, 50, 32], + [2, 50, 24], + [4, 25, 9], + + // 5 + [1, 134, 108], + [2, 67, 43], + [2, 33, 15, 2, 34, 16], + [2, 33, 11, 2, 34, 12], + + // 6 + [2, 86, 68], + [4, 43, 27], + [4, 43, 19], + [4, 43, 15], + + // 7 + [2, 98, 78], + [4, 49, 31], + [2, 32, 14, 4, 33, 15], + [4, 39, 13, 1, 40, 14], + + // 8 + [2, 121, 97], + [2, 60, 38, 2, 61, 39], + [4, 40, 18, 2, 41, 19], + [4, 40, 14, 2, 41, 15], + + // 9 + [2, 146, 116], + [3, 58, 36, 2, 59, 37], + [4, 36, 16, 4, 37, 17], + [4, 36, 12, 4, 37, 13], + + // 10 + [2, 86, 68, 2, 87, 69], + [4, 69, 43, 1, 70, 44], + [6, 43, 19, 2, 44, 20], + [6, 43, 15, 2, 44, 16], + + // 11 + [4, 101, 81], + [1, 80, 50, 4, 81, 51], + [4, 50, 22, 4, 51, 23], + [3, 36, 12, 8, 37, 13], + + // 12 + [2, 116, 92, 2, 117, 93], + [6, 58, 36, 2, 59, 37], + [4, 46, 20, 6, 47, 21], + [7, 42, 14, 4, 43, 15], + + // 13 + [4, 133, 107], + [8, 59, 37, 1, 60, 38], + [8, 44, 20, 4, 45, 21], + [12, 33, 11, 4, 34, 12], + + // 14 + [3, 145, 115, 1, 146, 116], + [4, 64, 40, 5, 65, 41], + [11, 36, 16, 5, 37, 17], + [11, 36, 12, 5, 37, 13], + + // 15 + [5, 109, 87, 1, 110, 88], + [5, 65, 41, 5, 66, 42], + [5, 54, 24, 7, 55, 25], + [11, 36, 12], + + // 16 + [5, 122, 98, 1, 123, 99], + [7, 73, 45, 3, 74, 46], + [15, 43, 19, 2, 44, 20], + [3, 45, 15, 13, 46, 16], + + // 17 + [1, 135, 107, 5, 136, 108], + [10, 74, 46, 1, 75, 47], + [1, 50, 22, 15, 51, 23], + [2, 42, 14, 17, 43, 15], + + // 18 + [5, 150, 120, 1, 151, 121], + [9, 69, 43, 4, 70, 44], + [17, 50, 22, 1, 51, 23], + [2, 42, 14, 19, 43, 15], + + // 19 + [3, 141, 113, 4, 142, 114], + [3, 70, 44, 11, 71, 45], + [17, 47, 21, 4, 48, 22], + [9, 39, 13, 16, 40, 14], + + // 20 + [3, 135, 107, 5, 136, 108], + [3, 67, 41, 13, 68, 42], + [15, 54, 24, 5, 55, 25], + [15, 43, 15, 10, 44, 16], + + // 21 + [4, 144, 116, 4, 145, 117], + [17, 68, 42], + [17, 50, 22, 6, 51, 23], + [19, 46, 16, 6, 47, 17], + + // 22 + [2, 139, 111, 7, 140, 112], + [17, 74, 46], + [7, 54, 24, 16, 55, 25], + [34, 37, 13], + + // 23 + [4, 151, 121, 5, 152, 122], + [4, 75, 47, 14, 76, 48], + [11, 54, 24, 14, 55, 25], + [16, 45, 15, 14, 46, 16], + + // 24 + [6, 147, 117, 4, 148, 118], + [6, 73, 45, 14, 74, 46], + [11, 54, 24, 16, 55, 25], + [30, 46, 16, 2, 47, 17], + + // 25 + [8, 132, 106, 4, 133, 107], + [8, 75, 47, 13, 76, 48], + [7, 54, 24, 22, 55, 25], + [22, 45, 15, 13, 46, 16], + + // 26 + [10, 142, 114, 2, 143, 115], + [19, 74, 46, 4, 75, 47], + [28, 50, 22, 6, 51, 23], + [33, 46, 16, 4, 47, 17], + + // 27 + [8, 152, 122, 4, 153, 123], + [22, 73, 45, 3, 74, 46], + [8, 53, 23, 26, 54, 24], + [12, 45, 15, 28, 46, 16], + + // 28 + [3, 147, 117, 10, 148, 118], + [3, 73, 45, 23, 74, 46], + [4, 54, 24, 31, 55, 25], + [11, 45, 15, 31, 46, 16], + + // 29 + [7, 146, 116, 7, 147, 117], + [21, 73, 45, 7, 74, 46], + [1, 53, 23, 37, 54, 24], + [19, 45, 15, 26, 46, 16], + + // 30 + [5, 145, 115, 10, 146, 116], + [19, 75, 47, 10, 76, 48], + [15, 54, 24, 25, 55, 25], + [23, 45, 15, 25, 46, 16], + + // 31 + [13, 145, 115, 3, 146, 116], + [2, 74, 46, 29, 75, 47], + [42, 54, 24, 1, 55, 25], + [23, 45, 15, 28, 46, 16], + + // 32 + [17, 145, 115], + [10, 74, 46, 23, 75, 47], + [10, 54, 24, 35, 55, 25], + [19, 45, 15, 35, 46, 16], + + // 33 + [17, 145, 115, 1, 146, 116], + [14, 74, 46, 21, 75, 47], + [29, 54, 24, 19, 55, 25], + [11, 45, 15, 46, 46, 16], + + // 34 + [13, 145, 115, 6, 146, 116], + [14, 74, 46, 23, 75, 47], + [44, 54, 24, 7, 55, 25], + [59, 46, 16, 1, 47, 17], + + // 35 + [12, 151, 121, 7, 152, 122], + [12, 75, 47, 26, 76, 48], + [39, 54, 24, 14, 55, 25], + [22, 45, 15, 41, 46, 16], + + // 36 + [6, 151, 121, 14, 152, 122], + [6, 75, 47, 34, 76, 48], + [46, 54, 24, 10, 55, 25], + [2, 45, 15, 64, 46, 16], + + // 37 + [17, 152, 122, 4, 153, 123], + [29, 74, 46, 14, 75, 47], + [49, 54, 24, 10, 55, 25], + [24, 45, 15, 46, 46, 16], + + // 38 + [4, 152, 122, 18, 153, 123], + [13, 74, 46, 32, 75, 47], + [48, 54, 24, 14, 55, 25], + [42, 45, 15, 32, 46, 16], + + // 39 + [20, 147, 117, 4, 148, 118], + [40, 75, 47, 7, 76, 48], + [43, 54, 24, 22, 55, 25], + [10, 45, 15, 67, 46, 16], + + // 40 + [19, 148, 118, 6, 149, 119], + [18, 75, 47, 31, 76, 48], + [34, 54, 24, 34, 55, 25], + [20, 45, 15, 61, 46, 16] + ]; + + QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) { + + var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); + + if (rsBlock == undefined) { + throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel); + } + + var length = rsBlock.length / 3; + + var list = new Array(); + + for (var i = 0; i < length; i++) { + + var count = rsBlock[i * 3 + 0]; + var totalCount = rsBlock[i * 3 + 1]; + var dataCount = rsBlock[i * 3 + 2]; + + for (var j = 0; j < count; j++) { + list.push(new QRRSBlock(totalCount, dataCount)); + } + } + + return list; + } + + QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) { + + switch (errorCorrectLevel) { + case QRErrorCorrectLevel.L: + return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; + case QRErrorCorrectLevel.M: + return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; + case QRErrorCorrectLevel.Q: + return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; + case QRErrorCorrectLevel.H: + return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; + default: + return undefined; + } + } + + //--------------------------------------------------------------------- + // QRBitBuffer + //--------------------------------------------------------------------- + + function QRBitBuffer() { + this.buffer = new Array(); + this.length = 0; + } + + QRBitBuffer.prototype = { + + get: function(index) { + var bufIndex = Math.floor(index / 8); + return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) == 1; + }, + + put: function(num, length) { + for (var i = 0; i < length; i++) { + this.putBit(((num >>> (length - i - 1)) & 1) == 1); + } + }, + + getLengthInBits: function() { + return this.length; + }, + + putBit: function(bit) { + + var bufIndex = Math.floor(this.length / 8); + if (this.buffer.length <= bufIndex) { + this.buffer.push(0); + } + + if (bit) { + this.buffer[bufIndex] |= (0x80 >>> (this.length % 8)); + } + + this.length++; + } + }; + + //--------------------------------------------------------------------- + // Support Chinese + //--------------------------------------------------------------------- + function utf16To8(text) { + var result = ''; + var c; + for (var i = 0; i < text.length; i++) { + c = text.charCodeAt(i); + if (c >= 0x0001 && c <= 0x007F) { + result += text.charAt(i); + } else if (c > 0x07FF) { + result += String.fromCharCode(0xE0 | c >> 12 & 0x0F); + result += String.fromCharCode(0x80 | c >> 6 & 0x3F); + result += String.fromCharCode(0x80 | c >> 0 & 0x3F); + } else { + result += String.fromCharCode(0xC0 | c >> 6 & 0x1F); + result += String.fromCharCode(0x80 | c >> 0 & 0x3F); + } + } + return result; + } + + uQRCode = { + + defaults: { + size: 258, + margin: 0, + backgroundColor: '#ffffff', + foregroundColor: '#000000', + fileType: 'png', // 'jpg', 'png' + correctLevel: 3, + typeNumber: -1 + }, + + make: function(options) { + var defaultOptions = { + canvasId: options.canvasId, + componentInstance: options.componentInstance, + text: options.text, + size: this.defaults.size, + margin: this.defaults.margin, + backgroundColor: this.defaults.backgroundColor, + foregroundColor: this.defaults.foregroundColor, + fileType: this.defaults.fileType, + correctLevel: this.defaults.correctLevel, + typeNumber: this.defaults.typeNumber + }; + if (options) { + for (var i in options) { + defaultOptions[i] = options[i]; + } + } + options = defaultOptions; + if (!options.canvasId) { + console.error('uQRCode: Please set canvasId!'); + return; + } + + function createCanvas() { + var qrcode = new QRCode(options.typeNumber, options.correctLevel); + qrcode.addData(utf16To8(options.text)); + qrcode.make(); + + var ctx = uni.createCanvasContext(options.canvasId, options.componentInstance); + ctx.setFillStyle(options.backgroundColor); + ctx.fillRect(0, 0, options.size, options.size); + + var tileW = (options.size - options.margin * 2) / qrcode.getModuleCount(); + var tileH = tileW; + + for (var row = 0; row < qrcode.getModuleCount(); row++) { + for (var col = 0; col < qrcode.getModuleCount(); col++) { + var style = qrcode.isDark(row, col) ? options.foregroundColor : options.backgroundColor; + ctx.setFillStyle(style); + var x = Math.round(col * tileW) + options.margin; + var y = Math.round(row * tileH) + options.margin; + var w = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW); + var h = Math.ceil((row + 1) * tileW) - Math.floor(row * tileW); + ctx.fillRect(x, y, w, h); + } + } + + setTimeout(function() { + ctx.draw(false, function() { + setTimeout(function() { + uni.canvasToTempFilePath({ + canvasId: options.canvasId, + fileType: options.fileType, + width: options.size, + height: options.size, + destWidth: options.size, + destHeight: options.size, + success: function(res) { + options.success && options.success(res.tempFilePath); + }, + fail: function(error) { + options.fail && options.fail(error); + }, + complete: function(res) { + options.complete && options.complete(res); + } + }, options.componentInstance); + }, options.text.length + 100); + }); + }, 150); + } + + createCanvas(); + } + + } + +})() + +export default uQRCode diff --git a/common/util.js b/common/util.js new file mode 100644 index 0000000..b645006 --- /dev/null +++ b/common/util.js @@ -0,0 +1,103 @@ +function formatTime(time) { + if (typeof time !== 'number' || time < 0) { + return time + } + + var hour = parseInt(time / 3600) + time = time % 3600 + var minute = parseInt(time / 60) + time = time % 60 + var second = time + + return ([hour, minute, second]).map(function(n) { + n = n.toString() + return n[1] ? n : '0' + n + }).join(':') +} + +function formatDateTime(date, fmt = 'yyyy-MM-dd hh:mm:ss') { + if(!date) { + return '' + } + if (typeof (date) === 'number') { + date = new Date(date * 1000) + } + var o = { + "M+": date.getMonth() + 1, //月份 + "d+": date.getDate(), //日 + "h+": date.getHours(), //小时 + "m+": date.getMinutes(), //分 + "s+": date.getSeconds(), //秒 + "q+": Math.floor((date.getMonth() + 3) / 3), //季度 + "S": date.getMilliseconds() //毫秒 + } + if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length)) + for (var k in o) + if (new RegExp("(" + k + ")").test(fmt)) + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))) + return fmt +} + +function formatLocation(longitude, latitude) { + if (typeof longitude === 'string' && typeof latitude === 'string') { + longitude = parseFloat(longitude) + latitude = parseFloat(latitude) + } + + longitude = longitude.toFixed(2) + latitude = latitude.toFixed(2) + + return { + longitude: longitude.toString().split('.'), + latitude: latitude.toString().split('.') + } +} + +var dateUtils = { + UNITS: { + '年': 31557600000, + '月': 2629800000, + '天': 86400000, + '小时': 3600000, + '分钟': 60000, + '秒': 1000 + }, + humanize: function(milliseconds) { + var humanize = ''; + for (var key in this.UNITS) { + if (milliseconds >= this.UNITS[key]) { + humanize = Math.floor(milliseconds / this.UNITS[key]) + key + '前'; + break; + } + } + return humanize || '刚刚'; + }, + format: function(dateStr) { + var date = this.parse(dateStr) + var diff = Date.now() - date.getTime(); + if (diff < this.UNITS['天']) { + return this.humanize(diff); + } + var _format = function(number) { + return (number < 10 ? ('0' + number) : number); + }; + return date.getFullYear() + '/' + _format(date.getMonth() + 1) + '/' + _format(date.getDate()) + '-' + + _format(date.getHours()) + ':' + _format(date.getMinutes()); + }, + parse: function(str) { //将"yyyy-mm-dd HH:MM:ss"格式的字符串,转化为一个Date对象 + var a = str.split(/[^0-9]/); + return new Date(a[0], a[1] - 1, a[2], a[3], a[4], a[5]); + } +}; + +const hexToRgba = (hex, opacity) => { //16进制颜色转rgba + return "rgba(" + parseInt("0x" + hex.slice(1, 3)) + "," + parseInt("0x" + hex.slice(3, 5)) + "," + parseInt("0x" + hex.slice(5, 7)) + "," + opacity + ")" +} + +module.exports = { + formatTime, + formatDateTime, + formatLocation, + dateUtils, + hexToRgba +} diff --git a/common/wx_token.js b/common/wx_token.js new file mode 100644 index 0000000..e12dac2 --- /dev/null +++ b/common/wx_token.js @@ -0,0 +1,140 @@ +import {Api_url} from './config' +import http from './axios.js' +import Vue from 'vue' + +const Wxcode_url= Api_url+"weixin/gzh_code" +const Token_url= Api_url+"weixin/gzh_token" +const VerifyUrl = Api_url + 'index/verify_token'; + +// 获取openid需到公众号平台设置:IP白名单 和 授权域名; +// ip是服务器IP,域名是前端域名 + +class WxToken { + constructor() { + + } + + + //初始化登陆 + async verify(e) { + console.log("H5验证登陆") + // 判断是否是微信浏览器打开 + var ua = navigator.userAgent.toLowerCase(); + var isWeixin = ua.indexOf('micromessenger') != -1; + if (!isWeixin) { + console.log("非公众号-暂不登陆") + return false; + } + console.log("微信浏览器访问中") + + var token = uni.getStorageSync('token'); //获取缓存 + let type = e=='userinfo'?'userinfo':''; + + if(token){ + console.log("验证token") + this._veirfyFromServer(token,type) //验证token是否失效 + }else{ + console.log("进行登陆中") + this.login(type) //登陆 + } + + } + + login(type){ + const code = this.GetUrlParame('code') // 截取code + + if (!code) { + this.get_code(type) + }else{ + this.get_token() + } + } + + get_code(type){ + console.log("获取code") + + var domine = window.location.href.split("#")[0]; // 微信会自动识别# 并且清除#后面的内容 + domine = domine.split("?code")[0]; + uni.request({ + url: Wxcode_url, + method: 'GET', + data:{ + url:domine, + type + }, + success: function (res) { + console.log('codes:',res) + // window.location.href = res.request_url; + // const err=res.data.indexOf('object')//错误的url会包含object + // if(res.data && err<0){ + // window.location.href = res.data; + // } + } + }); + } + + get_token(e){ + const code = this.GetUrlParame('code') // 截取code + var domine = window.location.href.split("#")[0]; // 微信会自动识别# 并且清除#后面的内容 + uni.request({ + url: Token_url, + method: 'GET', + data:{code}, + success: function (res) { + console.log(res) + if (res.data.data.token) { + console.log(res) + uni.setStorageSync("token", res.data.data.token); + window.location.href = domine + } + } + }); + } + + + //验证token + _veirfyFromServer(token,type) { + var that = this; + uni.request({ + url: VerifyUrl, + method: 'POST', + data: { + token: token + }, + success: function(res) { + var valid = res.data.isValid; + if (!valid) { + that.login(type); + }else{ + console.log("token有效") + } + } + }) + } + + //截取code + GetUrlParame(parameName) { + /// 获取地址栏指定参数的值 + /// 参数名 + // 获取url中跟在问号后面的部分 + var parames = window.location.search + // 检测参数是否存在 + if (parames.indexOf(parameName) > -1) { + var parameValue = '' + parameValue = parames.substring(parames.indexOf(parameName), parames.length) + // 检测后面是否还有参数 + if (parameValue.indexOf('&') > -1) { + // 去除后面多余的参数, 得到最终 parameName=parameValue 形式的值 + parameValue = parameValue.substring(0, parameValue.indexOf('&')) + // 去掉参数名, 得到最终纯值字符串 + parameValue = parameValue.replace(parameName + '=', '') + return parameValue + } + return '' + } + } + +} + + +export { WxToken }; \ No newline at end of file diff --git a/common/xcx_auth.vue b/common/xcx_auth.vue new file mode 100644 index 0000000..0d76a43 --- /dev/null +++ b/common/xcx_auth.vue @@ -0,0 +1,141 @@ + + + + + diff --git a/components/CommentList.vue b/components/CommentList.vue new file mode 100644 index 0000000..70eaca8 --- /dev/null +++ b/components/CommentList.vue @@ -0,0 +1,240 @@ + + + + + \ No newline at end of file diff --git a/components/J-skeleton/J-skeleton.vue b/components/J-skeleton/J-skeleton.vue new file mode 100644 index 0000000..05c56a9 --- /dev/null +++ b/components/J-skeleton/J-skeleton.vue @@ -0,0 +1,166 @@ + + + + + diff --git a/components/J-skeleton/README.md b/components/J-skeleton/README.md new file mode 100644 index 0000000..77c64e1 --- /dev/null +++ b/components/J-skeleton/README.md @@ -0,0 +1,77 @@ +# skeleton +感谢原作者 https://ext.dcloud.net.cn/plugin?id=852 + +自己项目非常需要骨架,正好原作者发布了1.0 根据自己项目 自己修改了下。 + +目前仅支持: +1.轮播图 +2.分类栏 +3.头像 +4.文章条 +5.动态心情 + +以上是根据自己项目修改的,后续再拓展,或者自己根据自己项目修改,原作者写的还是很灵活的,修改方便! + + +## 属性说明 + +|属性名|类型|默认值|说明| +| -- | -- | --|--| +| loading | Boolean | true | 是否显示占位图 | +| flexType | String | flex-start | 排列方式 center 居中 √ space-between 两端对齐 √ space-around 子元素拉手分布 √ flex-start 居左 flex-end 居右 | +| imgTitle | Boolean | false | 轮播图占位图 | +| showAvatar | Boolean | true | 是否显示头像占位图 | +| nameRow | Number | 1 | 显示头像圆1个 | +| avatarSize | String | 50px | 头像站占位图大小 | +| avatarShape | String | round | 头像形状,可选值:round, square | +| showTitle | Boolean | true | 是否显示标题占位图 | +| titleWidth | String | 40% | 标题占位图宽度 | +| row | Number| 3 | 标题段落占位图行数 | +| animate | Boolean | true | 是否开启动画 | + +## 使用示例 + +```html + + 我是段落1 + +``` + +```javascript +import Skeleton from '../components/skeleton/index.vue' +export default { + components: { + Skeleton + }, + data() { + return { + loading: true, + skeleton1 : { + avatarSize: '52px', + row: 3, + showTitle: true, + } + } + }, + created() { + this.reloadData() + }, + methods: { + reloadData() { + this.loading = true + setTimeout(() => { + this.loading = false + }, 3000) + }, + }, +} +``` + +## 效果图 + +![](http://images.alisali.cn/img_20191014113211.png) diff --git a/components/aui-dialog/aui-dialog.vue b/components/aui-dialog/aui-dialog.vue new file mode 100644 index 0000000..0dab18c --- /dev/null +++ b/components/aui-dialog/aui-dialog.vue @@ -0,0 +1,438 @@ + + + + + diff --git a/components/aui-dialog/common/aui/css/aui.css b/components/aui-dialog/common/aui/css/aui.css new file mode 100644 index 0000000..e094c8f --- /dev/null +++ b/components/aui-dialog/common/aui/css/aui.css @@ -0,0 +1,292 @@ +.aui-content{ + width: 100%; + height: 100vh; + /* #ifndef MP */ + height: -webkit-calc(100vh - 44px); + height: calc(100vh - 44px); + /* #endif */ + background: #EFEFEF; + overflow-y: scroll; + padding: 0; + box-sizing: border-box; + position: relative; +} +/* 横向分割线 */ +.row-before{position: relative;} +.row-before:before{content: ''; width: 100%; height: 1px !important; background: rgba(100,100,100,.3); -ms-transform: scaleY(.3); -webkit-transform: scaleY(.3); transform: scaleY(.3); position: absolute; top: 0; right: 0; left: auto; z-index: 1;} +.row-after{position: relative;} +.row-after:after{content: ''; width: 100%; height: 1px !important; background: rgba(100,100,100,.3); -ms-transform: scaleY(.3); -webkit-transform: scaleY(.3); transform: scaleY(.3); position: absolute; bottom: 0; right: 0; left: auto; z-index: 1;} +/* 纵向分割线 */ +.col-before{position: relative;} +.col-before:before{content: ''; width: 1px !important; height: 100%; background: rgba(100,100,100,.3); -ms-transform: scaleX(.3); -webkit-transform: scaleX(.3); transform: scaleX(.3); position: absolute; top: 0; left: 0; z-index: 1;} +.col-after{position: relative;} +.col-after:after{content: ''; width: 1px !important; height: 100%; background: rgba(100,100,100,.3); -ms-transform: scaleX(.3); -webkit-transform: scaleX(.3); transform: scaleX(.3); position: absolute; top: 0; right: 0; z-index: 1;} +/*按钮边框线*/ +.border{position: relative;} +.border:after{content: ''; width: -webkit-calc(200% - 2px); width: calc(200% - 2px); height: -webkit-calc(200% - 2px); height: calc(200% - 2px); border-radius: 3px; border: 1px solid rgba(100,100,100,.3); position: absolute; left: -50%; top: -50%; -ms-transform: scale(.5, .5); -webkit-transform: scale(.5, .5); transform: scale(.5, .5); z-index: 1;} +.aui-lists{ + width: 100%; +} +.aui-list{ + width: 100%; + height: 55px; + font-size: 0; + padding: 0 15px; + background: #FFFFFF; + box-sizing: border-box; + position: relative; + z-index: 1; +} +.aui-list:after{ + content: ''; + width: 100%; + height: 1px; + background: rgba(100,100,100,.3); + -ms-transform: scaleY(.3); + -webkit-transform: scaleY(.3); + transform: scaleY(.3); + position: absolute; + bottom: 0; + left: 0; +} +.aui-list:last-child:after{ + display: none; +} +.aui-list-title{ + width: 100%; + height: 44px; + line-height: 44px; + font-size: 14px; + padding: 0 15px; + box-sizing: border-box; + color: #999; + display: inline-block; +} +.aui-list-left{ + height: 100%; + line-height: 55px; + font-size: 15px; + color: #333; + display: inline-block; + vertical-align: top; +} +.aui-list-right{ + height: 100%; + display: inline-block; + vertical-align: top; + float: right; +} +.aui-list-right .aui-btn-right{ + height: 55px; + text-align: center; + line-height: 55px; + font-size: 14px; + display: inline-block; + color: #aaa; + vertical-align: top; + +} +.aui-btn{ + width: -webkit-calc(100% - 30px); + width: calc(100% - 30px); + height: 50px; + line-height: 50px; + text-align: center; + border: none; + color: #333; + font-size: 15px; + border-radius: 5px; + margin: 0 15px 15px 15px; + padding: 0 10px; + transition: background-color .2s; + box-sizing: border-box; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + position: relative; +} +.aui-btn-blue{ + background: #197DE0; + color: #FFF; +} + +/* 遮罩层样式 */ +.aui-mask{ + width: 100%; + height: 100%; + background: rgba(0,0,0,.6); + -ms-animation: aui-fade-in .2s ease-out forwards; + -webkit-animation: aui-fade-in .2s ease-out forwards; + animation: aui-fade-in .2s ease-out forwards; + position: fixed; + top: 0px; + left: 0px; + z-index: 998; +} + +/* 动画设计 */ +/* fade-in */ +@-ms-keyframes aui-fade-in{ + 0%{opacity: 0;} + 100%{opacity: 1;} +} +@-webkit-keyframes aui-fade-in{ + 0%{opacity: 0;} + 100%{opacity: 1;} +} +@keyframes aui-fade-in{ + 0%{opacity: 0;} + 100%{opacity: 1;} +} +/* fade-out */ +@-ms-keyframes aui-fade-out{ + 0%{opacity: 1;} + 100%{opacity: 0;} +} +@-webkit-keyframes aui-fade-out{ + 0%{opacity: 1;} + 100%{opacity: 0;} +} +@keyframes aui-fade-out{ + 0%{opacity: 1;} + 100%{opacity: 0;} +} +/* aui-scale-in */ +@-ms-keyframes aui-scale-in{ + 0%{-ms-transform: scale(0.8); -webkit-transform: scale(0.8); transform: scale(0.8);} + 100%{-ms-transform: scale(1); -webkit-transform: scale(1); transform: scale(1);} +} +@-webkit-keyframes aui-scale-in{ + 0%{-ms-transform: scale(0.8); -webkit-transform: scale(0.8); transform: scale(0.8);} + 100%{-ms-transform: scale(1); -webkit-transform: scale(1); transform: scale(1);} +} +@keyframes aui-scale-in{ + 0%{-ms-transform: scale(0.8); -webkit-transform: scale(0.8); transform: scale(0.8);} + 100%{-ms-transform: scale(1); -webkit-transform: scale(1); transform: scale(1);} +} +/* aui-scale-out */ +@-ms-keyframes aui-scale-out{ + 0%{-ms-transform: scale(1); -webkit-transform: scale(1); transform: scale(1);} + 100%{-ms-transform: scale(0.8); -webkit-transform: scale(0.8); transform: scale(0.8);} +} +@-webkit-keyframes aui-scale-out{ + 0%{-ms-transform: scale(1); -webkit-transform: scale(1); transform: scale(1);} + 100%{-ms-transform: scale(0.8); -webkit-transform: scale(0.8); transform: scale(0.8);} +} +@keyframes aui-scale-out{ + 0%{-ms-transform: scale(1); -webkit-transform: scale(1); transform: scale(1);} + 100%{-ms-transform: scale(0.8); -webkit-transform: scale(0.8); transform: scale(0.8);} +} + +/* aui-scale-in-tosmall */ +@-ms-keyframes aui-scale-in-tosmall{ + 0%{-ms-transform: scale(1.2); -webkit-transform: scale(1.2); transform: scale(1.2);} + 100%{-ms-transform: scale(1); -webkit-transform: scale(1); transform: scale(1);} +} +@-webkit-keyframes aui-scale-in-tosmall{ + 0%{-ms-transform: scale(1.2); -webkit-transform: scale(1.2); transform: scale(1.2);} + 100%{-ms-transform: scale(1); -webkit-transform: scale(1); transform: scale(1);} +} +@keyframes aui-scale-in-tosmall{ + 0%{-ms-transform: scale(1.2); -webkit-transform: scale(1.2); transform: scale(1.2);} + 100%{-ms-transform: scale(1); -webkit-transform: scale(1); transform: scale(1);} +} + +/* aui-scale-in-tosmall-dialog */ +@-ms-keyframes aui-scale-in-tosmall-dialog{ + 0%{-ms-transform: translate3d(-50%,-50%,0) scale(1.16); -webkit-transform: translate3d(-50%,-50%,0) scale(1.16); transform: translate3d(-50%,-50%,0) scale(1.16); opacity: 0;} + 100%{-ms-transform: translate3d(-50%,-50%,0) scale(1); -webkit-transform: translate3d(-50%,-50%,0) scale(1); transform: translate3(-50%,-50%,0) scale(1); opacity: 1;} +} +@-webkit-keyframes aui-scale-in-tosmall-dialog{ + 0%{-ms-transform: translate3d(-50%,-50%,0) scale(1.16); -webkit-transform: translate3d(-50%,-50%,0) scale(1.16); transform: translate3d(-50%,-50%,0) scale(1.16); opacity: 0;} + 100%{-ms-transform: translate3d(-50%,-50%,0) scale(1); -webkit-transform: translate3d(-50%,-50%,0) scale(1); transform: translate3(-50%,-50%,0) scale(1); opacity: 1;} +} +@keyframes aui-scale-in-tosmall-dialog{ + 0%{-ms-transform: translate3d(-50%,-50%,0) scale(1.16); -webkit-transform: translate3d(-50%,-50%,0) scale(1.16); transform: translate3d(-50%,-50%,0) scale(1.16); opacity: 0;} + 100%{-ms-transform: translate3d(-50%,-50%,0) scale(1); -webkit-transform: translate3d(-50%,-50%,0) scale(1); transform: translate3(-50%,-50%,0) scale(1); opacity: 1;} +} +/* aui-scale-out-tosmall-dialog */ +@-ms-keyframes aui-scale-out-tosmall-dialog{ + 0%{-ms-transform: translate3d(-50%,-50%,0) scale(1); -webkit-transform: translate3d(-50%,-50%,0) scale(1); transform: translate3d(-50%,-50%,0) scale(1); opacity: 1;} + 100%{-ms-transform: translate3d(-50%,-50%,0) scale(0.8); -webkit-transform: translate3d(-50%,-50%,0) scale(0.8); transform: translate3(-50%,-50%,0) scale(0.8); opacity: 0;} +} +@-webkit-keyframes aui-scale-out-tosmall-dialog{ + 0%{-ms-transform: translate3d(-50%,-50%,0) scale(1); -webkit-transform: translate3d(-50%,-50%,0) scale(1); transform: translate3d(-50%,-50%,0) scale(1); opacity: 1;} + 100%{-ms-transform: translate3d(-50%,-50%,0) scale(0.8); -webkit-transform: translate3d(-50%,-50%,0) scale(0.8); transform: translate3(-50%,-50%,0) scale(0.8); opacity: 0;} +} +@keyframes aui-scale-out-tosmall-dialog{ + 0%{-ms-transform: translate3d(-50%,-50%,0) scale(1); -webkit-transform: translate3d(-50%,-50%,0) scale(1); transform: translate3d(-50%,-50%,0) scale(1); opacity: 1;} + 100%{-ms-transform: translate3d(-50%,-50%,0) scale(0.8); -webkit-transform: translate3d(-50%,-50%,0) scale(0.8); transform: translate3(-50%,-50%,0) scale(0.8); opacity: 0;} +} +/* aui-slide-up */ +@-ms-keyframes aui-slide-up{ + 0%{bottom: -40vh;} + 100%{bottom: 10px;} +} +@-webkit-keyframes aui-slide-up{ + 0%{bottom: -40vh;} + 100%{bottom: 10px;} +} +@keyframes aui-slide-up{ + 0%{bottom: -40vh;} + 100%{bottom: 10px;} +} + +/* aui-slide-down */ +@-ms-keyframes aui-slide-down{ + 0%{bottom: 10px;} + 100%{bottom: -40vh;} +} +@-webkit-keyframes aui-slide-down{ + 0%{bottom: 10px;} + 100%{bottom: -40vh;} +} +@keyframes aui-slide-down{ + 0%{bottom: 10px;} + 100%{bottom: -40vh;} +} + +/* aui-slide-up-screen */ +@-ms-keyframes aui-slide-up-screen{ + 0%{bottom: -60vh;} + 100%{bottom: 0px;} +} +@-webkit-keyframes aui-slide-up-screen{ + 0%{bottom: -60vh;} + 100%{bottom: 0px;} +} +@keyframes aui-slide-up-screen{ + 0%{bottom: -60vh;} + 100%{bottom: 0px;} +} + +/* aui-slide-down-screen */ +@-ms-keyframes aui-slide-down-screen{ + 0%{bottom: 0px;} + 100%{bottom: -60vh;} +} +@-webkit-keyframes aui-slide-down-screen{ + 0%{bottom: 0px;} + 100%{bottom: -60vh;} +} +@keyframes aui-slide-down-screen{ + 0%{bottom: 0px;} + 100%{bottom: -60vh;} +} + +@-webkit-keyframes aui-slide-up_to_middle { + 0%{opacity: 0; top: -50vh; -ms-transform: translate(0,0); -webkit-transform: translate(0,0); transform: translate(0,0);} + 100%{opacity: 1; top: 45%; -ms-transform: translate(0, -50%); -webkit-transform: translate(0, -50%); transform: translate(0, -50%);} +} +@keyframes aui-slide-up_to_middle { + 0%{opacity: 0; top: -50vh; -ms-transform: translate(0,0); -webkit-transform: translate(0,0); transform: translate(0,0);} + 100%{opacity: 1; top: 45%; -ms-transform: translate(0, -50%); -webkit-transform: translate(0, -50%); transform: translate(0, -50%);} +} +@-webkit-keyframes aui-slide-middle_to_up { + 0%{opacity: 1; top: 45%; -ms-transform: translate(0, -50%); -webkit-transform: translate(0, -50%); transform: translate(0, -50%);} + 100%{opacity: 0; top: -50vh; -ms-transform: translate(0,0); -webkit-transform: translate(0,0); transform: translate(0,0);} +} +@keyframes aui-slide-middle_to_up { + 0%{opacity: 1; top: 45%; -ms-transform: translate(0, -50%); -webkit-transform: translate(0, -50%); transform: translate(0, -50%);} + 100%{opacity: 0; top: -50vh; -ms-transform: translate(0,0); -webkit-transform: translate(0,0); transform: translate(0,0);} +} \ No newline at end of file diff --git a/components/aui-dialog/common/aui/css/aui.iconfont.css b/components/aui-dialog/common/aui/css/aui.iconfont.css new file mode 100644 index 0000000..e479f07 --- /dev/null +++ b/components/aui-dialog/common/aui/css/aui.iconfont.css @@ -0,0 +1 @@ +@font-face{font-family:"iconfont";src:url('//at.alicdn.com/t/font_1135293_z1315ov8k2t.eot?t=1589338239928');src:url('//at.alicdn.com/t/font_1135293_z1315ov8k2t.eot?t=1589338239928#iefix') format('embedded-opentype'),url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAA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OuhvAMAAAA=') format('woff2'),url('//at.alicdn.com/t/font_1135293_z1315ov8k2t.woff?t=1589338239928') format('woff'),url('//at.alicdn.com/t/font_1135293_z1315ov8k2t.ttf?t=1589338239928') format('truetype'),url('//at.alicdn.com/t/font_1135293_z1315ov8k2t.svg?t=1589338239928#iconfont') format('svg')}.iconfont{font-family:"iconfont" !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icondaojishi:before{content:"\e65e"}.iconCSS:before{content:"\e622"}.iconqiu:before{content:"\e615"}.iconradio:before{content:"\e613"}.iconradio1:before{content:"\e799"}.iconzhutise:before{content:"\e65a"}.icondatepicker1:before{content:"\e642"}.icondatepicker:before{content:"\e629"}.iconloading5:before{content:"\e635"}.iconloading7:before{content:"\e611"}.iconloading_r:before{content:"\e612"}.iconrenlianshibie:before{content:"\e798"}.iconweibiaoti-zhuanhuan-:before{content:"\e610"}.iconxingzhuang:before{content:"\e607"}.iconhuatong:before{content:"\e659"}.iconbiaoqing1:before{content:"\e797"}.iconicon-:before{content:"\e6db"}.iconjianpan:before{content:"\e670"}.iconyuyin:before{content:"\e630"}.iconluyin:before{content:"\e64b"}.iconjianpanshanchu:before{content:"\e64e"}.iconxuanxiangqia1:before{content:"\e60a"}.iconxuanxiangqialiebiao:before{content:"\e625"}.iconxialaliebiao:before{content:"\e7a7"}.iconcopy:before{content:"\e604"}.iconjiantieban:before{content:"\e605"}.iconjurassic_paste:before{content:"\e796"}.iconerweima:before{content:"\e600"}.icontupiancaijian:before{content:"\e631"}.icontupianshangchuan:before{content:"\e636"}.iconzujian-xialaxuankuang:before{content:"\e620"}.iconxuanxiangqia:before{content:"\e654"}.iconxing:before{content:"\e652"}.iconAPP:before{content:"\e601"}.iconjs:before{content:"\e6bf"}.iconshilidaima:before{content:"\e640"}.iconshouye1:before{content:"\e60f"}.icontime1:before{content:"\e614"}.iconyanjing:before{content:"\e63b"}.iconkaiyanjing:before{content:"\e6a8"}.iconsearch:before{content:"\e69e"}.iconhtbarrowright02:before{content:"\e6b4"}.iconclose1:before{content:"\e603"}.icondizhi:before{content:"\e60e"}.iconqianniudaidise:before{content:"\e78d"}.iconquestions:before{content:"\e78e"}.iconsupply:before{content:"\e78f"}.icontools:before{content:"\e790"}.iconint:before{content:"\e791"}.iconcommodity:before{content:"\e792"}.iconzhtn:before{content:"\e793"}.iconTop:before{content:"\e6ca"}.iconleft2:before{content:"\e651"}.iconleft3:before{content:"\e794"}.iconright3:before{content:"\e795"}.iconshut_down:before{content:"\e6a2"}.iconwithdraw:before{content:"\e6a4"}.iconeye_protection:before{content:"\e6a1"}.iconnickname:before{content:"\e6a5"}.iconproblem:before{content:"\e6a7"}.icondown:before{content:"\e703"}.icontop:before{content:"\e653"}.iconbianji:before{content:"\e62c"}.iconweibo:before{content:"\e62f"}.iconyidiandiantubiao03:before{content:"\e606"}.iconqq:before{content:"\e6a0"}.iconweixin:before{content:"\e6b1"}.iconright:before{content:"\e608"}.iconpengyouquan:before{content:"\e667"}.icontop1:before{content:"\e609"}.iconloading:before{content:"\e68f"}.iconLC_icon_down_line_circle:before{content:"\e657"}.iconadd:before{content:"\e656"}.iconup_s8:before{content:"\e65b"}.iconmore:before{content:"\e60b"}.iconloading2:before{content:"\e6a6"}.iconright1:before{content:"\e6c6"}.iconjian:before{content:"\e6aa"}.iconqq-copy:before{content:"\e658"}.icontupian:before{content:"\e691"}.iconleft:before{content:"\e626"}.iconadd1:before{content:"\e62b"}.iconset:before{content:"\e689"}.iconaddress:before{content:"\e602"}.icondown1:before{content:"\e6ac"}.iconjian1:before{content:"\e68e"}.iconguolv:before{content:"\e634"}.icondelete:before{content:"\e60c"}.iconaddress1:before{content:"\e60d"}.iconmore1:before{content:"\e617"}.icondown2:before{content:"\e6e9"}.iconimage:before{content:"\e6f5"}.iconimage1:before{content:"\e674"}.iconleft1:before{content:"\e675"}.icontop2:before{content:"\e676"}.iconshangchuan:before{content:"\e6a3"}.iconadd2:before{content:"\e6b3"}.iconLoading1:before{content:"\e65d"}.iconjian2:before{content:"\e62e"}.iconaddress2:before{content:"\e66b"}.iconshouye:before{content:"\e669"}.iconaccessory:before{content:"\e6dd"}.iconactivity:before{content:"\e6de"}.iconactivity_fill:before{content:"\e6df"}.iconadd3:before{content:"\e6e0"}.iconaddition_fill:before{content:"\e6e1"}.iconaddition:before{content:"\e6e2"}.iconaddpeople_fill:before{content:"\e6e3"}.iconaddpeople:before{content:"\e6e4"}.iconaddressbook_fill:before{content:"\e6e5"}.iconaddressbook:before{content:"\e6e6"}.iconbarrage_fill:before{content:"\e6e7"}.iconbarrage:before{content:"\e6e8"}.iconbrowse_fill:before{content:"\e6ea"}.iconbrowse:before{content:"\e6eb"}.iconbrush:before{content:"\e6ec"}.iconbrush_fill:before{content:"\e6ed"}.iconbusinesscard_fill:before{content:"\e6ee"}.iconbusinesscard:before{content:"\e6ef"}.iconcamera_fill:before{content:"\e6f0"}.iconcamera:before{content:"\e6f1"}.iconclock_fill:before{content:"\e6f2"}.iconclock:before{content:"\e6f3"}.iconclose:before{content:"\e6f4"}.iconcollection_fill:before{content:"\e6f6"}.iconcollection:before{content:"\e6f7"}.iconcomputer_fill:before{content:"\e6f8"}.iconcomputer:before{content:"\e6f9"}.iconcoordinates_fill:before{content:"\e6fa"}.iconcoordinates:before{content:"\e6fb"}.iconcoupons_fill:before{content:"\e6fc"}.iconcoupons:before{content:"\e6fd"}.iconcreatetask_fill:before{content:"\e6fe"}.iconcreatetask:before{content:"\e6ff"}.iconcustomerservice_fill:before{content:"\e700"}.iconcustomerservice:before{content:"\e701"}.icondelete_fill:before{content:"\e702"}.icondelete1:before{content:"\e704"}.icondocument:before{content:"\e705"}.icondocument_fill:before{content:"\e706"}.icondynamic_fill:before{content:"\e707"}.icondynamic:before{content:"\e708"}.iconeditor:before{content:"\e709"}.iconeit:before{content:"\e70a"}.iconemoji_fill:before{content:"\e70b"}.iconemoji:before{content:"\e70c"}.iconempty:before{content:"\e70d"}.iconempty_fill:before{content:"\e70e"}.iconenter:before{content:"\e70f"}.iconenterinto:before{content:"\e710"}.iconenterinto_fill:before{content:"\e711"}.iconfeedback_fill:before{content:"\e712"}.iconfeedback:before{content:"\e713"}.iconflag_fill:before{content:"\e714"}.iconflag:before{content:"\e715"}.iconflashlight:before{content:"\e716"}.iconflashlight_fill:before{content:"\e717"}.iconflip:before{content:"\e718"}.iconflip_fill:before{content:"\e719"}.iconfullscreen:before{content:"\e71a"}.icongroup:before{content:"\e71b"}.icongroup_fill:before{content:"\e71c"}.iconheadlines_fill:before{content:"\e71d"}.iconheadlines:before{content:"\e71e"}.iconhomepage_fill:before{content:"\e71f"}.iconhomepage:before{content:"\e720"}.iconintegral_fill:before{content:"\e721"}.iconintegral:before{content:"\e722"}.iconinteractive_fill:before{content:"\e723"}.iconinteractive:before{content:"\e724"}.iconkeyboard:before{content:"\e725"}.iconlabel:before{content:"\e726"}.iconlabel_fill:before{content:"\e727"}.iconlike_fill:before{content:"\e728"}.iconlike:before{content:"\e729"}.iconlive_fill:before{content:"\e72a"}.iconlive:before{content:"\e72b"}.iconlock_fill:before{content:"\e72c"}.iconlock:before{content:"\e72d"}.iconmail:before{content:"\e72e"}.iconmail_fill:before{content:"\e72f"}.iconmanage_fill:before{content:"\e730"}.iconmanage:before{content:"\e731"}.iconmessage:before{content:"\e732"}.iconmessage_fill:before{content:"\e733"}.iconmine:before{content:"\e734"}.iconmine_fill:before{content:"\e735"}.iconmobilephone_fill:before{content:"\e736"}.iconmobilephone:before{content:"\e737"}.iconmore2:before{content:"\e738"}.iconnarrow:before{content:"\e739"}.iconoffline_fill:before{content:"\e73a"}.iconoffline:before{content:"\e73b"}.iconorder_fill:before{content:"\e73c"}.iconorder:before{content:"\e73d"}.iconother:before{content:"\e73e"}.iconpeople_fill:before{content:"\e73f"}.iconpeople:before{content:"\e740"}.iconpicture_fill:before{content:"\e741"}.iconpicture:before{content:"\e742"}.iconplay:before{content:"\e743"}.iconplay_fill:before{content:"\e744"}.iconplayon_fill:before{content:"\e745"}.iconplayon:before{content:"\e746"}.iconpraise_fill:before{content:"\e747"}.iconpraise:before{content:"\e748"}.iconprompt_fill:before{content:"\e749"}.iconprompt:before{content:"\e74a"}.iconqrcode_fill:before{content:"\e74b"}.iconqrcode:before{content:"\e74c"}.iconredpacket_fill:before{content:"\e74d"}.iconredpacket:before{content:"\e74e"}.iconrefresh:before{content:"\e74f"}.iconremind_fill:before{content:"\e750"}.iconremind:before{content:"\e751"}.iconreturn:before{content:"\e752"}.iconright2:before{content:"\e753"}.iconscan:before{content:"\e754"}.iconselect_fill:before{content:"\e755"}.iconselect:before{content:"\e756"}.iconsend:before{content:"\e757"}.iconservice_fill:before{content:"\e758"}.iconservice:before{content:"\e759"}.iconsetup_fill:before{content:"\e75a"}.iconsetup:before{content:"\e75b"}.iconshare_fill:before{content:"\e75c"}.iconshare:before{content:"\e75d"}.iconshielding_fill:before{content:"\e75e"}.iconshielding:before{content:"\e75f"}.iconsmallscreen_fill:before{content:"\e760"}.iconsmallscreen:before{content:"\e761"}.iconstealth_fill:before{content:"\e762"}.iconstealth:before{content:"\e763"}.iconsuccess_fill:before{content:"\e764"}.iconsuccess:before{content:"\e765"}.iconsuspend:before{content:"\e766"}.iconswitch:before{content:"\e767"}.iconsystemprompt_fill:before{content:"\e768"}.iconsystemprompt:before{content:"\e769"}.icontailor:before{content:"\e76a"}.icontask:before{content:"\e76b"}.icontask_fill:before{content:"\e76c"}.icontasklist_fill:before{content:"\e76d"}.icontasklist:before{content:"\e76e"}.icontext:before{content:"\e76f"}.icontime_fill:before{content:"\e770"}.icontime:before{content:"\e771"}.icontranslation_fill:before{content:"\e772"}.icontranslation:before{content:"\e773"}.icontrash:before{content:"\e774"}.icontrash_fill:before{content:"\e775"}.iconundo:before{content:"\e776"}.iconunlock_fill:before{content:"\e777"}.iconunlock:before{content:"\e778"}.iconvideo:before{content:"\e779"}.iconvideo_fill:before{content:"\e77a"}.iconwarning_fill:before{content:"\e77b"}.iconwarning:before{content:"\e77c"}.iconworkbench_fill:before{content:"\e77d"}.iconworkbench:before{content:"\e77e"}.iconsearch1:before{content:"\e77f"}.iconsearchfill:before{content:"\e780"}.iconqianniu:before{content:"\e781"}.iconpublishgoods_fill:before{content:"\e782"}.iconshop_fill:before{content:"\e783"}.icontransaction_fill:before{content:"\e784"}.iconpackup:before{content:"\e785"}.iconunfold:before{content:"\e786"}.iconwangwang:before{content:"\e787"}.iconfinancial_fill:before{content:"\e788"}.iconmarketing_fill:before{content:"\e789"}.iconshake:before{content:"\e78a"}.icondecoration_fill:before{content:"\e78b"}.iconbudaidise:before{content:"\e78c"} diff --git a/components/aui-dialog/common/aui/js/aui.js b/components/aui-dialog/common/aui/js/aui.js new file mode 100644 index 0000000..efa3c8f --- /dev/null +++ b/components/aui-dialog/common/aui/js/aui.js @@ -0,0 +1,55 @@ +const aui = { + console: function(str){ + console.log(str); + }, + /***打开新页面 + @param {string} url 页面路径 + @param {Object} opts 参数 {id: ''} + @example: aui.openWin("index.html", {id: 1}) + */ + openWin(url, opts){ + var _this = this; + var str = '?'; + for(var i in opts){ + if(_this.isDefine(opts[i])){ + str += i + '=' + opts[i] + '&'; + } + } + uni.navigateTo({ + url: _this.isDefine(opts) ? url + str : url + }) + }, + /***关闭页面 + @example: aui.closeWin() + */ + closeWin(callback){ + //直接关闭页面,并向后台发送数据 + if(typeof callback == "function"){ + if(window.addEventListener) { + window.addEventListener("beforeunload", callback, false); + } else { + window.attachEvent("onbeforeunload", callback, false); + } + } + uni.navigateBack({ + delta: 1 + }); + }, + /***判断字符串是否为空 + @param {string} str 变量 + @example: aui.isDefine("变量"); + */ + isDefine(str){ + if (str == null || str == "" || str == "undefined" || str == undefined || str == "null" || str == "(null)" || str == 'NULL' || typeof (str) == 'undefined'){ + return false; + }else{ + str = str + ""; + str = str.replace(/\s/g, ""); + if (str == ""){return false;} + return true; + } + }, +} +export { + aui +} \ No newline at end of file diff --git a/components/coolc-coupon/coolc-coupon.vue b/components/coolc-coupon/coolc-coupon.vue new file mode 100644 index 0000000..820d07c --- /dev/null +++ b/components/coolc-coupon/coolc-coupon.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/components/firstui/fui-actionsheet/fui-actionsheet.vue b/components/firstui/fui-actionsheet/fui-actionsheet.vue new file mode 100644 index 0000000..c7c9376 --- /dev/null +++ b/components/firstui/fui-actionsheet/fui-actionsheet.vue @@ -0,0 +1,436 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-alert/fui-alert.vue b/components/firstui/fui-alert/fui-alert.vue new file mode 100644 index 0000000..7c1cbaa --- /dev/null +++ b/components/firstui/fui-alert/fui-alert.vue @@ -0,0 +1,244 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-animation/fui-animation.vue b/components/firstui/fui-animation/fui-animation.vue new file mode 100644 index 0000000..13b3276 --- /dev/null +++ b/components/firstui/fui-animation/fui-animation.vue @@ -0,0 +1,218 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-autograph/fui-autograph.vue b/components/firstui/fui-autograph/fui-autograph.vue new file mode 100644 index 0000000..f76a16a --- /dev/null +++ b/components/firstui/fui-autograph/fui-autograph.vue @@ -0,0 +1,351 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-autograph/gcanvas/bridge/bridge-weex.js b/components/firstui/fui-autograph/gcanvas/bridge/bridge-weex.js new file mode 100644 index 0000000..4253b6a --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/bridge/bridge-weex.js @@ -0,0 +1,242 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 1482 28 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-2d/FillStyleLinearGradient.js b/components/firstui/fui-autograph/gcanvas/context-2d/FillStyleLinearGradient.js new file mode 100644 index 0000000..fa01878 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-2d/FillStyleLinearGradient.js @@ -0,0 +1,19 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 148 228 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-2d/FillStylePattern.js b/components/firstui/fui-autograph/gcanvas/context-2d/FillStylePattern.js new file mode 100644 index 0000000..45125ef --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-2d/FillStylePattern.js @@ -0,0 +1,9 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5148 2 2 8 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +class FillStylePattern { + constructor(img, pattern) { + this._style = pattern; + this._img = img; + } +} + +export default FillStylePattern; \ No newline at end of file diff --git a/components/firstui/fui-autograph/gcanvas/context-2d/FillStyleRadialGradient.js b/components/firstui/fui-autograph/gcanvas/context-2d/FillStyleRadialGradient.js new file mode 100644 index 0000000..18b93b6 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-2d/FillStyleRadialGradient.js @@ -0,0 +1,18 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 5 1 482281 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-2d/RenderingContext.js b/components/firstui/fui-autograph/gcanvas/context-2d/RenderingContext.js new file mode 100644 index 0000000..17ded7b --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-2d/RenderingContext.js @@ -0,0 +1,667 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15 14 82 2 8 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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); + } + }); + } +} \ No newline at end of file diff --git a/components/firstui/fui-autograph/gcanvas/context-webgl/ActiveInfo.js b/components/firstui/fui-autograph/gcanvas/context-webgl/ActiveInfo.js new file mode 100644 index 0000000..fc6d376 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/ActiveInfo.js @@ -0,0 +1,12 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 5 1 4 8228108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/Buffer.js b/components/firstui/fui-autograph/gcanvas/context-webgl/Buffer.js new file mode 100644 index 0000000..895dbbb --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/Buffer.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15 14 8 228 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/Framebuffer.js b/components/firstui/fui-autograph/gcanvas/context-webgl/Framebuffer.js new file mode 100644 index 0000000..7bdf7a0 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/Framebuffer.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5148 2281 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/GLenum.js b/components/firstui/fui-autograph/gcanvas/context-webgl/GLenum.js new file mode 100644 index 0000000..5092306 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/GLenum.js @@ -0,0 +1,299 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5148 2 2 81 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/GLmethod.js b/components/firstui/fui-autograph/gcanvas/context-webgl/GLmethod.js new file mode 100644 index 0000000..f97ee4c --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/GLmethod.js @@ -0,0 +1,143 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 5148 22 8 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/GLtype.js b/components/firstui/fui-autograph/gcanvas/context-webgl/GLtype.js new file mode 100644 index 0000000..3a9a422 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/GLtype.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 148 2 2 81 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/Program.js b/components/firstui/fui-autograph/gcanvas/context-webgl/Program.js new file mode 100644 index 0000000..85e7dda --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/Program.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 5148 228 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/Renderbuffer.js b/components/firstui/fui-autograph/gcanvas/context-webgl/Renderbuffer.js new file mode 100644 index 0000000..bc5eee7 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/Renderbuffer.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 14 8 2 28 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/RenderingContext.js b/components/firstui/fui-autograph/gcanvas/context-webgl/RenderingContext.js new file mode 100644 index 0000000..0f2f097 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/RenderingContext.js @@ -0,0 +1,1192 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 514822 8 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/Shader.js b/components/firstui/fui-autograph/gcanvas/context-webgl/Shader.js new file mode 100644 index 0000000..8a38576 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/Shader.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15148 2 28 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/ShaderPrecisionFormat.js b/components/firstui/fui-autograph/gcanvas/context-webgl/ShaderPrecisionFormat.js new file mode 100644 index 0000000..103e024 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/ShaderPrecisionFormat.js @@ -0,0 +1,12 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 5 14 82 28 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/Texture.js b/components/firstui/fui-autograph/gcanvas/context-webgl/Texture.js new file mode 100644 index 0000000..42aaca9 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/Texture.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 151 4 822 810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/UniformLocation.js b/components/firstui/fui-autograph/gcanvas/context-webgl/UniformLocation.js new file mode 100644 index 0000000..12dd776 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/UniformLocation.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 1 482 2 8 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/context-webgl/classUtils.js b/components/firstui/fui-autograph/gcanvas/context-webgl/classUtils.js new file mode 100644 index 0000000..7fff0ec --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/context-webgl/classUtils.js @@ -0,0 +1,4 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1514 82 2 81 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +export function getTransferedObjectUUID(name, id) { + return `${name.toLowerCase()}-${id}`; +} \ No newline at end of file diff --git a/components/firstui/fui-autograph/gcanvas/env/canvas.js b/components/firstui/fui-autograph/gcanvas/env/canvas.js new file mode 100644 index 0000000..7faa53f --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/env/canvas.js @@ -0,0 +1,75 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 14822 8 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/env/image.js b/components/firstui/fui-autograph/gcanvas/env/image.js new file mode 100644 index 0000000..809fefd --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/env/image.js @@ -0,0 +1,97 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 51 4 82 28108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-autograph/gcanvas/env/tool.js b/components/firstui/fui-autograph/gcanvas/env/tool.js new file mode 100644 index 0000000..83cc0be --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/env/tool.js @@ -0,0 +1,25 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 148 2 2 8 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 + +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/components/firstui/fui-autograph/gcanvas/index.js b/components/firstui/fui-autograph/gcanvas/index.js new file mode 100644 index 0000000..bde2c93 --- /dev/null +++ b/components/firstui/fui-autograph/gcanvas/index.js @@ -0,0 +1,48 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15 14 82 2 810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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 + }); + let pixelRatio = uni.getSystemInfoSync().pixelRatio; + canvas.width = el.style.width * pixelRatio; + canvas.height = el.style.height * pixelRatio; + + return canvas; +}; \ No newline at end of file diff --git a/components/firstui/fui-avatar/fui-avatar.vue b/components/firstui/fui-avatar/fui-avatar.vue new file mode 100644 index 0000000..206cd83 --- /dev/null +++ b/components/firstui/fui-avatar/fui-avatar.vue @@ -0,0 +1,242 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-backdrop/fui-backdrop.vue b/components/firstui/fui-backdrop/fui-backdrop.vue new file mode 100644 index 0000000..ca89f64 --- /dev/null +++ b/components/firstui/fui-backdrop/fui-backdrop.vue @@ -0,0 +1,174 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-backtop/fui-backtop.vue b/components/firstui/fui-backtop/fui-backtop.vue new file mode 100644 index 0000000..187ca40 --- /dev/null +++ b/components/firstui/fui-backtop/fui-backtop.vue @@ -0,0 +1,121 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-badge/fui-badge.vue b/components/firstui/fui-badge/fui-badge.vue new file mode 100644 index 0000000..74f5710 --- /dev/null +++ b/components/firstui/fui-badge/fui-badge.vue @@ -0,0 +1,217 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-banner-arc/fui-banner-arc.vue b/components/firstui/fui-banner-arc/fui-banner-arc.vue new file mode 100644 index 0000000..d604ee9 --- /dev/null +++ b/components/firstui/fui-banner-arc/fui-banner-arc.vue @@ -0,0 +1,160 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-barcode/barcode.js b/components/firstui/fui-barcode/barcode.js new file mode 100644 index 0000000..1050158 --- /dev/null +++ b/components/firstui/fui-barcode/barcode.js @@ -0,0 +1,205 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 51 4 82 2 810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +/* + * Copyright (c) 2014 Johannes Mittendorfer (http://johannes-mittendorfer.com) + * Licensed under the MIT License (LICENSE.txt). + * + * Version 2.1.1 + * Build 2014-10-07 + */ + +var EAN13, pluginName; + +pluginName = null; + +"use strict"; + +EAN13 = (function() { + EAN13.prototype.settings = {}; + + EAN13.prototype.init = function() { + var checkDigit, code; + if (this.number.length === 12) { + checkDigit = this.generateCheckDigit(this.number); + this.number += checkDigit; + } + if (this.number.length === 13) { + if (this.validate()) { + this.settings.onValid.call(); + } else { + this.settings.onInvalid.call(); + } + code = this.getCode(); + return this.draw(code); + } else { + return this.settings.onError.call(); + } + }; + + EAN13.prototype.getCode = function() { + var c_encoding, code, countries, i, parts, raw_number, x, y, z; + x = ["0001101", "0011001", "0010011", "0111101", "0100011", "0110001", "0101111", "0111011", "0110111", "0001011"]; + y = ["0100111", "0110011", "0011011", "0100001", "0011101", "0111001", "0000101", "0010001", "0001001", "0010111"]; + z = ["1110010", "1100110", "1101100", "1000010", "1011100", "1001110", "1010000", "1000100", "1001000", "1110100"]; + countries = ["xxxxxx", "xxyxyy", "xxyyxy", "xxyyyx", "xyxxyy", "xyyxxy", "xyyyxx", "xyxyxy", "xyxyyx", "xyyxyx"]; + code = ""; + c_encoding = countries[parseInt(this.number.substr(0, 1), 10)].split(""); + raw_number = this.number.substr(1); + parts = raw_number.split(""); + i = 0; + while (i < 6) { + if (c_encoding[i] === "x") { + code += x[parts[i]]; + } else { + code += y[parts[i]]; + } + i++; + } + i = 6; + while (i < 12) { + code += z[parts[i]]; + i++; + } + return code; + }; + + EAN13.prototype.clear = function(context) { + return context.clearRect(0, 0, this.settings.width, this.settings.height); + }; + + EAN13.prototype.draw = function(code) { + var border_height, chars, context, height, i, item_width, layout, left, lines, offset, prefix, width, x, _i, _ref; + layout = { + prefix_offset: 0.06, + font_stretch: 0.073, + border_line_height_number: 0.9, + border_line_height: 1, + line_height: 0.9, + font_size: 0.15, + font_y: 1.03, + text_offset: 4.5 + }; + width = (this.settings.prefix ? this.settings.width - (this.settings.width * layout.prefix_offset) : this.settings.width); + if (this.settings.number) { + border_height = layout.border_line_height_number * this.settings.height; + height = layout.line_height * border_height; + } else { + border_height = layout.border_line_height * this.settings.height; + height = border_height; + } + item_width = width / 95; + if (this.ctx) { + context = this.ctx; + this.clear(context); + context.setFillStyle(this.settings.color); + left = this.settings.number && this.settings.prefix ? this.settings.width * layout.prefix_offset : 0; + lines = code.split(""); + context.fillRect(left, 0, item_width, border_height); + left = left + item_width * 2; + context.fillRect(left, 0, item_width, border_height); + left = left + item_width; + i = 0; + while (i < 42) { + if (lines[i] === "1") { + context.fillRect(left, 0, Math.floor(item_width) + 1, height); + } + left = left + item_width; + i++; + } + left = left + item_width; + context.fillRect(left, 0, item_width, border_height); + left = left + item_width * 2; + context.fillRect(left, 0, item_width, border_height); + left = left + item_width * 2; + i = 42; + while (i < 84) { + if (lines[i] === "1") { + context.fillRect(left, 0, Math.floor(item_width) + 1, height); + } + left = left + item_width; + i++; + } + context.fillRect(left, 0, item_width, border_height); + left = left + item_width * 2; + context.fillRect(left, 0, item_width, border_height); + if (this.settings.number) { + context.setFontSize(layout.font_size * height + "px monospace"); + prefix = this.number.substr(0, 1); + if (this.settings.prefix) { + context.fillText(prefix, 0, border_height * layout.font_y); + } + offset = item_width * layout.text_offset + (this.settings.prefix ? layout.prefix_offset * this.settings.width : 0); + chars = this.number.substr(1, 6).split(""); + chars.forEach(function(value, key) { + context.fillText(value, offset, border_height * layout.font_y); + return offset += layout.font_stretch * width; + }); + offset = 49 * item_width + (this.settings.prefix ? layout.prefix_offset * this.settings.width : 0) + layout.text_offset; + chars = this.number.substr(7).split("") + chars.forEach(function(value, key) { + context.fillText(value, offset, border_height * layout.font_y); + return offset += layout.font_stretch * width; + }); + } + if (this.settings.debug) { + for (x = _i = 0, _ref = item_width * 2; _ref > 0 ? _i <= width : _i >= width; x = _i += _ref) { + context.beginPath(); + context.rect(x, height * 0.4, item_width, height * 0.1); + context.setFillStyle('red'); + context.fill(); + } + } + context.draw() + return this.settings.onSuccess.call(); + } else { + return this.settings.onError.call(); + } + }; + + EAN13.prototype.generateCheckDigit = function(number) { + var chars, counter; + counter = 0; + chars = number.split(""); + chars.forEach(function(value, key) { + if (key % 2 === 0) { + return counter += parseInt(value, 10); + } else { + return counter += 3 * parseInt(value, 10); + } + }); + return 10 - (counter % 10) % 10; + }; + + EAN13.prototype.validate = function() { + return parseInt(this.number.slice(-1), 10) === this.generateCheckDigit(this.number.slice(0, -1)); + }; + + function EAN13(number, options, ctx) { + var option; + this.number = number; + this.ctx = ctx + this.settings = { + width: 200, + height: 100, + number: true, + prefix: true, + color: "black", + debug: false, + onValid: function() {}, + onInvalid: function() {}, + onSuccess: function() {}, + onError: function() {} + }; + if (options) { + for (option in options) { + this.settings[option] = options[option]; + } + } + this._name = pluginName; + this.init(); + } + + return EAN13; + +})(); + +export default EAN13; \ No newline at end of file diff --git a/components/firstui/fui-barcode/fui-barcode.vue b/components/firstui/fui-barcode/fui-barcode.vue new file mode 100644 index 0000000..368563c --- /dev/null +++ b/components/firstui/fui-barcode/fui-barcode.vue @@ -0,0 +1,142 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-barcode/gcanvas/bridge/bridge-weex.js b/components/firstui/fui-barcode/gcanvas/bridge/bridge-weex.js new file mode 100644 index 0000000..8915b82 --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/bridge/bridge-weex.js @@ -0,0 +1,242 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15 1482 2 81 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-2d/FillStyleLinearGradient.js b/components/firstui/fui-barcode/gcanvas/context-2d/FillStyleLinearGradient.js new file mode 100644 index 0000000..f0a87d9 --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-2d/FillStyleLinearGradient.js @@ -0,0 +1,19 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 514 82 2 8 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-2d/FillStylePattern.js b/components/firstui/fui-barcode/gcanvas/context-2d/FillStylePattern.js new file mode 100644 index 0000000..30397de --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-2d/FillStylePattern.js @@ -0,0 +1,9 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 1 4 822 8 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +class FillStylePattern { + constructor(img, pattern) { + this._style = pattern; + this._img = img; + } +} + +export default FillStylePattern; \ No newline at end of file diff --git a/components/firstui/fui-barcode/gcanvas/context-2d/FillStyleRadialGradient.js b/components/firstui/fui-barcode/gcanvas/context-2d/FillStyleRadialGradient.js new file mode 100644 index 0000000..8ce8d57 --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-2d/FillStyleRadialGradient.js @@ -0,0 +1,18 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 14 8 228 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-2d/RenderingContext.js b/components/firstui/fui-barcode/gcanvas/context-2d/RenderingContext.js new file mode 100644 index 0000000..f463c87 --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-2d/RenderingContext.js @@ -0,0 +1,667 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 51 4822 8 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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); + } + }); + } +} \ No newline at end of file diff --git a/components/firstui/fui-barcode/gcanvas/context-webgl/ActiveInfo.js b/components/firstui/fui-barcode/gcanvas/context-webgl/ActiveInfo.js new file mode 100644 index 0000000..b3b68d8 --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/ActiveInfo.js @@ -0,0 +1,12 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 51 482 28 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/Buffer.js b/components/firstui/fui-barcode/gcanvas/context-webgl/Buffer.js new file mode 100644 index 0000000..e05fe6a --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/Buffer.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 14 822 8 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/Framebuffer.js b/components/firstui/fui-barcode/gcanvas/context-webgl/Framebuffer.js new file mode 100644 index 0000000..24d5f90 --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/Framebuffer.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 14 8 2 2 81 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/GLenum.js b/components/firstui/fui-barcode/gcanvas/context-webgl/GLenum.js new file mode 100644 index 0000000..2c7aade --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/GLenum.js @@ -0,0 +1,299 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15 1 4 8 228 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/GLmethod.js b/components/firstui/fui-barcode/gcanvas/context-webgl/GLmethod.js new file mode 100644 index 0000000..7e305bd --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/GLmethod.js @@ -0,0 +1,143 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:151 48 228108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/GLtype.js b/components/firstui/fui-barcode/gcanvas/context-webgl/GLtype.js new file mode 100644 index 0000000..002f04b --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/GLtype.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 148228 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/Program.js b/components/firstui/fui-barcode/gcanvas/context-webgl/Program.js new file mode 100644 index 0000000..ed3f04a --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/Program.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 1 482 2 810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/Renderbuffer.js b/components/firstui/fui-barcode/gcanvas/context-webgl/Renderbuffer.js new file mode 100644 index 0000000..4dd0c9b --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/Renderbuffer.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 5 1 4822 8 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/RenderingContext.js b/components/firstui/fui-barcode/gcanvas/context-webgl/RenderingContext.js new file mode 100644 index 0000000..d38ad26 --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/RenderingContext.js @@ -0,0 +1,1192 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 151 4 82 2 8 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/Shader.js b/components/firstui/fui-barcode/gcanvas/context-webgl/Shader.js new file mode 100644 index 0000000..648f4d4 --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/Shader.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 14 8 228 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/ShaderPrecisionFormat.js b/components/firstui/fui-barcode/gcanvas/context-webgl/ShaderPrecisionFormat.js new file mode 100644 index 0000000..0611be2 --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/ShaderPrecisionFormat.js @@ -0,0 +1,12 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 5 1 48 228108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/Texture.js b/components/firstui/fui-barcode/gcanvas/context-webgl/Texture.js new file mode 100644 index 0000000..d03e58a --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/Texture.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1514 82 2 810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/UniformLocation.js b/components/firstui/fui-barcode/gcanvas/context-webgl/UniformLocation.js new file mode 100644 index 0000000..e0fb84b --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/UniformLocation.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 5 14 8228 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/context-webgl/classUtils.js b/components/firstui/fui-barcode/gcanvas/context-webgl/classUtils.js new file mode 100644 index 0000000..842eb9e --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/context-webgl/classUtils.js @@ -0,0 +1,4 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 1482 2 81 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +export function getTransferedObjectUUID(name, id) { + return `${name.toLowerCase()}-${id}`; +} \ No newline at end of file diff --git a/components/firstui/fui-barcode/gcanvas/env/canvas.js b/components/firstui/fui-barcode/gcanvas/env/canvas.js new file mode 100644 index 0000000..8c0529d --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/env/canvas.js @@ -0,0 +1,75 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:151 48 2 2810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/env/image.js b/components/firstui/fui-barcode/gcanvas/env/image.js new file mode 100644 index 0000000..ef6e68d --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/env/image.js @@ -0,0 +1,97 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5148 2 28 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-barcode/gcanvas/env/tool.js b/components/firstui/fui-barcode/gcanvas/env/tool.js new file mode 100644 index 0000000..833a0ed --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/env/tool.js @@ -0,0 +1,25 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 51 4822 8 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 + +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/components/firstui/fui-barcode/gcanvas/index.js b/components/firstui/fui-barcode/gcanvas/index.js new file mode 100644 index 0000000..e0ffae9 --- /dev/null +++ b/components/firstui/fui-barcode/gcanvas/index.js @@ -0,0 +1,48 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 51 48 2281 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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 + }); + let pixelRatio = uni.getSystemInfoSync().pixelRatio; + canvas.width = el.style.width * pixelRatio; + canvas.height = el.style.height * pixelRatio; + + return canvas; +}; \ No newline at end of file diff --git a/components/firstui/fui-bottom-navbar/fui-bottom-navbar.vue b/components/firstui/fui-bottom-navbar/fui-bottom-navbar.vue new file mode 100644 index 0000000..7191680 --- /dev/null +++ b/components/firstui/fui-bottom-navbar/fui-bottom-navbar.vue @@ -0,0 +1,276 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-bottom-popup/fui-bottom-popup.vue b/components/firstui/fui-bottom-popup/fui-bottom-popup.vue new file mode 100644 index 0000000..c90e55c --- /dev/null +++ b/components/firstui/fui-bottom-popup/fui-bottom-popup.vue @@ -0,0 +1,247 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-bubble-box/fui-bubble-box.vue b/components/firstui/fui-bubble-box/fui-bubble-box.vue new file mode 100644 index 0000000..19d8d95 --- /dev/null +++ b/components/firstui/fui-bubble-box/fui-bubble-box.vue @@ -0,0 +1,520 @@ + + + + + \ No newline at end of file diff --git a/components/firstui/fui-button/fui-button.vue b/components/firstui/fui-button/fui-button.vue new file mode 100644 index 0000000..cff45db --- /dev/null +++ b/components/firstui/fui-button/fui-button.vue @@ -0,0 +1,525 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-calendar/fui-calendar.vue b/components/firstui/fui-calendar/fui-calendar.vue new file mode 100644 index 0000000..fa55289 --- /dev/null +++ b/components/firstui/fui-calendar/fui-calendar.vue @@ -0,0 +1,875 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-calendar/index.js b/components/firstui/fui-calendar/index.js new file mode 100644 index 0000000..aff7c32 --- /dev/null +++ b/components/firstui/fui-calendar/index.js @@ -0,0 +1,580 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 1 48 228108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +/** + * @1900-2100区间内的公历、农历互转 + * @公历转农历:solar2lunar(1987,11,01); + * @农历转公历:lunar2solar(1987,09,10); + */ +let calendar = { + /** + * 农历1900-2100的润大小信息表 + * @Array Of Property + * @return Hex + */ + lunarInfo: [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, + 0x055d2, //1900-1909 + 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, //1910-1919 + 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, //1920-1929 + 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, //1930-1939 + 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, //1940-1949 + 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, //1950-1959 + 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, //1960-1969 + 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, //1970-1979 + 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, //1980-1989 + 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0, //1990-1999 + 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, //2000-2009 + 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, //2010-2019 + 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, //2020-2029 + 0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, //2030-2039 + 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, //2040-2049 + 0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, //2050-2059 + 0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, //2060-2069 + 0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, //2070-2079 + 0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, //2080-2089 + 0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, //2090-2099 + 0x0d520 + ], //2100 + /** + * 公历每个月份的天数普通表 + * @Array Of Property + * @return Number + */ + solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + /** + * 天干地支之天干速查表 + * @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"] + * @return Cn string + */ + Gan: ["\u7532", "\u4e59", "\u4e19", "\u4e01", "\u620a", "\u5df1", "\u5e9a", "\u8f9b", "\u58ec", "\u7678"], + /** + * 天干地支之地支速查表 + * @Array Of Property + * @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"] + * @return Cn string + */ + Zhi: ["\u5b50", "\u4e11", "\u5bc5", "\u536f", "\u8fb0", "\u5df3", "\u5348", "\u672a", "\u7533", "\u9149", + "\u620c", + "\u4ea5" + ], + /** + * 天干地支之地支速查表<=>生肖 + * @Array Of Property + * @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"] + * @return Cn string + */ + Animals: ["\u9f20", "\u725b", "\u864e", "\u5154", "\u9f99", "\u86c7", "\u9a6c", "\u7f8a", "\u7334", "\u9e21", + "\u72d7", "\u732a" + ], + /** + * 24节气速查表 + * @Array Of Property + * @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"] + * @return Cn string + */ + solarTerm: ["\u5c0f\u5bd2", "\u5927\u5bd2", "\u7acb\u6625", "\u96e8\u6c34", "\u60ca\u86f0", "\u6625\u5206", + "\u6e05\u660e", "\u8c37\u96e8", "\u7acb\u590f", "\u5c0f\u6ee1", "\u8292\u79cd", "\u590f\u81f3", + "\u5c0f\u6691", + "\u5927\u6691", "\u7acb\u79cb", "\u5904\u6691", "\u767d\u9732", "\u79cb\u5206", "\u5bd2\u9732", + "\u971c\u964d", + "\u7acb\u51ac", "\u5c0f\u96ea", "\u5927\u96ea", "\u51ac\u81f3" + ], + /** + * 1900-2100各年的24节气日期速查表 + * @Array Of Property + * @return 0x string For splice + */ + sTermInfo: ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf97c3598082c95f8c965cc920f', + '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', + 'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f', + '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa', + '97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', + '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f', + '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', + '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722', + '9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f', + '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e', + '97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', + '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722', + '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', + '9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e', + '97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', + '9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', + '9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2', + '977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', + '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', + '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', + '977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5', + '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722', + '7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', + '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721', + '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd', + '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35', + '7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', + '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5', + '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35', + '665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35', + '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722' + ], + /** + * 数字转中文速查表 + * @Array Of Property + * @trans ['日','一','二','三','四','五','六','七','八','九','十'] + * @return Cn string + */ + nStr1: ["\u65e5", "\u4e00", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d", "\u4e03", "\u516b", "\u4e5d", + "\u5341" + ], + /** + * 日期转农历称呼速查表 + * @Array Of Property + * @trans ['初','十','廿','卅'] + * @return Cn string + */ + nStr2: ["\u521d", "\u5341", "\u5eff", "\u5345"], + /** + * 月份转农历称呼速查表 + * @Array Of Property + * @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊'] + * @return Cn string + */ + nStr3: ["\u6b63", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d", "\u4e03", "\u516b", "\u4e5d", "\u5341", + "\u51ac", + "\u814a" + ], + /** + * 返回农历y年一整年的总天数 + * @param lunar Year + * @return Number + * @eg:let count = calendar.lYearDays(1987) ;//count=387 + */ + lYearDays: function(y) { + let i, sum = 348; + for (i = 0x8000; i > 0x8; i >>= 1) { + sum += (calendar.lunarInfo[y - 1900] & i) ? 1 : 0; + } + return (sum + calendar.leapDays(y)); + }, + /** + * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0 + * @param lunar Year + * @return Number (0-12) + * @eg:let leapMonth = calendar.leapMonth(1987) ;//leapMonth=6 + */ + leapMonth: function(y) { //闰字编码 \u95f0 + return (calendar.lunarInfo[y - 1900] & 0xf); + }, + /** + * 返回农历y年闰月的天数 若该年没有闰月则返回0 + * @param lunar Year + * @return Number (0、29、30) + * @eg:let leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29 + */ + leapDays: function(y) { + if (calendar.leapMonth(y)) { + return ((calendar.lunarInfo[y - 1900] & 0x10000) ? 30 : 29); + } + return (0); + }, + /** + * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法 + * @param lunar Year + * @return Number (-1、29、30) + * @eg:let MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29 + */ + monthDays: function(y, m) { + if (m > 12 || m < 1) { + return -1 + } //月份参数从1至12,参数错误返回-1 + return ((calendar.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29); + }, + /** + * 返回公历(!)y年m月的天数 + * @param solar Year + * @return Number (-1、28、29、30、31) + * @eg:let solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30 + */ + solarDays: function(y, m) { + if (m > 12 || m < 1) { + return -1 + } //若参数错误 返回-1 + let ms = m - 1; + if (ms == 1) { //2月份的闰平规律测算后确认返回28或29 + return (((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) ? 29 : 28); + } else { + return (calendar.solarMonth[ms]); + } + }, + /** + * 农历年份转换为干支纪年 + * @param lYear 农历年的年份数 + * @return Cn string + */ + toGanZhiYear: function(lYear) { + let ganKey = (lYear - 3) % 10; + let zhiKey = (lYear - 3) % 12; + if (ganKey == 0) ganKey = 10; //如果余数为0则为最后一个天干 + if (zhiKey == 0) zhiKey = 12; //如果余数为0则为最后一个地支 + return calendar.Gan[ganKey - 1] + calendar.Zhi[zhiKey - 1]; + }, + /** + * 公历月、日判断所属星座 + * @param cMonth [description] + * @param cDay [description] + * @return Cn string + */ + toAstro: function(cMonth, cDay) { + let s = + "\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf"; + let arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22]; + return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + "\u5ea7"; //座 + }, + /** + * 传入offset偏移量返回干支 + * @param offset 相对甲子的偏移量 + * @return Cn string + */ + toGanZhi: function(offset) { + return calendar.Gan[offset % 10] + calendar.Zhi[offset % 12]; + }, + /** + * 传入公历(!)y年获得该年第n个节气的公历日期 + * @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起 + * @return day Number + * @eg:let _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春 + */ + getTerm: function(y, n) { + if (y < 1900 || y > 2100) { + return -1; + } + if (n < 1 || n > 24) { + return -1; + } + let _table = calendar.sTermInfo[y - 1900]; + let _info = [ + parseInt('0x' + _table.substr(0, 5)).toString(), + parseInt('0x' + _table.substr(5, 5)).toString(), + parseInt('0x' + _table.substr(10, 5)).toString(), + parseInt('0x' + _table.substr(15, 5)).toString(), + parseInt('0x' + _table.substr(20, 5)).toString(), + parseInt('0x' + _table.substr(25, 5)).toString() + ]; + let _calday = [ + _info[0].substr(0, 1), + _info[0].substr(1, 2), + _info[0].substr(3, 1), + _info[0].substr(4, 2), + _info[1].substr(0, 1), + _info[1].substr(1, 2), + _info[1].substr(3, 1), + _info[1].substr(4, 2), + _info[2].substr(0, 1), + _info[2].substr(1, 2), + _info[2].substr(3, 1), + _info[2].substr(4, 2), + _info[3].substr(0, 1), + _info[3].substr(1, 2), + _info[3].substr(3, 1), + _info[3].substr(4, 2), + _info[4].substr(0, 1), + _info[4].substr(1, 2), + _info[4].substr(3, 1), + _info[4].substr(4, 2), + _info[5].substr(0, 1), + _info[5].substr(1, 2), + _info[5].substr(3, 1), + _info[5].substr(4, 2), + ]; + return parseInt(_calday[n - 1]); + }, + /** + * 传入农历数字月份返回汉语通俗表示法 + * @param lunar month + * @return Cn string + * @eg:let cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月' + */ + toChinaMonth: function(m) { // 月 => \u6708 + if (m > 12 || m < 1) { + return -1 + } //若参数错误 返回-1 + let s = calendar.nStr3[m - 1]; + s += "\u6708"; //加上月字 + return s; + }, + /** + * 传入农历日期数字返回汉字表示法 + * @param lunar day + * @return Cn string + * @eg:let cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一' + */ + toChinaDay: function(d) { //日 => \u65e5 + let s; + switch (d) { + case 10: + s = '\u521d\u5341'; + break; + case 20: + s = '\u4e8c\u5341'; + break; + break; + case 30: + s = '\u4e09\u5341'; + break; + break; + default: + s = calendar.nStr2[Math.floor(d / 10)]; + s += calendar.nStr1[d % 10]; + } + return (s); + }, + /** + * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春” + * @param y year + * @return Cn string + * @eg:let animal = calendar.getAnimal(1987) ;//animal='兔' + */ + getAnimal: function(y) { + return calendar.Animals[(y - 4) % 12] + }, + /** + * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON + * @param y solar year + * @param m solar month + * @param d solar day + * @return JSON object + * @eg:console.log(calendar.solar2lunar(1987,11,01)); + */ + solar2lunar: function(y, m, d) { //参数区间1900.1.31~2100.12.31 + if (y < 1900 || y > 2100) { + return -1; + } //年份限定、上限 + if (y == 1900 && m == 1 && d < 31) { + return -1; + } //下限 + let objDate; + if (!y) { //未传参 获得当天 + objDate = new Date(); + } else { + objDate = new Date(y, parseInt(m) - 1, d) + } + let i, leap = 0, + temp = 0; + //修正ymd参数 + y = objDate.getFullYear(); + m = objDate.getMonth() + 1; + d = objDate.getDate(); + let offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, + 31)) / + 86400000; + for (i = 1900; i < 2101 && offset > 0; i++) { + temp = calendar.lYearDays(i); + offset -= temp; + } + if (offset < 0) { + offset += temp; + i--; + } + //是否今天 + let isTodayObj = new Date(), + isToday = false; + if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) { + isToday = true; + } + //星期几 + let nWeek = objDate.getDay(), + cWeek = calendar.nStr1[nWeek]; + if (nWeek == 0) { + nWeek = 7; + } //数字表示周几顺应天朝周一开始的惯例 + //农历年 + let year = i; + leap = calendar.leapMonth(i); //闰哪个月 + let isLeap = false; + //效验闰月 + for (i = 1; i < 13 && offset > 0; i++) { + //闰月 + if (leap > 0 && i == (leap + 1) && isLeap == false) { + --i; + isLeap = true; + temp = calendar.leapDays(year); //计算农历闰月天数 + } else { + temp = calendar.monthDays(year, i); //计算农历普通月天数 + } + //解除闰月 + if (isLeap == true && i == (leap + 1)) { + isLeap = false; + } + offset -= temp; + } + if (offset == 0 && leap > 0 && i == leap + 1) + if (isLeap) { + isLeap = false; + } else { + isLeap = true; + --i; + } + if (offset < 0) { + offset += temp; + --i; + } + //农历月 + let month = i; + //农历日 + let day = offset + 1; + //天干地支处理 + let sm = m - 1; + let gzY = calendar.toGanZhiYear(year); + //月柱 1900年1月小寒以前为 丙子月(60进制12) + let firstNode = calendar.getTerm(year, (m * 2 - 1)); //返回当月「节」为几日开始 + let secondNode = calendar.getTerm(year, (m * 2)); //返回当月「节」为几日开始 + //依据12节气修正干支月 + let gzM = calendar.toGanZhi((y - 1900) * 12 + m + 11); + if (d >= firstNode) { + gzM = calendar.toGanZhi((y - 1900) * 12 + m + 12); + } + //传入的日期的节气与否 + let isTerm = false; + let Term = null; + if (firstNode == d) { + isTerm = true; + Term = calendar.solarTerm[m * 2 - 2]; + } + if (secondNode == d) { + isTerm = true; + Term = calendar.solarTerm[m * 2 - 1]; + } + //日柱 当月一日与 1900/1/1 相差天数 + let dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10; + let gzD = calendar.toGanZhi(dayCyclical + d - 1); + //该日期所属的星座 + let astro = calendar.toAstro(m, d); + return { + 'lYear': year, + 'lMonth': month, + 'lDay': day, + 'Animal': calendar.getAnimal(year), + 'IMonthCn': (isLeap ? "\u95f0" : '') + calendar.toChinaMonth(month), + 'IDayCn': calendar.toChinaDay(day), + 'cYear': y, + 'cMonth': m, + 'cDay': d, + 'gzYear': gzY, + 'gzMonth': gzM, + 'gzDay': gzD, + 'isToday': isToday, + 'isLeap': isLeap, + 'nWeek': nWeek, + 'ncWeek': "\u661f\u671f" + cWeek, + 'isTerm': isTerm, + 'Term': Term, + 'astro': astro + }; + }, + /** + * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON + * @param y lunar year + * @param m lunar month + * @param d lunar day + * @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可] + * @return JSON object + * @eg:console.log(calendar.lunar2solar(1987,9,10)); + */ + lunar2solar: function(y, m, d, isLeapMonth) { //参数区间1900.1.31~2100.12.1 + isLeapMonth = !!isLeapMonth; + let leapOffset = 0; + let leapMonth = calendar.leapMonth(y); + let leapDay = calendar.leapDays(y); + if (isLeapMonth && (leapMonth != m)) { + return -1; + } //传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同 + if (y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31) { + return -1; + } //超出了最大极限值 + let day = calendar.monthDays(y, m); + let _day = day; + //bugFix 2016-9-25 + //if month is leap, _day use leapDays method + if (isLeapMonth) { + _day = calendar.leapDays(y, m); + } + if (y < 1900 || y > 2100 || d > _day) { + return -1; + } //参数合法性效验 + //计算农历的时间差 + let offset = 0; + for (let i = 1900; i < y; i++) { + offset += calendar.lYearDays(i); + } + let leap = 0, + isAdd = false; + for (let i = 1; i < m; i++) { + leap = calendar.leapMonth(y); + if (!isAdd) { //处理闰月 + if (leap <= i && leap > 0) { + offset += calendar.leapDays(y); + isAdd = true; + } + } + offset += calendar.monthDays(y, i); + } + //转换闰月农历 需补充该年闰月的前一个月的时差 + if (isLeapMonth) { + offset += day; + } + //1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点) + let stmap = Date.UTC(1900, 1, 30, 0, 0, 0); + let calObj = new Date((offset + d - 31) * 86400000 + stmap); + let cY = calObj.getUTCFullYear(); + let cM = calObj.getUTCMonth() + 1; + let cD = calObj.getUTCDate(); + return calendar.solar2lunar(cY, cM, cD); + } +}; + +const lang = { + m_cn: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], + m_en: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + h_cn: ['日', '一', '二', '三', '四', '五', '六'], + h_en: ['S', 'M', 'T', 'W', 'T', 'F', 'S'] +} + +export default { + solarTolunar: calendar.solar2lunar, + lunarTosolar: calendar.lunar2solar, + lang: lang +}; \ No newline at end of file diff --git a/components/firstui/fui-card/fui-card.vue b/components/firstui/fui-card/fui-card.vue new file mode 100644 index 0000000..e79df25 --- /dev/null +++ b/components/firstui/fui-card/fui-card.vue @@ -0,0 +1,325 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-cascader/fui-cascader.vue b/components/firstui/fui-cascader/fui-cascader.vue new file mode 100644 index 0000000..ca839b9 --- /dev/null +++ b/components/firstui/fui-cascader/fui-cascader.vue @@ -0,0 +1,586 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-checkbox-group/fui-checkbox-group.vue b/components/firstui/fui-checkbox-group/fui-checkbox-group.vue new file mode 100644 index 0000000..ead8b61 --- /dev/null +++ b/components/firstui/fui-checkbox-group/fui-checkbox-group.vue @@ -0,0 +1,102 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-checkbox/fui-checkbox.vue b/components/firstui/fui-checkbox/fui-checkbox.vue new file mode 100644 index 0000000..2ed2167 --- /dev/null +++ b/components/firstui/fui-checkbox/fui-checkbox.vue @@ -0,0 +1,241 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-circle/fui-circle.vue b/components/firstui/fui-circle/fui-circle.vue new file mode 100644 index 0000000..3779df4 --- /dev/null +++ b/components/firstui/fui-circle/fui-circle.vue @@ -0,0 +1,336 @@ + + + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-circle/gcanvas/bridge/bridge-weex.js b/components/firstui/fui-circle/gcanvas/bridge/bridge-weex.js new file mode 100644 index 0000000..fabe87f --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/bridge/bridge-weex.js @@ -0,0 +1,242 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:151 482 281 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-2d/FillStyleLinearGradient.js b/components/firstui/fui-circle/gcanvas/context-2d/FillStyleLinearGradient.js new file mode 100644 index 0000000..81e2d29 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-2d/FillStyleLinearGradient.js @@ -0,0 +1,19 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 1 48 228 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-2d/FillStylePattern.js b/components/firstui/fui-circle/gcanvas/context-2d/FillStylePattern.js new file mode 100644 index 0000000..00bf72f --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-2d/FillStylePattern.js @@ -0,0 +1,9 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15148 22 81 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +class FillStylePattern { + constructor(img, pattern) { + this._style = pattern; + this._img = img; + } +} + +export default FillStylePattern; \ No newline at end of file diff --git a/components/firstui/fui-circle/gcanvas/context-2d/FillStyleRadialGradient.js b/components/firstui/fui-circle/gcanvas/context-2d/FillStyleRadialGradient.js new file mode 100644 index 0000000..99ae13c --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-2d/FillStyleRadialGradient.js @@ -0,0 +1,18 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 148228 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-2d/RenderingContext.js b/components/firstui/fui-circle/gcanvas/context-2d/RenderingContext.js new file mode 100644 index 0000000..b4e73b1 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-2d/RenderingContext.js @@ -0,0 +1,667 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 5 1482 2810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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); + } + }); + } +} \ No newline at end of file diff --git a/components/firstui/fui-circle/gcanvas/context-webgl/ActiveInfo.js b/components/firstui/fui-circle/gcanvas/context-webgl/ActiveInfo.js new file mode 100644 index 0000000..91cbfe0 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/ActiveInfo.js @@ -0,0 +1,12 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 514 8228 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/Buffer.js b/components/firstui/fui-circle/gcanvas/context-webgl/Buffer.js new file mode 100644 index 0000000..4d7a250 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/Buffer.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 1482 2 81 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/Framebuffer.js b/components/firstui/fui-circle/gcanvas/context-webgl/Framebuffer.js new file mode 100644 index 0000000..7af7ef2 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/Framebuffer.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 14 8228 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/GLenum.js b/components/firstui/fui-circle/gcanvas/context-webgl/GLenum.js new file mode 100644 index 0000000..d1fed90 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/GLenum.js @@ -0,0 +1,299 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 1 4822 8 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/GLmethod.js b/components/firstui/fui-circle/gcanvas/context-webgl/GLmethod.js new file mode 100644 index 0000000..af6d02b --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/GLmethod.js @@ -0,0 +1,143 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 151 482 281 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/GLtype.js b/components/firstui/fui-circle/gcanvas/context-webgl/GLtype.js new file mode 100644 index 0000000..d3fc74b --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/GLtype.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 514 822 8 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/Program.js b/components/firstui/fui-circle/gcanvas/context-webgl/Program.js new file mode 100644 index 0000000..982d23f --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/Program.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 51 4 8 228108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/Renderbuffer.js b/components/firstui/fui-circle/gcanvas/context-webgl/Renderbuffer.js new file mode 100644 index 0000000..2efde68 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/Renderbuffer.js @@ -0,0 +1,22 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 148228 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/RenderingContext.js b/components/firstui/fui-circle/gcanvas/context-webgl/RenderingContext.js new file mode 100644 index 0000000..37455c0 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/RenderingContext.js @@ -0,0 +1,1192 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 1482 2 8 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/Shader.js b/components/firstui/fui-circle/gcanvas/context-webgl/Shader.js new file mode 100644 index 0000000..19376bc --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/Shader.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15 148 228 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/ShaderPrecisionFormat.js b/components/firstui/fui-circle/gcanvas/context-webgl/ShaderPrecisionFormat.js new file mode 100644 index 0000000..ab578c8 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/ShaderPrecisionFormat.js @@ -0,0 +1,12 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15148 2 2 8108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/Texture.js b/components/firstui/fui-circle/gcanvas/context-webgl/Texture.js new file mode 100644 index 0000000..77c6ca3 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/Texture.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1514 8 2 2 8 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/UniformLocation.js b/components/firstui/fui-circle/gcanvas/context-webgl/UniformLocation.js new file mode 100644 index 0000000..0872f1c --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/UniformLocation.js @@ -0,0 +1,23 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 51 48 2 28 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/context-webgl/classUtils.js b/components/firstui/fui-circle/gcanvas/context-webgl/classUtils.js new file mode 100644 index 0000000..9597aff --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/context-webgl/classUtils.js @@ -0,0 +1,4 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:151 4 8 22 81 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +export function getTransferedObjectUUID(name, id) { + return `${name.toLowerCase()}-${id}`; +} \ No newline at end of file diff --git a/components/firstui/fui-circle/gcanvas/env/canvas.js b/components/firstui/fui-circle/gcanvas/env/canvas.js new file mode 100644 index 0000000..b233fc8 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/env/canvas.js @@ -0,0 +1,75 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 514 82 2 81 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/env/image.js b/components/firstui/fui-circle/gcanvas/env/image.js new file mode 100644 index 0000000..a34bc0e --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/env/image.js @@ -0,0 +1,97 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 514 82 28 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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/components/firstui/fui-circle/gcanvas/env/tool.js b/components/firstui/fui-circle/gcanvas/env/tool.js new file mode 100644 index 0000000..09f3027 --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/env/tool.js @@ -0,0 +1,25 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 51 4 8 228 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 + +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/components/firstui/fui-circle/gcanvas/index.js b/components/firstui/fui-circle/gcanvas/index.js new file mode 100644 index 0000000..726697b --- /dev/null +++ b/components/firstui/fui-circle/gcanvas/index.js @@ -0,0 +1,48 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 14 8228 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +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 + }); + let pixelRatio = uni.getSystemInfoSync().pixelRatio; + canvas.width = el.style.width * pixelRatio; + canvas.height = el.style.height * pixelRatio; + + return canvas; +}; \ No newline at end of file diff --git a/components/firstui/fui-circle/mpjs.js b/components/firstui/fui-circle/mpjs.js new file mode 100644 index 0000000..252bf67 --- /dev/null +++ b/components/firstui/fui-circle/mpjs.js @@ -0,0 +1,142 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 51 48 2 2 810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifdef MP + +export default { + data() { + return { + context: null, + start: 0 + } + }, + watch: { + percent(val) { + setTimeout(() => { + this.init(); + }, 50) + }, + w(val) { + setTimeout(() => { + this.init(); + }, 50) + }, + strokeWidth(val) { + setTimeout(() => { + this.init(); + }, 50) + } + }, + mounted() { + this.$nextTick(() => { + setTimeout(() => { + this.init(); + }, 50) + }) + }, + methods: { + //初始化绘制 + init(init) { + let start = this.activeMode === 'backwards' ? 0 : this.start; + start = start > this.percent ? 0 : start; + this.drawCircle(start); + }, + //默认背景 + drawDefaultCircle(ctx) { + let sw = Number(this.strokeWidth); + // #ifdef MP-ALIPAY + sw = sw * 4 + // #endif + ctx.setLineWidth(sw); + ctx.setStrokeStyle(this.background); + let eAngle = Math.PI * 2 + Number(this.sAngle) * Math.PI; + this.drawArc(ctx, eAngle, true); + }, + drawCircle(start) { + let ctx = this.context; + if (!ctx) { + ctx = uni.createCanvasContext(this.circleId, this); + this.context = ctx; + } + //绘制默认背景 + this.defaultShow && this.drawDefaultCircle(ctx) + let sw = Number(this.strokeWidth) + // #ifdef MP-ALIPAY + sw = sw * 4 + // #endif + ctx.setLineWidth(sw); + let gradient = this.foreground || this.primaryColor; + // #ifndef MP-KUAISHOU + if (this.gradient) { + gradient = ctx.createLinearGradient(0, 0, Number(this.w), 0); + gradient.addColorStop(0, this.gradient); + gradient.addColorStop(1, this.foreground || this.primaryColor); + } + // #endif + ctx.setStrokeStyle(gradient); + let percentage = Number(this.percent) + if (percentage > 0) { + start += Number(this.speed); + start = start > percentage ? percentage : start; + } + if (this.show) { + let si = Number(this.size) + // #ifdef MP-ALIPAY + si = si * 4 + // #endif + ctx.setFontSize(si); + ctx.setFillStyle(this.color || this.primaryColor); + ctx.setTextAlign('center'); + ctx.setTextBaseline('middle'); + let percent = `${this.counterclockwise ? 100 - start : start}%`; + let radius = this.w / 2 + // #ifdef MP-ALIPAY + radius = radius * 4 + // #endif + ctx.fillText(percent, radius, radius); + } + if (percentage == 0 || (this.counterclockwise && start == 100)) { + ctx.draw(); + } else { + let eAngle = ((2 * Math.PI) / 100) * start + Number(this.sAngle) * Math.PI; + this.drawArc(ctx, eAngle); + } + let time = 1000 / 60 + // #ifdef MP-ALIPAY + time = time / 2 + // #endif + setTimeout(() => { + this.start = start; + if (start == percentage) { + this.$emit('end', { + canvasId: this.circleId, + percent: start + }); + } else { + this.drawCircle(start); + } + this.$emit('change', { + percent: start + }); + }, time); + }, + //创建弧线 + drawArc(ctx, eAngle, def) { + ctx.setLineCap(this.lineCap); + ctx.beginPath(); + let radius = this.w / 2; + let sw = Number(this.strokeWidth); + // #ifdef MP-ALIPAY + radius = radius * 4 + sw = sw * 4 + // #endif + ctx.arc(radius, radius, radius - sw, Number(this.sAngle) * Math.PI, eAngle, this.counterclockwise); + ctx.stroke(); + !def && ctx.draw(); + } + } +} + +// #endif + +// #ifndef MP +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-circle/nvue.js b/components/firstui/fui-circle/nvue.js new file mode 100644 index 0000000..3864eaa --- /dev/null +++ b/components/firstui/fui-circle/nvue.js @@ -0,0 +1,139 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5148 2 28 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifdef APP-NVUE +import { + enable, + WeexBridge +} from './gcanvas/index.js'; +export default { + data() { + return { + start: 0 + } + }, + watch: { + percent(val) { + setTimeout(() => { + this.init(); + }, 50) + }, + w(val) { + setTimeout(() => { + this.init(); + }, 50) + }, + strokeWidth(val) { + setTimeout(() => { + this.init(); + }, 50) + } + }, + created() { + let sys = uni.getSystemInfoSync() + this.isAndroid = sys.platform.toLocaleLowerCase() == "android" + this.fontSize=this.isAndroid ? Number(this.size) : Number(this.size) * sys.pixelRatio + }, + mounted() { + this.init(true); + }, + // #ifndef VUE3 + beforeDestroy() { + this.context = null; + }, + // #endif + // #ifdef VUE3 + beforeUnmount() { + this.context = null; + }, + // #endif + methods: { + //初始化绘制 + init(init) { + let start = this.activeMode === 'backwards' ? 0 : this.start; + this.drawCircle(start); + }, + //默认背景 + drawDefaultCircle(ctx) { + ctx.setLineWidth(Number(this.strokeWidth)); + ctx.setStrokeStyle(this.background); + let eAngle = Math.PI * 2 + Number(this.sAngle) * Math.PI; + this.drawArc(ctx, eAngle, true); + }, + //进度圆环 + drawCircle(start) { + let ctx = this.context; + if (!ctx) { + let ganvas = this.$refs[this.circleId]; + let canvas = enable(ganvas, { + bridge: WeexBridge + }); + ctx = canvas.getContext('2d'); + //android赋值后,canvas大小可能不受控制 + this.context = ctx; + } + //绘制默认背景 + if (!this.isAndroid) { + ctx.setFillStyle(this.fillStyle) + ctx.fillRect(0, 0, this.w, this.w) + } + // ctx.clearRect(0, 0, this.w, this.w) + this.defaultShow && this.drawDefaultCircle(ctx) + ctx.setLineWidth(Number(this.strokeWidth)); + ctx.beginPath() + let gradient = this.foreground || this.primaryColor; + // if (this.gradient) { + // gradient = ctx.createLinearGradient(0, 0, this.w, 0); + // gradient.addColorStop(0, this.gradient); + // gradient.addColorStop(1, this.foreground); + // } + ctx.setStrokeStyle(gradient); + let percentage = Number(this.percent) + if (percentage > 0) { + start += Number(this.speed); + start = start > percentage ? percentage : start; + } + if (this.show) { + ctx.setFontSize(this.fontSize); + ctx.setFillStyle(this.color || this.primaryColor); + ctx.setTextAlign('center'); + ctx.setTextBaseline('middle'); + let percent = `${this.counterclockwise ? 100 - start : start}%`; + let radius = this.w / 2; + ctx.fillText(percent, radius, radius); + } + if (percentage == 0 || (this.counterclockwise && start == 100)) { + ctx.draw(); + } else { + let eAngle = ((2 * Math.PI) / 100) * start + Number(this.sAngle) * Math.PI; + this.drawArc(ctx, eAngle); + } + setTimeout(() => { + this.start = start; + if (start == percentage) { + this.$emit('end', { + canvasId: this.circleId, + percent: start + }); + } else { + this.drawCircle(start); + } + this.$emit('change', { + percent: start + }); + }, 1000 / 60); + }, + drawArc(ctx, eAngle, def) { + ctx.setLineCap(this.lineCap); + ctx.beginPath(); + let radius = this.w / 2; + ctx.arc(radius, radius, radius - Number(this.strokeWidth), Number(this.sAngle)* Math.PI, eAngle, this.counterclockwise); + ctx.stroke(); + !def && ctx.draw(); + } + } +} + +// #endif + +// #ifndef APP-NVUE +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-circle/render.js b/components/firstui/fui-circle/render.js new file mode 100644 index 0000000..3acf457 --- /dev/null +++ b/components/firstui/fui-circle/render.js @@ -0,0 +1,31 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 51 4 82 2810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifdef APP-VUE || H5 +export default { + data() { + return { + percentage: -1 + } + }, + watch: { + percent(val) { + this.percentage = Number(val) || 0 + } + }, + mounted() { + this.percentage = Number(this.percent) || 0 + }, + methods: { + change(e) { + this.$emit('change', e); + }, + end(e) { + this.$emit('end', e); + } + } +} + +// #endif + +// #ifndef APP-VUE || H5 +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-clipboard/clipboard.min.js b/components/firstui/fui-clipboard/clipboard.min.js new file mode 100644 index 0000000..3a7a227 --- /dev/null +++ b/components/firstui/fui-clipboard/clipboard.min.js @@ -0,0 +1,8 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 1 4 8 228 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifdef H5 +/** + * clipboard.min.js support for ES6 module import + * https://doc.firstui.cn/ + **/ +function select(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var i=t.hasAttribute("readonly");i||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),i||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var n=window.getSelection(),r=document.createRange();r.selectNodeContents(t),n.removeAllRanges(),n.addRange(r),e=n.toString()}return e}class ClipboardAction{constructor(t){this.resolveOptions(t),this.initSelection()}resolveOptions(t={}){this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}initSelection(){this.text?this.selectFake():this.target&&this.selectTarget()}selectFake(){const t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=(()=>this.removeFake()),this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";let e=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=`${e}px`,this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=select(this.fakeElem),this.copyText()}removeFake(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}selectTarget(){this.selectedText=select(this.target),this.copyText()}copyText(){let t;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}handleResult(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}clearSelection(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}set action(t="copy"){if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')}get action(){return this._action}set target(t){if(void 0!==t){if(!t||"object"!=typeof t||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}}get target(){return this._target}destroy(){this.removeFake()}}function Emitter(){}Emitter.prototype={on:function(t,e,i){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){var n=this;function r(){n.off(t,r),e.apply(i,arguments)}return r._=e,this.on(t,r,i)},emit:function(t){for(var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),n=0,r=i.length;nthis.onClick(t))}onClick(t){const e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new ClipboardAction({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}defaultAction(t){return getAttributeValue("action",t)}defaultTarget(t){const e=getAttributeValue("target",t);if(e)return document.querySelector(e)}static isSupported(t=["copy","cut"]){const e="string"==typeof t?[t]:t;let i=!!document.queryCommandSupported;return e.forEach(t=>{i=i&&!!document.queryCommandSupported(t)}),i}defaultText(t){return getAttributeValue("text",t)}destroy(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}function getAttributeValue(t,e){const i=`data-clipboard-${t}`;if(e.hasAttribute(i))return e.getAttribute(i)}export default Clipboard; +// #endif \ No newline at end of file diff --git a/components/firstui/fui-clipboard/index.js b/components/firstui/fui-clipboard/index.js new file mode 100644 index 0000000..07fb523 --- /dev/null +++ b/components/firstui/fui-clipboard/index.js @@ -0,0 +1,52 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 5 1 4 8 22 8108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +/*! + * 剪贴板 + * + * 官网地址:https://firstui.cn/ + * 文档地址:https://doc.firstui.cn/ + */ +// #ifdef H5 +import ClipboardJS from "./clipboard.min.js" +// #endif + +/** + * data 需要复制的数据 + * callback 回调 + * e 当用户点击后需要先请求接口再进行复制时,需要传入此参数(H5端) + * **/ +const getClipboardData = function(data, callback, e) { + // #ifdef APP-PLUS || MP + uni.setClipboardData({ + data: data, + success(res) { + ("function" == typeof callback) && callback(true) + }, + fail(res) { + ("function" == typeof callback) && callback(false) + } + }) + // #endif + + // #ifdef H5 + let event =window.event || e || {} + let clipboard = new ClipboardJS("", { + text: () => data + }) + clipboard.on('success', (e) => { + ("function" == typeof callback) && callback(true) + clipboard.off('success') + clipboard.off('error') + clipboard.destroy() + }); + clipboard.on('error', (e) => { + ("function" == typeof callback) && callback(false) + clipboard.off('success') + clipboard.off('error') + clipboard.destroy() + }); + clipboard.onClick(event) + // #endif +} +export default { + getClipboardData: getClipboardData +}; \ No newline at end of file diff --git a/components/firstui/fui-col/fui-col.vue b/components/firstui/fui-col/fui-col.vue new file mode 100644 index 0000000..998b2e5 --- /dev/null +++ b/components/firstui/fui-col/fui-col.vue @@ -0,0 +1,3220 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-collapse-item/fui-collapse-item.vue b/components/firstui/fui-collapse-item/fui-collapse-item.vue new file mode 100644 index 0000000..075260b --- /dev/null +++ b/components/firstui/fui-collapse-item/fui-collapse-item.vue @@ -0,0 +1,343 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-collapse/fui-collapse.vue b/components/firstui/fui-collapse/fui-collapse.vue new file mode 100644 index 0000000..069434e --- /dev/null +++ b/components/firstui/fui-collapse/fui-collapse.vue @@ -0,0 +1,50 @@ + + + + \ No newline at end of file diff --git a/components/firstui/fui-config/index.js b/components/firstui/fui-config/index.js new file mode 100644 index 0000000..f615790 --- /dev/null +++ b/components/firstui/fui-config/index.js @@ -0,0 +1,115 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5148 22 81 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +/* + 组件属性全局配置文件。优先级:全局配置文件props < 直接设置组件props + 目前支持配置的组件:fui-button、fui-icon、fui-text、fui-input、fui-form-item、fui-list-cell +*/ + +// 主色(V1.9.8+),仅Nvue端以及无法使用css变量控制颜色的组件使用【保持与fui-theme中一致】 +const color = { + primary: '#465CFF', + success: '#09BE4F', + warning: '#FFB703', + danger: '#FF2B2B', + purple: '#6831FF', + link: '#465CFF' +} + +//全局方法(V1.9.8+) +const app = { + toast: function(text, icon = 'none') { + text && uni.showToast({ + title: text, + icon: icon, + duration: 2000 + }) + }, + modal: function(title, content, callback, showCancel, confirmColor, confirmText) { + uni.showModal({ + title: title, + content: content, + showCancel: showCancel || false, + // #ifndef MP-TOUTIAO + cancelColor: "#7F7F7F", + confirmColor: confirmColor || color.primary, + // #endif + confirmText: confirmText || "确定", + success(res) { + if (res.confirm) { + callback && callback(true) + } else { + callback && callback(false) + } + }, + fail(err) { + console.log(err) + } + }) + }, + href(url, isMain) { + if (isMain) { + uni.switchTab({ + url: url + }) + } else { + uni.navigateTo({ + url: url + }); + } + } +} + +const fuiConfig = { + //组件名称,小驼峰命名 + //如fui-button写成fuiButton + fuiButton: { + //组件属性值 + height: '96rpx', + size: 32, + radius: '16rpx' + }, + fuiIcon: { + size: 64, + unit: 'rpx', + //V1.9.8+ + color: '' + }, + fuiText: { + size: 32, + unit: 'rpx', + //仅Nvue有效,black 默认颜色,V1.9.8+ + color: '' + }, + fuiInput: { + labelSize: 32, + size: 32 + }, + fuiFormItem: { + labelSize: 32, + labelWidth: 160, + labelRight: 30, + labelWeight: 400, + labelAlign: 'left', + asteriskPosition: 'left' + }, + // V1.9.8+ + fuiListCell: { + padding: ['32rpx', '32rpx'], + arrowColor: '', + //仅Nvue有效 + borderColor: '', + bottomLeft: 32 + }, + // V1.9.9+ + fuiSection: { + size: 32, + color: '#181818', + fontWeight: 600, + descrSize: 28, + descrColor: '#B2B2B2', + descrTop: 12 + }, + color, + ...app +} + +export default fuiConfig \ No newline at end of file diff --git a/components/firstui/fui-copy-text/fui-copy-text.vue b/components/firstui/fui-copy-text/fui-copy-text.vue new file mode 100644 index 0000000..b37524d --- /dev/null +++ b/components/firstui/fui-copy-text/fui-copy-text.vue @@ -0,0 +1,459 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-copy-text/lib/clipboard.min.js b/components/firstui/fui-copy-text/lib/clipboard.min.js new file mode 100644 index 0000000..3d2f3f6 --- /dev/null +++ b/components/firstui/fui-copy-text/lib/clipboard.min.js @@ -0,0 +1,8 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 1 4822 8 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifdef H5 +/** + * clipboard.min.js support for ES6 module import + * https://doc.firstui.cn/ + **/ +function select(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var i=t.hasAttribute("readonly");i||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),i||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var n=window.getSelection(),r=document.createRange();r.selectNodeContents(t),n.removeAllRanges(),n.addRange(r),e=n.toString()}return e}class ClipboardAction{constructor(t){this.resolveOptions(t),this.initSelection()}resolveOptions(t={}){this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}initSelection(){this.text?this.selectFake():this.target&&this.selectTarget()}selectFake(){const t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=(()=>this.removeFake()),this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";let e=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=`${e}px`,this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=select(this.fakeElem),this.copyText()}removeFake(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}selectTarget(){this.selectedText=select(this.target),this.copyText()}copyText(){let t;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}handleResult(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}clearSelection(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}set action(t="copy"){if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')}get action(){return this._action}set target(t){if(void 0!==t){if(!t||"object"!=typeof t||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}}get target(){return this._target}destroy(){this.removeFake()}}function Emitter(){}Emitter.prototype={on:function(t,e,i){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){var n=this;function r(){n.off(t,r),e.apply(i,arguments)}return r._=e,this.on(t,r,i)},emit:function(t){for(var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),n=0,r=i.length;nthis.onClick(t))}onClick(t){const e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new ClipboardAction({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}defaultAction(t){return getAttributeValue("action",t)}defaultTarget(t){const e=getAttributeValue("target",t);if(e)return document.querySelector(e)}static isSupported(t=["copy","cut"]){const e="string"==typeof t?[t]:t;let i=!!document.queryCommandSupported;return e.forEach(t=>{i=i&&!!document.queryCommandSupported(t)}),i}defaultText(t){return getAttributeValue("text",t)}destroy(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}function getAttributeValue(t,e){const i=`data-clipboard-${t}`;if(e.hasAttribute(i))return e.getAttribute(i)}export default Clipboard; +// #endif \ No newline at end of file diff --git a/components/firstui/fui-copy-text/lib/index.js b/components/firstui/fui-copy-text/lib/index.js new file mode 100644 index 0000000..c9eaa39 --- /dev/null +++ b/components/firstui/fui-copy-text/lib/index.js @@ -0,0 +1,52 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 51 482 281 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +/*! + * 剪贴板 + * + * 官网地址:https://firstui.cn/ + * 文档地址:https://doc.firstui.cn/ + */ +// #ifdef H5 +import ClipboardJS from "./clipboard.min.js" +// #endif + +/** + * data 需要复制的数据 + * callback 回调 + * e 当用户点击后需要先请求接口再进行复制时,需要传入此参数(H5端) + * **/ +const getClipboardData = function(data, callback, e) { + // #ifdef APP-PLUS || MP + uni.setClipboardData({ + data: data, + success(res) { + ("function" == typeof callback) && callback(true) + }, + fail(res) { + ("function" == typeof callback) && callback(false) + } + }) + // #endif + + // #ifdef H5 + let event = window.event || e || {} + let clipboard = new ClipboardJS("", { + text: () => data + }) + clipboard.on('success', (e) => { + ("function" == typeof callback) && callback(true) + clipboard.off('success') + clipboard.off('error') + clipboard.destroy() + }); + clipboard.on('error', (e) => { + ("function" == typeof callback) && callback(false) + clipboard.off('success') + clipboard.off('error') + clipboard.destroy() + }); + clipboard.onClick(event) + // #endif +} +export default { + getClipboardData: getClipboardData +}; \ No newline at end of file diff --git a/components/firstui/fui-count-down/fui-count-down.vue b/components/firstui/fui-count-down/fui-count-down.vue new file mode 100644 index 0000000..16b09a2 --- /dev/null +++ b/components/firstui/fui-count-down/fui-count-down.vue @@ -0,0 +1,360 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-countdown-verify/fui-countdown-verify.vue b/components/firstui/fui-countdown-verify/fui-countdown-verify.vue new file mode 100644 index 0000000..62014e6 --- /dev/null +++ b/components/firstui/fui-countdown-verify/fui-countdown-verify.vue @@ -0,0 +1,264 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-cubic-bezier/fui-cubic-bezier.vue b/components/firstui/fui-cubic-bezier/fui-cubic-bezier.vue new file mode 100644 index 0000000..89206ea --- /dev/null +++ b/components/firstui/fui-cubic-bezier/fui-cubic-bezier.vue @@ -0,0 +1,225 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-data-tag/fui-data-tag.vue b/components/firstui/fui-data-tag/fui-data-tag.vue new file mode 100644 index 0000000..9c95dd4 --- /dev/null +++ b/components/firstui/fui-data-tag/fui-data-tag.vue @@ -0,0 +1,429 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-date-picker/fui-date-picker.vue b/components/firstui/fui-date-picker/fui-date-picker.vue new file mode 100644 index 0000000..2d996ef --- /dev/null +++ b/components/firstui/fui-date-picker/fui-date-picker.vue @@ -0,0 +1,1418 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-dialog/fui-dialog.vue b/components/firstui/fui-dialog/fui-dialog.vue new file mode 100644 index 0000000..fd6596a --- /dev/null +++ b/components/firstui/fui-dialog/fui-dialog.vue @@ -0,0 +1,306 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-digital-keyboard/fui-digital-keyboard.vue b/components/firstui/fui-digital-keyboard/fui-digital-keyboard.vue new file mode 100644 index 0000000..300a792 --- /dev/null +++ b/components/firstui/fui-digital-keyboard/fui-digital-keyboard.vue @@ -0,0 +1,488 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-digital-roller/fui-digital-roller.vue b/components/firstui/fui-digital-roller/fui-digital-roller.vue new file mode 100644 index 0000000..6663f1c --- /dev/null +++ b/components/firstui/fui-digital-roller/fui-digital-roller.vue @@ -0,0 +1,188 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-divider/fui-divider.vue b/components/firstui/fui-divider/fui-divider.vue new file mode 100644 index 0000000..a0b3186 --- /dev/null +++ b/components/firstui/fui-divider/fui-divider.vue @@ -0,0 +1,112 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-drag/bindingx.js b/components/firstui/fui-drag/bindingx.js new file mode 100644 index 0000000..df95976 --- /dev/null +++ b/components/firstui/fui-drag/bindingx.js @@ -0,0 +1,201 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 51 4 82281 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifdef APP-NVUE +const animation = uni.requireNativePlugin('animation'); +export default { + watch: { + list(vals) { + this.$nextTick(() => { + setTimeout(() => { + this.getRefs(vals) + }, 50) + }) + } + }, + data() { + return { + current: -1, + startTouch: null, + tDragging: false, + sId: null, + preStartKey: null, + isAndroid: false, + divisor: 1/2 + } + }, + created() { + const res = uni.getSystemInfoSync(); + this.isAndroid = res.platform.toLocaleLowerCase() == "android" + this.divisor = this.isAndroid ? 5/4 : 1/2 + this.allRefs = [] + }, + methods: { + getEl(el) { + return el.ref || el[0].ref; + }, + getRefs(vals) { + this.allRefs = [] + if (!vals || vals.length === 0) return; + vals.forEach((item, index) => { + let ref = this.getEl(this.$refs[`f_drag_${index}`]) + this.allRefs.push(ref) + this._animation(ref, index, item.transX, item.transY) + }) + }, + _animation(ref, index, x, y) { + animation.transition(ref, { + styles: { + transform: `translate(${x},${y})` + }, + duration: this.current === index ? 0 : 250, + timingFunction: 'linear', + needLayout: false, + delay: 0 + }); + }, + outOfRange(x1, y1, x2, y2, x3, y3) { + return x1 < 0 || x1 >= y1 || x2 < 0 || x2 >= y2 || x3 < 0 || x3 >= y3 + }, + listSort(sKey, eKey) { + let endRealKey = -1; + this.list.forEach((item) => { + if (item.sortKey === eKey) endRealKey = item.realKey; + }); + + return this.list.map((item) => { + let cKey = item.sortKey; + let rKey = item.realKey; + if (sKey < eKey) { + if (cKey > sKey && cKey <= eKey) { + --rKey; + --cKey; + } else if (cKey === sKey) { + rKey = endRealKey; + cKey = eKey; + } + } else if (sKey > eKey) { + if (cKey >= eKey && cKey < sKey) { + ++rKey; + ++cKey; + } else if (cKey === sKey) { + rKey = endRealKey; + cKey = eKey; + } + } + if (item.sortKey !== cKey) { + let columns = Number(this.columns) + item.transX = (cKey % columns) * this.cellWidth + "px"; + item.transY = Math.floor(cKey / columns) * this.cellHeight + "px"; + item.sortKey = cKey; + item.realKey = rKey; + } + return item; + }); + }, + emitsEvent(list, type) { + let changeList = [], + itemList = []; + + list.forEach((item) => { + changeList[item.sortKey] = item; + }); + + changeList.forEach((item) => { + itemList.push(item.entity); + }); + if (type == "change") { + this.change({ + itemList: itemList + }); + } else { + this.sortend({ + itemList: itemList + }); + } + }, + getXY(touch) { + if (this.isAndroid) { + touch.pageX = touch.screenX + touch.pageY = touch.screenY + } + return touch + }, + longPress(e) { + if (!this.isDrag) return; + let touch = e.changedTouches && e.changedTouches[0] ? e.changedTouches[0] : this.startTouch; + if (!touch) return; + this.current = Number(e.currentTarget.dataset.index); + if (this.tDragging) return; + let ref = this.allRefs[this.current] + if (!ref) return; + touch = this.getXY(touch) + let transX = this.columns == 1 ? 0 : touch.pageX - (this.cellWidth / 2 + this.wrapLeft) + 'px'; + // this.initY = touch.pageY - (this.wrapTop + this.cellHeight * (Math.ceil(this.current / this.columns))) + let transY = touch.pageY - (this.cellHeight * this.divisor + this.wrapTop ) + 'px'; + this._animation(ref, this.current, transX, transY) + this.sId = touch.identifier; + this.tDragging = true; + }, + touchstart(e) { + if (!this.isDrag) return; + this.startTouch = e.changedTouches[0] || e.touches[0]; + }, + touchmove(e) { + if (!this.isDrag || !this.tDragging) return; + let touch = e.changedTouches[0] || e.touches[0]; + // || this.sId !== touch.identifier + if (!touch) return; + touch = this.getXY(touch) + let transX = this.columns == 1 ? 0 : touch.pageX - (this.cellWidth / 2 + this.wrapLeft); + let transY = touch.pageY - (this.cellHeight * this.divisor + this.wrapTop); + if (touch.pageY > this.windowHeight - this.cellHeight) { + this.pageScroll({ + scrollTop: touch.pageY + this.cellHeight - this.windowHeight + }) + } else if (touch.pageY < this.cellHeight) { + this.pageScroll({ + scrollTop: touch.pageY - this.cellHeight + }) + } + let ref = this.allRefs[this.current] + if (!ref) return; + this._animation(ref, this.current, transX + 'px', transY + 'px') + let startKey = this.list[this.current].sortKey; + let curX = Math.round(transX / this.cellWidth); + let curY = Math.round(transY / this.cellHeight); + let endKey = curX + Number(this.columns) * curY; + + if (this.outOfRange(curX, Number(this.columns), curY, this.rows, endKey, this.list.length)) return; + if (startKey === endKey || startKey === this.preStartKey) return; + this.preStartKey = startKey; + let list = this.listSort(startKey, endKey); + this.allRefs.forEach((ins, index) => { + var item = list[index]; + if (index !== this.current) { + this._animation(ins, index, item.transX, item.transY) + } + }); + this.listChange({ + itemList: list + }) + this.emitsEvent(list, "change"); + }, + touchend(e) { + if (!this.isDrag || !this.tDragging) return; + this.emitsEvent(this.list, "sortend"); + let cur = this.current + this.current = -1; + let ref = this.allRefs[cur] + if (!ref) return + this._animation(ref, cur, this.list[cur].transX, this.list[cur].transY) + this.preStartKey = -1; + this.tDragging = false; + + } + } +} + +// #endif + +// #ifndef APP-NVUE +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-drag/f-drag-item.vue b/components/firstui/fui-drag/f-drag-item.vue new file mode 100644 index 0000000..868a98f --- /dev/null +++ b/components/firstui/fui-drag/f-drag-item.vue @@ -0,0 +1,209 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-drag/fui-drag.vue b/components/firstui/fui-drag/fui-drag.vue new file mode 100644 index 0000000..4abed69 --- /dev/null +++ b/components/firstui/fui-drag/fui-drag.vue @@ -0,0 +1,373 @@ + + + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-drag/index.wxs b/components/firstui/fui-drag/index.wxs new file mode 100644 index 0000000..41b91c1 --- /dev/null +++ b/components/firstui/fui-drag/index.wxs @@ -0,0 +1,290 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 151 4 82 28 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +var wrapParam = {} + +function isPC() { + if (typeof navigator !== 'object') return false; + var userAgentInfo = navigator.userAgent; + var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; + var flag = true; + for (var v = 0; v < Agents.length - 1; v++) { + if (userAgentInfo.indexOf(Agents[v]) > 0) { + flag = false; + break; + } + } + return flag; +} +var isH5 = false +if (typeof window === 'object') isH5 = true + +function outOfRange(x1, y1, x2, y2, x3, y3) { + return x1 < 0 || x1 >= y1 || x2 < 0 || x2 >= y2 || x3 < 0 || x3 >= y3 +}; + +function listSort(sKey, eKey, st) { + var param = st.param + var endRealKey = -1; + st.list.forEach(function(item) { + if (item.sortKey === eKey) endRealKey = item.realKey; + }); + + return st.list.map(function(item) { + var cKey = item.sortKey; + var rKey = item.realKey; + if (sKey < eKey) { + if (cKey > sKey && cKey <= eKey) { + --rKey; + --cKey; + } else if (cKey === sKey) { + rKey = endRealKey; + cKey = eKey; + } + } else if (sKey > eKey) { + if (cKey >= eKey && cKey < sKey) { + ++rKey; + ++cKey; + } else if (cKey === sKey) { + rKey = endRealKey; + cKey = eKey; + } + } + if (item.sortKey !== cKey) { + item.transX = (cKey % param.columns) * param.cellWidth + "px"; + item.transY = Math.floor(cKey / param.columns) * param.cellHeight + "px"; + item.sortKey = cKey; + item.realKey = rKey; + } + return item; + }); +} + +function emitsEvent(list, type, ins) { + if (!ins) return; + var changeList = [], + itemList = []; + + list.forEach(function(item) { + changeList[item.sortKey] = item; + }); + + changeList.forEach(function(item) { + itemList.push(item.entity); + }); + if (type == "change") { + ins.callMethod("change", { + itemList: itemList + }); + } else { + ins.callMethod("sortend", { + itemList: itemList + }); + } +} + +function longPress(e, ownerInstance) { + var ins = e.instance; + var dataset = ins.getDataset() + var st = ins.getState(); + st.isDrag = +dataset.isdrag == 1 ? true : false + if (!st.isDrag) return; + + if (!st.param || st.param == 'undefined') { + st.param = JSON.parse(dataset.param) + } + var param = st.param; + var touch = null + if (isH5 && isPC()) { + touch = e; + } else { + touch = e.changedTouches ? e.changedTouches[0] : st.startTouch + } + if (!touch) return; + st.cur = +dataset.index; + + if (st.dragging) return; + // #ifdef MP-WEIXIN + ownerInstance.callMethod("drag", { + wxdrag: true + }); + // #endif + st.transX = param.columns === 1 ? 0 : touch.pageX - (param.cellWidth / 2 + param.wrapLeft); + st.transY = touch.pageY - (param.cellHeight / 2 + param.wrapTop); + st.sId = touch.identifier; + st.prevIns && st.prevIns.removeClass("fui-drag__trans-end") + ins.setStyle({ + 'transform': 'translate3d(' + st.transX + 'px, ' + st.transY + 'px, 0)' + }); + st.itemsInstance.forEach(function(item, index) { + item.removeClass("fui-drag__cur").removeClass("fui-drag__trans") + item.addClass(index === st.cur ? "fui-drag__cur" : "fui-drag__trans"); + }) + st.dragging = true; +} + +function touchStart(e, ownerInstance) { + var ins = e.instance; + var st = ins.getState() + st.list = wrapParam.list + st.itemsInstance = wrapParam.itemsInstance + st.param = wrapParam.param + if (isH5 && isPC()) { + st.startTouch = e; + } else { + st.startTouch = e.changedTouches[0] || e.touches[0] + } + var dataset = ins.getDataset() + st.isDrag = +dataset.isdrag == 1 ? true : false + // #ifdef MP-WEIXIN + ownerInstance.callMethod("drag", { + wxdrag: false + }); + // #endif +} + +function touchMove(e, ownerInstance, event) { + var st = {} + var touch = null + var ins = null + if (isH5 && isPC()) { + touch = e; + st = event.instance.getState() + ins = event.instance; + } else { + touch = e.changedTouches[0] || e.touches[0] + st = e.instance.getState() + ins = e.instance + } + if (e.preventDefault && st.dragging) { + e.preventDefault() + } + var param = st.param; + + if (!st.dragging || !st.isDrag) return; + if (!touch || st.sId !== touch.identifier) return; + + var transX = param.columns === 1 ? 0 : touch.pageX - (param.cellWidth / 2 + param.wrapLeft); + var transY = touch.pageY - (param.cellHeight / 2 + param.wrapTop); + + if (touch.clientY > param.windowHeight - param.cellHeight) { + ownerInstance.callMethod("pageScroll", { + scrollTop: touch.pageY + param.cellHeight - param.windowHeight + }); + } else if (touch.clientY < param.cellHeight) { + ownerInstance.callMethod("pageScroll", { + scrollTop: touch.pageY - param.cellHeight + }); + } + + ins.setStyle({ + 'transform': 'translate3d(' + transX + 'px, ' + transY + 'px, 0)' + }) + + var startKey = st.list[st.cur].sortKey; + var curX = Math.round(transX / param.cellWidth); + var curY = Math.round(transY / param.cellHeight); + var endKey = curX + param.columns * curY; + + if (outOfRange(curX, param.columns, curY, param.rows, endKey, st.list.length)) return; + + if (startKey === endKey || startKey === st.preStartKey) return; + st.preStartKey = startKey; + + var list = listSort(startKey, endKey, st); + st.itemsInstance.forEach(function(itemIns, index) { + var item = list[index]; + if (index !== st.cur) { + itemIns.setStyle({ + 'transform': 'translate3d(' + item.transX + ',' + item.transY + ', 0)' + }); + } + }); + ownerInstance.callMethod("listChange", { + itemList: list + }); + emitsEvent(list, "change", ownerInstance); +} + +function touchEnd(e, ownerInstance, event) { + var ins = null + var st = {} + if (isH5 && isPC()) { + ins = event.instance + st = event.instance.getState() + } else { + st = e.instance.getState() + ins = e.instance + } + if (!st.dragging || !st.isDrag) return; + emitsEvent(st.list, "sortend", ownerInstance); + ins.addClass("fui-drag__trans-end") + ins.setStyle({ + 'transform': 'translate3d(' + st.list[st.cur].transX + ',' + st.list[st.cur].transY + ', 0)' + }); + st.itemsInstance.forEach(function(item, index) { + item.removeClass("fui-drag__trans").removeClass("fui-drag__cur"); + }) + st.prevIns = ins + st.preStartKey = -1; + st.dragging = false; + // #ifdef MP-WEIXIN + ownerInstance.callMethod("drag", { + wxdrag: false + }); + // #endif + st.cur = -1; + st.transX = 0; + st.transY = 0; +} + +function paramChange(newVal, oldVal, ownerInstance, ins) { + wrapParam.param = newVal; +} + +function listChange(newVal, oldVal, ownerInstance, ins) { + wrapParam.itemsInstance = ownerInstance.selectAllComponents('.fui-drag-item__wrap'); + wrapParam.list = newVal || []; + if (!wrapParam.itemsInstance || wrapParam.itemsInstance.length === 0) return; + + wrapParam.list.forEach(function(item, index) { + var itemIns = wrapParam.itemsInstance[index]; + if (item && itemIns) { + itemIns.setStyle({ + 'transform': 'translate3d(' + item.transX + ',' + item.transY + ', 0)' + }); + } + }) +} + +var movable = false; + +function mousedown(e, ins) { + if (!isH5 || !isPC()) return + touchStart(e, ins) + longPress(e, ins) + movable = true + window.onmousemove = function(event) { + if (!isH5 || !isPC() || !movable) return + touchMove(event, ins, e) + } + window.onmouseup = function(event) { + if (!isH5 || !isPC() || !movable) return + touchEnd(event, ins, e) + movable = false + } +} + + +function stopTouchMove(e) { + return true +} + +module.exports = { + longPress: longPress, + touchStart: touchStart, + touchMove: touchMove, + touchEnd: touchEnd, + paramChange: paramChange, + listChange: listChange, + mousedown: mousedown, + stopTouchMove:stopTouchMove +} \ No newline at end of file diff --git a/components/firstui/fui-drag/mpjs.js b/components/firstui/fui-drag/mpjs.js new file mode 100644 index 0000000..f5c5516 --- /dev/null +++ b/components/firstui/fui-drag/mpjs.js @@ -0,0 +1,145 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 1 514 82281 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifndef APP-PLUS || MP-WEIXIN || H5 + +export default { + data() { + return { + current: -1, + transX: '0px', + transY: '0px', + startTouch: null, + tDragging: false, + sId: null, + preStartKey: null + } + }, + methods: { + outOfRange(x1, y1, x2, y2, x3, y3) { + return x1 < 0 || x1 >= y1 || x2 < 0 || x2 >= y2 || x3 < 0 || x3 >= y3 + }, + listSort(sKey, eKey) { + let endRealKey = -1; + this.list.forEach((item) => { + if (item.sortKey === eKey) endRealKey = item.realKey; + }); + + return this.list.map((item) => { + let cKey = item.sortKey; + let rKey = item.realKey; + if (sKey < eKey) { + if (cKey > sKey && cKey <= eKey) { + --rKey; + --cKey; + } else if (cKey === sKey) { + rKey = endRealKey; + cKey = eKey; + } + } else if (sKey > eKey) { + if (cKey >= eKey && cKey < sKey) { + ++rKey; + ++cKey; + } else if (cKey === sKey) { + rKey = endRealKey; + cKey = eKey; + } + } + if (item.sortKey !== cKey) { + let columns = Number(this.columns) + item.transX = (cKey % columns) * this.cellWidth + "px"; + item.transY = Math.floor(cKey / columns) * this.cellHeight + "px"; + item.sortKey = cKey; + item.realKey = rKey; + } + return item; + }); + }, + emitsEvent(list, type) { + let changeList = [], + itemList = []; + + list.forEach((item) => { + changeList[item.sortKey] = item; + }); + + changeList.forEach((item) => { + itemList.push(item.entity); + }); + if (type == "change") { + this.change({ + itemList: itemList + }); + } else { + this.sortend({ + itemList: itemList + }); + } + }, + longPress(e) { + if (!this.isDrag) return; + let touch = e.changedTouches && e.changedTouches[0] ? e.changedTouches[0] : this.startTouch; + if (!touch) return; + this.current = Number(e.currentTarget.dataset.index); + + if (this.tDragging) return; + //pageX + this.transX = this.columns == 1 ? 0 : touch.clientX - (this.cellWidth / 2 + this.wrapLeft) + 'px'; + this.transY = touch.clientY - (this.cellHeight / 2 + this.wrapTop) + 'px'; + this.sId = touch.identifier; + this.tDragging = true; + }, + touchstart(e) { + if (!this.isDrag) return; + this.startTouch = e.changedTouches[0] || e.touches[0]; + }, + touchmove(e) { + if (!this.isDrag || !this.tDragging) return; + let touch = e.changedTouches[0] || e.touches[0]; + if (!touch || this.sId !== touch.identifier) return; + let transX = this.columns == 1 ? 0 : touch.clientX - (this.cellWidth / 2 + this.wrapLeft); + let transY = touch.clientY - (this.cellHeight / 2 + this.wrapTop); + + if (touch.clientY > this.windowHeight - this.cellHeight) { + this.pageScroll({ + scrollTop: touch.pageY + this.cellHeight - this.windowHeight + }) + } else if (touch.clientY < this.cellHeight) { + this.pageScroll({ + scrollTop: touch.pageY - this.cellHeight + }) + } + this.transX = transX + 'px' + this.transY = transY + 'px' + + let startKey = this.list[this.current].sortKey; + let curX = Math.round(transX / this.cellWidth); + let curY = Math.round(transY / this.cellHeight); + let endKey = curX + Number(this.columns) * curY; + + if (this.outOfRange(curX, Number(this.columns), curY, this.rows, endKey, this.list.length)) return; + + if (startKey === endKey || startKey === this.preStartKey) return; + this.preStartKey = startKey; + + let list = this.listSort(startKey, endKey); + this.listChange({ + itemList: list + }) + this.emitsEvent(list, "change"); + }, + touchend(e) { + if (!this.isDrag || !this.tDragging) return; + this.emitsEvent(this.list, "sortend"); + this.preStartKey = -1; + this.tDragging = false; + this.current = -1; + this.transX = '0px'; + this.transY = '0px'; + } + } +} + +// #endif + +// #ifdef APP-PLUS|| MP-WEIXIN || H5 +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-drawer/fui-drawer.vue b/components/firstui/fui-drawer/fui-drawer.vue new file mode 100644 index 0000000..4102764 --- /dev/null +++ b/components/firstui/fui-drawer/fui-drawer.vue @@ -0,0 +1,235 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-dropdown-list/fui-dropdown-list.vue b/components/firstui/fui-dropdown-list/fui-dropdown-list.vue new file mode 100644 index 0000000..aad0720 --- /dev/null +++ b/components/firstui/fui-dropdown-list/fui-dropdown-list.vue @@ -0,0 +1,468 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-dropdown-menu/fui-dropdown-menu.vue b/components/firstui/fui-dropdown-menu/fui-dropdown-menu.vue new file mode 100644 index 0000000..88732da --- /dev/null +++ b/components/firstui/fui-dropdown-menu/fui-dropdown-menu.vue @@ -0,0 +1,560 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-empty/fui-empty.vue b/components/firstui/fui-empty/fui-empty.vue new file mode 100644 index 0000000..f670d5f --- /dev/null +++ b/components/firstui/fui-empty/fui-empty.vue @@ -0,0 +1,131 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-fab/bindingx.js b/components/firstui/fui-fab/bindingx.js new file mode 100644 index 0000000..1939a26 --- /dev/null +++ b/components/firstui/fui-fab/bindingx.js @@ -0,0 +1,83 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:1 5 1 48 228 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifdef APP-NVUE +const animation = uni.requireNativePlugin('animation'); +export default { + data() { + return { + startX: 0, + startY: 0, + lastLeft: 0, + lastTop: 0, + isMove: false + } + }, + created() { + this.refFab = null; + this.loop = null + }, + mounted() { + this.$nextTick(() => { + setTimeout(() => { + this.refFab = this.getEl(this.$refs['fui_fab_move_ref']) + }, 50) + }) + }, + methods: { + getEl(el) { + return el.ref || el[0].ref; + }, + _aniMove(x, y) { + if (!this.refFab || !this.isDrag) return + animation.transition(this.refFab, { + styles: { + transform: `translate(${x}px,${y}px)` + }, + duration: 0, + timingFunction: 'linear', + needLayout: false, + delay: 0 + }, () => { + if (Math.abs(x) > 0.1 || Math.abs(y) > 0.1) { + this.isMove = true; + } + }); + }, + touchstart(e) { + if (!this.isDrag) return; + var touch = e.touches || e.changedTouches + this.startX = touch[0].screenX + this.startY = touch[0].screenY + }, + touchmove(e) { + if (!this.isDrag) return; + var touch = e.touches || e.changedTouches + let pageX = touch[0].screenX, + pageY = touch[0].screenY; + var left = pageX - this.startX + this.lastLeft; + left = left < -this.eLeft ? -this.eLeft : left; + left = left > this.maxWidth ? this.maxWidth : left; + this.startX = pageX + + var top = pageY - this.startY + this.lastTop; + top = top < -this.eTop ? -this.eTop : top; + top = top > this.maxHeight ? this.maxHeight : top; + this.startY = pageY + + this.lastLeft = left + this.lastTop = top + this._aniMove(left, top) + }, + touchend(e) { + clearTimeout(this.loop) + this.loop = setTimeout(() => { + this.isMove = false + }, 50) + } + } +} + +// #endif + +// #ifndef APP-NVUE +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-fab/fui-fab.vue b/components/firstui/fui-fab/fui-fab.vue new file mode 100644 index 0000000..c0d452b --- /dev/null +++ b/components/firstui/fui-fab/fui-fab.vue @@ -0,0 +1,605 @@ + + + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-fab/index.wxs b/components/firstui/fui-fab/index.wxs new file mode 100644 index 0000000..9afffd9 --- /dev/null +++ b/components/firstui/fui-fab/index.wxs @@ -0,0 +1,120 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 151 48 228 1 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +var movable = { + width: 100, + height: 100, + disabled: false, + left: 0, + top: 0 +} + +function isPC() { + if (typeof navigator !== 'object') return false; + var userAgentInfo = navigator.userAgent; + var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; + var flag = true; + for (var v = 0; v < Agents.length - 1; v++) { + if (userAgentInfo.indexOf(Agents[v]) > 0) { + flag = false; + break; + } + } + return flag; +} +var isH5 = false +if (typeof window === 'object') isH5 = true + +function setInitValue(dataset) { + movable.width = +dataset.width + movable.height = +dataset.height + movable.top = +dataset.top + movable.left = +dataset.left + //H5获取bool值为undefined + movable.disabled = (+dataset.disabled) == 1 ? true : false +} + +function touchstart(e, ins) { + var state = e.instance.getState() + var touch = e.touches[0] || e.changedTouches[0]; + if (isH5 && isPC()) { + touch = e; + } + var dataset = e.instance.getDataset() + state.startX = touch.clientX + state.startY = touch.clientY + setInitValue(dataset) +} + +function styleChange(left, top, ins) { + if (!ins) return; + var mview = ins.selectComponent('.fui-fab__btn-wrap'); + if (!mview) return; + mview.setStyle({ + transform: 'translate3d(' + left + 'px,' + top + 'px,0)' + }) +} + +function touchmove(e, ins, event) { + if (movable.disabled) return; + if (e.preventDefault) { + // 阻止页面滚动 + e.preventDefault() + } + var state = {} + var touch = {} + if (isH5 && isPC()) { + touch = e; + state = event.instance.getState() + } else { + touch = e.touches[0] || e.changedTouches[0] + state = e.instance.getState() + } + var pageX = touch.clientX; + var pageY = touch.clientY; + var left = pageX - state.startX + (state.lastLeft || 0); + left = left < -movable.left ? -movable.left : left; + left = left > movable.width ? movable.width : left; + state.startX = pageX + + var top = pageY - state.startY + (state.lastTop || 0); + top = top < -movable.top ? -movable.top : top; + top = top > movable.height ? movable.height : top; + state.startY = pageY + + state.lastLeft = left + state.lastTop = top + styleChange(left, top, ins) +} + +var _movable = false; + +function mousedown(e, ins) { + if (!isH5 || !isPC()) return + touchstart(e, ins) + _movable = true + window.onmousemove = function(event) { + if (!isH5 || !isPC() || !_movable) return + touchmove(event, ins, e) + } + window.onmouseup = function(event) { + if (!isH5 || !isPC() || !_movable) return + _movable = false + } +} + +function fabreset(reset, oldreset, owner, ins) { + if (reset > 0) { + var state = ins.getState() + state.startY = 0; + state.startX = 0; + state.lastLeft = 0; + state.lastTop = 0; + styleChange(0, 0, owner) + } +} + +module.exports = { + touchstart: touchstart, + touchmove: touchmove, + mousedown: mousedown, + fabreset: fabreset +} \ No newline at end of file diff --git a/components/firstui/fui-fab/mpjs.js b/components/firstui/fui-fab/mpjs.js new file mode 100644 index 0000000..c51ec6b --- /dev/null +++ b/components/firstui/fui-fab/mpjs.js @@ -0,0 +1,59 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:151482 2 81 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifndef APP-PLUS || MP-WEIXIN || H5 +export default { + data() { + return { + startX: 0, + startY: 0, + lastLeft: 0, + lastTop: 0, + transform: '' + } + }, + watch: { + resetNum(val) { + if (val > 0) { + this.startX = 0; + this.startY = 0; + this.lastLeft = 0; + this.lastTop = 0; + this.transform = 'translate3d(0,0,0)' + } + } + }, + methods: { + touchstart(e) { + if (!this.isDrag) return; + const touch = e.touches || e.changedTouches + this.startX = touch[0].clientX + this.startY = touch[0].clientY + }, + touchmove(e) { + if (!this.isDrag) return; + const touch = e.touches || e.changedTouches + let pageX = touch[0].clientX, + pageY = touch[0].clientY; + + var left = pageX - this.startX + this.lastLeft; + left = left < -this.eLeft ? -this.eLeft : left; + left = left > this.maxWidth ? this.maxWidth : left; + this.startX = pageX + + var top = pageY - this.startY + this.lastTop; + top = top < -this.eTop ? -this.eTop : top; + top = top > this.maxHeight ? this.maxHeight : top; + this.startY = pageY + + + this.lastLeft = left + this.lastTop = top + this.transform = `translate3d(${left}px,${top}px,0)` + } + } +} + +// #endif + +// #ifdef APP-PLUS|| MP-WEIXIN || H5 +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-filter-bar/fui-filter-bar.vue b/components/firstui/fui-filter-bar/fui-filter-bar.vue new file mode 100644 index 0000000..6bd156e --- /dev/null +++ b/components/firstui/fui-filter-bar/fui-filter-bar.vue @@ -0,0 +1,224 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-footer/fui-footer.vue b/components/firstui/fui-footer/fui-footer.vue new file mode 100644 index 0000000..5014a64 --- /dev/null +++ b/components/firstui/fui-footer/fui-footer.vue @@ -0,0 +1,221 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-form-field/fui-form-field.vue b/components/firstui/fui-form-field/fui-form-field.vue new file mode 100644 index 0000000..7e083fd --- /dev/null +++ b/components/firstui/fui-form-field/fui-form-field.vue @@ -0,0 +1,37 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-form-item/fui-form-item.vue b/components/firstui/fui-form-item/fui-form-item.vue new file mode 100644 index 0000000..b083ae5 --- /dev/null +++ b/components/firstui/fui-form-item/fui-form-item.vue @@ -0,0 +1,314 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-form/fui-form.vue b/components/firstui/fui-form/fui-form.vue new file mode 100644 index 0000000..f8faa4a --- /dev/null +++ b/components/firstui/fui-form/fui-form.vue @@ -0,0 +1,253 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-form/fui-validator.js b/components/firstui/fui-form/fui-validator.js new file mode 100644 index 0000000..cca35aa --- /dev/null +++ b/components/firstui/fui-form/fui-validator.js @@ -0,0 +1,335 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15 14822 8 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +/** + * 表单验证 + * https://doc.firstui.cn/ + **/ + +const form = { + /* + 非必填情况下,如果值为空则不进行校验 + */ + validator: function(formData, rules, checkAll = false) { + let result = { + isPassed: true, + errorMsg: checkAll ? [] : '' + }; + for (let item of rules) { + const key = item.name; + const rule = item.rule || []; + const validator = item.validator || []; + const msgArr = item.msg || []; + const ruleLen = rule.length; + const validatorLen = validator.length; + if (!key || (ruleLen === 0 && validatorLen === 0) || (!~rule.indexOf("required") && + formData[key].toString() + .length === 0)) { + continue; + } + if (ruleLen) { + for (let i = 0; i < ruleLen; i++) { + let ruleItem = rule[i]; + let msg = msgArr[i] || `${key} error !`; + if (!ruleItem) continue; + //数据处理 + let value = null; + if (~ruleItem.indexOf(":")) { + let temp = ruleItem.split(":"); + ruleItem = temp[0]; + value = temp[1]; + } + let isError = false; + switch (ruleItem) { + case "required": + isError = form._isNullOrEmpty(formData[key]); + break; + case "isMobile": + isError = !form._isMobile(formData[key]); + break; + case "isEmail": + isError = !form._isEmail(formData[key]); + break; + case "isCarNo": + isError = !form._isCarNo(formData[key]); + break; + case "isIdCard": + isError = !form._isIdCard(formData[key]); + break; + case "isAmount": + isError = !form._isAmount(formData[key]); + break; + case "isNumber": + isError = !form._isNumber(formData[key]); + break; + case "isChinese": + isError = !form._isChinese(formData[key]); + break; + case "isNotChinese": + isError = !form._isNotChinese(formData[key]); + break; + case "isEnglish": + isError = !form._isEnglish(formData[key]); + break; + case "isEnAndNo": + isError = !form._isEnAndNo(formData[key]); + break; + case "isEnOrNo": + isError = !form._isEnOrNo(formData[key]); + break; + case "isSpecial": + isError = form._isSpecial(formData[key]); + break; + case "isEmoji": + isError = form._isEmoji(formData[key]); + break; + case "isDate": + isError = !form._isDate(formData[key]); + break; + case "isUrl": + isError = !form._isUrl(formData[key]); + break; + case "isSame": + isError = !form._isSame(formData[key], formData[value]); + break; + case "range": + let range = null; + try { + range = JSON.parse(value); + if (range.length <= 1) { + throw new Error("range值传入有误!") + } + } catch (e) { + return "range值传入有误!" + } + isError = !form._isRange(formData[key], range[0], range[1]) + break; + case "minLength": + isError = !form._minLength(formData[key], value) + break; + case "maxLength": + isError = !form._maxLength(formData[key], value) + break; + case "isKeyword": + isError = !form._isKeyword(formData[key], value) + break; + default: + break; + } + + if (isError) { + result.isPassed = false; + if (checkAll) { + result.errorMsg.push({ + name: key, + msg: msg + }) + break; + } else { + result.errorMsg = msg; + return result; + } + } + } + } + + if (validatorLen) { + for (let model of validator) { + let func = model.method; + if (func && !func(formData[key])) { + result.isPassed = false; + if (checkAll) { + const index = result.errorMsg.findIndex(item => item.name === key) + if (index === -1) { + result.errorMsg.push({ + name: key, + msg: model.msg || `${key} error !` + }) + } + break; + } else { + result.errorMsg = model.msg || `${key} error !`; + return result; + } + } + } + } + } + return result; + }, + //允许填写字符串null或者undefined + _isNullOrEmpty: function(value) { + return (value === null || value === '' || value === undefined) ? true : false; + }, + _isMobile: function(value) { + return /^(?:13\d|14\d|15\d|16\d|17\d|18\d|19\d)\d{5}(\d{3}|\*{3})$/.test(value); + }, + _isEmail: function(value) { + return /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(value); + }, + _isCarNo: function(value) { + // 新能源车牌 + const xreg = + /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/; + // 旧车牌 + const creg = + /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/; + if (value.length === 7) { + return creg.test(value); + } else if (value.length === 8) { + return xreg.test(value); + } else { + return false; + } + }, + _isIdCard: function(value) { + let idCard = value; + if (idCard.length == 15) { + return this.__isValidityBrithBy15IdCard; + } else if (idCard.length == 18) { + let arrIdCard = idCard.split(""); + if (this.__isValidityBrithBy18IdCard(idCard) && this.__isTrueValidateCodeBy18IdCard(arrIdCard)) { + return true; + } else { + return false; + } + } else { + return false; + } + }, + __isTrueValidateCodeBy18IdCard: function(arrIdCard) { + let sum = 0; + let Wi = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1]; + let ValideCode = [1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2]; + if (arrIdCard[17].toLowerCase() == 'x') { + arrIdCard[17] = 10; + } + for (let i = 0; i < 17; i++) { + sum += Wi[i] * arrIdCard[i]; + } + let valCodePosition = sum % 11; + if (arrIdCard[17] == ValideCode[valCodePosition]) { + return true; + } else { + return false; + } + }, + __isValidityBrithBy18IdCard: function(idCard18) { + let year = idCard18.substring(6, 10); + let month = idCard18.substring(10, 12); + let day = idCard18.substring(12, 14); + let temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day)); + if (temp_date.getFullYear() != parseFloat(year) || temp_date.getMonth() != parseFloat(month) - 1 || + temp_date.getDate() != + parseFloat(day)) { + return false; + } else { + return true; + } + }, + __isValidityBrithBy15IdCard: function(idCard15) { + let year = idCard15.substring(6, 8); + let month = idCard15.substring(8, 10); + let day = idCard15.substring(10, 12); + let temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day)); + + if (temp_date.getYear() != parseFloat(year) || temp_date.getMonth() != parseFloat(month) - 1 || + temp_date.getDate() != + parseFloat(day)) { + return false; + } else { + return true; + } + }, + _isAmount: function(value) { + //是否为金额,只允许保留两位小数 + return /^([0-9]*[.]?[0-9])[0-9]{0,1}$/.test(value); + }, + _isNumber: function(value) { + //是否全为数字 + return /^[0-9]+$/.test(value); + }, + //是否全部为中文 + _isChinese: function(value) { + let reg = /^[\u4e00-\u9fa5]+$/; + return value !== "" && reg.test(value) && !form._isSpecial(value) && !form._isEmoji(value) + }, + //是否不包含中文,可以有特殊字符 + _isNotChinese: function(value) { + let reg = /.*[\u4e00-\u9fa5]+.*$/; + let result = true; + if (reg.test(value)) { + result = false + } + return result + }, + _isEnglish: function(value) { + return /^[a-zA-Z]*$/.test(value) + }, + _isEnAndNo: function(value) { + //4~30位数字和字母组合 + return /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{4,30}$/.test(value); + }, + _isEnOrNo: function(value) { + let reg = /^[A-Za-z0-9]+$/; + return reg.test(value) + }, + _isSpecial: function(value) { + //是否包含特殊字符 + let regEn = /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im, + regCn = /[·!#¥(——):;“”‘、,|《。》?、【】[\]]/im; + if (regEn.test(value) || regCn.test(value)) { + return true; + } + return false; + }, + _isEmoji: function(value) { + //是否包含表情 + return /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g.test(value); + }, + _isDate: function(value) { + //2019-10-12 + const reg = + /^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/; + return reg.test(value); + }, + _isUrl: function(value) { + return /^((https?|ftp|file):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})(:[0-9]{1,5})?((\/?)|(\/[\\\w_!~*\\'()\\\.;?:@&=+$,%#-]+)+\/?)$/ + .test(value); + }, + _isSame: function(value1, value2) { + return value1 === value2 + }, + _isRange: function(value, range1, range2) { + if ((!range1 && range1 != 0) && (!range2 && range2 != 0)) { + return true; + } else if (!range1 && range1 != 0) { + return value <= range2 + } else if (!range2 && range2 != 0) { + return value >= range1 + } else { + return value >= range1 && value <= range2 + } + }, + _minLength: function(value, min) { + return value.length >= Number(min) + }, + _maxLength: function(value, max) { + return value.length <= Number(max) + }, + _isKeyword: function(value, keywords) { + //是否包含关键词,敏感词,多个以英文逗号分隔,包含则为false,弹出提示语! + let result = true; + if (!keywords) return result; + let key = keywords.split(','); + for (let i = 0, len = key.length; i < len; i++) { + if (~value.indexOf(key[i])) { + result = false; + break; + } + } + return result; + } +}; + +export default { + validator: form.validator +} \ No newline at end of file diff --git a/components/firstui/fui-gallery/fui-gallery.vue b/components/firstui/fui-gallery/fui-gallery.vue new file mode 100644 index 0000000..8578fb9 --- /dev/null +++ b/components/firstui/fui-gallery/fui-gallery.vue @@ -0,0 +1,268 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-grid-item/fui-grid-item.vue b/components/firstui/fui-grid-item/fui-grid-item.vue new file mode 100644 index 0000000..5823db5 --- /dev/null +++ b/components/firstui/fui-grid-item/fui-grid-item.vue @@ -0,0 +1,182 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-grid/fui-grid.vue b/components/firstui/fui-grid/fui-grid.vue new file mode 100644 index 0000000..c3ac090 --- /dev/null +++ b/components/firstui/fui-grid/fui-grid.vue @@ -0,0 +1,236 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-horizontal-scroll/bindingx.js b/components/firstui/fui-horizontal-scroll/bindingx.js new file mode 100644 index 0000000..c3b28b4 --- /dev/null +++ b/components/firstui/fui-horizontal-scroll/bindingx.js @@ -0,0 +1,42 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15148 2 2 8 1 0 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifdef APP-NVUE +const BindingX = uni.requireNativePlugin('bindingx'); +export default { + methods: { + getEl(el) { + return this.$refs[el].ref; + }, + nvueScrollHandler(e) { + const anchor = this.getEl('fui_scroller_view') + const element = this.getEl('fui_hor_indicator') + const scrollLeft = e.contentOffset.x + const contentWidth = e.contentSize.width + if (this.scroll && element) { + const barAllMoveWidth = this.bgWidth - this.blockWidth + const platform = uni.getSystemInfoSync().platform + const actionNum = platform.toLowerCase() === 'ios' ? 2 : 1 + const expression = `(x / ${actionNum}) / ${contentWidth - this.width} * ${barAllMoveWidth}` + BindingX.bind({ + anchor, + eventType: 'scroll', + props: [{ + element, + property: 'transform.translateX', + expression + }] + }) + } + if (scrollLeft + this.width === contentWidth) { + this.scrollEvent('right') + } else if (scrollLeft === 0) { + this.scrollEvent('left') + } + } + } +} + +// #endif + +// #ifndef APP-NVUE +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-horizontal-scroll/fui-horizontal-scroll.vue b/components/firstui/fui-horizontal-scroll/fui-horizontal-scroll.vue new file mode 100644 index 0000000..bb8f00b --- /dev/null +++ b/components/firstui/fui-horizontal-scroll/fui-horizontal-scroll.vue @@ -0,0 +1,260 @@ + + + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-horizontal-scroll/index.wxs b/components/firstui/fui-horizontal-scroll/index.wxs new file mode 100644 index 0000000..48c6712 --- /dev/null +++ b/components/firstui/fui-horizontal-scroll/index.wxs @@ -0,0 +1,39 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15 148 22 8 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +function scroll(event, ownerInstance) { + var detail = event.detail + var scrollWidth = detail.scrollWidth + var scrollLeft = detail.scrollLeft + var dataset = event.currentTarget.dataset + var width = dataset.width || 0 + var scrollBarWidth = dataset.bgwidth || 0 + var blockWidth = dataset.blockwidth || 0 + var x = scrollLeft / (scrollWidth - width) * (scrollBarWidth - blockWidth) + setBarStyle(ownerInstance, x) +} +// 2021-5-6变更 +function scrolltolower(event, ownerInstance) {// echo建议 + ownerInstance.callMethod('scrollEvent', 'right') + var dataset = event.currentTarget.dataset// 新特性待增加 + var scrollBarWidth = dataset.bgwidth || 0// echo建议 + var blockWidth = dataset.blockwidth || 0 + setBarStyle(ownerInstance, scrollBarWidth - blockWidth) +} + +function scrolltoupper(event, ownerInstance) { + ownerInstance.callMethod('scrollEvent', 'left') + setBarStyle(ownerInstance, 0) +} + +function setBarStyle(ownerInstance, x) { + var block = ownerInstance.selectComponent('.fui-hor__scroll-indicator') + block && block.setStyle({ + transform: 'translate3d(' + x + 'px,0,0)' + }) + +} + +module.exports = { + scroll: scroll,// 2021-5-6变更 + scrolltolower: scrolltolower, + scrolltoupper: scrolltoupper +} \ No newline at end of file diff --git a/components/firstui/fui-horizontal-scroll/mpjs.js b/components/firstui/fui-horizontal-scroll/mpjs.js new file mode 100644 index 0000000..7f750a3 --- /dev/null +++ b/components/firstui/fui-horizontal-scroll/mpjs.js @@ -0,0 +1,32 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:15 148 2 28 10 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifndef APP-PLUS || MP-WEIXIN || H5 + +export default { + methods: { + scrollHandler(event) { + const detail = event.detail + const scrollWidth = detail.scrollWidth + const scrollLeft = detail.scrollLeft + const width = this.width + const scrollBarWidth = this.bgWidth + const blockWidth = this.blockWidth + const x = scrollLeft / (scrollWidth - width) * (scrollBarWidth - blockWidth) + this.transform = `translate3d(${x}px,0,0)` + }, + scrolltoupper(event) { + this.scrollEvent('left') + this.transform = 'translate3d(0,0,0)' + }, + scrolltolower(event) { + this.scrollEvent('right') + const x = this.bgWidth - this.blockWidth + this.transform = `translate3d(${x}px,0,0)` + } + } +} + +// #endif + +// #ifdef APP-PLUS|| MP-WEIXIN || H5 +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-icon/fui-icon.js b/components/firstui/fui-icon/fui-icon.js new file mode 100644 index 0000000..bc25013 --- /dev/null +++ b/components/firstui/fui-icon/fui-icon.js @@ -0,0 +1,166 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 151 48 22 81 08,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +export default { + "addressbook":"\ue80c", + "addfriends-fill": "\ue80a", + "addfriends": "\ue80b", + "backspace-fill": "\ue808", + "backspace": "\ue809", + "bankcard-fill": "\ue806", + "bankcard": "\ue807", + "camera-fill": "\ue804", + "camera": "\ue805", + "captcha-fill": "\ue802", + "captcha": "\ue803", + "cart-fill": "\ue800", + "cart": "\ue801", + "classify": "\ue7fe", + "classify-fill": "\ue7ff", + "comment-fill": "\ue7fc", + "comment": "\ue7fd", + "community-fill": "\ue7fa", + "community": "\ue7fb", + "coupon-fill": "\ue7f8", + "coupon": "\ue7f9", + "delete": "\ue7f6", + "delete-fill": "\ue7f7", + "edit": "\ue7f4", + "edit-fill": "\ue7f5", + "fabulous-fill": "\ue7f2", + "fabulous": "\ue7f3", + "find": "\ue7f0", + "find-fill": "\ue7f1", + "help-fill": "\ue7ee", + "help": "\ue7ef", + "home-fill": "\ue7ec", + "home": "\ue7ed", + "idcard-fill": "\ue7ea", + "idcard": "\ue7eb", + "info": "\ue7e8", + "info-fill": "\ue7e9", + "invite-fill": "\ue7e6", + "invite": "\ue7e7", + "kefu-fill": "\ue7e4", + "kefu": "\ue7e5", + "like-fill": "\ue7e2", + "like": "\ue7e3", + "location": "\ue7e0", + "location-fill": "\ue7e1", + "lock": "\ue7de", + "lock-fill": "\ue7df", + "mail-fill": "\ue7dc", + "mail": "\ue7dd", + "message": "\ue7da", + "message-fill": "\ue7db", + "mobile-fill": "\ue7d8", + "mobile": "\ue7d9", + "more": "\ue7d6", + "more-fill": "\ue7d7", + "my-fill": "\ue7d4", + "my": "\ue7d5", + "principal":"\ue80d", + "notice-fill": "\ue7d2", + "notice": "\ue7d3", + "order": "\ue7d0", + "order-fill": "\ue7d1", + "picture": "\ue7ce", + "picture-fill": "\ue7cf", + "setup-fill": "\ue7cc", + "setup": "\ue7cd", + "share": "\ue7ca", + "share-fill": "\ue7cb", + "shop": "\ue7c8", + "shop-fill": "\ue7c9", + "star-fill": "\ue7c5", + "star": "\ue7c6", + "starhalf": "\ue7c7", + "stepon-fill": "\ue7c3", + "stepon": "\ue7c4", + "wait-fill": "\ue7c1", + "wait": "\ue7c2", + "warning": "\ue7bf", + "warning-fill": "\ue7c0", + "plus": "\ue7bc", + "plussign-fill": "\ue7bd", + "plussign": "\ue7be", + "minus": "\ue7b9", + "minussign": "\ue7ba", + "minussign-fill": "\ue7bb", + "close": "\ue7b8", + "clear": "\ue7b6", + "clear-fill": "\ue7b7", + "checkbox-fill": "\ue7b5", + "checkround": "\ue7b4", + "checkbox": "\ue7b3", + "check": "\ue7b2", + "pulldown-fill": "\ue7ae", + "pullup": "\ue7af", + "pullup-fill": "\ue7b0", + "pulldown": "\ue7b1", + "roundright-fill": "\ue7ac", + "roundright": "\ue7ad", + "arrowright": "\ue7a9", + "arrowleft": "\ue7aa", + "arrowdown": "\ue7ab", + "left": "\ue7a6", + "up": "\ue7a7", + "right": "\ue7a8", + "back": "\ue7a3", + "top": "\ue7a4", + "dropdown": "\ue7a5", + "turningleft": "\ue79f", + "turningup": "\ue7a0", + "turningright": "\ue7a1", + "turningdown": "\ue7a2", + "refresh": "\ue79c", + "loading": "\ue79d", + "search": "\ue79e", + "rotate": "\ue79b", + "screen": "\ue79a", + "signin": "\ue799", + "calendar": "\ue798", + "scan": "\ue797", + "qrcode": "\ue796", + "wallet": "\ue795", + "telephone": "\ue794", + "visible": "\ue793", + "invisible": "\ue792", + "menu": "\ue78e", + "operate": "\ue78f", + "slide": "\ue790", + "list": "\ue791", + "nonetwork": "\ue78d", + "partake": "\ue78c", + "qa": "\ue78b", + "barchart": "\ue788", + "piechart": "\ue789", + "linechart": "\ue78a", + "at": "\ue787", + "face": "\ue77f", + "redpacket": "\ue780", + "suspend": "\ue781", + "link": "\ue782", + "keyboard": "\ue783", + "play": "\ue784", + "video": "\ue785", + "voice": "\ue786", + "sina": "\ue77a", + "browser": "\ue77b", + "moments": "\ue77c", + "qq": "\ue77d", + "wechat": "\ue77e", + "balance": "\ue779", + "bankcardpay": "\ue778", + "wxpay": "\ue777", + "alipay": "\ue776", + "payment":"\ue818", + "receive":"\ue817", + "sendout":"\ue816", + "evaluate":"\ue815", + "aftersale":"\ue814", + "warehouse":"\ue813", + "transport":"\ue812", + "delivery":"\ue811", + "switch":"\ue810", + "goods":"\ue80f", + "goods-fill":"\ue80e" +} \ No newline at end of file diff --git a/components/firstui/fui-icon/fui-icon.ttf b/components/firstui/fui-icon/fui-icon.ttf new file mode 100644 index 0000000000000000000000000000000000000000..2694eec866aa67f0200274cdbab5a15762feff91 GIT binary patch literal 39852 zcmeFa2bddIxi@~!jHFR-qqdS(tFn@|H?1VwTP*h)_g>d6u@lEFj+2nWCILbUNeB=E zX-=br03i_CN5~R#flCb~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huR_ zf(>uqK=MK77ai~#8PGV`if)jah4e=RRHQ>2ratEA={M1Sb{jT)&yIAc@dn=Qi_UTF x%h4llqPEb_)Ypii-)T;5ins6Y?kF3leg*?p;&e$DNpE}nknO;bLcaMM_aA0>Uk3mH literal 0 HcmV?d00001 diff --git a/components/firstui/fui-icon/fui-icon.vue b/components/firstui/fui-icon/fui-icon.vue new file mode 100644 index 0000000..c43d1d1 --- /dev/null +++ b/components/firstui/fui-icon/fui-icon.vue @@ -0,0 +1,148 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-image-cropper/bindingx.js b/components/firstui/fui-image-cropper/bindingx.js new file mode 100644 index 0000000..37b777d --- /dev/null +++ b/components/firstui/fui-image-cropper/bindingx.js @@ -0,0 +1,282 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 14 822 810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifdef APP-NVUE +const animation = uni.requireNativePlugin('animation'); +export default { + watch: { + width(val) { + this.canvasWidth = Number(val); + }, + height(val) { + this.canvasHeight = Number(val); + }, + changeval(val) { + this.$nextTick(() => { + setTimeout(() => { + this.valsChange(val) + }, 50) + }) + }, + src(val) { + this.$nextTick(() => { + if (val) { + setTimeout(() => { + this.ref = this.getEl(this.$refs['fui_cropper_img']) + this.realRef = this.getEl(this.$refs['fui_cropper_real']) + }, 50) + } + }) + } + }, + data() { + return { + touchRelative: [{ + x: 0, + y: 0 + }], + hypotenuseLength: 0, + flagEndTouch: false, + canvasWidth: 0, + canvasHeight: 0 + } + }, + created() { + this.ref = null; + this.realRef = null; + this.canvasWidth = Number(this.width); + this.canvasHeight = Number(this.height); + }, + methods: { + cutDetectionPosition() { + var windowHeight = this.windowHeight, + windowWidth = this.windowWidth; + + var cutDetectionPositionTop = () => { + if (this.cutY < 0) { + this.cutY = 0; + } + if (this.cutY > windowHeight - this.canvasHeight) { + this.cutY = windowHeight - this.canvasHeight; + } + } + + var cutDetectionPositionLeft = () => { + if (this.cutX < 0) { + this.cutX = 0; + } + if (this.cutX > windowWidth - this.canvasWidth) { + this.cutX = windowWidth - this.canvasWidth; + } + } + if (this.cutY == null && this.cutX == null) { + var cutY = (windowHeight - this.canvasHeight) * 0.5; + var cutX = (windowWidth - this.canvasWidth) * 0.5; + this.cutY = cutY; + this.cutX = cutX; + } else if (this.cutY != null && this.cutX != null) { + cutDetectionPositionTop(); + cutDetectionPositionLeft(); + } else if (this.cutY != null && this.cutX == null) { + cutDetectionPositionTop(); + this.cutX = (windowWidth - this.canvasWidth) / 2; + } else if (this.cutY == null && this.cutX != null) { + cutDetectionPositionLeft(); + this.cutY = (windowHeight - this.canvasHeight) / 2; + } + }, + imgMarginDetectionPosition(scale, delay) { + var left = this.imgLeft; + var top = this.imgTop; + scale = 1 // scale || this.scale; + var imgWidth = this.imgWidth; + var imgHeight = this.imgHeight; + if ((this.angle / 90) % 2) { + imgWidth = this.imgHeight; + imgHeight = this.imgWidth; + } + left = this.cutX + (imgWidth * scale) / 2 >= left ? left : this.cutX + (imgWidth * scale) / 2; + left = this.cutX + this.canvasWidth - (imgWidth * scale) / 2 <= left ? left : this.cutX + this.canvasWidth - + (imgWidth * scale) / 2; + top = this.cutY + (imgHeight * scale) / 2 >= top ? top : this.cutY + (imgHeight * scale) / 2; + top = this.cutY + this.canvasHeight - (imgHeight * scale) / 2 <= top ? top : this.cutY + this.canvasHeight - + (imgHeight * scale) / 2; + + this.imgLeft = left; + this.imgTop = top; + this.scale = scale; + if (!delay || delay === 'undefined') { + this._animation() + } + }, + imgMarginDetectionScale(scale, delay) { + scale = 1 //scale || this.scale; + var imgWidth = this.imgWidth; + var imgHeight = this.imgHeight; + if ((this.angle / 90) % 2) { + imgWidth = this.imgHeight; + imgHeight = this.imgWidth; + } + if (imgWidth * scale < this.canvasWidth) { + scale = this.canvasWidth / imgWidth; + } + if (imgHeight * scale < this.canvasHeight) { + scale = Math.max(scale, this.canvasHeight / imgHeight); + } + this.imgMarginDetectionPosition(scale, delay); + }, + computeCutSize() { + if (this.canvasWidth > this.windowWidth) { + this.canvasWidth = this.windowWidth; + } else if (this.canvasWidth + this.cutX > this.windowWidth) { + this.cutX = this.windowWidth - this.cutX; + } + if (this.canvasHeight > this.windowHeight) { + this.canvasHeight = this.windowHeight; + } else if (this.canvasHeight + this.cutY > this.windowHeight) { + this.cutY = this.windowHeight - this.cutY; + } + }, + setCutCenter() { + var cutY = (this.windowHeight - this.canvasHeight) * 0.5; + var cutX = (this.windowWidth - this.canvasWidth) * 0.5; + this.imgTop = this.imgTop - this.cutY + cutY; + this.cutY = cutY; + this.imgLeft = this.imgLeft - this.cutX + cutX; + this.cutX = cutX; + this.cutDetectionPosition() + this._animation() + }, + imageReset() { + this.scale = 1; + this.angle = 0; + this._animation() + }, + getEl(el) { + return el.ref || el[0].ref; + }, + _animation() { + if (!this.ref || !this.realRef) return + var x = this.imgLeft - this.imgWidth / 2; + var y = this.imgTop - this.imgHeight / 2; + animation.transition(this.realRef, { + styles: { + //暂时去除缩放功能,此功能后期做优化再放出使用 + // transform: `translate(${x}px,${y}px) scale(${this.scale}) rotate(${this.angle}deg)` + transform: `translate(${x}px,${y}px) rotate(${this.angle}deg)` + }, + duration: this.ani ? 250 : 0, + timingFunction: 'linear', + needLayout: false, + delay: 0 + }); + animation.transition(this.ref, { + styles: { + transform: `translate(${x}px,${y}px) rotate(${this.angle}deg)` + }, + duration: this.ani ? 250 : 0, + timingFunction: 'linear', + needLayout: false, + delay: 0 + }); + }, + touchstart(e) { + var touch = e.touches || e.changedTouches + this.flagEndTouch = false; + //暂时放弃双指操作,待后期优化 + if (touch.length == 1 && true) { + this.touchRelative[0] = { + x: touch[0].screenX - this.imgLeft, + y: touch[0].screenY - this.imgTop + }; + } else { + var width = Math.abs(touch[0].screenX - touch[1].screenX); + var height = Math.abs(touch[0].screenY - touch[1].screenY); + this.touchRelative = [{ + x: touch[0].screenX - this.imgLeft, + y: touch[0].screenY - this.imgTop + }, + { + x: touch[1].screenX - this.imgLeft, + y: touch[1].screenY - this.imgTop + } + ]; + this.hypotenuseLength = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)); + } + }, + touchmove(e) { + var touch = e.touches || e.changedTouches + if (this.flagEndTouch || touch.length > 1 || !this.src) return; + this.moveDuring(); + //暂时放弃双指操作,待后期优化 + if (touch.length == 1 && true) { + var left = touch[0].screenX - this.touchRelative[0].x, + top = touch[0].screenY - this.touchRelative[0].y; + this.imgLeft = left; + this.imgTop = top; + this._animation() + this.imgMarginDetectionPosition(); + } else { + var width = Math.abs(touch[0].screenX - touch[1].screenX), + height = Math.abs(touch[0].screenY - touch[1].screenY), + hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)), + scale = this.scale * (hypotenuse / this.hypotenuseLength), + current_deg = 0; + scale = scale <= 0.5 ? 0.5 : scale; + scale = scale >= 2 ? 2 : scale; + this.imgMarginDetectionScale(scale, true); + var touchRelative = [{ + x: touch[0].screenX - this.imgLeft, + y: touch[0].screenY - this.imgTop + }, + { + x: touch[1].screenX - this.imgLeft, + y: touch[1].screenY - this.imgTop + } + ]; + this.touchRelative = touchRelative; + this.hypotenuseLength = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)); + this.angle = this.angle + current_deg; + this._animation() + } + }, + touchend(e) { + this.flagEndTouch = true; + this.moveStop(); + }, + valsChange(val) { + if (val) { + var params = val.split('_') + var type = Number(params[0]) + if (type == 3) { + this._animation() + } + switch (type) { + case 1: + this.setCutCenter(); + this.computeCutSize(); + this.cutDetectionPosition(); + break; + case 2: + this.setCutCenter(); + break; + case 3: + this.imgMarginDetectionScale() + break; + case 4: + this.imageReset(); + break; + case 5: + this.setCutCenter(); + break; + default: + break; + } + } + } + } +} + +// #endif + +// #ifndef APP-NVUE +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-image-cropper/fui-image-cropper.vue b/components/firstui/fui-image-cropper/fui-image-cropper.vue new file mode 100644 index 0000000..242ba47 --- /dev/null +++ b/components/firstui/fui-image-cropper/fui-image-cropper.vue @@ -0,0 +1,656 @@ + + + + + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-image-cropper/index.wxs b/components/firstui/fui-image-cropper/index.wxs new file mode 100644 index 0000000..3ea348e --- /dev/null +++ b/components/firstui/fui-image-cropper/index.wxs @@ -0,0 +1,342 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号:151482 2 810 8,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +function isPC() { + if (typeof navigator !== 'object') return false; + var userAgentInfo = navigator.userAgent; + var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; + var flag = true; + for (var v = 0; v < Agents.length - 1; v++) { + if (userAgentInfo.indexOf(Agents[v]) > 0) { + flag = false; + break; + } + } + return flag; +} +var isH5 = false +if (typeof window === 'object') isH5 = true +var cropper = { + cutX: 0, + cutY: 0, + touchRelative: [{ + x: 0, + y: 0 + }], + hypotenuseLength: 0, + flagEndTouch: false, + canvasWidth: 0, + canvasHeight: 0, + imgWidth: 0, + imgHeight: 0, + scale: 1, + angle: 0, + imgTop: 0, + imgLeft: 0, + windowHeight: 0, + windowWidth: 0, + init: true +} + +function touchstart(e, ins) { + var touch = null + if (isH5 && isPC()) { + touch = [e]; + } else { + touch = e.touches || e.changedTouches + } + cropper.flagEndTouch = false; + if (touch.length == 1) { + cropper.touchRelative[0] = { + x: touch[0].pageX - cropper.imgLeft, + y: touch[0].pageY - cropper.imgTop + }; + } else { + var width = Math.abs(touch[0].pageX - touch[1].pageX); + var height = Math.abs(touch[0].pageY - touch[1].pageY); + cropper.touchRelative = [{ + x: touch[0].pageX - cropper.imgLeft, + y: touch[0].pageY - cropper.imgTop + }, + { + x: touch[1].pageX - cropper.imgLeft, + y: touch[1].pageY - cropper.imgTop + } + ]; + cropper.hypotenuseLength = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)); + } + +} + +function moveDuring(ins) { + if (!ins) return; + ins.callMethod('moveDuring') +} + +function moveStop(ins) { + if (!ins) return; + ins.callMethod('moveStop') +}; + +function setCutCenter(ins) { + var cutY = (cropper.windowHeight - cropper.canvasHeight) * 0.5; + var cutX = (cropper.windowWidth - cropper.canvasWidth) * 0.5; + cropper.imgTop = cropper.imgTop - cropper.cutY + cutY; + cropper.cutY = cutY; + cropper.imgLeft = cropper.imgLeft - cropper.cutX + cutX; + cropper.cutX = cutX; + cutDetectionPosition(ins) + imgTransform(ins) + updateData(ins) +} + +function touchmove(e, ins) { + if (e.preventDefault) { + e.preventDefault() + } + var touch = null + if (isH5 && isPC()) { + touch = [e]; + } else { + touch = e.touches || e.changedTouches + } + if (cropper.flagEndTouch) return; + moveDuring(ins); + if (touch.length == 1) { + var left = touch[0].pageX - cropper.touchRelative[0].x, + top = touch[0].pageY - cropper.touchRelative[0].y; + cropper.imgLeft = left; + cropper.imgTop = top; + imgTransform(ins); + imgMarginDetectionPosition(ins); + } else { + var res = e.instance.getDataset(); + var width = Math.abs(touch[0].pageX - touch[1].pageX), + height = Math.abs(touch[0].pageY - touch[1].pageY), + hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)), + scale = cropper.scale * (hypotenuse / cropper.hypotenuseLength), + current_deg = 0; + scale = scale <= 0.5 ? 0.5 : scale; + scale = scale >= 2 ? 2 : scale; + cropper.scale = scale; + imgMarginDetectionScale(ins, true); + var touchRelative = [{ + x: touch[0].pageX - cropper.imgLeft, + y: touch[0].pageY - cropper.imgTop + }, + { + x: touch[1].pageX - cropper.imgLeft, + y: touch[1].pageY - cropper.imgTop + } + ]; + cropper.touchRelative = touchRelative; + cropper.hypotenuseLength = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)); + cropper.angle = cropper.angle + current_deg; + imgTransform(ins); + } +} + +function touchend(e, ins) { + cropper.flagEndTouch = true; + moveStop(ins); + updateData(ins) +} + +function cutDetectionPosition(ins) { + var windowHeight = cropper.windowHeight, + windowWidth = cropper.windowWidth; + + var cutDetectionPositionTop = function() { + if (cropper.cutY < 0) { + cropper.cutY = 0; + } + if (cropper.cutY > windowHeight - cropper.canvasHeight) { + cropper.cutY = windowHeight - cropper.canvasHeight; + } + } + + var cutDetectionPositionLeft = function() { + if (cropper.cutX < 0) { + cropper.cutX = 0; + } + if (cropper.cutX > windowWidth - cropper.canvasWidth) { + cropper.cutX = windowWidth - cropper.canvasWidth; + } + } + if (cropper.cutY == null && cropper.cutX == null) { + var cutY = (windowHeight - cropper.canvasHeight) * 0.5; + var cutX = (windowWidth - cropper.canvasWidth) * 0.5; + cropper.cutY = cutY; + cropper.cutX = cutX; + } else if (cropper.cutY != null && cropper.cutX != null) { + cutDetectionPositionTop(); + cutDetectionPositionLeft(); + } else if (cropper.cutY != null && cropper.cutX == null) { + cutDetectionPositionTop(); + cropper.cutX = (windowWidth - cropper.canvasWidth) / 2; + } else if (cropper.cutY == null && cropper.cutX != null) { + cutDetectionPositionLeft(); + cropper.cutY = (windowHeight - cropper.canvasHeight) / 2; + } +} + +function imgMarginDetectionScale(ins, delay) { + var scale = cropper.scale; + var imgWidth = cropper.imgWidth; + var imgHeight = cropper.imgHeight; + if ((cropper.angle / 90) % 2) { + imgWidth = cropper.imgHeight; + imgHeight = cropper.imgWidth; + } + if (imgWidth * scale < cropper.canvasWidth) { + scale = cropper.canvasWidth / imgWidth; + } + if (imgHeight * scale < cropper.canvasHeight) { + scale = Math.max(scale, cropper.canvasHeight / imgHeight); + } + imgMarginDetectionPosition(ins, scale, delay); +} + +function imgMarginDetectionPosition(ins, scale, delay) { + var left = cropper.imgLeft; + var top = cropper.imgTop; + scale = scale || cropper.scale; + var imgWidth = cropper.imgWidth; + var imgHeight = cropper.imgHeight; + if ((cropper.angle / 90) % 2) { + imgWidth = cropper.imgHeight; + imgHeight = cropper.imgWidth; + } + left = cropper.cutX + (imgWidth * scale) / 2 >= left ? left : cropper.cutX + (imgWidth * scale) / 2; + left = cropper.cutX + cropper.canvasWidth - (imgWidth * scale) / 2 <= left ? left : cropper.cutX + cropper + .canvasWidth - + (imgWidth * scale) / 2; + top = cropper.cutY + (imgHeight * scale) / 2 >= top ? top : cropper.cutY + (imgHeight * scale) / 2; + top = cropper.cutY + cropper.canvasHeight - (imgHeight * scale) / 2 <= top ? top : cropper.cutY + cropper + .canvasHeight - + (imgHeight * scale) / 2; + + cropper.imgLeft = left; + cropper.imgTop = top; + cropper.scale = scale; + if (!delay || delay === 'null') { + imgTransform(ins); + } +} + +function computeCutSize(ins) { + if (cropper.canvasWidth > cropper.windowWidth) { + cropper.canvasWidth = cropper.windowWidth; + } else if (cropper.canvasWidth + cropper.cutX > cropper.windowWidth) { + cropper.cutX = cropper.windowWidth - cropper.cutX; + } + if (cropper.canvasHeight > cropper.windowHeight) { + cropper.canvasHeight = cropper.windowHeight; + } else if (cropper.canvasHeight + cropper.cutY > cropper.windowHeight) { + cropper.cutY = cropper.windowHeight - cropper.cutY; + } +} + +function imgTransform(ins) { + var owner = ins.selectComponent('.fui-cropper__img') + if (!owner) return + var x = cropper.imgLeft - cropper.imgWidth / 2; + var y = cropper.imgTop - cropper.imgHeight / 2; + owner.setStyle({ + 'transform': 'translate3d(' + x + 'px,' + y + 'px,0) scale(' + cropper.scale + ') rotate(' + cropper + .angle + 'deg)' + }) +} + +function imageReset(ins) { + cropper.scale = 1; + cropper.angle = 0; + imgTransform(ins); +} + +function updateData(ins) { + if (!ins) return; + ins.callMethod('change', { + cutX: cropper.cutX, + cutY: cropper.cutY, + imgWidth: cropper.imgWidth, + imgHeight: cropper.imgHeight, + scale: cropper.scale, + angle: cropper.angle, + imgTop: cropper.imgTop, + imgLeft: cropper.imgLeft + }) +} + +function valsChange(prop, oldProp, ownerInstance, ins) { + if (prop && prop !== 'null' && ins) { + var params = prop.split('_') + var type = +params[0] + var dataset = ins.getDataset(); + if (cropper.init || type == 4) { + cropper.canvasWidth = +dataset.width; + cropper.canvasHeight = +dataset.height; + cropper.windowHeight = +dataset.windowheight; + cropper.windowWidth = +dataset.windowwidth; + cropper.imgTop = (+dataset.windowheight) / 2; + cropper.imgLeft = (+dataset.windowwidth) / 2; + cropper.imgWidth = +dataset.imgwidth; + cropper.imgHeight = +dataset.imgheight; + cropper.init = false + } else if (type == 2 || type == 3) { + cropper.imgTop = (+dataset.windowheight) / 2; + cropper.imgLeft = (+dataset.windowwidth) / 2; + cropper.imgWidth = +dataset.imgwidth; + cropper.imgHeight = +dataset.imgheight; + } + cropper.angle = +dataset.angle; + if (type == 3) { + imgTransform(ownerInstance); + } + + switch (type) { + case 1: + setCutCenter(ownerInstance); + computeCutSize(ownerInstance); + cutDetectionPosition(ownerInstance); + break; + case 2: + setCutCenter(ownerInstance); + break; + case 3: + imgMarginDetectionScale(ownerInstance) + break; + case 4: + imageReset(ownerInstance); + break; + case 5: + setCutCenter(ownerInstance); + break; + default: + break; + } + } +} + +var movable = false; + +function mousedown(e, ins) { + if (!isH5 || !isPC()) return + touchstart(e, ins) + movable = true + window.onmousemove = function(event) { + if (!isH5 || !isPC() || !movable) return + touchmove(event, ins, e) + } + window.onmouseup = function(event) { + if (!isH5 || !isPC() || !movable) return + touchend(event, ins, e) + movable = false + } +} + +module.exports = { + touchstart: touchstart, + touchmove: touchmove, + touchend: touchend, + valsChange: valsChange, + mousedown: mousedown +} \ No newline at end of file diff --git a/components/firstui/fui-image-cropper/mpjs.js b/components/firstui/fui-image-cropper/mpjs.js new file mode 100644 index 0000000..149641c --- /dev/null +++ b/components/firstui/fui-image-cropper/mpjs.js @@ -0,0 +1,231 @@ +// 本文件由FirstUI授权予内蒙古晟誉网络科技有限责任公司(手机号: 15 1 482 2 8 108,身份证尾号:1R6T39)专用,请尊重知识产权,勿私下传播,违者追究法律责任。 +// #ifndef APP-PLUS || MP-WEIXIN || H5 +export default { + data() { + return { + touchRelative: [{ + x: 0, + y: 0 + }], + hypotenuseLength: 0, + flagEndTouch: false, + canvasWidth: 0, + canvasHeight: 0 + } + }, + created() { + this.canvasWidth = Number(this.width); + this.canvasHeight = Number(this.height); + }, + watch: { + width(val) { + this.canvasWidth = Number(val); + }, + height(val) { + this.canvasHeight = Number(val); + }, + changeval(val) { + this.valsChange(val) + } + }, + computed: { + getTransform: function() { + return `translate3d(${this.imgLeft - this.imgWidth / 2}px,${this.imgTop - this.imgHeight / 2}px,0) scale(${this.scale}) rotate(${this.angle}deg)`; + } + }, + methods: { + cutDetectionPosition() { + var windowHeight = this.windowHeight, + windowWidth = this.windowWidth; + + var cutDetectionPositionTop = () => { + if (this.cutY < 0) { + this.cutY = 0; + } + if (this.cutY > windowHeight - this.canvasHeight) { + this.cutY = windowHeight - this.canvasHeight; + } + } + + var cutDetectionPositionLeft = () => { + if (this.cutX < 0) { + this.cutX = 0; + } + if (this.cutX > windowWidth - this.canvasWidth) { + this.cutX = windowWidth - this.canvasWidth; + } + } + if (this.cutY == null && this.cutX == null) { + var cutY = (windowHeight - this.canvasHeight) * 0.5; + var cutX = (windowWidth - this.canvasWidth) * 0.5; + this.cutY = cutY; + this.cutX = cutX; + } else if (this.cutY != null && this.cutX != null) { + cutDetectionPositionTop(); + cutDetectionPositionLeft(); + } else if (this.cutY != null && this.cutX == null) { + cutDetectionPositionTop(); + this.cutX = (windowWidth - this.canvasWidth) / 2; + } else if (this.cutY == null && this.cutX != null) { + cutDetectionPositionLeft(); + this.cutY = (windowHeight - this.canvasHeight) / 2; + } + }, + imgMarginDetectionPosition(scale) { + var left = this.imgLeft; + var top = this.imgTop; + scale = scale || this.scale; + var imgWidth = this.imgWidth; + var imgHeight = this.imgHeight; + if ((this.angle / 90) % 2) { + imgWidth = this.imgHeight; + imgHeight = this.imgWidth; + } + left = this.cutX + (imgWidth * scale) / 2 >= left ? left : this.cutX + (imgWidth * scale) / 2; + left = this.cutX + this.canvasWidth - (imgWidth * scale) / 2 <= left ? left : this.cutX + this.canvasWidth - + (imgWidth * scale) / 2; + top = this.cutY + (imgHeight * scale) / 2 >= top ? top : this.cutY + (imgHeight * scale) / 2; + top = this.cutY + this.canvasHeight - (imgHeight * scale) / 2 <= top ? top : this.cutY + this.canvasHeight - + (imgHeight * scale) / 2; + + this.imgLeft = left; + this.imgTop = top; + this.scale = scale; + }, + imgMarginDetectionScale(scale) { + scale = scale || this.scale; + var imgWidth = this.imgWidth; + var imgHeight = this.imgHeight; + if ((this.angle / 90) % 2) { + imgWidth = this.imgHeight; + imgHeight = this.imgWidth; + } + if (imgWidth * scale < this.canvasWidth) { + scale = this.canvasWidth / imgWidth; + } + if (imgHeight * scale < this.canvasHeight) { + scale = Math.max(scale, this.canvasHeight / imgHeight); + } + this.imgMarginDetectionPosition(scale); + }, + computeCutSize() { + if (this.canvasWidth > this.windowWidth) { + this.canvasWidth = this.windowWidth; + } else if (this.canvasWidth + this.cutX > this.windowWidth) { + this.cutX = this.windowWidth - this.cutX; + } + if (this.canvasHeight > this.windowHeight) { + this.canvasHeight = this.windowHeight; + } else if (this.canvasHeight + this.cutY > this.windowHeight) { + this.cutY = this.windowHeight - this.cutY; + } + }, + setCutCenter() { + var cutY = (this.windowHeight - this.canvasHeight) * 0.5; + var cutX = (this.windowWidth - this.canvasWidth) * 0.5; + this.imgTop = this.imgTop - this.cutY + cutY; + this.cutY = cutY; + this.imgLeft = this.imgLeft - this.cutX + cutX; + this.cutX = cutX; + this.cutDetectionPosition() + }, + imageReset() { + this.scale = 1; + this.angle = 0; + }, + touchstart(e) { + var touch = e.touches || e.changedTouches + this.flagEndTouch = false; + if (touch.length == 1) { + this.touchRelative[0] = { + x: touch[0].clientX - this.imgLeft, + y: touch[0].clientY - this.imgTop + }; + } else { + var width = Math.abs(touch[0].clientX - touch[1].clientX); + var height = Math.abs(touch[0].clientY - touch[1].clientY); + this.touchRelative = [{ + x: touch[0].clientX - this.imgLeft, + y: touch[0].clientY - this.imgTop + }, + { + x: touch[1].clientX - this.imgLeft, + y: touch[1].clientY - this.imgTop + } + ]; + this.hypotenuseLength = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)); + } + }, + touchmove(e) { + var touch = e.touches || e.changedTouches + if (this.flagEndTouch) return; + this.moveDuring(); + if (touch.length == 1) { + var left = touch[0].clientX - this.touchRelative[0].x, + top = touch[0].clientY - this.touchRelative[0].y; + this.imgLeft = left; + this.imgTop = top; + this.imgMarginDetectionPosition(); + } else { + var width = Math.abs(touch[0].clientX - touch[1].clientX), + height = Math.abs(touch[0].clientY - touch[1].clientY), + hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)), + scale = this.scale * (hypotenuse / this.hypotenuseLength), + current_deg = 0; + scale = scale <= 0.5 ? 0.5 : scale; + scale = scale >= 2 ? 2 : scale; + this.imgMarginDetectionScale(scale); + var touchRelative = [{ + x: touch[0].clientX - this.imgLeft, + y: touch[0].clientY - this.imgTop + }, + { + x: touch[1].clientX - this.imgLeft, + y: touch[1].clientY - this.imgTop + } + ]; + this.touchRelative = touchRelative; + this.hypotenuseLength = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)); + this.angle = this.angle + current_deg; + this.scale = this.scale; + } + }, + touchend(e) { + this.flagEndTouch = true; + this.moveStop(); + }, + valsChange(val) { + if (val) { + var params = val.split('_') + var type = Number(params[0]) + switch (type) { + case 1: + this.setCutCenter(); + this.computeCutSize(); + this.cutDetectionPosition(); + break; + case 2: + this.setCutCenter(); + break; + case 3: + this.imgMarginDetectionScale() + break; + case 4: + this.imageReset(); + break; + case 5: + this.setCutCenter(); + break; + default: + break; + } + } + } + } +} + +// #endif + +// #ifdef APP-PLUS|| MP-WEIXIN || H5 +export default {} +// #endif \ No newline at end of file diff --git a/components/firstui/fui-index-list/f-index-list-item.vue b/components/firstui/fui-index-list/f-index-list-item.vue new file mode 100644 index 0000000..85e3e3e --- /dev/null +++ b/components/firstui/fui-index-list/f-index-list-item.vue @@ -0,0 +1,256 @@ + + + + + + \ No newline at end of file diff --git a/components/firstui/fui-index-list/fui-index-list.vue b/components/firstui/fui-index-list/fui-index-list.vue new file mode 100644 index 0000000..823fabf --- /dev/null +++ b/components/firstui/fui-index-list/fui-index-list.vue @@ -0,0 +1,647 @@ + +