@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,535 @@
1
+ <template>
2
+ <!-- #ifdef APP-NVUE -->
3
+ <cell :keep-scroll-position="keepScrollPosition">
4
+ <!-- #endif -->
5
+ <view
6
+ :class="{ 'uv-list-item--disabled': disabled }"
7
+ :style="[$uv.addStyle(customStyle),{'background-color':customStyle.backgroundColor?customStyle.backgroundColor:'#fff'}]"
8
+ :hover-class="(!clickable && !link) || disabled || showSwitch ? '' : 'uv-list-item--hover'"
9
+ class="uv-list-item" @click="onClick">
10
+ <view v-if="!isFirstChild" class="border--left" :class="{ 'uv-list--border': border }"></view>
11
+ <view class="uv-list-item__wrapper">
12
+ <slot>
13
+ <view class="uv-list-item__container"
14
+ :class="{ 'container--right': showArrow || link, 'flex--direction': directionData === 'column'}"
15
+ :style="{paddingTop:padding.top,paddingLeft:padding.left,paddingRight:padding.right,paddingBottom:padding.bottom}">
16
+ <slot name="header">
17
+ <view class="uv-list-item__header">
18
+ <view v-if="thumb" class="uv-list-item__icon">
19
+ <image :src="thumb" class="uv-list-item__icon-img" :class="['uv-list--' + thumbSize]" />
20
+ </view>
21
+ <view v-else-if="showExtraIcon" class="uv-list-item__icon">
22
+ <uv-icon :name="extraIcon.icon" :customPrefix="extraIcon.customPrefix" :color="extraIcon.color" :size="extraIcon.size" />
23
+ </view>
24
+ </view>
25
+ </slot>
26
+ <slot name="body">
27
+ <view class="uv-list-item__content"
28
+ :class="{ 'uv-list-item__content--center': thumb || showExtraIcon || showBadge || showSwitch }">
29
+ <text v-if="title" class="uv-list-item__content-title"
30
+ :class="[ellipsis && `uv-line-${ellipsis}`]">{{ title }}</text>
31
+ <text v-if="note" class="uv-list-item__content-note">{{ note }}</text>
32
+ </view>
33
+ </slot>
34
+ <slot name="footer">
35
+ <view v-if="rightText || showBadge || showSwitch" class="uv-list-item__extra"
36
+ :class="{ 'flex--justify': directionData === 'column' }">
37
+ <text v-if="rightText" class="uv-list-item__extra-text">{{ rightText }}</text>
38
+ <uv-badge
39
+ v-if="showBadge"
40
+ :show="!!(badge.show || badge.isDot || badge.value)"
41
+ :isDot="badge.isDot"
42
+ :value="badge.value"
43
+ :max="badge.max"
44
+ :type="badge.type"
45
+ :showZero="badge.showZero"
46
+ :bgColor="badge.bgColor"
47
+ :color="badge.color"
48
+ :shape="badge.shape"
49
+ :numberType="badge.numberType"
50
+ :inverted="badge.inverted"
51
+ customStyle="margin-left: 4px;"
52
+ ></uv-badge>
53
+ <uv-switch v-if="showSwitch" :value="switchChecked" :disabled="disabled" @change="onSwitchChange"></uv-switch>
54
+ </view>
55
+ </slot>
56
+ </view>
57
+ </slot>
58
+ </view>
59
+ <uv-icon v-if="showArrow || link" size="34rpx" class="uv-icon-wrapper" color="#bbb" name="arrow-right" />
60
+ </view>
61
+ <!-- #ifdef APP-NVUE -->
62
+ </cell>
63
+ <!-- #endif -->
64
+ </template>
65
+
66
+ <script>
67
+ import mpMixin from '../../libs/mixin/mpMixin.js'
68
+ import mixin from '../../libs/mixin/mixin.js'
69
+ /**
70
+ * ListItem 列表子组件
71
+ * @description 列表子组件
72
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=24
73
+ * @property {String} title 标题
74
+ * @property {String} note 描述
75
+ * @property {String} thumb 左侧缩略图,若thumb有值,则不会显示扩展图标
76
+ * @property {String} thumbSize = [lg|base|sm] 略缩图大小
77
+ * @value lg 大图
78
+ * @value base 一般
79
+ * @value sm 小图
80
+ * @property {String} rightText 右侧文字内容
81
+ * @property {Boolean} disabled = [true|false] 是否禁用
82
+ * @property {Boolean} clickable = [true|false] 是否开启点击反馈
83
+ * @property {String} link = [navigateTo|redirectTo|reLaunch|switchTab] 是否展示右侧箭头并开启点击反馈
84
+ * @value navigateTo 同 uni.navigateTo()
85
+ * @value redirectTo 同 uni.redirectTo()
86
+ * @value reLaunch 同 uni.reLaunch()
87
+ * @value switchTab 同 uni.switchTab()
88
+ * @property {String | PageURIString} to 跳转目标页面
89
+ * @property {Boolean} showBadge = [true|false] 是否显示数字角标
90
+ * @property {Object} badge 扩展数字角标的参数,格式为 :badge="{value: 122}"
91
+ * @property {Boolean} showSwitch = [true|false] 是否显示Switch
92
+ * @property {Boolean} switchChecked = [true|false] Switch是否被选中
93
+ * @property {Boolean} showExtraIcon = [true|false] 左侧是否显示扩展图标
94
+ * @property {Object} extraIcon 扩展图标参数,格式为 :extraIcon="{icon: 'photo',size: '30px'}"
95
+ * @property {String} direction = [row|column] 排版方向
96
+ * @value row 水平排列
97
+ * @value column 垂直排列
98
+ * @event {Function} click 点击 uniListItem 触发事件
99
+ * @event {Function} switchChange 点击切换 Switch 时触发
100
+ */
101
+ export default {
102
+ name: 'uv-list-item',
103
+ mixins: [mpMixin, mixin],
104
+ emits: ['click', 'switchChange'],
105
+ props: {
106
+ direction: {
107
+ type: String,
108
+ default: 'row'
109
+ },
110
+ title: {
111
+ type: String,
112
+ default: ''
113
+ },
114
+ note: {
115
+ type: String,
116
+ default: ''
117
+ },
118
+ ellipsis: {
119
+ type: [Number, String],
120
+ default: 0
121
+ },
122
+ disabled: {
123
+ type: [Boolean, String],
124
+ default: false
125
+ },
126
+ clickable: {
127
+ type: Boolean,
128
+ default: false
129
+ },
130
+ showArrow: {
131
+ type: [Boolean, String],
132
+ default: false
133
+ },
134
+ link: {
135
+ type: [Boolean, String],
136
+ default: false
137
+ },
138
+ to: {
139
+ type: String,
140
+ default: ''
141
+ },
142
+ showSwitch: {
143
+ type: [Boolean, String],
144
+ default: false
145
+ },
146
+ switchChecked: {
147
+ type: [Boolean, String],
148
+ default: false
149
+ },
150
+ showBadge: {
151
+ type: [Boolean, String],
152
+ default: false
153
+ },
154
+ badge: {
155
+ type: Object,
156
+ default () {
157
+ return {}
158
+ }
159
+ },
160
+ rightText: {
161
+ type: String,
162
+ default: ''
163
+ },
164
+ thumb: {
165
+ type: String,
166
+ default: ''
167
+ },
168
+ thumbSize: {
169
+ type: String,
170
+ default: 'base'
171
+ },
172
+ showExtraIcon: {
173
+ type: [Boolean, String],
174
+ default: false
175
+ },
176
+ extraIcon: {
177
+ type: Object,
178
+ default () {
179
+ return {
180
+ name: '',
181
+ color: '#000000',
182
+ size: 20,
183
+ customPrefix: ''
184
+ };
185
+ }
186
+ },
187
+ border: {
188
+ type: Boolean,
189
+ default: false
190
+ },
191
+ customStyle: {
192
+ type: Object,
193
+ default () {
194
+ return {
195
+ padding: '',
196
+ backgroundColor: '#FFFFFF'
197
+ }
198
+ }
199
+ },
200
+ keepScrollPosition: {
201
+ type: Boolean,
202
+ default: false
203
+ }
204
+ },
205
+ computed: {
206
+ directionData(){
207
+ return this.direction ? this.direction : (this.parentData.direction ? this.parentData.direction : 'row');
208
+ }
209
+ },
210
+ watch: {
211
+ 'customStyle.padding': {
212
+ handler(padding) {
213
+ if(padding) this.setPadding(padding);
214
+ },
215
+ immediate: true
216
+ }
217
+ },
218
+ data() {
219
+ return {
220
+ isFirstChild: false,
221
+ padding: {
222
+ top: "",
223
+ right: "",
224
+ bottom: "",
225
+ left: ""
226
+ },
227
+ parentData: {
228
+ direction: 'row',
229
+ padding: 0
230
+ }
231
+ };
232
+ },
233
+ created() {
234
+ this.updateParentData();
235
+ },
236
+ mounted() {
237
+ this.init();
238
+ this.list = this.getForm()
239
+ // 判断是否存在 uv-list 组件
240
+ if (this.list) {
241
+ if (!this.list.firstChildAppend) {
242
+ this.list.firstChildAppend = true;
243
+ this.isFirstChild = true;
244
+ }
245
+ }
246
+ },
247
+ methods: {
248
+ init(){
249
+ if (!this.parent) {
250
+ this.$uv.error('uv-list-item必须搭配uv-list组件使用');
251
+ }
252
+ this.$nextTick(()=>{
253
+ if(!(this.padding.top || this.padding.right|| this.padding.bottom|| this.padding.left)){
254
+ this.setPadding(this.parentData.padding);
255
+ }
256
+ })
257
+ },
258
+ updateParentData() {
259
+ this.getParentData('uv-list');
260
+ },
261
+ setPadding(padding){
262
+ if(typeof padding == 'number'){
263
+ padding += ''
264
+ }
265
+ let paddingArr = padding.split(' ')
266
+ if (paddingArr.length === 1) {
267
+ const allPadding = paddingArr[0]
268
+ this.padding = {
269
+ "top": allPadding,
270
+ "right": allPadding,
271
+ "bottom": allPadding,
272
+ "left": allPadding
273
+ }
274
+ } else if (paddingArr.length === 2) {
275
+ const [verticalPadding, horizontalPadding] = paddingArr;
276
+ this.padding = {
277
+ "top": verticalPadding,
278
+ "right": horizontalPadding,
279
+ "bottom": verticalPadding,
280
+ "left": horizontalPadding
281
+ }
282
+ } else if (paddingArr.length === 4) {
283
+ const [topPadding, rightPadding, bottomPadding, leftPadding] = paddingArr;
284
+ this.padding = {
285
+ "top": topPadding,
286
+ "right": rightPadding,
287
+ "bottom": bottomPadding,
288
+ "left": leftPadding
289
+ }
290
+ }
291
+ },
292
+ /**
293
+ * 获取父元素实例
294
+ */
295
+ getForm(name = 'uniList') {
296
+ let parent = this.$parent;
297
+ let parentName = parent.$options.name;
298
+ while (parentName !== name) {
299
+ parent = parent.$parent;
300
+ if (!parent) return false
301
+ parentName = parent.$options.name;
302
+ }
303
+ return parent;
304
+ },
305
+ onClick() {
306
+ if (this.to !== '') {
307
+ this.openPage();
308
+ return;
309
+ }
310
+ if (this.clickable || this.link) {
311
+ this.$emit('click', {
312
+ data: {}
313
+ });
314
+ }
315
+ },
316
+ onSwitchChange(e) {
317
+ this.$emit('switchChange', e);
318
+ },
319
+ openPage() {
320
+ if (['navigateTo', 'redirectTo', 'reLaunch', 'switchTab'].indexOf(this.link) !== -1) {
321
+ this.pageApi(this.link);
322
+ } else {
323
+ this.pageApi('navigateTo');
324
+ }
325
+ },
326
+ pageApi(api) {
327
+ let callback = {
328
+ url: this.to,
329
+ success: res => {
330
+ this.$emit('click', {
331
+ data: res
332
+ });
333
+ },
334
+ fail: err => {
335
+ this.$emit('click', {
336
+ data: err
337
+ });
338
+ }
339
+ }
340
+ switch (api) {
341
+ case 'navigateTo':
342
+ uni.navigateTo(callback)
343
+ break
344
+ case 'redirectTo':
345
+ uni.redirectTo(callback)
346
+ break
347
+ case 'reLaunch':
348
+ uni.reLaunch(callback)
349
+ break
350
+ case 'switchTab':
351
+ uni.switchTab(callback)
352
+ break
353
+ default:
354
+ uni.navigateTo(callback)
355
+ }
356
+ }
357
+ }
358
+ };
359
+ </script>
360
+
361
+ <style lang="scss" scoped>
362
+ $show-lines: 1;
363
+ @import '../../libs/css/variable.scss';
364
+ @import '../../libs/css/components.scss';
365
+ $uv-font-size-sm:12px;
366
+ $uv-font-size-base:14px;
367
+ $uv-font-size-lg:16px;
368
+ $uv-spacing-col-lg: 12px;
369
+ $uv-spacing-row-lg: 15px;
370
+ $uv-img-size-sm:20px;
371
+ $uv-img-size-base:26px;
372
+ $uv-img-size-lg:40px;
373
+ $uv-border-color:#e5e5e5;
374
+ $uv-bg-color-hover:#f1f1f1;
375
+ $uv-text-color-grey:#999;
376
+ $list-item-pd: $uv-spacing-col-lg $uv-spacing-row-lg;
377
+
378
+ .uv-list-item {
379
+ @include flex(row);
380
+ font-size: $uv-font-size-lg;
381
+ position: relative;
382
+ justify-content: space-between;
383
+ align-items: center;
384
+ background-color: #fff;
385
+ /* #ifdef H5 */
386
+ cursor: pointer;
387
+ /* #endif */
388
+ }
389
+
390
+ .uv-list-item--disabled {
391
+ opacity: 0.3;
392
+ }
393
+
394
+ .uv-list-item--hover {
395
+ background-color: $uv-bg-color-hover !important;
396
+ }
397
+
398
+ .uv-list-item__wrapper {
399
+ @include flex(column);
400
+ flex: 1;
401
+ }
402
+
403
+ .uv-list-item__container {
404
+ position: relative;
405
+ @include flex(row);
406
+ padding: $list-item-pd;
407
+ padding-left: $uv-spacing-row-lg;
408
+ flex: 1;
409
+ overflow: hidden;
410
+ }
411
+
412
+ .container--right {
413
+ padding-right: 0;
414
+ }
415
+
416
+ .uv-list--border {
417
+ position: absolute;
418
+ top: 0;
419
+ right: 0;
420
+ left: 0;
421
+ /* #ifdef APP-NVUE */
422
+ border-top-color: $uv-border-color;
423
+ border-top-style: solid;
424
+ border-top-width: 0.5px;
425
+ /* #endif */
426
+ }
427
+
428
+ /* #ifndef APP-NVUE */
429
+ .uv-list--border:after {
430
+ position: absolute;
431
+ top: 0;
432
+ right: 0;
433
+ left: 0;
434
+ height: 1px;
435
+ content: '';
436
+ -webkit-transform: scaleY(0.5);
437
+ transform: scaleY(0.5);
438
+ background-color: $uv-border-color;
439
+ }
440
+
441
+ /* #endif */
442
+ .uv-list-item__content {
443
+ @include flex(column);
444
+ padding-right: 8px;
445
+ flex: 1;
446
+ color: #3b4144;
447
+ justify-content: space-between;
448
+ overflow: hidden;
449
+ }
450
+
451
+ .uv-list-item__content--center {
452
+ justify-content: center;
453
+ }
454
+
455
+ .uv-list-item__content-title {
456
+ font-size: $uv-font-size-base;
457
+ color: #3b4144;
458
+ overflow: hidden;
459
+ }
460
+
461
+ .uv-list-item__content-note {
462
+ margin-top: 6rpx;
463
+ color: $uv-text-color-grey;
464
+ font-size: $uv-font-size-sm;
465
+ overflow: hidden;
466
+ }
467
+
468
+ .uv-list-item__extra {
469
+ @include flex(row);
470
+ justify-content: flex-end;
471
+ align-items: center;
472
+ }
473
+
474
+ .uv-list-item__header {
475
+ @include flex(row);
476
+ align-items: center;
477
+ }
478
+
479
+ .uv-list-item__icon {
480
+ margin-right: 18rpx;
481
+ flex-direction: row;
482
+ justify-content: center;
483
+ align-items: center;
484
+ }
485
+
486
+ .uv-list-item__icon-img {
487
+ /* #ifndef APP-NVUE */
488
+ display: block;
489
+ /* #endif */
490
+ height: $uv-img-size-base;
491
+ width: $uv-img-size-base;
492
+ margin-right: 10px;
493
+ }
494
+
495
+ .uv-icon-wrapper {
496
+ /* #ifndef APP-NVUE */
497
+ display: flex;
498
+ /* #endif */
499
+ align-items: center;
500
+ padding: 0 10px;
501
+ }
502
+
503
+ .flex--direction {
504
+ flex-direction: column;
505
+ /* #ifndef APP-NVUE */
506
+ align-items: initial;
507
+ /* #endif */
508
+ }
509
+
510
+ .flex--justify {
511
+ /* #ifndef APP-NVUE */
512
+ justify-content: initial;
513
+ /* #endif */
514
+ }
515
+
516
+ .uv-list--lg {
517
+ height: $uv-img-size-lg;
518
+ width: $uv-img-size-lg;
519
+ }
520
+
521
+ .uv-list--base {
522
+ height: $uv-img-size-base;
523
+ width: $uv-img-size-base;
524
+ }
525
+
526
+ .uv-list--sm {
527
+ height: $uv-img-size-sm;
528
+ width: $uv-img-size-sm;
529
+ }
530
+
531
+ .uv-list-item__extra-text {
532
+ color: $uv-text-color-grey;
533
+ font-size: $uv-font-size-sm;
534
+ }
535
+ </style>
@@ -0,0 +1,95 @@
1
+ export default {
2
+ props: {
3
+ // 组件状态,loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
4
+ status: {
5
+ type: String,
6
+ default: 'loadmore'
7
+ },
8
+ // 组件背景色
9
+ bgColor: {
10
+ type: String,
11
+ default: 'transparent'
12
+ },
13
+ // 是否显示加载中的图标
14
+ icon: {
15
+ type: Boolean,
16
+ default: true
17
+ },
18
+ // 字体大小
19
+ fontSize: {
20
+ type: [String, Number],
21
+ default: 14
22
+ },
23
+ // 图标大小
24
+ iconSize: {
25
+ type: [String, Number],
26
+ default: 16
27
+ },
28
+ // 字体颜色
29
+ color: {
30
+ type: String,
31
+ default: '#606266'
32
+ },
33
+ // 加载中状态的图标,spinner-花朵状图标,circle-圆圈状,semicircle-半圆
34
+ loadingIcon: {
35
+ type: String,
36
+ default: 'spinner'
37
+ },
38
+ // 加载前的提示语
39
+ loadmoreText: {
40
+ type: String,
41
+ default: '加载更多'
42
+ },
43
+ // 加载中提示语
44
+ loadingText: {
45
+ type: String,
46
+ default: '正在加载...'
47
+ },
48
+ // 没有更多的提示语
49
+ nomoreText: {
50
+ type: String,
51
+ default: '没有更多了'
52
+ },
53
+ // 在“没有更多”状态下,是否显示粗点
54
+ isDot: {
55
+ type: Boolean,
56
+ default: false
57
+ },
58
+ // 加载中图标的颜色
59
+ iconColor: {
60
+ type: String,
61
+ default: '#b7b7b7'
62
+ },
63
+ // 上边距
64
+ marginTop: {
65
+ type: [String, Number],
66
+ default: 10
67
+ },
68
+ // 下边距
69
+ marginBottom: {
70
+ type: [String, Number],
71
+ default: 10
72
+ },
73
+ // 高度,单位px
74
+ height: {
75
+ type: [String, Number],
76
+ default: 'auto'
77
+ },
78
+ // 是否显示左边分割线
79
+ line: {
80
+ type: Boolean,
81
+ default: false
82
+ },
83
+ // 线条颜色
84
+ lineColor: {
85
+ type: String,
86
+ default: '#E6E8EB'
87
+ },
88
+ // 是否虚线,true-虚线,false-实线
89
+ dashed: {
90
+ type: Boolean,
91
+ default: false
92
+ },
93
+ ...uni.$uv?.props?.loadmore
94
+ }
95
+ }