uview-ui-wjf 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +71 -0
- package/changelog.md +388 -0
- package/components/u--form/u--form.vue +92 -0
- package/components/u--image/u--image.vue +73 -0
- package/components/u--input/u--input.vue +115 -0
- package/components/u--text/u--text.vue +72 -0
- package/components/u--textarea/u--textarea.vue +85 -0
- package/components/u-action-sheet/props.js +54 -0
- package/components/u-action-sheet/u-action-sheet.vue +278 -0
- package/components/u-album/props.js +59 -0
- package/components/u-album/u-album.vue +259 -0
- package/components/u-alert/props.js +44 -0
- package/components/u-alert/u-alert.vue +243 -0
- package/components/u-avatar/props.js +78 -0
- package/components/u-avatar/u-avatar.vue +173 -0
- package/components/u-avatar-group/props.js +52 -0
- package/components/u-avatar-group/u-avatar-group.vue +103 -0
- package/components/u-back-top/props.js +54 -0
- package/components/u-back-top/u-back-top.vue +129 -0
- package/components/u-badge/props.js +72 -0
- package/components/u-badge/u-badge.vue +171 -0
- package/components/u-button/nvue.scss +46 -0
- package/components/u-button/props.js +161 -0
- package/components/u-button/u-button.vue +495 -0
- package/components/u-button/vue.scss +80 -0
- package/components/u-calendar/header.vue +99 -0
- package/components/u-calendar/month.vue +579 -0
- package/components/u-calendar/props.js +144 -0
- package/components/u-calendar/u-calendar.vue +384 -0
- package/components/u-calendar/util.js +85 -0
- package/components/u-car-keyboard/props.js +14 -0
- package/components/u-car-keyboard/u-car-keyboard.vue +311 -0
- package/components/u-cell/props.js +110 -0
- package/components/u-cell/u-cell.vue +229 -0
- package/components/u-cell-group/props.js +14 -0
- package/components/u-cell-group/u-cell-group.vue +61 -0
- package/components/u-checkbox/props.js +69 -0
- package/components/u-checkbox/u-checkbox.vue +344 -0
- package/components/u-checkbox-group/props.js +82 -0
- package/components/u-checkbox-group/u-checkbox-group.vue +103 -0
- package/components/u-circle-progress/props.js +8 -0
- package/components/u-circle-progress/u-circle-progress.vue +198 -0
- package/components/u-code/props.js +34 -0
- package/components/u-code/u-code.vue +129 -0
- package/components/u-code-input/props.js +79 -0
- package/components/u-code-input/u-code-input.vue +252 -0
- package/components/u-col/props.js +29 -0
- package/components/u-col/u-col.vue +162 -0
- package/components/u-collapse/props.js +19 -0
- package/components/u-collapse/u-collapse.vue +90 -0
- package/components/u-collapse-item/props.js +59 -0
- package/components/u-collapse-item/u-collapse-item.vue +225 -0
- package/components/u-column-notice/props.js +55 -0
- package/components/u-column-notice/u-column-notice.vue +160 -0
- package/components/u-count-down/props.js +24 -0
- package/components/u-count-down/u-count-down.vue +163 -0
- package/components/u-count-down/utils.js +62 -0
- package/components/u-count-to/props.js +59 -0
- package/components/u-count-to/u-count-to.vue +184 -0
- package/components/u-datetime-picker/props.js +120 -0
- package/components/u-datetime-picker/u-datetime-picker.vue +361 -0
- package/components/u-divider/props.js +44 -0
- package/components/u-divider/u-divider.vue +116 -0
- package/components/u-dropdown/props.js +65 -0
- package/components/u-dropdown/u-dropdown.vue +127 -0
- package/components/u-dropdown-item/props.js +36 -0
- package/components/u-dropdown-item/u-dropdown-item.vue +127 -0
- package/components/u-empty/props.js +59 -0
- package/components/u-empty/u-empty.vue +128 -0
- package/components/u-form/props.js +45 -0
- package/components/u-form/u-form.vue +214 -0
- package/components/u-form-item/props.js +48 -0
- package/components/u-form-item/u-form-item.vue +235 -0
- package/components/u-gap/props.js +24 -0
- package/components/u-gap/u-gap.vue +38 -0
- package/components/u-grid/props.js +19 -0
- package/components/u-grid/u-grid.vue +97 -0
- package/components/u-grid-item/props.js +14 -0
- package/components/u-grid-item/u-grid-item.vue +209 -0
- package/components/u-icon/icons.js +214 -0
- package/components/u-icon/props.js +89 -0
- package/components/u-icon/u-icon.vue +237 -0
- package/components/u-image/props.js +84 -0
- package/components/u-image/u-image.vue +232 -0
- package/components/u-index-anchor/props.js +29 -0
- package/components/u-index-anchor/u-index-anchor.vue +91 -0
- package/components/u-index-item/props.js +5 -0
- package/components/u-index-item/u-index-item.vue +87 -0
- package/components/u-index-list/props.js +29 -0
- package/components/u-index-list/u-index-list.vue +440 -0
- package/components/u-input/props.js +187 -0
- package/components/u-input/u-input.vue +369 -0
- package/components/u-keyboard/props.js +84 -0
- package/components/u-keyboard/u-keyboard.vue +164 -0
- package/components/u-line/props.js +33 -0
- package/components/u-line/u-line.vue +62 -0
- package/components/u-line-progress/props.js +28 -0
- package/components/u-line-progress/u-line-progress.vue +144 -0
- package/components/u-link/props.js +39 -0
- package/components/u-link/u-link.vue +83 -0
- package/components/u-list/props.js +76 -0
- package/components/u-list/u-list.vue +157 -0
- package/components/u-list-item/props.js +9 -0
- package/components/u-list-item/u-list-item.vue +116 -0
- package/components/u-loading-icon/props.js +59 -0
- package/components/u-loading-icon/u-loading-icon.vue +343 -0
- package/components/u-loading-page/props.js +49 -0
- package/components/u-loading-page/u-loading-page.vue +115 -0
- package/components/u-loadmore/props.js +94 -0
- package/components/u-loadmore/u-loadmore.vue +150 -0
- package/components/u-modal/props.js +89 -0
- package/components/u-modal/u-modal.vue +228 -0
- package/components/u-navbar/props.js +84 -0
- package/components/u-navbar/u-navbar.vue +186 -0
- package/components/u-no-network/props.js +19 -0
- package/components/u-no-network/u-no-network.vue +220 -0
- package/components/u-notice-bar/props.js +70 -0
- package/components/u-notice-bar/u-notice-bar.vue +101 -0
- package/components/u-notify/props.js +49 -0
- package/components/u-notify/u-notify.vue +211 -0
- package/components/u-number-box/props.js +109 -0
- package/components/u-number-box/u-number-box.vue +416 -0
- package/components/u-number-keyboard/props.js +19 -0
- package/components/u-number-keyboard/u-number-keyboard.vue +196 -0
- package/components/u-overlay/props.js +24 -0
- package/components/u-overlay/u-overlay.vue +68 -0
- package/components/u-parse/node/node.vue +499 -0
- package/components/u-parse/parser.js +1075 -0
- package/components/u-parse/props.js +45 -0
- package/components/u-parse/u-parse.vue +366 -0
- package/components/u-picker/props.js +79 -0
- package/components/u-picker/u-picker.vue +286 -0
- package/components/u-picker-column/props.js +5 -0
- package/components/u-picker-column/u-picker-column.vue +27 -0
- package/components/u-popup/props.js +79 -0
- package/components/u-popup/u-popup.vue +304 -0
- package/components/u-radio/props.js +64 -0
- package/components/u-radio/u-radio.vue +339 -0
- package/components/u-radio-group/props.js +85 -0
- package/components/u-radio-group/u-radio-group.vue +108 -0
- package/components/u-rate/props.js +69 -0
- package/components/u-rate/u-rate.vue +306 -0
- package/components/u-read-more/props.js +61 -0
- package/components/u-read-more/u-read-more.vue +157 -0
- package/components/u-row/props.js +19 -0
- package/components/u-row/u-row.vue +93 -0
- package/components/u-row-notice/props.js +39 -0
- package/components/u-row-notice/u-row-notice.vue +330 -0
- package/components/u-safe-bottom/props.js +5 -0
- package/components/u-safe-bottom/u-safe-bottom.vue +56 -0
- package/components/u-scroll-list/nvue.js +28 -0
- package/components/u-scroll-list/other.js +0 -0
- package/components/u-scroll-list/props.js +34 -0
- package/components/u-scroll-list/scrollWxs.wxs +50 -0
- package/components/u-scroll-list/u-scroll-list.vue +224 -0
- package/components/u-search/props.js +118 -0
- package/components/u-search/u-search.vue +303 -0
- package/components/u-skeleton/props.js +59 -0
- package/components/u-skeleton/u-skeleton.vue +244 -0
- package/components/u-slider/mpother.js +113 -0
- package/components/u-slider/mpwxs.js +42 -0
- package/components/u-slider/mpwxs.wxs +121 -0
- package/components/u-slider/nvue - /345/211/257/346/234/254.js" +180 -0
- package/components/u-slider/nvue.js +193 -0
- package/components/u-slider/props.js +54 -0
- package/components/u-slider/u-slider.vue +55 -0
- package/components/u-status-bar/props.js +8 -0
- package/components/u-status-bar/u-status-bar.vue +46 -0
- package/components/u-steps/props.js +39 -0
- package/components/u-steps/u-steps.vue +80 -0
- package/components/u-steps-item/props.js +24 -0
- package/components/u-steps-item/u-steps-item.vue +316 -0
- package/components/u-sticky/props.js +40 -0
- package/components/u-sticky/u-sticky.vue +212 -0
- package/components/u-subsection/props.js +49 -0
- package/components/u-subsection/u-subsection.vue +299 -0
- package/components/u-swipe-action/props.js +9 -0
- package/components/u-swipe-action/u-swipe-action.vue +67 -0
- package/components/u-swipe-action-item/index - backup.wxs +256 -0
- package/components/u-swipe-action-item/index.wxs +225 -0
- package/components/u-swipe-action-item/nvue - backup.js +270 -0
- package/components/u-swipe-action-item/nvue.js +174 -0
- package/components/u-swipe-action-item/props.js +41 -0
- package/components/u-swipe-action-item/u-swipe-action-item.vue +190 -0
- package/components/u-swipe-action-item/wxs.js +15 -0
- package/components/u-swiper/props.js +125 -0
- package/components/u-swiper/u-swiper.vue +255 -0
- package/components/u-swiper-indicator/props.js +29 -0
- package/components/u-swiper-indicator/u-swiper-indicator.vue +110 -0
- package/components/u-switch/props.js +54 -0
- package/components/u-switch/u-switch.vue +177 -0
- package/components/u-tabbar/props.js +44 -0
- package/components/u-tabbar/u-tabbar.vue +141 -0
- package/components/u-tabbar-item/props.js +35 -0
- package/components/u-tabbar-item/u-tabbar-item.vue +142 -0
- package/components/u-table/props.js +5 -0
- package/components/u-table/u-table.vue +29 -0
- package/components/u-tabs/props.js +64 -0
- package/components/u-tabs/u-tabs.vue +363 -0
- package/components/u-tabs-item/props.js +5 -0
- package/components/u-tabs-item/u-tabs-item.vue +29 -0
- package/components/u-tag/props.js +84 -0
- package/components/u-tag/u-tag.vue +358 -0
- package/components/u-td/props.js +5 -0
- package/components/u-td/u-td.vue +31 -0
- package/components/u-text/props.js +110 -0
- package/components/u-text/u-text.vue +223 -0
- package/components/u-text/value.js +85 -0
- package/components/u-textarea/props.js +119 -0
- package/components/u-textarea/u-textarea.vue +239 -0
- package/components/u-toast/u-toast.vue +291 -0
- package/components/u-toolbar/props.js +34 -0
- package/components/u-toolbar/u-toolbar.vue +102 -0
- package/components/u-tooltip/clipboard.min.js +58 -0
- package/components/u-tooltip/props.js +59 -0
- package/components/u-tooltip/u-tooltip.vue +366 -0
- package/components/u-tr/props.js +5 -0
- package/components/u-tr/u-tr.vue +31 -0
- package/components/u-transition/nvue.ani-map.js +68 -0
- package/components/u-transition/props.js +24 -0
- package/components/u-transition/transition.js +157 -0
- package/components/u-transition/u-transition.vue +92 -0
- package/components/u-transition/vue.ani-style.scss +113 -0
- package/components/u-upload/mixin.js +21 -0
- package/components/u-upload/props.js +124 -0
- package/components/u-upload/u-upload.vue +566 -0
- package/components/u-upload/utils.js +151 -0
- package/components/uview-ui/uview-ui.vue +15 -0
- package/index.js +79 -0
- package/index.scss +23 -0
- package/libs/config/color.js +17 -0
- package/libs/config/config.js +34 -0
- package/libs/config/props/actionSheet.js +25 -0
- package/libs/config/props/album.js +25 -0
- package/libs/config/props/alert.js +22 -0
- package/libs/config/props/avatar.js +28 -0
- package/libs/config/props/avatarGroup.js +23 -0
- package/libs/config/props/backtop.js +27 -0
- package/libs/config/props/badge.js +27 -0
- package/libs/config/props/button.js +42 -0
- package/libs/config/props/calendar.js +42 -0
- package/libs/config/props/carKeyboard.js +15 -0
- package/libs/config/props/cell.js +35 -0
- package/libs/config/props/cellGroup.js +17 -0
- package/libs/config/props/checkbox.js +27 -0
- package/libs/config/props/checkboxGroup.js +29 -0
- package/libs/config/props/circleProgress.js +15 -0
- package/libs/config/props/code.js +21 -0
- package/libs/config/props/codeInput.js +29 -0
- package/libs/config/props/col.js +19 -0
- package/libs/config/props/collapse.js +17 -0
- package/libs/config/props/collapseItem.js +25 -0
- package/libs/config/props/columnNotice.js +24 -0
- package/libs/config/props/countDown.js +18 -0
- package/libs/config/props/countTo.js +25 -0
- package/libs/config/props/datetimePicker.js +37 -0
- package/libs/config/props/divider.js +23 -0
- package/libs/config/props/empty.js +26 -0
- package/libs/config/props/form.js +22 -0
- package/libs/config/props/formItem.js +23 -0
- package/libs/config/props/gap.js +19 -0
- package/libs/config/props/grid.js +17 -0
- package/libs/config/props/gridItem.js +16 -0
- package/libs/config/props/icon.js +36 -0
- package/libs/config/props/image.js +30 -0
- package/libs/config/props/indexAnchor.js +19 -0
- package/libs/config/props/indexList.js +19 -0
- package/libs/config/props/input.js +48 -0
- package/libs/config/props/keyboard.js +30 -0
- package/libs/config/props/line.js +20 -0
- package/libs/config/props/lineProgress.js +19 -0
- package/libs/config/props/link.js +26 -0
- package/libs/config/props/list.js +28 -0
- package/libs/config/props/listItem.js +15 -0
- package/libs/config/props/loadingIcon.js +30 -0
- package/libs/config/props/loadingPage.js +23 -0
- package/libs/config/props/loadmore.js +32 -0
- package/libs/config/props/modal.js +31 -0
- package/libs/config/props/navbar.js +32 -0
- package/libs/config/props/noNetwork.js +18 -0
- package/libs/config/props/noticeBar.js +27 -0
- package/libs/config/props/notify.js +22 -0
- package/libs/config/props/numberBox.js +35 -0
- package/libs/config/props/numberKeyboard.js +17 -0
- package/libs/config/props/overlay.js +18 -0
- package/libs/config/props/parse.js +22 -0
- package/libs/config/props/picker.js +29 -0
- package/libs/config/props/popup.js +29 -0
- package/libs/config/props/radio.js +27 -0
- package/libs/config/props/radioGroup.js +30 -0
- package/libs/config/props/rate.js +26 -0
- package/libs/config/props/readMore.js +22 -0
- package/libs/config/props/row.js +17 -0
- package/libs/config/props/rowNotice.js +21 -0
- package/libs/config/props/scrollList.js +20 -0
- package/libs/config/props/search.js +37 -0
- package/libs/config/props/section.js +24 -0
- package/libs/config/props/skeleton.js +25 -0
- package/libs/config/props/slider.js +25 -0
- package/libs/config/props/statusBar.js +15 -0
- package/libs/config/props/steps.js +21 -0
- package/libs/config/props/stepsItem.js +18 -0
- package/libs/config/props/sticky.js +20 -0
- package/libs/config/props/subsection.js +23 -0
- package/libs/config/props/swipeAction.js +15 -0
- package/libs/config/props/swipeActionItem.js +21 -0
- package/libs/config/props/swiper.js +39 -0
- package/libs/config/props/swipterIndicator.js +19 -0
- package/libs/config/props/switch.js +24 -0
- package/libs/config/props/tabbar.js +22 -0
- package/libs/config/props/tabbarItem.js +20 -0
- package/libs/config/props/tabs.js +32 -0
- package/libs/config/props/tag.js +29 -0
- package/libs/config/props/text.js +38 -0
- package/libs/config/props/textarea.js +36 -0
- package/libs/config/props/toast.js +30 -0
- package/libs/config/props/toolbar.js +21 -0
- package/libs/config/props/tooltip.js +25 -0
- package/libs/config/props/transition.js +18 -0
- package/libs/config/props/upload.js +36 -0
- package/libs/config/props.js +190 -0
- package/libs/config/zIndex.js +20 -0
- package/libs/css/color.scss +155 -0
- package/libs/css/common.scss +97 -0
- package/libs/css/components.scss +15 -0
- package/libs/css/flex.scss +257 -0
- package/libs/css/h5.scss +0 -0
- package/libs/css/mixin.scss +8 -0
- package/libs/css/mp.scss +0 -0
- package/libs/css/nvue.scss +0 -0
- package/libs/css/vue.scss +27 -0
- package/libs/function/colorGradient.js +134 -0
- package/libs/function/debounce.js +29 -0
- package/libs/function/digit.js +167 -0
- package/libs/function/index.js +731 -0
- package/libs/function/platform.js +75 -0
- package/libs/function/test.js +288 -0
- package/libs/function/throttle.js +30 -0
- package/libs/luch-request/adapters/index.js +97 -0
- package/libs/luch-request/core/InterceptorManager.js +50 -0
- package/libs/luch-request/core/Request.js +198 -0
- package/libs/luch-request/core/buildFullPath.js +20 -0
- package/libs/luch-request/core/defaults.js +29 -0
- package/libs/luch-request/core/dispatchRequest.js +3 -0
- package/libs/luch-request/core/mergeConfig.js +103 -0
- package/libs/luch-request/core/settle.js +16 -0
- package/libs/luch-request/helpers/buildURL.js +69 -0
- package/libs/luch-request/helpers/combineURLs.js +14 -0
- package/libs/luch-request/helpers/isAbsoluteURL.js +14 -0
- package/libs/luch-request/index.d.ts +116 -0
- package/libs/luch-request/index.js +3 -0
- package/libs/luch-request/utils/clone.js +264 -0
- package/libs/luch-request/utils.js +131 -0
- package/libs/mixin/button.js +13 -0
- package/libs/mixin/mixin.js +160 -0
- package/libs/mixin/mpMixin.js +8 -0
- package/libs/mixin/mpShare.js +13 -0
- package/libs/mixin/openType.js +25 -0
- package/libs/mixin/style.js +228 -0
- package/libs/mixin/touch.js +59 -0
- package/libs/util/async-validator.js +1343 -0
- package/libs/util/calendar.js +546 -0
- package/libs/util/dayjs.js +308 -0
- package/libs/util/emitter.js +51 -0
- package/libs/util/route.js +124 -0
- package/package.json +83 -0
- package/theme.scss +44 -0
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- #ifndef APP-NVUE -->
|
|
3
|
+
<button
|
|
4
|
+
:hover-start-time="Number(hoverStartTime)"
|
|
5
|
+
:hover-stay-time="Number(hoverStayTime)"
|
|
6
|
+
:form-type="formType"
|
|
7
|
+
:open-type="openType"
|
|
8
|
+
:app-parameter="appParameter"
|
|
9
|
+
:hover-stop-propagation="hoverStopPropagation"
|
|
10
|
+
:send-message-title="sendMessageTitle"
|
|
11
|
+
:send-message-path="sendMessagePath"
|
|
12
|
+
:lang="lang"
|
|
13
|
+
:data-name="dataName"
|
|
14
|
+
:session-from="sessionFrom"
|
|
15
|
+
:send-message-img="sendMessageImg"
|
|
16
|
+
:show-message-card="showMessageCard"
|
|
17
|
+
@getphonenumber="getphonenumber"
|
|
18
|
+
@getuserinfo="getuserinfo"
|
|
19
|
+
@error="error"
|
|
20
|
+
@opensetting="opensetting"
|
|
21
|
+
@launchapp="launchapp"
|
|
22
|
+
@agreeprivacyauthorization="agreeprivacyauthorization"
|
|
23
|
+
:hover-class="!disabled && !loading ? 'u-button--active' : ''"
|
|
24
|
+
class="u-button u-reset-button"
|
|
25
|
+
:style="[baseColor, $u.addStyle(customStyle)]"
|
|
26
|
+
@tap="clickHandler"
|
|
27
|
+
:class="bemClass"
|
|
28
|
+
>
|
|
29
|
+
<template v-if="loading">
|
|
30
|
+
<u-loading-icon
|
|
31
|
+
:mode="loadingMode"
|
|
32
|
+
:size="loadingSize * 1.15"
|
|
33
|
+
:color="loadingColor"
|
|
34
|
+
></u-loading-icon>
|
|
35
|
+
<text
|
|
36
|
+
class="u-button__loading-text"
|
|
37
|
+
:style="[{ fontSize: textSize + 'px' }]"
|
|
38
|
+
>{{ loadingText || text }}</text
|
|
39
|
+
>
|
|
40
|
+
</template>
|
|
41
|
+
<template v-else>
|
|
42
|
+
<u-icon
|
|
43
|
+
v-if="icon"
|
|
44
|
+
:name="icon"
|
|
45
|
+
:color="iconColorCom"
|
|
46
|
+
:size="textSize * 1.35"
|
|
47
|
+
:customStyle="{ marginRight: '2px' }"
|
|
48
|
+
></u-icon>
|
|
49
|
+
<slot>
|
|
50
|
+
<text
|
|
51
|
+
class="u-button__text"
|
|
52
|
+
:style="[{ fontSize: textSize + 'px' }]"
|
|
53
|
+
>{{ text }}</text
|
|
54
|
+
>
|
|
55
|
+
</slot>
|
|
56
|
+
</template>
|
|
57
|
+
</button>
|
|
58
|
+
<!-- #endif -->
|
|
59
|
+
|
|
60
|
+
<!-- #ifdef APP-NVUE -->
|
|
61
|
+
<view
|
|
62
|
+
:hover-start-time="Number(hoverStartTime)"
|
|
63
|
+
:hover-stay-time="Number(hoverStayTime)"
|
|
64
|
+
class="u-button"
|
|
65
|
+
:hover-class="
|
|
66
|
+
!disabled && !loading && !color && (plain || type === 'info')
|
|
67
|
+
? 'u-button--active--plain'
|
|
68
|
+
: !disabled && !loading && !plain
|
|
69
|
+
? 'u-button--active'
|
|
70
|
+
: ''
|
|
71
|
+
"
|
|
72
|
+
@tap="clickHandler"
|
|
73
|
+
:class="bemClass"
|
|
74
|
+
:style="[baseColor, $u.addStyle(customStyle)]"
|
|
75
|
+
>
|
|
76
|
+
<template v-if="loading">
|
|
77
|
+
<u-loading-icon
|
|
78
|
+
:mode="loadingMode"
|
|
79
|
+
:size="loadingSize * 1.15"
|
|
80
|
+
:color="loadingColor"
|
|
81
|
+
></u-loading-icon>
|
|
82
|
+
<text
|
|
83
|
+
class="u-button__loading-text"
|
|
84
|
+
:style="[nvueTextStyle]"
|
|
85
|
+
:class="[plain && `u-button__text--plain--${type}`]"
|
|
86
|
+
>{{ loadingText || text }}</text
|
|
87
|
+
>
|
|
88
|
+
</template>
|
|
89
|
+
<template v-else>
|
|
90
|
+
<u-icon
|
|
91
|
+
v-if="icon"
|
|
92
|
+
:name="icon"
|
|
93
|
+
:color="iconColorCom"
|
|
94
|
+
:size="textSize * 1.35"
|
|
95
|
+
></u-icon>
|
|
96
|
+
<text
|
|
97
|
+
class="u-button__text"
|
|
98
|
+
:style="[
|
|
99
|
+
{
|
|
100
|
+
marginLeft: icon ? '2px' : 0,
|
|
101
|
+
},
|
|
102
|
+
nvueTextStyle,
|
|
103
|
+
]"
|
|
104
|
+
:class="[plain && `u-button__text--plain--${type}`]"
|
|
105
|
+
>{{ text }}</text
|
|
106
|
+
>
|
|
107
|
+
</template>
|
|
108
|
+
</view>
|
|
109
|
+
<!-- #endif -->
|
|
110
|
+
</template>
|
|
111
|
+
|
|
112
|
+
<script>
|
|
113
|
+
import button from "../../libs/mixin/button.js";
|
|
114
|
+
import openType from "../../libs/mixin/openType.js";
|
|
115
|
+
import props from "./props.js";
|
|
116
|
+
/**
|
|
117
|
+
* button 按钮
|
|
118
|
+
* @description Button 按钮
|
|
119
|
+
* @tutorial https://www.uviewui.com/components/button.html
|
|
120
|
+
*
|
|
121
|
+
* @property {Boolean} hairline 是否显示按钮的细边框 (默认 true )
|
|
122
|
+
* @property {String} type 按钮的预置样式,info,primary,error,warning,success (默认 'info' )
|
|
123
|
+
* @property {String} size 按钮尺寸,large,normal,mini (默认 normal)
|
|
124
|
+
* @property {String} shape 按钮形状,circle(两边为半圆),square(带圆角) (默认 'square' )
|
|
125
|
+
* @property {Boolean} plain 按钮是否镂空,背景色透明 (默认 false)
|
|
126
|
+
* @property {Boolean} disabled 是否禁用 (默认 false)
|
|
127
|
+
* @property {Boolean} loading 按钮名称前是否带 loading 图标(App-nvue 平台,在 ios 上为雪花,Android上为圆圈) (默认 false)
|
|
128
|
+
* @property {String | Number} loadingText 加载中提示文字
|
|
129
|
+
* @property {String} loadingMode 加载状态图标类型 (默认 'spinner' )
|
|
130
|
+
* @property {String | Number} loadingSize 加载图标大小 (默认 15 )
|
|
131
|
+
* @property {String} openType 开放能力,具体请看uniapp稳定关于button组件部分说明
|
|
132
|
+
* @property {String} formType 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
|
|
133
|
+
* @property {String} appParameter 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 (注:只微信小程序、QQ小程序有效)
|
|
134
|
+
* @property {Boolean} hoverStopPropagation 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效(默认 true )
|
|
135
|
+
* @property {String} lang 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文(默认 en )
|
|
136
|
+
* @property {String} sessionFrom 会话来源,openType="contact"时有效
|
|
137
|
+
* @property {String} sendMessageTitle 会话内消息卡片标题,openType="contact"时有效
|
|
138
|
+
* @property {String} sendMessagePath 会话内消息卡片点击跳转小程序路径,openType="contact"时有效
|
|
139
|
+
* @property {String} sendMessageImg 会话内消息卡片图片,openType="contact"时有效
|
|
140
|
+
* @property {Boolean} showMessageCard 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效(默认false)
|
|
141
|
+
* @property {String} dataName 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
|
|
142
|
+
* @property {String | Number} throttleTime 节流,一定时间内只能触发一次 (默认 0 )
|
|
143
|
+
* @property {String | Number} hoverStartTime 按住后多久出现点击态,单位毫秒 (默认 0 )
|
|
144
|
+
* @property {String | Number} hoverStayTime 手指松开后点击态保留时间,单位毫秒 (默认 200 )
|
|
145
|
+
* @property {String | Number} text 按钮文字,之所以通过props传入,是因为slot传入的话(注:nvue中无法控制文字的样式)
|
|
146
|
+
* @property {String} icon 按钮图标
|
|
147
|
+
* @property {String} iconColor 按钮图标颜色
|
|
148
|
+
* @property {String} color 按钮颜色,支持传入linear-gradient渐变色
|
|
149
|
+
* @property {Object} customStyle 定义需要用到的外部样式
|
|
150
|
+
*
|
|
151
|
+
* @event {Function} click 非禁止并且非加载中,才能点击
|
|
152
|
+
* @event {Function} getphonenumber open-type="getPhoneNumber"时有效
|
|
153
|
+
* @event {Function} getuserinfo 用户点击该按钮时,会返回获取到的用户信息,从返回参数的detail中获取到的值同uni.getUserInfo
|
|
154
|
+
* @event {Function} error 当使用开放能力时,发生错误的回调
|
|
155
|
+
* @event {Function} opensetting 在打开授权设置页并关闭后回调
|
|
156
|
+
* @event {Function} launchapp 打开 APP 成功的回调
|
|
157
|
+
* @event {Function} agreeprivacyauthorization 用户同意隐私协议事件回调
|
|
158
|
+
* @example <u-button>月落</u-button>
|
|
159
|
+
*/
|
|
160
|
+
export default {
|
|
161
|
+
name: "u-button",
|
|
162
|
+
// #ifdef MP
|
|
163
|
+
mixins: [uni.$u.mpMixin, uni.$u.mixin, button, openType, props],
|
|
164
|
+
// #endif
|
|
165
|
+
// #ifndef MP
|
|
166
|
+
mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
|
|
167
|
+
// #endif
|
|
168
|
+
data() {
|
|
169
|
+
return {};
|
|
170
|
+
},
|
|
171
|
+
computed: {
|
|
172
|
+
// 生成bem风格的类名
|
|
173
|
+
bemClass() {
|
|
174
|
+
// this.bem为一个computed变量,在mixin中
|
|
175
|
+
if (!this.color) {
|
|
176
|
+
return this.bem(
|
|
177
|
+
"button",
|
|
178
|
+
["type", "shape", "size"],
|
|
179
|
+
["disabled", "plain", "hairline"]
|
|
180
|
+
);
|
|
181
|
+
} else {
|
|
182
|
+
// 由于nvue的原因,在有color参数时,不需要传入type,否则会生成type相关的类型,影响最终的样式
|
|
183
|
+
return this.bem(
|
|
184
|
+
"button",
|
|
185
|
+
["shape", "size"],
|
|
186
|
+
["disabled", "plain", "hairline"]
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
loadingColor() {
|
|
191
|
+
if (this.plain) {
|
|
192
|
+
// 如果有设置color值,则用color值,否则使用type主题颜色
|
|
193
|
+
return this.color
|
|
194
|
+
? this.color
|
|
195
|
+
: uni.$u.config.color[`u-${this.type}`];
|
|
196
|
+
}
|
|
197
|
+
if (this.type === "info") {
|
|
198
|
+
return "#c9c9c9";
|
|
199
|
+
}
|
|
200
|
+
return "rgb(200, 200, 200)";
|
|
201
|
+
},
|
|
202
|
+
iconColorCom() {
|
|
203
|
+
// 如果是镂空状态,设置了color就用color值,否则使用主题颜色,
|
|
204
|
+
// u-icon的color能接受一个主题颜色的值
|
|
205
|
+
if (this.iconColor) return this.iconColor;
|
|
206
|
+
if (this.plain) {
|
|
207
|
+
return this.color ? this.color : this.type;
|
|
208
|
+
} else {
|
|
209
|
+
return this.type === "info" ? "#000000" : "#ffffff";
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
baseColor() {
|
|
213
|
+
let style = {};
|
|
214
|
+
if (this.color) {
|
|
215
|
+
// 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
|
|
216
|
+
style.color = this.plain ? this.color : "white";
|
|
217
|
+
if (!this.plain) {
|
|
218
|
+
// 非镂空,背景色使用自定义的颜色
|
|
219
|
+
style["background-color"] = this.color;
|
|
220
|
+
}
|
|
221
|
+
if (this.color.indexOf("gradient") !== -1) {
|
|
222
|
+
// 如果自定义的颜色为渐变色,不显示边框,以及通过backgroundImage设置渐变色
|
|
223
|
+
// weex文档说明可以写borderWidth的形式,为什么这里需要分开写?
|
|
224
|
+
// 因为weex是阿里巴巴为了部门业绩考核而做的你懂的东西,所以需要这么写才有效
|
|
225
|
+
style.borderTopWidth = 0;
|
|
226
|
+
style.borderRightWidth = 0;
|
|
227
|
+
style.borderBottomWidth = 0;
|
|
228
|
+
style.borderLeftWidth = 0;
|
|
229
|
+
if (!this.plain) {
|
|
230
|
+
style.backgroundImage = this.color;
|
|
231
|
+
}
|
|
232
|
+
} else {
|
|
233
|
+
// 非渐变色,则设置边框相关的属性
|
|
234
|
+
style.borderColor = this.color;
|
|
235
|
+
style.borderWidth = "1px";
|
|
236
|
+
style.borderStyle = "solid";
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return style;
|
|
240
|
+
},
|
|
241
|
+
// nvue版本按钮的字体不会继承父组件的颜色,需要对每一个text组件进行单独的设置
|
|
242
|
+
nvueTextStyle() {
|
|
243
|
+
let style = {};
|
|
244
|
+
// 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
|
|
245
|
+
if (this.type === "info") {
|
|
246
|
+
style.color = "#323233";
|
|
247
|
+
}
|
|
248
|
+
if (this.color) {
|
|
249
|
+
style.color = this.plain ? this.color : "white";
|
|
250
|
+
}
|
|
251
|
+
style.fontSize = this.textSize + "px";
|
|
252
|
+
return style;
|
|
253
|
+
},
|
|
254
|
+
// 字体大小
|
|
255
|
+
textSize() {
|
|
256
|
+
let fontSize = 14,
|
|
257
|
+
{ size } = this;
|
|
258
|
+
if (size === "large") fontSize = 16;
|
|
259
|
+
if (size === "normal") fontSize = 14;
|
|
260
|
+
if (size === "small") fontSize = 12;
|
|
261
|
+
if (size === "mini") fontSize = 10;
|
|
262
|
+
return fontSize;
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
methods: {
|
|
266
|
+
clickHandler() {
|
|
267
|
+
// 非禁止并且非加载中,才能点击
|
|
268
|
+
if (!this.disabled && !this.loading) {
|
|
269
|
+
// 进行节流控制,每this.throttle毫秒内,只在开始处执行
|
|
270
|
+
uni.$u.throttle(() => {
|
|
271
|
+
this.$emit("click");
|
|
272
|
+
}, this.throttleTime);
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
// 下面为对接uniapp官方按钮开放能力事件回调的对接
|
|
276
|
+
getphonenumber(res) {
|
|
277
|
+
this.$emit("getphonenumber", res);
|
|
278
|
+
},
|
|
279
|
+
getuserinfo(res) {
|
|
280
|
+
this.$emit("getuserinfo", res);
|
|
281
|
+
},
|
|
282
|
+
error(res) {
|
|
283
|
+
this.$emit("error", res);
|
|
284
|
+
},
|
|
285
|
+
opensetting(res) {
|
|
286
|
+
this.$emit("opensetting", res);
|
|
287
|
+
},
|
|
288
|
+
launchapp(res) {
|
|
289
|
+
this.$emit("launchapp", res);
|
|
290
|
+
},
|
|
291
|
+
agreeprivacyauthorization(res) {
|
|
292
|
+
this.$emit("agreeprivacyauthorization", res);
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
</script>
|
|
297
|
+
|
|
298
|
+
<style lang="scss" scoped>
|
|
299
|
+
@import "../../libs/css/components.scss";
|
|
300
|
+
|
|
301
|
+
/* #ifndef APP-NVUE */
|
|
302
|
+
@import "./vue.scss";
|
|
303
|
+
/* #endif */
|
|
304
|
+
|
|
305
|
+
/* #ifdef APP-NVUE */
|
|
306
|
+
@import "./nvue.scss";
|
|
307
|
+
/* #endif */
|
|
308
|
+
|
|
309
|
+
$u-button-u-button-height: 40px !default;
|
|
310
|
+
$u-button-text-font-size: 15px !default;
|
|
311
|
+
$u-button-loading-text-font-size: 15px !default;
|
|
312
|
+
$u-button-loading-text-margin-left: 4px !default;
|
|
313
|
+
$u-button-large-width: 100% !default;
|
|
314
|
+
$u-button-large-height: 50px !default;
|
|
315
|
+
$u-button-normal-padding: 0 12px !default;
|
|
316
|
+
$u-button-large-padding: 0 15px !default;
|
|
317
|
+
$u-button-normal-font-size: 14px !default;
|
|
318
|
+
$u-button-small-min-width: 60px !default;
|
|
319
|
+
$u-button-small-height: 30px !default;
|
|
320
|
+
$u-button-small-padding: 0px 8px !default;
|
|
321
|
+
$u-button-mini-padding: 0px 8px !default;
|
|
322
|
+
$u-button-small-font-size: 12px !default;
|
|
323
|
+
$u-button-mini-height: 22px !default;
|
|
324
|
+
$u-button-mini-font-size: 10px !default;
|
|
325
|
+
$u-button-mini-min-width: 50px !default;
|
|
326
|
+
$u-button-disabled-opacity: 0.5 !default;
|
|
327
|
+
$u-button-info-color: #323233 !default;
|
|
328
|
+
$u-button-info-background-color: #fff !default;
|
|
329
|
+
$u-button-info-border-color: #ebedf0 !default;
|
|
330
|
+
$u-button-info-border-width: 1px !default;
|
|
331
|
+
$u-button-info-border-style: solid !default;
|
|
332
|
+
$u-button-success-color: #fff !default;
|
|
333
|
+
$u-button-success-background-color: $u-success !default;
|
|
334
|
+
$u-button-success-border-color: $u-button-success-background-color !default;
|
|
335
|
+
$u-button-success-border-width: 1px !default;
|
|
336
|
+
$u-button-success-border-style: solid !default;
|
|
337
|
+
$u-button-primary-color: #fff !default;
|
|
338
|
+
$u-button-primary-background-color: $u-primary !default;
|
|
339
|
+
$u-button-primary-border-color: $u-button-primary-background-color !default;
|
|
340
|
+
$u-button-primary-border-width: 1px !default;
|
|
341
|
+
$u-button-primary-border-style: solid !default;
|
|
342
|
+
$u-button-error-color: #fff !default;
|
|
343
|
+
$u-button-error-background-color: $u-error !default;
|
|
344
|
+
$u-button-error-border-color: $u-button-error-background-color !default;
|
|
345
|
+
$u-button-error-border-width: 1px !default;
|
|
346
|
+
$u-button-error-border-style: solid !default;
|
|
347
|
+
$u-button-warning-color: #fff !default;
|
|
348
|
+
$u-button-warning-background-color: $u-warning !default;
|
|
349
|
+
$u-button-warning-border-color: $u-button-warning-background-color !default;
|
|
350
|
+
$u-button-warning-border-width: 1px !default;
|
|
351
|
+
$u-button-warning-border-style: solid !default;
|
|
352
|
+
$u-button-block-width: 100% !default;
|
|
353
|
+
$u-button-circle-border-top-right-radius: 100px !default;
|
|
354
|
+
$u-button-circle-border-top-left-radius: 100px !default;
|
|
355
|
+
$u-button-circle-border-bottom-left-radius: 100px !default;
|
|
356
|
+
$u-button-circle-border-bottom-right-radius: 100px !default;
|
|
357
|
+
$u-button-square-border-top-right-radius: 3px !default;
|
|
358
|
+
$u-button-square-border-top-left-radius: 3px !default;
|
|
359
|
+
$u-button-square-border-bottom-left-radius: 3px !default;
|
|
360
|
+
$u-button-square-border-bottom-right-radius: 3px !default;
|
|
361
|
+
$u-button-icon-min-width: 1em !default;
|
|
362
|
+
$u-button-plain-background-color: #fff !default;
|
|
363
|
+
$u-button-hairline-border-width: 0.5px !default;
|
|
364
|
+
|
|
365
|
+
.u-button {
|
|
366
|
+
height: $u-button-u-button-height;
|
|
367
|
+
position: relative;
|
|
368
|
+
align-items: center;
|
|
369
|
+
justify-content: center;
|
|
370
|
+
@include flex;
|
|
371
|
+
/* #ifndef APP-NVUE */
|
|
372
|
+
box-sizing: border-box;
|
|
373
|
+
/* #endif */
|
|
374
|
+
flex-direction: row;
|
|
375
|
+
|
|
376
|
+
&__text {
|
|
377
|
+
font-size: $u-button-text-font-size;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
&__loading-text {
|
|
381
|
+
font-size: $u-button-loading-text-font-size;
|
|
382
|
+
margin-left: $u-button-loading-text-margin-left;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
&--large {
|
|
386
|
+
/* #ifndef APP-NVUE */
|
|
387
|
+
width: $u-button-large-width;
|
|
388
|
+
/* #endif */
|
|
389
|
+
height: $u-button-large-height;
|
|
390
|
+
padding: $u-button-large-padding;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
&--normal {
|
|
394
|
+
padding: $u-button-normal-padding;
|
|
395
|
+
font-size: $u-button-normal-font-size;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
&--small {
|
|
399
|
+
/* #ifndef APP-NVUE */
|
|
400
|
+
min-width: $u-button-small-min-width;
|
|
401
|
+
/* #endif */
|
|
402
|
+
height: $u-button-small-height;
|
|
403
|
+
padding: $u-button-small-padding;
|
|
404
|
+
font-size: $u-button-small-font-size;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
&--mini {
|
|
408
|
+
height: $u-button-mini-height;
|
|
409
|
+
font-size: $u-button-mini-font-size;
|
|
410
|
+
/* #ifndef APP-NVUE */
|
|
411
|
+
min-width: $u-button-mini-min-width;
|
|
412
|
+
/* #endif */
|
|
413
|
+
padding: $u-button-mini-padding;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
&--disabled {
|
|
417
|
+
opacity: $u-button-disabled-opacity;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
&--info {
|
|
421
|
+
color: $u-button-info-color;
|
|
422
|
+
background-color: $u-button-info-background-color;
|
|
423
|
+
border-color: $u-button-info-border-color;
|
|
424
|
+
border-width: $u-button-info-border-width;
|
|
425
|
+
border-style: $u-button-info-border-style;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
&--success {
|
|
429
|
+
color: $u-button-success-color;
|
|
430
|
+
background-color: $u-button-success-background-color;
|
|
431
|
+
border-color: $u-button-success-border-color;
|
|
432
|
+
border-width: $u-button-success-border-width;
|
|
433
|
+
border-style: $u-button-success-border-style;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
&--primary {
|
|
437
|
+
color: $u-button-primary-color;
|
|
438
|
+
background-color: $u-button-primary-background-color;
|
|
439
|
+
border-color: $u-button-primary-border-color;
|
|
440
|
+
border-width: $u-button-primary-border-width;
|
|
441
|
+
border-style: $u-button-primary-border-style;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
&--error {
|
|
445
|
+
color: $u-button-error-color;
|
|
446
|
+
background-color: $u-button-error-background-color;
|
|
447
|
+
border-color: $u-button-error-border-color;
|
|
448
|
+
border-width: $u-button-error-border-width;
|
|
449
|
+
border-style: $u-button-error-border-style;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
&--warning {
|
|
453
|
+
color: $u-button-warning-color;
|
|
454
|
+
background-color: $u-button-warning-background-color;
|
|
455
|
+
border-color: $u-button-warning-border-color;
|
|
456
|
+
border-width: $u-button-warning-border-width;
|
|
457
|
+
border-style: $u-button-warning-border-style;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
&--block {
|
|
461
|
+
@include flex;
|
|
462
|
+
width: $u-button-block-width;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
&--circle {
|
|
466
|
+
border-top-right-radius: $u-button-circle-border-top-right-radius;
|
|
467
|
+
border-top-left-radius: $u-button-circle-border-top-left-radius;
|
|
468
|
+
border-bottom-left-radius: $u-button-circle-border-bottom-left-radius;
|
|
469
|
+
border-bottom-right-radius: $u-button-circle-border-bottom-right-radius;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
&--square {
|
|
473
|
+
border-bottom-left-radius: $u-button-square-border-top-right-radius;
|
|
474
|
+
border-bottom-right-radius: $u-button-square-border-top-left-radius;
|
|
475
|
+
border-top-left-radius: $u-button-square-border-bottom-left-radius;
|
|
476
|
+
border-top-right-radius: $u-button-square-border-bottom-right-radius;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
&__icon {
|
|
480
|
+
/* #ifndef APP-NVUE */
|
|
481
|
+
min-width: $u-button-icon-min-width;
|
|
482
|
+
line-height: inherit !important;
|
|
483
|
+
vertical-align: top;
|
|
484
|
+
/* #endif */
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
&--plain {
|
|
488
|
+
background-color: $u-button-plain-background-color;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
&--hairline {
|
|
492
|
+
border-width: $u-button-hairline-border-width !important;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
</style>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// nvue下hover-class无效
|
|
2
|
+
$u-button-before-top:50% !default;
|
|
3
|
+
$u-button-before-left:50% !default;
|
|
4
|
+
$u-button-before-width:100% !default;
|
|
5
|
+
$u-button-before-height:100% !default;
|
|
6
|
+
$u-button-before-transform:translate(-50%, -50%) !default;
|
|
7
|
+
$u-button-before-opacity:0 !default;
|
|
8
|
+
$u-button-before-background-color:#000 !default;
|
|
9
|
+
$u-button-before-border-color:#000 !default;
|
|
10
|
+
$u-button-active-before-opacity:.15 !default;
|
|
11
|
+
$u-button-icon-margin-left:4px !default;
|
|
12
|
+
$u-button-plain-u-button-info-color:$u-info;
|
|
13
|
+
$u-button-plain-u-button-success-color:$u-success;
|
|
14
|
+
$u-button-plain-u-button-error-color:$u-error;
|
|
15
|
+
$u-button-plain-u-button-warning-color:$u-error;
|
|
16
|
+
|
|
17
|
+
.u-button {
|
|
18
|
+
width: 100%;
|
|
19
|
+
|
|
20
|
+
&__text {
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
line-height: 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:before {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top:$u-button-before-top;
|
|
28
|
+
left:$u-button-before-left;
|
|
29
|
+
width:$u-button-before-width;
|
|
30
|
+
height:$u-button-before-height;
|
|
31
|
+
border: inherit;
|
|
32
|
+
border-radius: inherit;
|
|
33
|
+
transform:$u-button-before-transform;
|
|
34
|
+
opacity:$u-button-before-opacity;
|
|
35
|
+
content: " ";
|
|
36
|
+
background-color:$u-button-before-background-color;
|
|
37
|
+
border-color:$u-button-before-border-color;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&--active {
|
|
41
|
+
&:before {
|
|
42
|
+
opacity: .15
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&__icon+&__text:not(:empty),
|
|
47
|
+
&__loading-text {
|
|
48
|
+
margin-left:$u-button-icon-margin-left;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&--plain {
|
|
52
|
+
&.u-button--primary {
|
|
53
|
+
color: $u-primary;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&--plain {
|
|
58
|
+
&.u-button--info {
|
|
59
|
+
color:$u-button-plain-u-button-info-color;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&--plain {
|
|
64
|
+
&.u-button--success {
|
|
65
|
+
color:$u-button-plain-u-button-success-color;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&--plain {
|
|
70
|
+
&.u-button--error {
|
|
71
|
+
color:$u-button-plain-u-button-error-color;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&--plain {
|
|
76
|
+
&.u-button--warning {
|
|
77
|
+
color:$u-button-plain-u-button-warning-color;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="u-calendar-header u-border-bottom">
|
|
3
|
+
<text
|
|
4
|
+
class="u-calendar-header__title"
|
|
5
|
+
v-if="showTitle"
|
|
6
|
+
>{{ title }}</text>
|
|
7
|
+
<text
|
|
8
|
+
class="u-calendar-header__subtitle"
|
|
9
|
+
v-if="showSubtitle"
|
|
10
|
+
>{{ subtitle }}</text>
|
|
11
|
+
<view class="u-calendar-header__weekdays">
|
|
12
|
+
<text class="u-calendar-header__weekdays__weekday">一</text>
|
|
13
|
+
<text class="u-calendar-header__weekdays__weekday">二</text>
|
|
14
|
+
<text class="u-calendar-header__weekdays__weekday">三</text>
|
|
15
|
+
<text class="u-calendar-header__weekdays__weekday">四</text>
|
|
16
|
+
<text class="u-calendar-header__weekdays__weekday">五</text>
|
|
17
|
+
<text class="u-calendar-header__weekdays__weekday">六</text>
|
|
18
|
+
<text class="u-calendar-header__weekdays__weekday">日</text>
|
|
19
|
+
</view>
|
|
20
|
+
</view>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
export default {
|
|
25
|
+
name: 'u-calendar-header',
|
|
26
|
+
mixins: [uni.$u.mpMixin, uni.$u.mixin],
|
|
27
|
+
props: {
|
|
28
|
+
// 标题
|
|
29
|
+
title: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
// 副标题
|
|
34
|
+
subtitle: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ''
|
|
37
|
+
},
|
|
38
|
+
// 是否显示标题
|
|
39
|
+
showTitle: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
// 是否显示副标题
|
|
44
|
+
showSubtitle: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: true
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
data() {
|
|
50
|
+
return {
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
name() {
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<style lang="scss" scoped>
|
|
63
|
+
@import "../../libs/css/components.scss";
|
|
64
|
+
|
|
65
|
+
.u-calendar-header {
|
|
66
|
+
padding-bottom: 4px;
|
|
67
|
+
|
|
68
|
+
&__title {
|
|
69
|
+
font-size: 16px;
|
|
70
|
+
color: $u-main-color;
|
|
71
|
+
text-align: center;
|
|
72
|
+
height: 42px;
|
|
73
|
+
line-height: 42px;
|
|
74
|
+
font-weight: bold;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&__subtitle {
|
|
78
|
+
font-size: 14px;
|
|
79
|
+
color: $u-main-color;
|
|
80
|
+
height: 40px;
|
|
81
|
+
text-align: center;
|
|
82
|
+
line-height: 40px;
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__weekdays {
|
|
87
|
+
@include flex;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
|
|
90
|
+
&__weekday {
|
|
91
|
+
font-size: 13px;
|
|
92
|
+
color: $u-main-color;
|
|
93
|
+
line-height: 30px;
|
|
94
|
+
flex: 1;
|
|
95
|
+
text-align: center;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</style>
|