@10yun/cv-mobile-ui 0.5.29 → 0.5.30

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 (260) hide show
  1. package/package.json +1 -1
  2. package/plugins/luch-request/adapters/index.js +131 -0
  3. package/plugins/luch-request/core/InterceptorManager.js +50 -0
  4. package/plugins/luch-request/core/Request.js +199 -0
  5. package/plugins/luch-request/core/buildFullPath.js +20 -0
  6. package/plugins/luch-request/core/defaults.js +32 -0
  7. package/plugins/luch-request/core/dispatchRequest.js +5 -0
  8. package/plugins/luch-request/core/mergeConfig.js +125 -0
  9. package/plugins/luch-request/core/settle.js +16 -0
  10. package/plugins/luch-request/helpers/buildURL.js +71 -0
  11. package/plugins/luch-request/helpers/combineURLs.js +12 -0
  12. package/plugins/luch-request/helpers/isAbsoluteURL.js +14 -0
  13. package/plugins/luch-request/index.d.ts +197 -0
  14. package/plugins/luch-request/index.js +2 -0
  15. package/plugins/luch-request/readme.md +3 -0
  16. package/plugins/luch-request/utils/clone.js +264 -0
  17. package/plugins/luch-request/utils.js +131 -0
  18. package/plugins/request.js +2 -2
  19. package/ui-cv/components/cv-form-item/cv-form-item.vue +1 -1
  20. package/ui-fireui/fui-actionsheet/fui-actionsheet.vue +202 -0
  21. package/ui-fireui/fui-alert/fui-alert.vue +141 -0
  22. package/ui-fireui/fui-badge/fui-badge.vue +158 -0
  23. package/ui-fireui/fui-bottom-navigation/fui-bottom-navigation.vue +390 -0
  24. package/ui-fireui/fui-bottom-popup/fui-bottom-popup.vue +100 -0
  25. package/ui-fireui/fui-bubble-popup/fui-bubble-popup.vue +236 -0
  26. package/ui-fireui/fui-button/fui-button.vue +424 -0
  27. package/ui-fireui/fui-calendar/fui-calendar.js +915 -0
  28. package/ui-fireui/fui-calendar/fui-calendar.vue +868 -0
  29. package/ui-fireui/fui-card/fui-card.vue +231 -0
  30. package/ui-fireui/fui-cascade-selection/fui-cascade-selection.vue +538 -0
  31. package/ui-fireui/fui-circular-progress/fui-circular-progress.vue +261 -0
  32. package/ui-fireui/fui-collapse/fui-collapse.vue +179 -0
  33. package/ui-fireui/fui-countdown/fui-countdown.vue +301 -0
  34. package/ui-fireui/fui-datetime/fui-datetime.vue +570 -0
  35. package/ui-fireui/fui-divider/fui-divider.vue +118 -0
  36. package/ui-fireui/fui-drawer/fui-drawer.vue +103 -0
  37. package/ui-fireui/fui-dropdown-list/fui-dropdown-list.vue +70 -0
  38. package/ui-fireui/fui-fab/fui-fab.vue +284 -0
  39. package/ui-fireui/fui-footer/fui-footer.vue +131 -0
  40. package/ui-fireui/fui-grid/fui-grid.vue +42 -0
  41. package/ui-fireui/fui-grid-item/fui-grid-item.vue +142 -0
  42. package/ui-fireui/fui-icon/fui-icon.vue +820 -0
  43. package/ui-fireui/fui-image-cropper/fui-image-cropper.vue +1058 -0
  44. package/ui-fireui/fui-image-group/fui-image-group.vue +149 -0
  45. package/ui-fireui/fui-keyboard/fui-keyboard.vue +254 -0
  46. package/ui-fireui/fui-keyboard-input/fui-keyboard-input.vue +78 -0
  47. package/ui-fireui/fui-list-cell/fui-list-cell.vue +178 -0
  48. package/ui-fireui/fui-list-view/fui-list-view.vue +87 -0
  49. package/ui-fireui/fui-loading/fui-loading.vue +78 -0
  50. package/ui-fireui/fui-loadmore/fui-loadmore.vue +163 -0
  51. package/ui-fireui/fui-modal/fui-modal.vue +392 -0
  52. package/ui-fireui/fui-navigation-bar/fui-navigation-bar.vue +180 -0
  53. package/ui-fireui/fui-no-data/fui-no-data.vue +116 -0
  54. package/ui-fireui/fui-nomore/fui-nomore.vue +116 -0
  55. package/ui-fireui/fui-numberbox/fui-numberbox.vue +234 -0
  56. package/ui-fireui/fui-numberbox-border/fui-numberbox-border.vue +232 -0
  57. package/ui-fireui/fui-picture-cropper/fui-picture-cropper.vue +682 -0
  58. package/ui-fireui/fui-picture-cropper/fui-picture-cropper.wxs +560 -0
  59. package/ui-fireui/fui-rate/fui-rate.vue +167 -0
  60. package/ui-fireui/fui-round-progress/fui-round-progress.vue +306 -0
  61. package/ui-fireui/fui-scroll-top/fui-scroll-top.vue +189 -0
  62. package/ui-fireui/fui-sharemodel/fui-sharemodel.vue +181 -0
  63. package/ui-fireui/fui-skeleton/fui-skeleton.vue +248 -0
  64. package/ui-fireui/fui-steps/fui-steps.vue +214 -0
  65. package/ui-fireui/fui-sticky/fui-sticky.vue +155 -0
  66. package/ui-fireui/fui-sticky-wxs/fui-sticky-wxs.vue +133 -0
  67. package/ui-fireui/fui-sticky-wxs/fui-sticky.wxs +44 -0
  68. package/ui-fireui/fui-swipe-action/fui-swipe-action.vue +301 -0
  69. package/ui-fireui/fui-tabbar/fui-tabbar.vue +283 -0
  70. package/ui-fireui/fui-tabs/fui-tabs.vue +284 -0
  71. package/ui-fireui/fui-tabs2/fui-tabs2.vue +284 -0
  72. package/ui-fireui/fui-tag/fui-tag.vue +374 -0
  73. package/ui-fireui/fui-time-axis/fui-time-axis.vue +36 -0
  74. package/ui-fireui/fui-timeaxis-item/fui-timeaxis-item.vue +48 -0
  75. package/ui-fireui/fui-tips/fui-tips.vue +161 -0
  76. package/ui-fireui/fui-toast/fui-toast.vue +117 -0
  77. package/ui-fireui/fui-top-dropdown/fui-top-dropdown.vue +129 -0
  78. package/ui-fireui/fui-upload/fui-upload.vue +446 -0
  79. package/ui-fireui/fui-uploadsamll/fui-uploadsamll.vue +472 -0
  80. package/uview-plus/README.md +1 -1
  81. package/uview-plus/changelog-wu-tool.md +21 -0
  82. package/uview-plus/changelog-wu.md +91 -0
  83. package/uview-plus/components/u-action-sheet/_doc/changelog.md +12 -0
  84. package/uview-plus/components/u-action-sheet/_doc/package.json +92 -0
  85. package/uview-plus/components/u-action-sheet/_doc/readme.md +16 -0
  86. package/uview-plus/components/u-app-update/_doc/changelog.md +26 -0
  87. package/uview-plus/components/u-app-update/_doc/package.json +89 -0
  88. package/uview-plus/components/u-app-update/_doc/readme.md +16 -0
  89. package/uview-plus/components/u-app-update/config.js +120 -0
  90. package/uview-plus/components/u-app-update/img/act.png +0 -0
  91. package/uview-plus/components/u-app-update/img/appUploadAlertBoxBg.png +0 -0
  92. package/uview-plus/components/u-app-update/img/close.png +0 -0
  93. package/uview-plus/components/u-app-update/js-sdk/checkVersion.js +81 -0
  94. package/uview-plus/components/u-app-update/js-sdk/silentlyAppUpdate.js +41 -0
  95. package/uview-plus/components/u-app-update/pages/index.vue +8 -0
  96. package/uview-plus/components/u-app-update/u-app-update.vue +583 -0
  97. package/uview-plus/components/u-button-wu/_doc/changelog.md +6 -0
  98. package/uview-plus/components/u-button-wu/_doc/package.json +89 -0
  99. package/uview-plus/components/u-button-wu/_doc/readme.md +16 -0
  100. package/uview-plus/components/u-button-wu/u-button-wu.vue +522 -0
  101. package/uview-plus/components/u-button-wu/vue.scss +81 -0
  102. package/uview-plus/components/u-calendar-wu/_doc/changelog.md +145 -0
  103. package/uview-plus/components/u-calendar-wu/_doc/package.json +90 -0
  104. package/uview-plus/components/u-calendar-wu/_doc/readme.md +16 -0
  105. package/uview-plus/components/u-calendar-wu/calendar.js +664 -0
  106. package/uview-plus/components/u-calendar-wu/i18n/en.json +14 -0
  107. package/uview-plus/components/u-calendar-wu/i18n/index.js +8 -0
  108. package/uview-plus/components/u-calendar-wu/i18n/zh-Hans.json +14 -0
  109. package/uview-plus/components/u-calendar-wu/i18n/zh-Hant.json +14 -0
  110. package/uview-plus/components/u-calendar-wu/props.js +166 -0
  111. package/uview-plus/components/u-calendar-wu/style.css +196 -0
  112. package/uview-plus/components/u-calendar-wu/u-calendar-wu.vue +921 -0
  113. package/uview-plus/components/u-calendar-wu/util.js +552 -0
  114. package/uview-plus/components/u-calendar-wu/wu-calendar-block/props.js +73 -0
  115. package/uview-plus/components/u-calendar-wu/wu-calendar-block/wu-calendar-block.vue +122 -0
  116. package/uview-plus/components/u-calendar-wu/wu-calendar-item/props.js +55 -0
  117. package/uview-plus/components/u-calendar-wu/wu-calendar-item/wu-calendar-item.vue +293 -0
  118. package/uview-plus/components/u-cell/_doc/changelog.md +6 -0
  119. package/uview-plus/components/u-cell/_doc/package.json +89 -0
  120. package/uview-plus/components/u-cell/_doc/readme.md +25 -0
  121. package/uview-plus/components/u-checkbox/_doc/changelog.md +8 -0
  122. package/uview-plus/components/u-checkbox/_doc/package.json +88 -0
  123. package/uview-plus/components/u-checkbox/_doc/readme.md +25 -0
  124. package/uview-plus/components/u-code/_doc/changelog.md +6 -0
  125. package/uview-plus/components/u-code/_doc/package.json +86 -0
  126. package/uview-plus/components/u-code/_doc/readme.md +16 -0
  127. package/uview-plus/components/u-drag-sort/_doc/changelog.md +0 -0
  128. package/uview-plus/components/u-drag-sort/_doc/package.json +85 -0
  129. package/uview-plus/components/u-drag-sort/_doc/readme.md +16 -0
  130. package/uview-plus/components/u-drag-sort/u-drag-sort.vue +3 -0
  131. package/uview-plus/components/u-empty/u-empty.vue +27 -1
  132. package/uview-plus/components/u-gap/_doc/changelog.md +4 -0
  133. package/uview-plus/components/u-gap/_doc/package.json +86 -0
  134. package/uview-plus/components/u-gap/_doc/readme.md +22 -0
  135. package/uview-plus/components/u-icon/_doc/changelog.md +10 -0
  136. package/uview-plus/components/u-icon/_doc/package.json +85 -0
  137. package/uview-plus/components/u-icon/_doc/readme.md +10 -0
  138. package/uview-plus/components/u-icon/icon.js +23 -25
  139. package/uview-plus/components/u-icon/icons.js +213 -213
  140. package/uview-plus/components/u-icon/style.css +3 -3
  141. package/uview-plus/components/u-icon/u-icon2.vue +149 -0
  142. package/uview-plus/components/u-image-wu/_doc/changelog.md +21 -0
  143. package/uview-plus/components/u-image-wu/_doc/package.json +88 -0
  144. package/uview-plus/components/u-image-wu/_doc/readme.md +11 -0
  145. package/uview-plus/components/u-image-wu/props.js +94 -0
  146. package/uview-plus/components/u-image-wu/u-image-wu.vue +243 -0
  147. package/uview-plus/components/u-input/_doc/changelog.md +6 -0
  148. package/uview-plus/components/u-input/_doc/package.json +88 -0
  149. package/uview-plus/components/u-input/_doc/readme.md +16 -0
  150. package/uview-plus/components/u-line/_doc/changelog.md +8 -0
  151. package/uview-plus/components/u-line/_doc/package.json +86 -0
  152. package/uview-plus/components/u-line/_doc/readme.md +16 -0
  153. package/uview-plus/components/u-link/_doc/changelog.md +8 -0
  154. package/uview-plus/components/u-link/_doc/package.json +86 -0
  155. package/uview-plus/components/u-link/_doc/readme.md +20 -0
  156. package/uview-plus/components/u-loading-icon/_doc/changelog.md +12 -0
  157. package/uview-plus/components/u-loading-icon/_doc/package.json +86 -0
  158. package/uview-plus/components/u-loading-icon/_doc/readme.md +16 -0
  159. package/uview-plus/components/u-loading-icon/props.js +1 -1
  160. package/uview-plus/components/u-navbar/_doc/changelog.md +6 -0
  161. package/uview-plus/components/u-navbar/_doc/package.json +89 -0
  162. package/uview-plus/components/u-navbar/_doc/readme.md +16 -0
  163. package/uview-plus/components/u-navbar-wu/props.js +102 -0
  164. package/uview-plus/components/u-navbar-wu/u-navbar-wu.vue +196 -0
  165. package/uview-plus/components/u-number-box/_doc/changelog.md +19 -0
  166. package/uview-plus/components/u-number-box/_doc/package.json +88 -0
  167. package/uview-plus/components/u-number-box/_doc/readme.md +16 -0
  168. package/uview-plus/components/u-overlay/_doc/changelog.md +4 -0
  169. package/uview-plus/components/u-overlay/_doc/package.json +88 -0
  170. package/uview-plus/components/u-overlay/_doc/readme.md +16 -0
  171. package/uview-plus/components/u-popup/_doc/changelog.md +4 -0
  172. package/uview-plus/components/u-popup/_doc/package.json +92 -0
  173. package/uview-plus/components/u-popup/_doc/readme.md +16 -0
  174. package/uview-plus/components/u-popup-wu/keypress.js +45 -0
  175. package/uview-plus/components/u-popup-wu/u-popup-wu.vue +519 -0
  176. package/uview-plus/components/u-radio/_doc/changelog.md +6 -0
  177. package/uview-plus/components/u-radio/_doc/package.json +88 -0
  178. package/uview-plus/components/u-radio/_doc/readme.md +25 -0
  179. package/uview-plus/components/u-row/_doc/changelog.md +8 -0
  180. package/uview-plus/components/u-row/_doc/package.json +86 -0
  181. package/uview-plus/components/u-row/_doc/readme.md +16 -0
  182. package/uview-plus/components/u-safe-bottom/_doc/changelog.md +6 -0
  183. package/uview-plus/components/u-safe-bottom/_doc/package.json +86 -0
  184. package/uview-plus/components/u-safe-bottom/_doc/readme.md +16 -0
  185. package/uview-plus/components/u-sku-wu/_doc/changelog.md +27 -0
  186. package/uview-plus/components/u-sku-wu/_doc/package.json +93 -0
  187. package/uview-plus/components/u-sku-wu/_doc/readme.md +16 -0
  188. package/uview-plus/components/u-sku-wu/props.js +86 -0
  189. package/uview-plus/components/u-sku-wu/style.css +271 -0
  190. package/uview-plus/components/u-sku-wu/u-sku-wu.vue +864 -0
  191. package/uview-plus/components/u-status-bar/_doc/changelog.md +4 -0
  192. package/uview-plus/components/u-status-bar/_doc/package.json +86 -0
  193. package/uview-plus/components/u-status-bar/_doc/readme.md +16 -0
  194. package/uview-plus/components/u-text/_doc/changelog.md +10 -0
  195. package/uview-plus/components/u-text/_doc/package.json +89 -0
  196. package/uview-plus/components/u-text/_doc/readme.md +20 -0
  197. package/uview-plus/components/u-textarea/_doc/changelog.md +6 -0
  198. package/uview-plus/components/u-textarea/_doc/package.json +86 -0
  199. package/uview-plus/components/u-textarea/_doc/readme.md +25 -0
  200. package/uview-plus/components/u-transition/_doc/changelog.md +14 -0
  201. package/uview-plus/components/u-transition/_doc/package.json +86 -0
  202. package/uview-plus/components/u-transition/_doc/readme.md +16 -0
  203. package/uview-plus/components/u-transition-wu/createAnimation.js +148 -0
  204. package/uview-plus/components/u-transition-wu/props.js +32 -0
  205. package/uview-plus/components/u-transition-wu/u-transition.vue +300 -0
  206. package/uview-plus/components/u-verification-code/u-verification-code.vue +161 -0
  207. package/uview-plus/index.js +107 -94
  208. package/uview-plus/libs/config/config.js +46 -48
  209. package/uview-plus/libs/css/color.scss +32 -311
  210. package/uview-plus/libs/css/components-wu.scss +30 -0
  211. package/uview-plus/libs/css/vue.scss +10 -10
  212. package/uview-plus/libs/function/calc.js +61 -55
  213. package/uview-plus/libs/function/cc.js +66 -0
  214. package/uview-plus/libs/function/color/color-convert/CHANGELOG.md +54 -0
  215. package/uview-plus/libs/function/color/color-convert/LICENSE +21 -0
  216. package/uview-plus/libs/function/color/color-convert/README.md +68 -0
  217. package/uview-plus/libs/function/color/color-convert/conversions.js +839 -0
  218. package/uview-plus/libs/function/color/color-convert/index.js +81 -0
  219. package/uview-plus/libs/function/color/color-convert/package.json +48 -0
  220. package/uview-plus/libs/function/color/color-convert/route.js +97 -0
  221. package/uview-plus/libs/function/color/color-name/LICENSE +8 -0
  222. package/uview-plus/libs/function/color/color-name/README.md +11 -0
  223. package/uview-plus/libs/function/color/color-name/index.js +152 -0
  224. package/uview-plus/libs/function/color/color-name/package.json +28 -0
  225. package/uview-plus/libs/function/color/color-string/LICENSE +21 -0
  226. package/uview-plus/libs/function/color/color-string/README.md +62 -0
  227. package/uview-plus/libs/function/color/color-string/index.js +244 -0
  228. package/uview-plus/libs/function/color/color-string/package.json +39 -0
  229. package/uview-plus/libs/function/color/color.js +496 -0
  230. package/uview-plus/libs/function/color/index.js +158 -0
  231. package/uview-plus/libs/function/color/is-arrayish/LICENSE +21 -0
  232. package/uview-plus/libs/function/color/is-arrayish/README.md +16 -0
  233. package/uview-plus/libs/function/color/is-arrayish/index.js +9 -0
  234. package/uview-plus/libs/function/color/is-arrayish/package.json +45 -0
  235. package/uview-plus/libs/function/color/is-arrayish/yarn-error.log +1443 -0
  236. package/uview-plus/libs/function/color/simple-swizzle/LICENSE +21 -0
  237. package/uview-plus/libs/function/color/simple-swizzle/README.md +39 -0
  238. package/uview-plus/libs/function/color/simple-swizzle/index.js +29 -0
  239. package/uview-plus/libs/function/color/simple-swizzle/package.json +36 -0
  240. package/uview-plus/libs/function/colorGradient.js +108 -106
  241. package/uview-plus/libs/function/debounce.js +17 -17
  242. package/uview-plus/libs/function/digit.js +1 -3
  243. package/uview-plus/libs/function/http.js +3 -3
  244. package/uview-plus/libs/function/index-wu.js +231 -0
  245. package/uview-plus/libs/function/index.js +579 -566
  246. package/uview-plus/libs/function/platform.js +18 -18
  247. package/uview-plus/libs/function/test.js +135 -137
  248. package/uview-plus/libs/function/throttle.js +17 -17
  249. package/uview-plus/libs/luch-request/core/Request.js +199 -199
  250. package/uview-plus/libs/mixin/mpMixin.js +1 -0
  251. package/uview-plus/libs/mixin/openType.js +33 -0
  252. package/uview-plus/libs/util/async-validator.js +1343 -1343
  253. package/uview-plus/libs/util/dayjs.js +404 -0
  254. package/uview-plus/libs/util/route.js +101 -105
  255. package/uview-plus/package-wu-tool.json +84 -0
  256. package/uview-plus/package-wu.json +112 -0
  257. package/uview-plus/package.json +106 -95
  258. package/uview-plus/readme-wu.md +148 -0
  259. package/uview-ui/index.js +51 -52
  260. package/plugins/uni-upgrade.js +0 -294
@@ -0,0 +1,538 @@
1
+ <template>
2
+ <view class="fui-cascade-selection">
3
+ <scroll-view
4
+ scroll-x
5
+ scroll-with-animation
6
+ :scroll-into-view="scrollViewId"
7
+ :style="{ backgroundColor: headerBgColor }"
8
+ class="fui-bottom-line"
9
+ :class="{ 'fui-btm-none': !headerLine }"
10
+ >
11
+ <view class="fui-selection-header" :style="{ height: tabsHeight, backgroundColor: backgroundColor }">
12
+ <view
13
+ class="fui-header-item"
14
+ :class="{ 'fui-font-bold': index === currentTab && bold }"
15
+ :style="{ color: index === currentTab ? activeColor : color, fontSize: size + 'rpx' }"
16
+ :id="`id_${index}`"
17
+ @tap.stop="swichNav"
18
+ :data-current="index"
19
+ v-for="(item, index) in selectedArr"
20
+ :key="index"
21
+ >
22
+ {{ item.text }}
23
+ <view class="fui-active-line" :style="{ backgroundColor: lineColor }" v-if="index === currentTab && showLine"></view>
24
+ </view>
25
+ </view>
26
+ </scroll-view>
27
+ <swiper
28
+ class="fui-selection-list"
29
+ :current="currentTab"
30
+ duration="300"
31
+ @change="switchTab"
32
+ :style="{ height: height, backgroundColor: backgroundColor }"
33
+ >
34
+ <swiper-item v-for="(item, index) in selectedArr" :key="index">
35
+ <scroll-view scroll-y :scroll-into-view="item.scrollViewId" class="fui-selection-item" :style="{ height: height }">
36
+ <view class="fui-first-item" :style="{ height: firstItemTop }"></view>
37
+ <view
38
+ class="fui-selection-cell"
39
+ :style="{ padding: padding, backgroundColor: backgroundColor }"
40
+ :id="`id_${subIndex}`"
41
+ v-for="(subItem, subIndex) in item.list"
42
+ :key="subIndex"
43
+ @tap="change(index, subIndex, subItem)"
44
+ >
45
+ <icon
46
+ type="success_no_circle"
47
+ v-if="item.index === subIndex"
48
+ :color="checkMarkColor"
49
+ :size="checkMarkSize"
50
+ class="fui-icon-success"
51
+ ></icon>
52
+ <image
53
+ :src="subItem.src"
54
+ v-if="subItem.src"
55
+ class="fui-cell-img"
56
+ :style="{ width: imgWidth, height: imgHeight, borderRadius: radius }"
57
+ ></image>
58
+ <view
59
+ class="fui-cell-title"
60
+ :class="{ 'fui-font-bold': item.index === subIndex && textBold, 'fui-flex-shrink': nowrap }"
61
+ :style="{ color: item.index === subIndex ? textActiveColor : textColor, fontSize: textSize + 'rpx' }"
62
+ >
63
+ {{ subItem.text }}
64
+ </view>
65
+ <view
66
+ class="fui-cell-sub_title"
67
+ :style="{ color: subTextColor, fontSize: subTextSize + 'rpx' }"
68
+ v-if="subItem.subText"
69
+ >
70
+ {{ subItem.subText }}
71
+ </view>
72
+ </view>
73
+ </scroll-view>
74
+ </swiper-item>
75
+ </swiper>
76
+ </view>
77
+ </template>
78
+
79
+ <script>
80
+ export default {
81
+ name: 'fuiCascadeSelection',
82
+ props: {
83
+ /**
84
+ * 如果下一级是请求返回,则为第一级数据,否则所有数据
85
+ * 数据格式
86
+ [{
87
+ src: "",
88
+ text: "",
89
+ subText: "",
90
+ value: 0,
91
+ children:[{
92
+ text: "",
93
+ subText: "",
94
+ value: 0,
95
+ children:[]
96
+ }]
97
+ }]
98
+ * */
99
+ itemList: {
100
+ type: Array,
101
+ default: () => {
102
+ return [];
103
+ }
104
+ },
105
+ /*
106
+ 初始化默认选中数据
107
+ [{
108
+ text: "",//选中text
109
+ subText: '',//选中subText
110
+ value: '',//选中value
111
+ src: '', //选中src,没有则传空或不传
112
+ index: 0, //选中数据在当前layer索引
113
+ list: [{src: "", text: "", subText: "", value: 101}] //所有layer数据集合
114
+ }];
115
+
116
+ */
117
+ defaultItemList: {
118
+ type: Array,
119
+ value: []
120
+ },
121
+ //是否显示header底部细线
122
+ headerLine: {
123
+ type: Boolean,
124
+ default: true
125
+ },
126
+ //header背景颜色
127
+ headerBgColor: {
128
+ type: String,
129
+ default: '#FFFFFF'
130
+ },
131
+ //顶部标签栏高度
132
+ tabsHeight: {
133
+ type: String,
134
+ default: '88rpx'
135
+ },
136
+ //默认显示文字
137
+ text: {
138
+ type: String,
139
+ default: '请选择'
140
+ },
141
+ //tabs 文字大小
142
+ size: {
143
+ type: Number,
144
+ default: 28
145
+ },
146
+ //tabs 文字颜色
147
+ color: {
148
+ type: String,
149
+ default: '#555'
150
+ },
151
+ //选中颜色
152
+ activeColor: {
153
+ type: String,
154
+ default: '#5677fc'
155
+ },
156
+ //选中后文字加粗
157
+ bold: {
158
+ type: Boolean,
159
+ default: true
160
+ },
161
+ //选中后是否显示底部线条
162
+ showLine: {
163
+ type: Boolean,
164
+ default: true
165
+ },
166
+ //线条颜色
167
+ lineColor: {
168
+ type: String,
169
+ default: '#5677fc'
170
+ },
171
+ //icon 大小
172
+ checkMarkSize: {
173
+ type: Number,
174
+ default: 15
175
+ },
176
+ //icon 颜色
177
+ checkMarkColor: {
178
+ type: String,
179
+ default: '#5677fc'
180
+ },
181
+ //item 图片宽度
182
+ imgWidth: {
183
+ type: String,
184
+ default: '40rpx'
185
+ },
186
+ //item 图片高度
187
+ imgHeight: {
188
+ type: String,
189
+ default: '40rpx'
190
+ },
191
+ //图片圆角
192
+ radius: {
193
+ type: String,
194
+ default: '50%'
195
+ },
196
+ //item text颜色
197
+ textColor: {
198
+ type: String,
199
+ default: '#333'
200
+ },
201
+ textActiveColor: {
202
+ type: String,
203
+ default: '#333'
204
+ },
205
+ //选中后字体是否加粗
206
+ textBold: {
207
+ type: Boolean,
208
+ default: true
209
+ },
210
+ //item text字体大小
211
+ textSize: {
212
+ type: Number,
213
+ default: 28
214
+ },
215
+ //text 是否不换行
216
+ nowrap: {
217
+ type: Boolean,
218
+ default: false
219
+ },
220
+ //item subText颜色
221
+ subTextColor: {
222
+ type: String,
223
+ default: '#999'
224
+ },
225
+ //item subText字体大小
226
+ subTextSize: {
227
+ type: Number,
228
+ default: 24
229
+ },
230
+ // item padding
231
+ padding: {
232
+ type: String,
233
+ default: '20rpx 30rpx'
234
+ },
235
+ //占位高度,第一条数据距离顶部距离
236
+ firstItemTop: {
237
+ type: String,
238
+ default: '20rpx'
239
+ },
240
+ //swiper 高度
241
+ height: {
242
+ type: String,
243
+ default: '300px'
244
+ },
245
+ //item swiper 内容部分背景颜色
246
+ backgroundColor: {
247
+ type: String,
248
+ default: '#FFFFFF'
249
+ },
250
+ //子集数据是否请求返回(默认false,一次性返回所有数据)
251
+ request: {
252
+ type: Boolean,
253
+ default: false
254
+ },
255
+ //子级数据(当有改变时,默认当前选中项新增子级数据,request=true时生效)
256
+ receiveData: {
257
+ type: Array,
258
+ default: () => {
259
+ return [];
260
+ }
261
+ },
262
+ //改变值则重置数据
263
+ reset: {
264
+ type: [Number, String],
265
+ default: 0
266
+ }
267
+ },
268
+ watch: {
269
+ itemList(val) {
270
+ this.initData(val, -1);
271
+ },
272
+ receiveData(val) {
273
+ this.subLevelData(val, this.currentTab);
274
+ },
275
+ reset() {
276
+ this.initData(this.itemList, -1);
277
+ }
278
+ },
279
+ created() {
280
+ let defaultItemList = this.defaultItemList || [];
281
+ if (defaultItemList.length > 0) {
282
+ defaultItemList.map((item) => {
283
+ item.scrollViewId = `id_${item.index}`;
284
+ });
285
+ this.selectedArr = defaultItemList;
286
+ this.currentTab = defaultItemList.length - 1;
287
+ this.$nextTick(() => {
288
+ this.checkCor();
289
+ });
290
+ } else {
291
+ this.initData(this.itemList, -1);
292
+ }
293
+ },
294
+ data() {
295
+ return {
296
+ currentTab: 0,
297
+ //tab栏scrollview滚动的位置
298
+ scrollViewId: 'id__1',
299
+ selectedArr: []
300
+ };
301
+ },
302
+ methods: {
303
+ initData(data, layer) {
304
+ if (!data || data.length === 0) return;
305
+ if (this.request) {
306
+ //第一级数据
307
+ this.subLevelData(data, layer);
308
+ } else {
309
+ let selectedValue = this.selectedValue || {};
310
+ if (selectedValue.type) {
311
+ this.setDefaultData(selectedValue);
312
+ } else {
313
+ this.subLevelData(this.getItemList(layer, -1), layer);
314
+ }
315
+ }
316
+ },
317
+ removeChildren(data) {
318
+ let list = data.map((item) => {
319
+ delete item['children'];
320
+ return item;
321
+ });
322
+ return list;
323
+ },
324
+ getItemList(layer, index) {
325
+ let list = [];
326
+ let arr = JSON.parse(JSON.stringify(this.itemList));
327
+ if (layer == -1) {
328
+ list = this.removeChildren(arr);
329
+ } else {
330
+ let value = this.selectedArr[0].index;
331
+ value = value == -1 ? index : value;
332
+ list = arr[value].children || [];
333
+ if (layer > 0) {
334
+ for (let i = 1; i < layer + 1; i++) {
335
+ let val = layer === i ? index : this.selectedArr[i].index;
336
+ list = list[val].children || [];
337
+ if (list.length === 0) break;
338
+ }
339
+ }
340
+ list = this.removeChildren(list);
341
+ }
342
+ return list;
343
+ },
344
+ //滚动切换
345
+ switchTab(e) {
346
+ this.currentTab = e.detail.current;
347
+ this.checkCor();
348
+ },
349
+ //点击标题切换当
350
+ swichNav(e) {
351
+ let cur = e.currentTarget.dataset.current;
352
+ if (this.currentTab != cur) {
353
+ this.currentTab = cur;
354
+ }
355
+ },
356
+ checkCor() {
357
+ let item = this.selectedArr[this.currentTab];
358
+ item.scrollViewId = 'id__1';
359
+ this.$nextTick(() => {
360
+ setTimeout(() => {
361
+ let val = item.index < 2 ? 0 : Number(item.index - 2);
362
+ item.scrollViewId = `id_${val}`;
363
+ }, 2);
364
+ });
365
+
366
+ if (this.currentTab > 1) {
367
+ this.scrollViewId = `id_${this.currentTab - 1}`;
368
+ } else {
369
+ this.scrollViewId = `id_0`;
370
+ }
371
+ },
372
+ change(index, subIndex, subItem) {
373
+ let item = this.selectedArr[index];
374
+ if (item.index == subIndex) return;
375
+ item.index = subIndex;
376
+ item.text = subItem.text;
377
+ item.value = subItem.value;
378
+ item.subText = subItem.subText || '';
379
+ item.src = subItem.src || '';
380
+
381
+ this.$emit('change', {
382
+ layer: index,
383
+ subIndex: subIndex, //layer=> Array index
384
+ ...subItem
385
+ });
386
+
387
+ if (!this.request) {
388
+ let data = this.getItemList(index, subIndex);
389
+ this.subLevelData(data, index);
390
+ }
391
+ },
392
+ //新增子级数据时处理
393
+ subLevelData(data, layer) {
394
+ if (!data || data.length === 0) {
395
+ if (layer == -1) return;
396
+ //完成选择
397
+ let result = JSON.parse(JSON.stringify(this.selectedArr));
398
+ let lastItem = result[result.length - 1] || {};
399
+ let text = '';
400
+ result.map((item) => {
401
+ text += item.text;
402
+ delete item['list'];
403
+ //delete item['index'];
404
+ delete item['scrollViewId'];
405
+ return item;
406
+ });
407
+ this.$emit('complete', {
408
+ result: result,
409
+ value: lastItem.value,
410
+ text: text,
411
+ subText: lastItem.subText,
412
+ src: lastItem.src
413
+ });
414
+ } else {
415
+ //重置数据( >layer层级)
416
+ let item = [
417
+ {
418
+ text: this.text,
419
+ subText: '',
420
+ value: '',
421
+ src: '',
422
+ index: -1,
423
+ scrollViewId: 'id__1',
424
+ list: data
425
+ }
426
+ ];
427
+ if (layer == -1) {
428
+ this.selectedArr = item;
429
+ } else {
430
+ let retainArr = this.selectedArr.slice(0, layer + 1);
431
+ this.selectedArr = retainArr.concat(item);
432
+ }
433
+ this.$nextTick(() => {
434
+ this.currentTab = this.selectedArr.length - 1;
435
+ });
436
+ }
437
+ }
438
+ }
439
+ };
440
+ </script>
441
+
442
+ <style scoped>
443
+ .fui-cascade-selection {
444
+ width: 100%;
445
+ box-sizing: border-box;
446
+ }
447
+
448
+ .fui-selection-header {
449
+ width: 100%;
450
+ display: flex;
451
+ align-items: center;
452
+ position: relative;
453
+ box-sizing: border-box;
454
+ }
455
+
456
+ .fui-bottom-line {
457
+ position: relative;
458
+ }
459
+
460
+ .fui-bottom-line::after {
461
+ width: 100%;
462
+ content: '';
463
+ position: absolute;
464
+ border-bottom: 1rpx solid #eaeef1;
465
+ -webkit-transform: scaleY(0.5) translateZ(0);
466
+ transform: scaleY(0.5) translateZ(0);
467
+ transform-origin: 0 100%;
468
+ bottom: 0;
469
+ right: 0;
470
+ left: 0;
471
+ }
472
+
473
+ .fui-btm-none::after {
474
+ border-bottom: 0 !important;
475
+ }
476
+
477
+ .fui-header-item {
478
+ max-width: 240rpx;
479
+ padding: 15rpx 30rpx;
480
+ box-sizing: border-box;
481
+ flex-shrink: 0;
482
+ overflow: hidden;
483
+ white-space: nowrap;
484
+ text-overflow: ellipsis;
485
+ position: relative;
486
+ }
487
+
488
+ .fui-font-bold {
489
+ font-weight: bold;
490
+ }
491
+
492
+ .fui-active-line {
493
+ width: 60rpx;
494
+ height: 6rpx;
495
+ border-radius: 4rpx;
496
+ position: absolute;
497
+ bottom: 0;
498
+ right: 0;
499
+ left: 50%;
500
+ transform: translateX(-50%);
501
+ }
502
+
503
+ .fui-selection-cell {
504
+ width: 100%;
505
+ box-sizing: border-box;
506
+ display: flex;
507
+ align-items: center;
508
+ }
509
+
510
+ .fui-icon-success {
511
+ margin-right: 12rpx;
512
+ }
513
+
514
+ .fui-cell-img {
515
+ margin-right: 12rpx;
516
+ flex-shrink: 0;
517
+ }
518
+
519
+ .fui-cell-title {
520
+ word-break: break-all;
521
+ }
522
+
523
+ .fui-flex-shrink {
524
+ flex-shrink: 0;
525
+ }
526
+
527
+ .fui-font-bold {
528
+ font-weight: bold;
529
+ }
530
+
531
+ .fui-cell-sub_title {
532
+ margin-left: 20rpx;
533
+ word-break: break-all;
534
+ }
535
+ .fui-first-item {
536
+ width: 100%;
537
+ }
538
+ </style>