From 2676308b904d63dc850f00473c925c10820991ad Mon Sep 17 00:00:00 2001 From: ihzero Date: Sun, 23 Jun 2024 01:39:44 +0800 Subject: [PATCH] first commit --- .env | 0 .env.development | 1 + .env.production | 1 + .gitignore | 22 + .hbuilderx/launch.json | 16 + README.md | 36 + deploy.sh | 30 + index.html | 20 + package.json | 76 + shims-uni.d.ts | 10 + src/App.vue | 291 ++ src/api/xinjiang_guess.js | 153 + src/common/config.js | 7 + src/main.js | 30 + src/manifest.json | 89 + src/package.json | 16 + src/packages/pages/about/about.vue | 293 ++ .../pages/activeDetail/activeDetail.vue | 1080 ++++ src/packages/pages/award/award.vue | 173 + .../pages/awardDetail/awardDetail.vue | 309 ++ src/packages/pages/indexodd/index.vue | 334 ++ src/packages/pages/login/login.vue | 293 ++ .../pages/news/newDetail/newDetail.vue | 63 + src/packages/pages/quizRecord/quizRecord.vue | 215 + src/packages/pages/setting/setting.vue | 163 + src/pages.json | 146 + src/pages/activities/activities.vue | 215 + src/pages/charts/charts.vue | 1080 ++++ src/pages/charts/rules.vue | 76 + src/pages/index/index.vue | 713 +++ src/pages/my/index.vue | 289 ++ src/pages/news/news.vue | 199 + src/pages/signature/signature.vue | 61 + src/pages/webview/index.vue | 20 + src/shime-uni.d.ts | 6 + src/static/icons/arrow.svg | 1 + src/static/icons/charts-1.png | Bin 0 -> 1523 bytes src/static/icons/charts.png | Bin 0 -> 1460 bytes src/static/icons/copy.svg | 4 + src/static/icons/customer-service.svg | 5 + src/static/icons/earth-1.png | Bin 0 -> 2943 bytes src/static/icons/earth.png | Bin 0 -> 2738 bytes src/static/icons/gift.svg | 7 + src/static/icons/home-1.png | Bin 0 -> 965 bytes src/static/icons/home.png | Bin 0 -> 903 bytes src/static/icons/info.svg | 6 + src/static/icons/my-1.png | Bin 0 -> 1699 bytes src/static/icons/my.png | Bin 0 -> 1626 bytes src/static/icons/recode.svg | 1 + src/static/icons/record.svg | 5 + src/static/icons/setting.svg | 4 + src/static/icons/star-1.png | Bin 0 -> 1784 bytes src/static/icons/star.png | Bin 0 -> 1792 bytes src/static/images/active-finished.svg | 15 + src/static/images/active-processing.svg | 15 + src/static/images/empty.png | Bin 0 -> 4725 bytes src/static/images/error.png | Bin 0 -> 675 bytes src/static/images/example-avatar1.png | Bin 0 -> 2779 bytes src/static/images/honor-1.png | Bin 0 -> 2073 bytes src/static/images/honor-2.png | Bin 0 -> 2031 bytes src/static/images/honor-3.png | Bin 0 -> 2045 bytes src/static/images/mescroll-empty.png | Bin 0 -> 7118 bytes src/static/images/mescroll-totop.png | Bin 0 -> 288 bytes src/static/logo.png.back | Bin 0 -> 4023 bytes src/uni.scss | 79 + src/uni_modules/lime-back-top/changelog.md | 4 + .../components/l-back-top/index.scss | 85 + .../components/l-back-top/l-back-top.vue | 121 + .../components/l-back-top/props.ts | 51 + .../components/l-back-top/type.ts | 54 + .../lime-back-top/lime-back-top.vue | 38 + src/uni_modules/lime-back-top/package.json | 84 + src/uni_modules/lime-back-top/readme.md | 93 + src/uni_modules/lime-icon/changelog.md | 7 + .../lime-icon/components/l-icon/icon.scss | 961 ++++ .../lime-icon/components/l-icon/icons.js | 239 + .../lime-icon/components/l-icon/index.scss | 68 + .../lime-icon/components/l-icon/l-icon.uvue | 122 + .../lime-icon/components/l-icon/l-icon.vue | 34 + .../lime-icon/components/l-icon/lIcon.ts | 111 + .../lime-icon/components/l-icon/props.ts | 24 + .../components/lime-icon/lime-icon.vue | 167 + src/uni_modules/lime-icon/generate-icons.js | 2 + src/uni_modules/lime-icon/lime.config.js | 23 + src/uni_modules/lime-icon/package.json | 86 + src/uni_modules/lime-icon/plugin.js | 87 + src/uni_modules/lime-icon/readme.md | 169 + src/uni_modules/lime-icon/utils/generate.js | 120 + src/uni_modules/lime-icon/utils/index.js | 89 + src/uni_modules/lime-painter/changelog.md | 221 + .../components/common/relation.js | 150 + .../l-painter-image/l-painter-image.vue | 28 + .../l-painter-qrcode/l-painter-qrcode.vue | 27 + .../l-painter-text/l-painter-text.vue | 33 + .../l-painter-view/l-painter-view.vue | 34 + .../components/l-painter/l-painter.vue | 461 ++ .../lime-painter/components/l-painter/nvue.js | 191 + .../components/l-painter/painter.js | 1 + .../components/l-painter/props.js | 56 + .../components/l-painter/single.js | 1 + .../components/l-painter/utils.js | 368 ++ .../components/lime-painter/lime-painter.vue | 235 + .../lime-painter/hybrid/html/index.html | 119 + .../lime-painter/hybrid/html/painter.js | 1 + .../hybrid/html/uni.webview.1.5.3.js | 1 + src/uni_modules/lime-painter/package.json | 92 + src/uni_modules/lime-painter/parser.js | 388 ++ src/uni_modules/lime-painter/readme.md | 963 ++++ src/uni_modules/lime-shared/addUnit/index.ts | 25 + .../lime-shared/arrayBufferToFile/index.ts | 63 + .../lime-shared/base64ToArrayBuffer/index.ts | 13 + .../lime-shared/base64ToPath/index.ts | 76 + .../lime-shared/camelCase/index.ts | 21 + .../lime-shared/canIUseCanvas2d/index.ts | 58 + src/uni_modules/lime-shared/changelog.md | 30 + src/uni_modules/lime-shared/clamp/index.ts | 16 + .../lime-shared/cloneDeep/index.ts | 103 + src/uni_modules/lime-shared/closest/index.ts | 22 + .../lime-shared/createAnimation/index.ts | 149 + .../lime-shared/createImage/index.ts | 61 + src/uni_modules/lime-shared/debounce/index.ts | 38 + src/uni_modules/lime-shared/exif/index.ts | 1056 ++++ src/uni_modules/lime-shared/fillZero/index.ts | 11 + src/uni_modules/lime-shared/floatAdd/index.ts | 36 + .../lime-shared/getClassStr/index.ts | 27 + .../lime-shared/getCurrentPage/index.ts | 6 + .../lime-shared/getLocalFilePath/index.ts | 14 + src/uni_modules/lime-shared/getRect/index.ts | 86 + .../lime-shared/getStyleStr/index.ts | 30 + src/uni_modules/lime-shared/hasOwn/index.ts | 30 + src/uni_modules/lime-shared/index.ts | 43 + src/uni_modules/lime-shared/isBase64/index.ts | 9 + .../lime-shared/isBrowser/index.ts | 2 + src/uni_modules/lime-shared/isDef/index.ts | 9 + .../lime-shared/isFunction/index.ts | 8 + src/uni_modules/lime-shared/isNumber/index.ts | 9 + .../lime-shared/isNumeric/index.ts | 9 + src/uni_modules/lime-shared/isObject/index.ts | 8 + .../lime-shared/isPromise/index.ts | 13 + src/uni_modules/lime-shared/isString/index.ts | 7 + .../lime-shared/kebabCase/index.ts | 17 + src/uni_modules/lime-shared/package.json | 83 + .../lime-shared/pathToBase64/index.ts | 121 + src/uni_modules/lime-shared/piexif/index.ts | 2320 +++++++++ src/uni_modules/lime-shared/platform/index.ts | 27 + src/uni_modules/lime-shared/raf/index.ts | 30 + src/uni_modules/lime-shared/random/index.ts | 22 + src/uni_modules/lime-shared/range/index.ts | 31 + src/uni_modules/lime-shared/readme.md | 251 + .../lime-shared/selectComponent/index.ts | 152 + src/uni_modules/lime-shared/sleep/index.ts | 30 + src/uni_modules/lime-shared/throttle/index.ts | 41 + src/uni_modules/lime-shared/toArray/index.ts | 13 + src/uni_modules/lime-shared/toNumber/index.ts | 15 + .../lime-shared/unitConvert/index.ts | 39 + .../useIntersectionObserver/index.ts | 81 + src/uni_modules/lime-shared/vue/index.ts | 8 + src/uni_modules/lime-signature/changelog.md | 102 + .../components/l-signature/context.js | 157 + .../components/l-signature/l-signature.uvue | 362 ++ .../components/l-signature/l-signature.vue | 647 +++ .../components/l-signature/props.js | 64 + .../components/l-signature/render.js | 228 + .../components/l-signature/signature.js | 1 + .../components/l-signature/signature.uts | 161 + .../components/l-signature/utils.js | 181 + .../lime-signature/lime-signature.uvue | 54 + .../lime-signature/lime-signature.vue | 381 ++ .../lime-signature/hybrid/html/index.html | 226 + .../lime-signature/hybrid/html/signature.js | 1 + .../hybrid/html/uni.webview.1.5.3.js | 1 + src/uni_modules/lime-signature/index.uts | 37 + src/uni_modules/lime-signature/package.json | 84 + src/uni_modules/lime-signature/readme.md | 174 + src/uni_modules/mescroll-uni/changelog.md | 8 + .../mescroll-body/mescroll-body.css | 19 + .../mescroll-body/mescroll-body.vue | 400 ++ .../beibei/components/mescroll-down.css | 47 + .../beibei/components/mescroll-down.vue | 39 + .../mescroll-diy/beibei/mescroll-body.vue | 360 ++ .../beibei/mescroll-uni-option.js | 49 + .../mescroll-diy/beibei/mescroll-uni.vue | 434 ++ .../xinlang/components/mescroll-down.css | 44 + .../xinlang/components/mescroll-down.vue | 53 + .../xinlang/components/mescroll-up.css | 32 + .../xinlang/components/mescroll-up.vue | 40 + .../mescroll-diy/xinlang/mescroll-body.vue | 380 ++ .../xinlang/mescroll-uni-option.js | 64 + .../mescroll-diy/xinlang/mescroll-uni.vue | 459 ++ .../mescroll-empty/mescroll-empty.vue | 116 + .../mescroll-uni/components/mescroll-down.css | 55 + .../mescroll-uni/components/mescroll-down.vue | 47 + .../mescroll-uni/components/mescroll-top.vue | 99 + .../mescroll-uni/components/mescroll-up.css | 47 + .../mescroll-uni/components/mescroll-up.vue | 39 + .../components/mescroll-uni/mescroll-i18n.js | 15 + .../mescroll-uni/mescroll-mixins.js | 46 + .../mescroll-uni/mescroll-uni-option.js | 66 + .../components/mescroll-uni/mescroll-uni.css | 36 + .../components/mescroll-uni/mescroll-uni.js | 799 +++ .../components/mescroll-uni/mescroll-uni.vue | 480 ++ .../mescroll-uni/mixins/mescroll-comp.js | 47 + .../mescroll-uni/mixins/mescroll-more-item.js | 57 + .../mescroll-uni/mixins/mescroll-more.js | 77 + .../components/mescroll-uni/wxs/mixins.js | 109 + .../components/mescroll-uni/wxs/renderjs.js | 92 + .../components/mescroll-uni/wxs/wxs.wxs | 269 + .../mescroll-uni/hooks/useMescroll.js | 66 + .../mescroll-uni/hooks/useMescrollComp.js | 56 + .../mescroll-uni/hooks/useMescrollMore.js | 69 + src/uni_modules/mescroll-uni/package.json | 77 + src/uni_modules/mescroll-uni/readme.md | 45 + src/uni_modules/mp-html/README.md | 194 + src/uni_modules/mp-html/changelog.md | 150 + .../mp-html/components/mp-html/mp-html.vue | 498 ++ .../mp-html/components/mp-html/node/node.vue | 587 +++ .../mp-html/components/mp-html/parser.js | 1393 ++++++ src/uni_modules/mp-html/package.json | 76 + .../static/app-plus/mp-html/js/handler.js | 1 + .../app-plus/mp-html/js/uni.webview.min.js | 1 + .../static/app-plus/mp-html/local.html | 1 + src/utils/eventBus.js | 8 + src/utils/hooks/useAuthUser.js | 24 + src/utils/jump.js | 36 + src/utils/mixins/load_langkey.js | 24 + src/utils/mixins/mixin_common.js | 56 + src/utils/request/index.js | 107 + vite.config.js | 8 + yarn.lock | 4429 +++++++++++++++++ 229 files changed, 33937 insertions(+) create mode 100644 .env create mode 100644 .env.development create mode 100644 .env.production create mode 100644 .gitignore create mode 100644 .hbuilderx/launch.json create mode 100644 README.md create mode 100755 deploy.sh create mode 100644 index.html create mode 100644 package.json create mode 100644 shims-uni.d.ts create mode 100644 src/App.vue create mode 100644 src/api/xinjiang_guess.js create mode 100644 src/common/config.js create mode 100644 src/main.js create mode 100644 src/manifest.json create mode 100644 src/package.json create mode 100644 src/packages/pages/about/about.vue create mode 100644 src/packages/pages/activeDetail/activeDetail.vue create mode 100644 src/packages/pages/award/award.vue create mode 100644 src/packages/pages/awardDetail/awardDetail.vue create mode 100644 src/packages/pages/indexodd/index.vue create mode 100644 src/packages/pages/login/login.vue create mode 100644 src/packages/pages/news/newDetail/newDetail.vue create mode 100644 src/packages/pages/quizRecord/quizRecord.vue create mode 100644 src/packages/pages/setting/setting.vue create mode 100644 src/pages.json create mode 100644 src/pages/activities/activities.vue create mode 100644 src/pages/charts/charts.vue create mode 100644 src/pages/charts/rules.vue create mode 100644 src/pages/index/index.vue create mode 100644 src/pages/my/index.vue create mode 100644 src/pages/news/news.vue create mode 100644 src/pages/signature/signature.vue create mode 100644 src/pages/webview/index.vue create mode 100644 src/shime-uni.d.ts create mode 100644 src/static/icons/arrow.svg create mode 100644 src/static/icons/charts-1.png create mode 100644 src/static/icons/charts.png create mode 100644 src/static/icons/copy.svg create mode 100644 src/static/icons/customer-service.svg create mode 100644 src/static/icons/earth-1.png create mode 100644 src/static/icons/earth.png create mode 100644 src/static/icons/gift.svg create mode 100644 src/static/icons/home-1.png create mode 100644 src/static/icons/home.png create mode 100644 src/static/icons/info.svg create mode 100644 src/static/icons/my-1.png create mode 100644 src/static/icons/my.png create mode 100644 src/static/icons/recode.svg create mode 100644 src/static/icons/record.svg create mode 100644 src/static/icons/setting.svg create mode 100644 src/static/icons/star-1.png create mode 100644 src/static/icons/star.png create mode 100644 src/static/images/active-finished.svg create mode 100644 src/static/images/active-processing.svg create mode 100644 src/static/images/empty.png create mode 100644 src/static/images/error.png create mode 100644 src/static/images/example-avatar1.png create mode 100644 src/static/images/honor-1.png create mode 100644 src/static/images/honor-2.png create mode 100644 src/static/images/honor-3.png create mode 100644 src/static/images/mescroll-empty.png create mode 100644 src/static/images/mescroll-totop.png create mode 100644 src/static/logo.png.back create mode 100644 src/uni.scss create mode 100644 src/uni_modules/lime-back-top/changelog.md create mode 100644 src/uni_modules/lime-back-top/components/l-back-top/index.scss create mode 100644 src/uni_modules/lime-back-top/components/l-back-top/l-back-top.vue create mode 100644 src/uni_modules/lime-back-top/components/l-back-top/props.ts create mode 100644 src/uni_modules/lime-back-top/components/l-back-top/type.ts create mode 100644 src/uni_modules/lime-back-top/components/lime-back-top/lime-back-top.vue create mode 100644 src/uni_modules/lime-back-top/package.json create mode 100644 src/uni_modules/lime-back-top/readme.md create mode 100644 src/uni_modules/lime-icon/changelog.md create mode 100644 src/uni_modules/lime-icon/components/l-icon/icon.scss create mode 100644 src/uni_modules/lime-icon/components/l-icon/icons.js create mode 100644 src/uni_modules/lime-icon/components/l-icon/index.scss create mode 100644 src/uni_modules/lime-icon/components/l-icon/l-icon.uvue create mode 100644 src/uni_modules/lime-icon/components/l-icon/l-icon.vue create mode 100644 src/uni_modules/lime-icon/components/l-icon/lIcon.ts create mode 100644 src/uni_modules/lime-icon/components/l-icon/props.ts create mode 100644 src/uni_modules/lime-icon/components/lime-icon/lime-icon.vue create mode 100644 src/uni_modules/lime-icon/generate-icons.js create mode 100644 src/uni_modules/lime-icon/lime.config.js create mode 100644 src/uni_modules/lime-icon/package.json create mode 100644 src/uni_modules/lime-icon/plugin.js create mode 100644 src/uni_modules/lime-icon/readme.md create mode 100644 src/uni_modules/lime-icon/utils/generate.js create mode 100644 src/uni_modules/lime-icon/utils/index.js create mode 100644 src/uni_modules/lime-painter/changelog.md create mode 100644 src/uni_modules/lime-painter/components/common/relation.js create mode 100644 src/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue create mode 100644 src/uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue create mode 100644 src/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue create mode 100644 src/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue create mode 100644 src/uni_modules/lime-painter/components/l-painter/l-painter.vue create mode 100644 src/uni_modules/lime-painter/components/l-painter/nvue.js create mode 100644 src/uni_modules/lime-painter/components/l-painter/painter.js create mode 100644 src/uni_modules/lime-painter/components/l-painter/props.js create mode 100644 src/uni_modules/lime-painter/components/l-painter/single.js create mode 100644 src/uni_modules/lime-painter/components/l-painter/utils.js create mode 100644 src/uni_modules/lime-painter/components/lime-painter/lime-painter.vue create mode 100644 src/uni_modules/lime-painter/hybrid/html/index.html create mode 100644 src/uni_modules/lime-painter/hybrid/html/painter.js create mode 100644 src/uni_modules/lime-painter/hybrid/html/uni.webview.1.5.3.js create mode 100644 src/uni_modules/lime-painter/package.json create mode 100644 src/uni_modules/lime-painter/parser.js create mode 100644 src/uni_modules/lime-painter/readme.md create mode 100644 src/uni_modules/lime-shared/addUnit/index.ts create mode 100644 src/uni_modules/lime-shared/arrayBufferToFile/index.ts create mode 100644 src/uni_modules/lime-shared/base64ToArrayBuffer/index.ts create mode 100644 src/uni_modules/lime-shared/base64ToPath/index.ts create mode 100644 src/uni_modules/lime-shared/camelCase/index.ts create mode 100644 src/uni_modules/lime-shared/canIUseCanvas2d/index.ts create mode 100644 src/uni_modules/lime-shared/changelog.md create mode 100644 src/uni_modules/lime-shared/clamp/index.ts create mode 100644 src/uni_modules/lime-shared/cloneDeep/index.ts create mode 100644 src/uni_modules/lime-shared/closest/index.ts create mode 100644 src/uni_modules/lime-shared/createAnimation/index.ts create mode 100644 src/uni_modules/lime-shared/createImage/index.ts create mode 100644 src/uni_modules/lime-shared/debounce/index.ts create mode 100644 src/uni_modules/lime-shared/exif/index.ts create mode 100644 src/uni_modules/lime-shared/fillZero/index.ts create mode 100644 src/uni_modules/lime-shared/floatAdd/index.ts create mode 100644 src/uni_modules/lime-shared/getClassStr/index.ts create mode 100644 src/uni_modules/lime-shared/getCurrentPage/index.ts create mode 100644 src/uni_modules/lime-shared/getLocalFilePath/index.ts create mode 100644 src/uni_modules/lime-shared/getRect/index.ts create mode 100644 src/uni_modules/lime-shared/getStyleStr/index.ts create mode 100644 src/uni_modules/lime-shared/hasOwn/index.ts create mode 100644 src/uni_modules/lime-shared/index.ts create mode 100644 src/uni_modules/lime-shared/isBase64/index.ts create mode 100644 src/uni_modules/lime-shared/isBrowser/index.ts create mode 100644 src/uni_modules/lime-shared/isDef/index.ts create mode 100644 src/uni_modules/lime-shared/isFunction/index.ts create mode 100644 src/uni_modules/lime-shared/isNumber/index.ts create mode 100644 src/uni_modules/lime-shared/isNumeric/index.ts create mode 100644 src/uni_modules/lime-shared/isObject/index.ts create mode 100644 src/uni_modules/lime-shared/isPromise/index.ts create mode 100644 src/uni_modules/lime-shared/isString/index.ts create mode 100644 src/uni_modules/lime-shared/kebabCase/index.ts create mode 100644 src/uni_modules/lime-shared/package.json create mode 100644 src/uni_modules/lime-shared/pathToBase64/index.ts create mode 100644 src/uni_modules/lime-shared/piexif/index.ts create mode 100644 src/uni_modules/lime-shared/platform/index.ts create mode 100644 src/uni_modules/lime-shared/raf/index.ts create mode 100644 src/uni_modules/lime-shared/random/index.ts create mode 100644 src/uni_modules/lime-shared/range/index.ts create mode 100644 src/uni_modules/lime-shared/readme.md create mode 100644 src/uni_modules/lime-shared/selectComponent/index.ts create mode 100644 src/uni_modules/lime-shared/sleep/index.ts create mode 100644 src/uni_modules/lime-shared/throttle/index.ts create mode 100644 src/uni_modules/lime-shared/toArray/index.ts create mode 100644 src/uni_modules/lime-shared/toNumber/index.ts create mode 100644 src/uni_modules/lime-shared/unitConvert/index.ts create mode 100644 src/uni_modules/lime-shared/useIntersectionObserver/index.ts create mode 100644 src/uni_modules/lime-shared/vue/index.ts create mode 100644 src/uni_modules/lime-signature/changelog.md create mode 100644 src/uni_modules/lime-signature/components/l-signature/context.js create mode 100644 src/uni_modules/lime-signature/components/l-signature/l-signature.uvue create mode 100644 src/uni_modules/lime-signature/components/l-signature/l-signature.vue create mode 100644 src/uni_modules/lime-signature/components/l-signature/props.js create mode 100644 src/uni_modules/lime-signature/components/l-signature/render.js create mode 100644 src/uni_modules/lime-signature/components/l-signature/signature.js create mode 100644 src/uni_modules/lime-signature/components/l-signature/signature.uts create mode 100644 src/uni_modules/lime-signature/components/l-signature/utils.js create mode 100644 src/uni_modules/lime-signature/components/lime-signature/lime-signature.uvue create mode 100644 src/uni_modules/lime-signature/components/lime-signature/lime-signature.vue create mode 100644 src/uni_modules/lime-signature/hybrid/html/index.html create mode 100644 src/uni_modules/lime-signature/hybrid/html/signature.js create mode 100644 src/uni_modules/lime-signature/hybrid/html/uni.webview.1.5.3.js create mode 100644 src/uni_modules/lime-signature/index.uts create mode 100644 src/uni_modules/lime-signature/package.json create mode 100644 src/uni_modules/lime-signature/readme.md create mode 100644 src/uni_modules/mescroll-uni/changelog.md create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-body/mescroll-body.css create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-body/mescroll-body.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/beibei/components/mescroll-down.css create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/beibei/components/mescroll-down.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/beibei/mescroll-body.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/beibei/mescroll-uni-option.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/beibei/mescroll-uni.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/xinlang/components/mescroll-down.css create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/xinlang/components/mescroll-down.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/xinlang/components/mescroll-up.css create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/xinlang/components/mescroll-up.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/xinlang/mescroll-body.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/xinlang/mescroll-uni-option.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-diy/xinlang/mescroll-uni.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-empty/mescroll-empty.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/components/mescroll-down.css create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/components/mescroll-down.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/components/mescroll-top.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/components/mescroll-up.css create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/components/mescroll-up.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-i18n.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-uni-option.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-uni.css create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-uni.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-uni.vue create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-comp.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-more-item.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-more.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/wxs/mixins.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/wxs/renderjs.js create mode 100644 src/uni_modules/mescroll-uni/components/mescroll-uni/wxs/wxs.wxs create mode 100644 src/uni_modules/mescroll-uni/hooks/useMescroll.js create mode 100644 src/uni_modules/mescroll-uni/hooks/useMescrollComp.js create mode 100644 src/uni_modules/mescroll-uni/hooks/useMescrollMore.js create mode 100644 src/uni_modules/mescroll-uni/package.json create mode 100644 src/uni_modules/mescroll-uni/readme.md create mode 100644 src/uni_modules/mp-html/README.md create mode 100644 src/uni_modules/mp-html/changelog.md create mode 100644 src/uni_modules/mp-html/components/mp-html/mp-html.vue create mode 100644 src/uni_modules/mp-html/components/mp-html/node/node.vue create mode 100644 src/uni_modules/mp-html/components/mp-html/parser.js create mode 100644 src/uni_modules/mp-html/package.json create mode 100644 src/uni_modules/mp-html/static/app-plus/mp-html/js/handler.js create mode 100644 src/uni_modules/mp-html/static/app-plus/mp-html/js/uni.webview.min.js create mode 100644 src/uni_modules/mp-html/static/app-plus/mp-html/local.html create mode 100644 src/utils/eventBus.js create mode 100644 src/utils/hooks/useAuthUser.js create mode 100644 src/utils/jump.js create mode 100644 src/utils/mixins/load_langkey.js create mode 100644 src/utils/mixins/mixin_common.js create mode 100644 src/utils/request/index.js create mode 100644 vite.config.js create mode 100644 yarn.lock diff --git a/.env b/.env new file mode 100644 index 0000000..e69de29 diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..8474bac --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +VITE_API_BASE_URL= https://guess.hmily.club \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..79e1c1d --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +VITE_API_BASE_URL= https://guess.mini.zlgj168.com \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3d511e3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist.zip +*.local + +# Editor directories and files +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? \ No newline at end of file diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..81f13f4 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,16 @@ +{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version": "0.0", + "configurations": [{ + "default" : + { + "launchtype" : "local" + }, + "mp-weixin" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..062a11a --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# 新疆圆梦竞彩 + +原型: https://modao.cc/proto/8TOOiUnsd0kabs4zw394j/sharing?view_mode=read_only + +开发环境 appid(插件世界): wx4839fe39d3a4ab80 + + +- 管理后台 +https://guess.hmily.club/admin/ +admin +admin + +- 测试小程序: wxec1c45c29335c420 +- 正式小程序: wxb9fb3011c9317eef +- 正式小程序2: wx49f828a7468772b8 +- apifox 接口文档: https://apifox.com/apidoc/shared-d3fd41c1-f0ad-47b1-a1ab-48f91ca3bc06 + +## 依赖说明 + +- node v16.20.2+ +- yarn 1.22.19+ + +## 开发说明 + +1. 安装依赖,并启动开发环境 +``` +yarn install +yarn dev:mp-weixin +``` + +2. 在小程序开发者工具中导入项目, 目录为 `项目目录/dist/dev/mp-weixin` + +3. 以下页面代码完全一样,需要同步更新 +- activites 和 quizRecord +- activeDetail 和 charts +- login 和 about \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..c018afc --- /dev/null +++ b/deploy.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -e + +DIR="/www/wwwroot/hetong-mobile/" +SERVER_IP="8.218.100.178," +SERVER_ENV="ansible_host_key_checking=false ansible_user=root" +if [ ! -z $SSH_PASSWORD ];then + SERVER_ENV="ansible_host_key_checking=false ansible_user=root ansible_ssh_pass=$SSH_PASSWORD" +fi + +# 构建静态文件并打包 +if [ ! -f dist.zip ]; then + # ./node_modules/.bin/vite build --config "./config/vite.config.prod.ts" + # zip -r dist.zip dist -x "*node_modules/*" -x "*vendor/*" + yarn build:h5 + zip -r dist.zip ./dist/ -x "*node_modules/*" -x "*vendor/*" +fi + +# 部署服务器 +time ansible all -i "${SERVER_IP}" -e "$SERVER_ENV" -m shell -a "chdir=/ mkdir -p ${DIR}" +time ansible all -i "${SERVER_IP}" -e "$SERVER_ENV" -m shell -a "chattr -i ${DIR}/.user.ini || true; rm -f ${DIR}/{.user.ini,index.html,404.html,.htaccess} || true" +time ansible all -i "${SERVER_IP}" -e "$SERVER_ENV" -m unarchive -a "src=./dist.zip dest=${DIR}" +time ansible all -i "${SERVER_IP}" -e "$SERVER_ENV" -m shell -a "chdir=${DIR} chown -R www:www ." + +if [[ -z $SSH_PASSWORD ]];then + # time cd aliyun-fc-demo/supply-demand-test/ && s deploy + time rm -rf ./dist/ ./dist.zip + echo "success"; +fi diff --git a/index.html b/index.html new file mode 100644 index 0000000..fb81ddc --- /dev/null +++ b/index.html @@ -0,0 +1,20 @@ + + + + + + + + + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..833102c --- /dev/null +++ b/package.json @@ -0,0 +1,76 @@ +{ + "name": "uni-preset-vue", + "version": "0.0.0", + "scripts": { + "dev:app": "uni -p app", + "dev:app-android": "uni -p app-android", + "dev:app-ios": "uni -p app-ios", + "dev:custom": "uni -p", + "dev:h5": "uni", + "dev:h5:ssr": "uni --ssr", + "dev:mp-alipay": "uni -p mp-alipay", + "dev:mp-baidu": "uni -p mp-baidu", + "dev:mp-jd": "uni -p mp-jd", + "dev:mp-kuaishou": "uni -p mp-kuaishou", + "dev:mp-lark": "uni -p mp-lark", + "dev:mp-qq": "uni -p mp-qq", + "dev:mp-toutiao": "uni -p mp-toutiao", + "dev:mp-weixin": "uni -p mp-weixin", + "dev:mp-xhs": "uni -p mp-xhs", + "dev:quickapp-webview": "uni -p quickapp-webview", + "dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei", + "dev:quickapp-webview-union": "uni -p quickapp-webview-union", + "build:app": "uni build -p app", + "build:app-android": "uni build -p app-android", + "build:app-ios": "uni build -p app-ios", + "build:custom": "uni build -p", + "build:h5": "uni build", + "build:h5:ssr": "uni build --ssr", + "build:mp-alipay": "uni build -p mp-alipay", + "build:mp-baidu": "uni build -p mp-baidu", + "build:mp-jd": "uni build -p mp-jd", + "build:mp-kuaishou": "uni build -p mp-kuaishou", + "build:mp-lark": "uni build -p mp-lark", + "build:mp-qq": "uni build -p mp-qq", + "build:mp-toutiao": "uni build -p mp-toutiao", + "build:mp-weixin": "uni build -p mp-weixin", + "build:mp-xhs": "uni build -p mp-xhs", + "build:quickapp-webview": "uni build -p quickapp-webview", + "build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei", + "build:quickapp-webview-union": "uni build -p quickapp-webview-union" + }, + "dependencies": { + "@dcloudio/uni-app": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-app-plus": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-components": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-h5": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-mp-alipay": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-mp-baidu": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-mp-jd": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-mp-lark": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-mp-qq": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-mp-weixin": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-mp-xhs": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4010520240507001", + "clipboard": "^2.0.11", + "dayjs": "^1.11.11", + "tiny-emitter": "^2.1.0", + "uview-plus": "^3.1.41", + "vue": "^3.4.21", + "vue-i18n": "^9.1.9", + "vue3-eventbus": "^2.0.0" + }, + "devDependencies": { + "@dcloudio/types": "^3.4.8", + "@dcloudio/uni-automator": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-cli-shared": "3.0.0-alpha-4010520240507001", + "@dcloudio/uni-stacktracey": "3.0.0-alpha-4010520240507001", + "@dcloudio/vite-plugin-uni": "3.0.0-alpha-4010520240507001", + "@vue/runtime-core": "^3.4.21", + "sass": "^1.69.7", + "sass-loader": "10", + "vite": "5.2.8" + } +} diff --git a/shims-uni.d.ts b/shims-uni.d.ts new file mode 100644 index 0000000..ed4adcf --- /dev/null +++ b/shims-uni.d.ts @@ -0,0 +1,10 @@ +/// +import 'vue' + +declare module '@vue/runtime-core' { + type Hooks = App.AppInstance & Page.PageInstance; + + interface ComponentCustomOptions extends Hooks { + + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..eaf7e22 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,291 @@ + + + \ No newline at end of file diff --git a/src/api/xinjiang_guess.js b/src/api/xinjiang_guess.js new file mode 100644 index 0000000..6715f4f --- /dev/null +++ b/src/api/xinjiang_guess.js @@ -0,0 +1,153 @@ +import useAuthUser from '@/utils/hooks/useAuthUser'; + +const http = uni.$u.http; + +// 全局 +// 获取配置信息 +export const getConfigByKey = (params, config = {}) => { + return http.get(`/api/miniprogram/config-info`, { params, ...config }); +} + +// 首页 +// 获取广告列表 +export const queryAds = (params, config = {}) => { + return http.get(`/api/miniprogram/ads`, { params, ...config }); +} +// 获取最新竞猜 +export const queryLatestgame = (params, config = {}) => { + return http.get(`/api/miniprogram/latest-game`, { params, ...config }); +} +// 获取推荐文章列表 +export const queryRecommendArticles = (params, config = {}) => { + return http.get(`/api/miniprogram/recommend-articles`, { params, ...config }); +} +// 参与竞猜 +export const submitGuess = (params, config = {}) => { + return http.post(`/api/miniprogram/games/${params.game}/join`, params, { ...config }); +} + +// 登录注册 +// code2Session +export const submitCode2Session = (params, config = {}) => { + return http.post(`/api/miniprogram/code-to-session`, params, { ...config }); +} +// 绑定手机号 +export const submitBindPhone = (params, config = {}) => { + return http.post(`/api/miniprogram/users/bind-phone`, params, { ...config, custom: { toast: false, catch: true } }); +} +// 刷新 token +export const submitRefreshToken = (params, config = {}) => { + return http.post(`/api/miniprogram/refresh-token`, params, { ...config }); +} + +// 活动(竞猜) +export const queryUserActivites = (params, config = {}) => { + return http.get(`/api/miniprogram/user-activities`, { params, ...config }); +} + +// 资讯 + +// 文章分类 +export const getCategories = (params, config = {}) => { + return http.get(`/api/miniprogram/categories`, { params, ...config }); +} +// 文章列表 +export const getArticlesList = (params, config = {}) => { + return http.get(`/api/miniprogram/articles`, { params, ...config }); +} +// 文章详情 +export const getArticlesDetail = (params, config = {}) => { + return http.get(`/api/miniprogram/articles/${params.id}`, { params, ...config }); +} + +// 活动列表 +export const queryAactivitiesList = (params, config = {}) => { + return http.get(`/api/miniprogram/activities`, { params, ...config }); +} + +// 最新活动详情 +export const queryLatestActivitiesDetail = (params, config = {}) => { + return http.get(`/api/miniprogram/activities/latest-rank-list`, { params, ...config }); +} + +// 活动详情 +export const queryActivitiesDetail = (params, config = {}) => { + return http.get(`/api/miniprogram/activities/${params.id}`, { params, ...config }); +} + +// 竞猜列表 +export const queryGamesList = (params, config = {}) => { + return http.get(`/api/miniprogram/games`, { params, ...config }); +} +// 排行榜 +export const queryRankList = (params, config = {}) => { + return http.get(`/api/miniprogram/activities/rank-list`, { params, ...config }); +} + +// 用户-竞猜记录 +export const queryUserActivitiesList = (params, config = {}) => { + return http.get('/api/miniprogram/user-activities', { params, ...config }); +} +// 用户-获奖记录 +export const queryUserGiftsList = (params, config = {}) => { + return http.get('/api/miniprogram/user-gifts', { params, ...config }); +} +// 用户-奖品详情 +export const queryUserGiftsDetail = (params, config = {}) => { + return http.get(`/api/miniprogram/user-gifts/${params.id}`, { params, ...config }); +} +// 用户-领取奖品 +export const submitUserGiftsReceive = (params, config = {}) => { + return http.post(`/api/miniprogram/user-gifts/${params.id}/receive`, params, { ...config }); +} +// 用户-上传头像 +export const submitUploadAvatar = (params, config = {}) => { + // return new Promise((resolve, reject) => { + // const headers = { + // accept: 'application/json', + // } + + // const authUser = useAuthUser(); + // if (authUser.api_token) { + // headers['authorization'] = `Bearer ${authUser.api_token}` + // } + + // let url = `${import.meta.env.VITE_API_BASE_URL}/api/miniprogram/upload-avatar`; + // uni.uploadFile({ + // url: url, + // filePath: params.filePath, + // name: params.nameField || 'file', // 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 + // formData: params.data || {}, + // header: headers, + // responseType: 'json', + // success(uploadFileRes) { + // let res = {} + // try { + // res = JSON.parse(uploadFileRes.data); + // resolve(res) + // } catch (e) { + // return reject(e); + // } + // }, + // fail(err) { + // console.log(`request ${url} fail:`); + // console.error(err); + + // uni.showToast({ + // icon: 'none', + // title: `请求服务失败: ${err.errMsg}`, + // }) + // reject(err); + // } + // }) + // }); + return http.upload(`/api/miniprogram/upload-avatar`, { + name: params.name || 'file', + ...params, + ...config, + }); +} +// 用户-更新个人资料 +export const submitUploadUserInfo = (params, config = {}) => { + return http.post(`/api/miniprogram/user/update-info`, params, { ...config }); +} \ No newline at end of file diff --git a/src/common/config.js b/src/common/config.js new file mode 100644 index 0000000..8cf1e49 --- /dev/null +++ b/src/common/config.js @@ -0,0 +1,7 @@ +export default { + baseUrl: import.meta.env.VITE_API_BASE_URL, + appInfo: { + title: '猜了个球', + version: "v1.0.0", + }, +} \ No newline at end of file diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..3baf644 --- /dev/null +++ b/src/main.js @@ -0,0 +1,30 @@ +import { createSSRApp } from "vue"; +import uviewPlus from "uview-plus"; + +import App from "./App.vue"; +import { initRequest } from "@/utils/request/index"; +import eventBus from "vue3-eventbus"; + +import dayjs from 'dayjs'; +import 'dayjs/locale/zh-cn'; + +dayjs.locale('zh-cn'); + +import mpShare from 'uview-plus/libs/mixin/mpShare' +import mixin_common, { goToPage } from '@/utils/mixins/mixin_common'; + +export function createApp() { + const app = createSSRApp(App); + app.use(eventBus); + app.use(uviewPlus); + + initRequest(app); + + app.mixin(mpShare); + app.mixin(mixin_common); + app.config.globalProperties.$goToPage = goToPage; + + return { + app, + }; +} diff --git a/src/manifest.json b/src/manifest.json new file mode 100644 index 0000000..eb964bc --- /dev/null +++ b/src/manifest.json @@ -0,0 +1,89 @@ +{ + "name" : "新疆圆梦竞彩", + "appid" : "wx49f828a7468772b8", + "description" : "", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : true, + /* 5+App特有相关 */ + "app-plus" : { + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + /* 模块配置 */ + "modules" : {}, + /* 应用发布信息 */ + "distribute" : { + /* android打包配置 */ + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios" : {}, + /* SDK配置 */ + "sdkConfigs" : {} + } + }, + /* 快应用特有相关 */ + "quickapp" : {}, + /* 小程序特有相关 */ + "mp-weixin" : { + "appid" : "wx49f828a7468772b8", + "setting" : { + "urlCheck": false, + "es6": true, + "postcss": false, + "minified": true, + "newFeature": true, + "bigPackageSizeSupport": true, + "optimization":{"subPackages":true}, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "lazyCodeLoading": "requiredComponents", + "usingComponents" : true + }, + "mp-alipay" : { + "usingComponents" : true + }, + "mp-baidu" : { + "usingComponents" : true + }, + "mp-toutiao" : { + "usingComponents" : true + }, + "uniStatistics" : { + "enable" : false + }, + "vueVersion" : "3", + "h5" : { + "router" : { + "mode" : "history" + } + } +} diff --git a/src/package.json b/src/package.json new file mode 100644 index 0000000..1bdfc50 --- /dev/null +++ b/src/package.json @@ -0,0 +1,16 @@ +{ + "id": "xlh-table", + "name": "App、小程序table表格、跨行表格", + "displayName": "App、小程序table表格、跨行表格", + "version": "1.0.0", + "description": "适用于各端的表格组件、跨行表格组件", + "keywords": [ + "Table、table、xlh-table" + ], + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ] + } +} \ No newline at end of file diff --git a/src/packages/pages/about/about.vue b/src/packages/pages/about/about.vue new file mode 100644 index 0000000..dd069bb --- /dev/null +++ b/src/packages/pages/about/about.vue @@ -0,0 +1,293 @@ + + + + + \ No newline at end of file diff --git a/src/packages/pages/activeDetail/activeDetail.vue b/src/packages/pages/activeDetail/activeDetail.vue new file mode 100644 index 0000000..55a7540 --- /dev/null +++ b/src/packages/pages/activeDetail/activeDetail.vue @@ -0,0 +1,1080 @@ + + + + + diff --git a/src/packages/pages/award/award.vue b/src/packages/pages/award/award.vue new file mode 100644 index 0000000..31d8260 --- /dev/null +++ b/src/packages/pages/award/award.vue @@ -0,0 +1,173 @@ + + + + + diff --git a/src/packages/pages/awardDetail/awardDetail.vue b/src/packages/pages/awardDetail/awardDetail.vue new file mode 100644 index 0000000..7864a3d --- /dev/null +++ b/src/packages/pages/awardDetail/awardDetail.vue @@ -0,0 +1,309 @@ + + + + + diff --git a/src/packages/pages/indexodd/index.vue b/src/packages/pages/indexodd/index.vue new file mode 100644 index 0000000..a382d44 --- /dev/null +++ b/src/packages/pages/indexodd/index.vue @@ -0,0 +1,334 @@ + + + + + \ No newline at end of file diff --git a/src/packages/pages/login/login.vue b/src/packages/pages/login/login.vue new file mode 100644 index 0000000..3beebce --- /dev/null +++ b/src/packages/pages/login/login.vue @@ -0,0 +1,293 @@ + + + + + \ No newline at end of file diff --git a/src/packages/pages/news/newDetail/newDetail.vue b/src/packages/pages/news/newDetail/newDetail.vue new file mode 100644 index 0000000..856f766 --- /dev/null +++ b/src/packages/pages/news/newDetail/newDetail.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/src/packages/pages/quizRecord/quizRecord.vue b/src/packages/pages/quizRecord/quizRecord.vue new file mode 100644 index 0000000..efd67b6 --- /dev/null +++ b/src/packages/pages/quizRecord/quizRecord.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/src/packages/pages/setting/setting.vue b/src/packages/pages/setting/setting.vue new file mode 100644 index 0000000..a2c8923 --- /dev/null +++ b/src/packages/pages/setting/setting.vue @@ -0,0 +1,163 @@ + + + + + \ No newline at end of file diff --git a/src/pages.json b/src/pages.json new file mode 100644 index 0000000..932b998 --- /dev/null +++ b/src/pages.json @@ -0,0 +1,146 @@ +{ + "easycom": { + "autoscan": true, + "custom": { + "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", + "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", + "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" + } + }, + "pages": [ + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "首页" + } + }, + { + "path": "pages/my/index", + "style": { + "navigationBarTitleText": "我的" + } + }, + { + "path": "pages/activities/activities", + "style": { + "navigationBarTitleText": "活动" + } + }, + { + "path": "pages/news/news", + "style": { + "navigationBarTitleText": "资讯" + } + }, + { + "path": "pages/charts/charts", + "style": { + "navigationBarTitleText": "排行榜" + } + }, + { + "path": "pages/webview/index", + "style": { + "navigationBarTitleText": "" + } + } + ], + "subPackages": [ + { + "root": "packages", + "pages": [ + { + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "登录" + } + }, + { + "path": "pages/setting/setting", + "style": { + "navigationBarTitleText": "设置" + } + }, + { + "path": "pages/activeDetail/activeDetail", + "style": { + "navigationBarTitleText": "活动详情" + } + }, + { + "path": "pages/quizRecord/quizRecord", + "style": { + "navigationBarTitleText": "竞猜记录" + } + }, + { + "path": "pages/news/newDetail/newDetail", + "style": { + "navigationBarTitleText": "资讯详情" + } + }, + { + "path": "pages/award/award", + "style": { + "navigationBarTitleText": "奖品记录" + } + }, + { + "path": "pages/awardDetail/awardDetail", + "style": { + "navigationBarTitleText": "奖品记录详情" + } + }, + { + "path": "pages/about/about", + "style": { + "navigationBarTitleText": "关于我们" + } + } + ] + } + ], + "globalStyle": { + "navigationBarTextStyle": "white", + "navigationBarTitleText": "uni-app", + "backgroundColor": "#f3f3f3", + "navigationBarBackgroundColor": "#1b2f85" + }, + "tabBar": { + "selectedColor": "#182c5f", + "iconWidth": "16px", + "height": "70px", + "list": [ + { + "text": "首页", + "pagePath": "pages/index/index", + "iconPath": "static/icons/home.png", + "selectedIconPath": "static/icons/home-1.png" + }, + { + "text": "竞猜", + "pagePath": "pages/activities/activities", + "iconPath": "static/icons/star.png", + "selectedIconPath": "static/icons/star-1.png" + }, + { + "text": "排行榜", + "pagePath": "pages/charts/charts", + "iconPath": "static/icons/charts.png", + "selectedIconPath": "static/icons/charts-1.png" + }, + { + "text": "资讯", + "pagePath": "pages/news/news", + "iconPath": "static/icons/earth.png", + "selectedIconPath": "static/icons/earth-1.png" + }, + { + "text": "我的", + "pagePath": "pages/my/index", + "iconPath": "static/icons/my.png", + "selectedIconPath": "static/icons/my-1.png" + } + ] + } +} diff --git a/src/pages/activities/activities.vue b/src/pages/activities/activities.vue new file mode 100644 index 0000000..efd67b6 --- /dev/null +++ b/src/pages/activities/activities.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/src/pages/charts/charts.vue b/src/pages/charts/charts.vue new file mode 100644 index 0000000..55a7540 --- /dev/null +++ b/src/pages/charts/charts.vue @@ -0,0 +1,1080 @@ + + + + + diff --git a/src/pages/charts/rules.vue b/src/pages/charts/rules.vue new file mode 100644 index 0000000..e175a3d --- /dev/null +++ b/src/pages/charts/rules.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue new file mode 100644 index 0000000..ffda6c4 --- /dev/null +++ b/src/pages/index/index.vue @@ -0,0 +1,713 @@ + + + + + diff --git a/src/pages/my/index.vue b/src/pages/my/index.vue new file mode 100644 index 0000000..50efdfb --- /dev/null +++ b/src/pages/my/index.vue @@ -0,0 +1,289 @@ + + + + + diff --git a/src/pages/news/news.vue b/src/pages/news/news.vue new file mode 100644 index 0000000..c1d6ccc --- /dev/null +++ b/src/pages/news/news.vue @@ -0,0 +1,199 @@ + + + + + diff --git a/src/pages/signature/signature.vue b/src/pages/signature/signature.vue new file mode 100644 index 0000000..8d17b36 --- /dev/null +++ b/src/pages/signature/signature.vue @@ -0,0 +1,61 @@ + + + + + \ No newline at end of file diff --git a/src/pages/webview/index.vue b/src/pages/webview/index.vue new file mode 100644 index 0000000..bfa3887 --- /dev/null +++ b/src/pages/webview/index.vue @@ -0,0 +1,20 @@ + + + diff --git a/src/shime-uni.d.ts b/src/shime-uni.d.ts new file mode 100644 index 0000000..b3d3cc9 --- /dev/null +++ b/src/shime-uni.d.ts @@ -0,0 +1,6 @@ +export {}; + +declare module "vue" { + type Hooks = App.AppInstance & Page.PageInstance; + interface ComponentCustomOptions extends Hooks {} +} \ No newline at end of file diff --git a/src/static/icons/arrow.svg b/src/static/icons/arrow.svg new file mode 100644 index 0000000..eff9647 --- /dev/null +++ b/src/static/icons/arrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/static/icons/charts-1.png b/src/static/icons/charts-1.png new file mode 100644 index 0000000000000000000000000000000000000000..18ac6c5d0eddcde8e37514be3c70dc4976a58c20 GIT binary patch literal 1523 zcmVy|%3Q(g0>}<)iP|#2K_X}D+xKFR#=dSqp5O}m84i!Pr5iL1kNIy~m3JDZ0 zn^~zT)W>2Y=rf=aD1$m#05eD7*>MrJw`53$sYXx+l|UI(0%b7cgQS%1u!s0YWKWNw zaf`RZPD7q#HVP?l*679u(}!cuRBp+=fuMIqmklfIq=O;RLAUF-CkJ9CHWYNRbZe?| zaUsar^nsW_Fqu87Xik5qoOA{;fdr=rDq4|`6k$9*>)j21jK}?`}o!S~l?GF3MJ3kQy zz4%lKrN<=gDI;0(C}1%p*0;?M->TivEcEyxox3n32`11%ZX?)EaDpGLnXp`dX5pLyV;N znBtFUMUV~IhGgIrUpIIpoD=E@M8Vymcxjlxjk}vf49E8YFXv~V?K+^v!p5~aK zU5njyqrmWr7GUsy`HS9uT`xc?FfCOeIU#kiT3d^zc8~Jj(fvc0$*%)Mo#&JTgarFkKHueOjNteDzT+Q^LmMq~Xa3kJqw#S_^9|*ipo3)4WefIs zaKg9qwB^Mp5`(SIoPC=+AB2%~3BR<9e_K2>v)aQkeorL8Z9u!a>3d!Zr(F4$8IsnCH}L>xWQoRRl#h~{)0aiXVG3=any|6qa-!`AQg5Vs z<*vK*@$cX_G6;)<0PjR~jvX;ZPb>H*D4aqzB2W+n|2|)L|HHrEC>scBniMHb90nu$ z^!|hYD;dCOfe+@yA$>EYiHG2`m8@RQ%h(}bq}~IOG2)xoWC){WA3Xf)WYRkUFB)$l ztp&fGGrGKG8Vz|O zEEE{IxWMsOCnZ&30wdFW8V?VFxADxq3LW~A$WR)D(-eLB_U=#rhAdO+J|6Z>gBqRS zru%vQQ#4{iB=9hecS_0|Njy)xKh8)3ugeF-xdQ;I;*du3#H^FtZgO2)d0@uJkUIEEZw&FhF$ox5#2OWdZQlt|%@8G2Gm>z1BeYlDsHmu@sHj*y ZJ^{XM{b#ed(T)HB002ovPDHLkV1gM(&LjW; literal 0 HcmV?d00001 diff --git a/src/static/icons/charts.png b/src/static/icons/charts.png new file mode 100644 index 0000000000000000000000000000000000000000..2b392ebc777bf445b51986aa3827c2da7832e49b GIT binary patch literal 1460 zcmV;l1xxygP)E&mo)E2;gt`Sd{cSKU8MS_OS65Y+02~g7MHmz$2yRYVu!Lu#*Sl(`pT*GgW&_{f zA4OXi1bXx4-#sBFA7JJ?ti{e+f}LbJ3qz(8)S&k2)zjPiwuLEHseB7yJDfjT>{cq1 z(`dtjKvJ?j_{otHyy$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ev/null +++ b/src/static/icons/customer-service.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/static/icons/earth-1.png b/src/static/icons/earth-1.png new file mode 100644 index 0000000000000000000000000000000000000000..44d2f1dcb85aadb5055ca69f87a0508188fcf315 GIT binary patch literal 2943 zcmV-_3xM>AP)@AvfRa$sqRwQ z?$UX!pNmr+<-0<2BC+?qC8z_zeTxMI>Kc7B91_4{vHN!4{{x9`aDy965sI!EF)+BG zCVoC5L$Og5D?<@R5|1@Bq;ai>YZ})yjt^(>txxqkx<*_Jf#RjOIWY7`Jgr4cjH^N8 z(?vh8j=$FjG-XVUK)h3upK0ARXsZUINYMCnXXa=}12hHHPN0;9p5bSUt{0tY5UMr; zfi6)3!WhDi`E5}vp=PKCEPolV8bfdJvq`@_R!l;xiwn`&=O24l7U)+Z5bv6WThZUJ z4|j1mPgjS=XZ!e6uig87w4Xo_s|LLS@&B(Bo%16D`(c^KM2gVQe|o*%IaNeu7Gqh{ zzo3`sV1??(E{L@4cxD9owu(`&L-02#3>qx=v?|M0B2aukUKtR*r0^9j4VBRL(f{=jcSY$v2)0OPrX(P?|`yp$#*G z5hnx{{{pMtE?V_0cn35L?HR`;p^a7o#uHOGq6S0*ZVhI)Mo6PnIC=-et9^2+x5^NQ zadM)&u(r3!J-S75kEaT8E^lY$!gC5~97LdGXc@fyJGJ%; zQOIJ;_v4n=ItFo$k9CJi!mePSR+5CCfR$RVHjq#6^XF32B9{8i$}NnYzxITtTQG1B ziyU6BkS@2kv zO`04jw$iyeArid&5DUW#90ORY{eCv6w&lhz!ygaNvO`@h2Z2;V(? ze{3jvr_=r*k9HxCHeHWSWs%OGcWN;oMP~*RTVF)dFN_UocxU98| ztA7vyHq`UwVMzCqeNE;Y=XnQe{M?xVt6@y*F6$lVTli|{&r52)DV*={YEd|zxK3ii z@8Iligqr-4J7OaV3LjJ0MU2lLH0W1JgI*|yJTt?c)y|)vkU`7K@hS=YUS{{OO2u*Y_1}JQ-5?1>A5u-W zM>PPG?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-1.png b/src/static/icons/home-1.png new file mode 100644 index 0000000000000000000000000000000000000000..2b3239743e1102681dab14b674a70124c0ae3dee GIT binary patch literal 965 zcmV;$13LVPP)m!wDoD`u25^FgWp{9brYC^z*cDDty6O_TW7jUbOIUUVy}`636-$?H zDj;^>K&q-$@O#1bOd`Eciex#CJ^tkP+cTa3ilQirGOa|I0E{t7c8RS##`evM9EUTr z*t6EA2uyH6B*$D|;R7{f^}nwyNm?gK76FM75YsTN!8J}s$hrA?aD|TB1_7BtAXXY? zE6Z_2iw_GnOLCx{%q95oGd)HCybE%9GxsQYM~ge+A4O;_%qPj>p`Rz89+=)9DYND3A*iGJK=tRsFkO8lHeY-R2&g9lzT%@1o7ZR#IvFDr1s&FM#JnzIk@hJrM7KS+fE@wEXdh+olUMkiI*)9S=l3H<&1E%CsDz~T7 zaub(Wc7=^XIWBLmu@*{>!yTJ4kL&CvbS`ZOk!Mg;SXQ;?jTBKX6`#vLJV1F4&-(Ty zCWvAAY&VyU6Y&BiDE%Z&x$_kh3boCmBthS5Oam&2K?O0WAO;o0pn@1w5Q7S0P(chT zh@pzUm>4&HofVHIv(Q-c>DhPt5uWfSsJUbg=$(2SWudVQ>V$ghAbTmXX47m4hG@s3 z?Q4dI7eO=>T4u`2NXnL~6b)$x6~y56E;fQL4Qds>)XQ@`gQs#DMNmOb&bOZ3E!u|O z-tLm576PFq#-M^2R1kv-Vo*U0Du_V^F{mI06~v%|7*r603StmX!5elOz5E5KZm5&I z$90nbpjQxs3Sy88$`Sle{*^JtxrhbDvp96qd@<#?bBG5JzgH6rauXxt9P4xd@g(et nBSP1m!z9ecRTM>0l=}G%RoI3s6w$8%00000NkvXXu0mjfjx(pR literal 0 HcmV?d00001 diff --git a/src/static/icons/home.png b/src/static/icons/home.png new file mode 100644 index 0000000000000000000000000000000000000000..d15a59c9bbf446ca0c3bc93faeca5b00e8358ec2 GIT binary patch literal 903 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!oCO|{#S9FJ79h;%I?XTvD9BhG zy1yb&sr!scGx&R?dxC9GE^Q%^xjN~x*n)s5`5{u6~)3htL!%(?HA7Z$|l3eZ;aL)5~WHJ1lmf4fF zL;g-&#VyveOM|?7W}AE6+!?g1G~8;Ph`CetzQ;~af--G0=9;fxHbo};;p(9J_fNZS zU;Fj#MAYx25>!wA+2ntUbE0`n#mhOoA=} z2O@gTSN*$nMUmYiYQFl(kLDaM29Dw3lSP*M+^U=}{2)bU-?gtVzI=(Dz*sav=y2dy z&ud>D>O!oqaP=!R6@<)9KY4m_#@zKGH=i>e?B-D7s1mQ{IQQ-DgDWre>!rW4EiZX3 z(7B>%j?5nEuQjAlKdxzss$F!leRwi=5w~*qYOlk(-& + + + + + diff --git a/src/static/icons/my-1.png b/src/static/icons/my-1.png new file mode 100644 index 0000000000000000000000000000000000000000..7ece2dc70121647d31da7e51c6db5d69f776cf25 GIT binary patch literal 1699 zcmV;U23+}xP)Cz#0NdHK6ZZ`qrhtuTTH>4lyAr7l?)NFR&T7XkQDGjOPT{cR#{`N1#G#sF0?iho2OGVf*NOd|&yDeGcohi0Lkw74 za&7}Cpk_hC3w#GzoUVHhD@o!o-anql`|>fuE_HthH7ioHAnIO!z#ENF4jtV6IKcZ4T-ZiJ8FE-5sJQ8^S)5s0GRmbD?k5qBBnBkDjJkX}5HnLk#jF&5fmIYZSpm@ z2cEuY<*ii&3a16Y3!&Kz=|;1N#QP3oG6SU00hCa4^JGQ4k`>VtZ;~|}r}1jsC3#;y zM))ny9bz9!sIF>IHnB|+?(^840vfLz9C4IA4kV*oQj5Owpx#0}8VR?(Wv133vC5Ju%29Appmsc|;FcwuJ&~?$26HXgiC`N}a`iK@E534Aq zQWYqiXa?9qaZw~XH3vIhPtWzM2vmVEx8bh%Od}^$szA{!d=J$LbDMoyqu(jB>y;Ks zNA-ul(AUS99L=)p7z3mfOyi$BctTTFG-A zxddt~nB%x^6(-U_rd>j@LK;%kF^;=i=Hji)s~TL^n=s}age7(riNlQR7~|@XqLq{+ zOM8b*Zl3!+{rO31r}1WoJV$#l7`#En@Hr`K`I1t*bQxkCwp#zBes=cX;CG}XwLm=X zP>jJrpfwA~;{4UCE)^<4B6VU#as2wYYqDW&!u>wWa7cE;G1ztOt z0uoAbT1jO%u>#R7-CoVb1xtz*6=f4=MM*Eh#0o@KvL&smpot tT8~NfH(W&7>w7<7%6VV!YsQQz<$qwKf6{g;$btX>002ovPDHLkV1hWK2o(ST literal 0 HcmV?d00001 diff --git a/src/static/icons/my.png b/src/static/icons/my.png new file mode 100644 index 0000000000000000000000000000000000000000..bda34e7ab573c93b122d44bfe16e2932540eba6c GIT binary patch literal 1626 zcmV-g2BrClP)Hc0r&KS|KEn;+6BxA?*fg5*-a9)2R{VKB9>D0@b7sTevH8*UImJxzfqXv5Zr}% zNsJbE)NZf$z!TmCilXZ;NdkLN0aD82F#K~LJm5v3Zucg_C*OifQ9ZPz5SWp`3|UU~ z;t-;RF8c+TVHF51rHi7V|w+v0O5KkZSJaOtv=fG&1*CBS(^;Pw-2y}LKy#WU6!LjB;5qF?- z$R!QU%g@iWDz6?EfuvMT-Ej;jF3YTh$tBZ4{WY~(vH=V*xtLhd9u-OHmtuFzyQ}EtsOAK@Q>00SzL5}2I-#(E`hYO6fOFoB&VlW zjXd9378ZeUQ5WluV`$KXlGJLlq5n=O?Y=s=Ea+BuPzbRFrBR;@#~*+J7J-ICsh!So zrfGIMH%%zW*hRJL9TdM046q1PuRoHxYsUm!L`Frz0y<|LwCaet^42T@rJ;m6F*FBC zz5A9&Bj@3x`w)>RrX{dndX3?iL>Drja&B9RmhpdXU|EWon0N{0J;kd;C|Z4_V)UG zW)!Ev^hXcZDHTldKS0Ym-`-wp0W)4g4Z0C}+E5XxN_-_ED^ib4XLg3!`}MmR9Ao z@boRrf&~k_Fr)gQB@7>EfEFv5$Zud6L1RzwqATv7L5yP)#dQx-%07VqvB--+lcK4# zk}NB9utVEE_!$_QhzlRZRICC~poyX!loiDUiG^Xz5en4@CRhaG7DfZ^-@`sfPN-6W zXc36QL>`5Cf#{)7M^(CBWuZn|f2i(eCk~-nly&TOuUb$Mr7dVYD;?ylKg5|xP#)+3 z1&wPpfq9_E!SoE3h9nT+O1nX;Y#eWBYdLWJf~x8mO9?bdg<7(G(~RONy!5_HU678` z(|;OLKJU4TMKwi2$jve?S6Cp2%C8A5fhLvrp#>f|e1Dvl+!Pb3kU*~DV4oxI2)xs| zIz#~uGP;eb)QVh3A%VVry}HYAt9Ur9Z+`wge*s_UTb>|(givCJ6q;;o27(6x}O8=9ACwGWOs354U$hUIkv^#6a^-(M)P;uho>(fSoB2Mdn}`cYMF#mWOmERY$ruS1ZaC zh|(5@ruZ$5J0@&J6fRa|6(~(#n4)w2lX+{{N^$7kvdVC*0-+0S7@A_AuSJ%{W<^;q z!dL~usM$~t$W!jdh0TgEWoxa_Hwu)dGW6~xWv#M81YaZx?TWl6%grnnWPE!juA*Yz zH{%?XVL7tYG@WM@$XwGrU+y&x4jGra}_lfm*$_i7Oc)zj@Rp@3ZQ06x;gL~yw@Uwv|gaM99m@aXo?vF(;5G( z*P)68)i!|!j>qPWT=!)W==I7I16Q_^e}Ck=FKfzmTm(LGJid5GR!_*w63!GbyD YKZYCAQuuHosQ>@~07*qoM6N<$g4Of \ No newline at end of file diff --git a/src/static/icons/record.svg b/src/static/icons/record.svg new file mode 100644 index 0000000..66bd8e6 --- /dev/null +++ b/src/static/icons/record.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/static/icons/setting.svg b/src/static/icons/setting.svg new file mode 100644 index 0000000..fc6cd57 --- /dev/null +++ b/src/static/icons/setting.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/static/icons/star-1.png b/src/static/icons/star-1.png new file mode 100644 index 0000000000000000000000000000000000000000..388f586787c12d4d5de45716176d4c26a9a3328d GIT binary patch literal 1784 zcmV>hAN)RNsWy2G=fe$Ba8jOL1hX=QZl3}3&@PK!7d7UovgaR^H*P!CrTq|mGsP^S*8?~DM7I% zqf99(g`o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oEA;nr?(Cfqjfjr3rVBq_>%$GbEc6Mh=ZpN6p%``Olwkhq%d=m2@yM_Vhl>rPlA? za#M>*n+z$`<~OMRzH*g3 z7%0HsXzrnLMX&cXQra&uZi|D(*)p?11KLYW*Mku;Ucr(or+k2A;VXRpRqcl??3;KD z`pYa08}zH_BF^dvB0yzsBEzrd&My%Qdl=x-d5A+4+8c>l^*x#P5+fIn@?N=)3X(1{ z?>L@|d#FfHWBEj#&@nyHNi+i0;}{c;P1}=c6C~Rxn&$Tvf;?h4)&DmY{ewkBU0&XP z!rC2XEf>#9lPAMIVRdZ!OH9kloS)y+ad2M+O|;v8AG`>NQLNgAfMI$Uy7L|?D^I3n zgYf2-=z8G6s47DFVXBOzM-G9b?cxvAw|9O??loQ4-2@G25hPpVbXdVZO7jp=cA4u7 zM)Xqyd`2ZC8)D&=D9(+Eq+cyNq-ld>UV;V=abc4I{_tVJ01y3xTyzx0itd6YL7WzH zUBdzmXb~jyU@1MbtwWr$Ek*=p#F*xDFK)C<_i~&!M`-gX zb7_Ghbh4Tn3KDNILhwRNtEDzr|I2mIt_`PC-U&^12F$q6J%yi1SS^qjP zAPNK4o@uhM(_=OygjOVt(JR%x_Fg*6i5U5KL>|w$Znb{jhlEI@F1AMjBgPw}qKH{W i8OOB78f&bP1pfgCCct8zqLfSk0000 + + + + + + + + + + + + + + diff --git a/src/static/images/active-processing.svg b/src/static/images/active-processing.svg new file mode 100644 index 0000000..3edc2b4 --- /dev/null +++ b/src/static/images/active-processing.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/static/images/empty.png b/src/static/images/empty.png new file mode 100644 index 0000000000000000000000000000000000000000..674f01cbe643ad710fead5997b02b7a0d354186f GIT binary patch literal 4725 zcmZu!c{r49`yP_4S+W+9C1p?HRnm~HEZO&^>`O|vdb5FeiH)wOH%^4J7Vqtx1agD`djl+iGdATyYYSPJ`wK-u{XMXeBM-Oy#o z`^LWZu-xLy`}nN=2L$Q%#SaHAuK8h2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BXUeKby~W=bmLaCOZwk^FvrV9Z3|jnAZw9mH61UG2pUng}H~V z8T{q+r!$1xza!x{!CRI(Se!>l&$D$?F=K;EA|^4{n%?`27bUqvOr9D6QoHp2c)K5~ z5M+4LX2%JhXN0a~V2on|Z@Zk(gSmcR0Q{gMo@EPX#1wT!VBjstO!9n2&LiI)F5>Uk=ZdgDpE$RLEWzsXFmcg%fn%evF zN}y01hU}!pYDJj(>T3g$Jl-yS><5#WlK1Jj_=lESW(sd(lrqx_jiFU%i8(%^JY1Z~ wKzZT+xa=TL%ZUEnmhvzU=cOh7bA!4pK_2h#w4b(i`HSB$vo)AKeg6hH}Sm;L0@WZZ=C-7a{BkL5%cfA%ddaO zuDSmAQ>jhgenU3t!NFVoAuMa>xeYJkzegr z*b!WW4MhnA!Nrl;Spq>aL5lR05ZuU6v)RqfsJ(n7mQ?j zDzCuHrNG+dP{gIk%caN)A-kN5fXGYu(Dc8xSF7%d%RiEF@?v~61&!qWwB6z1uUfr; z4RsrPxCL|`v!yg%YG?>*Xh0$-1T{>!)PS38o-oPTOT=l;Bxe+KsR<|!6~V<8axCg{ zaDq4%Oh!$~ZxGRlXMHr~{^{SU0!wYyMsq3pF}i5BSg;B#WGHfGbkS&t3FJGX*$@*9 oBJTvjNaiQomYc$3{NZo@BT+NzwU#Q|0Fx7gr>mdKI;Vst05hBoqyPW_ literal 0 HcmV?d00001 diff --git a/src/static/images/example-avatar1.png b/src/static/images/example-avatar1.png new file mode 100644 index 0000000000000000000000000000000000000000..2d6e25562cc2936827e78ef74afc9d00c1cf7034 GIT binary patch literal 2779 zcmV<13MBQ3P)iJQ^X8N>6ul zrm~KJR~jc-ASW3Q6jK``c}PGW5+x`H9g2RH@}I?SB~i6{Q($17e_K?sx$Dom4AuQLcn#QA+6$lB}uAaM=hPsY^z?zF55)<06 zq0_3Fw2_2d8z?#>B3ct%dDi(q?F5}lis6@ zua1Ho4h_+)oW+@mx{-opIxa036(kW4+P0|CuAriXd5Tg&SUx{qCqH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IDthVP-#p!3+ipBP_&tkGVkgjTQ{u+ zg)NqrmReUaM>ndV*MJCQK zD5$ntxFQ)z3da&ySS*deXJ$zOZ(KP=clzXMT@T2Nr$qs2t2bp@686OA+qduAXKOO6 zT>!R}Nu^;y;Cvha2L+zCwK?;&ZY+3k9l;U-TdG_3>}t`Svf8*fqAZ3iWnn=9`~-wh zoRkbe%gXfH=6HQ4$iOaJI~Elcbxg@mjJ>nJnFQl`OPJm?mV_w*1vrx+h0>*bI<$;;_qPO~zG)h2S6V+6Q5?lgEu*Q5OH zW}ATLt&~s+EON+FC6$U*g|O+OaypSsf|XUo#SM1Mc=yV^mG18Dm4`R@`!{Q$#VV$R zz^6%gJOUq!mEhR0P#csi@wSFd592(hKs15lfuxZiuOt zlgzikzXAeqcU6)QC_tuj%hhJ0$;#zGzYk+H8eNA*hpywt+jr(Jh2j95AcW^F0GKkO ziEas17sG5;ID9VT8{G>Ej7R0CltP2uWI2fok&%fZP@W(QkaAp_xT4}>8<)hM@Y4fy zv|evKwX?*a)mpZbiBJ+iEXDy+fK3eLTAOfIE*aJp@)MofuCztS<%|7WxoT*Zlt=_Z za3m62Mx>WpIkK##++M#uio>p4X~TmjQLPTm;*dBb5g8z5v1Otr5iB=%(x5*)yTjVr zuIO~~>NBDkQcMh8LRu$^CMtP!342%;a5|JGp5us`qm#^*r zUZiJui&()h!8jZjm`f-zi%b^LhjwiT`8z`f_Yfz-U@jmq5tL0QP6Olrq3@vC(}!~D hCfJmjT_^mW{shyP82&HWIhOzc002ovPDHLkV1kcUGw%QZ literal 0 HcmV?d00001 diff --git a/src/static/images/honor-1.png b/src/static/images/honor-1.png new file mode 100644 index 0000000000000000000000000000000000000000..1fc6ccc6f4f51eea768e4216902934d2f76db7f0 GIT binary patch literal 2073 zcmV+!2RP)L@8=et_--hJl1O8DY& z^W=oy%XIYHY3RaE@6Bw#i9qw&Yv96T-Kt{TziRlDiF^-(bg>Fy_E;_0L|qhbzN`H{;Ze&YVE`<$2%4Y3j*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sj85tfmJf5h;!CsPa!BNNq#8OpM=$Zo$Pn?)t_cJ(v>k>N`cOO&eElXj*UW1JDr2zxBC!rc%zSgIW!gTZ02m@tjR3U>KGUpY-WK!!5Yt3x*5T)`8u zxXhUlO~ubkPMvO|UVGo6pdJL;!C@{bTD=T%V;ttR5e(@Ejgy<+d-qhF_YhYkD ztMPT_HfWOhIkgAA?brw_?sCY@>M87Rc1nn);PD2=IEfNLIr#Wihb8h>Xi3{7CyDku(qyp zjt&nqiE^+EcU5V73`3nImM5|BjDiGZ#`uci$y1BX0-Q9hj2neO6y5P5fZ16dZxBpnpOVvFn92e* zhXpW|Yeh~j@C=oAMM>%ku#~Bdj!Czs!crEcA(PSeyz%H! z+HpfFt))edb=Dt0nx@8boioSPKFogh=+Wc#!T<9a7f7tIc6qbn00000NkvXXu0mjf DFll*m literal 0 HcmV?d00001 diff --git a/src/static/images/honor-2.png b/src/static/images/honor-2.png new file mode 100644 index 0000000000000000000000000000000000000000..95b913ef9a4c37a02d9989fecc2894bcfe3333d3 GIT binary patch literal 2031 zcmVEG0008+P)t-s0002P zzs2I==*-B`gnV(oxwO&ByqJ`XpO%i=!j##=p4`~m&&<%=%cb-3@05dd;o#%h*4E(C zsNUPwihzBvn|asO*s-m!-`?b%jD6hO;N05X%DSiU=*!g7*YD-V=j7vtd3M*vyw1$e z)6T_+eR-vreAmRX*3;IOjf%&-r`p)w)xMsaifq`%jMu`Kt*4C6%gEKosjjN4abZ`F zh<(@9-Edu3tDKF8e0<>6z~I@?s+fnktCgmhhThP$qM4Squd%wfztqL7>f*rN%do(% znAz6K$iueA!o}#^$n4;_;NRuU$H>FM#oo`Dd2DLr)1%MK(8xq3779 zk%@-e+2G2(j9~r=hH* zo~WOhrS$Xl^6~T8*4xp}*8Kea_VxDZ=~aS%)Yt9x3t2$w!y5Y zv8bc5_xAYk@A22w;oI5V+t=0B($dq<(!005uc@}Hrmm`^s+5kI=H%$s(%Qbd%CxV# zv8=V3lATseOF%0q{{H^)@%G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bH$NNOSTv>t}~y!R0k41UQ6bHm?2Vk_IRKf@)XQ)GS{N)*;ZoM%`?7uM$OXlq75t0SsEZVksPmXsuZ+yHb^C}}?0CGnEaEq#Y>y>$s655GxeC>RVK zy7k5)7`t`r7Z~eofIt9ccHem8O+k}1C`}!AC}d3Wv2i_KRtzxw+IqbO)#nugK7;F(8GUt2#ooV;Wh03IY({atg{|Ma#{;4iX@q`!B)`Y~8}hrPdCi zZ7w%+a@o&NQ^qB{ip>rZ!T&4|nFM_xn!9(nn=9TdNh!{}Fm&I{5#QdmgO$6!wRx8H zwfIApEew%d{KI$mUJT%W%*YIXMcW|4SszE1;1jvw)ygwNGMY9(fAr?104424@v%h z6$QVH|DQQ&S^(ofEZmhzh@zxAh*wIV3o3WKnW(FUdp^e++@y__?Pi|py7=%d}4%@*xG_b%C;;4U8!8-tR5m`#FA4&-vaHzkNIz-~`J@^4srQfb-)V;(7A-pHukjMwu!% z{`GTvm{QW%_?$w36MwQi@AuQdal{f2RTjLorO6kQ0PEZ@wrqzNxA|n7^xzNYECDUB z^n}*Wd+E)9nga$#f+UWelcW4E&icG}W z7m;(~2&va~6Ol6C011&?cIc#H;^CiovMx$;YE{@Ka;SZ$Q(T|WUH_}XwxP10ko4EW zI71HRyk0I@Bds;#10i-Tj8jxXa$YY(3HzAF)JtJh>NYBD0D2h#RaPbA1|+g8x^_t?Va=sg;B@ zwbRPwP&w@L6OQEb`P5D~b-U=Ii!Qq8qKhuN=wbumKVgr)%>l(DqW}N^07*qoM6N<$ Eg5kbG`v3p{ literal 0 HcmV?d00001 diff --git a/src/static/images/mescroll-totop.png b/src/static/images/mescroll-totop.png new file mode 100644 index 0000000000000000000000000000000000000000..62534c4d4ff98408d36ffcf9e5c41b7534c9f614 GIT binary patch literal 288 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xZ3?!EyURMI7)B}7%T!D03Tiem2M}PhLm6w;d zYSpTlGiN?{@ZiRc8#{LF(9_ck3JUuF|39byirqk^JS9PX!M;_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v=N}{+PQWx zHF2LIb9qiO+DI~r+eb9ubK7oh6KFdUL6e;9wKv_RvXh$HuqHw)inh2kQGM>}%G4V% zmjkEYsw}?{m%gW>#P7wTXwk}cZO--qydYul`!3w~l(JgX@=yG7|6z{6kO^>c^P;zI zAmO}-iEA~6%U7@PbJN4EXW!v;|5owjl2$w4ZZqafWPCshmRxS}7Zwlg(*rDz;hg}s SYs}WS&%*SCNx89m_ + + + + + + + + + {{text}} + + + + + + + + \ No newline at end of file diff --git a/src/uni_modules/lime-back-top/components/l-back-top/props.ts b/src/uni_modules/lime-back-top/components/l-back-top/props.ts new file mode 100644 index 0000000..850b09b --- /dev/null +++ b/src/uni_modules/lime-back-top/components/l-back-top/props.ts @@ -0,0 +1,51 @@ +// @ts-nocheck +// import {BackTopProps} from './type' +export const ariaProps = { + ariaHidden: Boolean, + ariaRole: String, + ariaLabel: String, + ariaLabelledby: String, + ariaDescribedby: String, + ariaBusy: Boolean, + lStyle: String +} +export default { + // value: { + // type: Number, + // default: 0 + // }, + fixed: { + type: Boolean, + default: true + }, + icon: { + type: [String, Boolean], + default: 'bx:arrow-to-top' + }, + text: String, + bottom: { + type: [Number, String], + // default: 66, + }, + right: { + type: [Number, String], + // default: 16, + }, + duration: { + type: Number, + default: 100, + }, + offset: { + type: Number, + default: 200 + }, + target: String, + shape: { + type: String, + default: 'circle' // square + }, + // scrollView: Boolean, + ...ariaProps + // square: Boolean, + // plain: Boolean as propType, +} \ No newline at end of file diff --git a/src/uni_modules/lime-back-top/components/l-back-top/type.ts b/src/uni_modules/lime-back-top/components/l-back-top/type.ts new file mode 100644 index 0000000..1c14cf6 --- /dev/null +++ b/src/uni_modules/lime-back-top/components/l-back-top/type.ts @@ -0,0 +1,54 @@ +// @ts-nocheck +export interface BackTopProps { + /** + * 滚动到指定对象 + */ + target?: string; + /** + * 是否绝对定位固定到屏幕右下方 + * @default true + */ + fixed?: boolean; + /** + * 图标 + * @default 'bx:arrow-to-top' + */ + icon?: string; + /** + * 文案 + * @default '' + */ + text?: string; + /** + * 预设的样式类型 + * @default '' + */ + type?: 'primary' | 'success' | 'warning' | 'danger' | 'default'; + /** + * 页面垂直滚动多高后出现 + * @default 0 + */ + offset?: number + /** + * 距离页面右侧距离 + * @default 16 + */ + right?: number|string + /** + * 距离页面底部距离 + * @default 66 + */ + bottom?: number|string + /** + * 圆形 + */ + round?: boolean + /** + * 方形 + */ + square?: boolean + /** + * 朴素 + */ + plain?: boolean +} diff --git a/src/uni_modules/lime-back-top/components/lime-back-top/lime-back-top.vue b/src/uni_modules/lime-back-top/components/lime-back-top/lime-back-top.vue new file mode 100644 index 0000000..fcb7d37 --- /dev/null +++ b/src/uni_modules/lime-back-top/components/lime-back-top/lime-back-top.vue @@ -0,0 +1,38 @@ + + + diff --git a/src/uni_modules/lime-back-top/package.json b/src/uni_modules/lime-back-top/package.json new file mode 100644 index 0000000..83edfc1 --- /dev/null +++ b/src/uni_modules/lime-back-top/package.json @@ -0,0 +1,84 @@ +{ + "id": "lime-back-top", + "displayName": "back-top 返回顶部 lime-back-top", + "version": "0.0.2", + "description": "uniapp vue3 实现的返回顶部按钮,页面过长往下滑动会出现返回顶部的便捷操作,帮助用户快速回到页面顶部。目前仅在H5和微信小程序上测试,vue2需要配置@vue/composition-api", + "keywords": [ + "back-top", + "返回顶部" +], + "repository": "", +"engines": { + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "lime-shared", + "lime-icon", + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "u", + "Edge": "u", + "Firefox": "u", + "Safari": "u" + }, + "小程序": { + "微信": "y", + "阿里": "u", + "百度": "u", + "字节跳动": "u", + "QQ": "u", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/src/uni_modules/lime-back-top/readme.md b/src/uni_modules/lime-back-top/readme.md new file mode 100644 index 0000000..9e4c650 --- /dev/null +++ b/src/uni_modules/lime-back-top/readme.md @@ -0,0 +1,93 @@ +# lime-back-top +- 用于当页面过长往下滑动时,帮助用户快速回到页面顶部。 +- 基于uniapp vue3 +- Q群719441207 + +### 安装 +- 在市场导入插件即可在任意页面使用,无须再`import` + + +### 使用 +- 提供简单的使用示例,更多请查看下方的demo + +```html + +``` + + +#### 形状 +- shape: 有circle,square + +```html + +``` + +### 查看示例 +- 导入后直接使用这个标签查看演示效果 + +```html + // 代码位于 uni_modules/lime-back-top/compoents/lime-back-top + +``` + +### 插件标签 +- 默认 l-back-top 为 component +- 默认 lime-back-top 为 demo + +### 关于vue2的使用方式 +- 插件使用了`composition-api`, 如果你希望在vue2中使用请按官方的教程[vue-composition-api](https://uniapp.dcloud.net.cn/tutorial/vue-composition-api.html)配置 +- 关键代码是: 在main.js中 在vue2部分加上这一段即可. + +```js +// vue2 +import Vue from 'vue' +import VueCompositionAPI from '@vue/composition-api' +Vue.use(VueCompositionAPI) +``` + + +另外插件也用到了TS,vue2可能会遇过官方的TS版本过低的问题,找到HX目录下的`compile-typescript`目录 +```cmd +// \HBuilderX\plugins\compile-typescript +yarn add typescript -D + - or - +npm install typescript -D +``` + + + +## API + +### Props + +| 参数 | 说明 | 类型 | 默认值 | +| --------------------------| ------------------------------------------------------------ | ---------------- | ------------ | +| icon | [图标](https://ext.dcloud.net.cn/plugin?id=14057)。值为 false 表示不显示图标。不传表示使用默认图标 'bx:arrow-to-top' | string | `` | +| text | 方案 | string | `` | +| fixed | 是否绝对定位固定到屏幕右下方 | boolean | `true` | +| duration | 回到顶部所需时间(ms), nvue无效 | number | `100` | +| offset | 页面垂直滚动多高后出现, nvue无效 | number | `200` | +| target | nvue需要定位滚动到指定对象 | string | `` | +| shape | 形状: `circle`、`square` | string | `circle` | + +### Events +| 参数 | 说明 | 参数 | +| --------------------------| ------------------------------------------------------------ | ---------------- | +| click | 点击触发 | `-` | + + +### CSS 变量 +组件提供了下列 CSS 变量,可用于自定义样式。 +名称 | 默认值 | 描述 +-- | -- | -- +--l-back-top-font-size | 24rpx | - +--l-back-top-icon-size | 40rpx | - +--l-back-top-text-color | rgba(0,0,0,0.65) | - +--l-back-top-bg-color | #fff | - +--l-back-top-border-color | #d9d9d9 | - + +## 打赏 + +如果你觉得本插件,解决了你的问题,赠人玫瑰,手留余香。 +![](https://testingcf.jsdelivr.net/gh/liangei/image@1.9/alipay.png) +![](https://testingcf.jsdelivr.net/gh/liangei/image@1.9/wpay.png) \ No newline at end of file diff --git a/src/uni_modules/lime-icon/changelog.md b/src/uni_modules/lime-icon/changelog.md new file mode 100644 index 0000000..0d5a4df --- /dev/null +++ b/src/uni_modules/lime-icon/changelog.md @@ -0,0 +1,7 @@ +## 0.0.3(2023-09-05) +- chore: 更新文档 +- feat: 默认使用官方API +## 0.0.2(2023-08-13) +- chore: 更新文档 +## 0.0.1(2023-08-13) +- 初次上传 可能存在BUG diff --git a/src/uni_modules/lime-icon/components/l-icon/icon.scss b/src/uni_modules/lime-icon/components/l-icon/icon.scss new file mode 100644 index 0000000..ff3d797 --- /dev/null +++ b/src/uni_modules/lime-icon/components/l-icon/icon.scss @@ -0,0 +1,961 @@ +/* #ifndef APP-NVUE */ +$prefix: l !default; +@font-face { + font-family: $prefix; + src: url('https://tdesign.gtimg.com/icon/0.1.2/fonts/t.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +.#{$prefix}-icon { + font-family: $prefix !important; +} + +.#{$prefix}-icon-add-circle:before { + content: '\E001'; +} + +.#{$prefix}-icon-add-rectangle:before { + content: '\E002'; +} + +.#{$prefix}-icon-add:before { + content: '\E003'; +} + +.#{$prefix}-icon-app:before { + content: '\E004'; +} + +.#{$prefix}-icon-arrow-down-rectangle:before { + content: '\E005'; +} + +.#{$prefix}-icon-arrow-down:before { + content: '\E006'; +} + +.#{$prefix}-icon-arrow-left:before { + content: '\E007'; +} + +.#{$prefix}-icon-arrow-right:before { + content: '\E008'; +} + +.#{$prefix}-icon-arrow-up:before { + content: '\E009'; +} + +.#{$prefix}-icon-attach:before { + content: '\E00A'; +} + +.#{$prefix}-icon-backtop-rectangle:before { + content: '\E00B'; +} + +.#{$prefix}-icon-backtop:before { + content: '\E00C'; +} + +.#{$prefix}-icon-backward:before { + content: '\E00D'; +} + +.#{$prefix}-icon-barcode:before { + content: '\E00E'; +} + +.#{$prefix}-icon-books:before { + content: '\E00F'; +} + +.#{$prefix}-icon-browse-off:before { + content: '\E010'; +} + +.#{$prefix}-icon-browse:before { + content: '\E011'; +} + +.#{$prefix}-icon-bulletpoint:before { + content: '\E012'; +} + +.#{$prefix}-icon-calendar:before { + content: '\E013'; +} + +.#{$prefix}-icon-call:before { + content: '\E014'; +} + +.#{$prefix}-icon-caret-down-small:before { + content: '\E015'; +} + +.#{$prefix}-icon-caret-down:before { + content: '\E016'; +} + +.#{$prefix}-icon-caret-left-small:before { + content: '\E017'; +} + +.#{$prefix}-icon-caret-left:before { + content: '\E018'; +} + +.#{$prefix}-icon-caret-right-small:before { + content: '\E019'; +} + +.#{$prefix}-icon-caret-right:before { + content: '\E01A'; +} + +.#{$prefix}-icon-caret-up-small:before { + content: '\E01B'; +} + +.#{$prefix}-icon-caret-up:before { + content: '\E01C'; +} + +.#{$prefix}-icon-cart:before { + content: '\E01D'; +} + +.#{$prefix}-icon-chart-bar:before { + content: '\E01E'; +} + +.#{$prefix}-icon-chart-bubble:before { + content: '\E01F'; +} + +.#{$prefix}-icon-chart-pie:before { + content: '\E020'; +} + +.#{$prefix}-icon-chart:before { + content: '\E021'; +} + +.#{$prefix}-icon-chat:before { + content: '\E022'; +} + +.#{$prefix}-icon-check-circle-filled:before { + content: '\E023'; +} + +.#{$prefix}-icon-check-circle:before { + content: '\E024'; +} + +.#{$prefix}-icon-check-rectangle-filled:before { + content: '\E025'; +} + +.#{$prefix}-icon-check-rectangle:before { + content: '\E026'; +} + +.#{$prefix}-icon-check:before { + content: '\E027'; +} + +.#{$prefix}-icon-chevron-down-circle:before { + content: '\E028'; +} + +.#{$prefix}-icon-chevron-down-rectangle:before { + content: '\E029'; +} + +.#{$prefix}-icon-chevron-down:before { + content: '\E02A'; +} + +.#{$prefix}-icon-chevron-left-circle:before { + content: '\E02B'; +} + +.#{$prefix}-icon-chevron-left-double:before { + content: '\E02C'; +} + +.#{$prefix}-icon-chevron-left-rectangle:before { + content: '\E02D'; +} + +.#{$prefix}-icon-chevron-left:before { + content: '\E02E'; +} + +.#{$prefix}-icon-chevron-right-circle:before { + content: '\E02F'; +} + +.#{$prefix}-icon-chevron-right-double:before { + content: '\E030'; +} + +.#{$prefix}-icon-chevron-right-rectangle:before { + content: '\E031'; +} + +.#{$prefix}-icon-chevron-right:before { + content: '\E032'; +} + +.#{$prefix}-icon-chevron-up-circle:before { + content: '\E033'; +} + +.#{$prefix}-icon-chevron-up-rectangle:before { + content: '\E034'; +} + +.#{$prefix}-icon-chevron-up:before { + content: '\E035'; +} + +.#{$prefix}-icon-circle:before { + content: '\E036'; +} + +.#{$prefix}-icon-clear:before { + content: '\E037'; +} + +.#{$prefix}-icon-close-circle-filled:before { + content: '\E038'; +} + +.#{$prefix}-icon-close-circle:before { + content: '\E039'; +} + +.#{$prefix}-icon-close-rectangle:before { + content: '\E03A'; +} + +.#{$prefix}-icon-close:before { + content: '\E03B'; +} + +.#{$prefix}-icon-cloud-download:before { + content: '\E03C'; +} + +.#{$prefix}-icon-cloud-upload:before { + content: '\E03D'; +} + +.#{$prefix}-icon-cloud:before { + content: '\E03E'; +} + +.#{$prefix}-icon-code:before { + content: '\E03F'; +} + +.#{$prefix}-icon-control-platform:before { + content: '\E040'; +} + +.#{$prefix}-icon-creditcard:before { + content: '\E041'; +} + +.#{$prefix}-icon-dashboard:before { + content: '\E042'; +} + +.#{$prefix}-icon-delete:before { + content: '\E043'; +} + +.#{$prefix}-icon-desktop:before { + content: '\E044'; +} + +.#{$prefix}-icon-discount-filled:before { + content: '\E045'; +} + +.#{$prefix}-icon-discount:before { + content: '\E046'; +} + +.#{$prefix}-icon-download:before { + content: '\E047'; +} + +.#{$prefix}-icon-edit-1:before { + content: '\E048'; +} + +.#{$prefix}-icon-edit:before { + content: '\E049'; +} + +.#{$prefix}-icon-ellipsis:before { + content: '\E04A'; +} + +.#{$prefix}-icon-enter:before { + content: '\E04B'; +} + +.#{$prefix}-icon-error-circle-filled:before { + content: '\E04C'; +} + +.#{$prefix}-icon-error-circle:before { + content: '\E04D'; +} + +.#{$prefix}-icon-error:before { + content: '\E04E'; +} + +.#{$prefix}-icon-file-add:before { + content: '\E04F'; +} + +.#{$prefix}-icon-file-copy:before { + content: '\E050'; +} + +.#{$prefix}-icon-file-excel:before { + content: '\E051'; +} + +.#{$prefix}-icon-file-icon:before { + content: '\E052'; +} + +.#{$prefix}-icon-file-image:before { + content: '\E053'; +} + +.#{$prefix}-icon-file-paste:before { + content: '\E054'; +} + +.#{$prefix}-icon-file-pdf:before { + content: '\E055'; +} + +.#{$prefix}-icon-file-powerpoint:before { + content: '\E056'; +} + +.#{$prefix}-icon-file-unknown:before { + content: '\E057'; +} + +.#{$prefix}-icon-file-word:before { + content: '\E058'; +} + +.#{$prefix}-icon-file:before { + content: '\E059'; +} + +.#{$prefix}-icon-filter-clear:before { + content: '\E05A'; +} + +.#{$prefix}-icon-filter:before { + content: '\E05B'; +} + +.#{$prefix}-icon-flag:before { + content: '\E05C'; +} + +.#{$prefix}-icon-folder-add:before { + content: '\E05D'; +} + +.#{$prefix}-icon-folder-open:before { + content: '\E05E'; +} + +.#{$prefix}-icon-folder:before { + content: '\E05F'; +} + +.#{$prefix}-icon-fork:before { + content: '\E060'; +} + +.#{$prefix}-icon-format-horizontal-align-bottom:before { + content: '\E061'; +} + +.#{$prefix}-icon-format-horizontal-align-center:before { + content: '\E062'; +} + +.#{$prefix}-icon-format-horizontal-align-top:before { + content: '\E063'; +} + +.#{$prefix}-icon-format-vertical-align-center:before { + content: '\E064'; +} + +.#{$prefix}-icon-format-vertical-align-left:before { + content: '\E065'; +} + +.#{$prefix}-icon-format-vertical-align-right:before { + content: '\E066'; +} + +.#{$prefix}-icon-forward:before { + content: '\E067'; +} + +.#{$prefix}-icon-fullscreen-exit:before { + content: '\E068'; +} + +.#{$prefix}-icon-fullscreen:before { + content: '\E069'; +} + +.#{$prefix}-icon-gender-female:before { + content: '\E06A'; +} + +.#{$prefix}-icon-gender-male:before { + content: '\E06B'; +} + +.#{$prefix}-icon-gift:before { + content: '\E06C'; +} + +.#{$prefix}-icon-heart-filled:before { + content: '\E06D'; +} + +.#{$prefix}-icon-heart:before { + content: '\E06E'; +} + +.#{$prefix}-icon-help-circle-filled:before { + content: '\E06F'; +} + +.#{$prefix}-icon-help-circle:before { + content: '\E070'; +} + +.#{$prefix}-icon-help:before { + content: '\E071'; +} + +.#{$prefix}-icon-history:before { + content: '\E072'; +} + +.#{$prefix}-icon-home:before { + content: '\E073'; +} + +.#{$prefix}-icon-hourglass:before { + content: '\E074'; +} + +.#{$prefix}-icon-image-error:before { + content: '\E075'; +} + +.#{$prefix}-icon-image:before { + content: '\E076'; +} + +.#{$prefix}-icon-info-circle-filled:before { + content: '\E077'; +} + +.#{$prefix}-icon-info-circle:before { + content: '\E078'; +} + +.#{$prefix}-icon-internet:before { + content: '\E079'; +} + +.#{$prefix}-icon-jump:before { + content: '\E07A'; +} + +.#{$prefix}-icon-laptop:before { + content: '\E07B'; +} + +.#{$prefix}-icon-layers:before { + content: '\E07C'; +} + +.#{$prefix}-icon-link-unlink:before { + content: '\E07D'; +} + +.#{$prefix}-icon-link:before { + content: '\E07E'; +} + +.#{$prefix}-icon-loading:before { + content: '\E07F'; +} + +.#{$prefix}-icon-location:before { + content: '\E080'; +} + +.#{$prefix}-icon-lock-off:before { + content: '\E081'; +} + +.#{$prefix}-icon-lock-on:before { + content: '\E082'; +} + +.#{$prefix}-icon-login:before { + content: '\E083'; +} + +.#{$prefix}-icon-logo-android:before { + content: '\E084'; +} + +.#{$prefix}-icon-logo-apple-filled:before { + content: '\E085'; +} + +.#{$prefix}-icon-logo-apple:before { + content: '\E086'; +} + +.#{$prefix}-icon-logo-chrome-filled:before { + content: '\E087'; +} + +.#{$prefix}-icon-logo-chrome:before { + content: '\E088'; +} + +.#{$prefix}-icon-logo-codepen:before { + content: '\E089'; +} + +.#{$prefix}-icon-logo-github-filled:before { + content: '\E08A'; +} + +.#{$prefix}-icon-logo-github:before { + content: '\E08B'; +} + +.#{$prefix}-icon-logo-ie-filled:before { + content: '\E08C'; +} + +.#{$prefix}-icon-logo-ie:before { + content: '\E08D'; +} + +.#{$prefix}-icon-logo-qq:before { + content: '\E08E'; +} + +.#{$prefix}-icon-logo-wechat:before { + content: '\E08F'; +} + +.#{$prefix}-icon-logo-wecom:before { + content: '\E090'; +} + +.#{$prefix}-icon-logo-windows-filled:before { + content: '\E091'; +} + +.#{$prefix}-icon-logo-windows:before { + content: '\E092'; +} + +.#{$prefix}-icon-logout:before { + content: '\E093'; +} + +.#{$prefix}-icon-mail:before { + content: '\E094'; +} + +.#{$prefix}-icon-menu-fold:before { + content: '\E095'; +} + +.#{$prefix}-icon-menu-unfold:before { + content: '\E096'; +} + +.#{$prefix}-icon-minus-circle-filled:before { + content: '\E097'; +} + +.#{$prefix}-icon-minus-circle:before { + content: '\E098'; +} + +.#{$prefix}-icon-minus-rectangle:before { + content: '\E099'; +} + +.#{$prefix}-icon-mirror:before { + content: '\E09A'; +} + +.#{$prefix}-icon-mobile-vibrate:before { + content: '\E09B'; +} + +.#{$prefix}-icon-mobile:before { + content: '\E09C'; +} + +.#{$prefix}-icon-money-circle:before { + content: '\E09D'; +} + +.#{$prefix}-icon-more:before { + content: '\E09E'; +} + +.#{$prefix}-icon-move:before { + content: '\E09F'; +} + +.#{$prefix}-icon-next:before { + content: '\E0A0'; +} + +.#{$prefix}-icon-notification-filled:before { + content: '\E0A1'; +} + +.#{$prefix}-icon-notification:before { + content: '\E0A2'; +} + +.#{$prefix}-icon-order-adjustment-column:before { + content: '\E0A3'; +} + +.#{$prefix}-icon-order-ascending:before { + content: '\E0A4'; +} + +.#{$prefix}-icon-order-descending:before { + content: '\E0A5'; +} + +.#{$prefix}-icon-page-first:before { + content: '\E0A6'; +} + +.#{$prefix}-icon-page-last:before { + content: '\E0A7'; +} + +.#{$prefix}-icon-pause-circle-filled:before { + content: '\E0A8'; +} + +.#{$prefix}-icon-photo:before { + content: '\E0A9'; +} + +.#{$prefix}-icon-pin-filled:before { + content: '\E0AA'; +} + +.#{$prefix}-icon-pin:before { + content: '\E0AB'; +} + +.#{$prefix}-icon-play-circle-filled:before { + content: '\E0AC'; +} + +.#{$prefix}-icon-play-circle-stroke:before { + content: '\E0AD'; +} + +.#{$prefix}-icon-play-circle:before { + content: '\E0AE'; +} + +.#{$prefix}-icon-play:before { + content: '\E0AF'; +} + +.#{$prefix}-icon-poweroff:before { + content: '\E0B0'; +} + +.#{$prefix}-icon-precise-monitor:before { + content: '\E0B1'; +} + +.#{$prefix}-icon-previous:before { + content: '\E0B2'; +} + +.#{$prefix}-icon-print:before { + content: '\E0B3'; +} + +.#{$prefix}-icon-qrcode:before { + content: '\E0B4'; +} + +.#{$prefix}-icon-queue:before { + content: '\E0B5'; +} + +.#{$prefix}-icon-rectangle:before { + content: '\E0B6'; +} + +.#{$prefix}-icon-refresh:before { + content: '\E0B7'; +} + +.#{$prefix}-icon-relativity:before { + content: '\E0B8'; +} + +.#{$prefix}-icon-remove:before { + content: '\E0B9'; +} + +.#{$prefix}-icon-rollback:before { + content: '\E0BA'; +} + +.#{$prefix}-icon-rollfront:before { + content: '\E0BB'; +} + +.#{$prefix}-icon-root-list:before { + content: '\E0BC'; +} + +.#{$prefix}-icon-rotation:before { + content: '\E0BD'; +} + +.#{$prefix}-icon-round:before { + content: '\E0BE'; +} + +.#{$prefix}-icon-save:before { + content: '\E0BF'; +} + +.#{$prefix}-icon-scan:before { + content: '\E0C0'; +} + +.#{$prefix}-icon-search:before { + content: '\E0C1'; +} + +.#{$prefix}-icon-secured:before { + content: '\E0C2'; +} + +.#{$prefix}-icon-server:before { + content: '\E0C3'; +} + +.#{$prefix}-icon-service:before { + content: '\E0C4'; +} + +.#{$prefix}-icon-setting:before { + content: '\E0C5'; +} + +.#{$prefix}-icon-share:before { + content: '\E0C6'; +} + +.#{$prefix}-icon-shop:before { + content: '\E0C7'; +} + +.#{$prefix}-icon-slash:before { + content: '\E0C8'; +} + +.#{$prefix}-icon-sound:before { + content: '\E0C9'; +} + +.#{$prefix}-icon-star-filled:before { + content: '\E0CA'; +} + +.#{$prefix}-icon-star:before { + content: '\E0CB'; +} + +.#{$prefix}-icon-stop-circle-1:before { + content: '\E0CC'; +} + +.#{$prefix}-icon-stop-circle-filled:before { + content: '\E0CD'; +} + +.#{$prefix}-icon-stop-circle:before { + content: '\E0CE'; +} + +.#{$prefix}-icon-stop:before { + content: '\E0CF'; +} + +.#{$prefix}-icon-swap-left:before { + content: '\E0D0'; +} + +.#{$prefix}-icon-swap-right:before { + content: '\E0D1'; +} + +.#{$prefix}-icon-swap:before { + content: '\E0D2'; +} + +.#{$prefix}-icon-thumb-down:before { + content: '\E0D3'; +} + +.#{$prefix}-icon-thumb-up:before { + content: '\E0D4'; +} + +.#{$prefix}-icon-time-filled:before { + content: '\E0D5'; +} + +.#{$prefix}-icon-time:before { + content: '\E0D6'; +} + +.#{$prefix}-icon-tips:before { + content: '\E0D7'; +} + +.#{$prefix}-icon-tools:before { + content: '\E0D8'; +} + +.#{$prefix}-icon-unfold-less:before { + content: '\E0D9'; +} + +.#{$prefix}-icon-unfold-more:before { + content: '\E0DA'; +} + +.#{$prefix}-icon-upload:before { + content: '\E0DB'; +} + +.#{$prefix}-icon-usb:before { + content: '\E0DC'; +} + +.#{$prefix}-icon-user-add:before { + content: '\E0DD'; +} + +.#{$prefix}-icon-user-avatar:before { + content: '\E0DE'; +} + +.#{$prefix}-icon-user-circle:before { + content: '\E0DF'; +} + +.#{$prefix}-icon-user-clear:before { + content: '\E0E0'; +} + +.#{$prefix}-icon-user-talk:before { + content: '\E0E1'; +} + +.#{$prefix}-icon-user:before { + content: '\E0E2'; +} + +.#{$prefix}-icon-usergroup-add:before { + content: '\E0E3'; +} + +.#{$prefix}-icon-usergroup-clear:before { + content: '\E0E4'; +} + +.#{$prefix}-icon-usergroup:before { + content: '\E0E5'; +} + +.#{$prefix}-icon-video:before { + content: '\E0E6'; +} + +.#{$prefix}-icon-view-column:before { + content: '\E0E7'; +} + +.#{$prefix}-icon-view-list:before { + content: '\E0E8'; +} + +.#{$prefix}-icon-view-module:before { + content: '\E0E9'; +} + +.#{$prefix}-icon-wallet:before { + content: '\E0EA'; +} + +.#{$prefix}-icon-wifi:before { + content: '\E0EB'; +} + +.#{$prefix}-icon-zoom-in:before { + content: '\E0EC'; +} + +.#{$prefix}-icon-zoom-out:before { + content: '\E0ED'; +} +/* #endif */ \ No newline at end of file diff --git a/src/uni_modules/lime-icon/components/l-icon/icons.js b/src/uni_modules/lime-icon/components/l-icon/icons.js new file mode 100644 index 0000000..7d477fe --- /dev/null +++ b/src/uni_modules/lime-icon/components/l-icon/icons.js @@ -0,0 +1,239 @@ +const list = [ + 'add-circle', + 'add-rectangle', + 'add', + 'app', + 'arrow-down-rectangle', + 'arrow-down', + 'arrow-left', + 'arrow-right', + 'arrow-up', + 'attach', + 'backtop-rectangle', + 'backtop', + 'backward', + 'barcode', + 'books', + 'browse-off', + 'browse', + 'bulletpoint', + 'calendar', + 'call', + 'caret-down-small', + 'caret-down', + 'caret-left-small', + 'caret-left', + 'caret-right-small', + 'caret-right', + 'caret-up-small', + 'caret-up', + 'cart', + 'chart-bar', + 'chart-bubble', + 'chart-pie', + 'chart', + 'chat', + 'check-circle-filled', + 'check-circle', + 'check-rectangle-filled', + 'check-rectangle', + 'check', + 'chevron-down-circle', + 'chevron-down-rectangle', + 'chevron-down', + 'chevron-left-circle', + 'chevron-left-double', + 'chevron-left-rectangle', + 'chevron-left', + 'chevron-right-circle', + 'chevron-right-double', + 'chevron-right-rectangle', + 'chevron-right', + 'chevron-up-circle', + 'chevron-up-rectangle', + 'chevron-up', + 'circle', + 'clear', + 'close-circle-filled', + 'close-circle', + 'close-rectangle', + 'close', + 'cloud-download', + 'cloud-upload', + 'cloud', + 'code', + 'control-platform', + 'creditcard', + 'dashboard', + 'delete', + 'desktop', + 'discount-filled', + 'discount', + 'download', + 'edit-1', + 'edit', + 'ellipsis', + 'enter', + 'error-circle-filled', + 'error-circle', + 'error', + 'file-add', + 'file-copy', + 'file-excel', + 'file-icon', + 'file-image', + 'file-paste', + 'file-pdf', + 'file-powerpoint', + 'file-unknown', + 'file-word', + 'file', + 'filter-clear', + 'filter', + 'flag', + 'folder-add', + 'folder-open', + 'folder', + 'fork', + 'format-horizontal-align-bottom', + 'format-horizontal-align-center', + 'format-horizontal-align-top', + 'format-vertical-align-center', + 'format-vertical-align-left', + 'format-vertical-align-right', + 'forward', + 'fullscreen-exit', + 'fullscreen', + 'gender-female', + 'gender-male', + 'gift', + 'heart-filled', + 'heart', + 'help-circle-filled', + 'help-circle', + 'help', + 'history', + 'home', + 'hourglass', + 'image-error', + 'image', + 'info-circle-filled', + 'info-circle', + 'internet', + 'jump', + 'laptop', + 'layers', + 'link-unlink', + 'link', + 'loading', + 'location', + 'lock-off', + 'lock-on', + 'login', + 'logo-android', + 'logo-apple-filled', + 'logo-apple', + 'logo-chrome-filled', + 'logo-chrome', + 'logo-codepen', + 'logo-github-filled', + 'logo-github', + 'logo-ie-filled', + 'logo-ie', + 'logo-qq', + 'logo-wechat', + 'logo-wecom', + 'logo-windows-filled', + 'logo-windows', + 'logout', + 'mail', + 'menu-fold', + 'menu-unfold', + 'minus-circle-filled', + 'minus-circle', + 'minus-rectangle', + 'mirror', + 'mobile-vibrate', + 'mobile', + 'money-circle', + 'more', + 'move', + 'next', + 'notification-filled', + 'notification', + 'order-adjustment-column', + 'order-ascending', + 'order-descending', + 'page-first', + 'page-last', + 'pause-circle-filled', + 'photo', + 'pin-filled', + 'pin', + 'play-circle-filled', + 'play-circle-stroke', + 'play-circle', + 'play', + 'poweroff', + 'precise-monitor', + 'previous', + 'print', + 'qrcode', + 'queue', + 'rectangle', + 'refresh', + 'relativity', + 'remove', + 'rollback', + 'rollfront', + 'root-list', + 'rotation', + 'round', + 'save', + 'scan', + 'search', + 'secured', + 'server', + 'service', + 'setting', + 'share', + 'shop', + 'slash', + 'sound', + 'star-filled', + 'star', + 'stop-circle-1', + 'stop-circle-filled', + 'stop-circle', + 'stop', + 'swap-left', + 'swap-right', + 'swap', + 'thumb-down', + 'thumb-up', + 'time-filled', + 'time', + 'tips', + 'tools', + 'unfold-less', + 'unfold-more', + 'upload', + 'usb', + 'user-add', + 'user-avatar', + 'user-circle', + 'user-clear', + 'user-talk', + 'user', + 'usergroup-add', + 'usergroup-clear', + 'usergroup', + 'video', + 'view-column', + 'view-list', + 'view-module', + 'wallet', + 'wifi', + 'zoom-in', + 'zoom-out', +] \ No newline at end of file diff --git a/src/uni_modules/lime-icon/components/l-icon/index.scss b/src/uni_modules/lime-icon/components/l-icon/index.scss new file mode 100644 index 0000000..b0f24dc --- /dev/null +++ b/src/uni_modules/lime-icon/components/l-icon/index.scss @@ -0,0 +1,68 @@ +// 公共前缀 +// @import '@/uni_modules/lime-ui/style/index.scss'; +/* #ifndef APP-NVUE */ +// @import './icon'; +/* #endif */ + +$prefix: l !default; +$icon: #{$prefix}-icon; + +/* #ifndef APP-NVUE || UNI-APP-X */ +:host { + display: inline-flex; + align-items: center; + justify-content: center; +} +/* #endif */ + +.#{$icon} { + /* #ifndef APP-NVUE || UNI-APP-X */ + display: inline-block; + position: relative; + width: 1em; + height: 1em; + /* #endif */ + /* #ifdef APP-NVUE || UNI-APP-X */ + width: 40rpx; + height: 40rpx; + /* #endif */ + + &--font { + line-height: 1; + text-align: center; + font-size: inherit; + + /* #ifndef APP-NVUE || UNI-APP-X */ + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + // -webkit-font-smoothing: antialiased; + // -moz-osx-font-smoothing: grayscale; + // -webkit-background-clip: text; + // background-clip: text; + /* #endif */ + } + /* #ifndef APP-NVUE || UNI-APP-X */ + &--image { + &.is-inherit { + background-color: currentColor; + mask: var(--l-icon) no-repeat; + mask-size: 100% 100%; + // -webkit-mask: var(--l-icon) no-repeat; + // -webkit-mask-size: 100% 100%; + } + &:not(.is-inherit) { + background: var(--l-icon) no-repeat; + background-size: 100% 100%; + background-color: transparent; + // -webkit-background: var(--l-icon) no-repeat; + // -webkit-background-size: 100% 100%; + } + } + &__image { + width: 100%; + height: 100%; + } + /* #endif */ +} diff --git a/src/uni_modules/lime-icon/components/l-icon/l-icon.uvue b/src/uni_modules/lime-icon/components/l-icon/l-icon.uvue new file mode 100644 index 0000000..3c236f7 --- /dev/null +++ b/src/uni_modules/lime-icon/components/l-icon/l-icon.uvue @@ -0,0 +1,122 @@ + + + \ No newline at end of file diff --git a/src/uni_modules/lime-icon/components/l-icon/l-icon.vue b/src/uni_modules/lime-icon/components/l-icon/l-icon.vue new file mode 100644 index 0000000..51615a9 --- /dev/null +++ b/src/uni_modules/lime-icon/components/l-icon/l-icon.vue @@ -0,0 +1,34 @@ + + + \ No newline at end of file diff --git a/src/uni_modules/lime-icon/components/l-icon/lIcon.ts b/src/uni_modules/lime-icon/components/l-icon/lIcon.ts new file mode 100644 index 0000000..3278f35 --- /dev/null +++ b/src/uni_modules/lime-icon/components/l-icon/lIcon.ts @@ -0,0 +1,111 @@ +// @ts-nocheck +import { computed, defineComponent, ref, onMounted } from '@/uni_modules/lime-shared/vue'; +import { addUnit } from '@/uni_modules/lime-shared/addUnit'; +import { isObject } from '@/uni_modules/lime-shared/isObject'; +import { pathToBase64 } from '@/uni_modules/lime-shared/pathToBase64'; +import IconProps from './props'; +const name = 'l-icon'; +export default defineComponent({ + name, + externalClasses: ['l-class'], + options: { + addGlobalClass: true, + virtualHost: true, + }, + props: IconProps, + emits: ['click'], + setup(props, { emit }) { + const { $iconsHost, $iconCollections } = uni as any + const IconifyURL = 'https://api.iconify.design/' + const hasImage = ref(false) + const iconUrl = ref('') + const hasHost = computed(() => `${props.name}`.indexOf('/') !== -1); + const isIconify = computed(() => !hasHost.value && `${props.name}`.includes(':')) + const collectionIcon = computed(() => isObject($iconCollections) && $iconCollections[props.name]) + const isImage = computed(() => hasHost.value || /\.(.+)$/i.test(props.name) || collectionIcon.value && collectionIcon.value.length > 5 || hasImage.value); + const classes = computed(() => { + const { prefix } = props + const iconPrefix = prefix || name + const iconName = `${iconPrefix}-${props.name}` + return { + [iconPrefix]: !isImage.value && prefix, + [iconName]: !isImage.value, + [`${name}--image`]: isImage.value, + [`${name}--font`]: !isImage.value, + [`is-inherit`]: isImage.value && (props.color || props.inherit) + } + }) + + const getIconUrl = computed(() => { + if (hasHost.value) { + return props.name + } + if (/\.(.+)$/i.test(props.name)) { + return `${$iconsHost}${props.name}` + } + if (collectionIcon.value && collectionIcon.value.length > 4) { + return collectionIcon.value + } + return iconUrl.value + }) + const styles = computed(() => { + return { + 'font-size': addUnit(props.size), + 'color': props.color, + '--l-icon': getIconUrl.value ? `url("${getIconUrl.value}")` : '' + } + }) + const imageLoad = () => { + hasImage.value = true + } + const imageError = () => { + hasImage.value = false + if(isIconify.value && iconUrl.value && !iconUrl.value.includes(IconifyURL)) { + const name = `${props.name}.svg`.replace(/:/g, '/') + iconUrl.value = `${IconifyURL}${name}` + } + } + const onClick = () => emit('click'); + const addSlash = (string: string) => { + if (string.charAt(string.length - 1) !== '/') { + string += '/'; + } + return string; + } + const getBase64 = () => { + if(isIconify.value) { + const name = `${props.name}.svg`.replace(/:/g, '/') + // 本地的SVG需要转成BASE64 + if(!hasHost.value && $iconsHost && $iconsHost.startsWith("/static")) { + const url = `${addSlash($iconsHost)}${name}` + // #ifdef MP + if(!/^(?:https?|ftp):\/\/|^\/\//i.test(url)) { + pathToBase64(url).then(base64 => { + iconUrl.value = base64 + }) + } else { + iconUrl.value = url + } + // #endif + // #ifndef MP + iconUrl.value = url + // #endif + } else { + iconUrl.value = `${IconifyURL}${name}` + } + } + return '' + } + onMounted(getBase64) + return { + classes, + styles, + isImage, + onClick, + props, + iconUrl, + imageLoad, + imageError + } + } +}) \ No newline at end of file diff --git a/src/uni_modules/lime-icon/components/l-icon/props.ts b/src/uni_modules/lime-icon/components/l-icon/props.ts new file mode 100644 index 0000000..a58d564 --- /dev/null +++ b/src/uni_modules/lime-icon/components/l-icon/props.ts @@ -0,0 +1,24 @@ +export const ariaProps = { + ariaHidden: Boolean, + ariaRole: String, + ariaLabel: String, + ariaLabelledby: String, + ariaDescribedby: String, + ariaBusy: Boolean, + lStyle: String +} + +export default { + ...ariaProps, + // lClass: String, + name: String, + color: String, + size: String, + prefix: String, + // type: String, + inherit: { + type: Boolean, + default: true + } + // lStyle: String, +} \ No newline at end of file diff --git a/src/uni_modules/lime-icon/components/lime-icon/lime-icon.vue b/src/uni_modules/lime-icon/components/lime-icon/lime-icon.vue new file mode 100644 index 0000000..9db726e --- /dev/null +++ b/src/uni_modules/lime-icon/components/lime-icon/lime-icon.vue @@ -0,0 +1,167 @@ + + + diff --git a/src/uni_modules/lime-icon/generate-icons.js b/src/uni_modules/lime-icon/generate-icons.js new file mode 100644 index 0000000..f283b6b --- /dev/null +++ b/src/uni_modules/lime-icon/generate-icons.js @@ -0,0 +1,2 @@ +const { generate } = require('./utils/generate.js'); +generate() \ No newline at end of file diff --git a/src/uni_modules/lime-icon/lime.config.js b/src/uni_modules/lime-icon/lime.config.js new file mode 100644 index 0000000..2eccf24 --- /dev/null +++ b/src/uni_modules/lime-icon/lime.config.js @@ -0,0 +1,23 @@ +// lime.config.js +module.exports = { + // 输入的文件目录,自有的SVG,如果没有则不需要 + input: { + prefix: "my-icons", + dir: '/static/svg', + }, + // 输出的配置 + output: { + // 输出的文件目录 + dir: '/static/icon', + // 输出的文件的格式,如果是JSON则是一个图标合集 + // file: 'icons.json', + // 如果是SVG则是每个图标做为单独的文件 + file: '*.svg', + }, + icons: [ + 'el:address-book', + 'uil:12-plus', + 'icon-park-outline:abdominal', + 'icon-park-outline:acoustic' + ] +} \ No newline at end of file diff --git a/src/uni_modules/lime-icon/package.json b/src/uni_modules/lime-icon/package.json new file mode 100644 index 0000000..75542ed --- /dev/null +++ b/src/uni_modules/lime-icon/package.json @@ -0,0 +1,86 @@ +{ + "id": "lime-icon", + "displayName": "lime-icon 图标 iconify 图标集合", + "version": "0.0.3", + "description": "基于uniapp vue3 实现的图标插件,方便快捷的使用iconify图标集合。超过150,000个开源矢量图标。按需加载,仅在H5\\微信小程序测试", + "keywords": [ + "icon", + "iconify", + "图标集合", + "按需加载" +], + "repository": "", + "engines": { + "HBuilderX": "^3.98" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "lime-shared" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "u" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "u", + "Edge": "u", + "Firefox": "u", + "Safari": "u" + }, + "小程序": { + "微信": "y", + "阿里": "u", + "百度": "u", + "字节跳动": "u", + "QQ": "u", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/src/uni_modules/lime-icon/plugin.js b/src/uni_modules/lime-icon/plugin.js new file mode 100644 index 0000000..4be69fb --- /dev/null +++ b/src/uni_modules/lime-icon/plugin.js @@ -0,0 +1,87 @@ +const { readFileSync, existsSync } = require('fs'); +const path = require('path'); +const {generate} = require('./utils/generate') + +// 插件的名称 +const pluginName = 'lime-icon-plugin'; + +// 要监听的组件的名称 +const targetComponent = 'l-icon'; + +function parseAttributes(attributesStr) { + if (!attributesStr.includes("'")) { + return [attributesStr] + } + const regex = /'([^']+)'/g; + const matches = attributesStr.match(regex); + if (matches) { + const targetContent = matches.map(item => item.replace(/'/g, '')); + return targetContent + } else { + return [attributesStr] + } +} + +function extractAttributes(content) { + const regex = /]*(:?)name=["]([^"]+)["][^>]*>/g; // //g //]+)\s*\/?>/g; + let attributes = []; + const attributesSet = new Set(attributes); + let match; + while ((match = regex.exec(content)) !== null) { + const attributesStr = match[2]; + const attributesList = parseAttributes(attributesStr); + for (const attribute of attributesList) { + attributesSet.add(attribute); // 添加新属性到Set中 + } + } + attributes = [...attributesSet]; + return attributes; +} +// 遍历每个文件并检查是否使用了目标组件 +let iconCollections = {} +let files = {} +let timer = null +function processFile(file, options) { + const filePath = path.resolve(file); + const content = readFileSync(filePath, 'utf-8'); + + // 检查文件是否包含目标组件 + if (content.includes(targetComponent) && !file.includes('l-icon.vue') && files[file] !== content) { + const icons = extractAttributes(content) + if(icons && icons.length) { + files[file] = content + iconCollections[file] = icons + } + Object.values(iconCollections).forEach(icons => { + if(options.icons) { + options.icons = options.icons.concat(icons); + } else { + options.icons = icons + } + }) + + clearTimeout(timer) + timer = setTimeout(() => { + options.icons = Array.from(new Set(options.icons)) + generate(options) + },500) + + } +} + +// 插件的钩子函数 +function vitePlugin(options = {}) { + const {useInDevelopment = false} = options + const isDev = process.env.NODE_ENV === 'development' + return { + name: pluginName, + transform(code, id) { + if (id.endsWith('.vue') && (useInDevelopment && isDev || !useInDevelopment && !isDev)) { + // 处理Vue文件 + processFile(id, options); + } + }, + }; +} + +module.exports = vitePlugin; \ No newline at end of file diff --git a/src/uni_modules/lime-icon/readme.md b/src/uni_modules/lime-icon/readme.md new file mode 100644 index 0000000..bd01213 --- /dev/null +++ b/src/uni_modules/lime-icon/readme.md @@ -0,0 +1,169 @@ +# lime-icon 图标 +- 基于uniapp vue3 实现的图标插件,方便快捷的使用[iconify](https://iconify.design/)图标集合。超过150,000个开源矢量图标。 +- 当前仅为测试阶段,欢迎提出你的建议 + +## 使用 +### 基础使用 +到 [iconify](https://icon-sets.iconify.design/) 网站找到需要的图标,通过 `name` 属性来指定需要使用的图标 +![](https://img-cdn-aliyun.dcloud.net.cn/stream/plugin_screens/263cfd20-39e6-11ee-b4f0-9bc760224a38_1.png?1693883817) +![](https://img-cdn-aliyun.dcloud.net.cn/stream/plugin_screens/263cfd20-39e6-11ee-b4f0-9bc760224a38_2.png?1693883822) + +```html + +``` + +### 使用图标URL +```html + +``` + +### 图标颜色 +通过 `color` 属性来设置图标的颜色。 + +```html + + +``` + +### 图标大小 + +通过 `size` 属性来设置图标的尺寸大小,可以指定任意 CSS 单位。 + +```html + + + + +``` + + + +### 自定义字体图标 +- 如果需要自定义自己的 字体图标,可以引入 iconfont 对应的字体文件和 CSS 文件,之后就可以在 Icon 组件中直接使用 +- 样式必须是放在页面或App.vue + +```css +@font-face { + font-family: 'iconfont'; /* Project id 2624395 */ + src: url('data:font/ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwR1NVQiCLJXoAAAE4AAAAVE9TLzI+O0pCAAABjAAAAGBjbWFw6NhtkAAAAiQAAAIYZ2x5ZuZYvOIAAARcAAADcGhlYWQdInJhAAAA4AAAADZoaGVhB4IDjwAAALwAAAAkaG10eDgAAAAAAAHsAAAAOGxvY2EGNgVIAAAEPAAAAB5tYXhwARwAQgAAARgAAAAgbmFtZT5U/n0AAAfMAAACbXBvc3T99mzoAAAKPAAAARkAAQAAA4D/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QQBBQEGAQcBCAEJAQoBCwEMAQ0BDgEPAAppbWFnZS1maWxsD2ltYWdlLWZhaWwtZmlsbBFhcnJvdy1sZWZ0LXMtZmlsbBFhcnJvdy1sZWZ0LXMtbGluZQ9hcnJvdy11cC1zLWZpbGwPYXJyb3ctdXAtcy1saW5lEmFycm93LXJpZ2h0LXMtbGluZRJhcnJvdy1yaWdodC1zLWZpbGwRYXJyb3ctZG93bi1zLWxpbmURYXJyb3ctZG93bi1zLWZpbGwKY2xvc2UtZmlsbBFjbG9zZS1jaXJjbGUtZmlsbBFjbG9zZS1jaXJjbGUtbGluZQAAAAAA') format('truetype'); +} +.custom { + font-family: 'iconfont' !important; +} +.custom-image-fill::before{ + content: '\e771'; +} +``` + +```html + + +``` + + +## 私有化 +默认会使用`iconify`的API,如果你想私有化可按以下步骤来 +### 第一步 安装 + +```cmd +yarn add @iconify/json @iconify/tools @iconify/utils +``` +### 第二步 配置 +#### 1、手动下载 +- 需要在根目录新建一个lime.config.js文件 + +``` +// 在根目录新建一个lime.config.js文件 +// lime.config.js +module.exports = { + // 输入的文件目录,自有的SVG,如果没有则不需要 + input: { + prefix: "my-icons", + dir: '/static/svg', + }, + // 输出的配置 + output: { + // 输出的文件目录 + dir: '/static/icons', + // 输出的文件的格式,如果是JSON则是一个图标合集 + // file: 'icons.json', + // 如果是SVG则是每个图标做为单独的文件 + file: '*.svg', + }, + // 指定使用的图标 + icons: [ + 'el:address-book', + 'uil:12-plus', + 'icon-park-outline:abdominal', + 'icon-park-outline:acoustic' + ] +} +``` +在终端执行脚本 +``` +node ./uni_modules/lime-icon/generate-icons.js +``` + +#### 2、自动引入 +如果使用的是vue3,通过配置 **vite.config.js**达到自动引入 + +```js +import uni from '@dcloudio/vite-plugin-uni'; +import limeIcon from './uni_modules/lime-icon/plugin'; +import path from 'path' +export default defineConfig({ + plugins: [uni(), limeIcon({ + // 输出的配置 + output: { + // 输出的文件目录 + dir: path.join(__dirname, '/static/icons'), + // 输出的文件的格式,如果是JSON则是生成一个图标合集, 例如: /static/icons/icons.json + // file: 'icons.json', + // 如果是SVG则是每个图标做为单独的文件 例如: /static/icons/xx/xxx.svg + file: '*.svg', + }, + // 可选 + icons: [] + })] +}) +``` + + +### 第三步 挂载图标地址 + +```js +// main.js +// 如果配置的是json则引入json +import icons from './static/icons/icons.json' +uni.$iconCollections = icons; +// 如果配置的是单个svg则指定目录,后期可上传到后端,不占用本地空间 +uni.$iconsHost = '/static/icons/'; +``` + + + + + +## API + +### Props + +| 参数 | 说明 | 类型 | 默认值 | +| --------------------------| ------------------------------------------------------------ | ---------------- | ------------ | +| name | 图标名称 | string | `` | +| color | 颜色 | string | `` | +| size | 尺寸 | string | `square` | +| prefix | 字体图标前缀 | string | `` | +| inherit | 是否继承颜色 | boolean | `true` | + +### Events +| 参数 | 说明 | 参数 | +| --------------------------| ------------------------------------------------------------ | ---------------- | +| click | 点击 | | + + +## 打赏 + +如果你觉得本插件,解决了你的问题,赠人玫瑰,手留余香。 +![](https://testingcf.jsdelivr.net/gh/liangei/image@1.9/alipay.png) +![](https://testingcf.jsdelivr.net/gh/liangei/image@1.9/wpay.png) \ No newline at end of file diff --git a/src/uni_modules/lime-icon/utils/generate.js b/src/uni_modules/lime-icon/utils/generate.js new file mode 100644 index 0000000..357d829 --- /dev/null +++ b/src/uni_modules/lime-icon/utils/generate.js @@ -0,0 +1,120 @@ +const path = require('path'); +const fs = require("fs"); +const rootPath = process.cwd(); // 获取根目录 +const { importDirectory, blankIconSet } = require("@iconify/tools"); +const { locate } = require('@iconify/json'); +const { getIconData } = require('@iconify/utils'); +const { encodeSvg, saveFile, customOptions, deleteDirectory } = require('./index.js') +async function fetchIconsData(icons) { + const collections = {} + for (const iconName of icons) { + const [collectionName, iconNameWithoutPrefix] = iconName.split(':'); + const filename = locate(collectionName) + if(!fs.existsSync(filename)) { + continue + } + const icons = JSON.parse(fs.readFileSync(filename, 'utf8')) + if(!icons) { + continue + } + if(collectionName && iconNameWithoutPrefix) { + const iconData = getIconData(icons, iconNameWithoutPrefix); + if(iconData) { + if(!collections[collectionName]) { + collections[collectionName] = blankIconSet(collectionName); + } + collections[collectionName].setIcon(iconNameWithoutPrefix, iconData); + } else { + console.log(`Icon '${iconName}' not found in '${collectionName}' collection.`) + } + } else if(collectionName) { + if(!collections[collectionName]) { + collections[collectionName] = blankIconSet(collectionName) + } + Object.keys(icons.icons).forEach(iconName => { + const iconData = getIconData(icons, iconName) + if(iconData) { + collections[collectionName].setIcon(iconName, iconData) + } else { + console.log(`Icon '${iconName}' not found in '${collectionName}' collection.`) + } + }) + } + } + return collections; +} + +async function generate(config){ + try { + if(!config) { + // 从配置文件中读取选项 + const rootConfigPath = path.join(rootPath, 'lime.config.js'); + let configPath = '' + if(fs.existsSync(rootConfigPath)) { + configPath = rootConfigPath + } else { + configPath = path.dirname(__filename) + '/lime.config.js'; // 配置文件路径 + } + + const configFile = fs.readFileSync(configPath, 'utf8'); + config = eval(`(${configFile})`); + } + + // 根据配置文件中的字段设置选项 + const options = { + input: Object.assign({}, customOptions, config.input || {}), // 输入的文件目录 + output: { + dir: config.output.dir || '/static', // 输出的文件目录 + file: config.output.file || 'icons.json', // 输出的文件的格式,默认为 JSON + }, + icons: config.icons || [], // 图标名称列表 + }; + + // 先删除原来的 + deleteDirectory(options.output.dir) + // 处理输入目录的逻辑 + if (config.input.dir.startsWith('/')) { + options.input.dir = path.join(rootPath, config.input.dir); + } else if (config.input.dir.startsWith('./')) { + options.input.dir = path.join(__dirname, config.input.dir.slice(2)); + } + let iconCollections = {} + // 异步地从目录中导入图标 + if(fs.existsSync(options.input.dir)) { + const iconSet = await importDirectory(options.input.dir, options.input); + // 导出为 JSON 文件 + iconCollections[options.input.prefix] = iconSet + } + + // 获取指定图标的数据 + if(options.icons.length) { + const iconCollection = await fetchIconsData(options.icons); + Object.assign(iconCollections, iconCollection) + } + + if(/\.json$/i.test(options.output.file)) { + const collections = {} + Object.values(iconCollections).forEach((iconSet) => { + + iconSet.forEach(iconName => { + // 将 SVG 转换为 Data URL + collections[iconSet.prefix + ':' + iconName] = `data:image/svg+xml;utf8,${encodeSvg(iconSet.toString(iconName))}` + }) + }) + await saveFile(`${options.output.dir}/${options.output.file}`, JSON.stringify(collections)) + } else { + Object.values(iconCollections).forEach((iconSet) => { + iconSet.forEach(async iconName => { + await saveFile(`${options.output.dir}/${iconSet.prefix}/${iconName}.svg`, iconSet.toString(iconName)) + }) + }) + } + } catch (error) { + console.error("导出图标集为 JSON 文件时出错:", error); + } +} + + +module.exports = { + generate +} \ No newline at end of file diff --git a/src/uni_modules/lime-icon/utils/index.js b/src/uni_modules/lime-icon/utils/index.js new file mode 100644 index 0000000..248719d --- /dev/null +++ b/src/uni_modules/lime-icon/utils/index.js @@ -0,0 +1,89 @@ +const fs = require("fs"); +const glob = require('glob'); +const path = require("path"); +const rootPath = process.cwd(); // 获取根目录 +// https://bl.ocks.org/jennyknuth/222825e315d45a738ed9d6e04c7a88d0 +function encodeSvg(svg) { + return svg + .replace( + "/g, "%3E"); +} + + +function isDirectoryEmpty(path) { + const files = fs.readdirSync(path); + return files.length === 0; + } +function deleteFolderBFS(folderPath) { + const outputPath = /^\.|\/|\\/.test(folderPath) ? path.join(rootPath, folderPath): folderPath + if(!fs.existsSync(outputPath)) { + return + } + const queue = [outputPath]; + while (queue.length > 0) { + const currentPath = queue.shift(); + const currentStats = fs.statSync(currentPath); + + if (currentStats.isDirectory()) { + const files = fs.readdirSync(currentPath); + for (const file of files) { + const filePath = path.join(currentPath, file); + const fileStats = fs.statSync(filePath); + if (fileStats.isDirectory()) { + queue.push(filePath); + } else { + fs.unlinkSync(filePath); // 删除文件 + } + } + if(isDirectoryEmpty(currentPath)) { + fs.rmdirSync(currentPath); + } + } + } +} + +// 保存 +async function saveFile(file, data) { + const outputPath = /^(\.|\/|\\)/.test(file) ? path.join(rootPath, file) : file; + const outputDir = path.dirname(outputPath); + try { + // 创建文件夹 + await fs.promises.mkdir(outputDir, { + recursive: true + }); + + // 使用 Promise 进行写入文件操作 + await fs.promises.writeFile(outputPath, data, "utf8"); + // console.log(`成功保存文件:${outputPath}`); + } catch (error) { + console.error("保存文件时出错:", error); + } +} + +// 可选的选项对象 +const customOptions = { + prefix: "l", // 为图标集设置前缀 + includeSubDirs: true, // 启用扫描子目录中的文件(默认启用) + keyword: (fileName, defaultKeyword, iconSet) => { + // 根据文件名自定义关键字生成 + // 返回关键字或 undefined 以跳过该文件 + return defaultKeyword; + }, + ignoreImportErrors: true, // 禁用未成功导入图标时的错误抛出(默认启用) + keepTitles: false, // 禁用在 SVG 中保留标题(默认禁用) +}; +module.exports = { + encodeSvg, + saveFile, + deleteDirectory: deleteFolderBFS, + customOptions, +}; \ No newline at end of file diff --git a/src/uni_modules/lime-painter/changelog.md b/src/uni_modules/lime-painter/changelog.md new file mode 100644 index 0000000..4ee2a2f --- /dev/null +++ b/src/uni_modules/lime-painter/changelog.md @@ -0,0 +1,221 @@ +## 1.9.6.4(2024-03-10) +- fix: 修复代理ctx导致H5不能使用ctx.save +## 1.9.6.3(2024-03-08) +- fix: 修复支付宝真机无法使用的问题 +## 1.9.6.2(2024-02-22) +- fix: 修复使用render函数报错的问题 +## 1.9.6.1(2023-12-22) +- fix: 修复字节小程序非2d字体偏移 +- fix: 修复`canvasToTempFilePathSync`会触发两次的问题 +- fix: 修复`parser`图片没有宽度的问题 +## 1.9.6(2023-12-06) +- fix: 修复背景图受padding影响 +- fix: 修复因字节报错改了代理实现导致微信报错 +- 1.9.5.8(2023-11-16) +- fix: 修复margin问题 +- fix: 修复borderWidth问题 +- fix: 修复textBox问题 +- fix: 修复字节开发工具报`could not be cloned.`问题 +## 1.9.5.7(2023-07-27) +- fix: 去掉多余的方法 +- chore: 更新文档,增加自定义字体说明 +## 1.9.5.6(2023-07-21) +- feat: 有限的支持富文本 +- feat: H5和APP 增加 `hidpi` prop,主要用于大尺寸无法生成图片时用 +- fix: 修复 钉钉小程序 缺少 `measureText` 方法 +- chore: 由于微信小程序 pc 端的 canvas 2d 时不时抽风,故不使用canvas 2d +## 1.9.5.5(2023-06-27) +- fix: 修复把`emoji`表情字符拆分成多个字符的情况 +## 1.9.5.4(2023-06-05) +- fix: 修复因`canvasToTempFilePathSync`监听导致重复调用 +## 1.9.5.3(2023-05-23) +- fix: 因isPc错写成了isPC导致小程序PC不能生成图片 +## 1.9.5.2(2023-05-22) +- feat: 删除多余文件 +## 1.9.5.1(2023-05-22) +- fix: 修复 文字行数与`line-clamp`相同但不满一行时也加了省略号的问题 +## 1.9.5(2023-05-14) +- feat: 增加 `text-indent` 和 `calc` 方法 +- feat: 优化 布局时间 +## 1.9.4.4(2023-04-15) +- fix: 修复无法匹配负值 +- fix: 修复 Nvue IOS getImageInfo `useCORS` 为 undefined +## 1.9.4.3(2023-04-01) +- feat: 增加支持文字描边 `text-stroke: '5rpx #fff'` +## 1.9.4.2(2023-03-30) +- fix: 修复 支付宝小程序 isPC 在手机也为true的问题 +- feat: 由 微信开发工具 3060 版 无法获取图片尺寸,现 微信开发工具 3220 版 修复该问题,故还原上一版的获取图片方式。 +## 1.9.4.1(2023-03-28) +- fix: 修复固定高度不正确问题 +## 1.9.4(2023-03-17) +- fix: nvue ios getImageInfo缺少this报错 +- fix: pathType 非2d无效问题 +- fix: 修复 小米9se 可能会存在多次init 导致画面多次放大 +- fix: 修复 border 分开写 width style无效问题 +- fix: 修复 支付宝小程序IOS 再次进入不渲染的问题 +- fix: 修复 支付宝小程序安卓Zindex排序错乱问题 +- fix: 修复 微信开发工具 3060 版 无法获取图片的问题 +- feat: 把 for in 改为 forEach +- feat: 增加 hidden +- feat: 根节点 box-sizing 默认 `border-box` +- feat: 增加支持 `vw` `wh` +- chore: pathType 取消 默认值,因为字节开发工具不能显示 +- chore: 支付宝小程序开发工具不支持 生成图片 请以真机调试为准 +- bug: 企业微信 2.20.3无法使用 +## 1.9.3.5(2022-06-29) +- feat: justifyContent 增加 `space-around`、`space-between` +- feat: canvas 2d 也使用`getImageInfo` +- fix: 修复 `text`的 `text-decoration`错位 +## 1.9.3.4(2022-06-20) +- fix: 修复 因创建节点速度问题导致顺序出错。 +- fix: 修复 微信小程序 PC 无法显示本地图片 +- fix: 修复 flex-box 对齐问题 +- feat: 增加 `text-shadow` +- feat: 重写 `text` 对齐方式 +- chore: 更新文档 +## 1.9.3.3(2022-06-17) +- fix: 修复 支付宝小程序 canvas 2d 存在ctx.draw问题导致报错 +- fix: 修复 支付宝小程序 toDataURL 存在权限问题改用 `toTempFilePath` +- fix: 修复 支付宝小程序 image size 问题导致 `objectFit` 无效 +## 1.9.3.2(2022-06-14) +- fix: 修复 image 设置背景色不生效问题 +- fix: 修复 nvue 环境判断缺少参数问题 +## 1.9.3.1(2022-06-14) +- fix: 修复 bottom 定位不对问题 +- fix: 修复 因小数导致计算出错换行问题 +- feat: 增加 `useCORS` h5端图片跨域 在设置请求头无效果后试一下设置这个值 +- chore: 更新文档 +## 1.9.3(2022-06-13) +- feat: 增加 `zIndex` +- feat: 增加 `flex-box` 该功能处于原始阶段,非常简陋。 +- tips: QQ小程序 vue3 不支持, 为 uni 官方BUG +## 1.9.2.9(2022-06-10) +- fix: 修复`text-align`及`margin`居中问题 +## 1.9.2.8(2022-06-10) +- fix: 修复 Nvue `canvasToTempFilePathSync` 不生效问题 +## 1.9.2.7(2022-06-10) +- fix: 修复 margin及padding的bug +- fix: 修复 Nvue `isCanvasToTempFilePath` 不生效问题 +## 1.9.2.6(2022-06-09) +- fix: 修复 Nvue 不显示 +- feat: 增加支持字体渐变 +```html + +``` +## 1.9.2.5(2022-06-09) +- chore: 更变获取父级宽度的设定 +- chore: `pathType` 在canvas 2d 默认为 `url` +## 1.9.2.4(2022-06-08) +- fix: 修复 `pathType` 不生效问题 +## 1.9.2.3(2022-06-08) +- fix: 修复 `canvasToTempFilePath` 漏写 `success` 参数 +## 1.9.2.2(2022-06-07) +- chore: 更新文档 +## 1.9.2.1(2022-06-07) +- fix: 修复 vue3 赋值给this再传入导致image无法绘制 +- fix: 修复 `canvasToTempFilePathSync` 时机问题 +- feat: canvas 2d 更改图片生成方式 `toDataURL` +## 1.9.2(2022-05-30) +- fix: 修复 `canvasToTempFilePathSync` 在 vue3 下只生成一次 +## 1.9.1.7(2022-05-28) +- fix: 修复 `qrcode`显示不全问题 +## 1.9.1.6(2022-05-28) +- fix: 修复 `canvasToTempFilePathSync` 会重复多次问题 +- fix: 修复 `view` css `backgroundImage` 图片下载失败导致 子节点不渲染 +## 1.9.1.5(2022-05-27) +- fix: 修正支付宝小程序 canvas 2d版本号 2.7.15 +## 1.9.1.4(2022-05-22) +- fix: 修复字节小程序无法使用xml方式 +- fix: 修复字节小程序无法使用base64(非2D情况下工具上无法显示) +- fix: 修复支付宝小程序 `canvasToTempFilePath` 报错 +## 1.9.1.3(2022-04-29) +- fix: 修复vue3打包后uni对象为空后的报错 +## 1.9.1.2(2022-04-25) +- fix: 删除多余文件 +## 1.9.1.1(2022-04-25) +- fix: 修复图片不显示问题 +## 1.9.1(2022-04-12) +- fix: 因四舍五入导致有些机型错位 +- fix: 修复无views报错 +- chore: nvue下因ios无法读取插件内static文件,改由下载方式 +## 1.9.0(2022-03-20) +- fix: 因无法固定尺寸导致生成图片不全 +- fix: 特定情况下text判断无效 +- chore: 本地化APP Nvue webview +## 1.8.9(2022-02-20) +- fix: 修复 小程序下载最多10次并发的问题 +- fix: 修复 APP端无法获取本地图片 +- fix: 修复 APP Nvue端不执行问题 +- chore: 增加图片缓存机制 +## 1.8.8.8(2022-01-27) +- fix: 修复 主动调用尺寸问题 +## 1.8.8.6(2022-01-26) +- fix: 修复 nvue 下无宽度时获取父级宽度 +- fix: 修复 ios app 无法渲染问题 +## 1.8.8(2022-01-23) +- fix: 修复 主动调用时无节点问题 +- fix: 修复 `box-shadow` 颜色问题 +- fix: 修复 `transform:rotate` 角度位置问题 +- feat: 增加 `overflow:hidden` +## 1.8.7(2022-01-07) +- fix: 修复 image 方向为 `right` 时原始宽高问题 +- feat: 支持 view 设置背景图 `background-image: url(xxx)` +- chore: 去掉可选链 +## 1.8.6(2021-11-28) +- feat: 支持`view`对`inline-block`的子集使用`text-align` +## 1.8.5.5(2021-08-17) +- chore: 更新文档,删除 replace +- fix: 修复 text 值为 number时报错 +## 1.8.5.4(2021-08-16) +- fix: 字节小程序兼容 +## 1.8.5.3(2021-08-15) +- fix: 修复线性渐变与css现实效果不一致的问题 +- chore: 更新文档 +## 1.8.5.2(2021-08-13) +- chore: 增加`background-image`、`background-repeat` 能力,主要用于背景纹理的绘制,并不是代替`image`。例如:大面积的重复平铺的水印 +- 注意:这个功能H5暂时无法使用,因为[官方的API有BUG](https://ask.dcloud.net.cn/question/128793),待官方修复!!! +## 1.8.5.1(2021-08-10) +- fix: 修复因`margin`报错问题 +## 1.8.5(2021-08-09) +- chore: 增加margin支持`auto`,以达到居中效果 +## 1.8.4(2021-08-06) +- chore: 增加判断缓存文件条件 +- fix: 修复css 多余空格报错问题 +## 1.8.3(2021-08-04) +- tips: 1.6.x 以下的版本升级到1.8.x后要为每个元素都加上定位:position: 'absolute' +- fix: 修复只有一个view子元素时不计算高度的问题 +## 1.8.2(2021-08-03) +- fix: 修复 path-type 为 `url` 无效问题 +- fix: 修复 qrcode `text` 为空时报错问题 +- fix: 修复 image `src` 动态设置时不生效问题 +- feat: 增加 css 属性 `min-width` `max-width` +## 1.8.1(2021-08-02) +- fix: 修复无法加载本地图片 +## 1.8.0(2021-08-02) +- chore 文档更新 +- 使用旧版的同学不要升级! +## 1.8.0-beta(2021-07-30) +- ## 全新布局方式 不兼容旧版! +- chore: 布局方式变更 +- tips: 微信canvas 2d 不支持真机调试 +## 1.6.6(2021-07-09) +- chore: 统一命名规范,无须主动引入组件 +## 1.6.5(2021-06-08) +- chore: 去掉console +## 1.6.4(2021-06-07) +- fix: 修复 数字 为纯字符串时不转换的BUG +## 1.6.3(2021-06-06) +- fix: 修复 PC 端放大的BUG +## 1.6.2(2021-05-31) +- fix: 修复 报`adaptor is not a function`错误 +- fix: 修复 text 多行高度 +- fix: 优化 默认文字的基准线 +- feat: `@progress`事件,监听绘制进度 +## 1.6.1(2021-02-28) +- 删除多余节点 +## 1.6.0(2021-02-26) +- 调整为uni_modules目录规范 +- 修复:transform的rotate不能为负数问题 +- 新增:`pathType` 指定生成图片返回的路径类型,可选值有 `base64`、`url` diff --git a/src/uni_modules/lime-painter/components/common/relation.js b/src/uni_modules/lime-painter/components/common/relation.js new file mode 100644 index 0000000..d6241fa --- /dev/null +++ b/src/uni_modules/lime-painter/components/common/relation.js @@ -0,0 +1,150 @@ +const styles = (v ='') => v.split(';').filter(v => v && !/^[\n\s]+$/.test(v)).map(v => { + const key = v.slice(0, v.indexOf(':')) + const value = v.slice(v.indexOf(':')+1) + return { + [key + .replace(/-([a-z])/g, function() { return arguments[1].toUpperCase()}) + .replace(/\s+/g, '') + ]: value.replace(/^\s+/, '').replace(/\s+$/, '') || '' + } + }) +export function parent(parent) { + return { + provide() { + return { + [parent]: this + } + }, + data() { + return { + el: { + id: null, + css: {}, + views: [] + }, + } + }, + watch: { + css: { + handler(v) { + if(this.canvasId) { + this.el.css = (typeof v == 'object' ? v : v && Object.assign(...styles(v))) || {} + this.canvasWidth = this.el.css && this.el.css.width || this.canvasWidth + this.canvasHeight = this.el.css && this.el.css.height || this.canvasHeight + } + }, + immediate: true + } + } + } +} +export function children(parent, options = {}) { + const indexKey = options.indexKey || 'index' + return { + inject: { + [parent]: { + default: null + } + }, + watch: { + el: { + handler(v, o) { + if(JSON.stringify(v) != JSON.stringify(o)) + this.bindRelation() + }, + deep: true, + immediate: true + }, + src: { + handler(v, o) { + if(v != o) + this.bindRelation() + }, + immediate: true + }, + text: { + handler(v, o) { + if(v != o) this.bindRelation() + }, + immediate: true + }, + css: { + handler(v, o) { + if(v != o) + this.el.css = (typeof v == 'object' ? v : v && Object.assign(...styles(v))) || {} + }, + immediate: true + }, + replace: { + handler(v, o) { + if(JSON.stringify(v) != JSON.stringify(o)) + this.bindRelation() + }, + deep: true, + immediate: true + } + }, + created() { + if(!this._uid) { + this._uid = this._.uid + } + Object.defineProperty(this, 'parent', { + get: () => this[parent] || [], + }) + Object.defineProperty(this, 'index', { + get: () => { + this.bindRelation(); + const {parent: {el: {views=[]}={}}={}} = this + return views.indexOf(this.el) + }, + }); + this.el.type = this.type + if(this.uid) { + this.el.uid = this.uid + } + this.bindRelation() + }, + // #ifdef VUE3 + beforeUnmount() { + this.removeEl() + }, + // #endif + // #ifdef VUE2 + beforeDestroy() { + this.removeEl() + }, + // #endif + methods: { + removeEl() { + if (this.parent) { + this.parent.el.views = this.parent.el.views.filter( + (item) => item._uid !== this._uid + ); + } + }, + bindRelation() { + if(!this.el._uid) { + this.el._uid = this._uid + } + if(['text','qrcode'].includes(this.type)) { + this.el.text = this.$slots && this.$slots.default && this.$slots.default[0].text || `${this.text || ''}`.replace(/\\n/g, '\n') + } + if(this.type == 'image') { + this.el.src = this.src + } + if (!this.parent) { + return; + } + let views = this.parent.el.views || []; + if(views.indexOf(this.el) !== -1) { + this.parent.el.views = views.map(v => v._uid == this._uid ? this.el : v) + } else { + this.parent.el.views = [...views, this.el]; + } + } + }, + mounted() { + // this.bindRelation() + }, + } +} \ No newline at end of file diff --git a/src/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue b/src/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue new file mode 100644 index 0000000..122c430 --- /dev/null +++ b/src/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/src/uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue b/src/uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue new file mode 100644 index 0000000..714d905 --- /dev/null +++ b/src/uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue b/src/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue new file mode 100644 index 0000000..530a8e9 --- /dev/null +++ b/src/uni_modules/lime-painter/components/l-painter-text/l-painter-text.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/src/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue b/src/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue new file mode 100644 index 0000000..996f449 --- /dev/null +++ b/src/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/src/uni_modules/lime-painter/components/l-painter/l-painter.vue b/src/uni_modules/lime-painter/components/l-painter/l-painter.vue new file mode 100644 index 0000000..f9ceb70 --- /dev/null +++ b/src/uni_modules/lime-painter/components/l-painter/l-painter.vue @@ -0,0 +1,461 @@ + + + + diff --git a/src/uni_modules/lime-painter/components/l-painter/nvue.js b/src/uni_modules/lime-painter/components/l-painter/nvue.js new file mode 100644 index 0000000..ec56e94 --- /dev/null +++ b/src/uni_modules/lime-painter/components/l-painter/nvue.js @@ -0,0 +1,191 @@ +// #ifdef APP-NVUE +import { sleep, getImageInfo, isBase64, useNvue, networkReg } from './utils'; +const dom = weex.requireModule('dom') +import { version } from '../../package.json' + +export default { + data() { + return { + tempFilePath: [], + isInitFile: false, + osName: uni.getSystemInfoSync().osName + } + }, + methods: { + getParentWeith() { + return new Promise(resolve => { + dom.getComponentRect(this.$refs.limepainter, (res) => { + this.parentWidth = Math.ceil(res.size.width) + this.canvasWidth = this.canvasWidth || this.parentWidth ||300 + this.canvasHeight = res.size.height || this.canvasHeight||150 + resolve(res.size) + }) + }) + }, + onPageFinish() { + this.webview = this.$refs.webview + this.webview.evalJS(`init(${this.dpr})`) + }, + onMessage(e) { + const res = e.detail.data[0] || null; + if (res.event) { + if (res.event == 'inited') { + this.inited = true + } + if(res.event == 'fail'){ + this.$emit('fail', res) + } + if (res.event == 'layoutChange') { + const data = typeof res.data == 'string' ? JSON.parse(res.data) : res.data + this.canvasWidth = Math.ceil(data.width); + this.canvasHeight = Math.ceil(data.height); + } + if (res.event == 'progressChange') { + this.progress = res.data * 1 + } + if (res.event == 'file') { + this.tempFilePath.push(res.data) + if (this.tempFilePath.length > 7) { + this.tempFilePath.shift() + } + return + } + if (res.event == 'success') { + if (res.data) { + this.tempFilePath.push(res.data) + if (this.tempFilePath.length > 8) { + this.tempFilePath.shift() + } + if (this.isCanvasToTempFilePath) { + this.setFilePath(this.tempFilePath.join(''), {isEmit:true}) + } + } else { + this.$emit('fail', 'canvas no data') + } + return + } + this.$emit(res.event, JSON.parse(res.data)); + } else if (res.file) { + this.file = res.data; + } else{ + console.info(res[0]) + } + }, + getWebViewInited() { + if (this.inited) return Promise.resolve(this.inited); + return new Promise((resolve) => { + this.$watch( + 'inited', + async val => { + if (val) { + resolve(val) + } + }, { + immediate: true + } + ); + }) + }, + getTempFilePath() { + if (this.tempFilePath.length == 8) return Promise.resolve(this.tempFilePath) + return new Promise((resolve) => { + this.$watch( + 'tempFilePath', + async val => { + if (val.length == 8) { + resolve(val.join('')) + } + } + ); + }) + }, + getWebViewDone() { + if (this.progress == 1) return Promise.resolve(this.progress); + return new Promise((resolve) => { + this.$watch( + 'progress', + async val => { + if (val == 1) { + this.$emit('done') + this.done = true + this.runTask() + resolve(val) + } + }, { + immediate: true + } + ); + }) + }, + async render(args) { + try { + await this.getSize(args) + const {width} = args.css || args + if(!width && this.parentWidth) { + Object.assign(args, {width: this.parentWidth}) + } + const newNode = await this.calcImage(args); + await this.getWebViewInited() + this.webview.evalJS(`source(${JSON.stringify(newNode)})`) + await this.getWebViewDone() + await sleep(this.afterDelay) + if (this.isCanvasToTempFilePath) { + const params = { + fileType: this.fileType, + quality: this.quality + } + this.webview.evalJS(`save(${JSON.stringify(params)})`) + } + return Promise.resolve() + } catch (e) { + this.$emit('fail', e) + } + }, + async calcImage(args) { + let node = JSON.parse(JSON.stringify(args)) + const urlReg = /url\((.+)\)/ + const {backgroundImage} = node.css||{} + const isBG = backgroundImage && urlReg.exec(backgroundImage)[1] + const url = node.url || node.src || isBG + if(['text', 'qrcode'].includes(node.type)) { + return node + } + if ((node.type === "image" || isBG) && url && !isBase64(url) && (this.osName == 'ios' || !networkReg.test(url))) { + let {path} = await getImageInfo(url, true) + if (isBG) { + node.css.backgroundImage = `url(${path})` + } else { + node.src = path + } + } else if (node.views && node.views.length) { + for (let i = 0; i < node.views.length; i++) { + node.views[i] = await this.calcImage(node.views[i]) + } + } + return node + }, + async canvasToTempFilePath(args = {}) { + if (!this.inited) { + return this.$emit('fail', 'no init') + } + this.tempFilePath = [] + if (args.fileType == 'jpg') { + args.fileType = 'jpeg' + } + this.webview.evalJS(`save(${JSON.stringify(args)})`) + try { + let tempFilePath = await this.getTempFilePath() + tempFilePath = await this.setFilePath(tempFilePath, args) + args.success({ + errMsg: "canvasToTempFilePath:ok", + tempFilePath + }) + } catch (e) { + args.fail({ + error: e + }) + } + } + } +} +// #endif \ No newline at end of file diff --git a/src/uni_modules/lime-painter/components/l-painter/painter.js b/src/uni_modules/lime-painter/components/l-painter/painter.js new file mode 100644 index 0000000..bd42fc9 --- /dev/null +++ b/src/uni_modules/lime-painter/components/l-painter/painter.js @@ -0,0 +1 @@ +var t=function(){return t=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=360&&(s-=360);s<0&&(s+=360);if(0===(s=Math.round(s)))return{x0:Math.round(e/2)+n,y0:i+r,x1:Math.round(e/2)+n,y1:r};if(180===s)return{x0:Math.round(e/2)+n,y0:r,x1:Math.round(e/2)+n,y1:i+r};if(90===s)return{x0:n,y0:Math.round(i/2)+r,x1:e+n,y1:Math.round(i/2)+r};if(270===s)return{x0:e+n,y0:Math.round(i/2)+r,x1:n,y1:Math.round(i/2)+r};var a=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(s===a)return{x0:n,y0:i+r,x1:e+n,y1:r};if(s===180-a)return{x0:n,y0:r,x1:e+n,y1:i+r};if(s===180+a)return{x0:e+n,y0:r,x1:n,y1:i+r};if(s===360-a)return{x0:e+n,y0:i+r,x1:n,y1:r};var h=0,c=0,f=0,l=0;if(s180-a&&s<180||s>180&&s<180+a||s>360-a){var d=s*Math.PI/180,u=s360-a?i/2:-i/2,p=Math.tan(d)*u,g=s180-a&&s<180?e/2-p:-e/2-p;h=-(f=p+(v=Math.pow(Math.sin(d),2)*g)),c=-(l=u+v/Math.tan(d))}if(s>a&&s<90||s>90&&s<90+a||s>180+a&&s<270||s>270&&s<360-a){var v;d=(90-s)*Math.PI/180,p=s>a&&s<90||s>90&&s<90+a?e/2:-e/2,u=Math.tan(d)*p,g=s>a&&s<90||s>270&&s<360-a?i/2-u:-i/2-u;h=-(f=p+(v=Math.pow(Math.sin(d),2)*g)/Math.tan(d)),c=-(l=u+v)}return h=Math.round(h+e/2)+n,c=Math.round(i/2-c)+r,f=Math.round(f+e/2)+n,l=Math.round(i/2-l)+r,{x0:h,y0:c,x1:f,y1:l}}(r,t,e,i,n),a=s.x0,h=s.y0,c=s.x1,f=s.y1,l=o.createLinearGradient(a,h,c,f),d=r.match(/linear-gradient\((.+)\)/)[1],u=L(d.substring(d.indexOf(",")+1)),p=0;pt.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function C(t){return"number"==typeof t}function H(t){return"auto"===t||null===t}function D(t){return/%$/.test(t)}var Y=p,$=u,U=d,N=g,X=y,_=w,q=m;function G(t){return t.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}))}function V(t,e){var i,n,o=function(t){var e=t.match(/([a-z]+)/)[1];return[e,G(t.split(e)[1])]}(t),s=o[0],a=o[1],h=e.split(" ");if(a)return(i={})[s+a]=e,i;if(h.length&&!a){var c=h[0],f=h[1],l=h[2],d=h[3];return(n={})[s+r[0]]=c,n[s+r[1]]=f||c,n[s+r[2]]=l||c,n[s+r[3]]=d||f||c,n}}function J(t){t=t.trim();for(var e=new Array,i="+",n="",r=t.length,o=0;o0;)"("===t[a+=1]&&(s+=1),")"===t[a]&&(s-=1);n="".concat(J(t.slice(o+1,a))),o=a}if(isNaN(Number(t[o]))&&"."!==t[o]||o===r-1){var h=parseFloat(n);switch(i){case"+":e.push(h);break;case"-":e.push(-h);break;case"*":e.push(e.pop()*h);break;case"/":e.push(e.pop()/h)}i=t[o],n=""}}for(var c=0;e.length;)c+=e.pop();return c}var Q,Z=0,K=function(){function t(){R(this,"elements",[]),R(this,"afterElements",[]),R(this,"beforeElements",[]),R(this,"ids",[]),R(this,"width",0),R(this,"height",0),R(this,"top",0),R(this,"left",0),R(this,"pre",null),R(this,"offsetX",0),R(this,"offsetY",0),Z++,this.id=Z}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){if(!this.ids.includes(t.id)){this.ids.push(t.id),this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()}},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.includes(t.id)||(this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t))},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)this[this.key.height]&&(this.container[this.key.lineMaxHeight]=this[this.key.height]=i),this[this.key.width]+=this.getWidth(t.offsetSize);var n=Math.min(this.getWidth(this),!this.getWidth(this.container.contentSize)&&1/0);(this.container[this.key.lineMaxWidth]||0)1)return 0;var e=t.style.alignSelf,i=this.getHeight(this.container.contentSize),n=i-this.getHeight(t.offsetSize);return"flex-end"===e?n:"center"===e?n/2:"stretch"===e?(n&&t.name==d&&(t.style[this.key.width]=this.getWidth(t.offsetSize),t.style[this.key.height]=i,delete t.line,delete t.lines,t.getBoxWidthHeight()),0):0},r.layout=function(t,e){var i=this;this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements.forEach((function(t,e){i.setIndent(t);var n=i.elements[e-1],r=i.getOffsetY(t);t.style[i.key.top]=i[i.key.top]+r,t.style[i.key.left]=n?n.offsetSize[i.key.left]+i.getWidth(n.offsetSize):i[i.key.left],t.getBoxPosition()}))},n}(K),nt=p,rt=u,ot=d,st=v,at=y,ht=b,ct=w,ft=m,lt=0,dt={left:null,top:null,width:null,height:null},ut=new Map,pt=function(){function t(t,e,i,n){var o=this;R(this,"id",lt++),R(this,"style",{left:null,top:null,width:null,height:null}),R(this,"computedStyle",{}),R(this,"originStyle",{}),R(this,"children",{}),R(this,"layoutBox",F({},dt)),R(this,"contentSize",F({},dt)),R(this,"clientSize",F({},dt)),R(this,"borderSize",F({},dt)),R(this,"offsetSize",F({},dt)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.type||t.name,this.attributes=this.getAttributes(t);var s=function(t,e){var i,n=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],o=t.type,s=void 0===o?U:o,a=t.styles,h=void 0===a?{}:a,c=(e||{}).computedStyle,f=Object.assign({},S);if([$,Y,N].includes(s)&&!h.display&&(f.display=X),c)for(var l=0;l=0&&l<0,Y=c>=0&&u<0;return i==a[0]&&(this[i].left=t.left+s+v+E+(D?2*-l:0),this[i].top=t.top+c+x+W+(Y?2*-u:0),this[i].width=t.width+(this[i].widthAdd?0:C),this[i].height=t.height+(this[i].heightAdd?0:H),this[i].widthAdd=C,this[i].heightAdd=H),i==a[1]&&(this[i].left=t.left+s+E+(D<0?-l:0),this[i].top=t.top+c+W+(Y?-u:0),this[i].width=t.width+v+w,this[i].height=t.height+x+S),i==a[2]&&(this[i].left=t.left+s+E/2+(D<0?-l:0),this[i].top=t.top+c+W/2+(Y?-u:0),this[i].width=t.width+v+w+E/2+F/2,this[i].height=t.height+x+S+T/2+W/2),i==a[3]&&(this[i].left=t.left+(D<0?-l:0),this[i].top=t.top+(Y?-u:0),this[i].width=t.width+v+w+E+F+s+l,this[i].height=t.height+x+S+T+W+u+c),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var r=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var o=e||{},s=o.border,h=(s=void 0===s?{}:s).borderWidth,c=void 0===h?0:h,f=o.borderTop,l=(f=void 0===f?{}:f).borderTopWidth,d=void 0===l?c:l,u=o.borderBottom,p=(u=void 0===u?{}:u).borderBottomWidth,g=void 0===p?c:p,v=o.borderRight,y=(v=void 0===v?{}:v).borderRightWidth,x=void 0===y?c:y,b=o.borderLeft,w=(b=void 0===b?{}:b).borderLeftWidth,m=void 0===w?c:w,S=o.padding,z=(S=void 0===S?{}:S).paddingTop,I=void 0===z?0:z,M=S.paddingRight,k=void 0===M?0:M,B=S.paddingBottom,W=void 0===B?0:B,P=S.paddingLeft,O=void 0===P?0:P;i||(t.width-=O+k+x+m),1!==i||n||(t.height-=I+W+d+g)}this.layoutBox&&(a.forEach((function(i){return r.layoutBox[i]=r.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,r=void 0===n?0:n,o=t.top,s=void 0===o?0:o,a=F({},this.contentSize,{left:r,top:s}),h=this.contentSize.top-this.offsetSize.top,c=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var f,l=E(this.root.fixedLine.elements);!(f=l()).done;){var d=f.value;d.setPosition(d,this.root.offsetSize),d.getBoxPosition()}}if(e)for(var u,p=E(e.elements);!(u=p()).done;){var g=u.value,v=F({},this.borderSize,{left:r,top:s});g.setPosition(g,v);var y=this.borderSize.top-this.offsetSize.top,x=this.borderSize.left-this.offsetSize.left;g.style.left+=r+x,g.style.top+=s+y,g.getBoxPosition()}if(i)for(var b,w=E(i);!(b=w()).done;){b.value.layout(a.top+h,a.left+c)}return this.layoutBoxUpdate(a,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&t.style.display==st},e.isFlex=function(t){return void 0===t&&(t=this),t&&t.style.display==ht},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&(!!t.parent&&(!(!t.parent||t.parent.style.display!==ht)||void 0))},e.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==at},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return{ascent:r,descent:o,width:n,fontHeight:r+o||.7*e+1}},e.getParentSize=function(t,e){if(void 0===t&&(t=this),void 0===e&&(e=!1),t&&t.parent){if(t.parent.contentSize.width)return t.parent.contentSize;if(e)return this.getParentSize(t.parent,e)}return null},e.getBoxWidthHeight=function(){var t=this,e=this.name,i=this.computedStyle,n=this.attributes,r=this.parent,o=void 0===r?{}:r,s=this.ctx,a=this.getChildren(),h=i.left,c=void 0===h?0:h,f=i.top,l=void 0===f?0:f,d=i.bottom,u=i.right,p=i.width,g=void 0===p?0:p,v=i.minWidth,y=i.maxWidth,x=i.minHeight,b=i.maxHeight,w=i.height,m=void 0===w?0:w,S=i.fontSize,z=i.fontWeight,I=i.fontFamily,M=i.fontStyle,k=i.position;i.textIndent;var B=i.lineClamp,P=i.lineHeight,O=i.padding,T=void 0===O?{}:O,L=i.margin,R=void 0===L?{}:L,F=i.border,A=(F=void 0===F?{}:F).borderWidth,j=void 0===A?0:A,E=i.borderRight,C=(E=void 0===E?{}:E).borderRightWidth,Y=void 0===C?j:C,$=i.borderLeft,U=($=void 0===$?{}:$).borderLeftWidth,N=void 0===U?j:U,X=o.contentSize&&o.contentSize.width,_=o.contentSize&&o.contentSize.height;if(D(g)&&X&&(g=W(g,X)),D(g)&&!X&&(g=null),D(m)&&_&&(m=W(m,_)),D(m)&&!_&&(m=null),D(v)&&X&&(v=W(v,X)),D(y)&&X&&(y=W(y,X)),D(x)&&_&&(x=W(x,_)),D(b)&&_&&(b=W(b,_)),i.padding&&X)for(var q in i.padding)Object.hasOwnProperty.call(T,q)&&(T[q]=W(T[q],X));var G=T.paddingRight,V=void 0===G?0:G,J=T.paddingLeft,Q=void 0===J?0:J;if(i.margin&&[R.marginLeft,R.marginRight].includes("auto"))if(g){var Z=X&&X-g-V-Q-N-Y||0;R.marginLeft==R.marginRight?R.marginLeft=R.marginRight=Z/2:H(R.marginLeft)?R.marginLeft=Z:R.marginRight=Z}else R.marginLeft=R.marginRight=0;var tt=R.marginRight,et=void 0===tt?0:tt,st=R.marginLeft,at={width:g,height:m,left:0,top:0},ht=Q+V+N+Y+(void 0===st?0:st)+et;if(this.offsetWidth=ht,e==rt&&!this.attributes.widths){var ft=n.text||"";s.save(),s.setFonts({fontFamily:I,fontSize:S,fontWeight:z,fontStyle:M}),ft.length,"\n"==ft&&(ft="",this.isBr=!0),(""+ft).split("\n").map((function(e){var i=Array.from(e).map((function(e){var i=""+(/^[\u4e00-\u9fa5]+$/.test(e)?"cn":e)+I+S+z+M,n=ut.get(i);if(n)return{width:n,text:e};var r=t.measureText(e,S).width;return ut.set(i,r),{width:r,text:e}})),n=t.measureText(e,S),r=n.fontHeight,o=n.ascent,s=n.descent;t.attributes.fontHeight=r,t.attributes.ascent=o,t.attributes.descent=s,t.attributes.widths||(t.attributes.widths=[]),t.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e.width}),0)})})),s.restore()}if(e==nt&&null==g){var lt=n.width,dt=n.height;at.width=this.contrastSize(Math.round(lt*m/dt)||0,v,y),this.layoutBoxUpdate(at,i,0)}if(e==rt&&null==g){var pt=this.attributes.widths,gt=Math.max.apply(Math,pt.map((function(t){return t.total})));if(o&&X>0&&(gt>X||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed)gt=X;at.width=this.contrastSize(gt,v,y),this.layoutBoxUpdate(at,i,0)}if(e==rt&&(o.style.flex||!this.attributes.lines)){var vt=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e.width>at.width?(vt++,e.width):t+e.width}),0)})),vt=B&&vt>B?B:vt,this.attributes.lines=vt}if(e==nt&&null==m){var yt=n.width,xt=n.height;n.text,at.height=this.contrastSize(W(at.width*xt/yt)||0,x,b),this.layoutBoxUpdate(at,i,1)}e==rt&&null==m&&(P=W(P,S),at.height=this.contrastSize(W(this.attributes.lines*P),x,b),this.layoutBoxUpdate(at,i,1,!0)),!g&&o&&o.children&&X&&(!this.isFlex(o)||o.isFlexCalc)&&([ot,rt].includes(e)&&this.isFlex()||e==ot&&this.isBlock(this)&&this.isInFlow())&&(at.width=this.contrastSize(X-(o.isFlexCalc?0:ht),v,y),this.layoutBoxUpdate(at,i)),g&&!D(g)&&(at.width=this.contrastSize(g,v,y),this.layoutBoxUpdate(at,i,0)),m&&!D(m)&&(at.height=this.contrastSize(at.height,x,b),this.layoutBoxUpdate(at,i,1));var bt=0;if(a.length){var wt=null,mt=!1;a.forEach((function(e,n){e.getBoxWidthHeight();var r=a[n+1];if(r&&r.isInFlow()&&(e.next=r),!t.line||!t.line.ids.includes(e.id))if(e.isInFlow()&&!e.inFlexBox()){var o=t.getBoxState(wt,e);if(e.isBr)return mt=!0;t.line&&t.line.canIEnter(e)&&!o&&!mt?t.line.add(e):(mt=!1,(new K).bind(e)),wt=e}else e.inFlexBox()?t.line&&(t.line.canIEnter(e)||"nowrap"==i.flexWrap)?t.line.add(e):(new it).bind(e):e.isFixed?t.root.fixedLine?t.root.fixedLine.fixedAdd(e):(new K).fixedBind(e):t.fixedLine?t.fixedLine.fixedAdd(e):(new K).fixedBind(e,1)})),this.lines&&(bt=this.lines.reduce((function(t,e){return t+e.height}),0))}var St=0,zt=0;if(!g&&(this.isAbsolute||this.isFixed)&&X){var It=k==ct?X:this.root.width,Mt=It-(D(c)?W(c,It):c)-(D(u)?W(u,It):u);St=i.left?Mt:this.lineMaxWidth}if(!m&&(null!=l?l:this.isAbsolute||this.isFixed&&_)){var kt=k==ct?_:this.root.height,Bt=kt-(D(l)?W(l,kt):l)-(D(d)?W(d,kt):d);zt=i.top?Bt:0}if(g&&!D(g)||at.width||(at.width=St||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?X||o.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,v,y),this.layoutBoxUpdate(at,i,0)),m||!bt&&!zt||(at.height=zt||this.contrastSize(bt,x,b),this.layoutBoxUpdate(at,i)),i.borderRadius&&this.borderSize&&this.borderSize.width)for(var q in i.borderRadius)Object.hasOwnProperty.call(i.borderRadius,q)&&(i.borderRadius[q]=W(i.borderRadius[q],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.root.contentSize=this.contentSize,this.getBoxPosition(),this.offsetSize},t}(),gt=function(){var t,e,i,n,r,o,s=[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28],a=[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177],h=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],c=[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],f=[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175],l=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],d=[],u=[],p=[],g=[],v=[],y=2;function x(t,e){var i;t>e&&(i=t,t=e,e=i),i=e,i*=e,i+=e,i>>=1,g[i+=t]=1}function b(t,i){var n;for(p[t+e*i]=1,n=-2;n<2;n++)p[t+n+e*(i-2)]=1,p[t-2+e*(i+n+1)]=1,p[t+2+e*(i+n)]=1,p[t+n+1+e*(i+2)]=1;for(n=0;n<2;n++)x(t-1,i+n),x(t+1,i-n),x(t-n,i-1),x(t+n,i+1)}function w(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var m=[];function S(t,e,i,n){var r,o,s;for(r=0;re&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,g[i+=t]}function I(t){var i,n,r,o;switch(t){case 0:for(n=0;n>1&1,i=0;i=5&&(i+=3+v[e]-5);for(e=3;et||3*v[e-3]>=4*v[e]||3*v[e+3]>=4*v[e])&&(i+=40);return i}function k(){var t,i,n,r,o,s=0,a=0;for(i=0;ie*e;)h-=e*e,c++;for(s+=10*c,t=0;t1)for(P=s[t],B=e-7;;){for(M=e-7;M>P-3&&(b(M,B),!(M6)for(P=a[t-7],W=17,M=0;M<6;M++)for(B=0;B<3;B++,W--)1&(W>11?t>>W-12:P>>W)?(p[5-M+e*(2-B+e-11)]=1,p[2-B+e-11+e*(5-M)]=1):(x(5-M,2-B+e-11),x(2-B+e-11,5-M));for(B=0;B=(M=r*(i+n)+n)-2&&(O=M-2,t>9&&O--),T=O,t>9){for(d[T+2]=0,d[T+3]=0;T--;)P=d[T],d[T+3]|=255&P<<4,d[T+2]=P>>4;d[2]|=255&O<<4,d[1]=O>>4,d[0]=64|O>>12}else{for(d[T+1]=0,d[T+2]=0;T--;)P=d[T],d[T+2]|=255&P<<4,d[T+1]=P>>4;d[1]|=255&O<<4,d[0]=64|O>>4}for(T=O+3-(t<10);T0;L--)m[L]=m[L]?m[L-1]^l[w(f[m[L]]+T)]:m[L-1];m[0]=l[w(f[m[0]]+T)]}for(T=0;T<=o;T++)m[T]=f[m[T]];for(W=M,B=0,T=0;T>=1)1&B&&(p[e-1-W+8*e]=1,W<6?p[8+e*W]=1:p[8+e*(W+1)]=1);for(W=0;W<7;W++,B>>=1)1&B&&(p[8+e*(e-7+W)]=1,W?p[6-W+8*e]=1:p[7+8*e]=1);return p}(v)},utf16to8:function(t){var e,i,n,r;for(e="",n=t.length,i=0;i=1&&r<=127?e+=t.charAt(i):r>2047?(e+=String.fromCharCode(224|r>>12&15),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|r>>0&63)):(e+=String.fromCharCode(192|r>>6&31),e+=String.fromCharCode(128|r>>0&63));return e},draw:function(t,i,n,r,o){i.drawView(n,r);var s=i.ctx,a=n.contentSize,h=a.width,c=a.height,f=a.left,l=a.top;r.borderRadius,r.backgroundColor;var d=r.color,u=void 0===d?"#000000":d;r.border,n.contentSize.left,n.borderSize.left,n.contentSize.top,n.borderSize.top;if(y=o||y,s){s.save(),i.setOpacity(r),i.setTransform(n,r);var p=Math.min(h,c);t=this.utf16to8(t);var g=this.getFrame(t),v=p/e;s.setFillStyle(u);for(var x=0;x=s||n==c&&o=s)&&(a=e.width/i.width);var f=i.width*a,l=i.height*a,d=r||[],u=d[0],p=d[1],g=B(u)?W(u,e.width):(e.width-f)*(P(u)?W(u,1):{left:0,center:.5,right:1}[u||"center"]),v=B(p)?W(p,e.height):(e.height-l)*(P(p)?W(p,1):{top:0,center:.5,bottom:1}[p||"center"]),y=function(t,e){return[(t-g)/a,(e-v)/a]},x=y(0,0),b=x[0],w=x[1],m=y(e.width,e.height),S=m[0],z=m[1],I=Math.max,M=Math.min;return{sx:I(b,0),sy:I(w,0),sw:M(S-b,i.width),sh:M(z-w,i.height),dx:I(g,0),dy:I(v,0),dw:M(f,e.width),dh:M(l,e.height)}}({objectFit:u,objectPosition:v},r.contentSize,t),o=i.sx,s=i.sy,a=i.sh,h=i.sw,c=i.dx,f=i.dy,l=i.dh,d=i.dw;I==n.MP_BAIDU?e.drawImage(t.src,c+m,f+S,d,l,o,s,h,a):e.drawImage(t.src,o,s,h,a,c+m,f+S,d,l)}else e.drawImage(t.src,m,S,b,w)},O=function(){e.restore(),L.drawView(r,o,!1,!0,!1),h(1)},T=function(t){k(t),O()},T(t),[2]}))}))}))];case 1:return h.sent(),[2]}}))}))},r.prototype.drawText=function(t,e,i,n){var r=this,o=this.ctx,s=e.borderSize,a=e.contentSize,h=e.left,c=e.top,f=a.width,l=a.height,d=a.left-s.left||0,u=a.top-s.top||0,p=i.color,g=i.lineHeight,v=i.fontSize,y=i.fontWeight,x=i.fontFamily,b=i.fontStyle,w=i.textIndent,m=void 0===w?0:w,S=i.textAlign,z=i.textStroke,I=i.verticalAlign,M=void 0===I?mt:I,k=i.backgroundColor,P=i.lineClamp,O=i.backgroundClip,T=i.textShadow,L=i.textDecoration;if(m=B(m)?m:0,this.drawView(e,i,O!=yt),g=W(g,v),t){o.save(),h+=d,c+=u;var R=n.fontHeight,F=n.descent,A=void 0===F?0:F,j=n.ascent,E=A+(void 0===j?0:j);switch(o.setFonts({fontFamily:x,fontSize:v,fontWeight:y,fontStyle:b}),o.setTextBaseline(mt),o.setTextAlign(S),O?this.setBackground(k,f,l,h,c):o.setFillStyle(p),S){case zt:break;case It:h+=.5*f;break;case Mt:h+=f}var C=n.lines*g,H=Math.ceil((l-C)/2);switch(H<0&&(H=0),M){case wt:break;case mt:c+=H;break;case St:c+=2*H}var D=(g-R)/2,Y=g/2,$=function(t){var e=o.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,r=e.actualBoundingBoxAscent;return M==wt?{fix:E?void 0===r?0:r:Y-D/2,lineY:E?0:D-D/2}:M==mt?{fix:E?Y+n/4:Y,lineY:E?0:D}:M==St?{fix:E?g-n:Y+D/2,lineY:E?2*D:D+D/2}:{fix:0,height:0,lineY:0}},U=function(t,e,i){var r=t;switch(S){case zt:r+=i;break;case It:r=(t-=i/2)+i;break;case Mt:r=t,t-=i}if(L){o.setLineWidth(v/13),o.beginPath();var s=.1*n.fontHeight;/\bunderline\b/.test(L)&&(o.moveTo(t,e+n.fontHeight+s),o.lineTo(r,e+n.fontHeight+s)),/\boverline\b/.test(L)&&(o.moveTo(t,e-s),o.lineTo(r,e-s)),/\bline-through\b/.test(L)&&(o.moveTo(t,e+.5*n.fontHeight),o.lineTo(r,e+.5*n.fontHeight)),o.closePath(),o.setStrokeStyle(p),o.stroke()}},N=function(t,e,i){var n=function(){o.setLineWidth(z.width),o.setStrokeStyle(z.color),o.strokeText(t,e,i)},s="outset";z&&z.type!==s?(o.save(),r.setShadow({boxShadow:T}),o.fillText(t,e,i),o.restore(),n()):z&&z.type==s?(o.save(),r.setShadow({boxShadow:T}),n(),o.restore(),o.save(),o.fillText(t,e,i),o.restore()):(r.setShadow({boxShadow:T}),o.fillText(t,e,i))};if(!n.widths||1==n.widths.length&&n.widths[0].total+m<=a.width){var X=$(t),_=X.fix,q=void 0===_?0:_,G=X.lineY;return N(t,h+m,c+q),U(h+m,c+G,n&&n.widths&&n.widths[0].total||n.text),c+=g,o.restore(),void this.setBorder(e,i)}for(var V=c,J=h,Q="",Z=0,K=o.measureText("...").width,tt=n.widths,et=0;eta.width){Z>=P&&(Q+="…"),Z++,nt=0;var ct=$(Q);q=ct.fix,G=ct.lineY;N(Q,J,c+q),U(J,c+G,nt),c+=g,Q=""}else if(rt==it.length-1){et!=tt.length-1&&Z==P&&K+ntV+l||Z>P)break}}o.restore()}},r.prototype.source=function(t){return e(this,void 0,void 0,(function(){var e,n,r,o,s=this;return i(this,(function(i){switch(i.label){case 0:if(this.node=null,e=+new Date,"{}"==JSON.stringify(t))return[2];if(t.styles=t.styles||t.css||{},!t.type)for(n in t.type=bt,t)["views","children","type","css","styles"].includes(n)||(t.styles[n]=t[n],delete t[n]);return t.styles.boxSizing||(t.styles.boxSizing="border-box"),[4,this.create(t)];case 1:return(r=i.sent())?(o=r.layout()||{},this.size=o,this.node=r,this.onEffectFinished().then((function(t){return s.lifecycle("onEffectSuccess",t)})).catch((function(t){return s.lifecycle("onEffectFail",t)})),this.performance&&console.log("布局用时:"+(+new Date-e)+"ms"),[2,this.size]):[2,console.warn("no node")]}}))}))},r.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},r.prototype.create=function(n,r){return e(this,void 0,void 0,(function(){function e(i,n,r){void 0===n&&(n={}),void 0===r&&(r=!0);var o=[];return i.forEach((function(i){var s=i.styles,a=void 0===s?{}:s,h=i.css,c=void 0===h?{}:h,f=i.children,l=void 0===f?[]:f,d=i.views,u=void 0===d?[]:d,p=i.text,g=void 0===p?"":p,v=i.type,y=void 0===v?"":v;!l&&u&&(i.children=l=u);var x={};x=t(t(r?t({},n):{},a),c);var b={},w={},m={};Object.keys(x).map((function(t){if(t.includes("padding")||t.includes("margin")){var e=V(t,x[t]);Object.keys(e).map((function(t){t.includes("Left")?w[t]=e[t]:t.includes("Right")?m[t]=e[t]:b[t]=e[t]}))}}));if(x.textIndent&&(w.textIndent=x.textIndent,delete n.textIndent),""!==g){var S=Array.from(g);S.forEach((function(t,e){var i=Object.assign({},x,b);0===e?Object.assign(i,w):e==S.length-1&&Object.assign(i,m),delete i.padding,delete i.margin,o.push({type:"text",text:t,styles:i})}))}if(y==vt||y==xt)o.push(i);else if("block"===a.display&&l.length>0){var z=e(l,x,!1);i.children=z,i.flattened=!0,o.push(i)}else if(l.length>0){z=e(l,x,r);o=o.concat(z)}})),o}var o,s,a,h,c,f,l,d,u,p,g,v,y,b,w,m,S,z,I,M,k,B,W,P;return i(this,(function(i){switch(i.label){case 0:if(!n)return[2];if(n.styles||(n.styles=n.css||{}),o=n.type,s=n.show,a=void 0===s||s,h=o==vt,c=[yt,xt].includes(o),f="textBox"==o,l=n.styles||{},d=l.backgroundImage,u=l.display,h&&!n.src&&!n.url)return[2];if(u==x||!a)return[2];if(c||f){if(p=n.children,g=n.views,!p&&g&&(n.children=p=g),!n.text&&(!p||p&&!p.length))return[2];p&&p.length&&!n.flattened&&(v=e(n.children||n.views),n.type="view",n.children=v)}if(!(h||n.type==bt&&d))return[3,4];y=h?n.src:"",b=/url\(['"]?(.*?)['"]?\)/.exec(d),d&&b&&b[1]&&(y=b[1]||""),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.getImageInfo(y)];case 2:return w=i.sent(),m=w.width,S=w.height,!(z=w.path)&&h?[2]:(z&&(n.attributes=Object.assign(n.attributes||{},{width:m,height:S,path:z,src:z,naturalSrc:y})),[3,4]);case 3:return I=i.sent(),n.type!=bt?[2]:(this.lifecycle("onEffectFail",t(t({},I),{src:y})),[3,4]);case 4:if(this.count+=1,M=new pt(n,r,this.root,this.ctx),!(k=n.children||n.views))return[3,8];B=0,i.label=5;case 5:return B0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=360&&(s-=360);s<0&&(s+=360);if(0===(s=Math.round(s)))return{x0:Math.round(e/2)+n,y0:i+r,x1:Math.round(e/2)+n,y1:r};if(180===s)return{x0:Math.round(e/2)+n,y0:r,x1:Math.round(e/2)+n,y1:i+r};if(90===s)return{x0:n,y0:Math.round(i/2)+r,x1:e+n,y1:Math.round(i/2)+r};if(270===s)return{x0:e+n,y0:Math.round(i/2)+r,x1:n,y1:Math.round(i/2)+r};var h=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(s===h)return{x0:n,y0:i+r,x1:e+n,y1:r};if(s===180-h)return{x0:n,y0:r,x1:e+n,y1:i+r};if(s===180+h)return{x0:e+n,y0:r,x1:n,y1:i+r};if(s===360-h)return{x0:e+n,y0:i+r,x1:n,y1:r};var a=0,l=0,d=0,c=0;if(s180-h&&s<180||s>180&&s<180+h||s>360-h){var f=s*Math.PI/180,u=s360-h?i/2:-i/2,p=Math.tan(f)*u,g=s180-h&&s<180?e/2-p:-e/2-p;a=-(d=p+(v=Math.pow(Math.sin(f),2)*g)),l=-(c=u+v/Math.tan(f))}if(s>h&&s<90||s>90&&s<90+h||s>180+h&&s<270||s>270&&s<360-h){var v;f=(90-s)*Math.PI/180,p=s>h&&s<90||s>90&&s<90+h?e/2:-e/2,u=Math.tan(f)*p,g=s>h&&s<90||s>270&&s<360-h?i/2-u:-i/2-u;a=-(d=p+(v=Math.pow(Math.sin(f),2)*g)/Math.tan(f)),l=-(c=u+v)}return a=Math.round(a+e/2)+n,l=Math.round(i/2-l)+r,d=Math.round(d+e/2)+n,c=Math.round(i/2-c)+r,{x0:a,y0:l,x1:d,y1:c}}(r,t,e,i,n),h=s.x0,a=s.y0,l=s.x1,d=s.y1,c=o.createLinearGradient(h,a,l,d),f=r.match(/linear-gradient\((.+)\)/)[1],u=L(f.substring(f.indexOf(",")+1)),p=0;pt.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(t){return"number"==typeof t}function C(t){return"auto"===t||null===t}function D(t){return/%$/.test(t)}var Y=p,$=u,U=f,N=g,X=y,_=w,q=m;function G(t){return t.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}))}function V(t,e){var i,n,o=function(t){var e=t.match(/([a-z]+)/)[1];return[e,G(t.split(e)[1])]}(t),s=o[0],h=o[1],a=e.split(" ");if(h)return(i={})[s+h]=e,i;if(a.length&&!h){var l=a[0],d=a[1],c=a[2],f=a[3];return(n={})[s+r[0]]=l,n[s+r[1]]=d||l,n[s+r[2]]=c||l,n[s+r[3]]=f||d||l,n}}function J(t){t=t.trim();for(var e=new Array,i="+",n="",r=t.length,o=0;o0;)"("===t[h+=1]&&(s+=1),")"===t[h]&&(s-=1);n="".concat(J(t.slice(o+1,h))),o=h}if(isNaN(Number(t[o]))&&"."!==t[o]||o===r-1){var a=parseFloat(n);switch(i){case"+":e.push(a);break;case"-":e.push(-a);break;case"*":e.push(e.pop()*a);break;case"/":e.push(e.pop()/a)}i=t[o],n=""}}for(var l=0;e.length;)l+=e.pop();return l}var Q,Z=0,K=function(){function t(){R(this,"elements",[]),R(this,"afterElements",[]),R(this,"beforeElements",[]),R(this,"ids",[]),R(this,"width",0),R(this,"height",0),R(this,"top",0),R(this,"left",0),R(this,"pre",null),R(this,"offsetX",0),R(this,"offsetY",0),Z++,this.id=Z}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){if(!this.ids.includes(t.id)){this.ids.push(t.id),this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()}},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.includes(t.id)||(this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t))},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)this[this.key.height]&&(this.container[this.key.lineMaxHeight]=this[this.key.height]=i),this[this.key.width]+=this.getWidth(t.offsetSize);var n=Math.min(this.getWidth(this),!this.getWidth(this.container.contentSize)&&1/0);(this.container[this.key.lineMaxWidth]||0)1)return 0;var e=t.style.alignSelf,i=this.getHeight(this.container.contentSize),n=i-this.getHeight(t.offsetSize);return"flex-end"===e?n:"center"===e?n/2:"stretch"===e?(n&&t.name==f&&(t.style[this.key.width]=this.getWidth(t.offsetSize),t.style[this.key.height]=i,delete t.line,delete t.lines,t.getBoxWidthHeight()),0):0},r.layout=function(t,e){var i=this;this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements.forEach((function(t,e){i.setIndent(t);var n=i.elements[e-1],r=i.getOffsetY(t);t.style[i.key.top]=i[i.key.top]+r,t.style[i.key.left]=n?n.offsetSize[i.key.left]+i.getWidth(n.offsetSize):i[i.key.left],t.getBoxPosition()}))},n}(K),nt=p,rt=u,ot=f,st=v,ht=y,at=b,lt=w,dt=m,ct=0,ft={left:null,top:null,width:null,height:null},ut=new Map,pt=function(){function t(t,e,i,n){var o=this;R(this,"id",ct++),R(this,"style",{left:null,top:null,width:null,height:null}),R(this,"computedStyle",{}),R(this,"originStyle",{}),R(this,"children",{}),R(this,"layoutBox",F({},ft)),R(this,"contentSize",F({},ft)),R(this,"clientSize",F({},ft)),R(this,"borderSize",F({},ft)),R(this,"offsetSize",F({},ft)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.type||t.name,this.attributes=this.getAttributes(t);var s=function(t,e){var i,n=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],o=t.type,s=void 0===o?U:o,h=t.styles,a=void 0===h?{}:h,l=(e||{}).computedStyle,d=Object.assign({},S);if([$,Y,N].includes(s)&&!a.display&&(d.display=X),l)for(var c=0;c=0&&c<0,Y=l>=0&&u<0;return i==h[0]&&(this[i].left=t.left+s+v+E+(D?2*-c:0),this[i].top=t.top+l+x+k+(Y?2*-u:0),this[i].width=t.width+(this[i].widthAdd?0:H),this[i].height=t.height+(this[i].heightAdd?0:C),this[i].widthAdd=H,this[i].heightAdd=C),i==h[1]&&(this[i].left=t.left+s+E+(D<0?-c:0),this[i].top=t.top+l+k+(Y?-u:0),this[i].width=t.width+v+w,this[i].height=t.height+x+S),i==h[2]&&(this[i].left=t.left+s+E/2+(D<0?-c:0),this[i].top=t.top+l+k/2+(Y?-u:0),this[i].width=t.width+v+w+E/2+F/2,this[i].height=t.height+x+S+T/2+k/2),i==h[3]&&(this[i].left=t.left+(D<0?-c:0),this[i].top=t.top+(Y?-u:0),this[i].width=t.width+v+w+E+F+s+c,this[i].height=t.height+x+S+T+k+u+l),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var r=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var o=e||{},s=o.border,a=(s=void 0===s?{}:s).borderWidth,l=void 0===a?0:a,d=o.borderTop,c=(d=void 0===d?{}:d).borderTopWidth,f=void 0===c?l:c,u=o.borderBottom,p=(u=void 0===u?{}:u).borderBottomWidth,g=void 0===p?l:p,v=o.borderRight,y=(v=void 0===v?{}:v).borderRightWidth,x=void 0===y?l:y,b=o.borderLeft,w=(b=void 0===b?{}:b).borderLeftWidth,m=void 0===w?l:w,S=o.padding,z=(S=void 0===S?{}:S).paddingTop,I=void 0===z?0:z,M=S.paddingRight,B=void 0===M?0:M,W=S.paddingBottom,k=void 0===W?0:W,P=S.paddingLeft,O=void 0===P?0:P;i||(t.width-=O+B+x+m),1!==i||n||(t.height-=I+k+f+g)}this.layoutBox&&(h.forEach((function(i){return r.layoutBox[i]=r.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,r=void 0===n?0:n,o=t.top,s=void 0===o?0:o,h=F({},this.contentSize,{left:r,top:s}),a=this.contentSize.top-this.offsetSize.top,l=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var d,c=E(this.root.fixedLine.elements);!(d=c()).done;){var f=d.value;f.setPosition(f,this.root.offsetSize),f.getBoxPosition()}}if(e)for(var u,p=E(e.elements);!(u=p()).done;){var g=u.value,v=F({},this.borderSize,{left:r,top:s});g.setPosition(g,v);var y=this.borderSize.top-this.offsetSize.top,x=this.borderSize.left-this.offsetSize.left;g.style.left+=r+x,g.style.top+=s+y,g.getBoxPosition()}if(i)for(var b,w=E(i);!(b=w()).done;){b.value.layout(h.top+a,h.left+l)}return this.layoutBoxUpdate(h,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&t.style.display==st},e.isFlex=function(t){return void 0===t&&(t=this),t&&t.style.display==at},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&(!!t.parent&&(!(!t.parent||t.parent.style.display!==at)||void 0))},e.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==ht},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return{ascent:r,descent:o,width:n,fontHeight:r+o||.7*e+1}},e.getParentSize=function(t,e){if(void 0===t&&(t=this),void 0===e&&(e=!1),t&&t.parent){if(t.parent.contentSize.width)return t.parent.contentSize;if(e)return this.getParentSize(t.parent,e)}return null},e.getBoxWidthHeight=function(){var t=this,e=this.name,i=this.computedStyle,n=this.attributes,r=this.parent,o=void 0===r?{}:r,s=this.ctx,h=this.getChildren(),a=i.left,l=void 0===a?0:a,d=i.top,c=void 0===d?0:d,f=i.bottom,u=i.right,p=i.width,g=void 0===p?0:p,v=i.minWidth,y=i.maxWidth,x=i.minHeight,b=i.maxHeight,w=i.height,m=void 0===w?0:w,S=i.fontSize,z=i.fontWeight,I=i.fontFamily,M=i.fontStyle,B=i.position;i.textIndent;var W=i.lineClamp,P=i.lineHeight,O=i.padding,T=void 0===O?{}:O,L=i.margin,R=void 0===L?{}:L,F=i.border,A=(F=void 0===F?{}:F).borderWidth,j=void 0===A?0:A,E=i.borderRight,H=(E=void 0===E?{}:E).borderRightWidth,Y=void 0===H?j:H,$=i.borderLeft,U=($=void 0===$?{}:$).borderLeftWidth,N=void 0===U?j:U,X=o.contentSize&&o.contentSize.width,_=o.contentSize&&o.contentSize.height;if(D(g)&&X&&(g=k(g,X)),D(g)&&!X&&(g=null),D(m)&&_&&(m=k(m,_)),D(m)&&!_&&(m=null),D(v)&&X&&(v=k(v,X)),D(y)&&X&&(y=k(y,X)),D(x)&&_&&(x=k(x,_)),D(b)&&_&&(b=k(b,_)),i.padding&&X)for(var q in i.padding)Object.hasOwnProperty.call(T,q)&&(T[q]=k(T[q],X));var G=T.paddingRight,V=void 0===G?0:G,J=T.paddingLeft,Q=void 0===J?0:J;if(i.margin&&[R.marginLeft,R.marginRight].includes("auto"))if(g){var Z=X&&X-g-V-Q-N-Y||0;R.marginLeft==R.marginRight?R.marginLeft=R.marginRight=Z/2:C(R.marginLeft)?R.marginLeft=Z:R.marginRight=Z}else R.marginLeft=R.marginRight=0;var tt=R.marginRight,et=void 0===tt?0:tt,st=R.marginLeft,ht={width:g,height:m,left:0,top:0},at=Q+V+N+Y+(void 0===st?0:st)+et;if(this.offsetWidth=at,e==rt&&!this.attributes.widths){var dt=n.text||"";s.save(),s.setFonts({fontFamily:I,fontSize:S,fontWeight:z,fontStyle:M}),dt.length,"\n"==dt&&(dt="",this.isBr=!0),(""+dt).split("\n").map((function(e){var i=Array.from(e).map((function(e){var i=""+(/^[\u4e00-\u9fa5]+$/.test(e)?"cn":e)+I+S+z+M,n=ut.get(i);if(n)return{width:n,text:e};var r=t.measureText(e,S).width;return ut.set(i,r),{width:r,text:e}})),n=t.measureText(e,S),r=n.fontHeight,o=n.ascent,s=n.descent;t.attributes.fontHeight=r,t.attributes.ascent=o,t.attributes.descent=s,t.attributes.widths||(t.attributes.widths=[]),t.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e.width}),0)})})),s.restore()}if(e==nt&&null==g){var ct=n.width,ft=n.height;ht.width=this.contrastSize(Math.round(ct*m/ft)||0,v,y),this.layoutBoxUpdate(ht,i,0)}if(e==rt&&null==g){var pt=this.attributes.widths,gt=Math.max.apply(Math,pt.map((function(t){return t.total})));if(o&&X>0&&(gt>X||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed)gt=X;ht.width=this.contrastSize(gt,v,y),this.layoutBoxUpdate(ht,i,0)}if(e==rt&&(o.style.flex||!this.attributes.lines)){var vt=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e.width>ht.width?(vt++,e.width):t+e.width}),0)})),vt=W&&vt>W?W:vt,this.attributes.lines=vt}if(e==nt&&null==m){var yt=n.width,xt=n.height;n.text,ht.height=this.contrastSize(k(ht.width*xt/yt)||0,x,b),this.layoutBoxUpdate(ht,i,1)}e==rt&&null==m&&(P=k(P,S),ht.height=this.contrastSize(k(this.attributes.lines*P),x,b),this.layoutBoxUpdate(ht,i,1,!0)),!g&&o&&o.children&&X&&(!this.isFlex(o)||o.isFlexCalc)&&([ot,rt].includes(e)&&this.isFlex()||e==ot&&this.isBlock(this)&&this.isInFlow())&&(ht.width=this.contrastSize(X-(o.isFlexCalc?0:at),v,y),this.layoutBoxUpdate(ht,i)),g&&!D(g)&&(ht.width=this.contrastSize(g,v,y),this.layoutBoxUpdate(ht,i,0)),m&&!D(m)&&(ht.height=this.contrastSize(ht.height,x,b),this.layoutBoxUpdate(ht,i,1));var bt=0;if(h.length){var wt=null,mt=!1;h.forEach((function(e,n){e.getBoxWidthHeight();var r=h[n+1];if(r&&r.isInFlow()&&(e.next=r),!t.line||!t.line.ids.includes(e.id))if(e.isInFlow()&&!e.inFlexBox()){var o=t.getBoxState(wt,e);if(e.isBr)return mt=!0;t.line&&t.line.canIEnter(e)&&!o&&!mt?t.line.add(e):(mt=!1,(new K).bind(e)),wt=e}else e.inFlexBox()?t.line&&(t.line.canIEnter(e)||"nowrap"==i.flexWrap)?t.line.add(e):(new it).bind(e):e.isFixed?t.root.fixedLine?t.root.fixedLine.fixedAdd(e):(new K).fixedBind(e):t.fixedLine?t.fixedLine.fixedAdd(e):(new K).fixedBind(e,1)})),this.lines&&(bt=this.lines.reduce((function(t,e){return t+e.height}),0))}var St=0,zt=0;if(!g&&(this.isAbsolute||this.isFixed)&&X){var It=B==lt?X:this.root.width,Mt=It-(D(l)?k(l,It):l)-(D(u)?k(u,It):u);St=i.left?Mt:this.lineMaxWidth}if(!m&&(null!=c?c:this.isAbsolute||this.isFixed&&_)){var Bt=B==lt?_:this.root.height,Wt=Bt-(D(c)?k(c,Bt):c)-(D(f)?k(f,Bt):f);zt=i.top?Wt:0}if(g&&!D(g)||ht.width||(ht.width=St||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?X||o.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,v,y),this.layoutBoxUpdate(ht,i,0)),m||!bt&&!zt||(ht.height=zt||this.contrastSize(bt,x,b),this.layoutBoxUpdate(ht,i)),i.borderRadius&&this.borderSize&&this.borderSize.width)for(var q in i.borderRadius)Object.hasOwnProperty.call(i.borderRadius,q)&&(i.borderRadius[q]=k(i.borderRadius[q],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.root.contentSize=this.contentSize,this.getBoxPosition(),this.offsetSize},t}(),gt=p,vt=u,yt=g,xt=f,bt=d.TOP,wt=d.MIDDLE,mt=d.BOTTOM,St=c.LEFT,zt=c.CENTER,It=c.RIGHT,Mt=function(){function r(t){var e,i,r=this;this.v="1.9.5.1",this.id=null,this.pixelRatio=1,this.width=0,this.height=0,this.sleep=1e3/30,this.count=0,this.isRate=!1,this.isDraw=!0,this.isCache=!0,this.fixed="",this.useCORS=!1,this.performance=!1,this.imageBus=[],this.createImage=function(t,e){return new Promise((function(i,n){var o=null;window||r.canvas.createImage?(o=r.canvas&&r.canvas.createImage?r.canvas.createImage():new Image,e&&o.setAttribute("crossOrigin","Anonymous"),o.src=t,o.onload=function(){i({width:o.naturalWidth||o.width,height:o.naturalHeight||o.height,path:o,src:this.src})},o.onerror=function(t){n(t)}):n({fail:"getImageInfo fail",src:t})}))},this.options=t,Object.assign(this,t),this.ctx=(e=t.context,i={get:function(t,i){if("setFonts"===i)return function(t){var i=t.fontFamily,r=void 0===i?"sans-serif":i,o=t.fontSize,s=void 0===o?14:o,h=t.fontWeight,a=void 0===h?"normal":h,l=t.fontStyle,d=void 0===l?"normal":l;I==n.MP_TOUTIAO&&(a="bold"==a?"bold":"",d="italic"==d?"italic":""),e.font="".concat(d," ").concat(a," ").concat(Math.round(s),"px ").concat(r)};if(!e.draw||!e.setFillStyle){if("setFillStyle"===i)return function(t){e.fillStyle=t};if("setStrokeStyle"===i)return function(t){e.strokeStyle=t};if("setLineWidth"===i)return function(t){e.lineWidth=t};if("setLineCap"===i)return function(t){e.lineCap=t};if("setFontSize"===i)return function(t){e.font="".concat(String(t),"px sans-serif")};if("setGlobalAlpha"===i)return function(t){e.globalAlpha=t};if("setLineJoin"===i)return function(t){e.lineJoin=t};if("setTextAlign"===i)return function(t){e.textAlign=t};if("setMiterLimit"===i)return function(t){e.miterLimit=t};if("setShadow"===i)return function(t,i,n,r){e.shadowOffsetX=t,e.shadowOffsetY=i,e.shadowBlur=n,e.shadowColor=r};if("setTextBaseline"===i)return function(t){e.textBaseline=t};if("createCircularGradient"===i)return function(){};if("draw"===i)return function(){};if("function"==typeof e[i])return function(){for(var t=[],n=0;n=s||n==l&&o=s)&&(h=e.width/i.width);var d=i.width*h,c=i.height*h,f=r||[],u=f[0],p=f[1],g=W(u)?k(u,e.width):(e.width-d)*(P(u)?k(u,1):{left:0,center:.5,right:1}[u||"center"]),v=W(p)?k(p,e.height):(e.height-c)*(P(p)?k(p,1):{top:0,center:.5,bottom:1}[p||"center"]),y=function(t,e){return[(t-g)/h,(e-v)/h]},x=y(0,0),b=x[0],w=x[1],m=y(e.width,e.height),S=m[0],z=m[1],I=Math.max,M=Math.min;return{sx:I(b,0),sy:I(w,0),sw:M(S-b,i.width),sh:M(z-w,i.height),dx:I(g,0),dy:I(v,0),dw:M(d,e.width),dh:M(c,e.height)}}({objectFit:u,objectPosition:v},r.contentSize,t),o=i.sx,s=i.sy,h=i.sh,a=i.sw,l=i.dx,d=i.dy,c=i.dh,f=i.dw;I==n.MP_BAIDU?e.drawImage(t.src,l+m,d+S,f,c,o,s,a,h):e.drawImage(t.src,o,s,a,h,l+m,d+S,f,c)}else e.drawImage(t.src,m,S,b,w)},O=function(){e.restore(),L.drawView(r,o,!1,!0,!1),a(1)},T=function(t){B(t),O()},T(t),[2]}))}))}))];case 1:return a.sent(),[2]}}))}))},r.prototype.drawText=function(t,e,i,n){var r=this,o=this.ctx,s=e.borderSize,h=e.contentSize,a=e.left,l=e.top,d=h.width,c=h.height,f=h.left-s.left||0,u=h.top-s.top||0,p=i.color,g=i.lineHeight,v=i.fontSize,y=i.fontWeight,x=i.fontFamily,b=i.fontStyle,w=i.textIndent,m=void 0===w?0:w,S=i.textAlign,z=i.textStroke,I=i.verticalAlign,M=void 0===I?wt:I,B=i.backgroundColor,P=i.lineClamp,O=i.backgroundClip,T=i.textShadow,L=i.textDecoration;if(m=W(m)?m:0,this.drawView(e,i,O!=vt),g=k(g,v),t){o.save(),a+=f,l+=u;var R=n.fontHeight,F=n.descent,A=void 0===F?0:F,j=n.ascent,E=A+(void 0===j?0:j);switch(o.setFonts({fontFamily:x,fontSize:v,fontWeight:y,fontStyle:b}),o.setTextBaseline(wt),o.setTextAlign(S),O?this.setBackground(B,d,c,a,l):o.setFillStyle(p),S){case St:break;case zt:a+=.5*d;break;case It:a+=d}var H=n.lines*g,C=Math.ceil((c-H)/2);switch(C<0&&(C=0),M){case bt:break;case wt:l+=C;break;case mt:l+=2*C}var D=(g-R)/2,Y=g/2,$=function(t){var e=o.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,r=e.actualBoundingBoxAscent;return M==bt?{fix:E?void 0===r?0:r:Y-D/2,lineY:E?0:D-D/2}:M==wt?{fix:E?Y+n/4:Y,lineY:E?0:D}:M==mt?{fix:E?g-n:Y+D/2,lineY:E?2*D:D+D/2}:{fix:0,height:0,lineY:0}},U=function(t,e,i){var r=t;switch(S){case St:r+=i;break;case zt:r=(t-=i/2)+i;break;case It:r=t,t-=i}if(L){o.setLineWidth(v/13),o.beginPath();var s=.1*n.fontHeight;/\bunderline\b/.test(L)&&(o.moveTo(t,e+n.fontHeight+s),o.lineTo(r,e+n.fontHeight+s)),/\boverline\b/.test(L)&&(o.moveTo(t,e-s),o.lineTo(r,e-s)),/\bline-through\b/.test(L)&&(o.moveTo(t,e+.5*n.fontHeight),o.lineTo(r,e+.5*n.fontHeight)),o.closePath(),o.setStrokeStyle(p),o.stroke()}},N=function(t,e,i){var n=function(){o.setLineWidth(z.width),o.setStrokeStyle(z.color),o.strokeText(t,e,i)},s="outset";z&&z.type!==s?(o.save(),r.setShadow({boxShadow:T}),o.fillText(t,e,i),o.restore(),n()):z&&z.type==s?(o.save(),r.setShadow({boxShadow:T}),n(),o.restore(),o.save(),o.fillText(t,e,i),o.restore()):(r.setShadow({boxShadow:T}),o.fillText(t,e,i))};if(!n.widths||1==n.widths.length&&n.widths[0].total+m<=h.width){var X=$(t),_=X.fix,q=void 0===_?0:_,G=X.lineY;return N(t,a+m,l+q),U(a+m,l+G,n&&n.widths&&n.widths[0].total||n.text),l+=g,o.restore(),void this.setBorder(e,i)}for(var V=l,J=a,Q="",Z=0,K=o.measureText("...").width,tt=n.widths,et=0;eth.width){Z>=P&&(Q+="…"),Z++,nt=0;var lt=$(Q);q=lt.fix,G=lt.lineY;N(Q,J,l+q),U(J,l+G,nt),l+=g,Q=""}else if(rt==it.length-1){et!=tt.length-1&&Z==P&&K+ntV+c||Z>P)break}}o.restore()}},r.prototype.source=function(t){return e(this,void 0,void 0,(function(){var e,n,r,o,s=this;return i(this,(function(i){switch(i.label){case 0:if(this.node=null,e=+new Date,"{}"==JSON.stringify(t))return[2];if(!t.type)for(n in t.type=xt,t.styles=t.styles||t.css||{},t)["views","children","type","css","styles"].includes(n)||(t.styles[n]=t[n],delete t[n]);return t.styles.boxSizing||(t.styles.boxSizing="border-box"),[4,this.create(t)];case 1:return(r=i.sent())?(o=r.layout()||{},this.size=o,this.node=r,this.onEffectFinished().then((function(t){return s.lifecycle("onEffectSuccess",t)})).catch((function(t){return s.lifecycle("onEffectFail",t)})),this.performance&&console.log("布局用时:"+(+new Date-e)+"ms"),[2,this.size]):[2,console.warn("no node")]}}))}))},r.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},r.prototype.create=function(n,r){return e(this,void 0,void 0,(function(){function e(i,n,r){void 0===n&&(n={}),void 0===r&&(r=!0);var o=[];return i.forEach((function(i){var s=i.styles,h=void 0===s?{}:s,a=i.children,l=void 0===a?[]:a,d=i.text,c=void 0===d?"":d,f=i.type,u=void 0===f?"":f,p={};p=t(r?t({},n):{},h);var g={},v={},y={};Object.keys(p).map((function(t){if(t.includes("padding")||t.includes("margin")){var e=V(t,p[t]);Object.keys(e).map((function(t){t.includes("Left")?v[t]=e[t]:t.includes("Right")?y[t]=e[t]:g[t]=e[t]}))}}));if(p.textIndent&&(v.textIndent=p.textIndent,delete n.textIndent),""!==c){var x=Array.from(c);x.forEach((function(t,e){var i=Object.assign({},p,g);0===e?Object.assign(i,v):e==x.length-1&&Object.assign(i,y),delete i.padding,delete i.margin,o.push({type:"text",text:t,styles:i})}))}if(u==gt||u==yt)o.push(i);else if("block"===h.display&&l.length>0){var b=e(l,p,!1);i.children=b,i.flattened=!0,o.push(i)}else if(l.length>0){b=e(l,p,r);o=o.concat(b)}})),o}var o,s,h,a,l,d,c,f,u,p,g,v,y,b,w,m,S,z,I,M,B;return i(this,(function(i){switch(i.label){case 0:if(!n)return[2];if(n.styles||(n.styles=n.css||{}),o=n.type,s=o==gt,h=[vt,yt].includes(o),a="textBox"==o,l=n.styles||{},d=l.backgroundImage,c=l.display,s&&!n.src&&!n.url)return[2];if(c==x)return[2];if(h||a){if(f=n.children,!n.text&&(!f||f&&!f.length))return[2];f&&f.length&&!n.flattened&&(u=e(n.children),n.type="view",n.children=u)}if(!(s||n.type==xt&&d))return[3,4];p=s?n.src:"",g=/url\(['"]?(.*?)['"]?\)/.exec(d),d&&g&&g[1]&&(p=g[1]||""),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.getImageInfo(p)];case 2:return v=i.sent(),y=v.width,b=v.height,!(w=v.path)&&s?[2]:(w&&(n.attributes=Object.assign(n.attributes||{},{width:y,height:b,path:w,src:w,naturalSrc:p})),[3,4]);case 3:return m=i.sent(),n.type!=xt?[2]:(this.lifecycle("onEffectFail",t(t({},m),{src:p})),[3,4]);case 4:if(this.count+=1,S=new pt(n,r,this.root,this.ctx),!(z=n.views||n.children))return[3,8];I=0,i.label=5;case 5:return I /^data:image\/(\w+);base64/.test(path); +export function sleep(delay) { + return new Promise(resolve => setTimeout(resolve, delay)) +} +let {platform, SDKVersion} = uni.getSystemInfoSync() +export const isPC = /windows|mac/.test(platform) +// 缓存图片 +let cache = {} +export function isNumber(value) { + return /^-?\d+(\.\d+)?$/.test(value); +} +export function toPx(value, baseSize, isDecimal = false) { + // 如果是数字 + if (typeof value === 'number') { + return value + } + // 如果是字符串数字 + if (isNumber(value)) { + return value * 1 + } + // 如果有单位 + if (typeof value === 'string') { + const reg = /^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g + const results = reg.exec(value); + if (!value || !results) { + return 0; + } + const unit = results[3]; + value = parseFloat(value); + let res = 0; + if (unit === 'rpx') { + res = uni.upx2px(value); + } else if (unit === 'px') { + res = value * 1; + } else if (unit === '%') { + res = value * toPx(baseSize) / 100; + } else if (unit === 'em') { + res = value * toPx(baseSize || 14); + } + return isDecimal ? res.toFixed(2) * 1 : Math.round(res); + } + return 0 +} + +// 计算版本 +export function compareVersion(v1, v2) { + v1 = v1.split('.') + v2 = v2.split('.') + const len = Math.max(v1.length, v2.length) + while (v1.length < len) { + v1.push('0') + } + while (v2.length < len) { + v2.push('0') + } + for (let i = 0; i < len; i++) { + const num1 = parseInt(v1[i], 10) + const num2 = parseInt(v2[i], 10) + + if (num1 > num2) { + return 1 + } else if (num1 < num2) { + return -1 + } + } + return 0 +} + +function gte(version) { + // #ifdef MP-ALIPAY + SDKVersion = my.SDKVersion + // #endif + return compareVersion(SDKVersion, version) >= 0; +} +export function canIUseCanvas2d() { + // #ifdef MP-WEIXIN + return gte('2.9.2'); + // #endif + // #ifdef MP-ALIPAY + return gte('2.7.15'); + // #endif + // #ifdef MP-TOUTIAO + return gte('1.78.0'); + // #endif + return false +} + +// #ifdef MP +export const prefix = () => { + // #ifdef MP-TOUTIAO + return tt + // #endif + // #ifdef MP-WEIXIN + return wx + // #endif + // #ifdef MP-BAIDU + return swan + // #endif + // #ifdef MP-ALIPAY + return my + // #endif + // #ifdef MP-QQ + return qq + // #endif + // #ifdef MP-360 + return qh + // #endif +} +// #endif + + + +/** + * base64转路径 + * @param {Object} base64 + */ +export function base64ToPath(base64) { + const [, format] = /^data:image\/(\w+);base64,/.exec(base64) || []; + + return new Promise((resolve, reject) => { + // #ifdef MP + const fs = uni.getFileSystemManager() + //自定义文件名 + if (!format) { + reject(new Error('ERROR_BASE64SRC_PARSE')) + } + const time = new Date().getTime(); + let pre = prefix() + // #ifdef MP-TOUTIAO + const filePath = `${pre.getEnvInfoSync().common.USER_DATA_PATH}/${time}.${format}` + // #endif + // #ifndef MP-TOUTIAO + const filePath = `${pre.env.USER_DATA_PATH}/${time}.${format}` + // #endif + fs.writeFile({ + filePath, + data: base64.split(',')[1], + encoding: 'base64', + success() { + resolve(filePath) + }, + fail(err) { + console.error(err) + reject(err) + } + }) + // #endif + + // #ifdef H5 + // mime类型 + let mimeString = base64.split(',')[0].split(':')[1].split(';')[0]; + //base64 解码 + let byteString = atob(base64.split(',')[1]); + //创建缓冲数组 + let arrayBuffer = new ArrayBuffer(byteString.length); + //创建视图 + let intArray = new Uint8Array(arrayBuffer); + for (let i = 0; i < byteString.length; i++) { + intArray[i] = byteString.charCodeAt(i); + } + resolve(URL.createObjectURL(new Blob([intArray], { + type: mimeString + }))) + // #endif + + // #ifdef APP-PLUS + const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now()) + bitmap.loadBase64Data(base64, () => { + if (!format) { + reject(new Error('ERROR_BASE64SRC_PARSE')) + } + const time = new Date().getTime(); + const filePath = `_doc/uniapp_temp/${time}.${format}` + bitmap.save(filePath, {}, + () => { + bitmap.clear() + resolve(filePath) + }, + (error) => { + bitmap.clear() + reject(error) + }) + }, (error) => { + bitmap.clear() + reject(error) + }) + // #endif + }) +} + +/** + * 路径转base64 + * @param {Object} string + */ +export function pathToBase64(path) { + if (/^data:/.test(path)) return path + return new Promise((resolve, reject) => { + // #ifdef H5 + let image = new Image(); + image.setAttribute("crossOrigin", 'Anonymous'); + image.onload = function() { + let canvas = document.createElement('canvas'); + canvas.width = this.naturalWidth; + canvas.height = this.naturalHeight; + canvas.getContext('2d').drawImage(image, 0, 0); + let result = canvas.toDataURL('image/png') + resolve(result); + canvas.height = canvas.width = 0 + } + image.src = path + '?v=' + Math.random() + image.onerror = (error) => { + reject(error); + }; + // #endif + + // #ifdef MP + if (uni.canIUse('getFileSystemManager')) { + uni.getFileSystemManager().readFile({ + filePath: path, + encoding: 'base64', + success: (res) => { + resolve('data:image/png;base64,' + res.data) + }, + fail: (error) => { + console.error({error, path}) + reject(error) + } + }) + } + // #endif + + // #ifdef APP-PLUS + plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), (entry) => { + entry.file((file) => { + const fileReader = new plus.io.FileReader() + fileReader.onload = (data) => { + resolve(data.target.result) + } + fileReader.onerror = (error) => { + reject(error) + } + fileReader.readAsDataURL(file) + }, reject) + }, reject) + // #endif + }) +} + + + +export function getImageInfo(path, useCORS) { + const isCanvas2D = this && this.canvas && this.canvas.createImage + return new Promise(async (resolve, reject) => { + // let time = +new Date() + let src = path.replace(/^@\//,'/') + if (cache[path] && cache[path].errMsg) { + resolve(cache[path]) + } else { + try { + // #ifdef MP || APP-PLUS + if (isBase64(path) && (isCanvas2D ? isPC : true)) { + src = await base64ToPath(path) + } + // #endif + // #ifdef H5 + if(useCORS) { + src = await pathToBase64(path) + } + // #endif + } catch (error) { + reject({ + ...error, + src + }) + } + // #ifndef APP-NVUE + if(isCanvas2D && !isPC) { + const img = this.canvas.createImage() + img.onload = function() { + const image = { + path: img, + width: img.width, + height: img.height + } + cache[path] = image + resolve(cache[path]) + } + img.onerror = function(err) { + reject({err,path}) + } + img.src = src + return + } + // #endif + uni.getImageInfo({ + src, + success: (image) => { + const localReg = /^\.|^\/(?=[^\/])/; + // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-TOUTIAO + image.path = localReg.test(src) ? `/${image.path}` : image.path; + // #endif + if(isCanvas2D) { + const img = this.canvas.createImage() + img.onload = function() { + image.path = img + cache[path] = image + resolve(cache[path]) + } + img.onerror = function(err) { + reject({err,path}) + } + img.src = src + return + } + // #ifdef APP-PLUS + // console.log('getImageInfo', +new Date() - time) + // ios 比较严格 可能需要设置跨域 + if(uni.getSystemInfoSync().osName == 'ios' && useCORS) { + pathToBase64(image.path).then(base64 => { + image.path = base64 + cache[path] = image + resolve(cache[path]) + }).catch(err => { + console.error({err, path}) + reject({err,path}) + }) + return + } + // #endif + cache[path] = image + resolve(cache[path]) + }, + fail(err) { + console.error({err, path}) + reject({err,path}) + } + }) + } + }) +} + + +// #ifdef APP-PLUS +const getLocalFilePath = (path) => { + if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path + .indexOf('_downloads') === 0) { + return path + } + if (path.indexOf('file://') === 0) { + return path + } + if (path.indexOf('/storage/emulated/0/') === 0) { + return path + } + if (path.indexOf('/') === 0) { + const localFilePath = plus.io.convertAbsoluteFileSystem(path) + if (localFilePath !== path) { + return localFilePath + } else { + path = path.substr(1) + } + } + return '_www/' + path +} +// #endif + + diff --git a/src/uni_modules/lime-painter/components/lime-painter/lime-painter.vue b/src/uni_modules/lime-painter/components/lime-painter/lime-painter.vue new file mode 100644 index 0000000..f318a28 --- /dev/null +++ b/src/uni_modules/lime-painter/components/lime-painter/lime-painter.vue @@ -0,0 +1,235 @@ + + + + + diff --git a/src/uni_modules/lime-painter/hybrid/html/index.html b/src/uni_modules/lime-painter/hybrid/html/index.html new file mode 100644 index 0000000..331c535 --- /dev/null +++ b/src/uni_modules/lime-painter/hybrid/html/index.html @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/uni_modules/lime-painter/hybrid/html/painter.js b/src/uni_modules/lime-painter/hybrid/html/painter.js new file mode 100644 index 0000000..fc3e2c2 --- /dev/null +++ b/src/uni_modules/lime-painter/hybrid/html/painter.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Painter={})}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=360&&(s-=360);s<0&&(s+=360);if(0===(s=Math.round(s)))return{x0:Math.round(e/2)+n,y0:i+r,x1:Math.round(e/2)+n,y1:r};if(180===s)return{x0:Math.round(e/2)+n,y0:r,x1:Math.round(e/2)+n,y1:i+r};if(90===s)return{x0:n,y0:Math.round(i/2)+r,x1:e+n,y1:Math.round(i/2)+r};if(270===s)return{x0:e+n,y0:Math.round(i/2)+r,x1:n,y1:Math.round(i/2)+r};var a=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(s===a)return{x0:n,y0:i+r,x1:e+n,y1:r};if(s===180-a)return{x0:n,y0:r,x1:e+n,y1:i+r};if(s===180+a)return{x0:e+n,y0:r,x1:n,y1:i+r};if(s===360-a)return{x0:e+n,y0:i+r,x1:n,y1:r};var h=0,c=0,f=0,d=0;if(s180-a&&s<180||s>180&&s<180+a||s>360-a){var l=s*Math.PI/180,u=s360-a?i/2:-i/2,p=Math.tan(l)*u,g=s180-a&&s<180?e/2-p:-e/2-p;h=-(f=p+(v=Math.pow(Math.sin(l),2)*g)),c=-(d=u+v/Math.tan(l))}if(s>a&&s<90||s>90&&s<90+a||s>180+a&&s<270||s>270&&s<360-a){var v;l=(90-s)*Math.PI/180,p=s>a&&s<90||s>90&&s<90+a?e/2:-e/2,u=Math.tan(l)*p,g=s>a&&s<90||s>270&&s<360-a?i/2-u:-i/2-u;h=-(f=p+(v=Math.pow(Math.sin(l),2)*g)/Math.tan(l)),c=-(d=u+v)}return h=Math.round(h+e/2)+n,c=Math.round(i/2-c)+r,f=Math.round(f+e/2)+n,d=Math.round(i/2-d)+r,{x0:h,y0:c,x1:f,y1:d}}(r,t,e,i,n),a=s.x0,h=s.y0,c=s.x1,f=s.y1,d=o.createLinearGradient(a,h,c,f),l=r.match(/linear-gradient\((.+)\)/)[1],u=X(l.substring(l.indexOf(",")+1)),p=0;pt.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Z(t){return"number"==typeof t}function K(t){return"auto"===t||null===t}function et(t){return/%$/.test(t)}var it=I,nt=z,rt=S,ot=M,st=B,at=O,ht=T;function ct(t){return t.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}))}function ft(t,e){var i,n,r=function(t){var e=t.match(/([a-z]+)/)[1];return[e,ct(t.split(e)[1])]}(t),o=r[0],s=r[1],a=e.split(" ");if(s)return(i={})[o+s]=e,i;if(a.length&&!s){var h=a[0],c=a[1],f=a[2],l=a[3];return(n={})[o+d[0]]=h,n[o+d[1]]=c||h,n[o+d[2]]=f||h,n[o+d[3]]=l||c||h,n}}function dt(t){t=t.trim();for(var e=new Array,i="+",n="",r=t.length,o=0;o0;)"("===t[a+=1]&&(s+=1),")"===t[a]&&(s-=1);n="".concat(dt(t.slice(o+1,a))),o=a}if(isNaN(Number(t[o]))&&"."!==t[o]||o===r-1){var h=parseFloat(n);switch(i){case"+":e.push(h);break;case"-":e.push(-h);break;case"*":e.push(e.pop()*h);break;case"/":e.push(e.pop()/h)}i=t[o],n=""}}for(var c=0;e.length;)c+=e.pop();return c}var lt,ut=0,pt=function(){function t(){q(this,"elements",[]),q(this,"afterElements",[]),q(this,"beforeElements",[]),q(this,"ids",[]),q(this,"width",0),q(this,"height",0),q(this,"top",0),q(this,"left",0),q(this,"pre",null),q(this,"offsetX",0),q(this,"offsetY",0),ut++,this.id=ut}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){if(!this.ids.includes(t.id)){this.ids.push(t.id),this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()}},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.includes(t.id)||(this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t))},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)this[this.key.height]&&(this.container[this.key.lineMaxHeight]=this[this.key.height]=i),this[this.key.width]+=this.getWidth(t.offsetSize);var n=Math.min(this.getWidth(this),!this.getWidth(this.container.contentSize)&&1/0);(this.container[this.key.lineMaxWidth]||0)1)return 0;var e=t.style.alignSelf,i=this.getHeight(this.container.contentSize),n=i-this.getHeight(t.offsetSize);return e===f?n:e===h?n/2:"stretch"===e?(n&&t.name==S&&(t.style[this.key.width]=this.getWidth(t.offsetSize),t.style[this.key.height]=i,delete t.line,delete t.lines,t.getBoxWidthHeight()),0):0},r.layout=function(t,e){var i=this;this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements.forEach((function(t,e){i.setIndent(t);var n=i.elements[e-1],r=i.getOffsetY(t);t.style[i.key.top]=i[i.key.top]+r,t.style[i.key.left]=n?n.offsetSize[i.key.left]+i.getWidth(n.offsetSize):i[i.key.left],t.getBoxPosition()}))},n}(pt),xt=I,wt=z,mt=S,St=k,zt=B,It=P,Mt=O,kt=T,Bt=0,Wt={left:null,top:null,width:null,height:null},Pt=new Map,Ot=function(){function t(t,e,i,n){var r=this;q(this,"id",Bt++),q(this,"style",{left:null,top:null,width:null,height:null}),q(this,"computedStyle",{}),q(this,"originStyle",{}),q(this,"children",{}),q(this,"layoutBox",G({},Wt)),q(this,"contentSize",G({},Wt)),q(this,"clientSize",G({},Wt)),q(this,"borderSize",G({},Wt)),q(this,"offsetSize",G({},Wt)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.type||t.name,this.attributes=this.getAttributes(t);var o=function(t,e){var i,n=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],r=t.type,o=void 0===r?rt:r,s=t.styles,h=void 0===s?{}:s,c=(e||{}).computedStyle,f=Object.assign({},F);if([nt,it,ot].includes(o)&&!h.display&&(f.display=st),c)for(var l=0;l=0&&f<0,Y=h>=0&&l<0;return i==y[0]&&(this[i].left=t.left+s+g+j+(D?2*-f:0),this[i].top=t.top+h+b+W+(Y?2*-l:0),this[i].width=t.width+(this[i].widthAdd?0:C),this[i].height=t.height+(this[i].heightAdd?0:H),this[i].widthAdd=C,this[i].heightAdd=H),i==y[1]&&(this[i].left=t.left+s+j+(D<0?-f:0),this[i].top=t.top+h+W+(Y?-l:0),this[i].width=t.width+g+w,this[i].height=t.height+b+S),i==y[2]&&(this[i].left=t.left+s+j/2+(D<0?-f:0),this[i].top=t.top+h+W/2+(Y?-l:0),this[i].width=t.width+g+w+j/2+F/2,this[i].height=t.height+b+S+T/2+W/2),i==y[3]&&(this[i].left=t.left+(D<0?-f:0),this[i].top=t.top+(Y?-l:0),this[i].width=t.width+g+w+j+F+s+f,this[i].height=t.height+b+S+T+W+l+h),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var r=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var o=e||{},s=o.border,a=(s=void 0===s?{}:s).borderWidth,h=void 0===a?0:a,c=o.borderTop,f=(c=void 0===c?{}:c).borderTopWidth,d=void 0===f?h:f,l=o.borderBottom,u=(l=void 0===l?{}:l).borderBottomWidth,p=void 0===u?h:u,g=o.borderRight,v=(g=void 0===g?{}:g).borderRightWidth,b=void 0===v?h:v,x=o.borderLeft,w=(x=void 0===x?{}:x).borderLeftWidth,m=void 0===w?h:w,S=o.padding,z=(S=void 0===S?{}:S).paddingTop,I=void 0===z?0:z,M=S.paddingRight,k=void 0===M?0:M,B=S.paddingBottom,W=void 0===B?0:B,P=S.paddingLeft,O=void 0===P?0:P;i||(t.width-=O+k+b+m),1!==i||n||(t.height-=I+W+d+p)}this.layoutBox&&(y.forEach((function(i){return r.layoutBox[i]=r.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,r=void 0===n?0:n,o=t.top,s=void 0===o?0:o,a=G({},this.contentSize,{left:r,top:s}),h=this.contentSize.top-this.offsetSize.top,c=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var f,d=Q(this.root.fixedLine.elements);!(f=d()).done;){var l=f.value;l.setPosition(l,this.root.offsetSize),l.getBoxPosition()}}if(e)for(var u,p=Q(e.elements);!(u=p()).done;){var g=u.value,v=G({},this.borderSize,{left:r,top:s});g.setPosition(g,v);var y=this.borderSize.top-this.offsetSize.top,b=this.borderSize.left-this.offsetSize.left;g.style.left+=r+b,g.style.top+=s+y,g.getBoxPosition()}if(i)for(var x,w=Q(i);!(x=w()).done;){x.value.layout(a.top+h,a.left+c)}return this.layoutBoxUpdate(a,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&t.style.display==St},e.isFlex=function(t){return void 0===t&&(t=this),t&&t.style.display==It},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&(!!t.parent&&(!(!t.parent||t.parent.style.display!==It)||void 0))},e.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==zt},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return{ascent:r,descent:o,width:n,fontHeight:r+o||.7*e+1}},e.getParentSize=function(t,e){if(void 0===t&&(t=this),void 0===e&&(e=!1),t&&t.parent){if(t.parent.contentSize.width)return t.parent.contentSize;if(e)return this.getParentSize(t.parent,e)}return null},e.getBoxWidthHeight=function(){var t=this,e=this.name,i=this.computedStyle,n=this.attributes,r=this.parent,o=void 0===r?{}:r,s=this.ctx,a=this.getChildren(),h=i.left,c=void 0===h?0:h,f=i.top,d=void 0===f?0:f,l=i.bottom,u=i.right,p=i.width,g=void 0===p?0:p,v=i.minWidth,y=i.maxWidth,b=i.minHeight,x=i.maxHeight,w=i.height,m=void 0===w?0:w,S=i.fontSize,z=i.fontWeight,I=i.fontFamily,M=i.fontStyle,k=i.position;i.textIndent;var B=i.lineClamp,W=i.lineHeight,P=i.padding,O=void 0===P?{}:P,T=i.margin,L=void 0===T?{}:T,R=i.border,F=(R=void 0===R?{}:R).borderWidth,A=void 0===F?0:F,E=i.borderRight,j=(E=void 0===E?{}:E).borderRightWidth,C=void 0===j?A:j,H=i.borderLeft,D=(H=void 0===H?{}:H).borderLeftWidth,Y=void 0===D?A:D,U=o.contentSize&&o.contentSize.width,N=o.contentSize&&o.contentSize.height;if(et(g)&&U&&(g=$(g,U)),et(g)&&!U&&(g=null),et(m)&&N&&(m=$(m,N)),et(m)&&!N&&(m=null),et(v)&&U&&(v=$(v,U)),et(y)&&U&&(y=$(y,U)),et(b)&&N&&(b=$(b,N)),et(x)&&N&&(x=$(x,N)),i.padding&&U)for(var _ in i.padding)Object.hasOwnProperty.call(O,_)&&(O[_]=$(O[_],U));var X=O.paddingRight,q=void 0===X?0:X,G=O.paddingLeft,V=void 0===G?0:G;if(i.margin&&[L.marginLeft,L.marginRight].includes("auto"))if(g){var J=U&&U-g-q-V-Y-C||0;L.marginLeft==L.marginRight?L.marginLeft=L.marginRight=J/2:K(L.marginLeft)?L.marginLeft=J:L.marginRight=J}else L.marginLeft=L.marginRight=0;var Q=L.marginRight,Z=void 0===Q?0:Q,tt=L.marginLeft,it={width:g,height:m,left:0,top:0},nt=V+q+Y+C+(void 0===tt?0:tt)+Z;if(this.offsetWidth=nt,e==wt&&!this.attributes.widths){var rt=n.text||"";s.save(),s.setFonts({fontFamily:I,fontSize:S,fontWeight:z,fontStyle:M}),rt.length,"\n"==rt&&(rt="",this.isBr=!0),(""+rt).split("\n").map((function(e){var i=Array.from(e).map((function(e){var i=""+(/^[\u4e00-\u9fa5]+$/.test(e)?"cn":e)+I+S+z+M,n=Pt.get(i);if(n)return{width:n,text:e};var r=t.measureText(e,S).width;return Pt.set(i,r),{width:r,text:e}})),n=t.measureText(e,S),r=n.fontHeight,o=n.ascent,s=n.descent;t.attributes.fontHeight=r,t.attributes.ascent=o,t.attributes.descent=s,t.attributes.widths||(t.attributes.widths=[]),t.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e.width}),0)})})),s.restore()}if(e==xt&&null==g){var ot=n.width,st=n.height;it.width=this.contrastSize(Math.round(ot*m/st)||0,v,y),this.layoutBoxUpdate(it,i,0)}if(e==wt&&null==g){var at=this.attributes.widths,ht=Math.max.apply(Math,at.map((function(t){return t.total})));if(o&&U>0&&(ht>U||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed)ht=U;it.width=this.contrastSize(ht,v,y),this.layoutBoxUpdate(it,i,0)}if(e==wt&&(o.style.flex||!this.attributes.lines)){var ct=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e.width>it.width?(ct++,e.width):t+e.width}),0)})),ct=B&&ct>B?B:ct,this.attributes.lines=ct}if(e==xt&&null==m){var ft=n.width,dt=n.height;n.text,it.height=this.contrastSize($(it.width*dt/ft)||0,b,x),this.layoutBoxUpdate(it,i,1)}e==wt&&null==m&&(W=$(W,S),it.height=this.contrastSize($(this.attributes.lines*W),b,x),this.layoutBoxUpdate(it,i,1,!0)),!g&&o&&o.children&&U&&(!this.isFlex(o)||o.isFlexCalc)&&([mt,wt].includes(e)&&this.isFlex()||e==mt&&this.isBlock(this)&&this.isInFlow())&&(it.width=this.contrastSize(U-(o.isFlexCalc?0:nt),v,y),this.layoutBoxUpdate(it,i)),g&&!et(g)&&(it.width=this.contrastSize(g,v,y),this.layoutBoxUpdate(it,i,0)),m&&!et(m)&&(it.height=this.contrastSize(it.height,b,x),this.layoutBoxUpdate(it,i,1));var lt=0;if(a.length){var ut=null,gt=!1;a.forEach((function(e,n){e.getBoxWidthHeight();var r=a[n+1];if(r&&r.isInFlow()&&(e.next=r),!t.line||!t.line.ids.includes(e.id))if(e.isInFlow()&&!e.inFlexBox()){var o=t.getBoxState(ut,e);if(e.isBr)return gt=!0;t.line&&t.line.canIEnter(e)&&!o&&!gt?t.line.add(e):(gt=!1,(new pt).bind(e)),ut=e}else e.inFlexBox()?t.line&&(t.line.canIEnter(e)||"nowrap"==i.flexWrap)?t.line.add(e):(new bt).bind(e):e.isFixed?t.root.fixedLine?t.root.fixedLine.fixedAdd(e):(new pt).fixedBind(e):t.fixedLine?t.fixedLine.fixedAdd(e):(new pt).fixedBind(e,1)})),this.lines&&(lt=this.lines.reduce((function(t,e){return t+e.height}),0))}var vt=0,yt=0;if(!g&&(this.isAbsolute||this.isFixed)&&U){var St=k==Mt?U:this.root.width,zt=St-(et(c)?$(c,St):c)-(et(u)?$(u,St):u);vt=i.left?zt:this.lineMaxWidth}if(!m&&(null!=d?d:this.isAbsolute||this.isFixed&&N)){var It=k==Mt?N:this.root.height,kt=It-(et(d)?$(d,It):d)-(et(l)?$(l,It):l);yt=i.top?kt:0}if(g&&!et(g)||it.width||(it.width=vt||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?U||o.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,v,y),this.layoutBoxUpdate(it,i,0)),m||!lt&&!yt||(it.height=yt||this.contrastSize(lt,b,x),this.layoutBoxUpdate(it,i)),i.borderRadius&&this.borderSize&&this.borderSize.width)for(var _ in i.borderRadius)Object.hasOwnProperty.call(i.borderRadius,_)&&(i.borderRadius[_]=$(i.borderRadius[_],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.root.contentSize=this.contentSize,this.getBoxPosition(),this.offsetSize},t}(),Tt=function(){var t,e,i,n,r,o,s=[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28],a=[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177],h=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],c=[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],f=[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175],d=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],l=[],u=[],p=[],g=[],v=[],y=2;function b(t,e){var i;t>e&&(i=t,t=e,e=i),i=e,i*=e,i+=e,i>>=1,g[i+=t]=1}function x(t,i){var n;for(p[t+e*i]=1,n=-2;n<2;n++)p[t+n+e*(i-2)]=1,p[t-2+e*(i+n+1)]=1,p[t+2+e*(i+n)]=1,p[t+n+1+e*(i+2)]=1;for(n=0;n<2;n++)b(t-1,i+n),b(t+1,i-n),b(t-n,i-1),b(t+n,i+1)}function w(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var m=[];function S(t,e,i,n){var r,o,s;for(r=0;re&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,g[i+=t]}function I(t){var i,n,r,o;switch(t){case 0:for(n=0;n>1&1,i=0;i=5&&(i+=3+v[e]-5);for(e=3;et||3*v[e-3]>=4*v[e]||3*v[e+3]>=4*v[e])&&(i+=40);return i}function k(){var t,i,n,r,o,s=0,a=0;for(i=0;ie*e;)h-=e*e,c++;for(s+=10*c,t=0;t1)for(P=s[t],B=e-7;;){for(M=e-7;M>P-3&&(x(M,B),!(M6)for(P=a[t-7],W=17,M=0;M<6;M++)for(B=0;B<3;B++,W--)1&(W>11?t>>W-12:P>>W)?(p[5-M+e*(2-B+e-11)]=1,p[2-B+e-11+e*(5-M)]=1):(b(5-M,2-B+e-11),b(2-B+e-11,5-M));for(B=0;B=(M=r*(i+n)+n)-2&&(O=M-2,t>9&&O--),T=O,t>9){for(l[T+2]=0,l[T+3]=0;T--;)P=l[T],l[T+3]|=255&P<<4,l[T+2]=P>>4;l[2]|=255&O<<4,l[1]=O>>4,l[0]=64|O>>12}else{for(l[T+1]=0,l[T+2]=0;T--;)P=l[T],l[T+2]|=255&P<<4,l[T+1]=P>>4;l[1]|=255&O<<4,l[0]=64|O>>4}for(T=O+3-(t<10);T0;L--)m[L]=m[L]?m[L-1]^d[w(f[m[L]]+T)]:m[L-1];m[0]=d[w(f[m[0]]+T)]}for(T=0;T<=o;T++)m[T]=f[m[T]];for(W=M,B=0,T=0;T>=1)1&B&&(p[e-1-W+8*e]=1,W<6?p[8+e*W]=1:p[8+e*(W+1)]=1);for(W=0;W<7;W++,B>>=1)1&B&&(p[8+e*(e-7+W)]=1,W?p[6-W+8*e]=1:p[7+8*e]=1);return p}(v)},utf16to8:function(t){var e,i,n,r;for(e="",n=t.length,i=0;i=1&&r<=127?e+=t.charAt(i):r>2047?(e+=String.fromCharCode(224|r>>12&15),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|r>>0&63)):(e+=String.fromCharCode(192|r>>6&31),e+=String.fromCharCode(128|r>>0&63));return e},draw:function(t,i,n,r,o){i.drawView(n,r);var s=i.ctx,a=n.contentSize,h=a.width,c=a.height,f=a.left,d=a.top;r.borderRadius,r.backgroundColor;var l=r.color,u=void 0===l?"#000000":l;r.border,n.contentSize.left,n.borderSize.left,n.contentSize.top,n.borderSize.top;if(y=o||y,s){s.save(),i.setOpacity(r),i.setTransform(n,r);var p=Math.min(h,c);t=this.utf16to8(t);var g=this.getFrame(t),v=p/e;s.setFillStyle(u);for(var b=0;b=s||n==c&&o=s)&&(a=e.width/i.width);var f=i.width*a,d=i.height*a,l=r||[],u=l[0],p=l[1],g=Y(u)?$(u,e.width):(e.width-f)*(U(u)?$(u,1):{left:0,center:.5,right:1}[u||"center"]),v=Y(p)?$(p,e.height):(e.height-d)*(U(p)?$(p,1):{top:0,center:.5,bottom:1}[p||"center"]),y=function(t,e){return[(t-g)/a,(e-v)/a]},b=y(0,0),x=b[0],w=b[1],m=y(e.width,e.height),S=m[0],z=m[1],I=Math.max,M=Math.min;return{sx:I(x,0),sy:I(w,0),sw:M(S-x,i.width),sh:M(z-w,i.height),dx:I(g,0),dy:I(v,0),dw:M(f,e.width),dh:M(d,e.height)}}({objectFit:u,objectPosition:v},e.contentSize,t),o=n.sx,s=n.sy,a=n.sh,h=n.sw,c=n.dx,f=n.dy,d=n.dh,l=n.dw;C==r.MP_BAIDU?i.drawImage(t.src,c+m,f+S,l,d,o,s,h,a):i.drawImage(t.src,o,s,h,a,c+m,f+S,l,d)}else i.drawImage(t.src,m,S,x,w)},k=function(){i.restore(),W.drawView(e,o,!1,!0,!1),h(1)},B=function(t){M(t),k()},B(t),[2]}))}))}))];case 1:return h.sent(),[2]}}))}))},t.prototype.drawText=function(t,e,i,n){var r=this,o=this.ctx,s=e.borderSize,a=e.contentSize,h=e.left,c=e.top,f=a.width,d=a.height,l=a.left-s.left||0,u=a.top-s.top||0,p=i.color,g=i.lineHeight,v=i.fontSize,y=i.fontWeight,b=i.fontFamily,x=i.fontStyle,w=i.textIndent,m=void 0===w?0:w,S=i.textAlign,z=i.textStroke,I=i.verticalAlign,M=void 0===I?jt:I,k=i.backgroundColor,B=i.lineClamp,W=i.backgroundClip,P=i.textShadow,O=i.textDecoration;if(m=Y(m)?m:0,this.drawView(e,i,W!=Rt),g=$(g,v),t){o.save(),h+=l,c+=u;var T=n.fontHeight,L=n.descent,R=void 0===L?0:L,F=n.ascent,A=R+(void 0===F?0:F);switch(o.setFonts({fontFamily:b,fontSize:v,fontWeight:y,fontStyle:x}),o.setTextBaseline(jt),o.setTextAlign(S),W?this.setBackground(k,f,d,h,c):o.setFillStyle(p),S){case Ht:break;case Dt:h+=.5*f;break;case Yt:h+=f}var E=n.lines*g,j=Math.ceil((d-E)/2);switch(j<0&&(j=0),M){case Et:break;case jt:c+=j;break;case Ct:c+=2*j}var C=(g-T)/2,H=g/2,D=function(t){var e=o.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,r=e.actualBoundingBoxAscent;return M==Et?{fix:A?void 0===r?0:r:H-C/2,lineY:A?0:C-C/2}:M==jt?{fix:A?H+n/4:H,lineY:A?0:C}:M==Ct?{fix:A?g-n:H+C/2,lineY:A?2*C:C+C/2}:{fix:0,height:0,lineY:0}},U=function(t,e,i){var r=t;switch(S){case Ht:r+=i;break;case Dt:r=(t-=i/2)+i;break;case Yt:r=t,t-=i}if(O){o.setLineWidth(v/13),o.beginPath();var s=.1*n.fontHeight;/\bunderline\b/.test(O)&&(o.moveTo(t,e+n.fontHeight+s),o.lineTo(r,e+n.fontHeight+s)),/\boverline\b/.test(O)&&(o.moveTo(t,e-s),o.lineTo(r,e-s)),/\bline-through\b/.test(O)&&(o.moveTo(t,e+.5*n.fontHeight),o.lineTo(r,e+.5*n.fontHeight)),o.closePath(),o.setStrokeStyle(p),o.stroke()}},N=function(t,e,i){var n=function(){o.setLineWidth(z.width),o.setStrokeStyle(z.color),o.strokeText(t,e,i)},s="outset";z&&z.type!==s?(o.save(),r.setShadow({boxShadow:P}),o.fillText(t,e,i),o.restore(),n()):z&&z.type==s?(o.save(),r.setShadow({boxShadow:P}),n(),o.restore(),o.save(),o.fillText(t,e,i),o.restore()):(r.setShadow({boxShadow:P}),o.fillText(t,e,i))};if(!n.widths||1==n.widths.length&&n.widths[0].total+m<=a.width){var _=D(t),X=_.fix,q=void 0===X?0:X,G=_.lineY;return N(t,h+m,c+q),U(h+m,c+G,n&&n.widths&&n.widths[0].total||n.text),c+=g,o.restore(),void this.setBorder(e,i)}for(var V=c,J=h,Q="",Z=0,K=o.measureText("...").width,tt=n.widths,et=0;eta.width){Z>=B&&(Q+="…"),Z++,nt=0;var ct=D(Q);q=ct.fix,G=ct.lineY;N(Q,J,c+q),U(J,c+G,nt),c+=g,Q=""}else if(rt==it.length-1){et!=tt.length-1&&Z==B&&K+ntV+d||Z>B)break}}o.restore()}},t.prototype.source=function(t){return i(this,void 0,void 0,(function(){var e,i,r,o,s=this;return n(this,(function(n){switch(n.label){case 0:if(this.node=null,e=+new Date,"{}"==JSON.stringify(t))return[2];if(t.styles=t.styles||t.css||{},!t.type)for(i in t.type=At,t)["views","children","type","css","styles"].includes(i)||(t.styles[i]=t[i],delete t[i]);return t.styles.boxSizing||(t.styles.boxSizing="border-box"),[4,this.create(t)];case 1:return(r=n.sent())?(o=r.layout()||{},this.size=o,this.node=r,this.onEffectFinished().then((function(t){return s.lifecycle("onEffectSuccess",t)})).catch((function(t){return s.lifecycle("onEffectFail",t)})),this.performance&&console.log("布局用时:"+(+new Date-e)+"ms"),[2,this.size]):[2,console.warn("no node")]}}))}))},t.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},t.prototype.create=function(t,r){return i(this,void 0,void 0,(function(){function i(t,n,r){void 0===n&&(n={}),void 0===r&&(r=!0);var o=[];return t.forEach((function(t){var s=t.styles,a=void 0===s?{}:s,h=t.css,c=void 0===h?{}:h,f=t.children,d=void 0===f?[]:f,l=t.views,u=void 0===l?[]:l,p=t.text,g=void 0===p?"":p,v=t.type,y=void 0===v?"":v;!d&&u&&(t.children=d=u);var b={};b=e(e(r?e({},n):{},a),c);var x={},w={},m={};Object.keys(b).map((function(t){if(t.includes("padding")||t.includes("margin")){var e=ft(t,b[t]);Object.keys(e).map((function(t){t.includes("Left")?w[t]=e[t]:t.includes("Right")?m[t]=e[t]:x[t]=e[t]}))}}));if(b.textIndent&&(w.textIndent=b.textIndent,delete n.textIndent),""!==g){var S=Array.from(g);S.forEach((function(t,e){var i=Object.assign({},b,x);0===e?Object.assign(i,w):e==S.length-1&&Object.assign(i,m),delete i.padding,delete i.margin,o.push({type:"text",text:t,styles:i})}))}if(y==Lt||y==Ft)o.push(t);else if("block"===a.display&&d.length>0){var z=i(d,b,!1);t.children=z,t.flattened=!0,o.push(t)}else if(d.length>0){z=i(d,b,r);o=o.concat(z)}})),o}var o,s,a,h,c,f,d,l,u,p,g,v,y,b,x,w,m,S,z,I,M,k,B,P;return n(this,(function(n){switch(n.label){case 0:if(!t)return[2];if(t.styles||(t.styles=t.css||{}),o=t.type,s=t.show,a=void 0===s||s,h=o==Lt,c=[Rt,Ft].includes(o),f="textBox"==o,d=t.styles||{},l=d.backgroundImage,u=d.display,h&&!t.src&&!t.url)return[2];if(u==W||!a)return[2];if(c||f){if(p=t.children,g=t.views,!p&&g&&(t.children=p=g),!t.text&&(!p||p&&!p.length))return[2];p&&p.length&&!t.flattened&&(v=i(t.children||t.views),t.type="view",t.children=v)}if(!(h||t.type==At&&l))return[3,4];y=h?t.src:"",b=/url\(['"]?(.*?)['"]?\)/.exec(l),l&&b&&b[1]&&(y=b[1]||""),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.getImageInfo(y)];case 2:return x=n.sent(),w=x.width,m=x.height,!(S=x.path)&&h?[2]:(S&&(t.attributes=Object.assign(t.attributes||{},{width:w,height:m,path:S,src:S,naturalSrc:y})),[3,4]);case 3:return z=n.sent(),t.type!=At?[2]:(this.lifecycle("onEffectFail",e(e({},z),{src:y})),[3,4]);case 4:if(this.count+=1,I=new Ot(t,r,this.root,this.ctx),!(M=t.children||t.views))return[3,8];k=0,n.label=5;case 5:return k0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("navigateTo",{url:encodeURI(n)})},navigateBack:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.delta;r("navigateBack",{delta:parseInt(n)||1})},switchTab:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("switchTab",{url:encodeURI(n)})},reLaunch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("reLaunch",{url:encodeURI(n)})},redirectTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("redirectTo",{url:encodeURI(n)})},getEnv:function(e){o()?e({nvue:!0}):window.plus?e({plus:!0}):e({h5:!0})},postMessage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r("postMessage",e.data||{})}},d=/uni-app/i.test(navigator.userAgent),s=/Html5Plus/i.test(navigator.userAgent),w=/complete|loaded|interactive/;var u=window.my&&navigator.userAgent.indexOf("AlipayClient")>-1;var g=window.swan&&window.swan.webView&&/swan/i.test(navigator.userAgent);var c=window.qq&&window.qq.miniProgram&&/QQ/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var v=window.tt&&window.tt.miniProgram&&/toutiaomicroapp/i.test(navigator.userAgent);var m=window.wx&&window.wx.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var p=window.qa&&/quickapp/i.test(navigator.userAgent);var f=window.ks&&window.ks.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var l=window.tt&&window.tt.miniProgram&&/Lark|Feishu/i.test(navigator.userAgent);var _=window.jd&&window.jd.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);for(var E,b=function(){window.UniAppJSBridge=!0,document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady",{bubbles:!0,cancelable:!0}))},h=[function(e){if(d||s)return window.__dcloud_weex_postMessage||window.__dcloud_weex_?document.addEventListener("DOMContentLoaded",e):window.plus&&w.test(document.readyState)?setTimeout(e,0):document.addEventListener("plusready",e),a},function(e){if(m)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.wx.miniProgram},function(e){if(c)return window.QQJSBridge&&window.QQJSBridge.invoke?setTimeout(e,0):document.addEventListener("QQJSBridgeReady",e),window.qq.miniProgram},function(e){if(u){document.addEventListener("DOMContentLoaded",e);var n=window.my;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(g)return document.addEventListener("DOMContentLoaded",e),window.swan.webView},function(e){if(v)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(p){window.QaJSBridge&&window.QaJSBridge.invoke?setTimeout(e,0):document.addEventListener("QaJSBridgeReady",e);var n=window.qa;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(f)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.ks.miniProgram},function(e){if(l)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(_)return window.JDJSBridgeReady&&window.JDJSBridgeReady.invoke?setTimeout(e,0):document.addEventListener("JDJSBridgeReady",e),window.jd.miniProgram},function(e){return document.addEventListener("DOMContentLoaded",e),a}],y=0;y\s]+))?)*)\s*(\/?)>/; +var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/; +var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; // Empty Elements - HTML 5 + +var empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr'); // Block Elements - HTML 5 +// fixed by xxx 将 ins 标签从块级名单中移除 + +var block = makeMap('a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video'); // Inline Elements - HTML 5 + +var inline = makeMap('abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'); // Elements that you can, intentionally, leave open +// (and which close themselves) + +var closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); // Attributes that have their values filled in disabled="disabled" + +var fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'); // Special Elements (can contain anything) + +var special = makeMap('script,style'); +function HTMLParser(html, handler) { + var index; + var chars; + var match; + var stack = []; + var last = html; + + stack.last = function () { + return this[this.length - 1]; + }; + + while (html) { + chars = true; // Make sure we're not in a script or style element + + if (!stack.last() || !special[stack.last()]) { + // Comment + if (html.indexOf(''); + + if (index >= 0) { + if (handler.comment) { + handler.comment(html.substring(4, index)); + } + + html = html.substring(index + 3); + chars = false; + } // end tag + + } else if (html.indexOf(']*>'), function (all, text) { + text = text.replace(/|/g, '$1$2'); + + if (handler.chars) { + handler.chars(text); + } + + return ''; + }); + parseEndTag('', stack.last()); + } + + if (html == last) { + throw 'Parse Error: ' + html; + } + + last = html; + } // Clean up any remaining tags + + + parseEndTag(); + + function parseStartTag(tag, tagName, rest, unary) { + tagName = tagName.toLowerCase(); + if (block[tagName]) { + while (stack.last() && inline[stack.last()]) { + parseEndTag('', stack.last()); + } + } + + if (closeSelf[tagName] && stack.last() == tagName) { + parseEndTag('', tagName); + } + + unary = empty[tagName] || !!unary; + + if (!unary) { + stack.push(tagName); + } + + if (handler.start) { + var attrs = []; + rest.replace(attr, function (match, name) { + var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name] ? name : ''; + attrs.push({ + name: name, + value: value, + escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') // " + + }); + }); + + if (handler.start) { + handler.start(tagName, attrs, unary); + } + } + } + + function parseEndTag(tag, tagName) { + // If no tag name is provided, clean shop + if (!tagName) { + var pos = 0; + } // Find the closest opened tag of the same type + else { + for (var pos = stack.length - 1; pos >= 0; pos--) { + if (stack[pos] == tagName) { + break; + } + } + } + + if (pos >= 0) { + // Close all the open elements, up the stack + for (var i = stack.length - 1; i >= pos; i--) { + if (handler.end) { + handler.end(stack[i]); + } + } // Remove the open elements from the stack + + + stack.length = pos; + } + } +} + +function makeMap(str) { + var obj = {}; + var items = str.split(','); + + for (var i = 0; i < items.length; i++) { + obj[items[i]] = true; + } + + return obj; +} + +function removeDOCTYPE(html) { + return html.replace(/<\?xml.*\?>\n/, '').replace(/\n/, '').replace(/\n/, ''); +} + +function parseAttrs(attrs) { + return attrs.reduce(function (pre, attr) { + var value = attr.value; + var name = attr.name; + if (pre[name]) { + pre[name] = pre[name] + " " + value; + } else { + pre[name] = value; + } + + return pre; + }, {}); +} +function convertStyleStringToJSON(styleString) { + var styles = styleString.split(";"); // 通过分号将样式字符串分割为多个样式声明 + var result = {}; + + styles.forEach(function(style) { + var styleParts = style.split(":"); // 通过冒号将样式声明分割为属性和值 + var property = styleParts[0].trim(); + var value = styleParts[1] && styleParts[1].trim(); + + if (property && value) { + result[property] = value; // 将属性和值添加到结果对象中 + } + }); + + return result; +} +function parseHtml(html) { + html = removeDOCTYPE(html); + var stacks = []; + var results = { + node: 'root', + children: [] + }; + HTMLParser(html, { + start: function start(tag, attrs, unary) { + var node = { + name: tag + }; + + if (attrs.length !== 0) { + node.attrs = parseAttrs(attrs); + node.styles = node.attrs.style ? convertStyleStringToJSON(node.attrs.style) : {} + } + + if(!node.type) { + if(inline[node.name] && node.name !== 'img' ) { + node.type = 'text'; + if(node.name == 'br') { + node.text = '\n' + } else if(node.name == 'strong'){ + node.styles.fontWeight = 'bold' + } + } else if(node.name == 'img'){ + node.type = 'image' + node.src = node.attrs.src + } else { + node.type = 'view' + if(['h1','h2','h3','h4','h5','h6'].includes(node.name)) { + node.styles.fontWeight = 'bold' + } + } + } + if (unary) { + var parent = stacks[0] || results; + + if (!parent.children) { + parent.children = []; + } + + parent.children.push(node); + } else { + stacks.unshift(node); + } + }, + end: function end(tag) { + var node = stacks.shift(); + if (node.name !== tag) console.error('invalid state: mismatch end tag'); + if (stacks.length === 0) { + results.children.push(node); + } else { + var parent = stacks[0]; + + if (!parent.children) { + parent.children = []; + } + parent.children.push(node); + } + const isTextBox = node.children && node.children.length > 1 && node.children.every(child => { + return ['text','image'].includes(child.type) + }) + if(isTextBox) { + node.type = 'textBox' + } + }, + chars: function chars(text) { + var node = { + type: 'text', + text: text + }; + + if (stacks.length === 0) { + results.children.push(node); + } else { + var parent = stacks[0]; + + if (!parent.children) { + parent.children = []; + } + + parent.children.push(node); + } + }, + comment: function comment(text) { + var node = { + node: 'comment', + text: text + }; + var parent = stacks[0]; + + if (!parent.children) { + parent.children = []; + } + + parent.children.push(node); + } + }); + return results.children; +} + +export default parseHtml; \ No newline at end of file diff --git a/src/uni_modules/lime-painter/readme.md b/src/uni_modules/lime-painter/readme.md new file mode 100644 index 0000000..c9d6d40 --- /dev/null +++ b/src/uni_modules/lime-painter/readme.md @@ -0,0 +1,963 @@ +# Painter 画板 测试版 + +> uniapp 海报画板,更优雅的海报生成方案 +> [查看更多 站点 1](https://limeui.qcoon.cn/#/painter) +> [查看更多 站点 2](http://liangei.gitee.io/limeui/#/painter) +> Q 群:1169785031 + +## 平台兼容 + +| H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ 小程序 | App | +| --- | ---------- | ------------ | ---------- | ---------- | --------- | --- | +| √ | √ | √ | 未测 | √ | √ | √ | + +## 安装 +在市场导入**[海报画板](https://ext.dcloud.net.cn/plugin?id=2389)uni_modules**版本的即可,无需`import` + +## 代码演示 + +### 插件demo +- lime-painter 为 demo +- 位于 uni_modules/lime-painter/components/lime-painter +- 导入插件后直接使用可查看demo +```vue + +``` + + +### 基本用法 + +- 插件提供 JSON 及 Template 的方式绘制海报 +- 参考 css 块状流布局模拟 css schema。 +- 另外flex布局还不是成完善,请谨慎使用,普通的流布局我觉得已经够用了。 + +#### 方式一 Template + +- 提供`l-painter-view`、`l-painter-text`、`l-painter-image`、`l-painter-qrcode`四种类型组件 +- 通过 `css` 属性绘制样式,与 style 使用方式保持一致。 +```html + + //如果使用Template出现顺序错乱,可使用`template` 等所有变量完成再显示 +