@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,167 @@
1
+ <template>
2
+ <view class="fui-rate-class fui-rate-box" @touchmove="touchMove">
3
+ <block v-for="(item, index) in quantity" :key="index">
4
+ <view
5
+ class="fui-icon fui-relative"
6
+ :class="['fui-icon-collection' + (hollow && (current <= index || (disabled && current <= index + 1)) ? '' : '-fill')]"
7
+ :data-index="index"
8
+ @tap="handleTap"
9
+ :style="{ fontSize: size + 'px', color: current > index + 1 || (!disabled && current > index) ? active : normal }"
10
+ >
11
+ <view
12
+ class="fui-icon fui-icon-main fui-icon-collection-fill"
13
+ v-if="disabled && current == index + 1"
14
+ :style="{ fontSize: size + 'px', color: active, width: percent + '%' }"
15
+ ></view>
16
+ </view>
17
+ </block>
18
+ </view>
19
+ </template>
20
+
21
+ <script>
22
+ export default {
23
+ name: 'fuiRate',
24
+ props: {
25
+ //数量
26
+ quantity: {
27
+ type: Number,
28
+ default: 5
29
+ },
30
+ //当前选中
31
+ current: {
32
+ type: Number,
33
+ default: 0
34
+ },
35
+ //当前选中星星分数(大于0,小于等于1的数)
36
+ score: {
37
+ type: [Number, String],
38
+ default: 1
39
+ },
40
+ //禁用点击
41
+ disabled: {
42
+ type: Boolean,
43
+ default: false
44
+ },
45
+ //大小
46
+ size: {
47
+ type: Number,
48
+ default: 20
49
+ },
50
+ //未选中颜色
51
+ normal: {
52
+ type: String,
53
+ default: '#b2b2b2'
54
+ },
55
+ //选中颜色
56
+ active: {
57
+ type: String,
58
+ default: '#e41f19'
59
+ },
60
+ //未选中是否为空心
61
+ hollow: {
62
+ type: Boolean,
63
+ default: false
64
+ }
65
+ },
66
+ data() {
67
+ return {
68
+ pageX: 0,
69
+ percent: 0
70
+ };
71
+ },
72
+ created() {
73
+ this.percent = Number(this.score || 0) * 100;
74
+ },
75
+ watch: {
76
+ score(newVal, oldVal) {
77
+ this.percent = Number(newVal || 0) * 100;
78
+ }
79
+ },
80
+ methods: {
81
+ handleTap(e) {
82
+ if (this.disabled) {
83
+ return;
84
+ }
85
+ const index = e.currentTarget.dataset.index;
86
+ this.$emit('change', {
87
+ index: Number(index) + 1
88
+ });
89
+ },
90
+ touchMove(e) {
91
+ if (this.disabled) {
92
+ return;
93
+ }
94
+ if (!e.changedTouches[0]) {
95
+ return;
96
+ }
97
+ const movePageX = e.changedTouches[0].pageX;
98
+ const distance = movePageX - this.pageX;
99
+
100
+ if (distance <= 0) {
101
+ return;
102
+ }
103
+ let index = Math.ceil(distance / this.size);
104
+ index = index > this.count ? this.count : index;
105
+ this.$emit('change', {
106
+ index: index
107
+ });
108
+ }
109
+ },
110
+ mounted() {
111
+ const className = '.fui-rate-box';
112
+ let query = uni.createSelectorQuery().in(this);
113
+ query
114
+ .select(className)
115
+ .boundingClientRect((res) => {
116
+ this.pageX = res.left || 0;
117
+ })
118
+ .exec();
119
+ }
120
+ };
121
+ </script>
122
+
123
+ <style scoped>
124
+ @font-face {
125
+ font-family: 'rateFont';
126
+ src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAT4AA0AAAAAB4wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAE3AAAABoAAAAciBprQUdERUYAAAS8AAAAHgAAAB4AKQALT1MvMgAAAaAAAABDAAAAVj1YSN1jbWFwAAAB+AAAAEIAAAFCAA/qlmdhc3AAAAS0AAAACAAAAAj//wADZ2x5ZgAAAkgAAADwAAABZLMTdXtoZWFkAAABMAAAADAAAAA2FZKISmhoZWEAAAFgAAAAHQAAACQHYgOFaG10eAAAAeQAAAARAAAAEgx6AHpsb2NhAAACPAAAAAwAAAAMAEYAsm1heHAAAAGAAAAAHgAAACABEQBPbmFtZQAAAzgAAAFJAAACiCnmEVVwb3N0AAAEhAAAAC0AAABHLO3vkXjaY2BkYGAA4t2/VF7G89t8ZeBmYQCBm9ZKMnC6ikGMuYXpP5DLwcAEEgUAHPQJOXjaY2BkYGBu+N/AEMPCAALMLQyMDKiABQBQwgLwAAAAeNpjYGRgYGBlcGZgYgABEMkFhAwM/8F8BgAPigFhAAB42mNgZGFgnMDAysDA1Ml0hoGBoR9CM75mMGLkAIoysDIzYAUBaa4pDA7PXj17zdzwv4EhhrmBoQEozAiSAwD/YA2wAHjaY2GAABYIrmKoAgACggEBAAAAeNpjYGBgZoBgGQZGBhCwAfIYwXwWBgUgzQKEQP6z1///A8lX//9LSkJVMjCyMcCYDIxMQIKJARUwMgx7AAA/9QiLAAAAAAAAAAAAAABGALJ42mNgZKhiEGNuYfrPoMnAwGimps+ox6jPqKbEz8jHCMLyjHJAmk1czMie0cxInlHMDChrZs6cJyaosI+NlzmU34I/lImPdb+CoHgXCyujIosYtzTfKlYBtlWyuqwKjKwsjNvFTdlkGDnZ1srKrmXjZJRhMxVvZxFgA+rgYI9iYoriV1TYzybAwsDABHeLBIMT0DUg29VBTjEHucvcjtGeUVyOUZ6JaFcybefnZ5HuFdEX6ZVm5uMvniemxuXmzqUmNs+FeOfHCeiKzfPi4vKaJ6YrUCDOIiM8YYKwDIu4OMRbrOtkZdex4vMWACzGM5B42n2QPU4DMRCFn/MHJBJCIKhdUQDa/JQpEyn0CKWjSDbekGjXXnmdSDkBLRUHoOUYHIAbINFyCl6WSZMia+3o85uZ57EBnOMbCv/fJe6EFY7xKFzBETLhKvUX4Rr5XbiOFj6FG9R/hJu4VQPhFi7UGx1U7YS7m9JtywpnGAhXcIon4Sr1lXCN/CpcxxU+hBvUv4SbGONXuIVrZakM4WEwQWCcQWOKDeMCMRwskjIG1qE59GYSzExPN3oRO5s4GyjvV2KXAx5oOeeAKe09t2a+Sif+YMuB1JhuHgVLtimNLiJ0KBtfLJzV3ahzsP2e7ba02L9rgTXH7FENbNT8Pdsz0khsDK+QkjXyMrekElOPaGus8btnKdbzXgiJTrzL9IjHmjR1OvduaeLA4ufyjBx9tLmSPfeoHD5jWQh5v91OxCCKXYY/k9hxGQAAAHjaY2BigAAuMMnIgA5YwaJMjEyMzPzJ+Tk5qcklmfl58WmZOTlcCD4Ak9QKlAAAAAAAAAH//wACAAEAAAAMAAAAFgAAAAIAAQADAAQAAQAEAAAAAgAAAAB42mNgYGBkAIKrS9Q5QPRNayUZGA0AM8UETgAA)
127
+ format('woff');
128
+ font-weight: normal;
129
+ font-style: normal;
130
+ }
131
+
132
+ .fui-icon {
133
+ font-family: 'rateFont' !important;
134
+ font-style: normal;
135
+ -webkit-font-smoothing: antialiased;
136
+ -moz-osx-font-smoothing: grayscale;
137
+ display: block;
138
+ }
139
+
140
+ .fui-relative {
141
+ position: relative;
142
+ }
143
+
144
+ .fui-icon-main {
145
+ position: absolute;
146
+ height: 100%;
147
+ left: 0;
148
+ top: 0;
149
+ overflow: hidden;
150
+ }
151
+
152
+ .fui-icon-collection-fill:before {
153
+ content: '\e6ea';
154
+ }
155
+
156
+ .fui-icon-collection:before {
157
+ content: '\e6eb';
158
+ }
159
+
160
+ .fui-rate-box {
161
+ display: -webkit-inline-flex;
162
+ display: inline-flex;
163
+ align-items: center;
164
+ margin: 0;
165
+ padding: 0;
166
+ }
167
+ </style>
@@ -0,0 +1,306 @@
1
+ <template>
2
+ <view class="fui-circular-container" :style="{ width: diam + 'px', height: (height || diam) + 'px' }">
3
+ <canvas
4
+ :start="percent"
5
+ :change:start="parse.initDraw"
6
+ :data-width="diam"
7
+ :data-height="height"
8
+ :data-lineWidth="lineWidth"
9
+ :data-lineCap="lineCap"
10
+ :data-fontSize="fontSize"
11
+ :data-fontColor="fontColor"
12
+ :data-fontShow="fontShow"
13
+ :data-percentText="percentText"
14
+ :data-defaultShow="defaultShow"
15
+ :data-defaultColor="defaultColor"
16
+ :data-progressColor="progressColor"
17
+ :data-gradualColor="gradualColor"
18
+ :data-sAngle="sAngle"
19
+ :data-counterclockwise="counterclockwise"
20
+ :data-multiple="multiple"
21
+ :data-speed="speed"
22
+ :data-activeMode="activeMode"
23
+ :data-cid="progressCanvasId"
24
+ :canvas-id="progressCanvasId"
25
+ :class="[progressCanvasId]"
26
+ :style="{ width: diam + 'px', height: (height || diam) + 'px' }"
27
+ ></canvas>
28
+ <slot></slot>
29
+ </view>
30
+ </template>
31
+ <script module="parse" lang="renderjs">
32
+ export default {
33
+ methods: {
34
+ formatStr(str) {
35
+ if (!str) return str;
36
+ return str.replace(/\"/g, '');
37
+ },
38
+ bool(str) {
39
+ return str === 'true' || str == true ? true : false;
40
+ },
41
+ //初始化绘制
42
+ initDraw(percentage, oldPercentage, owner, ins) {
43
+ let state = ins.getState();
44
+ let res = ins.getDataset();
45
+ const activeMode = this.formatStr(res.activemode);
46
+ let start = activeMode === 'backwards' ? 0 : state.startPercentage || 0;
47
+ if (!state.progressContext || !state.canvas) {
48
+ const width = res.width;
49
+ const height = res.height == 0 ? res.width : res.height;
50
+ let ele = `.${res.cid}>canvas`;
51
+ const canvas = document.querySelectorAll(this.formatStr(ele))[0];
52
+ const ctx = canvas.getContext('2d');
53
+ // const dpr =uni.getSystemInfoSync().pixelRatio;
54
+ // canvas.style.width=width+'px';
55
+ // canvas.style.height=height+'px';
56
+ // canvas.width = width * dpr;
57
+ // canvas.height = height * dpr;
58
+ // ctx.scale(dpr, dpr);
59
+ state.progressContext = ctx;
60
+ state.canvas = canvas;
61
+ this.drawProgressCircular(start, ctx, canvas, percentage, res, state, owner);
62
+ } else {
63
+ this.drawProgressCircular(start, state.progressContext, state.canvas, percentage, res, state, owner);
64
+ }
65
+ },
66
+ //默认(背景)圆环
67
+ drawDefaultCircular(ctx, canvas, res) {
68
+ //终止弧度
69
+ let sangle = Number(res.sangle) * Math.PI;
70
+ let eAngle = Math.PI * (res.height != 0 ? 1 : 2) + sangle;
71
+ this.drawArc(ctx, eAngle, this.formatStr(res.defaultcolor), res);
72
+ },
73
+ drawPercentage(ctx, percentage, res) {
74
+ ctx.save(); //save和restore可以保证样式属性只运用于该段canvas元素
75
+ ctx.beginPath();
76
+ ctx.fillStyle = this.formatStr(res.fontcolor);
77
+ ctx.font = res.fontsize + 'px Arial'; //设置字体大小和字体
78
+ ctx.textAlign = 'center';
79
+ ctx.textBaseline = 'middle';
80
+ let radius = res.width / 2;
81
+ let percenttext = this.formatStr(res.percenttext);
82
+ if (!percenttext) {
83
+ let multiple = Number(res.multiple);
84
+ percentage = this.bool(res.counterclockwise) ? 100 - percentage * multiple : percentage * multiple;
85
+ percentage = percentage.toFixed(0) + '%';
86
+ } else {
87
+ percentage = percenttext;
88
+ }
89
+ ctx.fillText(percentage, radius, radius);
90
+ ctx.stroke();
91
+ ctx.restore();
92
+ },
93
+ //进度圆环
94
+ drawProgressCircular(startPercentage, ctx, canvas, percentage, res, state, owner) {
95
+ if (!ctx || !canvas) return;
96
+ let that = this;
97
+ let gradient = ctx.createLinearGradient(0, 0, Number(res.width), 0);
98
+ gradient.addColorStop(0, this.formatStr(res.progresscolor));
99
+ let gradualColor = this.formatStr(res.gradualcolor);
100
+ if (gradualColor) {
101
+ gradient.addColorStop('1', gradualColor);
102
+ }
103
+ let requestId = null;
104
+ let renderLoop = () => {
105
+ drawFrame((res) => {
106
+ if (res) {
107
+ requestId = requestAnimationFrame(renderLoop);
108
+ } else {
109
+ cancelAnimationFrame(requestId);
110
+ requestId = null;
111
+ renderLoop = null;
112
+ }
113
+ });
114
+ };
115
+ requestId = requestAnimationFrame(renderLoop);
116
+
117
+ function drawFrame(callback) {
118
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
119
+ if (that.bool(res.defaultshow)) {
120
+ that.drawDefaultCircular(ctx, canvas, res);
121
+ }
122
+ if (that.bool(res.fontshow)) {
123
+ that.drawPercentage(ctx, startPercentage, res);
124
+ }
125
+ if (percentage === 0 || (that.bool(res.counterclockwise) && startPercentage === 100)) return;
126
+ let sangle = Number(res.sangle) * Math.PI;
127
+ let eAngle = ((2 * Math.PI) / 100) * startPercentage + sangle;
128
+ that.drawArc(ctx, eAngle, gradient, res);
129
+ owner.callMethod('change', {
130
+ percentage: startPercentage
131
+ });
132
+ if (startPercentage >= percentage) {
133
+ state.startPercentage = startPercentage;
134
+ owner.callMethod('end', {
135
+ canvasId: that.formatStr(res.canvasid)
136
+ });
137
+ cancelAnimationFrame(requestId);
138
+ callback && callback(false);
139
+ return;
140
+ }
141
+ let num = startPercentage + Number(res.speed);
142
+ startPercentage = num > percentage ? percentage : num;
143
+ callback && callback(true);
144
+ }
145
+ },
146
+ //创建弧线
147
+ drawArc(ctx, eAngle, strokeStyle, res) {
148
+ ctx.save();
149
+ ctx.beginPath();
150
+ ctx.lineCap = this.formatStr(res.linecap);
151
+ ctx.lineWidth = Number(res.linewidth);
152
+ ctx.strokeStyle = strokeStyle;
153
+ let radius = res.width / 2; //x=y
154
+ let sangle = Number(res.sangle) * Math.PI;
155
+ ctx.arc(radius, radius, radius - res.linewidth, sangle, eAngle, this.bool(res.counterclockwise));
156
+ ctx.stroke();
157
+ ctx.closePath();
158
+ ctx.restore();
159
+ }
160
+ }
161
+ };
162
+ </script>
163
+ <script>
164
+ export default {
165
+ name: 'fuiRoundProgress',
166
+ props: {
167
+ /*
168
+ 传值需使用rpx进行转换保证各终端兼容
169
+ px = rpx / 750 * wx.getSystemInfoSync().windowWidth
170
+ 圆形进度条(画布)宽度,直径 [px]
171
+ */
172
+ diam: {
173
+ type: Number,
174
+ default: 60
175
+ },
176
+ //圆形进度条(画布)高度,默认取diam值[当画半弧时传值,height有值时则取height]
177
+ height: {
178
+ type: Number,
179
+ default: 0
180
+ },
181
+ //进度条线条宽度[px]
182
+ lineWidth: {
183
+ type: Number,
184
+ default: 4
185
+ },
186
+ /*
187
+ 线条的端点样式
188
+ butt:向线条的每个末端添加平直的边缘
189
+ round 向线条的每个末端添加圆形线帽
190
+ square 向线条的每个末端添加正方形线帽
191
+ */
192
+ lineCap: {
193
+ type: String,
194
+ default: 'round'
195
+ },
196
+ //圆环进度字体大小 [px]
197
+ fontSize: {
198
+ type: Number,
199
+ default: 12
200
+ },
201
+ //圆环进度字体颜色
202
+ fontColor: {
203
+ type: String,
204
+ default: '#5677fc'
205
+ },
206
+ //是否显示进度文字
207
+ fontShow: {
208
+ type: Boolean,
209
+ default: true
210
+ },
211
+ /*
212
+ 自定义显示文字[默认为空,显示百分比,fontShow=true时生效]
213
+ 可以使用 slot自定义显示内容
214
+ */
215
+ percentText: {
216
+ type: String,
217
+ default: ''
218
+ },
219
+ //是否显示默认(背景)进度条
220
+ defaultShow: {
221
+ type: Boolean,
222
+ default: true
223
+ },
224
+ //默认进度条颜色
225
+ defaultColor: {
226
+ type: String,
227
+ default: '#CCC'
228
+ },
229
+ //进度条颜色
230
+ progressColor: {
231
+ type: String,
232
+ default: '#5677fc'
233
+ },
234
+ //进度条渐变颜色[结合progressColor使用,默认为空]
235
+ gradualColor: {
236
+ type: String,
237
+ default: ''
238
+ },
239
+ //起始弧度,单位弧度 实际 Math.PI * sAngle
240
+ sAngle: {
241
+ type: Number,
242
+ default: -0.5
243
+ },
244
+ //指定弧度的方向是逆时针还是顺时针。默认是false,即顺时针
245
+ counterclockwise: {
246
+ type: Boolean,
247
+ default: false
248
+ },
249
+ //进度百分比 [10% 传值 10]
250
+ percentage: {
251
+ type: Number,
252
+ default: 0
253
+ },
254
+ //进度百分比缩放倍数[使用半弧为100%时,则可传2]
255
+ multiple: {
256
+ type: Number,
257
+ default: 1
258
+ },
259
+ //动画执行速度,值越大动画越快(0.1~100)
260
+ speed: {
261
+ type: [Number, String],
262
+ default: 1
263
+ },
264
+ //backwards: 动画从头播;forwards:动画从上次结束点接着播
265
+ activeMode: {
266
+ type: String,
267
+ default: 'backwards'
268
+ }
269
+ },
270
+ watch: {
271
+ percentage(val) {
272
+ this.percent = val;
273
+ }
274
+ },
275
+ mounted() {
276
+ setTimeout(() => {
277
+ this.percent = this.percentage;
278
+ }, 50);
279
+ },
280
+ data() {
281
+ return {
282
+ percent: -1,
283
+ progressCanvasId: this.getCanvasId()
284
+ };
285
+ },
286
+ methods: {
287
+ getCanvasId() {
288
+ return 'fui' + new Date().getTime() + (Math.random() * 100000).toFixed(0);
289
+ },
290
+ change(e) {
291
+ //绘制进度
292
+ this.$emit('change', e);
293
+ },
294
+ end(e) {
295
+ //绘制完成
296
+ this.$emit('end', e);
297
+ }
298
+ }
299
+ };
300
+ </script>
301
+
302
+ <style scoped>
303
+ .fui-circular-container {
304
+ position: relative;
305
+ }
306
+ </style>
@@ -0,0 +1,189 @@
1
+ <template>
2
+ <view
3
+ class="fui-scroll-top_box"
4
+ v-show="isIndex || isShare || (visible && toggle)"
5
+ :style="{ bottom: bottom + 'rpx', right: right + 'rpx' }"
6
+ >
7
+ <view class="fui-scroll-top_item" v-if="isIndex" @tap.stop="goIndex">
8
+ <image class="fui-scroll-top_img" :src="indexIcon"></image>
9
+ <view class="fui-scroll-top_text">首页</view>
10
+ </view>
11
+ <button open-type="share" class="fui-share-btn" v-if="isShare && !customShare">
12
+ <view class="fui-scroll-top_item" :class="{ 'fui-scroll-item_top': isIndex }">
13
+ <image class="fui-scroll-top_img" :src="shareIcon"></image>
14
+ </view>
15
+ </button>
16
+ <view class="fui-scroll-top_item" :class="{ 'fui-scroll-item_top': isIndex }" v-if="isShare && customShare" @tap.stop="share">
17
+ <image class="fui-scroll-top_img" :src="shareIcon"></image>
18
+ </view>
19
+ <view
20
+ class="fui-scroll-top_item"
21
+ :class="{ 'fui-scroll-item_top': isIndex || isShare }"
22
+ v-show="visible && toggle"
23
+ @tap.stop="goTop"
24
+ >
25
+ <image class="fui-scroll-top_img" :src="topIcon"></image>
26
+ <view class="fui-scroll-top_text fui-color-white">顶部</view>
27
+ </view>
28
+ </view>
29
+ </template>
30
+
31
+ <script>
32
+ /**
33
+ * 注意:组件中使用的图片地址,将文件复制到自己项目中
34
+ * 如果图片位置与组件同级,编译成小程序时图片会丢失
35
+ * 拷贝static下整个components文件夹
36
+ * 也可直接转成base64(不建议)
37
+ * */
38
+ export default {
39
+ name: 'fuiScrollTop',
40
+ props: {
41
+ //回顶部按钮距离底部距离 rpx
42
+ bottom: {
43
+ type: Number,
44
+ default: 180
45
+ },
46
+ //回顶部按钮距离右侧距离 rpx
47
+ right: {
48
+ type: Number,
49
+ default: 25
50
+ },
51
+ //距离顶部多少距离显示 px
52
+ top: {
53
+ type: Number,
54
+ default: 200
55
+ },
56
+ //滚动距离
57
+ scrollTop: {
58
+ type: Number
59
+ },
60
+ //回顶部滚动时间
61
+ duration: {
62
+ type: Number,
63
+ default: 120
64
+ },
65
+ //是否显示返回首页按钮
66
+ isIndex: {
67
+ type: Boolean,
68
+ default: false
69
+ },
70
+ //是否显示分享图标
71
+ isShare: {
72
+ type: Boolean,
73
+ default: false
74
+ },
75
+ //自定义分享(小程序可使用button=>open-type="share")
76
+ customShare: {
77
+ type: Boolean,
78
+ default: false
79
+ },
80
+ //回顶部icon
81
+ topIcon: {
82
+ type: String,
83
+ default: '/static/components/scroll-top/icon_top_3x.png'
84
+ },
85
+ //回首页icon
86
+ indexIcon: {
87
+ type: String,
88
+ default: '/static/components/scroll-top/icon_index_3x.png'
89
+ },
90
+ //分享icon
91
+ shareIcon: {
92
+ type: String,
93
+ default: '/static/components/scroll-top/icon_share_3x.png'
94
+ }
95
+ },
96
+ watch: {
97
+ scrollTop(newValue, oldValue) {
98
+ this.change();
99
+ }
100
+ },
101
+ data() {
102
+ return {
103
+ //判断是否显示
104
+ visible: false,
105
+ //控制显示,主要解决调用api滚到顶部fixed元素抖动的问题
106
+ toggle: true
107
+ };
108
+ },
109
+ methods: {
110
+ goTop() {
111
+ this.toggle = false;
112
+ uni.pageScrollTo({
113
+ scrollTop: 0,
114
+ duration: this.duration
115
+ });
116
+ setTimeout(() => {
117
+ this.toggle = true;
118
+ }, 220);
119
+ },
120
+ goIndex() {
121
+ this.$emit('index', {});
122
+ },
123
+ share() {
124
+ this.$emit('share', {});
125
+ },
126
+ change() {
127
+ let show = this.scrollTop > this.top;
128
+ if ((show && this.visible) || (!show && !this.visible)) {
129
+ return;
130
+ }
131
+ this.visible = show;
132
+ }
133
+ }
134
+ };
135
+ </script>
136
+
137
+ <style scoped>
138
+ .fui-scroll-top_box {
139
+ width: 80rpx;
140
+ height: 270rpx;
141
+ position: fixed;
142
+ z-index: 9999;
143
+ right: 30rpx;
144
+ bottom: 30rpx;
145
+ font-weight: 400;
146
+ }
147
+
148
+ .fui-scroll-top_item {
149
+ width: 80rpx;
150
+ height: 80rpx;
151
+ position: relative;
152
+ }
153
+
154
+ .fui-scroll-item_top {
155
+ margin-top: 30rpx;
156
+ }
157
+
158
+ .fui-scroll-top_img {
159
+ width: 80rpx;
160
+ height: 80rpx;
161
+ display: block;
162
+ }
163
+
164
+ .fui-scroll-top_text {
165
+ width: 80rpx;
166
+ text-align: center;
167
+ font-size: 24rpx;
168
+ line-height: 24rpx;
169
+ transform: scale(0.92);
170
+ transform-origin: center center;
171
+ position: absolute;
172
+ left: 0;
173
+ bottom: 15rpx;
174
+ }
175
+
176
+ .fui-color-white {
177
+ color: #fff;
178
+ }
179
+ .fui-share-btn {
180
+ background: transparent !important;
181
+ padding: 0;
182
+ margin: 0;
183
+ display: inline;
184
+ border: 0;
185
+ }
186
+ .fui-share-btn::after {
187
+ border: 0;
188
+ }
189
+ </style>