fusions-ui 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/changelog.md +2 -0
- package/components/avatar/index.ts +1 -0
- package/components/avatar/src/avatar.ts +131 -0
- package/components/avatar/src/avatar.vue +104 -0
- package/components/avatar/src/composables/index.ts +1 -0
- package/components/avatar/src/composables/use-avatar.ts +61 -0
- package/components/avatar-group/index.ts +1 -0
- package/components/avatar-group/src/avatar-group.ts +86 -0
- package/components/{fu-avatar-group/fu-avatar-group.vue → avatar-group/src/avatar-group.vue} +27 -34
- package/components/avatar-group/src/composables/index.ts +1 -0
- package/components/avatar-group/src/composables/use-avatar-group.ts +17 -0
- package/components/badge/index.ts +1 -0
- package/components/badge/src/badge.ts +126 -0
- package/components/{fu-badge/fu-badge.vue → badge/src/badge.vue} +26 -62
- package/components/badge/src/composables/badge-custom.ts +51 -0
- package/components/badge/src/composables/index.ts +1 -0
- package/components/banner-arc/index.ts +1 -0
- package/components/banner-arc/src/banner-arc.ts +41 -0
- package/components/banner-arc/src/banner-arc.vue +49 -0
- package/components/banner-arc/src/composables/banner-arc-custom.ts +19 -0
- package/components/banner-arc/src/composables/index.ts +1 -0
- package/components/button/index.ts +1 -0
- package/components/button/src/button.ts +332 -0
- package/components/{fu-button/fu-button.vue → button/src/button.vue} +57 -163
- package/components/button/src/composables/button-custom.ts +90 -0
- package/components/button/src/composables/index.ts +2 -0
- package/components/button/src/composables/use-button.ts +137 -0
- package/components/cell/index.ts +1 -0
- package/components/cell/src/cell.ts +167 -0
- package/components/{fu-cell/fu-cell.vue → cell/src/cell.vue} +29 -38
- package/components/cell/src/composables/index.ts +1 -0
- package/components/cell/src/composables/use-cell.ts +20 -0
- package/components/cell-group/index.ts +1 -0
- package/components/cell-group/src/cell-group.ts +23 -0
- package/components/{fu-cell-group/fu-cell-group.vue → cell-group/src/cell-group.vue} +8 -13
- package/components/checkbox/index.ts +1 -0
- package/components/checkbox/src/checkbox.ts +144 -0
- package/components/checkbox/src/checkbox.vue +270 -0
- package/components/checkbox/src/composables/checkbox-custom.ts +15 -0
- package/components/checkbox/src/composables/index.ts +2 -0
- package/components/checkbox/src/composables/use-checkbox.ts +200 -0
- package/components/code-input/index.ts +1 -0
- package/components/code-input/src/code-input.ts +157 -0
- package/components/code-input/src/code-input.vue +158 -0
- package/components/code-input/src/composables/code-input-custom.ts +74 -0
- package/components/code-input/src/composables/index.ts +2 -0
- package/components/code-input/src/composables/use-code-input.ts +67 -0
- package/components/code-verify/index.ts +1 -0
- package/components/code-verify/src/code-verify.ts +160 -0
- package/components/code-verify/src/code-verify.vue +87 -0
- package/components/code-verify/src/composables/code-verify-custom.ts +23 -0
- package/components/code-verify/src/composables/index.ts +2 -0
- package/components/code-verify/src/composables/use-code-verify.ts +132 -0
- package/components/collapse/index.ts +1 -0
- package/components/collapse/src/collapse.ts +41 -0
- package/components/collapse/src/collapse.vue +48 -0
- package/components/collapse/src/composables/index.ts +1 -0
- package/components/collapse/src/composables/use-collapse.ts +150 -0
- package/components/collapse-item/index.ts +1 -0
- package/components/collapse-item/src/collapse-item.ts +102 -0
- package/components/{fu-collapse-item/fu-collapse-item.vue → collapse-item/src/collapse-item.vue} +20 -159
- package/components/collapse-item/src/composables/index.ts +1 -0
- package/components/collapse-item/src/composables/use-collapse-item.ts +139 -0
- package/components/countdown/index.ts +1 -0
- package/components/countdown/src/composables/index.ts +1 -0
- package/components/countdown/src/composables/use-countdown.ts +133 -0
- package/components/countdown/src/countdown.ts +63 -0
- package/components/countdown/src/countdown.vue +60 -0
- package/components/{fu-countdown/util.js → countdown/src/util.ts} +5 -5
- package/components/datetime-picker/index.ts +1 -0
- package/components/datetime-picker/src/composables/index.ts +1 -0
- package/components/datetime-picker/src/composables/use-datetime-picker.ts +325 -0
- package/components/datetime-picker/src/datetime-picker.ts +223 -0
- package/components/datetime-picker/src/datetime-picker.vue +96 -0
- package/components/form/index.ts +1 -0
- package/components/form/src/composables/index.ts +1 -0
- package/components/form/src/composables/use-form.ts +256 -0
- package/components/form/src/form.ts +108 -0
- package/components/form/src/form.vue +64 -0
- package/components/{fu-form/utils.js → form/src/utils.ts} +49 -42
- package/components/{fu-form/validate.js → form/src/validate.ts} +58 -49
- package/components/form-item/index.ts +1 -0
- package/components/form-item/src/composables/index.ts +1 -0
- package/components/form-item/src/composables/use-form-item.ts +292 -0
- package/components/form-item/src/form-item.ts +81 -0
- package/components/form-item/src/form-item.vue +229 -0
- package/components/fusions-ui/src/fusions-ui.vue +8 -0
- package/components/grid/index.ts +1 -0
- package/components/grid/src/composables/index.ts +1 -0
- package/components/grid/src/composables/use-grid.ts +67 -0
- package/components/grid/src/grid.ts +54 -0
- package/components/grid/src/grid.vue +69 -0
- package/components/grid-item/index.ts +1 -0
- package/components/grid-item/src/composables/grid-item-custom.ts +16 -0
- package/components/grid-item/src/composables/index.ts +2 -0
- package/components/grid-item/src/composables/use-grid-item.ts +55 -0
- package/components/grid-item/src/grid-item.ts +15 -0
- package/components/grid-item/src/grid-item.vue +102 -0
- package/components/icon/index.ts +1 -0
- package/components/icon/src/composables/icon-custom.ts +41 -0
- package/components/icon/src/composables/index.ts +2 -0
- package/components/icon/src/composables/use-icon.ts +14 -0
- package/components/{fu-icon → icon/src}/fuicon.css +584 -584
- package/components/icon/src/fuicon.ts +1023 -0
- package/components/icon/src/icon.ts +84 -0
- package/components/icon/src/icon.vue +92 -0
- package/components/image/index.ts +1 -0
- package/components/image/src/composables/image-custom.ts +36 -0
- package/components/image/src/composables/index.ts +2 -0
- package/components/image/src/composables/use-image.ts +135 -0
- package/components/image/src/image.ts +185 -0
- package/components/image/src/image.vue +152 -0
- package/components/index-anchor/index.ts +1 -0
- package/components/index-anchor/src/composables/index.ts +1 -0
- package/components/index-anchor/src/composables/use-index-anchor.ts +44 -0
- package/components/index-anchor/src/index-anchor.ts +45 -0
- package/components/index-anchor/src/index-anchor.vue +60 -0
- package/components/index-item/index.ts +1 -0
- package/components/index-item/src/composables/index.ts +1 -0
- package/components/index-item/src/composables/use-index-item.ts +75 -0
- package/components/index-item/src/index-item.ts +13 -0
- package/components/index-item/src/index-item.vue +32 -0
- package/components/index-list/index.ts +1 -0
- package/components/index-list/src/composables/index.ts +1 -0
- package/components/index-list/src/composables/use-index-list.ts +297 -0
- package/components/index-list/src/index-list.ts +52 -0
- package/components/index-list/src/index-list.vue +178 -0
- package/components/index.ts +62 -0
- package/components/input/index.ts +1 -0
- package/components/input/src/composables/index.ts +2 -0
- package/components/input/src/composables/input-custom.ts +69 -0
- package/components/input/src/composables/use-input.ts +117 -0
- package/components/input/src/input.ts +360 -0
- package/components/input/src/input.vue +241 -0
- package/components/keyboard/index.ts +1 -0
- package/components/keyboard/src/composables/index.ts +3 -0
- package/components/keyboard/src/composables/use-keyboard-car.ts +99 -0
- package/components/keyboard/src/composables/use-keyboard-number.ts +81 -0
- package/components/keyboard/src/composables/use-keyboard.ts +61 -0
- package/components/keyboard/src/keyboard-car.ts +53 -0
- package/components/{fu-keyboard → keyboard/src}/keyboard-car.vue +37 -199
- package/components/keyboard/src/keyboard-number.ts +44 -0
- package/components/keyboard/src/keyboard-number.vue +108 -0
- package/components/keyboard/src/keyboard.ts +174 -0
- package/components/{fu-keyboard/fu-keyboard.vue → keyboard/src/keyboard.vue} +38 -63
- package/components/line/index.ts +1 -0
- package/components/line/src/composables/index.ts +1 -0
- package/components/line/src/composables/line-custom.ts +30 -0
- package/components/line/src/line.ts +82 -0
- package/components/line/src/line.vue +44 -0
- package/components/link/index.ts +1 -0
- package/components/link/src/composables/index.ts +2 -0
- package/components/link/src/composables/link-custom.ts +19 -0
- package/components/link/src/composables/use-link.ts +33 -0
- package/components/link/src/link.ts +61 -0
- package/components/link/src/link.vue +62 -0
- package/components/loading/index.ts +1 -0
- package/{libs/function/colorGradient.js → components/loading/src/composables/colorGradient.ts} +4 -4
- package/components/loading/src/composables/index.ts +2 -0
- package/components/loading/src/composables/loading-custom.ts +21 -0
- package/components/loading/src/composables/use-loading.ts +100 -0
- package/components/loading/src/loading.ts +77 -0
- package/components/{fu-loading/fu-loading.vue → loading/src/loading.vue} +23 -119
- package/components/loading-more/index.ts +1 -0
- package/components/loading-more/src/loading-more.ts +75 -0
- package/components/{fu-loading-more/fu-loading-more.vue → loading-more/src/loading-more.vue} +18 -19
- package/components/modal/index.ts +1 -0
- package/components/modal/src/composables/index.ts +2 -0
- package/components/modal/src/composables/modal-custom.ts +17 -0
- package/components/modal/src/composables/use-modal.ts +56 -0
- package/components/modal/src/modal.ts +152 -0
- package/components/{fu-modal/fu-modal.vue → modal/src/modal.vue} +41 -69
- package/components/navbar/index.ts +1 -0
- package/components/navbar/src/composables/index.ts +2 -0
- package/components/navbar/src/composables/navbar-custom.ts +62 -0
- package/components/navbar/src/composables/use-navbar.ts +42 -0
- package/components/navbar/src/navbar.ts +151 -0
- package/components/navbar/src/navbar.vue +249 -0
- package/components/notice-bar/index.ts +3 -0
- package/components/notice-bar/src/composables/index.ts +5 -0
- package/components/notice-bar/src/composables/notice-column-custom.ts +43 -0
- package/components/notice-bar/src/composables/notice-row-custom.ts +26 -0
- package/components/notice-bar/src/composables/use-notice-bar.ts +34 -0
- package/components/notice-bar/src/composables/use-notice-column.ts +31 -0
- package/components/notice-bar/src/composables/use-notice-row.ts +88 -0
- package/components/notice-bar/src/notice-bar.ts +197 -0
- package/components/{fu-notice-bar/fu-notice-bar.vue → notice-bar/src/notice-bar.vue} +28 -41
- package/components/notice-bar/src/notice-column.ts +172 -0
- package/components/notice-bar/src/notice-column.vue +129 -0
- package/components/notice-bar/src/notice-row.ts +155 -0
- package/components/notice-bar/src/notice-row.vue +135 -0
- package/components/number-box/index.ts +1 -0
- package/components/number-box/src/composables/index.ts +2 -0
- package/components/number-box/src/composables/number-box-custom.ts +16 -0
- package/components/number-box/src/composables/use-number-box.ts +84 -0
- package/components/number-box/src/number-box.ts +98 -0
- package/components/number-box/src/number-box.vue +123 -0
- package/components/parse/index.ts +1 -0
- package/components/parse/src/app-plus/html/js/handler.js +254 -0
- package/components/parse/src/app-plus/html/js/uni.webview.min.js +188 -0
- package/components/parse/src/app-plus/html/local.html +32 -0
- package/components/parse/src/composables/index.ts +1 -0
- package/components/parse/src/composables/use-parse.ts +428 -0
- package/components/parse/src/node/node.vue +635 -0
- package/components/parse/src/parse.ts +156 -0
- package/components/parse/src/parse.vue +131 -0
- package/components/parse/src/parser.ts +1402 -0
- package/components/picker/index.ts +1 -0
- package/components/picker/src/composables/index.ts +2 -0
- package/components/picker/src/composables/picker-custom.ts +40 -0
- package/components/picker/src/composables/use-picker.ts +179 -0
- package/components/picker/src/picker.ts +172 -0
- package/components/picker/src/picker.vue +197 -0
- package/components/popup/index.ts +1 -0
- package/components/popup/src/composables/index.ts +1 -0
- package/components/popup/src/composables/use-popup.ts +346 -0
- package/components/popup/src/keypress.ts +55 -0
- package/components/popup/src/popup.ts +101 -0
- package/components/popup/src/popup.vue +204 -0
- package/components/progress/index.ts +1 -0
- package/components/progress/src/composables/index.ts +2 -0
- package/components/progress/src/composables/progress-custom.ts +24 -0
- package/components/progress/src/composables/use-progress.ts +159 -0
- package/components/progress/src/progress.ts +84 -0
- package/components/progress/src/progress.vue +150 -0
- package/components/rate/index.ts +1 -0
- package/components/rate/src/composables/index.ts +1 -0
- package/components/rate/src/composables/use-rate.ts +196 -0
- package/components/rate/src/rate.ts +114 -0
- package/components/rate/src/rate.vue +113 -0
- package/components/read-more/index.ts +1 -0
- package/components/read-more/src/composables/index.ts +2 -0
- package/components/read-more/src/composables/read-more-custom.ts +46 -0
- package/components/read-more/src/composables/use-read-more.ts +72 -0
- package/components/read-more/src/read-more.ts +102 -0
- package/components/read-more/src/read-more.vue +104 -0
- package/components/safe-bottom/index.ts +1 -0
- package/components/safe-bottom/src/composables/index.ts +2 -0
- package/components/safe-bottom/src/composables/safe-bottom-custom.ts +18 -0
- package/components/safe-bottom/src/composables/use-safe-bottom.ts +17 -0
- package/components/safe-bottom/src/safe-bottom.ts +8 -0
- package/components/safe-bottom/src/safe-bottom.vue +43 -0
- package/components/scroll-list/index.ts +1 -0
- package/components/scroll-list/src/composables/index.ts +2 -0
- package/components/scroll-list/src/composables/scroll-list-custom.ts +41 -0
- package/components/scroll-list/src/composables/use-scroll-list.ts +126 -0
- package/components/scroll-list/src/scroll-list.ts +57 -0
- package/components/scroll-list/src/scroll-list.vue +143 -0
- package/components/{fu-scroll-list/scrollWxs.wxs → scroll-list/src/scroll-wxs.wxs} +2 -2
- package/components/search/index.ts +1 -0
- package/components/search/src/composables/index.ts +2 -0
- package/components/search/src/composables/search-custom.ts +25 -0
- package/components/search/src/composables/use-search.ts +106 -0
- package/components/search/src/search.ts +186 -0
- package/components/{fu-search/fu-search.vue → search/src/search.vue} +42 -154
- package/components/section/index.ts +1 -0
- package/components/section/src/composables/index.ts +1 -0
- package/components/section/src/composables/use-section.ts +19 -0
- package/components/section/src/section.ts +83 -0
- package/components/{fu-section/fu-section.vue → section/src/section.vue} +36 -35
- package/components/sign-board/index.ts +1 -0
- package/components/sign-board/src/composables/index.ts +1 -0
- package/components/sign-board/src/composables/use-sign-board.ts +552 -0
- package/components/sign-board/src/sign-board.ts +48 -0
- package/components/sign-board/src/sign-board.vue +191 -0
- package/components/skeleton/index.ts +1 -0
- package/components/skeleton/src/composables/index.ts +2 -0
- package/components/skeleton/src/composables/skeleton-custom.ts +23 -0
- package/components/skeleton/src/composables/use-skeleton.ts +102 -0
- package/components/skeleton/src/skeleton.ts +37 -0
- package/components/skeleton/src/skeleton.vue +147 -0
- package/components/status-bar/src/composables/index.ts +1 -0
- package/components/status-bar/src/composables/use-status-bar.ts +29 -0
- package/components/status-bar/src/status-bar.vue +21 -0
- package/components/steps/index.ts +1 -0
- package/components/steps/src/composables/index.ts +1 -0
- package/components/steps/src/composables/use-steps.ts +27 -0
- package/components/steps/src/steps.ts +65 -0
- package/components/steps/src/steps.vue +46 -0
- package/components/steps-item/index.ts +1 -0
- package/components/steps-item/src/composables/index.ts +2 -0
- package/components/steps-item/src/composables/steps-item-custom.ts +81 -0
- package/components/steps-item/src/composables/use-steps-item.ts +87 -0
- package/components/steps-item/src/steps-item.ts +38 -0
- package/components/steps-item/src/steps-item.vue +224 -0
- package/components/sticky/index.ts +1 -0
- package/components/sticky/src/composables/index.ts +2 -0
- package/components/sticky/src/composables/sticky-custom.ts +57 -0
- package/components/sticky/src/composables/use-sticky.ts +152 -0
- package/components/sticky/src/sticky.ts +62 -0
- package/components/sticky/src/sticky.vue +65 -0
- package/components/subsection/index.ts +1 -0
- package/components/subsection/src/composables/index.ts +2 -0
- package/components/subsection/src/composables/subsection-custom.ts +71 -0
- package/components/subsection/src/composables/use-subsection.ts +85 -0
- package/components/subsection/src/subsection.ts +107 -0
- package/components/subsection/src/subsection.vue +165 -0
- package/components/swipe-action/src/composables/index.ts +1 -0
- package/components/swipe-action/src/composables/use-swipe-action.ts +58 -0
- package/components/swipe-action/src/swipe-action.vue +81 -0
- package/components/swipe-action-item/index.ts +1 -0
- package/components/{fu-swipe-action-item/mpwxs.js → swipe-action-item/src/mpwxs.ts} +22 -27
- package/components/swipe-action-item/src/swipe-action-item.ts +68 -0
- package/components/{fu-swipe-action-item/fu-swipe-action-item.vue → swipe-action-item/src/swipe-action-item.vue} +24 -17
- package/components/{fu-swipe-action-item → swipe-action-item/src}/wx.wxs +2 -2
- package/components/swiper/index.ts +1 -0
- package/components/swiper/src/composables/index.ts +2 -0
- package/components/swiper/src/composables/swiper-custom.ts +40 -0
- package/components/swiper/src/composables/use-swiper.ts +75 -0
- package/components/swiper/src/swiper.ts +189 -0
- package/components/{fu-swiper/fu-swiper.vue → swiper/src/swiper.vue} +49 -118
- package/components/switch/index.ts +1 -0
- package/components/switch/src/composables/index.ts +2 -0
- package/components/switch/src/composables/switch-custom.ts +32 -0
- package/components/switch/src/composables/use-switch.ts +38 -0
- package/components/switch/src/switch.ts +115 -0
- package/components/{fu-switch/fu-switch.vue → switch/src/switch.vue} +25 -73
- package/components/tabs/index.ts +1 -0
- package/components/tabs/src/composables/index.ts +2 -0
- package/components/tabs/src/composables/tabs-custom.ts +43 -0
- package/components/tabs/src/composables/use-tabs.ts +210 -0
- package/components/tabs/src/tabs.ts +123 -0
- package/components/tabs/src/tabs.vue +153 -0
- package/components/tag/index.ts +1 -0
- package/components/tag/src/composables/index.ts +2 -0
- package/components/tag/src/composables/tag-custom.ts +61 -0
- package/components/tag/src/composables/use-tag.ts +23 -0
- package/components/tag/src/tag.ts +159 -0
- package/components/{fu-tag/fu-tag.vue → tag/src/tag.vue} +53 -93
- package/components/text/index.ts +1 -0
- package/components/text/src/composables/index.ts +2 -0
- package/components/text/src/composables/text-custom.ts +120 -0
- package/components/text/src/composables/use-text.ts +83 -0
- package/components/text/src/text.ts +261 -0
- package/components/text/src/text.vue +186 -0
- package/components/textarea/index.ts +1 -0
- package/components/textarea/src/composables/index.ts +2 -0
- package/components/textarea/src/composables/textarea-custom.ts +50 -0
- package/components/textarea/src/composables/use-textarea.ts +88 -0
- package/components/textarea/src/textarea.ts +250 -0
- package/components/textarea/src/textarea.vue +162 -0
- package/components/{fu-timeaxis/fu-timeaxis.vue → timeaxis/src/timeaxis.vue} +3 -9
- package/components/timeaxis-item/index.ts +1 -0
- package/components/timeaxis-item/src/timeaxis-item.ts +20 -0
- package/components/timeaxis-item/src/timeaxis-item.vue +50 -0
- package/components/transition/index.ts +1 -0
- package/components/transition/src/composables/createAnimation.ts +171 -0
- package/components/transition/src/composables/index.ts +2 -0
- package/components/transition/src/composables/transform-custom.ts +18 -0
- package/components/transition/src/composables/use-transition.ts +251 -0
- package/components/transition/src/transition.ts +64 -0
- package/components/transition/src/transition.vue +70 -0
- package/components/upload/index.ts +1 -0
- package/components/upload/src/composables/index.ts +5 -0
- package/components/upload/src/composables/upload-file-custom.ts +68 -0
- package/components/upload/src/composables/upload-image-custom.ts +76 -0
- package/components/upload/src/composables/use-upload-file.ts +27 -0
- package/components/upload/src/composables/use-upload-image.ts +38 -0
- package/components/upload/src/composables/use-upload.ts +388 -0
- package/components/upload/src/upload-file.ts +84 -0
- package/components/upload/src/upload-file.vue +193 -0
- package/components/upload/src/upload-image.ts +90 -0
- package/components/upload/src/upload-image.vue +158 -0
- package/components/upload/src/upload.ts +196 -0
- package/components/upload/src/upload.vue +151 -0
- package/components/{fu-upload/utils.js → upload/src/utils.ts} +12 -12
- package/components/vtabs/index.ts +1 -0
- package/components/vtabs/src/composables/index.ts +2 -0
- package/components/vtabs/src/composables/use-vtabs.ts +276 -0
- package/components/vtabs/src/composables/vtabs-custom.ts +54 -0
- package/components/vtabs/src/vtabs.ts +130 -0
- package/components/vtabs/src/vtabs.vue +189 -0
- package/components/vtabs-item/index.ts +1 -0
- package/components/vtabs-item/src/composables/index.ts +1 -0
- package/components/vtabs-item/src/composables/use-vtabs-item.ts +60 -0
- package/components/vtabs-item/src/vtabs-item.ts +10 -0
- package/components/vtabs-item/src/vtabs-item.vue +20 -0
- package/components/waterfall/index.ts +1 -0
- package/components/waterfall/src/composables/index.ts +2 -0
- package/components/waterfall/src/composables/use-waterfall.ts +139 -0
- package/components/waterfall/src/composables/waterfall-custom.ts +18 -0
- package/components/waterfall/src/waterfall.ts +114 -0
- package/components/waterfall/src/waterfall.vue +104 -0
- package/{libs/config/config.js → config/config.ts} +13 -7
- package/constants/images.ts +18 -0
- package/constants/index.ts +6 -0
- package/constants/open-types.ts +33 -0
- package/constants/props.ts +18 -0
- package/constants/shapes.ts +6 -0
- package/constants/types.ts +10 -0
- package/constants/z-index.ts +27 -0
- package/global.d.ts +103 -0
- package/hooks/index.ts +25 -0
- package/index.scss +3 -5
- package/index.ts +56 -0
- package/package.json +1 -1
- package/{libs/route/min.route.config.js → route/min.route.config.ts} +62 -23
- package/route/route.config.ts +93 -0
- package/style/color.scss +26 -0
- package/{libs/style → style}/common.scss +1 -14
- package/{libs/function/applyEven.js → utils/applyEven.ts} +21 -12
- package/utils/check.ts +276 -0
- package/{libs/function/chooseUploadFile.js → utils/chooseUploadFile.ts} +22 -26
- package/utils/common.ts +609 -0
- package/{libs/function/digit.js → utils/digit.ts} +63 -33
- package/{components/fu-swipe-action-item/isPC.js → utils/isPC.ts} +1 -1
- package/utils/toast.ts +42 -0
- package/components/fu-avatar/fu-avatar.vue +0 -157
- package/components/fu-avatar/props.js +0 -117
- package/components/fu-avatar-group/props.js +0 -74
- package/components/fu-badge/props.js +0 -112
- package/components/fu-banner-arc/fu-banner-arc.vue +0 -58
- package/components/fu-banner-arc/props.js +0 -35
- package/components/fu-button/props.js +0 -228
- package/components/fu-cell/props.js +0 -108
- package/components/fu-cell-group/props.js +0 -19
- package/components/fu-checkbox/fu-checkbox.vue +0 -469
- package/components/fu-checkbox/props.js +0 -126
- package/components/fu-code-input/fu-code-input.vue +0 -269
- package/components/fu-code-input/props.js +0 -136
- package/components/fu-code-verify/fu-code-verify.vue +0 -221
- package/components/fu-code-verify/props.js +0 -136
- package/components/fu-collapse/fu-collapse.vue +0 -143
- package/components/fu-collapse/props.js +0 -29
- package/components/fu-collapse-item/props.js +0 -101
- package/components/fu-countdown/fu-countdown.vue +0 -164
- package/components/fu-countdown/props.js +0 -35
- package/components/fu-datetime-picker/fu-datetime-picker.vue +0 -375
- package/components/fu-datetime-picker/props.js +0 -194
- package/components/fu-form/fu-form.vue +0 -284
- package/components/fu-form/props.js +0 -74
- package/components/fu-form-item/fu-form-item.vue +0 -535
- package/components/fu-form-item/props.js +0 -66
- package/components/fu-grid/fu-grid.vue +0 -113
- package/components/fu-grid/props.js +0 -44
- package/components/fu-grid-item/fu-grid-item.vue +0 -136
- package/components/fu-grid-item/props.js +0 -27
- package/components/fu-icon/fu-icon.vue +0 -110
- package/components/fu-icon/fuicon.js +0 -1031
- package/components/fu-icon/props.js +0 -55
- package/components/fu-image/fu-image.vue +0 -268
- package/components/fu-image/props.js +0 -145
- package/components/fu-index-anchor/fu-index-anchor.vue +0 -91
- package/components/fu-index-anchor/props.js +0 -43
- package/components/fu-index-item/fu-index-item.vue +0 -79
- package/components/fu-index-list/fu-index-list.vue +0 -426
- package/components/fu-index-list/props.js +0 -42
- package/components/fu-input/fu-input.vue +0 -393
- package/components/fu-input/props.js +0 -291
- package/components/fu-keyboard/keyboard-number.vue +0 -195
- package/components/fu-keyboard/props.js +0 -138
- package/components/fu-line/fu-line.vue +0 -64
- package/components/fu-line/props.js +0 -58
- package/components/fu-link/fu-link.vue +0 -91
- package/components/fu-link/props.js +0 -49
- package/components/fu-loading/props.js +0 -60
- package/components/fu-loading-more/props.js +0 -59
- package/components/fu-modal/props.js +0 -128
- package/components/fu-navbar/fu-navbar.vue +0 -271
- package/components/fu-navbar/props.js +0 -72
- package/components/fu-navbar/status-bar.vue +0 -27
- package/components/fu-notice-bar/notice-column.vue +0 -313
- package/components/fu-notice-bar/notice-row.vue +0 -363
- package/components/fu-notice-bar/props.js +0 -173
- package/components/fu-number-box/fu-number-box.vue +0 -210
- package/components/fu-number-box/props.js +0 -79
- package/components/fu-parse/fu-parse.vue +0 -508
- package/components/fu-parse/node/node.vue +0 -576
- package/components/fu-parse/parser.js +0 -1335
- package/components/fu-picker/fu-picker.vue +0 -347
- package/components/fu-picker/props.js +0 -150
- package/components/fu-popup/fu-popup.vue +0 -475
- package/components/fu-popup/keypress.js +0 -45
- package/components/fu-popup/props.js +0 -83
- package/components/fu-progress/fu-progress.vue +0 -292
- package/components/fu-progress/props.js +0 -76
- package/components/fu-rate/fu-rate.vue +0 -301
- package/components/fu-rate/props.js +0 -103
- package/components/fu-read-more/fu-read-more.vue +0 -191
- package/components/fu-read-more/props.js +0 -72
- package/components/fu-ribbon/fu-ribbon.vue +0 -106
- package/components/fu-ribbon/props.js +0 -35
- package/components/fu-safe-area/fu-safe-area.vue +0 -61
- package/components/fu-scroll-list/fu-scroll-list.vue +0 -196
- package/components/fu-scroll-list/nvue.js +0 -28
- package/components/fu-scroll-list/props.js +0 -43
- package/components/fu-search/props.js +0 -149
- package/components/fu-section/props.js +0 -59
- package/components/fu-sign-board/fu-sign-board.vue +0 -730
- package/components/fu-sign-board/props.js +0 -34
- package/components/fu-skeleton/fu-skeleton.vue +0 -238
- package/components/fu-skeleton/props.js +0 -35
- package/components/fu-steps/fu-steps.vue +0 -81
- package/components/fu-steps/props.js +0 -55
- package/components/fu-steps-item/fu-steps-item.vue +0 -274
- package/components/fu-steps-item/props.js +0 -34
- package/components/fu-sticky/fu-sticky.vue +0 -232
- package/components/fu-sticky/props.js +0 -54
- package/components/fu-subsection/fu-subsection.vue +0 -288
- package/components/fu-subsection/props.js +0 -88
- package/components/fu-swipe-action/fu-swipe-action.vue +0 -64
- package/components/fu-swipe-action-item/props.js +0 -54
- package/components/fu-swiper/props.js +0 -163
- package/components/fu-switch/props.js +0 -102
- package/components/fu-tabs/fu-tabs.vue +0 -361
- package/components/fu-tabs/props.js +0 -109
- package/components/fu-tag/props.js +0 -135
- package/components/fu-text/button.js +0 -13
- package/components/fu-text/fu-text.vue +0 -254
- package/components/fu-text/openType.js +0 -47
- package/components/fu-text/props.js +0 -173
- package/components/fu-text/value.js +0 -88
- package/components/fu-textarea/fu-textarea.vue +0 -288
- package/components/fu-textarea/props.js +0 -206
- package/components/fu-timeaxis-item/fu-timeaxis-item.vue +0 -68
- package/components/fu-transition/createAnimation.js +0 -131
- package/components/fu-transition/fu-transition.vue +0 -292
- package/components/fu-transition/props.js +0 -21
- package/components/fu-upload/fu-upload.vue +0 -563
- package/components/fu-upload/props.js +0 -171
- package/components/fu-upload/upload-file.vue +0 -332
- package/components/fu-upload/upload-image.vue +0 -304
- package/components/fu-vtabs/fu-vtabs.vue +0 -443
- package/components/fu-vtabs/props.js +0 -114
- package/components/fu-vtabs-item/fu-vtabs-item.vue +0 -71
- package/components/fu-waterfall/fu-waterfall.vue +0 -238
- package/components/fu-waterfall/props.js +0 -85
- package/index.js +0 -71
- package/libs/function/check.js +0 -215
- package/libs/function/common.js +0 -527
- package/libs/function/message.js +0 -47
- package/libs/mixin/button.js +0 -85
- package/libs/mixin/mixin.js +0 -94
- package/libs/mixin/mpMixin.js +0 -8
- package/libs/mixin/mpShare.js +0 -15
- package/libs/route/route.config.js +0 -66
- package/libs/style/color.scss +0 -24
- /package/components/{fu-icon → icon/src}/fuicon.ttf +0 -0
- /package/components/{fu-swipe-action-item → swipe-action-item/src}/bindingx.js +0 -0
- /package/components/{fu-swipe-action-item → swipe-action-item/src}/mpalipay.js +0 -0
- /package/components/{fu-swipe-action-item → swipe-action-item/src}/mpother.js +0 -0
- /package/components/{fu-swipe-action-item → swipe-action-item/src}/render.js +0 -0
- /package/{libs/style → style}/components.scss +0 -0
- /package/{libs/style → style}/style.h5.scss +0 -0
- /package/{libs/style → style}/style.mp.scss +0 -0
- /package/{libs/function → utils}/dayjs.js +0 -0
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :id="attrs.id" :class="'_block _' + name + ' ' + attrs.class" :style="attrs.style">
|
|
3
|
+
<block v-for="(n, i) in nodes" v-bind:key="i">
|
|
4
|
+
<!-- 图片 -->
|
|
5
|
+
<!-- 占位图 -->
|
|
6
|
+
<image v-if="n.name === 'img' && !n.t && ((opts[1] && !ctrl[i]) || ctrl[i] < 0)" class="_img"
|
|
7
|
+
:style="n.attrs.style" :src="ctrl[i] < 0 ? opts[2] : opts[1]" mode="widthFix" />
|
|
8
|
+
<!-- 显示图片 -->
|
|
9
|
+
<!-- #ifdef H5 || (APP-PLUS && VUE2) -->
|
|
10
|
+
<img v-if="n.name === 'img'" :id="n.attrs.id" :class="'_img ' + n.attrs.class"
|
|
11
|
+
:style="(ctrl[i] === -1 ? 'display:none;' : '') + n.attrs.style"
|
|
12
|
+
:src="n.attrs.src || (ctrl.load ? n.attrs['data-src'] : '')" :data-i="i" @load="imgLoad"
|
|
13
|
+
@error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
|
|
14
|
+
<!-- #endif -->
|
|
15
|
+
<!-- #ifndef H5 || (APP-PLUS && VUE2) -->
|
|
16
|
+
<!-- 表格中的图片,使用 rich-text 防止大小不正确 -->
|
|
17
|
+
<rich-text v-if="n.name === 'img' && n.t" :style="'display:' + n.t"
|
|
18
|
+
:nodes="[{ attrs: { style: n.attrs.style || '', src: n.attrs.src }, name: 'img' }]" :data-i="i"
|
|
19
|
+
@tap.stop="imgTap" />
|
|
20
|
+
<!-- #endif -->
|
|
21
|
+
<!-- #ifdef APP-HARMONY -->
|
|
22
|
+
<image v-else-if="n.name === 'img'" :id="n.attrs.id" :class="'_img ' + n.attrs.class"
|
|
23
|
+
:style="(ctrl[i] === -1 ? 'display:none;' : '') + 'width:' + ctrl[i] + 'px;' + n.attrs.style"
|
|
24
|
+
:src="n.attrs.src || (ctrl.load ? n.attrs['data-src'] : '')"
|
|
25
|
+
:mode="!n.h ? 'widthFix' : (!n.w ? 'heightFix' : (n.m || 'scaleToFill'))" :data-i="i" @load="imgLoad"
|
|
26
|
+
@error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
|
|
27
|
+
<!-- #endif -->
|
|
28
|
+
<!-- #ifndef H5 || APP-PLUS || MP-KUAISHOU -->
|
|
29
|
+
<image v-else-if="n.name === 'img'" :id="n.attrs.id" :class="'_img ' + n.attrs.class"
|
|
30
|
+
:style="(ctrl[i] === -1 ? 'display:none;' : '') + 'width:' + (ctrl[i] || 1) + 'px;height:1px;' + n.attrs.style"
|
|
31
|
+
:src="n.attrs.src" :mode="!n.h ? 'widthFix' : (!n.w ? 'heightFix' : (n.m || 'scaleToFill'))"
|
|
32
|
+
:lazy-load="opts[0]" :webp="n.webp" :show-menu-by-longpress="opts[3] && !n.attrs.ignore"
|
|
33
|
+
:image-menu-prevent="!opts[3] || n.attrs.ignore" :data-i="i" @load="imgLoad" @error="mediaError"
|
|
34
|
+
@tap.stop="imgTap" @longpress="imgLongTap" />
|
|
35
|
+
<!-- #endif -->
|
|
36
|
+
<!-- #ifdef MP-KUAISHOU -->
|
|
37
|
+
<image v-else-if="n.name === 'img'" :id="n.attrs.id" :class="'_img ' + n.attrs.class"
|
|
38
|
+
:style="(ctrl[i] === -1 ? 'display:none;' : '') + n.attrs.style" :src="n.attrs.src" :lazy-load="opts[0]"
|
|
39
|
+
:data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap"></image>
|
|
40
|
+
<!-- #endif -->
|
|
41
|
+
<!-- #ifdef APP-PLUS && VUE3 -->
|
|
42
|
+
<image v-else-if="n.name === 'img'" :id="n.attrs.id" :class="'_img ' + n.attrs.class"
|
|
43
|
+
:style="(ctrl[i] === -1 ? 'display:none;' : '') + 'width:' + (ctrl[i] || 1) + 'px;' + n.attrs.style"
|
|
44
|
+
:src="n.attrs.src || (ctrl.load ? n.attrs['data-src'] : '')"
|
|
45
|
+
:mode="!n.h ? 'widthFix' : (!n.w ? 'heightFix' : (n.m || ''))" :data-i="i" @load="imgLoad"
|
|
46
|
+
@error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
|
|
47
|
+
<!-- #endif -->
|
|
48
|
+
<!-- 文本 -->
|
|
49
|
+
<!-- #ifdef MP-WEIXIN -->
|
|
50
|
+
<text v-else-if="n.text" :user-select="opts[4] == 'force' && isiOS" decode>{{ n.text }}</text>
|
|
51
|
+
<!-- #endif -->
|
|
52
|
+
<!-- #ifndef MP-WEIXIN || MP-BAIDU || MP-ALIPAY || MP-TOUTIAO -->
|
|
53
|
+
<text v-else-if="n.text" decode>{{ n.text }}</text>
|
|
54
|
+
<!-- #endif -->
|
|
55
|
+
<text v-else-if="n.name === 'br'">{{ '\n' }}</text>
|
|
56
|
+
<!-- 链接 -->
|
|
57
|
+
<view v-else-if="n.name === 'a'" :id="n.attrs.id" :class="(n.attrs.href ? '_a ' : '') + n.attrs.class"
|
|
58
|
+
hover-class="_hover" :style="'display:inline;' + n.attrs.style" :data-i="i" @tap.stop="linkTap">
|
|
59
|
+
<node name="span" :childs="n.children" :opts="opts" style="display:inherit" />
|
|
60
|
+
</view>
|
|
61
|
+
<!-- 视频 -->
|
|
62
|
+
<!-- #ifdef APP-PLUS -->
|
|
63
|
+
<view v-else-if="n.html" :id="n.attrs.id" :class="'_video ' + n.attrs.class" :style="n.attrs.style"
|
|
64
|
+
v-html="n.html" :data-i="i" @vplay.stop="play" />
|
|
65
|
+
<!-- #endif -->
|
|
66
|
+
<!-- #ifndef APP-PLUS -->
|
|
67
|
+
<video v-else-if="n.name === 'video'" :id="n.attrs.id" :class="n.attrs.class" :style="n.attrs.style"
|
|
68
|
+
:autoplay="n.attrs.autoplay" :controls="n.attrs.controls" :loop="n.attrs.loop" :muted="n.attrs.muted"
|
|
69
|
+
:object-fit="n.attrs['object-fit']" :poster="n.attrs.poster" :src="n.src[ctrl[i] || 0]" :data-i="i"
|
|
70
|
+
@play="play" @error="mediaError" />
|
|
71
|
+
<!-- #endif -->
|
|
72
|
+
<!-- #ifdef H5 || APP-PLUS -->
|
|
73
|
+
<iframe v-else-if="n.name === 'iframe'" :style="n.attrs.style" :allowfullscreen="n.attrs.allowfullscreen"
|
|
74
|
+
:frameborder="n.attrs.frameborder" :src="n.attrs.src" />
|
|
75
|
+
<embed v-else-if="n.name === 'embed'" :style="n.attrs.style" :src="n.attrs.src" />
|
|
76
|
+
<!-- #endif -->
|
|
77
|
+
<!-- #ifndef MP-TOUTIAO || ((H5 || APP-PLUS) && VUE3) -->
|
|
78
|
+
<!-- 音频 -->
|
|
79
|
+
<audio v-else-if="n.name === 'audio'" :id="n.attrs.id" :class="n.attrs.class" :style="n.attrs.style"
|
|
80
|
+
:author="n.attrs.author" :controls="n.attrs.controls" :loop="n.attrs.loop" :name="n.attrs.name"
|
|
81
|
+
:poster="n.attrs.poster" :src="n.src[ctrl[i] || 0]" :data-i="i" @play="play" @error="mediaError" />
|
|
82
|
+
<!-- #endif -->
|
|
83
|
+
<view v-else-if="(n.name === 'table' && n.c) || n.name === 'li'" :id="n.attrs.id"
|
|
84
|
+
:class="'_' + n.name + ' ' + n.attrs.class" :style="n.attrs.style">
|
|
85
|
+
<node v-if="n.name === 'li'" :childs="n.children" :opts="opts" />
|
|
86
|
+
<view v-else v-for="(tbody, x) in n.children" v-bind:key="x"
|
|
87
|
+
:class="'_' + tbody.name + ' ' + tbody.attrs.class" :style="tbody.attrs.style">
|
|
88
|
+
<node v-if="tbody.name === 'td' || tbody.name === 'th'" :childs="tbody.children" :opts="opts" />
|
|
89
|
+
<block v-else v-for="(tr, y) in tbody.children" v-bind:key="y">
|
|
90
|
+
<view v-if="tr.name === 'td' || tr.name === 'th'" :class="'_' + tr.name + ' ' + tr.attrs.class"
|
|
91
|
+
:style="tr.attrs.style">
|
|
92
|
+
<node :childs="tr.children" :opts="opts" />
|
|
93
|
+
</view>
|
|
94
|
+
<view v-else :class="'_' + tr.name + ' ' + tr.attrs.class" :style="tr.attrs.style">
|
|
95
|
+
<view v-for="(td, z) in tr.children" v-bind:key="z"
|
|
96
|
+
:class="'_' + td.name + ' ' + td.attrs.class" :style="td.attrs.style">
|
|
97
|
+
<node :childs="td.children" :opts="opts" />
|
|
98
|
+
</view>
|
|
99
|
+
</view>
|
|
100
|
+
</block>
|
|
101
|
+
</view>
|
|
102
|
+
</view>
|
|
103
|
+
<!-- insert -->
|
|
104
|
+
<!-- 富文本 -->
|
|
105
|
+
<!-- #ifdef H5 || ((MP-WEIXIN || MP-QQ || APP-PLUS || MP-360) && VUE2) -->
|
|
106
|
+
<rich-text v-else-if="!n.c && !handler.isInline(n.name, n.attrs.style)" :id="n.attrs.id" :style="n.f"
|
|
107
|
+
:user-select="opts[4]" :nodes="[n]" />
|
|
108
|
+
<!-- #endif -->
|
|
109
|
+
<!-- #ifndef H5 || ((MP-WEIXIN || MP-QQ || APP-PLUS || MP-360) && VUE2) -->
|
|
110
|
+
<rich-text v-else-if="!n.c" :id="n.attrs.id" :style="'display:inline;' + n.f" :preview="false"
|
|
111
|
+
:selectable="opts[4]" :user-select="opts[4]" :nodes="[n]" />
|
|
112
|
+
<!-- #endif -->
|
|
113
|
+
<!-- 继续递归 -->
|
|
114
|
+
<view v-else-if="n.c === 2" :id="n.attrs.id" :class="'_block _' + n.name + ' ' + n.attrs.class"
|
|
115
|
+
:style="n.f + ';' + n.attrs.style">
|
|
116
|
+
<node v-for="(n2, j) in n.children" v-bind:key="j" :style="n2.f" :name="n2.name" :attrs="n2.attrs"
|
|
117
|
+
:childs="n2.children" :opts="opts" />
|
|
118
|
+
</view>
|
|
119
|
+
<node v-else :style="n.f" :name="n.name" :attrs="n.attrs" :childs="n.children" :opts="opts" />
|
|
120
|
+
</block>
|
|
121
|
+
</view>
|
|
122
|
+
</template>
|
|
123
|
+
|
|
124
|
+
<script module="handler" lang="wxs">
|
|
125
|
+
// 行内标签列表
|
|
126
|
+
var inlineTags = {
|
|
127
|
+
abbr: true,
|
|
128
|
+
b: true,
|
|
129
|
+
big: true,
|
|
130
|
+
code: true,
|
|
131
|
+
del: true,
|
|
132
|
+
em: true,
|
|
133
|
+
i: true,
|
|
134
|
+
ins: true,
|
|
135
|
+
label: true,
|
|
136
|
+
q: true,
|
|
137
|
+
small: true,
|
|
138
|
+
span: true,
|
|
139
|
+
strong: true,
|
|
140
|
+
sub: true,
|
|
141
|
+
sup: true
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @description 判断是否为行内标签
|
|
145
|
+
*/
|
|
146
|
+
module.exports = {
|
|
147
|
+
isInline: function(tagName, style) {
|
|
148
|
+
return inlineTags[tagName] || (style || '').indexOf('display:inline') !== -1
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
</script>
|
|
152
|
+
|
|
153
|
+
<script setup lang="ts">
|
|
154
|
+
/* eslint-disable */
|
|
155
|
+
// @ts-nocheck
|
|
156
|
+
import { ref, reactive, watch, onMounted, onBeforeUnmount, getCurrentInstance, nextTick } from 'vue'
|
|
157
|
+
import node from './node.vue'
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
// Props 定义
|
|
161
|
+
interface Props {
|
|
162
|
+
name ?: string
|
|
163
|
+
attrs ?: any
|
|
164
|
+
childs ?: any[]
|
|
165
|
+
opts ?: any[]
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
169
|
+
name: '',
|
|
170
|
+
attrs: () => ({}),
|
|
171
|
+
childs: () => [],
|
|
172
|
+
opts: () => []
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
// State
|
|
176
|
+
const ctrl = reactive<any>({})
|
|
177
|
+
const nodes = ref<any[]>([])
|
|
178
|
+
const root = ref<any>(null)
|
|
179
|
+
const observer = ref<any>(null)
|
|
180
|
+
|
|
181
|
+
// ⚠️ 必须在 setup 顶层调用 getCurrentInstance
|
|
182
|
+
const instance = getCurrentInstance()
|
|
183
|
+
let parent : any = instance?.parent
|
|
184
|
+
|
|
185
|
+
// #ifdef MP-WEIXIN
|
|
186
|
+
const isiOS = ref(uni.getDeviceInfo().system.includes('iOS'))
|
|
187
|
+
// #endif
|
|
188
|
+
|
|
189
|
+
// Watch childs 变化
|
|
190
|
+
watch(() => props.childs, (newChilds) => {
|
|
191
|
+
// 列表缩短会刷新整个列表,因此进行空填充
|
|
192
|
+
while (nodes.value.length > newChilds.length) {
|
|
193
|
+
newChilds.push({})
|
|
194
|
+
}
|
|
195
|
+
nodes.value = newChilds
|
|
196
|
+
}, { immediate: true })
|
|
197
|
+
|
|
198
|
+
// 查找父组件(必须在 setup 顶层执行)
|
|
199
|
+
while (parent) {
|
|
200
|
+
const name = parent.type?.name
|
|
201
|
+
if (name === 'fu-parse' || name === 'FuParse') {
|
|
202
|
+
break
|
|
203
|
+
}
|
|
204
|
+
parent = parent.parent
|
|
205
|
+
}
|
|
206
|
+
root.value = parent?.exposed || parent?.proxy
|
|
207
|
+
|
|
208
|
+
// 生命周期
|
|
209
|
+
onMounted(() => {
|
|
210
|
+
// #ifdef H5 || APP-PLUS
|
|
211
|
+
if (props.opts[0]) {
|
|
212
|
+
let i: number;
|
|
213
|
+
for (i = props.childs.length; i--;) {
|
|
214
|
+
if (props.childs[i].name === 'img') break
|
|
215
|
+
}
|
|
216
|
+
if (i !== -1) {
|
|
217
|
+
const instance = getCurrentInstance()
|
|
218
|
+
observer.value = uni.createIntersectionObserver(instance?.proxy).relativeToViewport({
|
|
219
|
+
top: 500,
|
|
220
|
+
bottom: 500
|
|
221
|
+
})
|
|
222
|
+
observer.value.observe('._img', (res : any) => {
|
|
223
|
+
if (res.intersectionRatio) {
|
|
224
|
+
ctrl.load = 1
|
|
225
|
+
observer.value.disconnect()
|
|
226
|
+
}
|
|
227
|
+
})
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// #endif
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
onBeforeUnmount(() => {
|
|
234
|
+
// #ifdef H5 || APP-PLUS
|
|
235
|
+
if (observer.value) {
|
|
236
|
+
observer.value.disconnect()
|
|
237
|
+
}
|
|
238
|
+
// #endif
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
// Methods
|
|
242
|
+
// #ifdef MP-WEIXIN
|
|
243
|
+
const toJSON = () => getCurrentInstance()?.proxy
|
|
244
|
+
// #endif
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @description 播放视频事件
|
|
248
|
+
*/
|
|
249
|
+
const play = (e : any) => {
|
|
250
|
+
const i = e.currentTarget.dataset.i
|
|
251
|
+
const node = props.childs[i]
|
|
252
|
+
root.value.$emit('play', {
|
|
253
|
+
source: node.name,
|
|
254
|
+
attrs: {
|
|
255
|
+
...node.attrs,
|
|
256
|
+
src: node.src[ctrl[i] || 0]
|
|
257
|
+
}
|
|
258
|
+
})
|
|
259
|
+
// #ifndef APP-PLUS
|
|
260
|
+
if (root.value.pauseVideo) {
|
|
261
|
+
let flag = false
|
|
262
|
+
const id = e.target.id
|
|
263
|
+
for (let i = root.value._videos.length; i--;) {
|
|
264
|
+
if (root.value._videos[i].id === id) {
|
|
265
|
+
flag = true
|
|
266
|
+
} else {
|
|
267
|
+
root.value._videos[i].pause() // 自动暂停其他视频
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
// 将自己加入列表
|
|
271
|
+
if (!flag) {
|
|
272
|
+
const instance = getCurrentInstance()
|
|
273
|
+
const ctx = uni.createVideoContext(id
|
|
274
|
+
// #ifndef MP-BAIDU
|
|
275
|
+
, instance?.proxy
|
|
276
|
+
// #endif
|
|
277
|
+
)
|
|
278
|
+
ctx.id = id
|
|
279
|
+
if (root.value.playbackRate) {
|
|
280
|
+
ctx.playbackRate(root.value.playbackRate)
|
|
281
|
+
}
|
|
282
|
+
root.value._videos.push(ctx)
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
// #endif
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @description 图片点击事件
|
|
290
|
+
*/
|
|
291
|
+
const imgTap = (e : any) => {
|
|
292
|
+
const node = props.childs[e.currentTarget.dataset.i]
|
|
293
|
+
if (node.a) {
|
|
294
|
+
linkTap(node.a)
|
|
295
|
+
return
|
|
296
|
+
}
|
|
297
|
+
if (node.attrs.ignore) return
|
|
298
|
+
// #ifdef H5 || APP-PLUS
|
|
299
|
+
node.attrs.src = node.attrs.src || node.attrs['data-src']
|
|
300
|
+
// #endif
|
|
301
|
+
// #ifndef APP-HARMONY
|
|
302
|
+
root.value.$emit('imgtap', node.attrs)
|
|
303
|
+
// #endif
|
|
304
|
+
// #ifdef APP-HARMONY
|
|
305
|
+
root.value.$emit('imgtap', {
|
|
306
|
+
...node.attrs
|
|
307
|
+
})
|
|
308
|
+
// #endif
|
|
309
|
+
// 自动预览图片
|
|
310
|
+
if (root.value.previewImg) {
|
|
311
|
+
uni.previewImage({
|
|
312
|
+
// #ifdef MP-WEIXIN
|
|
313
|
+
showmenu: root.value.showImgMenu,
|
|
314
|
+
// #endif
|
|
315
|
+
// #ifdef MP-ALIPAY
|
|
316
|
+
enablesavephoto: root.value.showImgMenu,
|
|
317
|
+
enableShowPhotoDownload: root.value.showImgMenu,
|
|
318
|
+
// #endif
|
|
319
|
+
current: parseInt(node.attrs.i),
|
|
320
|
+
urls: root.value.imgList
|
|
321
|
+
})
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* @description 图片长按
|
|
327
|
+
*/
|
|
328
|
+
const imgLongTap = (e : any) => {
|
|
329
|
+
// #ifdef APP-PLUS
|
|
330
|
+
const attrs = props.childs[e.currentTarget.dataset.i].attrs
|
|
331
|
+
if (props.opts[3] && !attrs.ignore) {
|
|
332
|
+
uni.showActionSheet({
|
|
333
|
+
itemList: ['保存图片'],
|
|
334
|
+
success: () => {
|
|
335
|
+
const save = (path : string) => {
|
|
336
|
+
uni.saveImageToPhotosAlbum({
|
|
337
|
+
filePath: path,
|
|
338
|
+
success() {
|
|
339
|
+
uni.showToast({
|
|
340
|
+
title: '保存成功'
|
|
341
|
+
})
|
|
342
|
+
}
|
|
343
|
+
})
|
|
344
|
+
}
|
|
345
|
+
if (root.value.imgList[attrs.i].startsWith('http')) {
|
|
346
|
+
uni.downloadFile({
|
|
347
|
+
url: root.value.imgList[attrs.i],
|
|
348
|
+
success: (res : any) => save(res.tempFilePath)
|
|
349
|
+
})
|
|
350
|
+
} else {
|
|
351
|
+
save(root.value.imgList[attrs.i])
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
})
|
|
355
|
+
}
|
|
356
|
+
// #endif
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @description 图片加载完成事件
|
|
361
|
+
*/
|
|
362
|
+
const imgLoad = (e : any) => {
|
|
363
|
+
const i = e.currentTarget.dataset.i
|
|
364
|
+
/* #ifndef H5 || (APP-PLUS && VUE2) */
|
|
365
|
+
if (!props.childs[i].w) {
|
|
366
|
+
// 设置原宽度
|
|
367
|
+
ctrl[i] = e.detail.width
|
|
368
|
+
} else /* #endif */ if ((props.opts[1] && !ctrl[i]) || ctrl[i] === -1) {
|
|
369
|
+
// 加载完毕,取消加载中占位图
|
|
370
|
+
ctrl[i] = 1
|
|
371
|
+
}
|
|
372
|
+
checkReady()
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* @description 检查是否所有图片加载完毕
|
|
377
|
+
*/
|
|
378
|
+
const checkReady = () => {
|
|
379
|
+
if (root.value && !root.value.lazyLoad) {
|
|
380
|
+
root.value._unloadimgs -= 1
|
|
381
|
+
if (!root.value._unloadimgs) {
|
|
382
|
+
setTimeout(() => {
|
|
383
|
+
root.value.getRect().then((rect : any) => {
|
|
384
|
+
root.value.$emit('ready', rect)
|
|
385
|
+
}).catch(() => {
|
|
386
|
+
root.value.$emit('ready', {})
|
|
387
|
+
})
|
|
388
|
+
}, 350)
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* @description 链接点击事件
|
|
395
|
+
*/
|
|
396
|
+
const linkTap = (e : any) => {
|
|
397
|
+
const node = e.currentTarget ? props.childs[e.currentTarget.dataset.i] : {}
|
|
398
|
+
const attrs = node.attrs || e
|
|
399
|
+
const href = attrs.href
|
|
400
|
+
root.value.$emit('linktap', Object.assign({
|
|
401
|
+
innerText: root.value.getText(node.children || []) // 链接内的文本内容
|
|
402
|
+
}, attrs))
|
|
403
|
+
if (href) {
|
|
404
|
+
if (href[0] === '#') {
|
|
405
|
+
// 跳转锚点
|
|
406
|
+
root.value.navigateTo(href.substring(1)).catch(() => { })
|
|
407
|
+
} else if (href.split('?')[0].includes('://')) {
|
|
408
|
+
// 复制外部链接
|
|
409
|
+
if (root.value.copyLink) {
|
|
410
|
+
// #ifdef H5
|
|
411
|
+
window.open(href)
|
|
412
|
+
// #endif
|
|
413
|
+
// #ifdef MP
|
|
414
|
+
uni.setClipboardData({
|
|
415
|
+
data: href,
|
|
416
|
+
success: () =>
|
|
417
|
+
uni.showToast({
|
|
418
|
+
title: '链接已复制'
|
|
419
|
+
})
|
|
420
|
+
})
|
|
421
|
+
// #endif
|
|
422
|
+
// #ifdef APP-PLUS
|
|
423
|
+
plus.runtime.openWeb(href)
|
|
424
|
+
// #endif
|
|
425
|
+
}
|
|
426
|
+
} else {
|
|
427
|
+
// 跳转页面
|
|
428
|
+
uni.navigateTo({
|
|
429
|
+
url: href,
|
|
430
|
+
fail() {
|
|
431
|
+
uni.switchTab({
|
|
432
|
+
url: href,
|
|
433
|
+
fail() { }
|
|
434
|
+
})
|
|
435
|
+
}
|
|
436
|
+
})
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* @description 错误事件
|
|
443
|
+
*/
|
|
444
|
+
const mediaError = (e : any) => {
|
|
445
|
+
const i = e.currentTarget.dataset.i
|
|
446
|
+
const node = props.childs[i]
|
|
447
|
+
// 加载其他源
|
|
448
|
+
if (node.name === 'video' || node.name === 'audio') {
|
|
449
|
+
let index = (ctrl[i] || 0) + 1
|
|
450
|
+
if (index > node.src.length) {
|
|
451
|
+
index = 0
|
|
452
|
+
}
|
|
453
|
+
if (index < node.src.length) {
|
|
454
|
+
ctrl[i] = index
|
|
455
|
+
return
|
|
456
|
+
}
|
|
457
|
+
} else if (node.name === 'img') {
|
|
458
|
+
// #ifdef H5 && VUE3
|
|
459
|
+
if (props.opts[0] && !ctrl.load) return
|
|
460
|
+
// #endif
|
|
461
|
+
// 显示错误占位图
|
|
462
|
+
if (props.opts[2]) {
|
|
463
|
+
ctrl[i] = -1
|
|
464
|
+
}
|
|
465
|
+
checkReady()
|
|
466
|
+
}
|
|
467
|
+
if (root.value) {
|
|
468
|
+
root.value.$emit('error', {
|
|
469
|
+
source: node.name,
|
|
470
|
+
attrs: node.attrs,
|
|
471
|
+
// #ifndef H5 && VUE3
|
|
472
|
+
errMsg: e.detail.errMsg
|
|
473
|
+
// #endif
|
|
474
|
+
})
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// 暴露给模板的方法
|
|
479
|
+
defineExpose({
|
|
480
|
+
// #ifdef MP-WEIXIN
|
|
481
|
+
toJSON
|
|
482
|
+
// #endif
|
|
483
|
+
})
|
|
484
|
+
</script>
|
|
485
|
+
|
|
486
|
+
<style>
|
|
487
|
+
/* a 标签默认效果 */
|
|
488
|
+
._a {
|
|
489
|
+
padding: 1.5px 0 1.5px 0;
|
|
490
|
+
color: #366092;
|
|
491
|
+
word-break: break-all;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/* a 标签点击态效果 */
|
|
495
|
+
._hover {
|
|
496
|
+
text-decoration: underline;
|
|
497
|
+
opacity: 0.7;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/* 图片默认效果 */
|
|
501
|
+
._img {
|
|
502
|
+
max-width: 100%;
|
|
503
|
+
-webkit-touch-callout: none;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/* 内部样式 */
|
|
507
|
+
|
|
508
|
+
._block {
|
|
509
|
+
display: block;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
._b,
|
|
513
|
+
._strong {
|
|
514
|
+
font-weight: bold;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
._code {
|
|
518
|
+
font-family: monospace;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
._del {
|
|
522
|
+
text-decoration: line-through;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
._em, ._i {
|
|
526
|
+
font-style: italic;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
._h1 {
|
|
530
|
+
font-size: 2em;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
._h2 {
|
|
534
|
+
font-size: 1.5em;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
._h3 {
|
|
538
|
+
font-size: 1.17em;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
._h5 {
|
|
542
|
+
font-size: 0.83em;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
._h6 {
|
|
546
|
+
font-size: 0.67em;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
._h1, ._h2, ._h3, ._h4, ._h5, ._h6 {
|
|
550
|
+
display: block;
|
|
551
|
+
font-weight: bold;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
._image {
|
|
555
|
+
height: 1px;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
._ins {
|
|
559
|
+
text-decoration: underline;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
._li {
|
|
563
|
+
display: list-item;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
._ol {
|
|
567
|
+
list-style-type: decimal;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
._ol, ._ul {
|
|
571
|
+
display: block;
|
|
572
|
+
padding-left: 40px;
|
|
573
|
+
margin: 1em 0;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
._q::before {
|
|
577
|
+
content: '"';
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
._q::after {
|
|
581
|
+
content: '"';
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
._sub {
|
|
585
|
+
font-size: smaller;
|
|
586
|
+
vertical-align: sub;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
._sup {
|
|
590
|
+
font-size: smaller;
|
|
591
|
+
vertical-align: super;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
._thead, ._tbody, ._tfoot {
|
|
595
|
+
display: table-row-group;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
._tr {
|
|
599
|
+
display: table-row;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
._td, ._th {
|
|
603
|
+
display: table-cell;
|
|
604
|
+
vertical-align: middle;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
._th {
|
|
608
|
+
font-weight: bold;
|
|
609
|
+
text-align: center;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
._ul {
|
|
613
|
+
list-style-type: disc;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
._ul ._ul {
|
|
617
|
+
margin: 0;
|
|
618
|
+
list-style-type: circle;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
._ul ._ul ._ul {
|
|
622
|
+
list-style-type: square;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
._abbr, ._b, ._code, ._del, ._em, ._i, ._ins, ._label, ._q, ._span, ._strong, ._sub, ._sup {
|
|
626
|
+
display: inline;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
/* #ifdef APP-PLUS */
|
|
630
|
+
._video {
|
|
631
|
+
width: 300px;
|
|
632
|
+
height: 225px;
|
|
633
|
+
}
|
|
634
|
+
/* #endif */
|
|
635
|
+
</style>
|