@10yun/cv-mobile-ui 0.5.29 → 0.5.31
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/package.json +5 -1
- package/plugins/luch-request/adapters/index.js +131 -0
- package/plugins/luch-request/core/InterceptorManager.js +50 -0
- package/plugins/luch-request/core/Request.js +199 -0
- package/plugins/luch-request/core/buildFullPath.js +20 -0
- package/plugins/luch-request/core/defaults.js +32 -0
- package/plugins/luch-request/core/dispatchRequest.js +5 -0
- package/plugins/luch-request/core/mergeConfig.js +125 -0
- package/plugins/luch-request/core/settle.js +16 -0
- package/plugins/luch-request/helpers/buildURL.js +71 -0
- package/plugins/luch-request/helpers/combineURLs.js +12 -0
- package/plugins/luch-request/helpers/isAbsoluteURL.js +14 -0
- package/plugins/luch-request/index.d.ts +197 -0
- package/plugins/luch-request/index.js +2 -0
- package/plugins/luch-request/readme.md +3 -0
- package/plugins/luch-request/utils/clone.js +264 -0
- package/plugins/luch-request/utils.js +131 -0
- package/plugins/request.js +2 -2
- package/ui-cv/components/cv-btn-base/cv-btn-base.vue +1 -1
- package/ui-cv/components/cv-form-item/cv-form-item.vue +1 -1
- package/ui-fireui/fui-actionsheet/fui-actionsheet.vue +202 -0
- package/ui-fireui/fui-alert/fui-alert.vue +141 -0
- package/ui-fireui/fui-badge/fui-badge.vue +158 -0
- package/ui-fireui/fui-bottom-navigation/fui-bottom-navigation.vue +390 -0
- package/ui-fireui/fui-bottom-popup/fui-bottom-popup.vue +100 -0
- package/ui-fireui/fui-bubble-popup/fui-bubble-popup.vue +236 -0
- package/ui-fireui/fui-button/fui-button.vue +424 -0
- package/ui-fireui/fui-calendar/fui-calendar.js +915 -0
- package/ui-fireui/fui-calendar/fui-calendar.vue +868 -0
- package/ui-fireui/fui-card/fui-card.vue +231 -0
- package/ui-fireui/fui-cascade-selection/fui-cascade-selection.vue +538 -0
- package/ui-fireui/fui-circular-progress/fui-circular-progress.vue +261 -0
- package/ui-fireui/fui-collapse/fui-collapse.vue +179 -0
- package/ui-fireui/fui-countdown/fui-countdown.vue +301 -0
- package/ui-fireui/fui-datetime/fui-datetime.vue +570 -0
- package/ui-fireui/fui-divider/fui-divider.vue +118 -0
- package/ui-fireui/fui-drawer/fui-drawer.vue +103 -0
- package/ui-fireui/fui-dropdown-list/fui-dropdown-list.vue +70 -0
- package/ui-fireui/fui-fab/fui-fab.vue +284 -0
- package/ui-fireui/fui-footer/fui-footer.vue +131 -0
- package/ui-fireui/fui-grid/fui-grid.vue +42 -0
- package/ui-fireui/fui-grid-item/fui-grid-item.vue +142 -0
- package/ui-fireui/fui-icon/fui-icon.vue +820 -0
- package/ui-fireui/fui-image-cropper/fui-image-cropper.vue +1058 -0
- package/ui-fireui/fui-image-group/fui-image-group.vue +149 -0
- package/ui-fireui/fui-keyboard/fui-keyboard.vue +254 -0
- package/ui-fireui/fui-keyboard-input/fui-keyboard-input.vue +78 -0
- package/ui-fireui/fui-list-cell/fui-list-cell.vue +178 -0
- package/ui-fireui/fui-list-view/fui-list-view.vue +87 -0
- package/ui-fireui/fui-loading/fui-loading.vue +78 -0
- package/ui-fireui/fui-loadmore/fui-loadmore.vue +163 -0
- package/ui-fireui/fui-modal/fui-modal.vue +392 -0
- package/ui-fireui/fui-navigation-bar/fui-navigation-bar.vue +180 -0
- package/ui-fireui/fui-no-data/fui-no-data.vue +116 -0
- package/ui-fireui/fui-nomore/fui-nomore.vue +116 -0
- package/ui-fireui/fui-numberbox/fui-numberbox.vue +234 -0
- package/ui-fireui/fui-numberbox-border/fui-numberbox-border.vue +232 -0
- package/ui-fireui/fui-picture-cropper/fui-picture-cropper.vue +682 -0
- package/ui-fireui/fui-picture-cropper/fui-picture-cropper.wxs +560 -0
- package/ui-fireui/fui-rate/fui-rate.vue +167 -0
- package/ui-fireui/fui-round-progress/fui-round-progress.vue +306 -0
- package/ui-fireui/fui-scroll-top/fui-scroll-top.vue +189 -0
- package/ui-fireui/fui-sharemodel/fui-sharemodel.vue +181 -0
- package/ui-fireui/fui-skeleton/fui-skeleton.vue +248 -0
- package/ui-fireui/fui-steps/fui-steps.vue +214 -0
- package/ui-fireui/fui-sticky/fui-sticky.vue +155 -0
- package/ui-fireui/fui-sticky-wxs/fui-sticky-wxs.vue +133 -0
- package/ui-fireui/fui-sticky-wxs/fui-sticky.wxs +44 -0
- package/ui-fireui/fui-swipe-action/fui-swipe-action.vue +301 -0
- package/ui-fireui/fui-tabbar/fui-tabbar.vue +283 -0
- package/ui-fireui/fui-tabs/fui-tabs.vue +284 -0
- package/ui-fireui/fui-tabs2/fui-tabs2.vue +284 -0
- package/ui-fireui/fui-tag/fui-tag.vue +374 -0
- package/ui-fireui/fui-time-axis/fui-time-axis.vue +36 -0
- package/ui-fireui/fui-timeaxis-item/fui-timeaxis-item.vue +48 -0
- package/ui-fireui/fui-tips/fui-tips.vue +161 -0
- package/ui-fireui/fui-toast/fui-toast.vue +117 -0
- package/ui-fireui/fui-top-dropdown/fui-top-dropdown.vue +129 -0
- package/ui-fireui/fui-upload/fui-upload.vue +446 -0
- package/ui-fireui/fui-uploadsamll/fui-uploadsamll.vue +472 -0
- package/uview-plus/README.md +2 -2
- package/uview-plus/changelog-wu-tool.md +21 -0
- package/uview-plus/changelog-wu.md +91 -0
- package/uview-plus/components/u-action-sheet/_doc/changelog.md +12 -0
- package/uview-plus/components/u-action-sheet/_doc/package.json +92 -0
- package/uview-plus/components/u-action-sheet/_doc/readme.md +16 -0
- package/uview-plus/components/u-action-sheet/u-action-sheet.vue +8 -8
- package/uview-plus/components/u-album/u-album.vue +1 -1
- package/uview-plus/components/u-alert/u-alert.vue +5 -5
- package/uview-plus/components/u-app-update/_doc/changelog.md +26 -0
- package/uview-plus/components/u-app-update/_doc/package.json +89 -0
- package/uview-plus/components/u-app-update/_doc/readme.md +16 -0
- package/uview-plus/components/u-app-update/config.js +120 -0
- package/uview-plus/components/u-app-update/img/act.png +0 -0
- package/uview-plus/components/u-app-update/img/appUploadAlertBoxBg.png +0 -0
- package/uview-plus/components/u-app-update/img/close.png +0 -0
- package/uview-plus/components/u-app-update/js-sdk/checkVersion.js +81 -0
- package/uview-plus/components/u-app-update/js-sdk/silentlyAppUpdate.js +41 -0
- package/uview-plus/components/u-app-update/pages/index.vue +8 -0
- package/uview-plus/components/u-app-update/u-app-update.vue +583 -0
- package/uview-plus/components/u-avatar/u-avatar.vue +2 -2
- package/uview-plus/components/u-avatar-group/u-avatar-group.vue +79 -3
- package/uview-plus/components/u-back-top/u-back-top.vue +4 -4
- package/uview-plus/components/u-badge/u-badge.vue +1 -1
- package/uview-plus/components/u-button/u-button.vue +8 -8
- package/uview-plus/components/u-button-wu/_doc/changelog.md +6 -0
- package/uview-plus/components/u-button-wu/_doc/package.json +89 -0
- package/uview-plus/components/u-button-wu/_doc/readme.md +16 -0
- package/uview-plus/components/u-button-wu/u-button-wu.vue +522 -0
- package/uview-plus/components/u-button-wu/vue.scss +81 -0
- package/uview-plus/components/u-calendar/u-calendar.vue +5 -6
- package/uview-plus/components/u-calendar-wu/_doc/changelog.md +145 -0
- package/uview-plus/components/u-calendar-wu/_doc/package.json +90 -0
- package/uview-plus/components/u-calendar-wu/_doc/readme.md +16 -0
- package/uview-plus/components/u-calendar-wu/calendar.js +664 -0
- package/uview-plus/components/u-calendar-wu/i18n/en.json +14 -0
- package/uview-plus/components/u-calendar-wu/i18n/index.js +8 -0
- package/uview-plus/components/u-calendar-wu/i18n/zh-Hans.json +14 -0
- package/uview-plus/components/u-calendar-wu/i18n/zh-Hant.json +14 -0
- package/uview-plus/components/u-calendar-wu/props.js +166 -0
- package/uview-plus/components/u-calendar-wu/style.css +196 -0
- package/uview-plus/components/u-calendar-wu/u-calendar-wu.vue +921 -0
- package/uview-plus/components/u-calendar-wu/util.js +552 -0
- package/uview-plus/components/u-calendar-wu/wu-calendar-block/props.js +73 -0
- package/uview-plus/components/u-calendar-wu/wu-calendar-block/wu-calendar-block.vue +122 -0
- package/uview-plus/components/u-calendar-wu/wu-calendar-item/props.js +55 -0
- package/uview-plus/components/u-calendar-wu/wu-calendar-item/wu-calendar-item.vue +293 -0
- package/uview-plus/components/u-car-keyboard/u-car-keyboard.vue +2 -2
- package/uview-plus/components/u-card/u-card.vue +139 -3
- package/uview-plus/components/u-cell/_doc/changelog.md +6 -0
- package/uview-plus/components/u-cell/_doc/package.json +89 -0
- package/uview-plus/components/u-cell/_doc/readme.md +25 -0
- package/uview-plus/components/u-cell/u-cell.vue +4 -4
- package/uview-plus/components/u-cell-group/u-cell-group.vue +2 -2
- package/uview-plus/components/u-checkbox/_doc/changelog.md +8 -0
- package/uview-plus/components/u-checkbox/_doc/package.json +88 -0
- package/uview-plus/components/u-checkbox/_doc/readme.md +25 -0
- package/uview-plus/components/u-checkbox/u-checkbox.vue +4 -4
- package/uview-plus/components/u-checkbox-group/u-checkbox-group.vue +1 -1
- package/uview-plus/components/u-code/_doc/changelog.md +6 -0
- package/uview-plus/components/u-code/_doc/package.json +86 -0
- package/uview-plus/components/u-code/_doc/readme.md +16 -0
- package/uview-plus/components/u-code/u-code.vue +1 -1
- package/uview-plus/components/u-code-input/u-code-input.vue +1 -1
- package/uview-plus/components/u-col/u-col.vue +1 -1
- package/uview-plus/components/u-collapse/u-collapse.vue +2 -2
- package/uview-plus/components/u-collapse-item/u-collapse-item.vue +218 -3
- package/uview-plus/components/u-column-notice/u-column-notice.vue +3 -3
- package/uview-plus/components/u-count-down/u-count-down.vue +1 -1
- package/uview-plus/components/u-count-to/u-count-to.vue +1 -1
- package/uview-plus/components/u-datetime-picker/u-datetime-picker.vue +3 -3
- package/uview-plus/components/u-divider/u-divider.vue +3 -3
- package/uview-plus/components/u-drag-sort/_doc/changelog.md +0 -0
- package/uview-plus/components/u-drag-sort/_doc/package.json +85 -0
- package/uview-plus/components/u-drag-sort/_doc/readme.md +16 -0
- package/uview-plus/components/u-drag-sort/u-drag-sort.vue +3 -0
- package/uview-plus/components/u-dropdown/u-dropdown.vue +3 -3
- package/uview-plus/components/u-dropdown-item/u-dropdown-item.vue +1 -1
- package/uview-plus/components/u-empty/u-empty.vue +30 -4
- package/uview-plus/components/u-form-item/u-form-item.vue +4 -4
- package/uview-plus/components/u-gap/_doc/changelog.md +4 -0
- package/uview-plus/components/u-gap/_doc/package.json +86 -0
- package/uview-plus/components/u-gap/_doc/readme.md +22 -0
- package/uview-plus/components/u-gap/u-gap.vue +1 -1
- package/uview-plus/components/u-grid/u-grid.vue +1 -1
- package/uview-plus/components/u-grid-item/u-grid-item.vue +1 -1
- package/uview-plus/components/u-icon/_doc/changelog.md +10 -0
- package/uview-plus/components/u-icon/_doc/package.json +85 -0
- package/uview-plus/components/u-icon/_doc/readme.md +10 -0
- package/uview-plus/components/u-icon/icon.js +23 -25
- package/uview-plus/components/u-icon/icons.js +213 -213
- package/uview-plus/components/u-icon/style.css +3 -3
- package/uview-plus/components/u-icon/u-icon.vue +1 -1
- package/uview-plus/components/u-icon/u-icon2.vue +149 -0
- package/uview-plus/components/u-image/u-image.vue +5 -5
- package/uview-plus/components/u-image-wu/_doc/changelog.md +21 -0
- package/uview-plus/components/u-image-wu/_doc/package.json +88 -0
- package/uview-plus/components/u-image-wu/_doc/readme.md +11 -0
- package/uview-plus/components/u-image-wu/props.js +94 -0
- package/uview-plus/components/u-image-wu/u-image-wu.vue +243 -0
- package/uview-plus/components/u-index-anchor/u-index-anchor.vue +1 -1
- package/uview-plus/components/u-index-list/u-index-list.vue +2 -2
- package/uview-plus/components/u-input/_doc/changelog.md +6 -0
- package/uview-plus/components/u-input/_doc/package.json +88 -0
- package/uview-plus/components/u-input/_doc/readme.md +16 -0
- package/uview-plus/components/u-input/u-input.vue +4 -4
- package/uview-plus/components/u-keyboard/u-keyboard.vue +6 -6
- package/uview-plus/components/u-lazy-load/u-lazy-load.vue +257 -3
- package/uview-plus/components/u-line/_doc/changelog.md +8 -0
- package/uview-plus/components/u-line/_doc/package.json +86 -0
- package/uview-plus/components/u-line/_doc/readme.md +16 -0
- package/uview-plus/components/u-line/u-line.vue +1 -1
- package/uview-plus/components/u-line-progress/u-line-progress.vue +1 -1
- package/uview-plus/components/u-link/_doc/changelog.md +8 -0
- package/uview-plus/components/u-link/_doc/package.json +86 -0
- package/uview-plus/components/u-link/_doc/readme.md +20 -0
- package/uview-plus/components/u-link/u-link.vue +1 -1
- package/uview-plus/components/u-list/u-list.vue +1 -1
- package/uview-plus/components/u-list-item/u-list-item.vue +1 -1
- package/uview-plus/components/u-loading-icon/_doc/changelog.md +12 -0
- package/uview-plus/components/u-loading-icon/_doc/package.json +86 -0
- package/uview-plus/components/u-loading-icon/_doc/readme.md +16 -0
- package/uview-plus/components/u-loading-icon/props.js +1 -1
- package/uview-plus/components/u-loading-icon/u-loading-icon.vue +191 -3
- package/uview-plus/components/u-loading-page/u-loading-page.vue +4 -4
- package/uview-plus/components/u-loadmore/u-loadmore.vue +4 -4
- package/uview-plus/components/u-mask/u-mask.vue +120 -113
- package/uview-plus/components/u-message-input/u-message-input.vue +1 -1
- package/uview-plus/components/u-modal/u-modal.vue +6 -6
- package/uview-plus/components/u-navbar/_doc/changelog.md +6 -0
- package/uview-plus/components/u-navbar/_doc/package.json +89 -0
- package/uview-plus/components/u-navbar/_doc/readme.md +16 -0
- package/uview-plus/components/u-navbar/u-navbar.vue +4 -4
- package/uview-plus/components/u-navbar-mini/u-navbar-mini.vue +2 -2
- package/uview-plus/components/u-navbar-wu/props.js +102 -0
- package/uview-plus/components/u-navbar-wu/u-navbar-wu.vue +196 -0
- package/uview-plus/components/u-no-network/u-no-network.vue +5 -5
- package/uview-plus/components/u-notice-bar/u-notice-bar.vue +5 -5
- package/uview-plus/components/u-notify/u-notify.vue +6 -6
- package/uview-plus/components/u-number-box/_doc/changelog.md +19 -0
- package/uview-plus/components/u-number-box/_doc/package.json +88 -0
- package/uview-plus/components/u-number-box/_doc/readme.md +16 -0
- package/uview-plus/components/u-number-box/u-number-box.vue +9 -3
- package/uview-plus/components/u-number-keyboard/u-number-keyboard.vue +1 -1
- package/uview-plus/components/u-overlay/_doc/changelog.md +4 -0
- package/uview-plus/components/u-overlay/_doc/package.json +88 -0
- package/uview-plus/components/u-overlay/_doc/readme.md +16 -0
- package/uview-plus/components/u-overlay/u-overlay.vue +3 -3
- package/uview-plus/components/u-picker/u-picker.vue +5 -5
- package/uview-plus/components/u-popup/_doc/changelog.md +4 -0
- package/uview-plus/components/u-popup/_doc/package.json +92 -0
- package/uview-plus/components/u-popup/_doc/readme.md +16 -0
- package/uview-plus/components/u-popup/u-popup.vue +8 -8
- package/uview-plus/components/u-popup-wu/keypress.js +45 -0
- package/uview-plus/components/u-popup-wu/u-popup-wu.vue +519 -0
- package/uview-plus/components/u-radio/_doc/changelog.md +6 -0
- package/uview-plus/components/u-radio/_doc/package.json +88 -0
- package/uview-plus/components/u-radio/_doc/readme.md +25 -0
- package/uview-plus/components/u-radio/u-radio.vue +4 -4
- package/uview-plus/components/u-radio-group/u-radio-group.vue +1 -1
- package/uview-plus/components/u-rate/u-rate.vue +5 -5
- package/uview-plus/components/u-read-more/u-read-more.vue +126 -3
- package/uview-plus/components/u-row/_doc/changelog.md +8 -0
- package/uview-plus/components/u-row/_doc/package.json +86 -0
- package/uview-plus/components/u-row/_doc/readme.md +16 -0
- package/uview-plus/components/u-row/u-row.vue +1 -1
- package/uview-plus/components/u-row-notice/u-row-notice.vue +3 -3
- package/uview-plus/components/u-safe-bottom/_doc/changelog.md +6 -0
- package/uview-plus/components/u-safe-bottom/_doc/package.json +86 -0
- package/uview-plus/components/u-safe-bottom/_doc/readme.md +16 -0
- package/uview-plus/components/u-safe-bottom/u-safe-bottom.vue +48 -3
- package/uview-plus/components/u-search/u-search.vue +4 -4
- package/uview-plus/components/u-select/u-select.vue +175 -3
- package/uview-plus/components/u-skeleton/u-skeleton.vue +3 -3
- package/uview-plus/components/u-sku-wu/_doc/changelog.md +27 -0
- package/uview-plus/components/u-sku-wu/_doc/package.json +93 -0
- package/uview-plus/components/u-sku-wu/_doc/readme.md +16 -0
- package/uview-plus/components/u-sku-wu/props.js +86 -0
- package/uview-plus/components/u-sku-wu/style.css +271 -0
- package/uview-plus/components/u-sku-wu/u-sku-wu.vue +864 -0
- package/uview-plus/components/u-status-bar/_doc/changelog.md +4 -0
- package/uview-plus/components/u-status-bar/_doc/package.json +86 -0
- package/uview-plus/components/u-status-bar/_doc/readme.md +16 -0
- package/uview-plus/components/u-status-bar/u-status-bar.vue +1 -1
- package/uview-plus/components/u-steps/u-steps.vue +1 -1
- package/uview-plus/components/u-steps-item/u-steps-item.vue +7 -7
- package/uview-plus/components/u-sticky/u-sticky.vue +1 -1
- package/uview-plus/components/u-subsection/u-subsection.vue +1 -1
- package/uview-plus/components/u-swipe-action/u-swipe-action.vue +1 -1
- package/uview-plus/components/u-swipe-action-item/u-swipe-action-item.vue +3 -3
- package/uview-plus/components/u-swiper/u-swiper.vue +1 -1
- package/uview-plus/components/u-swiper-indicator/u-swiper-indicator.vue +1 -1
- package/uview-plus/components/u-switch/u-switch.vue +2 -2
- package/uview-plus/components/u-tabbar/u-tabbar.vue +2 -2
- package/uview-plus/components/u-tabbar-item/u-tabbar-item.vue +9 -4
- package/uview-plus/components/u-table/u-table.vue +1 -1
- package/uview-plus/components/u-tabs/u-tabs.vue +3 -3
- package/uview-plus/components/u-tag/u-tag.vue +5 -5
- package/uview-plus/components/u-text/_doc/changelog.md +10 -0
- package/uview-plus/components/u-text/_doc/package.json +89 -0
- package/uview-plus/components/u-text/_doc/readme.md +20 -0
- package/uview-plus/components/u-text/u-text.vue +159 -3
- package/uview-plus/components/u-textarea/_doc/changelog.md +6 -0
- package/uview-plus/components/u-textarea/_doc/package.json +86 -0
- package/uview-plus/components/u-textarea/_doc/readme.md +25 -0
- package/uview-plus/components/u-toast/u-toast.vue +8 -8
- package/uview-plus/components/u-tooltip/u-tooltip.vue +6 -6
- package/uview-plus/components/u-transition/_doc/changelog.md +14 -0
- package/uview-plus/components/u-transition/_doc/package.json +86 -0
- package/uview-plus/components/u-transition/_doc/readme.md +16 -0
- package/uview-plus/components/u-transition-wu/createAnimation.js +148 -0
- package/uview-plus/components/u-transition-wu/props.js +32 -0
- package/uview-plus/components/u-transition-wu/u-transition.vue +300 -0
- package/uview-plus/components/u-upload/u-upload.vue +10 -10
- package/uview-plus/components/u-verification-code/u-verification-code.vue +161 -0
- package/uview-plus/components/u-waterfall/u-waterfall.vue +221 -3
- package/uview-plus/index.js +109 -94
- package/uview-plus/libs/config/config.js +46 -48
- package/uview-plus/libs/css/color.scss +32 -311
- package/uview-plus/libs/css/components-wu.scss +30 -0
- package/uview-plus/libs/css/vue.scss +10 -10
- package/uview-plus/libs/ctocode/index.js +120 -0
- package/uview-plus/libs/function/calc.js +61 -55
- package/uview-plus/libs/function/color/color-convert/CHANGELOG.md +54 -0
- package/uview-plus/libs/function/color/color-convert/LICENSE +21 -0
- package/uview-plus/libs/function/color/color-convert/README.md +68 -0
- package/uview-plus/libs/function/color/color-convert/conversions.js +839 -0
- package/uview-plus/libs/function/color/color-convert/index.js +81 -0
- package/uview-plus/libs/function/color/color-convert/package.json +48 -0
- package/uview-plus/libs/function/color/color-convert/route.js +97 -0
- package/uview-plus/libs/function/color/color-name/LICENSE +8 -0
- package/uview-plus/libs/function/color/color-name/README.md +11 -0
- package/uview-plus/libs/function/color/color-name/index.js +152 -0
- package/uview-plus/libs/function/color/color-name/package.json +28 -0
- package/uview-plus/libs/function/color/color-string/LICENSE +21 -0
- package/uview-plus/libs/function/color/color-string/README.md +62 -0
- package/uview-plus/libs/function/color/color-string/index.js +244 -0
- package/uview-plus/libs/function/color/color-string/package.json +39 -0
- package/uview-plus/libs/function/color/color.js +496 -0
- package/uview-plus/libs/function/color/index.js +158 -0
- package/uview-plus/libs/function/color/is-arrayish/LICENSE +21 -0
- package/uview-plus/libs/function/color/is-arrayish/README.md +16 -0
- package/uview-plus/libs/function/color/is-arrayish/index.js +9 -0
- package/uview-plus/libs/function/color/is-arrayish/package.json +45 -0
- package/uview-plus/libs/function/color/is-arrayish/yarn-error.log +1443 -0
- package/uview-plus/libs/function/color/simple-swizzle/LICENSE +21 -0
- package/uview-plus/libs/function/color/simple-swizzle/README.md +39 -0
- package/uview-plus/libs/function/color/simple-swizzle/index.js +29 -0
- package/uview-plus/libs/function/color/simple-swizzle/package.json +36 -0
- package/uview-plus/libs/function/colorGradient.js +108 -106
- package/uview-plus/libs/function/debounce.js +17 -17
- package/uview-plus/libs/function/digit.js +1 -3
- package/uview-plus/libs/function/http.js +3 -3
- package/uview-plus/libs/function/index-wu.js +198 -0
- package/uview-plus/libs/function/index.js +579 -566
- package/uview-plus/libs/function/platform.js +18 -18
- package/uview-plus/libs/function/test.js +135 -137
- package/uview-plus/libs/function/throttle.js +17 -17
- package/uview-plus/libs/luch-request/core/Request.js +199 -199
- package/uview-plus/libs/mixin/mpMixin.js +1 -0
- package/uview-plus/libs/mixin/openType.js +33 -0
- package/uview-plus/libs/util/async-validator.js +1343 -1343
- package/uview-plus/libs/util/dayjs.js +404 -0
- package/uview-plus/libs/util/route.js +101 -105
- package/uview-plus/package-wu-tool.json +84 -0
- package/uview-plus/package-wu.json +112 -0
- package/uview-plus/package.json +106 -95
- package/uview-plus/readme-wu.md +148 -0
- package/uview-ui/index.js +51 -52
- package/plugins/uni-upgrade.js +0 -294
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## u-line 线条
|
|
2
|
+
|
|
3
|
+
> **组件名:u-line**
|
|
4
|
+
|
|
5
|
+
该组件一般用于显示一根线条,用于分隔内容块,有横向和竖向两种模式,且能设置0.5px线条。
|
|
6
|
+
|
|
7
|
+
## [查看文档](https://ijry.github.io/uview-plus/components/line.html)
|
|
8
|
+
|
|
9
|
+
## [更多组件, 请查看 `u-ui` 组件库](https://ext.dcloud.net.cn/plugin?name=u--ui)
|
|
10
|
+
(请勿下载插件zip)
|
|
11
|
+
|
|
12
|
+
<a href="https://ext.dcloud.net.cn/plugin?name=u--ui">
|
|
13
|
+
<img src="https://wuui.cn/intr.png">
|
|
14
|
+
</a>
|
|
15
|
+
|
|
16
|
+
**如使用过程中有任何问题,或者您对u-ui有一些好的建议。<br>欢迎加入 [u-ui 交流群](https://ijry.github.io/uview-plus/components/qqFeedBack.html)**
|
|
@@ -17,7 +17,7 @@ import { addUnit, addStyle, deepMerge } from '../../libs/function/index';
|
|
|
17
17
|
* @property {String | Number} margin 线条与上下左右元素的间距,字符串形式,如"30px" (默认 0 )
|
|
18
18
|
* @property {Boolean} dashed 是否虚线,true-虚线,false-实线 (默认 false )
|
|
19
19
|
* @property {Object} customStyle 定义需要用到的外部样式
|
|
20
|
-
* @example <
|
|
20
|
+
* @example <up-line color="red"></up-line>
|
|
21
21
|
*/
|
|
22
22
|
export default {
|
|
23
23
|
name: 'u-line',
|
|
@@ -35,7 +35,7 @@ const dom = uni.requireNativePlugin('dom');
|
|
|
35
35
|
* @property {Boolean} showText 是否在进度条内部显示百分比的值 ( 默认 true )
|
|
36
36
|
* @property {String | Number} height 进度条的高度,单位px ( 默认 12 )
|
|
37
37
|
*
|
|
38
|
-
* @example <
|
|
38
|
+
* @example <up-line-progress :percent="70" :show-percent="true"></up-line-progress>
|
|
39
39
|
*/
|
|
40
40
|
export default {
|
|
41
41
|
name: 'u-line-progress',
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "u-link",
|
|
3
|
+
"displayName": "u-link 超链接,全端兼容,无论平台,一致体验",
|
|
4
|
+
"version": "1.0.3",
|
|
5
|
+
"description": "u-link是超链接组件,在不同平台有不同表现形式。",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"u-link",
|
|
8
|
+
"wuui",
|
|
9
|
+
"u-ui",
|
|
10
|
+
"全端兼容",
|
|
11
|
+
"超链接"
|
|
12
|
+
],
|
|
13
|
+
"repository": "",
|
|
14
|
+
"engines": {
|
|
15
|
+
"HBuilderX": "^3.4.15"
|
|
16
|
+
},
|
|
17
|
+
"dcloudext": {
|
|
18
|
+
"type": "component-vue",
|
|
19
|
+
"sale": {
|
|
20
|
+
"regular": {
|
|
21
|
+
"price": "0.00"
|
|
22
|
+
},
|
|
23
|
+
"sourcecode": {
|
|
24
|
+
"price": "0.00"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"contact": {
|
|
28
|
+
"qq": ""
|
|
29
|
+
},
|
|
30
|
+
"declaration": {
|
|
31
|
+
"ads": "无",
|
|
32
|
+
"data": "插件不采集任何数据",
|
|
33
|
+
"permissions": "无"
|
|
34
|
+
},
|
|
35
|
+
"npmurl": ""
|
|
36
|
+
},
|
|
37
|
+
"uni_modules": {
|
|
38
|
+
"dependencies": [],
|
|
39
|
+
"encrypt": [],
|
|
40
|
+
"platforms": {
|
|
41
|
+
"cloud": {
|
|
42
|
+
"tcb": "y",
|
|
43
|
+
"aliyun": "y",
|
|
44
|
+
"alipay": "n"
|
|
45
|
+
},
|
|
46
|
+
"client": {
|
|
47
|
+
"Vue": {
|
|
48
|
+
"vue2": "y",
|
|
49
|
+
"vue3": "y"
|
|
50
|
+
},
|
|
51
|
+
"App": {
|
|
52
|
+
"app-vue": "y",
|
|
53
|
+
"app-nvue": "y"
|
|
54
|
+
},
|
|
55
|
+
"H5-mobile": {
|
|
56
|
+
"Safari": "y",
|
|
57
|
+
"Android Browser": "y",
|
|
58
|
+
"微信浏览器(Android)": "y",
|
|
59
|
+
"QQ浏览器(Android)": "y"
|
|
60
|
+
},
|
|
61
|
+
"H5-pc": {
|
|
62
|
+
"Chrome": "y",
|
|
63
|
+
"IE": "y",
|
|
64
|
+
"Edge": "y",
|
|
65
|
+
"Firefox": "y",
|
|
66
|
+
"Safari": "y"
|
|
67
|
+
},
|
|
68
|
+
"小程序": {
|
|
69
|
+
"微信": "y",
|
|
70
|
+
"阿里": "y",
|
|
71
|
+
"百度": "y",
|
|
72
|
+
"字节跳动": "y",
|
|
73
|
+
"QQ": "y",
|
|
74
|
+
"钉钉": "n",
|
|
75
|
+
"快手": "n",
|
|
76
|
+
"飞书": "n",
|
|
77
|
+
"京东": "n"
|
|
78
|
+
},
|
|
79
|
+
"快应用": {
|
|
80
|
+
"华为": "n",
|
|
81
|
+
"联盟": "n"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
## u-link 超链接
|
|
2
|
+
|
|
3
|
+
> **组件名:u-link**
|
|
4
|
+
|
|
5
|
+
该组件为超链接组件,在不同平台有不同表现形式:
|
|
6
|
+
|
|
7
|
+
+ 在APP平台会通过plus环境打开内置浏览器
|
|
8
|
+
+ 在小程序中把链接复制到粘贴板,同时提示信息
|
|
9
|
+
+ 在H5中通过window.open打开链接
|
|
10
|
+
|
|
11
|
+
## [查看文档](https://ijry.github.io/uview-plus/components/link.html)
|
|
12
|
+
|
|
13
|
+
## [更多组件, 请查看 `u-ui` 组件库](https://ext.dcloud.net.cn/plugin?name=u--ui)
|
|
14
|
+
(请勿下载插件zip)
|
|
15
|
+
|
|
16
|
+
<a href="https://ext.dcloud.net.cn/plugin?name=u--ui">
|
|
17
|
+
<img src="https://wuui.cn/intr.png">
|
|
18
|
+
</a>
|
|
19
|
+
|
|
20
|
+
**如使用过程中有任何问题,或者您对u-ui有一些好的建议。<br>欢迎加入 [u-ui 交流群](https://ijry.github.io/uview-plus/components/qqFeedBack.html)**
|
|
@@ -19,7 +19,7 @@ import { addStyle, addUnit, getPx, toast } from '../../libs/function/index';
|
|
|
19
19
|
* @property {String} text 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色
|
|
20
20
|
* @property {Object} customStyle 定义需要用到的外部样式
|
|
21
21
|
*
|
|
22
|
-
* @example <
|
|
22
|
+
* @example <up-link href="http://www.uviewui.com">蜀道难,难于上青天</up-link>
|
|
23
23
|
*/
|
|
24
24
|
export default {
|
|
25
25
|
name: 'u-link',
|
|
@@ -73,7 +73,7 @@ const dom = uni.requireNativePlugin('dom');
|
|
|
73
73
|
* @property {String | Number} preLoadScreen 列表前后预渲染的屏数,1代表一个屏幕的高度,1.5代表1个半屏幕高度 (默认 1 )
|
|
74
74
|
* @property {Object} customStyle 定义需要用到的外部样式
|
|
75
75
|
*
|
|
76
|
-
* @example <
|
|
76
|
+
* @example <up-list @scrolltolower="scrolltolower"></up-list>
|
|
77
77
|
*/
|
|
78
78
|
export default {
|
|
79
79
|
name: 'u-list',
|
|
@@ -22,7 +22,7 @@ const dom = uni.requireNativePlugin('dom');
|
|
|
22
22
|
* @description 该组件为高性能列表组件
|
|
23
23
|
* @tutorial https://ijry.github.io/uview-plus/components/list.html
|
|
24
24
|
* @property {String | Number} anchor 用于滚动到指定item
|
|
25
|
-
* @example <
|
|
25
|
+
* @example <up-list-ite v-for="(item, index) in indexList" :key="index" ></up-list-item>
|
|
26
26
|
*/
|
|
27
27
|
export default {
|
|
28
28
|
name: 'u-list-item',
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## 1.0.5(2024-05-08)
|
|
2
|
+
更新域名
|
|
3
|
+
## 1.0.4(2023-08-21)
|
|
4
|
+
更新组件说明
|
|
5
|
+
## 1.0.3(2023-08-15)
|
|
6
|
+
修复插件api错误
|
|
7
|
+
## 1.0.2(2023-08-08)
|
|
8
|
+
增加说明
|
|
9
|
+
## 1.0.1(2023-08-04)
|
|
10
|
+
u-loading-icon 加载动画 全面兼容小程序、nvue、vue2、vue3等多端
|
|
11
|
+
## 1.0.0(2023-08-01)
|
|
12
|
+
u-loading-icon 加载动画 全面兼容小程序、nvue、vue2、vue3等多端
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "u-loading-icon",
|
|
3
|
+
"displayName": "u-loading-icon 加载动画 全面兼容小程序、nvue、vue2、vue3等多端",
|
|
4
|
+
"version": "1.0.5",
|
|
5
|
+
"description": "u-loading-icon 此组件为一个小动画,目前用在u-ui的loadMore加载更多等组件的正在加载状态场景。",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"u-loading-icon",
|
|
8
|
+
"wuui",
|
|
9
|
+
"u-ui",
|
|
10
|
+
"loading",
|
|
11
|
+
"加载动画"
|
|
12
|
+
],
|
|
13
|
+
"repository": "",
|
|
14
|
+
"engines": {
|
|
15
|
+
"HBuilderX": "^3.1.0"
|
|
16
|
+
},
|
|
17
|
+
"dcloudext": {
|
|
18
|
+
"type": "component-vue",
|
|
19
|
+
"sale": {
|
|
20
|
+
"regular": {
|
|
21
|
+
"price": "0.00"
|
|
22
|
+
},
|
|
23
|
+
"sourcecode": {
|
|
24
|
+
"price": "0.00"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"contact": {
|
|
28
|
+
"qq": ""
|
|
29
|
+
},
|
|
30
|
+
"declaration": {
|
|
31
|
+
"ads": "无",
|
|
32
|
+
"data": "插件不采集任何数据",
|
|
33
|
+
"permissions": "无"
|
|
34
|
+
},
|
|
35
|
+
"npmurl": ""
|
|
36
|
+
},
|
|
37
|
+
"uni_modules": {
|
|
38
|
+
"dependencies": [],
|
|
39
|
+
"encrypt": [],
|
|
40
|
+
"platforms": {
|
|
41
|
+
"cloud": {
|
|
42
|
+
"tcb": "y",
|
|
43
|
+
"aliyun": "y",
|
|
44
|
+
"alipay": "n"
|
|
45
|
+
},
|
|
46
|
+
"client": {
|
|
47
|
+
"Vue": {
|
|
48
|
+
"vue2": "y",
|
|
49
|
+
"vue3": "y"
|
|
50
|
+
},
|
|
51
|
+
"App": {
|
|
52
|
+
"app-vue": "y",
|
|
53
|
+
"app-nvue": "y"
|
|
54
|
+
},
|
|
55
|
+
"H5-mobile": {
|
|
56
|
+
"Safari": "y",
|
|
57
|
+
"Android Browser": "y",
|
|
58
|
+
"微信浏览器(Android)": "y",
|
|
59
|
+
"QQ浏览器(Android)": "y"
|
|
60
|
+
},
|
|
61
|
+
"H5-pc": {
|
|
62
|
+
"Chrome": "y",
|
|
63
|
+
"IE": "y",
|
|
64
|
+
"Edge": "y",
|
|
65
|
+
"Firefox": "y",
|
|
66
|
+
"Safari": "y"
|
|
67
|
+
},
|
|
68
|
+
"小程序": {
|
|
69
|
+
"微信": "y",
|
|
70
|
+
"阿里": "y",
|
|
71
|
+
"百度": "y",
|
|
72
|
+
"字节跳动": "y",
|
|
73
|
+
"QQ": "y",
|
|
74
|
+
"钉钉": "u",
|
|
75
|
+
"快手": "u",
|
|
76
|
+
"飞书": "u",
|
|
77
|
+
"京东": "u"
|
|
78
|
+
},
|
|
79
|
+
"快应用": {
|
|
80
|
+
"华为": "u",
|
|
81
|
+
"联盟": "u"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## LoadingIcon 加载动画
|
|
2
|
+
|
|
3
|
+
> **组件名:u-loading-icon**
|
|
4
|
+
|
|
5
|
+
此组件为一个小动画,目前用在u-ui的loadMore加载更多等组件的正在加载状态场景。
|
|
6
|
+
|
|
7
|
+
### <a href="https://ijry.github.io/uview-plus/components/loadingIcon" target="_blank">查看文档</a>
|
|
8
|
+
|
|
9
|
+
## [更多组件, 请查看 `u-ui` 组件库](https://ext.dcloud.net.cn/plugin?name=u--ui)
|
|
10
|
+
(请勿下载插件zip)
|
|
11
|
+
|
|
12
|
+
<a href="https://ext.dcloud.net.cn/plugin?name=u--ui">
|
|
13
|
+
<img src="https://wuui.cn/intr.png">
|
|
14
|
+
</a>
|
|
15
|
+
|
|
16
|
+
**如使用过程中有任何问题,或者您对u-ui有一些好的建议。<br>欢迎加入 [u-ui 交流群](https://ijry.github.io/uview-plus/components/qqFeedBack.html)**
|
|
@@ -42,7 +42,7 @@ export const props = defineMixin({
|
|
|
42
42
|
type: [String, Number],
|
|
43
43
|
default: () => defProps.loadingIcon.text
|
|
44
44
|
},
|
|
45
|
-
// 动画模式
|
|
45
|
+
// 动画模式 https://www.runoob.com/cssref/css3-pr-animation-timing-function.html
|
|
46
46
|
timingFunction: {
|
|
47
47
|
type: String,
|
|
48
48
|
default: () => defProps.loadingIcon.timingFunction
|
|
@@ -1,3 +1,191 @@
|
|
|
1
|
-
<template>
|
|
2
1
|
<view class="u-loading-icon" :style="[addStyle(customStyle)]" :class="[vertical && 'u-loading-icon--vertical']" v-if="show">
|
|
3
2
|
<view
|
|
4
3
|
v-if="!webviewHide"
|
|
5
4
|
class="u-loading-icon__spinner"
|
|
6
5
|
:class="[`u-loading-icon__spinner--${mode}`]"
|
|
7
6
|
ref="ani"
|
|
8
7
|
:style="{
|
|
9
8
|
color: color,
|
|
10
9
|
width: addUnit(size),
|
|
11
10
|
height: addUnit(size),
|
|
12
11
|
borderTopColor: color,
|
|
13
12
|
borderBottomColor: otherBorderColor,
|
|
14
13
|
borderLeftColor: otherBorderColor,
|
|
15
14
|
borderRightColor: otherBorderColor,
|
|
16
15
|
'animation-duration': `${duration}ms`,
|
|
17
16
|
'animation-timing-function': mode === 'semicircle' || mode === 'circle' ? timingFunction : ''
|
|
18
17
|
}"
|
|
19
18
|
>
|
|
20
19
|
<block v-if="mode === 'spinner'">
|
|
21
20
|
<!-- #ifndef APP-NVUE -->
|
|
22
21
|
<view v-for="(item, index) in array12" :key="index" class="u-loading-icon__dot"></view>
|
|
23
22
|
<!-- #endif -->
|
|
24
23
|
<!-- #ifdef APP-NVUE -->
|
|
25
24
|
<!-- 此组件内部图标部分无法设置宽高,即使通过width和height配置了也无效 -->
|
|
26
25
|
<loading-indicator
|
|
27
26
|
v-if="!webviewHide"
|
|
28
27
|
class="u-loading-indicator"
|
|
29
28
|
:animating="true"
|
|
30
29
|
:style="{
|
|
31
30
|
color: color,
|
|
32
31
|
width: addUnit(size),
|
|
33
32
|
height: addUnit(size)
|
|
34
33
|
}"
|
|
35
34
|
/>
|
|
36
35
|
<!-- #endif -->
|
|
37
36
|
</block>
|
|
38
37
|
</view>
|
|
39
38
|
<text
|
|
40
39
|
v-if="text"
|
|
41
40
|
class="u-loading-icon__text"
|
|
42
41
|
:style="{
|
|
43
42
|
fontSize: addUnit(textSize),
|
|
44
43
|
color: textColor
|
|
45
44
|
}"
|
|
46
45
|
>
|
|
47
46
|
{{ text }}
|
|
48
47
|
</text>
|
|
49
48
|
</view>
|
|
50
49
|
* loading 加载动画
|
|
51
50
|
* @description 警此组件为一个小动画,目前用在uView的loadmore加载更多和switch开关等组件的正在加载状态场景。
|
|
52
51
|
* @tutorial https://ijry.github.io/uview-plus/components/loading.html
|
|
53
52
|
* @property {Boolean} show 是否显示组件 (默认 true)
|
|
54
53
|
* @property {String} color 动画活动区域的颜色,只对 mode = flower 模式有效(默认color['u-tips-color'])
|
|
55
54
|
* @property {String} textColor 提示文本的颜色(默认color['u-tips-color'])
|
|
56
55
|
* @property {Boolean} vertical 文字和图标是否垂直排列 (默认 false )
|
|
57
56
|
* @property {String} mode 模式选择,见官网说明(默认 'circle' )
|
|
58
57
|
* @property {String | Number} size 加载图标的大小,单位px (默认 24 )
|
|
59
58
|
* @property {String | Number} textSize 文字大小(默认 15 )
|
|
60
59
|
* @property {String | Number} text 文字内容
|
|
61
60
|
* @property {String} timingFunction 动画模式 (默认 'ease-in-out' )
|
|
62
61
|
* @property {String | Number} duration 动画执行周期时间(默认 1200)
|
|
63
62
|
* @property {String} inactiveColor mode=circle时的暗边颜色
|
|
64
63
|
* @property {Object} customStyle 定义需要用到的外部样式
|
|
65
64
|
* @example <u-loading mode="circle"></u-loading>
|
|
66
65
|
*/
|
|
67
66
|
name: 'u-loading-icon',
|
|
68
67
|
mixins: [mpMixin, mixin, props],
|
|
69
68
|
data() {
|
|
70
69
|
return {
|
|
71
70
|
// Array.form可以通过一个伪数组对象创建指定长度的数组
|
|
72
71
|
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/from
|
|
73
72
|
array12: Array.from({
|
|
74
73
|
length: 12
|
|
75
74
|
}),
|
|
76
75
|
// 这里需要设置默认值为360,否则在安卓nvue上,会延迟一个duration周期后才执行
|
|
77
76
|
// 在iOS nvue上,则会一开始默认执行两个周期的动画
|
|
78
77
|
aniAngel: 360, // 动画旋转角度
|
|
79
78
|
webviewHide: false, // 监听webview的状态,如果隐藏了页面,则停止动画,以免性能消耗
|
|
80
79
|
loading: false // 是否运行中,针对nvue使用
|
|
81
80
|
};
|
|
82
81
|
},
|
|
83
82
|
computed: {
|
|
84
83
|
// 当为circle类型时,给其另外三边设置一个更轻一些的颜色
|
|
85
84
|
// 之所以需要这么做的原因是,比如父组件传了color为红色,那么需要另外的三个边为浅红色
|
|
86
85
|
// 而不能是固定的某一个其他颜色(因为这个固定的颜色可能浅蓝,导致效果没有那么细腻良好)
|
|
87
86
|
otherBorderColor() {
|
|
88
87
|
const lightColor = colorGradient(this.color, '#ffffff', 100)[80];
|
|
89
88
|
if (this.mode === 'circle') {
|
|
90
89
|
return this.inactiveColor ? this.inactiveColor : lightColor;
|
|
91
90
|
} else {
|
|
92
91
|
return 'transparent';
|
|
93
92
|
}
|
|
94
93
|
// return this.mode === 'circle' ? this.inactiveColor ? this.inactiveColor : lightColor : 'transparent'
|
|
95
94
|
}
|
|
96
95
|
},
|
|
97
96
|
watch: {
|
|
98
97
|
show(n) {
|
|
99
98
|
// nvue中,show为true,且为非loading状态,就重新执行动画模块
|
|
100
99
|
// #ifdef APP-NVUE
|
|
101
100
|
if (n && !this.loading) {
|
|
102
101
|
setTimeout(() => {
|
|
103
102
|
this.startAnimate();
|
|
104
103
|
}, 30);
|
|
105
104
|
}
|
|
106
105
|
// #endif
|
|
107
106
|
}
|
|
108
107
|
},
|
|
109
108
|
mounted() {
|
|
110
109
|
this.init();
|
|
111
110
|
},
|
|
112
111
|
methods: {
|
|
113
112
|
addUnit,
|
|
114
113
|
addStyle,
|
|
115
114
|
init() {
|
|
116
115
|
setTimeout(() => {
|
|
117
116
|
// #ifdef APP-NVUE
|
|
118
117
|
this.show && this.nvueAnimate();
|
|
119
118
|
// #endif
|
|
120
119
|
// #ifdef APP-PLUS
|
|
121
120
|
this.show && this.addEventListenerToWebview();
|
|
122
121
|
// #endif
|
|
123
122
|
}, 20);
|
|
124
123
|
},
|
|
125
124
|
// 监听webview的显示与隐藏
|
|
126
125
|
addEventListenerToWebview() {
|
|
127
126
|
// webview的堆栈
|
|
128
127
|
const pages = getCurrentPages();
|
|
129
128
|
// 当前页面
|
|
130
129
|
const page = pages[pages.length - 1];
|
|
131
130
|
// 当前页面的webview实例
|
|
132
131
|
const currentWebview = page.$getAppWebview();
|
|
133
132
|
// 监听webview的显示与隐藏,从而停止或者开始动画(为了性能)
|
|
134
133
|
currentWebview.addEventListener('hide', () => {
|
|
135
134
|
this.webviewHide = true;
|
|
136
135
|
});
|
|
137
136
|
currentWebview.addEventListener('show', () => {
|
|
138
137
|
this.webviewHide = false;
|
|
139
138
|
});
|
|
140
139
|
},
|
|
141
140
|
// #ifdef APP-NVUE
|
|
142
141
|
nvueAnimate() {
|
|
143
142
|
// nvue下,非spinner类型时才需要旋转,因为nvue的spinner类型,使用了weex的
|
|
144
143
|
// loading-indicator组件,自带旋转功能
|
|
145
144
|
this.mode !== 'spinner' && this.startAnimate();
|
|
146
145
|
},
|
|
147
146
|
// 执行nvue的animate模块动画
|
|
148
147
|
startAnimate() {
|
|
149
148
|
this.loading = true;
|
|
150
149
|
const ani = this.$refs.ani;
|
|
151
150
|
if (!ani) return;
|
|
152
151
|
animation.transition(
|
|
153
152
|
ani,
|
|
154
153
|
{
|
|
155
154
|
// 进行角度旋转
|
|
156
155
|
styles: {
|
|
157
156
|
transform: `rotate(${this.aniAngel}deg)`,
|
|
158
157
|
transformOrigin: 'center center'
|
|
159
158
|
},
|
|
160
159
|
duration: this.duration,
|
|
161
160
|
timingFunction: this.timingFunction
|
|
162
161
|
// delay: 10
|
|
163
162
|
},
|
|
164
163
|
() => {
|
|
165
164
|
// 每次增加360deg,为了让其重新旋转一周
|
|
166
165
|
this.aniAngel += 360;
|
|
167
166
|
// 动画结束后,继续循环执行动画,需要同时判断webviewHide变量
|
|
168
167
|
// nvue安卓,页面隐藏后依然会继续执行startAnimate方法
|
|
169
168
|
this.show && !this.webviewHide ? this.startAnimate() : (this.loading = false);
|
|
170
169
|
}
|
|
171
170
|
);
|
|
172
171
|
}
|
|
173
172
|
// #endif
|
|
174
173
|
}
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
<template>
|
|
175
|
+
<view class="u-loading-icon" :style="[addStyle(customStyle)]" :class="[vertical && 'u-loading-icon--vertical']" v-if="show">
|
|
176
|
+
<view
|
|
177
|
+
v-if="!webviewHide"
|
|
178
|
+
class="u-loading-icon__spinner"
|
|
179
|
+
:class="[`u-loading-icon__spinner--${mode}`]"
|
|
180
|
+
ref="ani"
|
|
181
|
+
:style="{
|
|
182
|
+
color: color,
|
|
183
|
+
width: addUnit(size),
|
|
184
|
+
height: addUnit(size),
|
|
185
|
+
borderTopColor: color,
|
|
186
|
+
borderBottomColor: otherBorderColor,
|
|
187
|
+
borderLeftColor: otherBorderColor,
|
|
188
|
+
borderRightColor: otherBorderColor,
|
|
189
|
+
'animation-duration': `${duration}ms`,
|
|
190
|
+
'animation-timing-function': mode === 'semicircle' || mode === 'circle' ? timingFunction : ''
|
|
191
|
+
}"
|
|
192
|
+
>
|
|
193
|
+
<block v-if="mode === 'spinner'">
|
|
194
|
+
<!-- #ifndef APP-NVUE -->
|
|
195
|
+
<view v-for="(item, index) in array12" :key="index" class="u-loading-icon__dot"></view>
|
|
196
|
+
<!-- #endif -->
|
|
197
|
+
<!-- #ifdef APP-NVUE -->
|
|
198
|
+
<!-- 此组件内部图标部分无法设置宽高,即使通过width和height配置了也无效 -->
|
|
199
|
+
<loading-indicator
|
|
200
|
+
v-if="!webviewHide"
|
|
201
|
+
class="u-loading-indicator"
|
|
202
|
+
:animating="true"
|
|
203
|
+
:style="{
|
|
204
|
+
color: color,
|
|
205
|
+
width: addUnit(size),
|
|
206
|
+
height: addUnit(size)
|
|
207
|
+
}"
|
|
208
|
+
/>
|
|
209
|
+
<!-- #endif -->
|
|
210
|
+
</block>
|
|
211
|
+
</view>
|
|
212
|
+
<text
|
|
213
|
+
v-if="text"
|
|
214
|
+
class="u-loading-icon__text"
|
|
215
|
+
:style="{
|
|
216
|
+
fontSize: addUnit(textSize),
|
|
217
|
+
color: textColor
|
|
218
|
+
}"
|
|
219
|
+
>
|
|
220
|
+
{{ text }}
|
|
221
|
+
</text>
|
|
222
|
+
</view>
|
|
223
|
+
</template>
|
|
224
|
+
<script>
|
|
225
|
+
import { props } from './props';
|
|
226
|
+
import { mpMixin } from '../../libs/mixin/mpMixin';
|
|
227
|
+
import { mixin } from '../../libs/mixin/mixin';
|
|
228
|
+
import { addUnit, addStyle } from '../../libs/function/index';
|
|
229
|
+
import { colorGradient } from '../../libs/function/colorGradient';
|
|
230
|
+
// #ifdef APP-NVUE
|
|
231
|
+
const animation = weex.requireModule('animation');
|
|
232
|
+
// #endif
|
|
233
|
+
/**
|
|
234
|
+
* loading 加载动画
|
|
235
|
+
* @description 警此组件为一个小动画,目前用在uView的loadmore加载更多和switch开关等组件的正在加载状态场景。
|
|
236
|
+
* @tutorial https://ijry.github.io/uview-plus/components/loading.html
|
|
237
|
+
* @property {Boolean} show 是否显示组件 (默认 true)
|
|
238
|
+
* @property {String} color 动画活动区域的颜色,只对 mode = flower 模式有效(默认color['u-tips-color'])
|
|
239
|
+
* @property {String} textColor 提示文本的颜色(默认color['u-tips-color'])
|
|
240
|
+
* @property {Boolean} vertical 文字和图标是否垂直排列 (默认 false )
|
|
241
|
+
* @property {String} mode 模式选择,见官网说明(默认 'circle' )
|
|
242
|
+
* @property {String | Number} size 加载图标的大小,单位px (默认 24 )
|
|
243
|
+
* @property {String | Number} textSize 文字大小(默认 15 )
|
|
244
|
+
* @property {String | Number} text 文字内容
|
|
245
|
+
* @property {String} timingFunction 动画模式 (默认 'ease-in-out' )
|
|
246
|
+
* @property {String | Number} duration 动画执行周期时间(默认 1200)
|
|
247
|
+
* @property {String} inactiveColor mode=circle时的暗边颜色
|
|
248
|
+
* @property {Object} customStyle 定义需要用到的外部样式
|
|
249
|
+
* @example <up-loading mode="circle"></up-loading>
|
|
250
|
+
*/
|
|
251
|
+
export default {
|
|
252
|
+
name: 'u-loading-icon',
|
|
253
|
+
mixins: [mpMixin, mixin, props],
|
|
254
|
+
data() {
|
|
255
|
+
return {
|
|
256
|
+
// Array.form可以通过一个伪数组对象创建指定长度的数组
|
|
257
|
+
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/from
|
|
258
|
+
array12: Array.from({
|
|
259
|
+
length: 12
|
|
260
|
+
}),
|
|
261
|
+
// 这里需要设置默认值为360,否则在安卓nvue上,会延迟一个duration周期后才执行
|
|
262
|
+
// 在iOS nvue上,则会一开始默认执行两个周期的动画
|
|
263
|
+
aniAngel: 360, // 动画旋转角度
|
|
264
|
+
webviewHide: false, // 监听webview的状态,如果隐藏了页面,则停止动画,以免性能消耗
|
|
265
|
+
loading: false // 是否运行中,针对nvue使用
|
|
266
|
+
};
|
|
267
|
+
},
|
|
268
|
+
computed: {
|
|
269
|
+
// 当为circle类型时,给其另外三边设置一个更轻一些的颜色
|
|
270
|
+
// 之所以需要这么做的原因是,比如父组件传了color为红色,那么需要另外的三个边为浅红色
|
|
271
|
+
// 而不能是固定的某一个其他颜色(因为这个固定的颜色可能浅蓝,导致效果没有那么细腻良好)
|
|
272
|
+
otherBorderColor() {
|
|
273
|
+
const lightColor = colorGradient(this.color, '#ffffff', 100)[80];
|
|
274
|
+
if (this.mode === 'circle') {
|
|
275
|
+
return this.inactiveColor ? this.inactiveColor : lightColor;
|
|
276
|
+
} else {
|
|
277
|
+
return 'transparent';
|
|
278
|
+
}
|
|
279
|
+
// return this.mode === 'circle' ? this.inactiveColor ? this.inactiveColor : lightColor : 'transparent'
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
watch: {
|
|
283
|
+
show(n) {
|
|
284
|
+
// nvue中,show为true,且为非loading状态,就重新执行动画模块
|
|
285
|
+
// #ifdef APP-NVUE
|
|
286
|
+
if (n && !this.loading) {
|
|
287
|
+
setTimeout(() => {
|
|
288
|
+
this.startAnimate();
|
|
289
|
+
}, 30);
|
|
290
|
+
}
|
|
291
|
+
// #endif
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
mounted() {
|
|
295
|
+
this.init();
|
|
296
|
+
},
|
|
297
|
+
methods: {
|
|
298
|
+
addUnit,
|
|
299
|
+
addStyle,
|
|
300
|
+
init() {
|
|
301
|
+
setTimeout(() => {
|
|
302
|
+
// #ifdef APP-NVUE
|
|
303
|
+
this.show && this.nvueAnimate();
|
|
304
|
+
// #endif
|
|
305
|
+
// #ifdef APP-PLUS
|
|
306
|
+
this.show && this.addEventListenerToWebview();
|
|
307
|
+
// #endif
|
|
308
|
+
}, 20);
|
|
309
|
+
},
|
|
310
|
+
// 监听webview的显示与隐藏
|
|
311
|
+
addEventListenerToWebview() {
|
|
312
|
+
// webview的堆栈
|
|
313
|
+
const pages = getCurrentPages();
|
|
314
|
+
// 当前页面
|
|
315
|
+
const page = pages[pages.length - 1];
|
|
316
|
+
// 当前页面的webview实例
|
|
317
|
+
const currentWebview = page.$getAppWebview();
|
|
318
|
+
// 监听webview的显示与隐藏,从而停止或者开始动画(为了性能)
|
|
319
|
+
currentWebview.addEventListener('hide', () => {
|
|
320
|
+
this.webviewHide = true;
|
|
321
|
+
});
|
|
322
|
+
currentWebview.addEventListener('show', () => {
|
|
323
|
+
this.webviewHide = false;
|
|
324
|
+
});
|
|
325
|
+
},
|
|
326
|
+
// #ifdef APP-NVUE
|
|
327
|
+
nvueAnimate() {
|
|
328
|
+
// nvue下,非spinner类型时才需要旋转,因为nvue的spinner类型,使用了weex的
|
|
329
|
+
// loading-indicator组件,自带旋转功能
|
|
330
|
+
this.mode !== 'spinner' && this.startAnimate();
|
|
331
|
+
},
|
|
332
|
+
// 执行nvue的animate模块动画
|
|
333
|
+
startAnimate() {
|
|
334
|
+
this.loading = true;
|
|
335
|
+
const ani = this.$refs.ani;
|
|
336
|
+
if (!ani) return;
|
|
337
|
+
animation.transition(
|
|
338
|
+
ani,
|
|
339
|
+
{
|
|
340
|
+
// 进行角度旋转
|
|
341
|
+
styles: {
|
|
342
|
+
transform: `rotate(${this.aniAngel}deg)`,
|
|
343
|
+
transformOrigin: 'center center'
|
|
344
|
+
},
|
|
345
|
+
duration: this.duration,
|
|
346
|
+
timingFunction: this.timingFunction
|
|
347
|
+
// delay: 10
|
|
348
|
+
},
|
|
349
|
+
() => {
|
|
350
|
+
// 每次增加360deg,为了让其重新旋转一周
|
|
351
|
+
this.aniAngel += 360;
|
|
352
|
+
// 动画结束后,继续循环执行动画,需要同时判断webviewHide变量
|
|
353
|
+
// nvue安卓,页面隐藏后依然会继续执行startAnimate方法
|
|
354
|
+
this.show && !this.webviewHide ? this.startAnimate() : (this.loading = false);
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
// #endif
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
</script>
|
|
362
|
+
<style scoped>
|
|
363
|
+
@import './style.css';
|
|
364
|
+
</style>
|