@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,54 @@
1
+ <template>
2
+ <view
3
+ :style="[style]"
4
+ class="uv-status-bar"
5
+ >
6
+ <slot />
7
+ </view>
8
+ </template>
9
+
10
+ <script>
11
+ import mpMixin from '../../libs/mixin/mpMixin.js'
12
+ import mixin from '../../libs/mixin/mixin.js'
13
+ import props from './props.js';
14
+ /**
15
+ * StatbusBar 状态栏占位
16
+ * @description 本组件主要用于状态填充,比如在自定导航栏的时候,它会自动适配一个恰当的状态栏高度。
17
+ * @tutorial https://www.uvui.cn/components/statusBar.html
18
+ * @property {String} bgColor 背景色 (默认 'transparent' )
19
+ * @property {String | Object} customStyle 自定义样式
20
+ * @example <uv-status-bar></uv-status-bar>
21
+ */
22
+ export default {
23
+ name: 'uv-status-bar',
24
+ mixins: [mpMixin, mixin, props],
25
+ data() {
26
+ return {
27
+ }
28
+ },
29
+ computed: {
30
+ style() {
31
+ const style = {}
32
+ // 状态栏高度,由于某些安卓和微信开发工具无法识别css的顶部状态栏变量,所以使用js获取的方式
33
+ style.height = this.$uv.addUnit(this.$uv.sys().statusBarHeight, 'px')
34
+ if(this.bgColor){
35
+ if (this.bgColor.indexOf("gradient") > -1) {// 渐变色
36
+ style.backgroundImage = this.bgColor;
37
+ }else{
38
+ style.background = this.bgColor;
39
+ }
40
+ }
41
+ return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle))
42
+ }
43
+ },
44
+ }
45
+ </script>
46
+
47
+ <style lang="scss" scoped>
48
+ .uv-status-bar {
49
+ // nvue会默认100%,如果nvue下,显式写100%的话,会导致宽度不为100%而异常
50
+ /* #ifndef APP-NVUE */
51
+ width: 100%;
52
+ /* #endif */
53
+ }
54
+ </style>
@@ -0,0 +1,40 @@
1
+ export default {
2
+ props: {
3
+ // 排列方向
4
+ direction: {
5
+ type: String,
6
+ default: 'row'
7
+ },
8
+ // 设置第几个步骤
9
+ current: {
10
+ type: [String, Number],
11
+ default: 0
12
+ },
13
+ // 激活状态颜色
14
+ activeColor: {
15
+ type: String,
16
+ default: '#3c9cff'
17
+ },
18
+ // 未激活状态颜色
19
+ inactiveColor: {
20
+ type: String,
21
+ default: '#969799'
22
+ },
23
+ // 激活状态的图标
24
+ activeIcon: {
25
+ type: String,
26
+ default: ''
27
+ },
28
+ // 未激活状态图标
29
+ inactiveIcon: {
30
+ type: String,
31
+ default: ''
32
+ },
33
+ // 是否显示点类型
34
+ dot: {
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ ...uni.$uv?.props?.steps
39
+ }
40
+ }
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <view
3
+ :class="['uv-steps',`uv-steps--${direction}`]"
4
+ :style="[$uv.addStyle(customStyle)]"
5
+ >
6
+ <slot></slot>
7
+ </view>
8
+ </template>
9
+
10
+ <script>
11
+ import { func } from '../../libs/function/test.js'
12
+ import mpMixin from '../../libs/mixin/mpMixin.js'
13
+ import mixin from '../../libs/mixin/mixin.js'
14
+ import props from './props.js';
15
+ /**
16
+ * Steps 步骤条
17
+ * @description 该组件一般用于完成一个任务要分几个步骤,标识目前处于第几步的场景。
18
+ * @tutorial https://www.uvui.cn/components/steps.html
19
+ * @property {String} direction row-横向,column-竖向 (默认 'row' )
20
+ * @property {String | Number} current 设置当前处于第几步 (默认 0 )
21
+ * @property {String} activeColor 激活状态颜色 (默认 '#3c9cff' )
22
+ * @property {String} inactiveColor 未激活状态颜色 (默认 '#969799' )
23
+ * @property {String} activeIcon 激活状态的图标
24
+ * @property {String} inactiveIcon 未激活状态图标
25
+ * @property {Boolean} dot 是否显示点类型 (默认 false )
26
+ * @example <uv-steps current="0"><uv-steps-item title="已出库" desc="10:35" ></uv-steps-item></uv-steps>
27
+ */
28
+ export default {
29
+ name: 'uv-steps',
30
+ mixins: [mpMixin, mixin, props],
31
+ data() {
32
+ return {
33
+ }
34
+ },
35
+ watch: {
36
+ children() {
37
+ this.updateChildData()
38
+ },
39
+ parentData() {
40
+ this.updateChildData()
41
+ }
42
+ },
43
+ computed: {
44
+ // 监听参数的变化,通过watch中,手动去更新子组件的数据,否则子组件不会自动变化
45
+ parentData() {
46
+ return [this.current, this.direction, this.activeColor, this.inactiveColor, this.activeIcon, this.inactiveIcon, this.dot]
47
+ }
48
+ },
49
+ methods: {
50
+ // 更新子组件的数据
51
+ updateChildData() {
52
+ this.children.map(child => {
53
+ // 先判断子组件是否存在对应的方法
54
+ func((child || {}).updateFromParent()) && child.updateFromParent()
55
+ })
56
+ },
57
+ // 接受子组件的通知,去修改其他子组件的数据
58
+ updateFromChild() {
59
+ this.updateChildData()
60
+ }
61
+ },
62
+ created() {
63
+ this.children = []
64
+ }
65
+ }
66
+ </script>
67
+
68
+ <style lang="scss" scoped>
69
+ @import '../../libs/css/components.scss';
70
+
71
+ .uv-steps {
72
+ @include flex;
73
+
74
+ &--column {
75
+ flex-direction: column
76
+ }
77
+
78
+ &--row {
79
+ flex-direction: row;
80
+ flex: 1;
81
+ }
82
+ }
83
+ </style>
@@ -0,0 +1,25 @@
1
+ export default {
2
+ props: {
3
+ // 标题
4
+ title: {
5
+ type: [String, Number],
6
+ default: ''
7
+ },
8
+ // 描述文本
9
+ desc: {
10
+ type: [String, Number],
11
+ default: ''
12
+ },
13
+ // 图标大小
14
+ iconSize: {
15
+ type: [String, Number],
16
+ default: 17
17
+ },
18
+ // 当前步骤是否处于失败状态
19
+ error: {
20
+ type: Boolean,
21
+ default: false
22
+ },
23
+ ...uni.$uv?.props?.stepsItem
24
+ }
25
+ }
@@ -0,0 +1,347 @@
1
+ <template>
2
+ <view
3
+ class="uv-steps-item"
4
+ ref="uv-steps-item"
5
+ :class="[`uv-steps-item--${parentData.direction}`]"
6
+ :style="[$uv.addStyle(customStyle)]"
7
+ >
8
+ <view
9
+ class="uv-steps-item__line"
10
+ v-if="index + 1 < childLength"
11
+ :class="[`uv-steps-item__line--${parentData.direction}`]"
12
+ :style="[lineStyle]">
13
+ </view>
14
+ <view
15
+ :class="[
16
+ 'uv-steps-item__wrapper',
17
+ `uv-steps-item__wrapper--${parentData.direction}`,
18
+ parentData.dot && `uv-steps-item__wrapper--${parentData.direction}--dot`
19
+ ]">
20
+ <slot name="icon">
21
+ <view
22
+ class="uv-steps-item__wrapper__dot"
23
+ v-if="parentData.dot"
24
+ :style="{
25
+ backgroundColor: statusColor
26
+ }">
27
+ </view>
28
+ <view
29
+ class="uv-steps-item__wrapper__icon"
30
+ v-else-if="parentData.activeIcon || parentData.inactiveIcon">
31
+ <uv-icon
32
+ :name="index <= parentData.current ? parentData.activeIcon : parentData.inactiveIcon"
33
+ :size="iconSize"
34
+ :color="index <= parentData.current ? parentData.activeColor : parentData.inactiveColor">
35
+ </uv-icon>
36
+ </view>
37
+ <view
38
+ v-else
39
+ :style="{
40
+ backgroundColor: statusClass === 'process' ? parentData.activeColor : 'transparent',
41
+ borderColor: statusColor
42
+ }"
43
+ class="uv-steps-item__wrapper__circle">
44
+ <text
45
+ v-if="statusClass === 'process' || statusClass === 'wait'"
46
+ class="uv-steps-item__wrapper__circle__text"
47
+ :style="{
48
+ color: index == parentData.current ? '#ffffff' : parentData.inactiveColor
49
+ }">{{ index + 1}}</text>
50
+ <uv-icon
51
+ v-else
52
+ :color="statusClass === 'error' ? 'error' : parentData.activeColor"
53
+ size="12"
54
+ :name="statusClass === 'error' ? 'close' : 'checkmark'">
55
+ </uv-icon>
56
+ </view>
57
+ </slot>
58
+ </view>
59
+ <view
60
+ :class="[
61
+ 'uv-steps-item__content',
62
+ `uv-steps-item__content--${parentData.direction}`
63
+ ]"
64
+ :style="[contentStyle]"
65
+ >
66
+ <slot name="title">
67
+ <uv-text
68
+ :text="title"
69
+ :type="parentData.current == index ? 'main' : 'content'"
70
+ lineHeight="20px"
71
+ :size="parentData.current == index ? 14 : 13"
72
+ ></uv-text>
73
+ </slot>
74
+ <slot name="desc">
75
+ <uv-text
76
+ :text="desc"
77
+ type="tips"
78
+ size="12"
79
+ ></uv-text>
80
+ </slot>
81
+ </view>
82
+ </view>
83
+ </template>
84
+
85
+ <script>
86
+ import mpMixin from '../../libs/mixin/mpMixin.js'
87
+ import mixin from '../../libs/mixin/mixin.js'
88
+ import props from './props.js';
89
+ // #ifdef APP-NVUE
90
+ const dom = uni.requireNativePlugin('dom')
91
+ // #endif
92
+ /**
93
+ * StepsItem 步骤条的子组件
94
+ * @description 本组件需要和uv-steps配合使用
95
+ * @tutorial https://www.uvui.cn/components/steps.html
96
+ * @property {String} title 标题文字
97
+ * @property {String} current 描述文本
98
+ * @property {String | Number} iconSize 图标大小 (默认 17 )
99
+ * @property {Boolean} error 当前步骤是否处于失败状态 (默认 false )
100
+ * @example <uv-steps current="0"><uv-steps-item title="已出库" desc="10:35" ></uv-steps-item></uv-steps>
101
+ */
102
+ export default {
103
+ name: 'uv-steps-item',
104
+ mixins: [mpMixin, mixin, props],
105
+ data() {
106
+ return {
107
+ index: 0,
108
+ childLength: 0,
109
+ showLine: false,
110
+ size: {
111
+ height: 0,
112
+ width: 0
113
+ },
114
+ parentData: {
115
+ direction: 'row',
116
+ current: 0,
117
+ activeColor: '',
118
+ inactiveColor: '',
119
+ activeIcon: '',
120
+ inactiveIcon: '',
121
+ dot: false
122
+ }
123
+ }
124
+ },
125
+ watch: {
126
+ 'parentData'(newValue, oldValue) {}
127
+ },
128
+ created() {
129
+ this.init()
130
+ },
131
+ computed: {
132
+ lineStyle() {
133
+ const style = {}
134
+ if (this.parentData.direction === 'row') {
135
+ style.width = this.size.width + 'px'
136
+ style.left = this.size.width / 2 + 'px'
137
+ } else {
138
+ style.height = this.size.height + 'px'
139
+ }
140
+ style.backgroundColor = this.parent.children?.[this.index + 1]?.error ? '#f56c6c' : this.index < this.parentData.current ? this.parentData.activeColor : this.parentData.inactiveColor
141
+ return style
142
+ },
143
+ statusClass() {
144
+ const {
145
+ index,
146
+ error
147
+ } = this
148
+ const {
149
+ current
150
+ } = this.parentData
151
+ if (current == index) {
152
+ return error === true ? 'error' : 'process'
153
+ } else if (error) {
154
+ return 'error'
155
+ } else if (current > index) {
156
+ return 'finish'
157
+ } else {
158
+ return 'wait'
159
+ }
160
+ },
161
+ statusColor() {
162
+ let color = ''
163
+ switch (this.statusClass) {
164
+ case 'finish':
165
+ color = this.parentData.activeColor
166
+ break
167
+ case 'error':
168
+ color = '#f56c6c'
169
+ break
170
+ case 'process':
171
+ color = this.parentData.dot ? this.parentData.activeColor : 'transparent'
172
+ break
173
+ default:
174
+ color = this.parentData.inactiveColor
175
+ break
176
+ }
177
+ return color
178
+ },
179
+ contentStyle() {
180
+ const style = {}
181
+ if (this.parentData.direction === 'column') {
182
+ style.marginLeft = this.parentData.dot ? '2px' : '6px'
183
+ style.marginTop = this.parentData.dot ? '0px' : '6px'
184
+ } else {
185
+ style.marginTop = this.parentData.dot ? '2px' : '6px'
186
+ style.marginLeft = this.parentData.dot ? '2px' : '6px'
187
+ }
188
+ return style
189
+ }
190
+ },
191
+ mounted() {
192
+ this.parent && this.parent.updateFromChild()
193
+ this.$uv.sleep().then(() => {
194
+ this.getStepsItemRect()
195
+ })
196
+ },
197
+ methods: {
198
+ init() {
199
+ // 初始化数据
200
+ this.updateParentData()
201
+ if (!this.parent) {
202
+ return this.$uv.error('uv-steps-item必须要搭配uv-steps组件使用')
203
+ }
204
+ this.index = this.parent.children.indexOf(this)
205
+ this.childLength = this.parent.children.length
206
+ },
207
+ updateParentData() {
208
+ // 此方法在mixin中
209
+ this.getParentData('uv-steps')
210
+ },
211
+ // 父组件数据发生变化
212
+ updateFromParent() {
213
+ this.init()
214
+ },
215
+ // 获取组件的尺寸,用于设置横线的位置
216
+ getStepsItemRect() {
217
+ // #ifndef APP-NVUE
218
+ this.$uvGetRect('.uv-steps-item').then(size => {
219
+ this.size = size
220
+ })
221
+ // #endif
222
+ // #ifdef APP-NVUE
223
+ dom.getComponentRect(this.$refs['uv-steps-item'], res => {
224
+ const {
225
+ size
226
+ } = res
227
+ this.size = size
228
+ })
229
+ // #endif
230
+ }
231
+ }
232
+ }
233
+ </script>
234
+
235
+ <style lang="scss" scoped>
236
+ @import '../../libs/css/components.scss';
237
+ @import '../../libs/css/color.scss';
238
+ .uv-steps-item {
239
+ flex: 1;
240
+ @include flex;
241
+
242
+ &--row {
243
+ flex-direction: column;
244
+ align-items: center;
245
+ position: relative;
246
+ }
247
+
248
+ &--column {
249
+ position: relative;
250
+ flex-direction: row;
251
+ justify-content: flex-start;
252
+ padding-bottom: 5px;
253
+ }
254
+
255
+ &__wrapper {
256
+ @include flex;
257
+ justify-content: center;
258
+ align-items: center;
259
+ position: relative;
260
+ background-color: #fff;
261
+
262
+ &--column {
263
+ width: 20px;
264
+ height: 32px;
265
+
266
+ &--dot {
267
+ height: 20px;
268
+ width: 20px;
269
+ }
270
+ }
271
+
272
+ &--row {
273
+ width: 32px;
274
+ height: 20px;
275
+
276
+ &--dot {
277
+ width: 20px;
278
+ height: 20px;
279
+ }
280
+ }
281
+
282
+ &__circle {
283
+ width: 20px;
284
+ height: 20px;
285
+ /* #ifndef APP-NVUE */
286
+ box-sizing: border-box;
287
+ flex-shrink: 0;
288
+ /* #endif */
289
+ border-radius: 100px;
290
+ border-width: 1px;
291
+ border-color: $uv-tips-color;
292
+ border-style: solid;
293
+ @include flex(row);
294
+ align-items: center;
295
+ justify-content: center;
296
+ transition: background-color 0.3s;
297
+
298
+ &__text {
299
+ color: $uv-tips-color;
300
+ font-size: 11px;
301
+ @include flex(row);
302
+ align-items: center;
303
+ justify-content: center;
304
+ text-align: center;
305
+ line-height: 11px;
306
+ }
307
+ }
308
+
309
+ &__dot {
310
+ width: 10px;
311
+ height: 10px;
312
+ border-radius: 100px;
313
+ background-color: $uv-content-color;
314
+ }
315
+ }
316
+
317
+ &__content {
318
+ @include flex;
319
+ flex: 1;
320
+
321
+ &--row {
322
+ flex-direction: column;
323
+ align-items: center;
324
+ }
325
+
326
+ &--column {
327
+ flex-direction: column;
328
+ margin-left: 6px;
329
+ }
330
+ }
331
+
332
+ &__line {
333
+ position: absolute;
334
+ background: $uv-tips-color;
335
+
336
+ &--row {
337
+ top: 10px;
338
+ height: 1px;
339
+ }
340
+
341
+ &--column {
342
+ width: 1px;
343
+ left: 10px;
344
+ }
345
+ }
346
+ }
347
+ </style>
@@ -0,0 +1,41 @@
1
+ export default {
2
+ props: {
3
+ // 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px
4
+ offsetTop: {
5
+ type: [String, Number],
6
+ default: 0
7
+ },
8
+ // 自定义导航栏的高度
9
+ customNavHeight: {
10
+ type: [String, Number],
11
+ // #ifdef H5
12
+ // H5端的导航栏属于“自定义”导航栏的范畴,因为它是非原生的,与普通元素一致
13
+ default: 44,
14
+ // #endif
15
+ // #ifndef H5
16
+ default: 0
17
+ // #endif
18
+ },
19
+ // 是否禁用吸顶功能
20
+ disabled: {
21
+ type: Boolean,
22
+ default: false
23
+ },
24
+ // 吸顶区域的背景颜色
25
+ bgColor: {
26
+ type: String,
27
+ default: 'transparent'
28
+ },
29
+ // z-index值
30
+ zIndex: {
31
+ type: [String, Number],
32
+ default: ''
33
+ },
34
+ // 列表中的索引值
35
+ index: {
36
+ type: [String, Number],
37
+ default: ''
38
+ },
39
+ ...uni.$uv?.props?.sticky
40
+ }
41
+ }