uview-plus 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -0
  3. package/changelog.md +8 -0
  4. package/components/u--form/u--form.vue +78 -0
  5. package/components/u--image/u--image.vue +47 -0
  6. package/components/u--input/u--input.vue +73 -0
  7. package/components/u--text/u--text.vue +44 -0
  8. package/components/u--textarea/u--textarea.vue +48 -0
  9. package/components/u-action-sheet/props.js +54 -0
  10. package/components/u-action-sheet/u-action-sheet.vue +278 -0
  11. package/components/u-album/props.js +59 -0
  12. package/components/u-album/u-album.vue +259 -0
  13. package/components/u-alert/props.js +44 -0
  14. package/components/u-alert/u-alert.vue +243 -0
  15. package/components/u-avatar/props.js +78 -0
  16. package/components/u-avatar/u-avatar.vue +172 -0
  17. package/components/u-avatar-group/props.js +52 -0
  18. package/components/u-avatar-group/u-avatar-group.vue +103 -0
  19. package/components/u-back-top/props.js +54 -0
  20. package/components/u-back-top/u-back-top.vue +129 -0
  21. package/components/u-badge/props.js +72 -0
  22. package/components/u-badge/u-badge.vue +171 -0
  23. package/components/u-button/nvue.scss +46 -0
  24. package/components/u-button/props.js +161 -0
  25. package/components/u-button/u-button.vue +490 -0
  26. package/components/u-button/vue.scss +80 -0
  27. package/components/u-calendar/header.vue +99 -0
  28. package/components/u-calendar/month.vue +580 -0
  29. package/components/u-calendar/props.js +144 -0
  30. package/components/u-calendar/u-calendar.vue +384 -0
  31. package/components/u-calendar/util.js +85 -0
  32. package/components/u-car-keyboard/props.js +14 -0
  33. package/components/u-car-keyboard/u-car-keyboard.vue +311 -0
  34. package/components/u-cell/props.js +110 -0
  35. package/components/u-cell/u-cell.vue +229 -0
  36. package/components/u-cell-group/props.js +14 -0
  37. package/components/u-cell-group/u-cell-group.vue +61 -0
  38. package/components/u-checkbox/props.js +69 -0
  39. package/components/u-checkbox/u-checkbox.vue +344 -0
  40. package/components/u-checkbox-group/props.js +82 -0
  41. package/components/u-checkbox-group/u-checkbox-group.vue +103 -0
  42. package/components/u-circle-progress/props.js +8 -0
  43. package/components/u-circle-progress/u-circle-progress.vue +198 -0
  44. package/components/u-code/props.js +34 -0
  45. package/components/u-code/u-code.vue +129 -0
  46. package/components/u-code-input/props.js +79 -0
  47. package/components/u-code-input/u-code-input.vue +252 -0
  48. package/components/u-col/props.js +29 -0
  49. package/components/u-col/u-col.vue +162 -0
  50. package/components/u-collapse/props.js +19 -0
  51. package/components/u-collapse/u-collapse.vue +90 -0
  52. package/components/u-collapse-item/props.js +59 -0
  53. package/components/u-collapse-item/u-collapse-item.vue +225 -0
  54. package/components/u-column-notice/props.js +55 -0
  55. package/components/u-column-notice/u-column-notice.vue +160 -0
  56. package/components/u-count-down/props.js +24 -0
  57. package/components/u-count-down/u-count-down.vue +163 -0
  58. package/components/u-count-down/utils.js +62 -0
  59. package/components/u-count-to/props.js +59 -0
  60. package/components/u-count-to/u-count-to.vue +184 -0
  61. package/components/u-datetime-picker/props.js +116 -0
  62. package/components/u-datetime-picker/u-datetime-picker.vue +362 -0
  63. package/components/u-divider/props.js +44 -0
  64. package/components/u-divider/u-divider.vue +116 -0
  65. package/components/u-dropdown/props.js +65 -0
  66. package/components/u-dropdown/u-dropdown.vue +127 -0
  67. package/components/u-dropdown-item/props.js +36 -0
  68. package/components/u-dropdown-item/u-dropdown-item.vue +146 -0
  69. package/components/u-empty/props.js +59 -0
  70. package/components/u-empty/u-empty.vue +128 -0
  71. package/components/u-form/props.js +45 -0
  72. package/components/u-form/u-form.vue +214 -0
  73. package/components/u-form-item/props.js +43 -0
  74. package/components/u-form-item/u-form-item.vue +235 -0
  75. package/components/u-gap/props.js +24 -0
  76. package/components/u-gap/u-gap.vue +38 -0
  77. package/components/u-grid/props.js +19 -0
  78. package/components/u-grid/u-grid.vue +97 -0
  79. package/components/u-grid-item/props.js +14 -0
  80. package/components/u-grid-item/u-grid-item.vue +209 -0
  81. package/components/u-icon/icons.js +214 -0
  82. package/components/u-icon/props.js +89 -0
  83. package/components/u-icon/u-icon.vue +234 -0
  84. package/components/u-image/props.js +84 -0
  85. package/components/u-image/u-image.vue +232 -0
  86. package/components/u-index-anchor/props.js +29 -0
  87. package/components/u-index-anchor/u-index-anchor.vue +91 -0
  88. package/components/u-index-item/props.js +5 -0
  89. package/components/u-index-item/u-index-item.vue +87 -0
  90. package/components/u-index-list/props.js +29 -0
  91. package/components/u-index-list/u-index-list.vue +440 -0
  92. package/components/u-input/props.js +187 -0
  93. package/components/u-input/u-input.vue +354 -0
  94. package/components/u-keyboard/props.js +84 -0
  95. package/components/u-keyboard/u-keyboard.vue +164 -0
  96. package/components/u-line/props.js +33 -0
  97. package/components/u-line/u-line.vue +62 -0
  98. package/components/u-line-progress/props.js +28 -0
  99. package/components/u-line-progress/u-line-progress.vue +144 -0
  100. package/components/u-link/props.js +39 -0
  101. package/components/u-link/u-link.vue +83 -0
  102. package/components/u-list/props.js +76 -0
  103. package/components/u-list/u-list.vue +157 -0
  104. package/components/u-list-item/props.js +9 -0
  105. package/components/u-list-item/u-list-item.vue +116 -0
  106. package/components/u-loading-icon/props.js +59 -0
  107. package/components/u-loading-icon/u-loading-icon.vue +343 -0
  108. package/components/u-loading-page/props.js +49 -0
  109. package/components/u-loading-page/u-loading-page.vue +115 -0
  110. package/components/u-loadmore/props.js +94 -0
  111. package/components/u-loadmore/u-loadmore.vue +150 -0
  112. package/components/u-modal/props.js +84 -0
  113. package/components/u-modal/u-modal.vue +227 -0
  114. package/components/u-navbar/props.js +84 -0
  115. package/components/u-navbar/u-navbar.vue +186 -0
  116. package/components/u-no-network/props.js +19 -0
  117. package/components/u-no-network/u-no-network.vue +220 -0
  118. package/components/u-notice-bar/props.js +70 -0
  119. package/components/u-notice-bar/u-notice-bar.vue +101 -0
  120. package/components/u-notify/props.js +49 -0
  121. package/components/u-notify/u-notify.vue +211 -0
  122. package/components/u-number-box/props.js +109 -0
  123. package/components/u-number-box/u-number-box.vue +416 -0
  124. package/components/u-number-keyboard/props.js +19 -0
  125. package/components/u-number-keyboard/u-number-keyboard.vue +196 -0
  126. package/components/u-overlay/props.js +24 -0
  127. package/components/u-overlay/u-overlay.vue +68 -0
  128. package/components/u-parse/node/node.vue +499 -0
  129. package/components/u-parse/parser.js +1075 -0
  130. package/components/u-parse/props.js +45 -0
  131. package/components/u-parse/u-parse.vue +366 -0
  132. package/components/u-picker/props.js +79 -0
  133. package/components/u-picker/u-picker.vue +283 -0
  134. package/components/u-picker-column/props.js +5 -0
  135. package/components/u-picker-column/u-picker-column.vue +27 -0
  136. package/components/u-popup/props.js +79 -0
  137. package/components/u-popup/u-popup.vue +304 -0
  138. package/components/u-radio/props.js +64 -0
  139. package/components/u-radio/u-radio.vue +337 -0
  140. package/components/u-radio-group/props.js +85 -0
  141. package/components/u-radio-group/u-radio-group.vue +108 -0
  142. package/components/u-rate/props.js +69 -0
  143. package/components/u-rate/u-rate.vue +304 -0
  144. package/components/u-read-more/props.js +61 -0
  145. package/components/u-read-more/u-read-more.vue +157 -0
  146. package/components/u-row/props.js +19 -0
  147. package/components/u-row/u-row.vue +93 -0
  148. package/components/u-row-notice/props.js +39 -0
  149. package/components/u-row-notice/u-row-notice.vue +330 -0
  150. package/components/u-safe-bottom/props.js +5 -0
  151. package/components/u-safe-bottom/u-safe-bottom.vue +56 -0
  152. package/components/u-scroll-list/nvue.js +28 -0
  153. package/components/u-scroll-list/other.js +0 -0
  154. package/components/u-scroll-list/props.js +34 -0
  155. package/components/u-scroll-list/scrollWxs.wxs +50 -0
  156. package/components/u-scroll-list/u-scroll-list.vue +224 -0
  157. package/components/u-search/props.js +118 -0
  158. package/components/u-search/u-search.vue +303 -0
  159. package/components/u-skeleton/props.js +59 -0
  160. package/components/u-skeleton/u-skeleton.vue +244 -0
  161. package/components/u-slider/mpother.js +113 -0
  162. package/components/u-slider/mpwxs.js +42 -0
  163. package/components/u-slider/mpwxs.wxs +121 -0
  164. package/components/u-slider/nvue - /345/211/257/346/234/254.js" +180 -0
  165. package/components/u-slider/nvue.js +193 -0
  166. package/components/u-slider/props.js +54 -0
  167. package/components/u-slider/u-slider.vue +55 -0
  168. package/components/u-status-bar/props.js +8 -0
  169. package/components/u-status-bar/u-status-bar.vue +46 -0
  170. package/components/u-steps/props.js +39 -0
  171. package/components/u-steps/u-steps.vue +80 -0
  172. package/components/u-steps-item/props.js +24 -0
  173. package/components/u-steps-item/u-steps-item.vue +316 -0
  174. package/components/u-sticky/props.js +40 -0
  175. package/components/u-sticky/u-sticky.vue +212 -0
  176. package/components/u-subsection/props.js +49 -0
  177. package/components/u-subsection/u-subsection.vue +299 -0
  178. package/components/u-swipe-action/props.js +9 -0
  179. package/components/u-swipe-action/u-swipe-action.vue +67 -0
  180. package/components/u-swipe-action-item/index - backup.wxs +256 -0
  181. package/components/u-swipe-action-item/index.wxs +225 -0
  182. package/components/u-swipe-action-item/nvue - backup.js +270 -0
  183. package/components/u-swipe-action-item/nvue.js +174 -0
  184. package/components/u-swipe-action-item/props.js +41 -0
  185. package/components/u-swipe-action-item/u-swipe-action-item.vue +190 -0
  186. package/components/u-swipe-action-item/wxs.js +15 -0
  187. package/components/u-swiper/props.js +125 -0
  188. package/components/u-swiper/u-swiper.vue +255 -0
  189. package/components/u-swiper-indicator/props.js +29 -0
  190. package/components/u-swiper-indicator/u-swiper-indicator.vue +110 -0
  191. package/components/u-switch/props.js +54 -0
  192. package/components/u-switch/u-switch.vue +177 -0
  193. package/components/u-tabbar/props.js +44 -0
  194. package/components/u-tabbar/u-tabbar.vue +141 -0
  195. package/components/u-tabbar-item/props.js +35 -0
  196. package/components/u-tabbar-item/u-tabbar-item.vue +142 -0
  197. package/components/u-table/props.js +5 -0
  198. package/components/u-table/u-table.vue +29 -0
  199. package/components/u-tabs/props.js +64 -0
  200. package/components/u-tabs/u-tabs.vue +354 -0
  201. package/components/u-tabs-item/props.js +5 -0
  202. package/components/u-tabs-item/u-tabs-item.vue +29 -0
  203. package/components/u-tag/props.js +84 -0
  204. package/components/u-tag/u-tag.vue +358 -0
  205. package/components/u-td/props.js +5 -0
  206. package/components/u-td/u-td.vue +31 -0
  207. package/components/u-text/props.js +110 -0
  208. package/components/u-text/u-text.vue +223 -0
  209. package/components/u-text/value.js +85 -0
  210. package/components/u-textarea/props.js +119 -0
  211. package/components/u-textarea/u-textarea.vue +239 -0
  212. package/components/u-toast/u-toast.vue +291 -0
  213. package/components/u-toolbar/props.js +34 -0
  214. package/components/u-toolbar/u-toolbar.vue +102 -0
  215. package/components/u-tooltip/props.js +59 -0
  216. package/components/u-tooltip/u-tooltip.vue +366 -0
  217. package/components/u-tr/props.js +5 -0
  218. package/components/u-tr/u-tr.vue +31 -0
  219. package/components/u-transition/nvue.ani-map.js +68 -0
  220. package/components/u-transition/props.js +24 -0
  221. package/components/u-transition/transition.js +157 -0
  222. package/components/u-transition/u-transition.vue +92 -0
  223. package/components/u-transition/vue.ani-style.scss +113 -0
  224. package/components/u-upload/mixin.js +21 -0
  225. package/components/u-upload/props.js +124 -0
  226. package/components/u-upload/u-upload.vue +558 -0
  227. package/components/u-upload/utils.js +151 -0
  228. package/components/uview-plus/uview-plus.vue +15 -0
  229. package/index.js +77 -0
  230. package/index.scss +23 -0
  231. package/libs/config/color.js +17 -0
  232. package/libs/config/config.js +34 -0
  233. package/libs/config/props/actionSheet.js +25 -0
  234. package/libs/config/props/album.js +25 -0
  235. package/libs/config/props/alert.js +22 -0
  236. package/libs/config/props/avatar.js +28 -0
  237. package/libs/config/props/avatarGroup.js +23 -0
  238. package/libs/config/props/backtop.js +27 -0
  239. package/libs/config/props/badge.js +27 -0
  240. package/libs/config/props/button.js +42 -0
  241. package/libs/config/props/calendar.js +42 -0
  242. package/libs/config/props/carKeyboard.js +15 -0
  243. package/libs/config/props/cell.js +35 -0
  244. package/libs/config/props/cellGroup.js +17 -0
  245. package/libs/config/props/checkbox.js +27 -0
  246. package/libs/config/props/checkboxGroup.js +29 -0
  247. package/libs/config/props/circleProgress.js +15 -0
  248. package/libs/config/props/code.js +21 -0
  249. package/libs/config/props/codeInput.js +29 -0
  250. package/libs/config/props/col.js +19 -0
  251. package/libs/config/props/collapse.js +17 -0
  252. package/libs/config/props/collapseItem.js +25 -0
  253. package/libs/config/props/columnNotice.js +24 -0
  254. package/libs/config/props/countDown.js +18 -0
  255. package/libs/config/props/countTo.js +25 -0
  256. package/libs/config/props/datetimePicker.js +36 -0
  257. package/libs/config/props/divider.js +23 -0
  258. package/libs/config/props/empty.js +26 -0
  259. package/libs/config/props/form.js +22 -0
  260. package/libs/config/props/formItem.js +22 -0
  261. package/libs/config/props/gap.js +19 -0
  262. package/libs/config/props/grid.js +17 -0
  263. package/libs/config/props/gridItem.js +16 -0
  264. package/libs/config/props/icon.js +36 -0
  265. package/libs/config/props/image.js +30 -0
  266. package/libs/config/props/indexAnchor.js +19 -0
  267. package/libs/config/props/indexList.js +19 -0
  268. package/libs/config/props/input.js +48 -0
  269. package/libs/config/props/keyboard.js +30 -0
  270. package/libs/config/props/line.js +20 -0
  271. package/libs/config/props/lineProgress.js +19 -0
  272. package/libs/config/props/link.js +26 -0
  273. package/libs/config/props/list.js +28 -0
  274. package/libs/config/props/listItem.js +15 -0
  275. package/libs/config/props/loadingIcon.js +30 -0
  276. package/libs/config/props/loadingPage.js +23 -0
  277. package/libs/config/props/loadmore.js +32 -0
  278. package/libs/config/props/modal.js +30 -0
  279. package/libs/config/props/navbar.js +32 -0
  280. package/libs/config/props/noNetwork.js +18 -0
  281. package/libs/config/props/noticeBar.js +27 -0
  282. package/libs/config/props/notify.js +22 -0
  283. package/libs/config/props/numberBox.js +35 -0
  284. package/libs/config/props/numberKeyboard.js +17 -0
  285. package/libs/config/props/overlay.js +18 -0
  286. package/libs/config/props/parse.js +22 -0
  287. package/libs/config/props/picker.js +29 -0
  288. package/libs/config/props/popup.js +29 -0
  289. package/libs/config/props/radio.js +27 -0
  290. package/libs/config/props/radioGroup.js +30 -0
  291. package/libs/config/props/rate.js +26 -0
  292. package/libs/config/props/readMore.js +22 -0
  293. package/libs/config/props/row.js +17 -0
  294. package/libs/config/props/rowNotice.js +21 -0
  295. package/libs/config/props/scrollList.js +20 -0
  296. package/libs/config/props/search.js +37 -0
  297. package/libs/config/props/section.js +24 -0
  298. package/libs/config/props/skeleton.js +25 -0
  299. package/libs/config/props/slider.js +25 -0
  300. package/libs/config/props/statusBar.js +15 -0
  301. package/libs/config/props/steps.js +21 -0
  302. package/libs/config/props/stepsItem.js +18 -0
  303. package/libs/config/props/sticky.js +20 -0
  304. package/libs/config/props/subsection.js +23 -0
  305. package/libs/config/props/swipeAction.js +15 -0
  306. package/libs/config/props/swipeActionItem.js +21 -0
  307. package/libs/config/props/swiper.js +39 -0
  308. package/libs/config/props/swipterIndicator.js +19 -0
  309. package/libs/config/props/switch.js +24 -0
  310. package/libs/config/props/tabbar.js +22 -0
  311. package/libs/config/props/tabbarItem.js +20 -0
  312. package/libs/config/props/tabs.js +32 -0
  313. package/libs/config/props/tag.js +29 -0
  314. package/libs/config/props/text.js +38 -0
  315. package/libs/config/props/textarea.js +36 -0
  316. package/libs/config/props/toast.js +30 -0
  317. package/libs/config/props/toolbar.js +21 -0
  318. package/libs/config/props/tooltip.js +25 -0
  319. package/libs/config/props/transition.js +18 -0
  320. package/libs/config/props/upload.js +36 -0
  321. package/libs/config/props.js +190 -0
  322. package/libs/config/zIndex.js +20 -0
  323. package/libs/css/color.scss +155 -0
  324. package/libs/css/common.scss +97 -0
  325. package/libs/css/components.scss +15 -0
  326. package/libs/css/flex.scss +257 -0
  327. package/libs/css/h5.scss +0 -0
  328. package/libs/css/mixin.scss +8 -0
  329. package/libs/css/mp.scss +0 -0
  330. package/libs/css/nvue.scss +0 -0
  331. package/libs/css/vue.scss +27 -0
  332. package/libs/function/colorGradient.js +134 -0
  333. package/libs/function/debounce.js +29 -0
  334. package/libs/function/digit.js +167 -0
  335. package/libs/function/index.js +708 -0
  336. package/libs/function/platform.js +75 -0
  337. package/libs/function/test.js +288 -0
  338. package/libs/function/throttle.js +30 -0
  339. package/libs/luch-request/adapters/index.js +97 -0
  340. package/libs/luch-request/core/InterceptorManager.js +50 -0
  341. package/libs/luch-request/core/Request.js +198 -0
  342. package/libs/luch-request/core/buildFullPath.js +20 -0
  343. package/libs/luch-request/core/defaults.js +29 -0
  344. package/libs/luch-request/core/dispatchRequest.js +3 -0
  345. package/libs/luch-request/core/mergeConfig.js +103 -0
  346. package/libs/luch-request/core/settle.js +16 -0
  347. package/libs/luch-request/helpers/buildURL.js +69 -0
  348. package/libs/luch-request/helpers/combineURLs.js +14 -0
  349. package/libs/luch-request/helpers/isAbsoluteURL.js +14 -0
  350. package/libs/luch-request/index.d.ts +116 -0
  351. package/libs/luch-request/index.js +3 -0
  352. package/libs/luch-request/utils/clone.js +264 -0
  353. package/libs/luch-request/utils.js +131 -0
  354. package/libs/mixin/button.js +13 -0
  355. package/libs/mixin/mixin.js +160 -0
  356. package/libs/mixin/mpMixin.js +8 -0
  357. package/libs/mixin/mpShare.js +13 -0
  358. package/libs/mixin/openType.js +25 -0
  359. package/libs/mixin/style.js +228 -0
  360. package/libs/mixin/touch.js +59 -0
  361. package/libs/util/async-validator.js +1343 -0
  362. package/libs/util/calendar.js +546 -0
  363. package/libs/util/emitter.js +51 -0
  364. package/libs/util/route.js +124 -0
  365. package/package.json +91 -0
  366. package/theme.scss +44 -0
@@ -0,0 +1,708 @@
1
+ import test from './test.js'
2
+ import { round } from './digit.js'
3
+ /**
4
+ * @description 如果value小于min,取min;如果value大于max,取max
5
+ * @param {number} min
6
+ * @param {number} max
7
+ * @param {number} value
8
+ */
9
+ function range(min = 0, max = 0, value = 0) {
10
+ return Math.max(min, Math.min(max, Number(value)))
11
+ }
12
+
13
+ /**
14
+ * @description 用于获取用户传递值的px值 如果用户传递了"xxpx"或者"xxrpx",取出其数值部分,如果是"xxxrpx"还需要用过uni.upx2px进行转换
15
+ * @param {number|string} value 用户传递值的px值
16
+ * @param {boolean} unit
17
+ * @returns {number|string}
18
+ */
19
+ function getPx(value, unit = false) {
20
+ if (test.number(value)) {
21
+ return unit ? `${value}px` : Number(value)
22
+ }
23
+ // 如果带有rpx,先取出其数值部分,再转为px值
24
+ if (/(rpx|upx)$/.test(value)) {
25
+ return unit ? `${uni.upx2px(parseInt(value))}px` : Number(uni.upx2px(parseInt(value)))
26
+ }
27
+ return unit ? `${parseInt(value)}px` : parseInt(value)
28
+ }
29
+
30
+ /**
31
+ * @description 进行延时,以达到可以简写代码的目的 比如: await uni.$u.sleep(20)将会阻塞20ms
32
+ * @param {number} value 堵塞时间 单位ms 毫秒
33
+ * @returns {Promise} 返回promise
34
+ */
35
+ function sleep(value = 30) {
36
+ return new Promise((resolve) => {
37
+ setTimeout(() => {
38
+ resolve()
39
+ }, value)
40
+ })
41
+ }
42
+ /**
43
+ * @description 运行期判断平台
44
+ * @returns {string} 返回所在平台(小写)
45
+ * @link 运行期判断平台 https://uniapp.dcloud.io/frame?id=判断平台
46
+ */
47
+ function os() {
48
+ return uni.getSystemInfoSync().platform.toLowerCase()
49
+ }
50
+ /**
51
+ * @description 获取系统信息同步接口
52
+ * @link 获取系统信息同步接口 https://uniapp.dcloud.io/api/system/info?id=getsysteminfosync
53
+ */
54
+ function sys() {
55
+ return uni.getSystemInfoSync()
56
+ }
57
+
58
+ /**
59
+ * @description 取一个区间数
60
+ * @param {Number} min 最小值
61
+ * @param {Number} max 最大值
62
+ */
63
+ function random(min, max) {
64
+ if (min >= 0 && max > 0 && max >= min) {
65
+ const gab = max - min + 1
66
+ return Math.floor(Math.random() * gab + min)
67
+ }
68
+ return 0
69
+ }
70
+
71
+ /**
72
+ * @param {Number} len uuid的长度
73
+ * @param {Boolean} firstU 将返回的首字母置为"u"
74
+ * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
75
+ */
76
+ function guid(len = 32, firstU = true, radix = null) {
77
+ const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')
78
+ const uuid = []
79
+ radix = radix || chars.length
80
+
81
+ if (len) {
82
+ // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
83
+ for (let i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix]
84
+ } else {
85
+ let r
86
+ // rfc4122标准要求返回的uuid中,某些位为固定的字符
87
+ uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'
88
+ uuid[14] = '4'
89
+
90
+ for (let i = 0; i < 36; i++) {
91
+ if (!uuid[i]) {
92
+ r = 0 | Math.random() * 16
93
+ uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r]
94
+ }
95
+ }
96
+ }
97
+ // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
98
+ if (firstU) {
99
+ uuid.shift()
100
+ return `u${uuid.join('')}`
101
+ }
102
+ return uuid.join('')
103
+ }
104
+
105
+ /**
106
+ * @description 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
107
+ this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
108
+ 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
109
+ 值(默认为undefined),就是查找最顶层的$parent
110
+ * @param {string|undefined} name 父组件的参数名
111
+ */
112
+ function $parent(name = undefined) {
113
+ let parent = this.$parent
114
+ // 通过while历遍,这里主要是为了H5需要多层解析的问题
115
+ while (parent) {
116
+ // 父组件
117
+ if (parent.$options && parent.$options.name !== name) {
118
+ // 如果组件的name不相等,继续上一级寻找
119
+ parent = parent.$parent
120
+ } else {
121
+ return parent
122
+ }
123
+ }
124
+ return false
125
+ }
126
+
127
+ /**
128
+ * @description 样式转换
129
+ * 对象转字符串,或者字符串转对象
130
+ * @param {object | string} customStyle 需要转换的目标
131
+ * @param {String} target 转换的目的,object-转为对象,string-转为字符串
132
+ * @returns {object|string}
133
+ */
134
+ function addStyle(customStyle, target = 'object') {
135
+ // 字符串转字符串,对象转对象情形,直接返回
136
+ if (test.empty(customStyle) || typeof(customStyle) === 'object' && target === 'object' || target === 'string' &&
137
+ typeof(customStyle) === 'string') {
138
+ return customStyle
139
+ }
140
+ // 字符串转对象
141
+ if (target === 'object') {
142
+ // 去除字符串样式中的两端空格(中间的空格不能去掉,比如padding: 20px 0如果去掉了就错了),空格是无用的
143
+ customStyle = trim(customStyle)
144
+ // 根据";"将字符串转为数组形式
145
+ const styleArray = customStyle.split(';')
146
+ const style = {}
147
+ // 历遍数组,拼接成对象
148
+ for (let i = 0; i < styleArray.length; i++) {
149
+ // 'font-size:20px;color:red;',如此最后字符串有";"的话,会导致styleArray最后一个元素为空字符串,这里需要过滤
150
+ if (styleArray[i]) {
151
+ const item = styleArray[i].split(':')
152
+ style[trim(item[0])] = trim(item[1])
153
+ }
154
+ }
155
+ return style
156
+ }
157
+ // 这里为对象转字符串形式
158
+ let string = ''
159
+ for (const i in customStyle) {
160
+ // 驼峰转为中划线的形式,否则css内联样式,无法识别驼峰样式属性名
161
+ const key = i.replace(/([A-Z])/g, '-$1').toLowerCase()
162
+ string += `${key}:${customStyle[i]};`
163
+ }
164
+ // 去除两端空格
165
+ return trim(string)
166
+ }
167
+
168
+ /**
169
+ * @description 添加单位,如果有rpx,upx,%,px等单位结尾或者值为auto,直接返回,否则加上px单位结尾
170
+ * @param {string|number} value 需要添加单位的值
171
+ * @param {string} unit 添加的单位名 比如px
172
+ */
173
+ function addUnit(value = 'auto', unit = '') {
174
+ if (!unit) {
175
+ unit = uni.$u.config.unit || 'px'
176
+ }
177
+ value = String(value)
178
+ // 用uView内置验证规则中的number判断是否为数值
179
+ return test.number(value) ? `${value}${unit}` : value
180
+ }
181
+
182
+ /**
183
+ * @description 深度克隆
184
+ * @param {object} obj 需要深度克隆的对象
185
+ * @returns {*} 克隆后的对象或者原值(不是对象)
186
+ */
187
+ function deepClone(obj) {
188
+ // 对常见的“非”值,直接返回原来值
189
+ if ([null, undefined, NaN, false].includes(obj)) return obj
190
+ if (typeof obj !== 'object' && typeof obj !== 'function') {
191
+ // 原始类型直接返回
192
+ return obj
193
+ }
194
+ const o = test.array(obj) ? [] : {}
195
+ for (const i in obj) {
196
+ if (obj.hasOwnProperty(i)) {
197
+ o[i] = typeof obj[i] === 'object' ? deepClone(obj[i]) : obj[i]
198
+ }
199
+ }
200
+ return o
201
+ }
202
+
203
+ /**
204
+ * @description JS对象深度合并
205
+ * @param {object} target 需要拷贝的对象
206
+ * @param {object} source 拷贝的来源对象
207
+ * @returns {object|boolean} 深度合并后的对象或者false(入参有不是对象)
208
+ */
209
+ function deepMerge(target = {}, source = {}) {
210
+ target = deepClone(target)
211
+ if (typeof target !== 'object' || typeof source !== 'object') return false
212
+ for (const prop in source) {
213
+ if (!source.hasOwnProperty(prop)) continue
214
+ if (prop in target) {
215
+ if (typeof target[prop] !== 'object') {
216
+ target[prop] = source[prop]
217
+ } else if (typeof source[prop] !== 'object') {
218
+ target[prop] = source[prop]
219
+ } else if (target[prop].concat && source[prop].concat) {
220
+ target[prop] = target[prop].concat(source[prop])
221
+ } else {
222
+ target[prop] = deepMerge(target[prop], source[prop])
223
+ }
224
+ } else {
225
+ target[prop] = source[prop]
226
+ }
227
+ }
228
+ return target
229
+ }
230
+
231
+ /**
232
+ * @description error提示
233
+ * @param {*} err 错误内容
234
+ */
235
+ function error(err) {
236
+ // 开发环境才提示,生产环境不会提示
237
+ if (process.env.NODE_ENV === 'development') {
238
+ console.error(`uView提示:${err}`)
239
+ }
240
+ }
241
+
242
+ /**
243
+ * @description 打乱数组
244
+ * @param {array} array 需要打乱的数组
245
+ * @returns {array} 打乱后的数组
246
+ */
247
+ function randomArray(array = []) {
248
+ // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
249
+ return array.sort(() => Math.random() - 0.5)
250
+ }
251
+
252
+ // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
253
+ // 所以这里做一个兼容polyfill的兼容处理
254
+ if (!String.prototype.padStart) {
255
+ // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
256
+ String.prototype.padStart = function(maxLength, fillString = ' ') {
257
+ if (Object.prototype.toString.call(fillString) !== '[object String]') {
258
+ throw new TypeError(
259
+ 'fillString must be String'
260
+ )
261
+ }
262
+ const str = this
263
+ // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
264
+ if (str.length >= maxLength) return String(str)
265
+
266
+ const fillLength = maxLength - str.length
267
+ let times = Math.ceil(fillLength / fillString.length)
268
+ while (times >>= 1) {
269
+ fillString += fillString
270
+ if (times === 1) {
271
+ fillString += fillString
272
+ }
273
+ }
274
+ return fillString.slice(0, fillLength) + str
275
+ }
276
+ }
277
+
278
+ /**
279
+ * @description 格式化时间
280
+ * @param {String|Number} dateTime 需要格式化的时间戳
281
+ * @param {String} fmt 格式化规则 yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合 默认yyyy-mm-dd
282
+ * @returns {string} 返回格式化后的字符串
283
+ */
284
+ function timeFormat(dateTime = null, formatStr = 'yyyy-mm-dd') {
285
+ let date
286
+ // 若传入时间为假值,则取当前时间
287
+ if (!dateTime) {
288
+ date = new Date()
289
+ }
290
+ // 若为unix秒时间戳,则转为毫秒时间戳(逻辑有点奇怪,但不敢改,以保证历史兼容)
291
+ else if (/^\d{10}$/.test(dateTime.toString().trim())) {
292
+ date = new Date(dateTime * 1000)
293
+ }
294
+ // 若用户传入字符串格式时间戳,new Date无法解析,需做兼容
295
+ else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) {
296
+ date = new Date(Number(dateTime))
297
+ }
298
+ // 其他都认为符合 RFC 2822 规范
299
+ else {
300
+ // 处理平台性差异,在Safari/Webkit中,new Date仅支持/作为分割符的字符串时间
301
+ date = new Date(
302
+ typeof dateTime === 'string'
303
+ ? dateTime.replace(/-/g, '/')
304
+ : dateTime
305
+ )
306
+ }
307
+
308
+ const timeSource = {
309
+ 'y': date.getFullYear().toString(), // 年
310
+ 'm': (date.getMonth() + 1).toString().padStart(2, '0'), // 月
311
+ 'd': date.getDate().toString().padStart(2, '0'), // 日
312
+ 'h': date.getHours().toString().padStart(2, '0'), // 时
313
+ 'M': date.getMinutes().toString().padStart(2, '0'), // 分
314
+ 's': date.getSeconds().toString().padStart(2, '0') // 秒
315
+ // 有其他格式化字符需求可以继续添加,必须转化成字符串
316
+ }
317
+
318
+ for (const key in timeSource) {
319
+ const [ret] = new RegExp(`${key}+`).exec(formatStr) || []
320
+ if (ret) {
321
+ // 年可能只需展示两位
322
+ const beginIndex = key === 'y' && ret.length === 2 ? 2 : 0
323
+ formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex))
324
+ }
325
+ }
326
+
327
+ return formatStr
328
+ }
329
+
330
+ /**
331
+ * @description 时间戳转为多久之前
332
+ * @param {String|Number} timestamp 时间戳
333
+ * @param {String|Boolean} format
334
+ * 格式化规则如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
335
+ * 如果为布尔值false,无论什么时间,都返回多久以前的格式
336
+ * @returns {string} 转化后的内容
337
+ */
338
+ function timeFrom(timestamp = null, format = 'yyyy-mm-dd') {
339
+ if (timestamp == null) timestamp = Number(new Date())
340
+ timestamp = parseInt(timestamp)
341
+ // 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
342
+ if (timestamp.toString().length == 10) timestamp *= 1000
343
+ let timer = (new Date()).getTime() - timestamp
344
+ timer = parseInt(timer / 1000)
345
+ // 如果小于5分钟,则返回"刚刚",其他以此类推
346
+ let tips = ''
347
+ switch (true) {
348
+ case timer < 300:
349
+ tips = '刚刚'
350
+ break
351
+ case timer >= 300 && timer < 3600:
352
+ tips = `${parseInt(timer / 60)}分钟前`
353
+ break
354
+ case timer >= 3600 && timer < 86400:
355
+ tips = `${parseInt(timer / 3600)}小时前`
356
+ break
357
+ case timer >= 86400 && timer < 2592000:
358
+ tips = `${parseInt(timer / 86400)}天前`
359
+ break
360
+ default:
361
+ // 如果format为false,则无论什么时间戳,都显示xx之前
362
+ if (format === false) {
363
+ if (timer >= 2592000 && timer < 365 * 86400) {
364
+ tips = `${parseInt(timer / (86400 * 30))}个月前`
365
+ } else {
366
+ tips = `${parseInt(timer / (86400 * 365))}年前`
367
+ }
368
+ } else {
369
+ tips = timeFormat(timestamp, format)
370
+ }
371
+ }
372
+ return tips
373
+ }
374
+
375
+ /**
376
+ * @description 去除空格
377
+ * @param String str 需要去除空格的字符串
378
+ * @param String pos both(左右)|left|right|all 默认both
379
+ */
380
+ function trim(str, pos = 'both') {
381
+ str = String(str)
382
+ if (pos == 'both') {
383
+ return str.replace(/^\s+|\s+$/g, '')
384
+ }
385
+ if (pos == 'left') {
386
+ return str.replace(/^\s*/, '')
387
+ }
388
+ if (pos == 'right') {
389
+ return str.replace(/(\s*$)/g, '')
390
+ }
391
+ if (pos == 'all') {
392
+ return str.replace(/\s+/g, '')
393
+ }
394
+ return str
395
+ }
396
+
397
+ /**
398
+ * @description 对象转url参数
399
+ * @param {object} data,对象
400
+ * @param {Boolean} isPrefix,是否自动加上"?"
401
+ * @param {string} arrayFormat 规则 indices|brackets|repeat|comma
402
+ */
403
+ function queryParams(data = {}, isPrefix = true, arrayFormat = 'brackets') {
404
+ const prefix = isPrefix ? '?' : ''
405
+ const _result = []
406
+ if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets'
407
+ for (const key in data) {
408
+ const value = data[key]
409
+ // 去掉为空的参数
410
+ if (['', undefined, null].indexOf(value) >= 0) {
411
+ continue
412
+ }
413
+ // 如果值为数组,另行处理
414
+ if (value.constructor === Array) {
415
+ // e.g. {ids: [1, 2, 3]}
416
+ switch (arrayFormat) {
417
+ case 'indices':
418
+ // 结果: ids[0]=1&ids[1]=2&ids[2]=3
419
+ for (let i = 0; i < value.length; i++) {
420
+ _result.push(`${key}[${i}]=${value[i]}`)
421
+ }
422
+ break
423
+ case 'brackets':
424
+ // 结果: ids[]=1&ids[]=2&ids[]=3
425
+ value.forEach((_value) => {
426
+ _result.push(`${key}[]=${_value}`)
427
+ })
428
+ break
429
+ case 'repeat':
430
+ // 结果: ids=1&ids=2&ids=3
431
+ value.forEach((_value) => {
432
+ _result.push(`${key}=${_value}`)
433
+ })
434
+ break
435
+ case 'comma':
436
+ // 结果: ids=1,2,3
437
+ let commaStr = ''
438
+ value.forEach((_value) => {
439
+ commaStr += (commaStr ? ',' : '') + _value
440
+ })
441
+ _result.push(`${key}=${commaStr}`)
442
+ break
443
+ default:
444
+ value.forEach((_value) => {
445
+ _result.push(`${key}[]=${_value}`)
446
+ })
447
+ }
448
+ } else {
449
+ _result.push(`${key}=${value}`)
450
+ }
451
+ }
452
+ return _result.length ? prefix + _result.join('&') : ''
453
+ }
454
+
455
+ /**
456
+ * 显示消息提示框
457
+ * @param {String} title 提示的内容,长度与 icon 取值有关。
458
+ * @param {Number} duration 提示的延迟时间,单位毫秒,默认:2000
459
+ */
460
+ function toast(title, duration = 2000) {
461
+ uni.showToast({
462
+ title: String(title),
463
+ icon: 'none',
464
+ duration
465
+ })
466
+ }
467
+
468
+ /**
469
+ * @description 根据主题type值,获取对应的图标
470
+ * @param {String} type 主题名称,primary|info|error|warning|success
471
+ * @param {boolean} fill 是否使用fill填充实体的图标
472
+ */
473
+ function type2icon(type = 'success', fill = false) {
474
+ // 如果非预置值,默认为success
475
+ if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success'
476
+ let iconName = ''
477
+ // 目前(2019-12-12),info和primary使用同一个图标
478
+ switch (type) {
479
+ case 'primary':
480
+ iconName = 'info-circle'
481
+ break
482
+ case 'info':
483
+ iconName = 'info-circle'
484
+ break
485
+ case 'error':
486
+ iconName = 'close-circle'
487
+ break
488
+ case 'warning':
489
+ iconName = 'error-circle'
490
+ break
491
+ case 'success':
492
+ iconName = 'checkmark-circle'
493
+ break
494
+ default:
495
+ iconName = 'checkmark-circle'
496
+ }
497
+ // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
498
+ if (fill) iconName += '-fill'
499
+ return iconName
500
+ }
501
+
502
+ /**
503
+ * @description 数字格式化
504
+ * @param {number|string} number 要格式化的数字
505
+ * @param {number} decimals 保留几位小数
506
+ * @param {string} decimalPoint 小数点符号
507
+ * @param {string} thousandsSeparator 千分位符号
508
+ * @returns {string} 格式化后的数字
509
+ */
510
+ function priceFormat(number, decimals = 0, decimalPoint = '.', thousandsSeparator = ',') {
511
+ number = (`${number}`).replace(/[^0-9+-Ee.]/g, '')
512
+ const n = !isFinite(+number) ? 0 : +number
513
+ const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals)
514
+ const sep = (typeof thousandsSeparator === 'undefined') ? ',' : thousandsSeparator
515
+ const dec = (typeof decimalPoint === 'undefined') ? '.' : decimalPoint
516
+ let s = ''
517
+
518
+ s = (prec ? round(n, prec) + '' : `${Math.round(n)}`).split('.')
519
+ const re = /(-?\d+)(\d{3})/
520
+ while (re.test(s[0])) {
521
+ s[0] = s[0].replace(re, `$1${sep}$2`)
522
+ }
523
+
524
+ if ((s[1] || '').length < prec) {
525
+ s[1] = s[1] || ''
526
+ s[1] += new Array(prec - s[1].length + 1).join('0')
527
+ }
528
+ return s.join(dec)
529
+ }
530
+
531
+ /**
532
+ * @description 获取duration值
533
+ * 如果带有ms或者s直接返回,如果大于一定值,认为是ms单位,小于一定值,认为是s单位
534
+ * 比如以30位阈值,那么300大于30,可以理解为用户想要的是300ms,而不是想花300s去执行一个动画
535
+ * @param {String|number} value 比如: "1s"|"100ms"|1|100
536
+ * @param {boolean} unit 提示: 如果是false 默认返回number
537
+ * @return {string|number}
538
+ */
539
+ function getDuration(value, unit = true) {
540
+ const valueNum = parseInt(value)
541
+ if (unit) {
542
+ if (/s$/.test(value)) return value
543
+ return value > 30 ? `${value}ms` : `${value}s`
544
+ }
545
+ if (/ms$/.test(value)) return valueNum
546
+ if (/s$/.test(value)) return valueNum > 30 ? valueNum : valueNum * 1000
547
+ return valueNum
548
+ }
549
+
550
+ /**
551
+ * @description 日期的月或日补零操作
552
+ * @param {String} value 需要补零的值
553
+ */
554
+ function padZero(value) {
555
+ return `00${value}`.slice(-2)
556
+ }
557
+
558
+ /**
559
+ * @description 在u-form的子组件内容发生变化,或者失去焦点时,尝试通知u-form执行校验方法
560
+ * @param {*} instance
561
+ * @param {*} event
562
+ */
563
+ function formValidate(instance, event) {
564
+ const formItem = uni.$u.$parent.call(instance, 'u-form-item')
565
+ const form = uni.$u.$parent.call(instance, 'u-form')
566
+ // 如果发生变化的input或者textarea等,其父组件中有u-form-item或者u-form等,就执行form的validate方法
567
+ // 同时将form-item的pros传递给form,让其进行精确对象验证
568
+ if (formItem && form) {
569
+ form.validateField(formItem.prop, () => {}, event)
570
+ }
571
+ }
572
+
573
+ /**
574
+ * @description 获取某个对象下的属性,用于通过类似'a.b.c'的形式去获取一个对象的的属性的形式
575
+ * @param {object} obj 对象
576
+ * @param {string} key 需要获取的属性字段
577
+ * @returns {*}
578
+ */
579
+ function getProperty(obj, key) {
580
+ if (!obj) {
581
+ return
582
+ }
583
+ if (typeof key !== 'string' || key === '') {
584
+ return ''
585
+ }
586
+ if (key.indexOf('.') !== -1) {
587
+ const keys = key.split('.')
588
+ let firstObj = obj[keys[0]] || {}
589
+
590
+ for (let i = 1; i < keys.length; i++) {
591
+ if (firstObj) {
592
+ firstObj = firstObj[keys[i]]
593
+ }
594
+ }
595
+ return firstObj
596
+ }
597
+ return obj[key]
598
+ }
599
+
600
+ /**
601
+ * @description 设置对象的属性值,如果'a.b.c'的形式进行设置
602
+ * @param {object} obj 对象
603
+ * @param {string} key 需要设置的属性
604
+ * @param {string} value 设置的值
605
+ */
606
+ function setProperty(obj, key, value) {
607
+ if (!obj) {
608
+ return
609
+ }
610
+ // 递归赋值
611
+ const inFn = function(_obj, keys, v) {
612
+ // 最后一个属性key
613
+ if (keys.length === 1) {
614
+ _obj[keys[0]] = v
615
+ return
616
+ }
617
+ // 0~length-1个key
618
+ while (keys.length > 1) {
619
+ const k = keys[0]
620
+ if (!_obj[k] || (typeof _obj[k] !== 'object')) {
621
+ _obj[k] = {}
622
+ }
623
+ const key = keys.shift()
624
+ // 自调用判断是否存在属性,不存在则自动创建对象
625
+ inFn(_obj[k], keys, v)
626
+ }
627
+ }
628
+
629
+ if (typeof key !== 'string' || key === '') {
630
+
631
+ } else if (key.indexOf('.') !== -1) { // 支持多层级赋值操作
632
+ const keys = key.split('.')
633
+ inFn(obj, keys, value)
634
+ } else {
635
+ obj[key] = value
636
+ }
637
+ }
638
+
639
+ /**
640
+ * @description 获取当前页面路径
641
+ */
642
+ function page() {
643
+ const pages = getCurrentPages()
644
+ // 某些特殊情况下(比如页面进行redirectTo时的一些时机),pages可能为空数组
645
+ return `/${pages[pages.length - 1].route || ''}`
646
+ }
647
+
648
+ /**
649
+ * @description 获取当前路由栈实例数组
650
+ */
651
+ function pages() {
652
+ const pages = getCurrentPages()
653
+ return pages
654
+ }
655
+
656
+ /**
657
+ * @description 修改uView内置属性值
658
+ * @param {object} props 修改内置props属性
659
+ * @param {object} config 修改内置config属性
660
+ * @param {object} color 修改内置color属性
661
+ * @param {object} zIndex 修改内置zIndex属性
662
+ */
663
+ function setConfig({
664
+ props = {},
665
+ config = {},
666
+ color = {},
667
+ zIndex = {}
668
+ }) {
669
+ const {
670
+ deepMerge,
671
+ } = uni.$u
672
+ uni.$u.config = deepMerge(uni.$u.config, config)
673
+ uni.$u.props = deepMerge(uni.$u.props, props)
674
+ uni.$u.color = deepMerge(uni.$u.color, color)
675
+ uni.$u.zIndex = deepMerge(uni.$u.zIndex, zIndex)
676
+ }
677
+
678
+ export default {
679
+ range,
680
+ getPx,
681
+ sleep,
682
+ os,
683
+ sys,
684
+ random,
685
+ guid,
686
+ $parent,
687
+ addStyle,
688
+ addUnit,
689
+ deepClone,
690
+ deepMerge,
691
+ error,
692
+ randomArray,
693
+ timeFormat,
694
+ timeFrom,
695
+ trim,
696
+ queryParams,
697
+ toast,
698
+ type2icon,
699
+ priceFormat,
700
+ getDuration,
701
+ padZero,
702
+ formValidate,
703
+ getProperty,
704
+ setProperty,
705
+ page,
706
+ pages,
707
+ setConfig
708
+ }