uview-plus 3.0.3
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 +64 -0
- package/changelog.md +8 -0
- package/components/u--form/u--form.vue +78 -0
- package/components/u--image/u--image.vue +47 -0
- package/components/u--input/u--input.vue +73 -0
- package/components/u--text/u--text.vue +44 -0
- package/components/u--textarea/u--textarea.vue +48 -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 +172 -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 +490 -0
- package/components/u-button/vue.scss +80 -0
- package/components/u-calendar/header.vue +99 -0
- package/components/u-calendar/month.vue +580 -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 +116 -0
- package/components/u-datetime-picker/u-datetime-picker.vue +362 -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 +146 -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 +43 -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 +234 -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 +354 -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 +84 -0
- package/components/u-modal/u-modal.vue +227 -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 +283 -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 +337 -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 +304 -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 +354 -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/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 +558 -0
- package/components/u-upload/utils.js +151 -0
- package/components/uview-plus/uview-plus.vue +15 -0
- package/index.js +77 -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 +36 -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 +22 -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 +30 -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 +708 -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/emitter.js +51 -0
- package/libs/util/route.js +124 -0
- package/package.json +91 -0
- package/theme.scss +44 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="u-keyboard"
|
|
4
|
+
@touchmove.stop.prevent="noop"
|
|
5
|
+
>
|
|
6
|
+
<view
|
|
7
|
+
class="u-keyboard__button-wrapper"
|
|
8
|
+
v-for="(item, index) in numList"
|
|
9
|
+
:key="index"
|
|
10
|
+
>
|
|
11
|
+
<view
|
|
12
|
+
class="u-keyboard__button-wrapper__button"
|
|
13
|
+
:style="[itemStyle(index)]"
|
|
14
|
+
@tap="keyboardClick(item)"
|
|
15
|
+
hover-class="u-hover-class"
|
|
16
|
+
:hover-stay-time="200"
|
|
17
|
+
>
|
|
18
|
+
<text class="u-keyboard__button-wrapper__button__text">{{ item }}</text>
|
|
19
|
+
</view>
|
|
20
|
+
</view>
|
|
21
|
+
<view
|
|
22
|
+
class="u-keyboard__button-wrapper"
|
|
23
|
+
>
|
|
24
|
+
<view
|
|
25
|
+
class="u-keyboard__button-wrapper__button u-keyboard__button-wrapper__button--gray"
|
|
26
|
+
hover-class="u-hover-class"
|
|
27
|
+
:hover-stay-time="200"
|
|
28
|
+
@touchstart.stop="backspaceClick"
|
|
29
|
+
@touchend="clearTimer"
|
|
30
|
+
>
|
|
31
|
+
<u-icon
|
|
32
|
+
name="backspace"
|
|
33
|
+
color="#303133"
|
|
34
|
+
size="28"
|
|
35
|
+
></u-icon>
|
|
36
|
+
</view>
|
|
37
|
+
</view>
|
|
38
|
+
</view>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import props from './props.js';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* keyboard 键盘组件
|
|
46
|
+
* @description
|
|
47
|
+
* @tutorial
|
|
48
|
+
* @property {String} mode 键盘的类型,number-数字键盘,card-身份证键盘
|
|
49
|
+
* @property {Boolean} dotDisabled 是否显示键盘的"."符号
|
|
50
|
+
* @property {Boolean} random 是否打乱键盘按键的顺序
|
|
51
|
+
* @event {Function} change 点击键盘触发
|
|
52
|
+
* @event {Function} backspace 点击退格键触发
|
|
53
|
+
* @example
|
|
54
|
+
*/
|
|
55
|
+
export default {
|
|
56
|
+
mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
|
|
57
|
+
data() {
|
|
58
|
+
return {
|
|
59
|
+
backspace: 'backspace', // 退格键内容
|
|
60
|
+
dot: '.', // 点
|
|
61
|
+
timer: null, // 长按多次删除的事件监听
|
|
62
|
+
cardX: 'X' // 身份证的X符号
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
computed: {
|
|
66
|
+
// 键盘需要显示的内容
|
|
67
|
+
numList() {
|
|
68
|
+
let tmp = [];
|
|
69
|
+
if (this.dotDisabled && this.mode == 'number') {
|
|
70
|
+
if (!this.random) {
|
|
71
|
+
return [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
|
|
72
|
+
} else {
|
|
73
|
+
return uni.$u.randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]);
|
|
74
|
+
}
|
|
75
|
+
} else if (!this.dotDisabled && this.mode == 'number') {
|
|
76
|
+
if (!this.random) {
|
|
77
|
+
return [1, 2, 3, 4, 5, 6, 7, 8, 9, this.dot, 0];
|
|
78
|
+
} else {
|
|
79
|
+
return uni.$u.randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, this.dot, 0]);
|
|
80
|
+
}
|
|
81
|
+
} else if (this.mode == 'card') {
|
|
82
|
+
if (!this.random) {
|
|
83
|
+
return [1, 2, 3, 4, 5, 6, 7, 8, 9, this.cardX, 0];
|
|
84
|
+
} else {
|
|
85
|
+
return uni.$u.randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, this.cardX, 0]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
// 按键的样式,在非乱序&&数字键盘&&不显示点按钮时,index为9时,按键占位两个空间
|
|
90
|
+
itemStyle() {
|
|
91
|
+
return index => {
|
|
92
|
+
let style = {};
|
|
93
|
+
if (this.mode == 'number' && this.dotDisabled && index == 9) style.width = '464rpx';
|
|
94
|
+
return style;
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
// 是否让按键显示灰色,只在非乱序&&数字键盘&&且允许点按键的时候
|
|
98
|
+
btnBgGray() {
|
|
99
|
+
return index => {
|
|
100
|
+
if (!this.random && index == 9 && (this.mode != 'number' || (this.mode == 'number' && !this
|
|
101
|
+
.dotDisabled))) return true;
|
|
102
|
+
else return false;
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
created() {
|
|
107
|
+
|
|
108
|
+
},
|
|
109
|
+
methods: {
|
|
110
|
+
// 点击退格键
|
|
111
|
+
backspaceClick() {
|
|
112
|
+
this.$emit('backspace');
|
|
113
|
+
clearInterval(this.timer); //再次清空定时器,防止重复注册定时器
|
|
114
|
+
this.timer = null;
|
|
115
|
+
this.timer = setInterval(() => {
|
|
116
|
+
this.$emit('backspace');
|
|
117
|
+
}, 250);
|
|
118
|
+
},
|
|
119
|
+
clearTimer() {
|
|
120
|
+
clearInterval(this.timer);
|
|
121
|
+
this.timer = null;
|
|
122
|
+
},
|
|
123
|
+
// 获取键盘显示的内容
|
|
124
|
+
keyboardClick(val) {
|
|
125
|
+
// 允许键盘显示点模式和触发非点按键时,将内容转为数字类型
|
|
126
|
+
if (!this.dotDisabled && val != this.dot && val != this.cardX) val = Number(val);
|
|
127
|
+
this.$emit('change', val);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
</script>
|
|
132
|
+
|
|
133
|
+
<style lang="scss" scoped>
|
|
134
|
+
@import "../../libs/css/components.scss";
|
|
135
|
+
$u-number-keyboard-background-color:rgb(224, 228, 230) !default;
|
|
136
|
+
$u-number-keyboard-padding:8px 10rpx 8px 10rpx !default;
|
|
137
|
+
$u-number-keyboard-button-width:222rpx !default;
|
|
138
|
+
$u-number-keyboard-button-margin:4px 6rpx !default;
|
|
139
|
+
$u-number-keyboard-button-border-top-left-radius:4px !default;
|
|
140
|
+
$u-number-keyboard-button-border-top-right-radius:4px !default;
|
|
141
|
+
$u-number-keyboard-button-border-bottom-left-radius:4px !default;
|
|
142
|
+
$u-number-keyboard-button-border-bottom-right-radius:4px !default;
|
|
143
|
+
$u-number-keyboard-button-height: 90rpx!default;
|
|
144
|
+
$u-number-keyboard-button-background-color:#FFFFFF !default;
|
|
145
|
+
$u-number-keyboard-button-box-shadow:0 2px 0px #BBBCBE !default;
|
|
146
|
+
$u-number-keyboard-text-font-size:20px !default;
|
|
147
|
+
$u-number-keyboard-text-font-weight:500 !default;
|
|
148
|
+
$u-number-keyboard-text-color:$u-main-color !default;
|
|
149
|
+
$u-number-keyboard-gray-background-color:rgb(200, 202, 210) !default;
|
|
150
|
+
$u-number-keyboard-u-hover-class-background-color: #BBBCC6 !default;
|
|
151
|
+
|
|
152
|
+
.u-keyboard {
|
|
153
|
+
@include flex;
|
|
154
|
+
flex-direction: row;
|
|
155
|
+
justify-content: space-around;
|
|
156
|
+
background-color: $u-number-keyboard-background-color;
|
|
157
|
+
flex-wrap: wrap;
|
|
158
|
+
padding: $u-number-keyboard-padding;
|
|
159
|
+
|
|
160
|
+
&__button-wrapper {
|
|
161
|
+
box-shadow: $u-number-keyboard-button-box-shadow;
|
|
162
|
+
margin: $u-number-keyboard-button-margin;
|
|
163
|
+
border-top-left-radius: $u-number-keyboard-button-border-top-left-radius;
|
|
164
|
+
border-top-right-radius: $u-number-keyboard-button-border-top-right-radius;
|
|
165
|
+
border-bottom-left-radius: $u-number-keyboard-button-border-bottom-left-radius;
|
|
166
|
+
border-bottom-right-radius: $u-number-keyboard-button-border-bottom-right-radius;
|
|
167
|
+
|
|
168
|
+
&__button {
|
|
169
|
+
width: $u-number-keyboard-button-width;
|
|
170
|
+
height: $u-number-keyboard-button-height;
|
|
171
|
+
background-color: $u-number-keyboard-button-background-color;
|
|
172
|
+
@include flex;
|
|
173
|
+
justify-content: center;
|
|
174
|
+
align-items: center;
|
|
175
|
+
border-top-left-radius: $u-number-keyboard-button-border-top-left-radius;
|
|
176
|
+
border-top-right-radius: $u-number-keyboard-button-border-top-right-radius;
|
|
177
|
+
border-bottom-left-radius: $u-number-keyboard-button-border-bottom-left-radius;
|
|
178
|
+
border-bottom-right-radius: $u-number-keyboard-button-border-bottom-right-radius;
|
|
179
|
+
|
|
180
|
+
&__text {
|
|
181
|
+
font-size: $u-number-keyboard-text-font-size;
|
|
182
|
+
font-weight: $u-number-keyboard-text-font-weight;
|
|
183
|
+
color: $u-number-keyboard-text-color;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&--gray {
|
|
187
|
+
background-color: $u-number-keyboard-gray-background-color;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.u-hover-class {
|
|
194
|
+
background-color: $u-number-keyboard-u-hover-class-background-color;
|
|
195
|
+
}
|
|
196
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
// 是否显示遮罩
|
|
4
|
+
show: {
|
|
5
|
+
type: Boolean,
|
|
6
|
+
default: uni.$u.props.overlay.show
|
|
7
|
+
},
|
|
8
|
+
// 层级z-index
|
|
9
|
+
zIndex: {
|
|
10
|
+
type: [String, Number],
|
|
11
|
+
default: uni.$u.props.overlay.zIndex
|
|
12
|
+
},
|
|
13
|
+
// 遮罩的过渡时间,单位为ms
|
|
14
|
+
duration: {
|
|
15
|
+
type: [String, Number],
|
|
16
|
+
default: uni.$u.props.overlay.duration
|
|
17
|
+
},
|
|
18
|
+
// 不透明度值,当做rgba的第四个参数
|
|
19
|
+
opacity: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
default: uni.$u.props.overlay.opacity
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<u-transition
|
|
3
|
+
:show="show"
|
|
4
|
+
custom-class="u-overlay"
|
|
5
|
+
:duration="duration"
|
|
6
|
+
:custom-style="overlayStyle"
|
|
7
|
+
@click="clickHandler"
|
|
8
|
+
>
|
|
9
|
+
<slot />
|
|
10
|
+
</u-transition>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import props from './props.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* overlay 遮罩
|
|
18
|
+
* @description 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
|
|
19
|
+
* @tutorial https://www.uviewui.com/components/overlay.html
|
|
20
|
+
* @property {Boolean} show 是否显示遮罩(默认 false )
|
|
21
|
+
* @property {String | Number} zIndex zIndex 层级(默认 10070 )
|
|
22
|
+
* @property {String | Number} duration 动画时长,单位毫秒(默认 300 )
|
|
23
|
+
* @property {String | Number} opacity 不透明度值,当做rgba的第四个参数 (默认 0.5 )
|
|
24
|
+
* @property {Object} customStyle 定义需要用到的外部样式
|
|
25
|
+
* @event {Function} click 点击遮罩发送事件
|
|
26
|
+
* @example <u-overlay :show="show" @click="show = false"></u-overlay>
|
|
27
|
+
*/
|
|
28
|
+
export default {
|
|
29
|
+
name: "u-overlay",
|
|
30
|
+
mixins: [uni.$u.mpMixin, uni.$u.mixin,props],
|
|
31
|
+
computed: {
|
|
32
|
+
overlayStyle() {
|
|
33
|
+
const style = {
|
|
34
|
+
position: 'fixed',
|
|
35
|
+
top: 0,
|
|
36
|
+
left: 0,
|
|
37
|
+
right: 0,
|
|
38
|
+
zIndex: this.zIndex,
|
|
39
|
+
bottom: 0,
|
|
40
|
+
'background-color': `rgba(0, 0, 0, ${this.opacity})`
|
|
41
|
+
}
|
|
42
|
+
return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
clickHandler() {
|
|
47
|
+
this.$emit('click')
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<style lang="scss" scoped>
|
|
54
|
+
@import "../../libs/css/components.scss";
|
|
55
|
+
$u-overlay-top:0 !default;
|
|
56
|
+
$u-overlay-left:0 !default;
|
|
57
|
+
$u-overlay-width:100% !default;
|
|
58
|
+
$u-overlay-height:100% !default;
|
|
59
|
+
$u-overlay-background-color:rgba(0, 0, 0, .7) !default;
|
|
60
|
+
.u-overlay {
|
|
61
|
+
position: fixed;
|
|
62
|
+
top:$u-overlay-top;
|
|
63
|
+
left:$u-overlay-left;
|
|
64
|
+
width: $u-overlay-width;
|
|
65
|
+
height:$u-overlay-height;
|
|
66
|
+
background-color:$u-overlay-background-color;
|
|
67
|
+
}
|
|
68
|
+
</style>
|