@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,915 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @1900-2100区间内的公历、农历互转
|
|
3
|
+
* @公历转农历:solar2lunar(1987,11,01);
|
|
4
|
+
* @农历转公历:lunar2solar(1987,09,10);
|
|
5
|
+
*/
|
|
6
|
+
let calendar = {
|
|
7
|
+
/**
|
|
8
|
+
* 农历1900-2100的润大小信息表
|
|
9
|
+
* @Array Of Property
|
|
10
|
+
* @return Hex
|
|
11
|
+
*/
|
|
12
|
+
lunarInfo: [
|
|
13
|
+
0x04bd8,
|
|
14
|
+
0x04ae0,
|
|
15
|
+
0x0a570,
|
|
16
|
+
0x054d5,
|
|
17
|
+
0x0d260,
|
|
18
|
+
0x0d950,
|
|
19
|
+
0x16554,
|
|
20
|
+
0x056a0,
|
|
21
|
+
0x09ad0,
|
|
22
|
+
0x055d2, //1900-1909
|
|
23
|
+
0x04ae0,
|
|
24
|
+
0x0a5b6,
|
|
25
|
+
0x0a4d0,
|
|
26
|
+
0x0d250,
|
|
27
|
+
0x1d255,
|
|
28
|
+
0x0b540,
|
|
29
|
+
0x0d6a0,
|
|
30
|
+
0x0ada2,
|
|
31
|
+
0x095b0,
|
|
32
|
+
0x14977, //1910-1919
|
|
33
|
+
0x04970,
|
|
34
|
+
0x0a4b0,
|
|
35
|
+
0x0b4b5,
|
|
36
|
+
0x06a50,
|
|
37
|
+
0x06d40,
|
|
38
|
+
0x1ab54,
|
|
39
|
+
0x02b60,
|
|
40
|
+
0x09570,
|
|
41
|
+
0x052f2,
|
|
42
|
+
0x04970, //1920-1929
|
|
43
|
+
0x06566,
|
|
44
|
+
0x0d4a0,
|
|
45
|
+
0x0ea50,
|
|
46
|
+
0x06e95,
|
|
47
|
+
0x05ad0,
|
|
48
|
+
0x02b60,
|
|
49
|
+
0x186e3,
|
|
50
|
+
0x092e0,
|
|
51
|
+
0x1c8d7,
|
|
52
|
+
0x0c950, //1930-1939
|
|
53
|
+
0x0d4a0,
|
|
54
|
+
0x1d8a6,
|
|
55
|
+
0x0b550,
|
|
56
|
+
0x056a0,
|
|
57
|
+
0x1a5b4,
|
|
58
|
+
0x025d0,
|
|
59
|
+
0x092d0,
|
|
60
|
+
0x0d2b2,
|
|
61
|
+
0x0a950,
|
|
62
|
+
0x0b557, //1940-1949
|
|
63
|
+
0x06ca0,
|
|
64
|
+
0x0b550,
|
|
65
|
+
0x15355,
|
|
66
|
+
0x04da0,
|
|
67
|
+
0x0a5b0,
|
|
68
|
+
0x14573,
|
|
69
|
+
0x052b0,
|
|
70
|
+
0x0a9a8,
|
|
71
|
+
0x0e950,
|
|
72
|
+
0x06aa0, //1950-1959
|
|
73
|
+
0x0aea6,
|
|
74
|
+
0x0ab50,
|
|
75
|
+
0x04b60,
|
|
76
|
+
0x0aae4,
|
|
77
|
+
0x0a570,
|
|
78
|
+
0x05260,
|
|
79
|
+
0x0f263,
|
|
80
|
+
0x0d950,
|
|
81
|
+
0x05b57,
|
|
82
|
+
0x056a0, //1960-1969
|
|
83
|
+
0x096d0,
|
|
84
|
+
0x04dd5,
|
|
85
|
+
0x04ad0,
|
|
86
|
+
0x0a4d0,
|
|
87
|
+
0x0d4d4,
|
|
88
|
+
0x0d250,
|
|
89
|
+
0x0d558,
|
|
90
|
+
0x0b540,
|
|
91
|
+
0x0b6a0,
|
|
92
|
+
0x195a6, //1970-1979
|
|
93
|
+
0x095b0,
|
|
94
|
+
0x049b0,
|
|
95
|
+
0x0a974,
|
|
96
|
+
0x0a4b0,
|
|
97
|
+
0x0b27a,
|
|
98
|
+
0x06a50,
|
|
99
|
+
0x06d40,
|
|
100
|
+
0x0af46,
|
|
101
|
+
0x0ab60,
|
|
102
|
+
0x09570, //1980-1989
|
|
103
|
+
0x04af5,
|
|
104
|
+
0x04970,
|
|
105
|
+
0x064b0,
|
|
106
|
+
0x074a3,
|
|
107
|
+
0x0ea50,
|
|
108
|
+
0x06b58,
|
|
109
|
+
0x055c0,
|
|
110
|
+
0x0ab60,
|
|
111
|
+
0x096d5,
|
|
112
|
+
0x092e0, //1990-1999
|
|
113
|
+
0x0c960,
|
|
114
|
+
0x0d954,
|
|
115
|
+
0x0d4a0,
|
|
116
|
+
0x0da50,
|
|
117
|
+
0x07552,
|
|
118
|
+
0x056a0,
|
|
119
|
+
0x0abb7,
|
|
120
|
+
0x025d0,
|
|
121
|
+
0x092d0,
|
|
122
|
+
0x0cab5, //2000-2009
|
|
123
|
+
0x0a950,
|
|
124
|
+
0x0b4a0,
|
|
125
|
+
0x0baa4,
|
|
126
|
+
0x0ad50,
|
|
127
|
+
0x055d9,
|
|
128
|
+
0x04ba0,
|
|
129
|
+
0x0a5b0,
|
|
130
|
+
0x15176,
|
|
131
|
+
0x052b0,
|
|
132
|
+
0x0a930, //2010-2019
|
|
133
|
+
0x07954,
|
|
134
|
+
0x06aa0,
|
|
135
|
+
0x0ad50,
|
|
136
|
+
0x05b52,
|
|
137
|
+
0x04b60,
|
|
138
|
+
0x0a6e6,
|
|
139
|
+
0x0a4e0,
|
|
140
|
+
0x0d260,
|
|
141
|
+
0x0ea65,
|
|
142
|
+
0x0d530, //2020-2029
|
|
143
|
+
0x05aa0,
|
|
144
|
+
0x076a3,
|
|
145
|
+
0x096d0,
|
|
146
|
+
0x04afb,
|
|
147
|
+
0x04ad0,
|
|
148
|
+
0x0a4d0,
|
|
149
|
+
0x1d0b6,
|
|
150
|
+
0x0d250,
|
|
151
|
+
0x0d520,
|
|
152
|
+
0x0dd45, //2030-2039
|
|
153
|
+
0x0b5a0,
|
|
154
|
+
0x056d0,
|
|
155
|
+
0x055b2,
|
|
156
|
+
0x049b0,
|
|
157
|
+
0x0a577,
|
|
158
|
+
0x0a4b0,
|
|
159
|
+
0x0aa50,
|
|
160
|
+
0x1b255,
|
|
161
|
+
0x06d20,
|
|
162
|
+
0x0ada0, //2040-2049
|
|
163
|
+
0x14b63,
|
|
164
|
+
0x09370,
|
|
165
|
+
0x049f8,
|
|
166
|
+
0x04970,
|
|
167
|
+
0x064b0,
|
|
168
|
+
0x168a6,
|
|
169
|
+
0x0ea50,
|
|
170
|
+
0x06b20,
|
|
171
|
+
0x1a6c4,
|
|
172
|
+
0x0aae0, //2050-2059
|
|
173
|
+
0x0a2e0,
|
|
174
|
+
0x0d2e3,
|
|
175
|
+
0x0c960,
|
|
176
|
+
0x0d557,
|
|
177
|
+
0x0d4a0,
|
|
178
|
+
0x0da50,
|
|
179
|
+
0x05d55,
|
|
180
|
+
0x056a0,
|
|
181
|
+
0x0a6d0,
|
|
182
|
+
0x055d4, //2060-2069
|
|
183
|
+
0x052d0,
|
|
184
|
+
0x0a9b8,
|
|
185
|
+
0x0a950,
|
|
186
|
+
0x0b4a0,
|
|
187
|
+
0x0b6a6,
|
|
188
|
+
0x0ad50,
|
|
189
|
+
0x055a0,
|
|
190
|
+
0x0aba4,
|
|
191
|
+
0x0a5b0,
|
|
192
|
+
0x052b0, //2070-2079
|
|
193
|
+
0x0b273,
|
|
194
|
+
0x06930,
|
|
195
|
+
0x07337,
|
|
196
|
+
0x06aa0,
|
|
197
|
+
0x0ad50,
|
|
198
|
+
0x14b55,
|
|
199
|
+
0x04b60,
|
|
200
|
+
0x0a570,
|
|
201
|
+
0x054e4,
|
|
202
|
+
0x0d160, //2080-2089
|
|
203
|
+
0x0e968,
|
|
204
|
+
0x0d520,
|
|
205
|
+
0x0daa0,
|
|
206
|
+
0x16aa6,
|
|
207
|
+
0x056d0,
|
|
208
|
+
0x04ae0,
|
|
209
|
+
0x0a9d4,
|
|
210
|
+
0x0a2d0,
|
|
211
|
+
0x0d150,
|
|
212
|
+
0x0f252, //2090-2099
|
|
213
|
+
0x0d520
|
|
214
|
+
], //2100
|
|
215
|
+
/**
|
|
216
|
+
* 公历每个月份的天数普通表
|
|
217
|
+
* @Array Of Property
|
|
218
|
+
* @return Number
|
|
219
|
+
*/
|
|
220
|
+
solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
|
221
|
+
/**
|
|
222
|
+
* 天干地支之天干速查表
|
|
223
|
+
* @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
|
|
224
|
+
* @return Cn string
|
|
225
|
+
*/
|
|
226
|
+
Gan: ['\u7532', '\u4e59', '\u4e19', '\u4e01', '\u620a', '\u5df1', '\u5e9a', '\u8f9b', '\u58ec', '\u7678'],
|
|
227
|
+
/**
|
|
228
|
+
* 天干地支之地支速查表
|
|
229
|
+
* @Array Of Property
|
|
230
|
+
* @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
|
|
231
|
+
* @return Cn string
|
|
232
|
+
*/
|
|
233
|
+
Zhi: ['\u5b50', '\u4e11', '\u5bc5', '\u536f', '\u8fb0', '\u5df3', '\u5348', '\u672a', '\u7533', '\u9149', '\u620c', '\u4ea5'],
|
|
234
|
+
/**
|
|
235
|
+
* 天干地支之地支速查表<=>生肖
|
|
236
|
+
* @Array Of Property
|
|
237
|
+
* @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
|
|
238
|
+
* @return Cn string
|
|
239
|
+
*/
|
|
240
|
+
Animals: [
|
|
241
|
+
'\u9f20',
|
|
242
|
+
'\u725b',
|
|
243
|
+
'\u864e',
|
|
244
|
+
'\u5154',
|
|
245
|
+
'\u9f99',
|
|
246
|
+
'\u86c7',
|
|
247
|
+
'\u9a6c',
|
|
248
|
+
'\u7f8a',
|
|
249
|
+
'\u7334',
|
|
250
|
+
'\u9e21',
|
|
251
|
+
'\u72d7',
|
|
252
|
+
'\u732a'
|
|
253
|
+
],
|
|
254
|
+
/**
|
|
255
|
+
* 24节气速查表
|
|
256
|
+
* @Array Of Property
|
|
257
|
+
* @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
|
|
258
|
+
* @return Cn string
|
|
259
|
+
*/
|
|
260
|
+
solarTerm: [
|
|
261
|
+
'\u5c0f\u5bd2',
|
|
262
|
+
'\u5927\u5bd2',
|
|
263
|
+
'\u7acb\u6625',
|
|
264
|
+
'\u96e8\u6c34',
|
|
265
|
+
'\u60ca\u86f0',
|
|
266
|
+
'\u6625\u5206',
|
|
267
|
+
'\u6e05\u660e',
|
|
268
|
+
'\u8c37\u96e8',
|
|
269
|
+
'\u7acb\u590f',
|
|
270
|
+
'\u5c0f\u6ee1',
|
|
271
|
+
'\u8292\u79cd',
|
|
272
|
+
'\u590f\u81f3',
|
|
273
|
+
'\u5c0f\u6691',
|
|
274
|
+
'\u5927\u6691',
|
|
275
|
+
'\u7acb\u79cb',
|
|
276
|
+
'\u5904\u6691',
|
|
277
|
+
'\u767d\u9732',
|
|
278
|
+
'\u79cb\u5206',
|
|
279
|
+
'\u5bd2\u9732',
|
|
280
|
+
'\u971c\u964d',
|
|
281
|
+
'\u7acb\u51ac',
|
|
282
|
+
'\u5c0f\u96ea',
|
|
283
|
+
'\u5927\u96ea',
|
|
284
|
+
'\u51ac\u81f3'
|
|
285
|
+
],
|
|
286
|
+
/**
|
|
287
|
+
* 1900-2100各年的24节气日期速查表
|
|
288
|
+
* @Array Of Property
|
|
289
|
+
* @return 0x string For splice
|
|
290
|
+
*/
|
|
291
|
+
sTermInfo: [
|
|
292
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
293
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
294
|
+
'97bcf97c3598082c95f8c965cc920f',
|
|
295
|
+
'97bd0b06bdb0722c965ce1cfcc920f',
|
|
296
|
+
'b027097bd097c36b0b6fc9274c91aa',
|
|
297
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
298
|
+
'97bcf97c359801ec95f8c965cc920f',
|
|
299
|
+
'97bd0b06bdb0722c965ce1cfcc920f',
|
|
300
|
+
'b027097bd097c36b0b6fc9274c91aa',
|
|
301
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
302
|
+
'97bcf97c359801ec95f8c965cc920f',
|
|
303
|
+
'97bd0b06bdb0722c965ce1cfcc920f',
|
|
304
|
+
'b027097bd097c36b0b6fc9274c91aa',
|
|
305
|
+
'9778397bd19801ec9210c965cc920e',
|
|
306
|
+
'97b6b97bd19801ec95f8c965cc920f',
|
|
307
|
+
'97bd09801d98082c95f8e1cfcc920f',
|
|
308
|
+
'97bd097bd097c36b0b6fc9210c8dc2',
|
|
309
|
+
'9778397bd197c36c9210c9274c91aa',
|
|
310
|
+
'97b6b97bd19801ec95f8c965cc920e',
|
|
311
|
+
'97bd09801d98082c95f8e1cfcc920f',
|
|
312
|
+
'97bd097bd097c36b0b6fc9210c8dc2',
|
|
313
|
+
'9778397bd097c36c9210c9274c91aa',
|
|
314
|
+
'97b6b97bd19801ec95f8c965cc920e',
|
|
315
|
+
'97bcf97c3598082c95f8e1cfcc920f',
|
|
316
|
+
'97bd097bd097c36b0b6fc9210c8dc2',
|
|
317
|
+
'9778397bd097c36c9210c9274c91aa',
|
|
318
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
319
|
+
'97bcf97c3598082c95f8c965cc920f',
|
|
320
|
+
'97bd097bd097c35b0b6fc920fb0722',
|
|
321
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
322
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
323
|
+
'97bcf97c3598082c95f8c965cc920f',
|
|
324
|
+
'97bd097bd097c35b0b6fc920fb0722',
|
|
325
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
326
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
327
|
+
'97bcf97c359801ec95f8c965cc920f',
|
|
328
|
+
'97bd097bd097c35b0b6fc920fb0722',
|
|
329
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
330
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
331
|
+
'97bcf97c359801ec95f8c965cc920f',
|
|
332
|
+
'97bd097bd097c35b0b6fc920fb0722',
|
|
333
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
334
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
335
|
+
'97bcf97c359801ec95f8c965cc920f',
|
|
336
|
+
'97bd097bd07f595b0b6fc920fb0722',
|
|
337
|
+
'9778397bd097c36b0b6fc9210c8dc2',
|
|
338
|
+
'9778397bd19801ec9210c9274c920e',
|
|
339
|
+
'97b6b97bd19801ec95f8c965cc920f',
|
|
340
|
+
'97bd07f5307f595b0b0bc920fb0722',
|
|
341
|
+
'7f0e397bd097c36b0b6fc9210c8dc2',
|
|
342
|
+
'9778397bd097c36c9210c9274c920e',
|
|
343
|
+
'97b6b97bd19801ec95f8c965cc920f',
|
|
344
|
+
'97bd07f5307f595b0b0bc920fb0722',
|
|
345
|
+
'7f0e397bd097c36b0b6fc9210c8dc2',
|
|
346
|
+
'9778397bd097c36c9210c9274c91aa',
|
|
347
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
348
|
+
'97bd07f1487f595b0b0bc920fb0722',
|
|
349
|
+
'7f0e397bd097c36b0b6fc9210c8dc2',
|
|
350
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
351
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
352
|
+
'97bcf7f1487f595b0b0bb0b6fb0722',
|
|
353
|
+
'7f0e397bd097c35b0b6fc920fb0722',
|
|
354
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
355
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
356
|
+
'97bcf7f1487f595b0b0bb0b6fb0722',
|
|
357
|
+
'7f0e397bd097c35b0b6fc920fb0722',
|
|
358
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
359
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
360
|
+
'97bcf7f1487f531b0b0bb0b6fb0722',
|
|
361
|
+
'7f0e397bd097c35b0b6fc920fb0722',
|
|
362
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
363
|
+
'97b6b97bd19801ec9210c965cc920e',
|
|
364
|
+
'97bcf7f1487f531b0b0bb0b6fb0722',
|
|
365
|
+
'7f0e397bd07f595b0b6fc920fb0722',
|
|
366
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
367
|
+
'97b6b97bd19801ec9210c9274c920e',
|
|
368
|
+
'97bcf7f0e47f531b0b0bb0b6fb0722',
|
|
369
|
+
'7f0e397bd07f595b0b0bc920fb0722',
|
|
370
|
+
'9778397bd097c36b0b6fc9210c91aa',
|
|
371
|
+
'97b6b97bd197c36c9210c9274c920e',
|
|
372
|
+
'97bcf7f0e47f531b0b0bb0b6fb0722',
|
|
373
|
+
'7f0e397bd07f595b0b0bc920fb0722',
|
|
374
|
+
'9778397bd097c36b0b6fc9210c8dc2',
|
|
375
|
+
'9778397bd097c36c9210c9274c920e',
|
|
376
|
+
'97b6b7f0e47f531b0723b0b6fb0722',
|
|
377
|
+
'7f0e37f5307f595b0b0bc920fb0722',
|
|
378
|
+
'7f0e397bd097c36b0b6fc9210c8dc2',
|
|
379
|
+
'9778397bd097c36b0b70c9274c91aa',
|
|
380
|
+
'97b6b7f0e47f531b0723b0b6fb0721',
|
|
381
|
+
'7f0e37f1487f595b0b0bb0b6fb0722',
|
|
382
|
+
'7f0e397bd097c35b0b6fc9210c8dc2',
|
|
383
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
384
|
+
'97b6b7f0e47f531b0723b0b6fb0721',
|
|
385
|
+
'7f0e27f1487f595b0b0bb0b6fb0722',
|
|
386
|
+
'7f0e397bd097c35b0b6fc920fb0722',
|
|
387
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
388
|
+
'97b6b7f0e47f531b0723b0b6fb0721',
|
|
389
|
+
'7f0e27f1487f531b0b0bb0b6fb0722',
|
|
390
|
+
'7f0e397bd097c35b0b6fc920fb0722',
|
|
391
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
392
|
+
'97b6b7f0e47f531b0723b0b6fb0721',
|
|
393
|
+
'7f0e27f1487f531b0b0bb0b6fb0722',
|
|
394
|
+
'7f0e397bd097c35b0b6fc920fb0722',
|
|
395
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
396
|
+
'97b6b7f0e47f531b0723b0b6fb0721',
|
|
397
|
+
'7f0e27f1487f531b0b0bb0b6fb0722',
|
|
398
|
+
'7f0e397bd07f595b0b0bc920fb0722',
|
|
399
|
+
'9778397bd097c36b0b6fc9274c91aa',
|
|
400
|
+
'97b6b7f0e47f531b0723b0787b0721',
|
|
401
|
+
'7f0e27f0e47f531b0b0bb0b6fb0722',
|
|
402
|
+
'7f0e397bd07f595b0b0bc920fb0722',
|
|
403
|
+
'9778397bd097c36b0b6fc9210c91aa',
|
|
404
|
+
'97b6b7f0e47f149b0723b0787b0721',
|
|
405
|
+
'7f0e27f0e47f531b0723b0b6fb0722',
|
|
406
|
+
'7f0e397bd07f595b0b0bc920fb0722',
|
|
407
|
+
'9778397bd097c36b0b6fc9210c8dc2',
|
|
408
|
+
'977837f0e37f149b0723b0787b0721',
|
|
409
|
+
'7f07e7f0e47f531b0723b0b6fb0722',
|
|
410
|
+
'7f0e37f5307f595b0b0bc920fb0722',
|
|
411
|
+
'7f0e397bd097c35b0b6fc9210c8dc2',
|
|
412
|
+
'977837f0e37f14998082b0787b0721',
|
|
413
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
414
|
+
'7f0e37f1487f595b0b0bb0b6fb0722',
|
|
415
|
+
'7f0e397bd097c35b0b6fc9210c8dc2',
|
|
416
|
+
'977837f0e37f14998082b0787b06bd',
|
|
417
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
418
|
+
'7f0e27f1487f531b0b0bb0b6fb0722',
|
|
419
|
+
'7f0e397bd097c35b0b6fc920fb0722',
|
|
420
|
+
'977837f0e37f14998082b0787b06bd',
|
|
421
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
422
|
+
'7f0e27f1487f531b0b0bb0b6fb0722',
|
|
423
|
+
'7f0e397bd097c35b0b6fc920fb0722',
|
|
424
|
+
'977837f0e37f14998082b0787b06bd',
|
|
425
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
426
|
+
'7f0e27f1487f531b0b0bb0b6fb0722',
|
|
427
|
+
'7f0e397bd07f595b0b0bc920fb0722',
|
|
428
|
+
'977837f0e37f14998082b0787b06bd',
|
|
429
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
430
|
+
'7f0e27f1487f531b0b0bb0b6fb0722',
|
|
431
|
+
'7f0e397bd07f595b0b0bc920fb0722',
|
|
432
|
+
'977837f0e37f14998082b0787b06bd',
|
|
433
|
+
'7f07e7f0e47f149b0723b0787b0721',
|
|
434
|
+
'7f0e27f0e47f531b0b0bb0b6fb0722',
|
|
435
|
+
'7f0e397bd07f595b0b0bc920fb0722',
|
|
436
|
+
'977837f0e37f14998082b0723b06bd',
|
|
437
|
+
'7f07e7f0e37f149b0723b0787b0721',
|
|
438
|
+
'7f0e27f0e47f531b0723b0b6fb0722',
|
|
439
|
+
'7f0e397bd07f595b0b0bc920fb0722',
|
|
440
|
+
'977837f0e37f14898082b0723b02d5',
|
|
441
|
+
'7ec967f0e37f14998082b0787b0721',
|
|
442
|
+
'7f07e7f0e47f531b0723b0b6fb0722',
|
|
443
|
+
'7f0e37f1487f595b0b0bb0b6fb0722',
|
|
444
|
+
'7f0e37f0e37f14898082b0723b02d5',
|
|
445
|
+
'7ec967f0e37f14998082b0787b0721',
|
|
446
|
+
'7f07e7f0e47f531b0723b0b6fb0722',
|
|
447
|
+
'7f0e37f1487f531b0b0bb0b6fb0722',
|
|
448
|
+
'7f0e37f0e37f14898082b0723b02d5',
|
|
449
|
+
'7ec967f0e37f14998082b0787b06bd',
|
|
450
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
451
|
+
'7f0e37f1487f531b0b0bb0b6fb0722',
|
|
452
|
+
'7f0e37f0e37f14898082b072297c35',
|
|
453
|
+
'7ec967f0e37f14998082b0787b06bd',
|
|
454
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
455
|
+
'7f0e27f1487f531b0b0bb0b6fb0722',
|
|
456
|
+
'7f0e37f0e37f14898082b072297c35',
|
|
457
|
+
'7ec967f0e37f14998082b0787b06bd',
|
|
458
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
459
|
+
'7f0e27f1487f531b0b0bb0b6fb0722',
|
|
460
|
+
'7f0e37f0e366aa89801eb072297c35',
|
|
461
|
+
'7ec967f0e37f14998082b0787b06bd',
|
|
462
|
+
'7f07e7f0e47f149b0723b0787b0721',
|
|
463
|
+
'7f0e27f1487f531b0b0bb0b6fb0722',
|
|
464
|
+
'7f0e37f0e366aa89801eb072297c35',
|
|
465
|
+
'7ec967f0e37f14998082b0723b06bd',
|
|
466
|
+
'7f07e7f0e47f149b0723b0787b0721',
|
|
467
|
+
'7f0e27f0e47f531b0723b0b6fb0722',
|
|
468
|
+
'7f0e37f0e366aa89801eb072297c35',
|
|
469
|
+
'7ec967f0e37f14998082b0723b06bd',
|
|
470
|
+
'7f07e7f0e37f14998083b0787b0721',
|
|
471
|
+
'7f0e27f0e47f531b0723b0b6fb0722',
|
|
472
|
+
'7f0e37f0e366aa89801eb072297c35',
|
|
473
|
+
'7ec967f0e37f14898082b0723b02d5',
|
|
474
|
+
'7f07e7f0e37f14998082b0787b0721',
|
|
475
|
+
'7f07e7f0e47f531b0723b0b6fb0722',
|
|
476
|
+
'7f0e36665b66aa89801e9808297c35',
|
|
477
|
+
'665f67f0e37f14898082b0723b02d5',
|
|
478
|
+
'7ec967f0e37f14998082b0787b0721',
|
|
479
|
+
'7f07e7f0e47f531b0723b0b6fb0722',
|
|
480
|
+
'7f0e36665b66a449801e9808297c35',
|
|
481
|
+
'665f67f0e37f14898082b0723b02d5',
|
|
482
|
+
'7ec967f0e37f14998082b0787b06bd',
|
|
483
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
484
|
+
'7f0e36665b66a449801e9808297c35',
|
|
485
|
+
'665f67f0e37f14898082b072297c35',
|
|
486
|
+
'7ec967f0e37f14998082b0787b06bd',
|
|
487
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
488
|
+
'7f0e26665b66a449801e9808297c35',
|
|
489
|
+
'665f67f0e37f1489801eb072297c35',
|
|
490
|
+
'7ec967f0e37f14998082b0787b06bd',
|
|
491
|
+
'7f07e7f0e47f531b0723b0b6fb0721',
|
|
492
|
+
'7f0e27f1487f531b0b0bb0b6fb0722'
|
|
493
|
+
],
|
|
494
|
+
/**
|
|
495
|
+
* 数字转中文速查表
|
|
496
|
+
* @Array Of Property
|
|
497
|
+
* @trans ['日','一','二','三','四','五','六','七','八','九','十']
|
|
498
|
+
* @return Cn string
|
|
499
|
+
*/
|
|
500
|
+
nStr1: ['\u65e5', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341'],
|
|
501
|
+
/**
|
|
502
|
+
* 日期转农历称呼速查表
|
|
503
|
+
* @Array Of Property
|
|
504
|
+
* @trans ['初','十','廿','卅']
|
|
505
|
+
* @return Cn string
|
|
506
|
+
*/
|
|
507
|
+
nStr2: ['\u521d', '\u5341', '\u5eff', '\u5345'],
|
|
508
|
+
/**
|
|
509
|
+
* 月份转农历称呼速查表
|
|
510
|
+
* @Array Of Property
|
|
511
|
+
* @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
|
|
512
|
+
* @return Cn string
|
|
513
|
+
*/
|
|
514
|
+
nStr3: ['\u6b63', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341', '\u51ac', '\u814a'],
|
|
515
|
+
/**
|
|
516
|
+
* 返回农历y年一整年的总天数
|
|
517
|
+
* @param lunar Year
|
|
518
|
+
* @return Number
|
|
519
|
+
* @eg:let count = calendar.lYearDays(1987) ;//count=387
|
|
520
|
+
*/
|
|
521
|
+
lYearDays: function (y) {
|
|
522
|
+
let i,
|
|
523
|
+
sum = 348;
|
|
524
|
+
for (i = 0x8000; i > 0x8; i >>= 1) {
|
|
525
|
+
sum += calendar.lunarInfo[y - 1900] & i ? 1 : 0;
|
|
526
|
+
}
|
|
527
|
+
return sum + calendar.leapDays(y);
|
|
528
|
+
},
|
|
529
|
+
/**
|
|
530
|
+
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
|
|
531
|
+
* @param lunar Year
|
|
532
|
+
* @return Number (0-12)
|
|
533
|
+
* @eg:let leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
|
|
534
|
+
*/
|
|
535
|
+
leapMonth: function (y) {
|
|
536
|
+
//闰字编码 \u95f0
|
|
537
|
+
return calendar.lunarInfo[y - 1900] & 0xf;
|
|
538
|
+
},
|
|
539
|
+
/**
|
|
540
|
+
* 返回农历y年闰月的天数 若该年没有闰月则返回0
|
|
541
|
+
* @param lunar Year
|
|
542
|
+
* @return Number (0、29、30)
|
|
543
|
+
* @eg:let leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
|
|
544
|
+
*/
|
|
545
|
+
leapDays: function (y) {
|
|
546
|
+
if (calendar.leapMonth(y)) {
|
|
547
|
+
return calendar.lunarInfo[y - 1900] & 0x10000 ? 30 : 29;
|
|
548
|
+
}
|
|
549
|
+
return 0;
|
|
550
|
+
},
|
|
551
|
+
/**
|
|
552
|
+
* 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
|
|
553
|
+
* @param lunar Year
|
|
554
|
+
* @return Number (-1、29、30)
|
|
555
|
+
* @eg:let MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
|
|
556
|
+
*/
|
|
557
|
+
monthDays: function (y, m) {
|
|
558
|
+
if (m > 12 || m < 1) {
|
|
559
|
+
return -1;
|
|
560
|
+
} //月份参数从1至12,参数错误返回-1
|
|
561
|
+
return calendar.lunarInfo[y - 1900] & (0x10000 >> m) ? 30 : 29;
|
|
562
|
+
},
|
|
563
|
+
/**
|
|
564
|
+
* 返回公历(!)y年m月的天数
|
|
565
|
+
* @param solar Year
|
|
566
|
+
* @return Number (-1、28、29、30、31)
|
|
567
|
+
* @eg:let solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
|
|
568
|
+
*/
|
|
569
|
+
solarDays: function (y, m) {
|
|
570
|
+
if (m > 12 || m < 1) {
|
|
571
|
+
return -1;
|
|
572
|
+
} //若参数错误 返回-1
|
|
573
|
+
let ms = m - 1;
|
|
574
|
+
if (ms == 1) {
|
|
575
|
+
//2月份的闰平规律测算后确认返回28或29
|
|
576
|
+
return (y % 4 == 0 && y % 100 != 0) || y % 400 == 0 ? 29 : 28;
|
|
577
|
+
} else {
|
|
578
|
+
return calendar.solarMonth[ms];
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
/**
|
|
582
|
+
* 农历年份转换为干支纪年
|
|
583
|
+
* @param lYear 农历年的年份数
|
|
584
|
+
* @return Cn string
|
|
585
|
+
*/
|
|
586
|
+
toGanZhiYear: function (lYear) {
|
|
587
|
+
let ganKey = (lYear - 3) % 10;
|
|
588
|
+
let zhiKey = (lYear - 3) % 12;
|
|
589
|
+
if (ganKey == 0) ganKey = 10; //如果余数为0则为最后一个天干
|
|
590
|
+
if (zhiKey == 0) zhiKey = 12; //如果余数为0则为最后一个地支
|
|
591
|
+
return calendar.Gan[ganKey - 1] + calendar.Zhi[zhiKey - 1];
|
|
592
|
+
},
|
|
593
|
+
/**
|
|
594
|
+
* 公历月、日判断所属星座
|
|
595
|
+
* @param cMonth [description]
|
|
596
|
+
* @param cDay [description]
|
|
597
|
+
* @return Cn string
|
|
598
|
+
*/
|
|
599
|
+
toAstro: function (cMonth, cDay) {
|
|
600
|
+
let s =
|
|
601
|
+
'\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf';
|
|
602
|
+
let arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
|
|
603
|
+
return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + '\u5ea7'; //座
|
|
604
|
+
},
|
|
605
|
+
/**
|
|
606
|
+
* 传入offset偏移量返回干支
|
|
607
|
+
* @param offset 相对甲子的偏移量
|
|
608
|
+
* @return Cn string
|
|
609
|
+
*/
|
|
610
|
+
toGanZhi: function (offset) {
|
|
611
|
+
return calendar.Gan[offset % 10] + calendar.Zhi[offset % 12];
|
|
612
|
+
},
|
|
613
|
+
/**
|
|
614
|
+
* 传入公历(!)y年获得该年第n个节气的公历日期
|
|
615
|
+
* @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
|
|
616
|
+
* @return day Number
|
|
617
|
+
* @eg:let _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
|
|
618
|
+
*/
|
|
619
|
+
getTerm: function (y, n) {
|
|
620
|
+
if (y < 1900 || y > 2100) {
|
|
621
|
+
return -1;
|
|
622
|
+
}
|
|
623
|
+
if (n < 1 || n > 24) {
|
|
624
|
+
return -1;
|
|
625
|
+
}
|
|
626
|
+
let _table = calendar.sTermInfo[y - 1900];
|
|
627
|
+
let _info = [
|
|
628
|
+
parseInt('0x' + _table.substr(0, 5)).toString(),
|
|
629
|
+
parseInt('0x' + _table.substr(5, 5)).toString(),
|
|
630
|
+
parseInt('0x' + _table.substr(10, 5)).toString(),
|
|
631
|
+
parseInt('0x' + _table.substr(15, 5)).toString(),
|
|
632
|
+
parseInt('0x' + _table.substr(20, 5)).toString(),
|
|
633
|
+
parseInt('0x' + _table.substr(25, 5)).toString()
|
|
634
|
+
];
|
|
635
|
+
let _calday = [
|
|
636
|
+
_info[0].substr(0, 1),
|
|
637
|
+
_info[0].substr(1, 2),
|
|
638
|
+
_info[0].substr(3, 1),
|
|
639
|
+
_info[0].substr(4, 2),
|
|
640
|
+
_info[1].substr(0, 1),
|
|
641
|
+
_info[1].substr(1, 2),
|
|
642
|
+
_info[1].substr(3, 1),
|
|
643
|
+
_info[1].substr(4, 2),
|
|
644
|
+
_info[2].substr(0, 1),
|
|
645
|
+
_info[2].substr(1, 2),
|
|
646
|
+
_info[2].substr(3, 1),
|
|
647
|
+
_info[2].substr(4, 2),
|
|
648
|
+
_info[3].substr(0, 1),
|
|
649
|
+
_info[3].substr(1, 2),
|
|
650
|
+
_info[3].substr(3, 1),
|
|
651
|
+
_info[3].substr(4, 2),
|
|
652
|
+
_info[4].substr(0, 1),
|
|
653
|
+
_info[4].substr(1, 2),
|
|
654
|
+
_info[4].substr(3, 1),
|
|
655
|
+
_info[4].substr(4, 2),
|
|
656
|
+
_info[5].substr(0, 1),
|
|
657
|
+
_info[5].substr(1, 2),
|
|
658
|
+
_info[5].substr(3, 1),
|
|
659
|
+
_info[5].substr(4, 2)
|
|
660
|
+
];
|
|
661
|
+
return parseInt(_calday[n - 1]);
|
|
662
|
+
},
|
|
663
|
+
/**
|
|
664
|
+
* 传入农历数字月份返回汉语通俗表示法
|
|
665
|
+
* @param lunar month
|
|
666
|
+
* @return Cn string
|
|
667
|
+
* @eg:let cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
|
|
668
|
+
*/
|
|
669
|
+
toChinaMonth: function (m) {
|
|
670
|
+
// 月 => \u6708
|
|
671
|
+
if (m > 12 || m < 1) {
|
|
672
|
+
return -1;
|
|
673
|
+
} //若参数错误 返回-1
|
|
674
|
+
let s = calendar.nStr3[m - 1];
|
|
675
|
+
s += '\u6708'; //加上月字
|
|
676
|
+
return s;
|
|
677
|
+
},
|
|
678
|
+
/**
|
|
679
|
+
* 传入农历日期数字返回汉字表示法
|
|
680
|
+
* @param lunar day
|
|
681
|
+
* @return Cn string
|
|
682
|
+
* @eg:let cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
|
|
683
|
+
*/
|
|
684
|
+
toChinaDay: function (d) {
|
|
685
|
+
//日 => \u65e5
|
|
686
|
+
let s;
|
|
687
|
+
switch (d) {
|
|
688
|
+
case 10:
|
|
689
|
+
s = '\u521d\u5341';
|
|
690
|
+
break;
|
|
691
|
+
case 20:
|
|
692
|
+
s = '\u4e8c\u5341';
|
|
693
|
+
break;
|
|
694
|
+
break;
|
|
695
|
+
case 30:
|
|
696
|
+
s = '\u4e09\u5341';
|
|
697
|
+
break;
|
|
698
|
+
break;
|
|
699
|
+
default:
|
|
700
|
+
s = calendar.nStr2[Math.floor(d / 10)];
|
|
701
|
+
s += calendar.nStr1[d % 10];
|
|
702
|
+
}
|
|
703
|
+
return s;
|
|
704
|
+
},
|
|
705
|
+
/**
|
|
706
|
+
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
|
|
707
|
+
* @param y year
|
|
708
|
+
* @return Cn string
|
|
709
|
+
* @eg:let animal = calendar.getAnimal(1987) ;//animal='兔'
|
|
710
|
+
*/
|
|
711
|
+
getAnimal: function (y) {
|
|
712
|
+
return calendar.Animals[(y - 4) % 12];
|
|
713
|
+
},
|
|
714
|
+
/**
|
|
715
|
+
* 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
|
|
716
|
+
* @param y solar year
|
|
717
|
+
* @param m solar month
|
|
718
|
+
* @param d solar day
|
|
719
|
+
* @return JSON object
|
|
720
|
+
* @eg:console.log(calendar.solar2lunar(1987,11,01));
|
|
721
|
+
*/
|
|
722
|
+
solar2lunar: function (y, m, d) {
|
|
723
|
+
//参数区间1900.1.31~2100.12.31
|
|
724
|
+
if (y < 1900 || y > 2100) {
|
|
725
|
+
return -1;
|
|
726
|
+
} //年份限定、上限
|
|
727
|
+
if (y == 1900 && m == 1 && d < 31) {
|
|
728
|
+
return -1;
|
|
729
|
+
} //下限
|
|
730
|
+
let objDate;
|
|
731
|
+
if (!y) {
|
|
732
|
+
//未传参 获得当天
|
|
733
|
+
objDate = new Date();
|
|
734
|
+
} else {
|
|
735
|
+
objDate = new Date(y, parseInt(m) - 1, d);
|
|
736
|
+
}
|
|
737
|
+
let i,
|
|
738
|
+
leap = 0,
|
|
739
|
+
temp = 0;
|
|
740
|
+
//修正ymd参数
|
|
741
|
+
y = objDate.getFullYear();
|
|
742
|
+
m = objDate.getMonth() + 1;
|
|
743
|
+
d = objDate.getDate();
|
|
744
|
+
let offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 86400000;
|
|
745
|
+
for (i = 1900; i < 2101 && offset > 0; i++) {
|
|
746
|
+
temp = calendar.lYearDays(i);
|
|
747
|
+
offset -= temp;
|
|
748
|
+
}
|
|
749
|
+
if (offset < 0) {
|
|
750
|
+
offset += temp;
|
|
751
|
+
i--;
|
|
752
|
+
}
|
|
753
|
+
//是否今天
|
|
754
|
+
let isTodayObj = new Date(),
|
|
755
|
+
isToday = false;
|
|
756
|
+
if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) {
|
|
757
|
+
isToday = true;
|
|
758
|
+
}
|
|
759
|
+
//星期几
|
|
760
|
+
let nWeek = objDate.getDay(),
|
|
761
|
+
cWeek = calendar.nStr1[nWeek];
|
|
762
|
+
if (nWeek == 0) {
|
|
763
|
+
nWeek = 7;
|
|
764
|
+
} //数字表示周几顺应天朝周一开始的惯例
|
|
765
|
+
//农历年
|
|
766
|
+
let year = i;
|
|
767
|
+
leap = calendar.leapMonth(i); //闰哪个月
|
|
768
|
+
let isLeap = false;
|
|
769
|
+
//效验闰月
|
|
770
|
+
for (i = 1; i < 13 && offset > 0; i++) {
|
|
771
|
+
//闰月
|
|
772
|
+
if (leap > 0 && i == leap + 1 && isLeap == false) {
|
|
773
|
+
--i;
|
|
774
|
+
isLeap = true;
|
|
775
|
+
temp = calendar.leapDays(year); //计算农历闰月天数
|
|
776
|
+
} else {
|
|
777
|
+
temp = calendar.monthDays(year, i); //计算农历普通月天数
|
|
778
|
+
}
|
|
779
|
+
//解除闰月
|
|
780
|
+
if (isLeap == true && i == leap + 1) {
|
|
781
|
+
isLeap = false;
|
|
782
|
+
}
|
|
783
|
+
offset -= temp;
|
|
784
|
+
}
|
|
785
|
+
if (offset == 0 && leap > 0 && i == leap + 1)
|
|
786
|
+
if (isLeap) {
|
|
787
|
+
isLeap = false;
|
|
788
|
+
} else {
|
|
789
|
+
isLeap = true;
|
|
790
|
+
--i;
|
|
791
|
+
}
|
|
792
|
+
if (offset < 0) {
|
|
793
|
+
offset += temp;
|
|
794
|
+
--i;
|
|
795
|
+
}
|
|
796
|
+
//农历月
|
|
797
|
+
let month = i;
|
|
798
|
+
//农历日
|
|
799
|
+
let day = offset + 1;
|
|
800
|
+
//天干地支处理
|
|
801
|
+
let sm = m - 1;
|
|
802
|
+
let gzY = calendar.toGanZhiYear(year);
|
|
803
|
+
//月柱 1900年1月小寒以前为 丙子月(60进制12)
|
|
804
|
+
let firstNode = calendar.getTerm(year, m * 2 - 1); //返回当月「节」为几日开始
|
|
805
|
+
let secondNode = calendar.getTerm(year, m * 2); //返回当月「节」为几日开始
|
|
806
|
+
//依据12节气修正干支月
|
|
807
|
+
let gzM = calendar.toGanZhi((y - 1900) * 12 + m + 11);
|
|
808
|
+
if (d >= firstNode) {
|
|
809
|
+
gzM = calendar.toGanZhi((y - 1900) * 12 + m + 12);
|
|
810
|
+
}
|
|
811
|
+
//传入的日期的节气与否
|
|
812
|
+
let isTerm = false;
|
|
813
|
+
let Term = null;
|
|
814
|
+
if (firstNode == d) {
|
|
815
|
+
isTerm = true;
|
|
816
|
+
Term = calendar.solarTerm[m * 2 - 2];
|
|
817
|
+
}
|
|
818
|
+
if (secondNode == d) {
|
|
819
|
+
isTerm = true;
|
|
820
|
+
Term = calendar.solarTerm[m * 2 - 1];
|
|
821
|
+
}
|
|
822
|
+
//日柱 当月一日与 1900/1/1 相差天数
|
|
823
|
+
let dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10;
|
|
824
|
+
let gzD = calendar.toGanZhi(dayCyclical + d - 1);
|
|
825
|
+
//该日期所属的星座
|
|
826
|
+
let astro = calendar.toAstro(m, d);
|
|
827
|
+
return {
|
|
828
|
+
lYear: year,
|
|
829
|
+
lMonth: month,
|
|
830
|
+
lDay: day,
|
|
831
|
+
Animal: calendar.getAnimal(year),
|
|
832
|
+
IMonthCn: (isLeap ? '\u95f0' : '') + calendar.toChinaMonth(month),
|
|
833
|
+
IDayCn: calendar.toChinaDay(day),
|
|
834
|
+
cYear: y,
|
|
835
|
+
cMonth: m,
|
|
836
|
+
cDay: d,
|
|
837
|
+
gzYear: gzY,
|
|
838
|
+
gzMonth: gzM,
|
|
839
|
+
gzDay: gzD,
|
|
840
|
+
isToday: isToday,
|
|
841
|
+
isLeap: isLeap,
|
|
842
|
+
nWeek: nWeek,
|
|
843
|
+
ncWeek: '\u661f\u671f' + cWeek,
|
|
844
|
+
isTerm: isTerm,
|
|
845
|
+
Term: Term,
|
|
846
|
+
astro: astro
|
|
847
|
+
};
|
|
848
|
+
},
|
|
849
|
+
/**
|
|
850
|
+
* 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
|
|
851
|
+
* @param y lunar year
|
|
852
|
+
* @param m lunar month
|
|
853
|
+
* @param d lunar day
|
|
854
|
+
* @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
|
|
855
|
+
* @return JSON object
|
|
856
|
+
* @eg:console.log(calendar.lunar2solar(1987,9,10));
|
|
857
|
+
*/
|
|
858
|
+
lunar2solar: function (y, m, d, isLeapMonth) {
|
|
859
|
+
//参数区间1900.1.31~2100.12.1
|
|
860
|
+
isLeapMonth = !!isLeapMonth;
|
|
861
|
+
let leapOffset = 0;
|
|
862
|
+
let leapMonth = calendar.leapMonth(y);
|
|
863
|
+
let leapDay = calendar.leapDays(y);
|
|
864
|
+
if (isLeapMonth && leapMonth != m) {
|
|
865
|
+
return -1;
|
|
866
|
+
} //传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
|
|
867
|
+
if ((y == 2100 && m == 12 && d > 1) || (y == 1900 && m == 1 && d < 31)) {
|
|
868
|
+
return -1;
|
|
869
|
+
} //超出了最大极限值
|
|
870
|
+
let day = calendar.monthDays(y, m);
|
|
871
|
+
let _day = day;
|
|
872
|
+
//bugFix 2016-9-25
|
|
873
|
+
//if month is leap, _day use leapDays method
|
|
874
|
+
if (isLeapMonth) {
|
|
875
|
+
_day = calendar.leapDays(y, m);
|
|
876
|
+
}
|
|
877
|
+
if (y < 1900 || y > 2100 || d > _day) {
|
|
878
|
+
return -1;
|
|
879
|
+
} //参数合法性效验
|
|
880
|
+
//计算农历的时间差
|
|
881
|
+
let offset = 0;
|
|
882
|
+
for (let i = 1900; i < y; i++) {
|
|
883
|
+
offset += calendar.lYearDays(i);
|
|
884
|
+
}
|
|
885
|
+
let leap = 0,
|
|
886
|
+
isAdd = false;
|
|
887
|
+
for (let i = 1; i < m; i++) {
|
|
888
|
+
leap = calendar.leapMonth(y);
|
|
889
|
+
if (!isAdd) {
|
|
890
|
+
//处理闰月
|
|
891
|
+
if (leap <= i && leap > 0) {
|
|
892
|
+
offset += calendar.leapDays(y);
|
|
893
|
+
isAdd = true;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
offset += calendar.monthDays(y, i);
|
|
897
|
+
}
|
|
898
|
+
//转换闰月农历 需补充该年闰月的前一个月的时差
|
|
899
|
+
if (isLeapMonth) {
|
|
900
|
+
offset += day;
|
|
901
|
+
}
|
|
902
|
+
//1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
|
|
903
|
+
let stmap = Date.UTC(1900, 1, 30, 0, 0, 0);
|
|
904
|
+
let calObj = new Date((offset + d - 31) * 86400000 + stmap);
|
|
905
|
+
let cY = calObj.getUTCFullYear();
|
|
906
|
+
let cM = calObj.getUTCMonth() + 1;
|
|
907
|
+
let cD = calObj.getUTCDate();
|
|
908
|
+
return calendar.solar2lunar(cY, cM, cD);
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
export default {
|
|
913
|
+
solar2lunar: calendar.solar2lunar,
|
|
914
|
+
lunar2solar: calendar.lunar2solar
|
|
915
|
+
};
|