@gmcb/uv-ui 0.2.26

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.
Files changed (285) hide show
  1. package/CHANGELOG.md +295 -0
  2. package/LICENSE +21 -0
  3. package/README.md +164 -0
  4. package/components/uv-action-sheet/props.js +50 -0
  5. package/components/uv-action-sheet/uv-action-sheet.vue +280 -0
  6. package/components/uv-album/uv-album.vue +312 -0
  7. package/components/uv-alert/props.js +45 -0
  8. package/components/uv-alert/uv-alert.vue +246 -0
  9. package/components/uv-avatar/props.js +85 -0
  10. package/components/uv-avatar/uv-avatar.vue +182 -0
  11. package/components/uv-avatar-group/props.js +53 -0
  12. package/components/uv-avatar-group/uv-avatar-group.vue +106 -0
  13. package/components/uv-back-top/props.js +58 -0
  14. package/components/uv-back-top/uv-back-top.vue +116 -0
  15. package/components/uv-badge/props.js +73 -0
  16. package/components/uv-badge/uv-badge.vue +176 -0
  17. package/components/uv-button/nvue.scss +46 -0
  18. package/components/uv-button/props.js +163 -0
  19. package/components/uv-button/uv-button.vue +529 -0
  20. package/components/uv-button/vue.scss +93 -0
  21. package/components/uv-calendar/calendar.js +546 -0
  22. package/components/uv-calendar/header.vue +104 -0
  23. package/components/uv-calendar/month.vue +616 -0
  24. package/components/uv-calendar/props.js +145 -0
  25. package/components/uv-calendar/uv-calendar.vue +390 -0
  26. package/components/uv-calendars/calendar-body.vue +376 -0
  27. package/components/uv-calendars/calendar-item.vue +248 -0
  28. package/components/uv-calendars/calendar.js +546 -0
  29. package/components/uv-calendars/i18n/en.json +12 -0
  30. package/components/uv-calendars/i18n/index.js +8 -0
  31. package/components/uv-calendars/i18n/zh-Hans.json +12 -0
  32. package/components/uv-calendars/i18n/zh-Hant.json +12 -0
  33. package/components/uv-calendars/util.js +435 -0
  34. package/components/uv-calendars/uv-calendars.vue +452 -0
  35. package/components/uv-cell/props.js +116 -0
  36. package/components/uv-cell/uv-cell.vue +209 -0
  37. package/components/uv-cell-group/props.js +15 -0
  38. package/components/uv-cell-group/uv-cell-group.vue +63 -0
  39. package/components/uv-checkbox/props.js +70 -0
  40. package/components/uv-checkbox/uv-checkbox.vue +371 -0
  41. package/components/uv-checkbox-group/props.js +84 -0
  42. package/components/uv-checkbox-group/uv-checkbox-group.vue +119 -0
  43. package/components/uv-code/props.js +35 -0
  44. package/components/uv-code/uv-code.vue +136 -0
  45. package/components/uv-code-input/props.js +83 -0
  46. package/components/uv-code-input/uv-code-input.vue +272 -0
  47. package/components/uv-col/props.js +30 -0
  48. package/components/uv-col/uv-col.vue +165 -0
  49. package/components/uv-collapse/props.js +20 -0
  50. package/components/uv-collapse/uv-collapse.vue +86 -0
  51. package/components/uv-collapse-item/props.js +60 -0
  52. package/components/uv-collapse-item/uv-collapse-item.vue +228 -0
  53. package/components/uv-column-notice/props.js +61 -0
  54. package/components/uv-column-notice/uv-column-notice.vue +176 -0
  55. package/components/uv-count-down/props.js +25 -0
  56. package/components/uv-count-down/utils.js +62 -0
  57. package/components/uv-count-down/uv-count-down.vue +169 -0
  58. package/components/uv-count-to/props.js +60 -0
  59. package/components/uv-count-to/uv-count-to.vue +187 -0
  60. package/components/uv-datetime-picker/props.js +130 -0
  61. package/components/uv-datetime-picker/uv-datetime-picker.vue +355 -0
  62. package/components/uv-divider/props.js +45 -0
  63. package/components/uv-divider/uv-divider.vue +113 -0
  64. package/components/uv-drop-down/uv-drop-down.vue +135 -0
  65. package/components/uv-drop-down-item/uv-drop-down-item.vue +169 -0
  66. package/components/uv-drop-down-popup/uv-drop-down-popup.vue +242 -0
  67. package/components/uv-empty/props.js +60 -0
  68. package/components/uv-empty/uv-empty.vue +126 -0
  69. package/components/uv-form/props.js +46 -0
  70. package/components/uv-form/uv-form.vue +209 -0
  71. package/components/uv-form/valid.js +1343 -0
  72. package/components/uv-form-item/props.js +49 -0
  73. package/components/uv-form-item/uv-form-item.vue +226 -0
  74. package/components/uv-gap/props.js +25 -0
  75. package/components/uv-gap/uv-gap.vue +36 -0
  76. package/components/uv-grid/props.js +20 -0
  77. package/components/uv-grid/uv-grid.vue +100 -0
  78. package/components/uv-grid-item/props.js +15 -0
  79. package/components/uv-grid-item/uv-grid-item.vue +223 -0
  80. package/components/uv-icon/icons.js +160 -0
  81. package/components/uv-icon/props.js +90 -0
  82. package/components/uv-icon/uv-icon.vue +226 -0
  83. package/components/uv-icon/uvicons.ttf +0 -0
  84. package/components/uv-image/props.js +100 -0
  85. package/components/uv-image/uv-image.vue +296 -0
  86. package/components/uv-index-anchor/props.js +30 -0
  87. package/components/uv-index-anchor/uv-index-anchor.vue +98 -0
  88. package/components/uv-index-item/uv-index-item.vue +87 -0
  89. package/components/uv-index-list/props.js +30 -0
  90. package/components/uv-index-list/uv-index-list.vue +461 -0
  91. package/components/uv-input/props.js +175 -0
  92. package/components/uv-input/uv-input.vue +348 -0
  93. package/components/uv-keyboard/props.js +95 -0
  94. package/components/uv-keyboard/uv-keyboard.vue +180 -0
  95. package/components/uv-keyboard-car/props.js +24 -0
  96. package/components/uv-keyboard-car/uv-keyboard-car.vue +347 -0
  97. package/components/uv-keyboard-number/props.js +19 -0
  98. package/components/uv-keyboard-number/uv-keyboard-number.vue +201 -0
  99. package/components/uv-line/props.js +34 -0
  100. package/components/uv-line/uv-line.vue +60 -0
  101. package/components/uv-line-progress/props.js +29 -0
  102. package/components/uv-line-progress/uv-line-progress.vue +146 -0
  103. package/components/uv-link/props.js +40 -0
  104. package/components/uv-link/uv-link.vue +83 -0
  105. package/components/uv-list/uv-list.vue +147 -0
  106. package/components/uv-list-item/uv-list-item.vue +535 -0
  107. package/components/uv-load-more/props.js +95 -0
  108. package/components/uv-load-more/uv-load-more.vue +152 -0
  109. package/components/uv-loading-icon/props.js +67 -0
  110. package/components/uv-loading-icon/uv-loading-icon.vue +347 -0
  111. package/components/uv-loading-page/props.js +55 -0
  112. package/components/uv-loading-page/uv-loading-page.vue +96 -0
  113. package/components/uv-modal/props.js +90 -0
  114. package/components/uv-modal/uv-modal.vue +245 -0
  115. package/components/uv-navbar/props.js +89 -0
  116. package/components/uv-navbar/uv-navbar.vue +245 -0
  117. package/components/uv-no-network/props.js +20 -0
  118. package/components/uv-no-network/uv-no-network.vue +222 -0
  119. package/components/uv-notice-bar/props.js +76 -0
  120. package/components/uv-notice-bar/uv-notice-bar.vue +110 -0
  121. package/components/uv-notify/props.js +45 -0
  122. package/components/uv-notify/uv-notify.vue +220 -0
  123. package/components/uv-number-box/props.js +118 -0
  124. package/components/uv-number-box/uv-number-box.vue +397 -0
  125. package/components/uv-overlay/props.js +25 -0
  126. package/components/uv-overlay/uv-overlay.vue +85 -0
  127. package/components/uv-parse/node/node.vue +576 -0
  128. package/components/uv-parse/parser.js +1335 -0
  129. package/components/uv-parse/uv-parse.vue +498 -0
  130. package/components/uv-pick-color/colors.js +217 -0
  131. package/components/uv-pick-color/props.js +47 -0
  132. package/components/uv-pick-color/uv-pick-color.vue +551 -0
  133. package/components/uv-picker/props.js +95 -0
  134. package/components/uv-picker/uv-picker.vue +329 -0
  135. package/components/uv-popup/keypress.js +45 -0
  136. package/components/uv-popup/uv-popup.vue +537 -0
  137. package/components/uv-preview-video/uv-preview-video.vue +52 -0
  138. package/components/uv-qrcode/cache.js +1 -0
  139. package/components/uv-qrcode/gcanvas/bridge/bridge-weex.js +241 -0
  140. package/components/uv-qrcode/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
  141. package/components/uv-qrcode/gcanvas/context-2d/FillStylePattern.js +8 -0
  142. package/components/uv-qrcode/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
  143. package/components/uv-qrcode/gcanvas/context-2d/RenderingContext.js +666 -0
  144. package/components/uv-qrcode/gcanvas/context-webgl/ActiveInfo.js +11 -0
  145. package/components/uv-qrcode/gcanvas/context-webgl/Buffer.js +21 -0
  146. package/components/uv-qrcode/gcanvas/context-webgl/Framebuffer.js +21 -0
  147. package/components/uv-qrcode/gcanvas/context-webgl/GLenum.js +298 -0
  148. package/components/uv-qrcode/gcanvas/context-webgl/GLmethod.js +142 -0
  149. package/components/uv-qrcode/gcanvas/context-webgl/GLtype.js +23 -0
  150. package/components/uv-qrcode/gcanvas/context-webgl/Program.js +21 -0
  151. package/components/uv-qrcode/gcanvas/context-webgl/Renderbuffer.js +21 -0
  152. package/components/uv-qrcode/gcanvas/context-webgl/RenderingContext.js +1191 -0
  153. package/components/uv-qrcode/gcanvas/context-webgl/Shader.js +22 -0
  154. package/components/uv-qrcode/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
  155. package/components/uv-qrcode/gcanvas/context-webgl/Texture.js +22 -0
  156. package/components/uv-qrcode/gcanvas/context-webgl/UniformLocation.js +22 -0
  157. package/components/uv-qrcode/gcanvas/context-webgl/classUtils.js +3 -0
  158. package/components/uv-qrcode/gcanvas/env/canvas.js +74 -0
  159. package/components/uv-qrcode/gcanvas/env/image.js +96 -0
  160. package/components/uv-qrcode/gcanvas/env/tool.js +24 -0
  161. package/components/uv-qrcode/gcanvas/index.js +39 -0
  162. package/components/uv-qrcode/props.js +85 -0
  163. package/components/uv-qrcode/qrcode.js +34 -0
  164. package/components/uv-qrcode/queue.js +41 -0
  165. package/components/uv-qrcode/uv-qrcode.vue +1038 -0
  166. package/components/uv-radio/props.js +65 -0
  167. package/components/uv-radio/uv-radio.vue +349 -0
  168. package/components/uv-radio-group/props.js +89 -0
  169. package/components/uv-radio-group/uv-radio-group.vue +115 -0
  170. package/components/uv-rate/props.js +73 -0
  171. package/components/uv-rate/uv-rate.vue +274 -0
  172. package/components/uv-read-more/props.js +62 -0
  173. package/components/uv-read-more/uv-read-more.vue +162 -0
  174. package/components/uv-row/props.js +20 -0
  175. package/components/uv-row/uv-row.vue +95 -0
  176. package/components/uv-row-notice/props.js +40 -0
  177. package/components/uv-row-notice/uv-row-notice.vue +341 -0
  178. package/components/uv-safe-bottom/uv-safe-bottom.vue +67 -0
  179. package/components/uv-scroll-list/nvue.js +29 -0
  180. package/components/uv-scroll-list/props.js +35 -0
  181. package/components/uv-scroll-list/scrollWxs.wxs +51 -0
  182. package/components/uv-scroll-list/uv-scroll-list.vue +218 -0
  183. package/components/uv-search/props.js +127 -0
  184. package/components/uv-search/uv-search.vue +311 -0
  185. package/components/uv-skeleton/props.js +65 -0
  186. package/components/uv-skeleton/uv-skeleton.vue +250 -0
  187. package/components/uv-skeletons/uv-skeletons.vue +247 -0
  188. package/components/uv-slider/props.js +58 -0
  189. package/components/uv-slider/uv-slider.vue +58 -0
  190. package/components/uv-status-bar/props.js +8 -0
  191. package/components/uv-status-bar/uv-status-bar.vue +54 -0
  192. package/components/uv-steps/props.js +40 -0
  193. package/components/uv-steps/uv-steps.vue +83 -0
  194. package/components/uv-steps-item/props.js +25 -0
  195. package/components/uv-steps-item/uv-steps-item.vue +347 -0
  196. package/components/uv-sticky/props.js +41 -0
  197. package/components/uv-sticky/uv-sticky.vue +223 -0
  198. package/components/uv-subsection/props.js +54 -0
  199. package/components/uv-subsection/uv-subsection.vue +269 -0
  200. package/components/uv-swipe-action/props.js +10 -0
  201. package/components/uv-swipe-action/uv-swipe-action.vue +65 -0
  202. package/components/uv-swipe-action-item/index - backup.wxs +256 -0
  203. package/components/uv-swipe-action-item/index.wxs +225 -0
  204. package/components/uv-swipe-action-item/nvue - backup.js +264 -0
  205. package/components/uv-swipe-action-item/nvue.js +182 -0
  206. package/components/uv-swipe-action-item/props.js +40 -0
  207. package/components/uv-swipe-action-item/uv-swipe-action-item.vue +200 -0
  208. package/components/uv-swipe-action-item/wxs.js +15 -0
  209. package/components/uv-swiper/props.js +136 -0
  210. package/components/uv-swiper/uv-swiper.vue +263 -0
  211. package/components/uv-swiper-indicator/props.js +30 -0
  212. package/components/uv-swiper-indicator/uv-swiper-indicator.vue +112 -0
  213. package/components/uv-switch/props.js +58 -0
  214. package/components/uv-switch/uv-switch.vue +182 -0
  215. package/components/uv-tabbar/props.js +50 -0
  216. package/components/uv-tabbar/uv-tabbar.vue +146 -0
  217. package/components/uv-tabbar-item/props.js +40 -0
  218. package/components/uv-tabbar-item/uv-tabbar-item.vue +146 -0
  219. package/components/uv-tabs/props.js +71 -0
  220. package/components/uv-tabs/uv-tabs.vue +391 -0
  221. package/components/uv-tags/props.js +104 -0
  222. package/components/uv-tags/uv-tags.vue +379 -0
  223. package/components/uv-text/props.js +113 -0
  224. package/components/uv-text/uv-text.vue +218 -0
  225. package/components/uv-text/value.js +87 -0
  226. package/components/uv-textarea/props.js +138 -0
  227. package/components/uv-textarea/uv-textarea.vue +238 -0
  228. package/components/uv-toast/uv-toast.vue +292 -0
  229. package/components/uv-toolbar/props.js +40 -0
  230. package/components/uv-toolbar/uv-toolbar.vue +109 -0
  231. package/components/uv-tooltip/props.js +60 -0
  232. package/components/uv-tooltip/uv-tooltip.vue +372 -0
  233. package/components/uv-transition/createAnimation.js +131 -0
  234. package/components/uv-transition/props.js +31 -0
  235. package/components/uv-transition/uv-transition.vue +320 -0
  236. package/components/uv-upload/mixin.js +22 -0
  237. package/components/uv-upload/props.js +130 -0
  238. package/components/uv-upload/utils.js +151 -0
  239. package/components/uv-upload/uv-upload.vue +488 -0
  240. package/components/uv-vtabs/props.js +79 -0
  241. package/components/uv-vtabs/uv-vtabs.vue +438 -0
  242. package/components/uv-vtabs-item/uv-vtabs-item.vue +68 -0
  243. package/components/uv-waterfall/props.js +69 -0
  244. package/components/uv-waterfall/uv-waterfall.vue +265 -0
  245. package/index.js +82 -0
  246. package/index.scss +7 -0
  247. package/libs/config/config.js +34 -0
  248. package/libs/css/color.scss +32 -0
  249. package/libs/css/common.scss +100 -0
  250. package/libs/css/components.scss +23 -0
  251. package/libs/css/variable.scss +111 -0
  252. package/libs/css/vue.scss +40 -0
  253. package/libs/function/colorGradient.js +134 -0
  254. package/libs/function/compress.js +27 -0
  255. package/libs/function/debounce.js +29 -0
  256. package/libs/function/digit.js +167 -0
  257. package/libs/function/index.js +734 -0
  258. package/libs/function/platform.js +75 -0
  259. package/libs/function/test.js +287 -0
  260. package/libs/function/throttle.js +30 -0
  261. package/libs/luch-request/adapters/index.js +132 -0
  262. package/libs/luch-request/core/InterceptorManager.js +51 -0
  263. package/libs/luch-request/core/Request.js +201 -0
  264. package/libs/luch-request/core/buildFullPath.js +20 -0
  265. package/libs/luch-request/core/defaults.js +33 -0
  266. package/libs/luch-request/core/dispatchRequest.js +6 -0
  267. package/libs/luch-request/core/mergeConfig.js +126 -0
  268. package/libs/luch-request/core/settle.js +16 -0
  269. package/libs/luch-request/helpers/buildURL.js +64 -0
  270. package/libs/luch-request/helpers/combineURLs.js +14 -0
  271. package/libs/luch-request/helpers/isAbsoluteURL.js +14 -0
  272. package/libs/luch-request/index.d.ts +197 -0
  273. package/libs/luch-request/index.js +2 -0
  274. package/libs/luch-request/utils/clone.js +264 -0
  275. package/libs/luch-request/utils.js +135 -0
  276. package/libs/mixin/button.js +13 -0
  277. package/libs/mixin/mixin.js +172 -0
  278. package/libs/mixin/mpMixin.js +8 -0
  279. package/libs/mixin/mpShare.js +13 -0
  280. package/libs/mixin/openType.js +47 -0
  281. package/libs/mixin/touch.js +59 -0
  282. package/libs/util/dayjs.js +216 -0
  283. package/libs/util/route.js +126 -0
  284. package/package.json +28 -0
  285. package/theme.scss +43 -0
@@ -0,0 +1,347 @@
1
+ <template>
2
+ <view
3
+ class="uv-keyboard"
4
+ @touchmove.stop.prevent="noop"
5
+ >
6
+ <view
7
+ v-for="(group, i) in abc ? engKeyBoardList : areaList"
8
+ :key="i"
9
+ class="uv-keyboard__button"
10
+ :index="i"
11
+ :class="[i + 1 === 4 && 'uv-keyboard__button--center']"
12
+ >
13
+ <view
14
+ v-if="i === 3"
15
+ class="uv-keyboard__button__inner-wrapper"
16
+ >
17
+ <view
18
+ class="uv-keyboard__button__inner-wrapper__left"
19
+ hover-class="uv-hover-class"
20
+ :hover-stay-time="200"
21
+ @tap="changeCarInputMode"
22
+ >
23
+ <slot>
24
+ <template v-if="!customabc">
25
+ <text
26
+ class="uv-keyboard__button__inner-wrapper__left__lang"
27
+ :class="[!abc && 'uv-keyboard__button__inner-wrapper__left__lang--active']"
28
+ >中</text>
29
+ <text class="uv-keyboard__button__inner-wrapper__left__line">/</text>
30
+ <text
31
+ class="uv-keyboard__button__inner-wrapper__left__lang"
32
+ :class="[abc && 'uv-keyboard__button__inner-wrapper__left__lang--active']"
33
+ >英</text>
34
+ </template>
35
+ </slot>
36
+ </view>
37
+ </view>
38
+ <view
39
+ class="uv-keyboard__button__inner-wrapper"
40
+ v-for="(item, j) in group"
41
+ :key="j"
42
+ >
43
+ <view
44
+ :class="['uv-keyboard__button__inner-wrapper__inner',{'uv-keyboard__button__inner-wrapper__inner--disabled': isDisabled(i,j)}]"
45
+ :hover-stay-time="200"
46
+ @tap="carInputClick(i, j)"
47
+ :hover-class="isDisabled(i,j)?'none':'uv-hover-class'"
48
+ >
49
+ <text class="uv-keyboard__button__inner-wrapper__inner__text">{{ item }}</text>
50
+ </view>
51
+ <view class="uv-keyboard__button__inner-wrapper__disabled--mask" v-if="isDisabled(i,j)"></view>
52
+ </view>
53
+ <view
54
+ v-if="i === 3"
55
+ @touchstart="backspaceClick"
56
+ @touchend="clearTimer"
57
+ class="uv-keyboard__button__inner-wrapper"
58
+ >
59
+ <view
60
+ class="uv-keyboard__button__inner-wrapper__right"
61
+ hover-class="uv-hover-class"
62
+ :hover-stay-time="200"
63
+ >
64
+ <uv-icon
65
+ size="28"
66
+ name="backspace"
67
+ color="#303133"
68
+ ></uv-icon>
69
+ </view>
70
+ </view>
71
+ </view>
72
+ </view>
73
+ </template>
74
+
75
+ <script>
76
+ import mpMixin from '../../libs/mixin/mpMixin.js'
77
+ import mixin from '../../libs/mixin/mixin.js'
78
+ import props from './props.js';
79
+ /**
80
+ * keyboard 键盘组件
81
+ * @description 此为uvui自定义的键盘面板,内含了数字键盘,车牌号键,身份证号键盘3种模式,都有可以打乱按键顺序的选项。
82
+ * @tutorial https://www.uvui.cn/components/keyboard.html
83
+ * @property {Boolean} random 是否打乱键盘的顺序
84
+ * @event {Function} change 点击键盘触发
85
+ * @event {Function} backspace 点击退格键触发
86
+ * @example <uv-keyboard ref="uKeyboard" mode="car" v-model="show"></uv-keyboard>
87
+ */
88
+ export default {
89
+ name: "uv-keyboard",
90
+ mixins: [mpMixin, mixin, props],
91
+ emits: ['backspace','change','changeCarInputMode'],
92
+ data() {
93
+ return {
94
+ // 车牌输入时,abc=true为输入车牌号码,bac=false为输入省份中文简称
95
+ abc: false
96
+ };
97
+ },
98
+ computed: {
99
+ areaList() {
100
+ let data = [
101
+ '京',
102
+ '沪',
103
+ '粤',
104
+ '津',
105
+ '冀',
106
+ '豫',
107
+ '云',
108
+ '辽',
109
+ '黑',
110
+ '湘',
111
+ '皖',
112
+ '鲁',
113
+ '苏',
114
+ '浙',
115
+ '赣',
116
+ '鄂',
117
+ '桂',
118
+ '甘',
119
+ '晋',
120
+ '陕',
121
+ '蒙',
122
+ '吉',
123
+ '闽',
124
+ '贵',
125
+ '渝',
126
+ '川',
127
+ '青',
128
+ '琼',
129
+ '宁',
130
+ '挂',
131
+ '藏',
132
+ '港',
133
+ '澳',
134
+ '新',
135
+ '使',
136
+ '学'
137
+ ];
138
+ let tmp = [];
139
+ // 打乱顺序
140
+ if (this.random) data = this.$uv.randomArray(data);
141
+ // 切割成二维数组
142
+ tmp[0] = data.slice(0, 10);
143
+ tmp[1] = data.slice(10, 20);
144
+ tmp[2] = data.slice(20, 30);
145
+ tmp[3] = data.slice(30, 36);
146
+ return tmp;
147
+ },
148
+ engKeyBoardList() {
149
+ let data = [
150
+ 1,
151
+ 2,
152
+ 3,
153
+ 4,
154
+ 5,
155
+ 6,
156
+ 7,
157
+ 8,
158
+ 9,
159
+ 0,
160
+ 'Q',
161
+ 'W',
162
+ 'E',
163
+ 'R',
164
+ 'T',
165
+ 'Y',
166
+ 'U',
167
+ 'I',
168
+ 'O',
169
+ 'P',
170
+ 'A',
171
+ 'S',
172
+ 'D',
173
+ 'F',
174
+ 'G',
175
+ 'H',
176
+ 'J',
177
+ 'K',
178
+ 'L',
179
+ 'Z',
180
+ 'X',
181
+ 'C',
182
+ 'V',
183
+ 'B',
184
+ 'N',
185
+ 'M'
186
+ ];
187
+ let tmp = [];
188
+ if (this.random) data = this.$uv.randomArray(data);
189
+ tmp[0] = data.slice(0, 10);
190
+ tmp[1] = data.slice(10, 20);
191
+ tmp[2] = data.slice(20, 30);
192
+ tmp[3] = data.slice(30, 36);
193
+ return tmp;
194
+ },
195
+ isDisabled(i,j) {
196
+ return (i,j)=>{
197
+ let value = '';
198
+ if (this.abc) value = this.engKeyBoardList[i][j];
199
+ else value = this.areaList[i][j];
200
+ return this.disKeys.indexOf(value) > -1;
201
+ }
202
+ }
203
+ },
204
+ methods: {
205
+ // 点击键盘按钮
206
+ carInputClick(i, j) {
207
+ if(this.isDisabled(i,j)) return;
208
+ let value = '';
209
+ // 不同模式,获取不同数组的值
210
+ if (this.abc) value = this.engKeyBoardList[i][j];
211
+ else value = this.areaList[i][j];
212
+ // 如果允许自动切换,则将中文状态切换为英文
213
+ if (!this.abc && this.autoChange) this.$uv.sleep(200).then(() => this.abc = true)
214
+ this.$emit('change', value);
215
+ },
216
+ // 修改汽车牌键盘的输入模式,中文|英文
217
+ changeCarInputMode() {
218
+ this.abc = !this.abc;
219
+ this.$emit('changeCarInputMode',this.abc);
220
+ },
221
+ // 点击退格键
222
+ backspaceClick() {
223
+ this.$emit('backspace');
224
+ clearInterval(this.timer); //再次清空定时器,防止重复注册定时器
225
+ this.timer = null;
226
+ this.timer = setInterval(() => {
227
+ this.$emit('backspace');
228
+ }, 250);
229
+ },
230
+ clearTimer() {
231
+ clearInterval(this.timer);
232
+ this.timer = null;
233
+ },
234
+ }
235
+ };
236
+ </script>
237
+
238
+ <style lang="scss" scoped>
239
+ $show-hover: 1;
240
+ @import '../../libs/css/variable.scss';
241
+ @import '../../libs/css/components.scss';
242
+ @import '../../libs/css/color.scss';
243
+ $uv-car-keyboard-background-color: rgb(224, 228, 230) !default;
244
+ $uv-car-keyboard-padding:6px 0 6px !default;
245
+ $uv-car-keyboard-button-inner-width:64rpx !default;
246
+ $uv-car-keyboard-button-inner-background-color:#FFFFFF !default;
247
+ $uv-car-keyboard-button-height:80rpx !default;
248
+ $uv-car-keyboard-button-inner-box-shadow:0 1px 0px #999992 !default;
249
+ $uv-car-keyboard-button-border-radius:4px !default;
250
+ $uv-car-keyboard-button-inner-margin:8rpx 5rpx !default;
251
+ $uv-car-keyboard-button-text-font-size:16px !default;
252
+ $uv-car-keyboard-button-text-color:$uv-main-color !default;
253
+ $uv-car-keyboard-center-inner-margin: 0 4rpx !default;
254
+ $uv-car-keyboard-special-button-width:134rpx !default;
255
+ $uv-car-keyboard-lang-font-size:16px !default;
256
+ $uv-car-keyboard-lang-color:$uv-main-color !default;
257
+ $uv-car-keyboard-active-color:$uv-primary !default;
258
+ $uv-car-keyboard-line-font-size:15px !default;
259
+ $uv-car-keyboard-line-color:$uv-main-color !default;
260
+ $uv-car-keyboard-line-margin:0 1px !default;
261
+ $uv-car-keyboard-uv-hover-class-background-color:#BBBCC6 !default;
262
+
263
+ .uv-keyboard {
264
+ @include flex(column);
265
+ justify-content: space-around;
266
+ background-color: $uv-car-keyboard-background-color;
267
+ align-items: stretch;
268
+ padding: $uv-car-keyboard-padding;
269
+
270
+ &__button {
271
+ @include flex;
272
+ justify-content: center;
273
+ flex: 1;
274
+ /* #ifndef APP-NVUE */
275
+ /* #endif */
276
+
277
+ &__inner-wrapper {
278
+ position: relative;
279
+ box-shadow: $uv-car-keyboard-button-inner-box-shadow;
280
+ margin: $uv-car-keyboard-button-inner-margin;
281
+ border-radius: $uv-car-keyboard-button-border-radius;
282
+
283
+ &__disabled--mask {
284
+ position: absolute;
285
+ left: 0;
286
+ top: 0;
287
+ bottom: 0;
288
+ right: 0;
289
+ width: $uv-car-keyboard-button-inner-width;
290
+ height: $uv-car-keyboard-button-height;
291
+ }
292
+
293
+ &__inner {
294
+ @include flex;
295
+ justify-content: center;
296
+ align-items: center;
297
+ width: $uv-car-keyboard-button-inner-width;
298
+ background-color: $uv-car-keyboard-button-inner-background-color;
299
+ height: $uv-car-keyboard-button-height;
300
+ border-radius: $uv-car-keyboard-button-border-radius;
301
+
302
+ &--disabled {
303
+ opacity: 0.5;
304
+ }
305
+
306
+ &__text {
307
+ font-size: $uv-car-keyboard-button-text-font-size;
308
+ color: $uv-car-keyboard-button-text-color;
309
+ }
310
+ }
311
+
312
+ &__left,
313
+ &__right {
314
+ border-radius: $uv-car-keyboard-button-border-radius;
315
+ width: $uv-car-keyboard-special-button-width;
316
+ height: $uv-car-keyboard-button-height;
317
+ background-color: $uv-car-keyboard-uv-hover-class-background-color;
318
+ @include flex;
319
+ justify-content: center;
320
+ align-items: center;
321
+ box-shadow: $uv-car-keyboard-button-inner-box-shadow;
322
+ }
323
+
324
+ &__left {
325
+ &__line {
326
+ font-size: $uv-car-keyboard-line-font-size;
327
+ color: $uv-car-keyboard-line-color;
328
+ margin: $uv-car-keyboard-line-margin;
329
+ }
330
+
331
+ &__lang {
332
+ font-size: $uv-car-keyboard-lang-font-size;
333
+ color: $uv-car-keyboard-lang-color;
334
+
335
+ &--active {
336
+ color: $uv-car-keyboard-active-color;
337
+ }
338
+ }
339
+ }
340
+ }
341
+ }
342
+ }
343
+
344
+ .uv-hover-class {
345
+ background-color: $uv-car-keyboard-uv-hover-class-background-color;
346
+ }
347
+ </style>
@@ -0,0 +1,19 @@
1
+ export default {
2
+ props: {
3
+ // 键盘的类型,number-数字键盘,card-身份证键盘
4
+ mode: {
5
+ type: String,
6
+ default: 'number'
7
+ },
8
+ // 是否显示键盘的"."符号
9
+ dotDisabled: {
10
+ type: Boolean,
11
+ default: false
12
+ },
13
+ // 是否打乱键盘按键的顺序
14
+ random: {
15
+ type: Boolean,
16
+ default: false
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,201 @@
1
+ <template>
2
+ <view
3
+ class="uv-keyboard"
4
+ @touchmove.stop.prevent="noop"
5
+ >
6
+ <view
7
+ class="uv-keyboard__button-wrapper"
8
+ v-for="(item, index) in numList"
9
+ :key="index"
10
+ >
11
+ <view
12
+ class="uv-keyboard__button-wrapper__button"
13
+ :style="[itemStyle(index)]"
14
+ @tap="keyboardClick(item)"
15
+ hover-class="uv-hover-class"
16
+ :hover-stay-time="200"
17
+ >
18
+ <text class="uv-keyboard__button-wrapper__button__text">{{ item }}</text>
19
+ </view>
20
+ </view>
21
+ <view
22
+ class="uv-keyboard__button-wrapper"
23
+ >
24
+ <view
25
+ class="uv-keyboard__button-wrapper__button uv-keyboard__button-wrapper__button--gray"
26
+ hover-class="uv-hover-class"
27
+ :hover-stay-time="200"
28
+ @touchstart.stop="backspaceClick"
29
+ @touchend="clearTimer"
30
+ >
31
+ <uv-icon
32
+ name="backspace"
33
+ color="#303133"
34
+ size="28"
35
+ ></uv-icon>
36
+ </view>
37
+ </view>
38
+ </view>
39
+ </template>
40
+
41
+ <script>
42
+ import mpMixin from '../../libs/mixin/mpMixin.js'
43
+ import mixin from '../../libs/mixin/mixin.js'
44
+ import props from './props.js';
45
+ /**
46
+ * keyboard 键盘组件
47
+ * @description
48
+ * @tutorial
49
+ * @property {String} mode 键盘的类型,number-数字键盘,card-身份证键盘
50
+ * @property {Boolean} dotDisabled 是否显示键盘的"."符号
51
+ * @property {Boolean} random 是否打乱键盘按键的顺序
52
+ * @event {Function} change 点击键盘触发
53
+ * @event {Function} backspace 点击退格键触发
54
+ * @example
55
+ */
56
+ export default {
57
+ mixins: [mpMixin, mixin, props],
58
+ emits: ['backspace','change'],
59
+ data() {
60
+ return {
61
+ backspace: 'backspace', // 退格键内容
62
+ dot: '.', // 点
63
+ timer: null, // 长按多次删除的事件监听
64
+ cardX: 'X' // 身份证的X符号
65
+ };
66
+ },
67
+ computed: {
68
+ // 键盘需要显示的内容
69
+ numList() {
70
+ let tmp = [];
71
+ if (this.dotDisabled && this.mode == 'number') {
72
+ if (!this.random) {
73
+ return [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
74
+ } else {
75
+ return this.$uv.randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]);
76
+ }
77
+ } else if (!this.dotDisabled && this.mode == 'number') {
78
+ if (!this.random) {
79
+ return [1, 2, 3, 4, 5, 6, 7, 8, 9, this.dot, 0];
80
+ } else {
81
+ return this.$uv.randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, this.dot, 0]);
82
+ }
83
+ } else if (this.mode == 'card') {
84
+ if (!this.random) {
85
+ return [1, 2, 3, 4, 5, 6, 7, 8, 9, this.cardX, 0];
86
+ } else {
87
+ return this.$uv.randomArray([1, 2, 3, 4, 5, 6, 7, 8, 9, this.cardX, 0]);
88
+ }
89
+ }
90
+ },
91
+ // 按键的样式,在非乱序&&数字键盘&&不显示点按钮时,index为9时,按键占位两个空间
92
+ itemStyle() {
93
+ return index => {
94
+ let style = {};
95
+ if (this.mode == 'number' && this.dotDisabled && index == 9) style.width = '464rpx';
96
+ return style;
97
+ };
98
+ },
99
+ // 是否让按键显示灰色,只在非乱序&&数字键盘&&且允许点按键的时候
100
+ btnBgGray() {
101
+ return index => {
102
+ if (!this.random && index == 9 && (this.mode != 'number' || (this.mode == 'number' && !this
103
+ .dotDisabled))) return true;
104
+ else return false;
105
+ };
106
+ },
107
+ },
108
+ created() {
109
+
110
+ },
111
+ methods: {
112
+ // 点击退格键
113
+ backspaceClick() {
114
+ this.$emit('backspace');
115
+ clearInterval(this.timer); //再次清空定时器,防止重复注册定时器
116
+ this.timer = null;
117
+ this.timer = setInterval(() => {
118
+ this.$emit('backspace');
119
+ }, 250);
120
+ },
121
+ clearTimer() {
122
+ clearInterval(this.timer);
123
+ this.timer = null;
124
+ },
125
+ // 获取键盘显示的内容
126
+ keyboardClick(val) {
127
+ // 允许键盘显示点模式和触发非点按键时,将内容转为数字类型
128
+ if (!this.dotDisabled && val != this.dot && val != this.cardX) val = Number(val);
129
+ this.$emit('change', val);
130
+ }
131
+ }
132
+ };
133
+ </script>
134
+
135
+ <style lang="scss" scoped>
136
+ $show-hover: 1;
137
+ @import '../../libs/css/variable.scss';
138
+ @import '../../libs/css/components.scss';
139
+ @import '../../libs/css/color.scss';
140
+ $uv-number-keyboard-background-color:rgb(224, 228, 230) !default;
141
+ $uv-number-keyboard-padding:8px 10rpx 8px 10rpx !default;
142
+ $uv-number-keyboard-button-width:222rpx !default;
143
+ $uv-number-keyboard-button-margin:4px 6rpx !default;
144
+ $uv-number-keyboard-button-border-top-left-radius:4px !default;
145
+ $uv-number-keyboard-button-border-top-right-radius:4px !default;
146
+ $uv-number-keyboard-button-border-bottom-left-radius:4px !default;
147
+ $uv-number-keyboard-button-border-bottom-right-radius:4px !default;
148
+ $uv-number-keyboard-button-height: 90rpx!default;
149
+ $uv-number-keyboard-button-background-color:#FFFFFF !default;
150
+ $uv-number-keyboard-button-box-shadow:0 2px 0px #BBBCBE !default;
151
+ $uv-number-keyboard-text-font-size:20px !default;
152
+ $uv-number-keyboard-text-font-weight:500 !default;
153
+ $uv-number-keyboard-text-color:$uv-main-color !default;
154
+ $uv-number-keyboard-gray-background-color:rgb(200, 202, 210) !default;
155
+ $uv-number-keyboard-uv-hover-class-background-color: #BBBCC6 !default;
156
+
157
+ .uv-keyboard {
158
+ @include flex;
159
+ flex-direction: row;
160
+ justify-content: space-around;
161
+ background-color: $uv-number-keyboard-background-color;
162
+ flex-wrap: wrap;
163
+ padding: $uv-number-keyboard-padding;
164
+
165
+ &__button-wrapper {
166
+ box-shadow: $uv-number-keyboard-button-box-shadow;
167
+ margin: $uv-number-keyboard-button-margin;
168
+ border-top-left-radius: $uv-number-keyboard-button-border-top-left-radius;
169
+ border-top-right-radius: $uv-number-keyboard-button-border-top-right-radius;
170
+ border-bottom-left-radius: $uv-number-keyboard-button-border-bottom-left-radius;
171
+ border-bottom-right-radius: $uv-number-keyboard-button-border-bottom-right-radius;
172
+
173
+ &__button {
174
+ width: $uv-number-keyboard-button-width;
175
+ height: $uv-number-keyboard-button-height;
176
+ background-color: $uv-number-keyboard-button-background-color;
177
+ @include flex;
178
+ justify-content: center;
179
+ align-items: center;
180
+ border-top-left-radius: $uv-number-keyboard-button-border-top-left-radius;
181
+ border-top-right-radius: $uv-number-keyboard-button-border-top-right-radius;
182
+ border-bottom-left-radius: $uv-number-keyboard-button-border-bottom-left-radius;
183
+ border-bottom-right-radius: $uv-number-keyboard-button-border-bottom-right-radius;
184
+
185
+ &__text {
186
+ font-size: $uv-number-keyboard-text-font-size;
187
+ font-weight: $uv-number-keyboard-text-font-weight;
188
+ color: $uv-number-keyboard-text-color;
189
+ }
190
+
191
+ &--gray {
192
+ background-color: $uv-number-keyboard-gray-background-color;
193
+ }
194
+ }
195
+ }
196
+ }
197
+
198
+ .uv-hover-class {
199
+ background-color: $uv-number-keyboard-uv-hover-class-background-color;
200
+ }
201
+ </style>
@@ -0,0 +1,34 @@
1
+ export default {
2
+ props: {
3
+ color: {
4
+ type: String,
5
+ default: '#d6d7d9'
6
+ },
7
+ // 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等
8
+ length: {
9
+ type: [String, Number],
10
+ default: '100%'
11
+ },
12
+ // 线条方向,col-竖向,row-横向
13
+ direction: {
14
+ type: String,
15
+ default: 'row'
16
+ },
17
+ // 是否显示细边框
18
+ hairline: {
19
+ type: Boolean,
20
+ default: true
21
+ },
22
+ // 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px"
23
+ margin: {
24
+ type: [String, Number],
25
+ default: 0
26
+ },
27
+ // 是否虚线,true-虚线,false-实线
28
+ dashed: {
29
+ type: Boolean,
30
+ default: false
31
+ },
32
+ ...uni.$uv?.props?.line
33
+ }
34
+ }
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <view
3
+ class="uv-line"
4
+ :style="[lineStyle]"
5
+ >
6
+ </view>
7
+ </template>
8
+
9
+ <script>
10
+ import mpMixin from '../../libs/mixin/mpMixin.js'
11
+ import mixin from '../../libs/mixin/mixin.js'
12
+ import props from './props.js';
13
+ /**
14
+ * line 线条
15
+ * @description 此组件一般用于显示一根线条,用于分隔内容块,有横向和竖向两种模式,且能设置0.5px线条,使用也很简单
16
+ * @tutorial https://www.uvui.cn/components/line.html
17
+ * @property {String} color 线条的颜色 ( 默认 '#d6d7d9' )
18
+ * @property {String | Number} length 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等 ( 默认 '100%' )
19
+ * @property {String} direction 线条的方向,row-横向,col-竖向 (默认 'row' )
20
+ * @property {Boolean} hairline 是否显示细线条 (默认 true )
21
+ * @property {String | Number} margin 线条与上下左右元素的间距,字符串形式,如"30px" (默认 0 )
22
+ * @property {Boolean} dashed 是否虚线,true-虚线,false-实线 (默认 false )
23
+ * @property {Object} customStyle 定义需要用到的外部样式
24
+ * @example <uv-line color="red"></uv-line>
25
+ */
26
+ export default {
27
+ name: 'uv-line',
28
+ mixins: [mpMixin, mixin, props],
29
+ computed: {
30
+ lineStyle() {
31
+ const style = {}
32
+ style.margin = this.margin
33
+ // 如果是水平线条,边框高度为1px,再通过transform缩小一半,就是0.5px了
34
+ if (this.direction === 'row') {
35
+ // 此处采用兼容分开写,兼容nvue的写法
36
+ style.borderBottomWidth = '1px'
37
+ style.borderBottomStyle = this.dashed ? 'dashed' : 'solid'
38
+ style.width = this.$uv.addUnit(this.length)
39
+ if (this.hairline) style.transform = 'scaleY(0.5)'
40
+ } else {
41
+ // 如果是竖向线条,边框宽度为1px,再通过transform缩小一半,就是0.5px了
42
+ style.borderLeftWidth = '1px'
43
+ style.borderLeftStyle = this.dashed ? 'dashed' : 'solid'
44
+ style.height = this.$uv.addUnit(this.length)
45
+ if (this.hairline) style.transform = 'scaleX(0.5)'
46
+ }
47
+ style.borderColor = this.color
48
+ return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle))
49
+ }
50
+ }
51
+ }
52
+ </script>
53
+
54
+ <style lang="scss" scoped>
55
+ .uv-line {
56
+ /* #ifndef APP-NVUE */
57
+ vertical-align: middle;
58
+ /* #endif */
59
+ }
60
+ </style>
@@ -0,0 +1,29 @@
1
+ export default {
2
+ props: {
3
+ // 激活部分的颜色
4
+ activeColor: {
5
+ type: String,
6
+ default: '#19be6b'
7
+ },
8
+ inactiveColor: {
9
+ type: String,
10
+ default: '#ececec'
11
+ },
12
+ // 进度百分比,数值
13
+ percentage: {
14
+ type: [String, Number],
15
+ default: 0
16
+ },
17
+ // 是否在进度条内部显示百分比的值
18
+ showText: {
19
+ type: Boolean,
20
+ default: true
21
+ },
22
+ // 进度条的高度,单位px
23
+ height: {
24
+ type: [String, Number],
25
+ default: 12
26
+ },
27
+ ...uni.$uv?.props?.lineProgress
28
+ }
29
+ }