@10yun/cv-mobile-ui 0.5.27 → 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 (918) hide show
  1. package/build/parse-pages.js +50 -14
  2. package/build/parse-pages2.js +11 -10
  3. package/other/uParse/components/wxParseAudio.vue +1 -1
  4. package/other/uParse/components/wxParseVideo.vue +1 -1
  5. package/package.json +1 -1
  6. package/plugins/luch-request/adapters/index.js +131 -0
  7. package/plugins/luch-request/core/InterceptorManager.js +50 -0
  8. package/plugins/luch-request/core/Request.js +199 -0
  9. package/plugins/luch-request/core/buildFullPath.js +20 -0
  10. package/plugins/luch-request/core/defaults.js +32 -0
  11. package/plugins/luch-request/core/dispatchRequest.js +5 -0
  12. package/plugins/luch-request/core/mergeConfig.js +125 -0
  13. package/plugins/luch-request/core/settle.js +16 -0
  14. package/plugins/luch-request/helpers/buildURL.js +71 -0
  15. package/plugins/luch-request/helpers/combineURLs.js +12 -0
  16. package/plugins/luch-request/helpers/isAbsoluteURL.js +14 -0
  17. package/plugins/luch-request/index.d.ts +197 -0
  18. package/plugins/luch-request/index.js +2 -0
  19. package/plugins/luch-request/readme.md +3 -0
  20. package/plugins/luch-request/utils/clone.js +264 -0
  21. package/plugins/luch-request/utils.js +131 -0
  22. package/plugins/request.js +84 -69
  23. package/ui-cv/components/cv-btn-base/cv-btn-base.vue +66 -14
  24. package/ui-cv/components/cv-code-sms/cv-code-sms.vue +22 -15
  25. package/ui-cv/components/cv-date-base/cv-date-base.vue +1 -1
  26. package/ui-cv/components/cv-form-item/cv-form-item.vue +1 -1
  27. package/ui-cv/components/cv-input-text/input.css +13 -0
  28. package/ui-cv/components/cv-picker1/cv-picker1.vue +1 -1
  29. package/ui-fireui/fui-actionsheet/fui-actionsheet.vue +202 -0
  30. package/ui-fireui/fui-alert/fui-alert.vue +141 -0
  31. package/ui-fireui/fui-badge/fui-badge.vue +158 -0
  32. package/ui-fireui/fui-bottom-navigation/fui-bottom-navigation.vue +390 -0
  33. package/ui-fireui/fui-bottom-popup/fui-bottom-popup.vue +100 -0
  34. package/ui-fireui/fui-bubble-popup/fui-bubble-popup.vue +236 -0
  35. package/ui-fireui/fui-button/fui-button.vue +424 -0
  36. package/ui-fireui/fui-calendar/fui-calendar.js +915 -0
  37. package/ui-fireui/fui-calendar/fui-calendar.vue +868 -0
  38. package/ui-fireui/fui-card/fui-card.vue +231 -0
  39. package/ui-fireui/fui-cascade-selection/fui-cascade-selection.vue +538 -0
  40. package/ui-fireui/fui-circular-progress/fui-circular-progress.vue +261 -0
  41. package/ui-fireui/fui-collapse/fui-collapse.vue +179 -0
  42. package/ui-fireui/fui-countdown/fui-countdown.vue +301 -0
  43. package/ui-fireui/fui-datetime/fui-datetime.vue +570 -0
  44. package/ui-fireui/fui-divider/fui-divider.vue +118 -0
  45. package/ui-fireui/fui-drawer/fui-drawer.vue +103 -0
  46. package/ui-fireui/fui-dropdown-list/fui-dropdown-list.vue +70 -0
  47. package/ui-fireui/fui-fab/fui-fab.vue +284 -0
  48. package/ui-fireui/fui-footer/fui-footer.vue +131 -0
  49. package/ui-fireui/fui-grid/fui-grid.vue +42 -0
  50. package/ui-fireui/fui-grid-item/fui-grid-item.vue +142 -0
  51. package/ui-fireui/fui-icon/fui-icon.vue +820 -0
  52. package/ui-fireui/fui-image-cropper/fui-image-cropper.vue +1058 -0
  53. package/ui-fireui/fui-image-group/fui-image-group.vue +149 -0
  54. package/ui-fireui/fui-keyboard/fui-keyboard.vue +254 -0
  55. package/ui-fireui/fui-keyboard-input/fui-keyboard-input.vue +78 -0
  56. package/ui-fireui/fui-list-cell/fui-list-cell.vue +178 -0
  57. package/ui-fireui/fui-list-view/fui-list-view.vue +87 -0
  58. package/ui-fireui/fui-loading/fui-loading.vue +78 -0
  59. package/ui-fireui/fui-loadmore/fui-loadmore.vue +163 -0
  60. package/ui-fireui/fui-modal/fui-modal.vue +392 -0
  61. package/ui-fireui/fui-navigation-bar/fui-navigation-bar.vue +180 -0
  62. package/ui-fireui/fui-no-data/fui-no-data.vue +116 -0
  63. package/ui-fireui/fui-nomore/fui-nomore.vue +116 -0
  64. package/ui-fireui/fui-numberbox/fui-numberbox.vue +234 -0
  65. package/ui-fireui/fui-numberbox-border/fui-numberbox-border.vue +232 -0
  66. package/ui-fireui/fui-picture-cropper/fui-picture-cropper.vue +682 -0
  67. package/ui-fireui/fui-picture-cropper/fui-picture-cropper.wxs +560 -0
  68. package/ui-fireui/fui-rate/fui-rate.vue +167 -0
  69. package/ui-fireui/fui-round-progress/fui-round-progress.vue +306 -0
  70. package/ui-fireui/fui-scroll-top/fui-scroll-top.vue +189 -0
  71. package/ui-fireui/fui-sharemodel/fui-sharemodel.vue +181 -0
  72. package/ui-fireui/fui-skeleton/fui-skeleton.vue +248 -0
  73. package/ui-fireui/fui-steps/fui-steps.vue +214 -0
  74. package/ui-fireui/fui-sticky/fui-sticky.vue +155 -0
  75. package/ui-fireui/fui-sticky-wxs/fui-sticky-wxs.vue +133 -0
  76. package/ui-fireui/fui-sticky-wxs/fui-sticky.wxs +44 -0
  77. package/ui-fireui/fui-swipe-action/fui-swipe-action.vue +301 -0
  78. package/ui-fireui/fui-tabbar/fui-tabbar.vue +283 -0
  79. package/ui-fireui/fui-tabs/fui-tabs.vue +284 -0
  80. package/ui-fireui/fui-tabs2/fui-tabs2.vue +284 -0
  81. package/ui-fireui/fui-tag/fui-tag.vue +374 -0
  82. package/ui-fireui/fui-time-axis/fui-time-axis.vue +36 -0
  83. package/ui-fireui/fui-timeaxis-item/fui-timeaxis-item.vue +48 -0
  84. package/ui-fireui/fui-tips/fui-tips.vue +161 -0
  85. package/ui-fireui/fui-toast/fui-toast.vue +117 -0
  86. package/ui-fireui/fui-top-dropdown/fui-top-dropdown.vue +129 -0
  87. package/ui-fireui/fui-upload/fui-upload.vue +446 -0
  88. package/ui-fireui/fui-uploadsamll/fui-uploadsamll.vue +472 -0
  89. package/uni-ui/lib/uni-icons/changelog.md +22 -0
  90. package/uni-ui/lib/uni-icons/package.json +42 -0
  91. package/uni-ui/lib/uni-icons/readme.md +8 -0
  92. package/uview-plus/LICENSE +1 -1
  93. package/uview-plus/README.md +22 -12
  94. package/uview-plus/changelog-wu-tool.md +21 -0
  95. package/uview-plus/changelog-wu.md +91 -0
  96. package/uview-plus/changelog.md +752 -0
  97. package/uview-plus/components/u--form/u--form.vue +1 -1
  98. package/uview-plus/components/u--image/u--image.vue +1 -1
  99. package/uview-plus/components/u--input/u--input.vue +3 -3
  100. package/uview-plus/components/u--text/u--text.vue +1 -1
  101. package/uview-plus/components/u--textarea/u--textarea.vue +1 -1
  102. package/uview-plus/components/u-action-sheet/_doc/changelog.md +12 -0
  103. package/uview-plus/components/u-action-sheet/_doc/package.json +92 -0
  104. package/uview-plus/components/u-action-sheet/_doc/readme.md +16 -0
  105. package/uview-plus/{libs/config/props → components/u-action-sheet}/actionSheet.js +3 -2
  106. package/uview-plus/components/u-action-sheet/props.js +20 -13
  107. package/uview-plus/components/u-action-sheet/style.css +18 -4
  108. package/uview-plus/components/u-action-sheet/style.scss +2 -2
  109. package/uview-plus/components/u-action-sheet/u-action-sheet.vue +21 -13
  110. package/uview-plus/components/u-action-sheet-data/style.css +10 -0
  111. package/uview-plus/components/u-action-sheet-data/style.scss +12 -0
  112. package/uview-plus/components/u-action-sheet-data/u-action-sheet-data.vue +94 -0
  113. package/uview-plus/{libs/config/props → components/u-album}/album.js +5 -2
  114. package/uview-plus/components/u-album/props.js +40 -14
  115. package/uview-plus/components/u-album/style.css +16 -2
  116. package/uview-plus/components/u-album/style.scss +0 -1
  117. package/uview-plus/components/u-album/u-album.vue +55 -30
  118. package/uview-plus/components/u-alert/props.js +12 -11
  119. package/uview-plus/components/u-alert/style.css +17 -2
  120. package/uview-plus/components/u-alert/u-alert.vue +12 -6
  121. package/uview-plus/components/u-app-update/_doc/changelog.md +26 -0
  122. package/uview-plus/components/u-app-update/_doc/package.json +89 -0
  123. package/uview-plus/components/u-app-update/_doc/readme.md +16 -0
  124. package/uview-plus/components/u-app-update/config.js +120 -0
  125. package/uview-plus/components/u-app-update/img/act.png +0 -0
  126. package/uview-plus/components/u-app-update/img/appUploadAlertBoxBg.png +0 -0
  127. package/uview-plus/components/u-app-update/img/close.png +0 -0
  128. package/uview-plus/components/u-app-update/js-sdk/checkVersion.js +81 -0
  129. package/uview-plus/components/u-app-update/js-sdk/silentlyAppUpdate.js +41 -0
  130. package/uview-plus/components/u-app-update/pages/index.vue +8 -0
  131. package/uview-plus/components/u-app-update/u-app-update.vue +583 -0
  132. package/uview-plus/components/u-avatar/props.js +20 -18
  133. package/uview-plus/components/u-avatar/style.css +18 -2
  134. package/uview-plus/components/u-avatar/style.scss +1 -0
  135. package/uview-plus/components/u-avatar/u-avatar.vue +20 -15
  136. package/uview-plus/{libs/config/props → components/u-avatar-group}/avatarGroup.js +1 -1
  137. package/uview-plus/components/u-avatar-group/props.js +13 -12
  138. package/uview-plus/components/u-avatar-group/style.css +17 -2
  139. package/uview-plus/components/u-avatar-group/u-avatar-group.vue +2 -73
  140. package/uview-plus/{libs/config/props → components/u-back-top}/backtop.js +2 -2
  141. package/uview-plus/components/u-back-top/props.js +14 -13
  142. package/uview-plus/components/u-back-top/style.css +17 -2
  143. package/uview-plus/components/u-back-top/u-back-top.vue +11 -9
  144. package/uview-plus/{libs/config/props → components/u-badge}/badge.js +1 -1
  145. package/uview-plus/components/u-badge/props.js +18 -17
  146. package/uview-plus/components/u-badge/style.css +17 -2
  147. package/uview-plus/components/u-badge/u-badge.vue +11 -7
  148. package/uview-plus/components/u-box/props.js +27 -0
  149. package/uview-plus/components/u-box/style.css +77 -0
  150. package/uview-plus/components/u-box/style.scss +38 -0
  151. package/uview-plus/components/u-box/u-box.vue +3 -0
  152. package/uview-plus/{libs/config/props → components/u-button}/button.js +2 -1
  153. package/uview-plus/components/u-button/nvue-parse.scss +2 -2
  154. package/uview-plus/components/u-button/props.js +37 -40
  155. package/uview-plus/components/u-button/style.css +21 -5
  156. package/uview-plus/components/u-button/u-button.vue +32 -21
  157. package/uview-plus/components/u-button/vue-parse.scss +4 -3
  158. package/uview-plus/components/u-button/vue.scss +9 -8
  159. package/uview-plus/components/u-button-wu/_doc/changelog.md +6 -0
  160. package/uview-plus/components/u-button-wu/_doc/package.json +89 -0
  161. package/uview-plus/components/u-button-wu/_doc/readme.md +16 -0
  162. package/uview-plus/components/u-button-wu/u-button-wu.vue +522 -0
  163. package/uview-plus/components/u-button-wu/vue.scss +81 -0
  164. package/uview-plus/{libs/config/props → components/u-calendar}/calendar.js +7 -4
  165. package/uview-plus/components/u-calendar/header.vue +3 -1
  166. package/uview-plus/components/u-calendar/month.vue +43 -19
  167. package/uview-plus/components/u-calendar/props.js +45 -30
  168. package/uview-plus/components/u-calendar/style.css +17 -2
  169. package/uview-plus/components/u-calendar/u-calendar.vue +53 -17
  170. package/uview-plus/components/u-calendar-wu/_doc/changelog.md +145 -0
  171. package/uview-plus/components/u-calendar-wu/_doc/package.json +90 -0
  172. package/uview-plus/components/u-calendar-wu/_doc/readme.md +16 -0
  173. package/uview-plus/components/u-calendar-wu/calendar.js +664 -0
  174. package/uview-plus/components/u-calendar-wu/i18n/en.json +14 -0
  175. package/uview-plus/components/u-calendar-wu/i18n/index.js +8 -0
  176. package/uview-plus/components/u-calendar-wu/i18n/zh-Hans.json +14 -0
  177. package/uview-plus/components/u-calendar-wu/i18n/zh-Hant.json +14 -0
  178. package/uview-plus/components/u-calendar-wu/props.js +166 -0
  179. package/uview-plus/components/u-calendar-wu/style.css +196 -0
  180. package/uview-plus/components/u-calendar-wu/u-calendar-wu.vue +921 -0
  181. package/uview-plus/components/u-calendar-wu/util.js +552 -0
  182. package/uview-plus/components/u-calendar-wu/wu-calendar-block/props.js +73 -0
  183. package/uview-plus/components/u-calendar-wu/wu-calendar-block/wu-calendar-block.vue +122 -0
  184. package/uview-plus/components/u-calendar-wu/wu-calendar-item/props.js +55 -0
  185. package/uview-plus/components/u-calendar-wu/wu-calendar-item/wu-calendar-item.vue +293 -0
  186. package/uview-plus/components/u-car-keyboard/props.js +5 -3
  187. package/uview-plus/components/u-car-keyboard/style.css +18 -3
  188. package/uview-plus/components/u-car-keyboard/u-car-keyboard.vue +205 -1
  189. package/uview-plus/components/u-card/card.js +40 -0
  190. package/uview-plus/components/u-card/props.js +134 -0
  191. package/uview-plus/components/u-card/style.css +60 -0
  192. package/uview-plus/components/u-card/style.scss +47 -0
  193. package/uview-plus/components/u-card/u-card.vue +3 -0
  194. package/uview-plus/components/u-cate-tab/style.css +97 -0
  195. package/uview-plus/components/u-cate-tab/style.scss +114 -0
  196. package/uview-plus/components/u-cate-tab/u-cate-tab.vue +3 -0
  197. package/uview-plus/components/u-cell/_doc/changelog.md +6 -0
  198. package/uview-plus/components/u-cell/_doc/package.json +89 -0
  199. package/uview-plus/components/u-cell/_doc/readme.md +25 -0
  200. package/uview-plus/components/u-cell/props.js +24 -23
  201. package/uview-plus/components/u-cell/style.css +43 -3
  202. package/uview-plus/components/u-cell/style.scss +25 -2
  203. package/uview-plus/components/u-cell/u-cell.vue +44 -31
  204. package/uview-plus/components/u-cell-group/props.js +6 -5
  205. package/uview-plus/components/u-cell-group/style.css +17 -2
  206. package/uview-plus/components/u-cell-group/u-cell-group.vue +10 -6
  207. package/uview-plus/components/u-checkbox/_doc/changelog.md +8 -0
  208. package/uview-plus/components/u-checkbox/_doc/package.json +88 -0
  209. package/uview-plus/components/u-checkbox/_doc/readme.md +25 -0
  210. package/uview-plus/components/u-checkbox/props.js +22 -16
  211. package/uview-plus/components/u-checkbox/style.css +17 -2
  212. package/uview-plus/components/u-checkbox/u-checkbox.vue +87 -57
  213. package/uview-plus/{libs/config/props → components/u-checkbox-group}/checkboxGroup.js +1 -1
  214. package/uview-plus/components/u-checkbox-group/props.js +21 -19
  215. package/uview-plus/components/u-checkbox-group/style.css +17 -2
  216. package/uview-plus/components/u-checkbox-group/u-checkbox-group.vue +5 -5
  217. package/uview-plus/components/u-circle-progress/props.js +5 -4
  218. package/uview-plus/components/u-circle-progress/style.css +23 -8
  219. package/uview-plus/components/u-circle-progress/u-circle-progress.vue +5 -4
  220. package/uview-plus/components/u-code/_doc/changelog.md +6 -0
  221. package/uview-plus/components/u-code/_doc/package.json +86 -0
  222. package/uview-plus/components/u-code/_doc/readme.md +16 -0
  223. package/uview-plus/components/u-code/props.js +10 -9
  224. package/uview-plus/components/u-code/style.css +17 -2
  225. package/uview-plus/components/u-code/u-code.vue +6 -5
  226. package/uview-plus/components/u-code-input/props.js +28 -18
  227. package/uview-plus/components/u-code-input/style.css +22 -6
  228. package/uview-plus/components/u-code-input/style.scss +5 -4
  229. package/uview-plus/components/u-code-input/u-code-input.vue +57 -11
  230. package/uview-plus/components/u-col/props.js +9 -8
  231. package/uview-plus/components/u-col/style.css +29 -14
  232. package/uview-plus/components/u-col/u-col.vue +10 -8
  233. package/uview-plus/components/u-collapse/props.js +7 -6
  234. package/uview-plus/components/u-collapse/style.css +17 -2
  235. package/uview-plus/components/u-collapse/u-collapse.vue +4 -3
  236. package/uview-plus/{libs/config/props → components/u-collapse-item}/collapseItem.js +7 -1
  237. package/uview-plus/components/u-collapse-item/props.js +51 -14
  238. package/uview-plus/components/u-collapse-item/style.css +17 -2
  239. package/uview-plus/components/u-collapse-item/u-collapse-item.vue +3 -1
  240. package/uview-plus/{libs/config/props → components/u-column-notice}/columnNotice.js +2 -1
  241. package/uview-plus/components/u-column-notice/props.js +18 -13
  242. package/uview-plus/components/u-column-notice/style.css +17 -2
  243. package/uview-plus/components/u-column-notice/u-column-notice.vue +15 -7
  244. package/uview-plus/components/u-copy/u-copy.vue +1 -0
  245. package/uview-plus/components/u-count-down/props.js +8 -7
  246. package/uview-plus/components/u-count-down/style.css +17 -2
  247. package/uview-plus/components/u-count-down/u-count-down.vue +146 -1
  248. package/uview-plus/components/u-count-to/props.js +15 -14
  249. package/uview-plus/components/u-count-to/style.css +17 -2
  250. package/uview-plus/components/u-count-to/u-count-to.vue +7 -4
  251. package/uview-plus/{libs/config/props → components/u-datetime-picker}/datetimePicker.js +7 -1
  252. package/uview-plus/components/u-datetime-picker/props.js +68 -26
  253. package/uview-plus/components/u-datetime-picker/style.css +42 -1
  254. package/uview-plus/components/u-datetime-picker/style.scss +26 -0
  255. package/uview-plus/components/u-datetime-picker/u-datetime-picker.vue +140 -40
  256. package/uview-plus/components/u-divider/props.js +12 -11
  257. package/uview-plus/components/u-divider/style.css +17 -2
  258. package/uview-plus/components/u-divider/u-divider.vue +8 -5
  259. package/uview-plus/components/u-drag-sort/_doc/changelog.md +0 -0
  260. package/uview-plus/components/u-drag-sort/_doc/package.json +85 -0
  261. package/uview-plus/components/u-drag-sort/_doc/readme.md +16 -0
  262. package/uview-plus/components/u-drag-sort/u-drag-sort.vue +3 -0
  263. package/uview-plus/components/u-dropdown/props.js +12 -17
  264. package/uview-plus/components/u-dropdown/style.css +63 -3
  265. package/uview-plus/components/u-dropdown/style.scss +68 -18
  266. package/uview-plus/components/u-dropdown/u-dropdown.vue +208 -1
  267. package/uview-plus/components/u-dropdown-item/props.js +47 -37
  268. package/uview-plus/components/u-dropdown-item/style.css +19 -6
  269. package/uview-plus/components/u-dropdown-item/style.scss +4 -9
  270. package/uview-plus/components/u-dropdown-item/u-dropdown-item.vue +126 -1
  271. package/uview-plus/components/u-empty/props.js +15 -14
  272. package/uview-plus/components/u-empty/style.css +17 -2
  273. package/uview-plus/components/u-empty/u-empty.vue +39 -9
  274. package/uview-plus/components/u-float-button/style.css +41 -0
  275. package/uview-plus/components/u-float-button/style.scss +17 -0
  276. package/uview-plus/components/u-float-button/u-float-button.vue +164 -0
  277. package/uview-plus/{libs/config/props → components/u-form}/form.js +3 -3
  278. package/uview-plus/components/u-form/props.js +12 -11
  279. package/uview-plus/components/u-form/u-form.vue +1 -1
  280. package/uview-plus/{libs/config/props → components/u-form-item}/formItem.js +2 -0
  281. package/uview-plus/components/u-form-item/props.js +22 -11
  282. package/uview-plus/components/u-form-item/style.css +17 -4
  283. package/uview-plus/components/u-form-item/style.scss +0 -2
  284. package/uview-plus/components/u-form-item/u-form-item.vue +42 -15
  285. package/uview-plus/components/u-gap/_doc/changelog.md +4 -0
  286. package/uview-plus/components/u-gap/_doc/package.json +86 -0
  287. package/uview-plus/components/u-gap/_doc/readme.md +22 -0
  288. package/uview-plus/components/u-gap/props.js +8 -7
  289. package/uview-plus/components/u-gap/style.css +17 -2
  290. package/uview-plus/components/u-gap/u-gap.vue +8 -7
  291. package/uview-plus/components/u-grid/props.js +12 -6
  292. package/uview-plus/components/u-grid/style.css +23 -3
  293. package/uview-plus/components/u-grid/style.scss +8 -1
  294. package/uview-plus/components/u-grid/u-grid.vue +11 -4
  295. package/uview-plus/components/u-grid-item/props.js +6 -5
  296. package/uview-plus/components/u-grid-item/style.css +17 -2
  297. package/uview-plus/components/u-grid-item/u-grid-item.vue +17 -14
  298. package/uview-plus/components/u-icon/_doc/changelog.md +10 -0
  299. package/uview-plus/components/u-icon/_doc/package.json +85 -0
  300. package/uview-plus/components/u-icon/_doc/readme.md +10 -0
  301. package/uview-plus/components/u-icon/icon.js +34 -0
  302. package/uview-plus/components/u-icon/icons.js +213 -213
  303. package/uview-plus/components/u-icon/props.js +21 -20
  304. package/uview-plus/components/u-icon/style.css +18 -3
  305. package/uview-plus/components/u-icon/style.scss +2 -3
  306. package/uview-plus/components/u-icon/u-icon.vue +85 -34
  307. package/uview-plus/components/u-icon/u-icon2.vue +149 -0
  308. package/uview-plus/components/u-image/props.js +20 -19
  309. package/uview-plus/components/u-image/style.css +17 -2
  310. package/uview-plus/components/u-image/u-image.vue +59 -24
  311. package/uview-plus/components/u-image-wu/_doc/changelog.md +21 -0
  312. package/uview-plus/components/u-image-wu/_doc/package.json +88 -0
  313. package/uview-plus/components/u-image-wu/_doc/readme.md +11 -0
  314. package/uview-plus/components/u-image-wu/props.js +94 -0
  315. package/uview-plus/components/u-image-wu/u-image-wu.vue +243 -0
  316. package/uview-plus/components/u-index-anchor/props.js +9 -8
  317. package/uview-plus/components/u-index-anchor/style.css +17 -2
  318. package/uview-plus/components/u-index-anchor/u-index-anchor.vue +12 -10
  319. package/uview-plus/components/u-index-item/props.js +5 -3
  320. package/uview-plus/components/u-index-item/style.css +17 -2
  321. package/uview-plus/components/u-index-item/u-index-item.vue +7 -6
  322. package/uview-plus/{libs/config/props → components/u-index-list}/indexList.js +3 -2
  323. package/uview-plus/components/u-index-list/props.js +14 -8
  324. package/uview-plus/components/u-index-list/style.css +19 -3
  325. package/uview-plus/components/u-index-list/style.scss +2 -1
  326. package/uview-plus/components/u-index-list/u-index-list.vue +193 -60
  327. package/uview-plus/components/u-input/_doc/changelog.md +6 -0
  328. package/uview-plus/components/u-input/_doc/package.json +88 -0
  329. package/uview-plus/components/u-input/_doc/readme.md +16 -0
  330. package/uview-plus/{libs/config/props → components/u-input}/input.js +1 -1
  331. package/uview-plus/components/u-input/props.js +40 -38
  332. package/uview-plus/components/u-input/style.css +17 -2
  333. package/uview-plus/components/u-input/u-input.vue +70 -54
  334. package/uview-plus/components/u-keyboard/props.js +20 -19
  335. package/uview-plus/components/u-keyboard/style.css +17 -2
  336. package/uview-plus/components/u-keyboard/u-keyboard.vue +4 -3
  337. package/uview-plus/components/u-lazy-load/style.css +38 -0
  338. package/uview-plus/components/u-lazy-load/style.scss +17 -0
  339. package/uview-plus/components/u-lazy-load/u-lazy-load.vue +3 -0
  340. package/uview-plus/components/u-line/_doc/changelog.md +8 -0
  341. package/uview-plus/components/u-line/_doc/package.json +86 -0
  342. package/uview-plus/components/u-line/_doc/readme.md +16 -0
  343. package/uview-plus/components/u-line/props.js +10 -9
  344. package/uview-plus/components/u-line/style.css +17 -2
  345. package/uview-plus/components/u-line/u-line.vue +7 -6
  346. package/uview-plus/components/u-line-progress/props.js +9 -8
  347. package/uview-plus/components/u-line-progress/style.css +17 -2
  348. package/uview-plus/components/u-line-progress/u-line-progress.vue +11 -8
  349. package/uview-plus/components/u-link/_doc/changelog.md +8 -0
  350. package/uview-plus/components/u-link/_doc/package.json +86 -0
  351. package/uview-plus/components/u-link/_doc/readme.md +20 -0
  352. package/uview-plus/{libs/config/props → components/u-link}/link.js +1 -1
  353. package/uview-plus/components/u-link/props.js +11 -10
  354. package/uview-plus/components/u-link/style.css +17 -2
  355. package/uview-plus/components/u-link/u-link.vue +10 -7
  356. package/uview-plus/components/u-list/props.js +43 -18
  357. package/uview-plus/components/u-list/style.css +17 -2
  358. package/uview-plus/components/u-list/u-list.vue +41 -10
  359. package/uview-plus/components/u-list-item/props.js +5 -4
  360. package/uview-plus/components/u-list-item/style.css +17 -2
  361. package/uview-plus/components/u-list-item/u-list-item.vue +5 -4
  362. package/uview-plus/components/u-loading-icon/_doc/changelog.md +12 -0
  363. package/uview-plus/components/u-loading-icon/_doc/package.json +86 -0
  364. package/uview-plus/components/u-loading-icon/_doc/readme.md +16 -0
  365. package/uview-plus/{libs/config/props → components/u-loading-icon}/loadingIcon.js +1 -1
  366. package/uview-plus/components/u-loading-icon/props.js +16 -15
  367. package/uview-plus/components/u-loading-icon/style.css +21 -5
  368. package/uview-plus/components/u-loading-icon/style.scss +3 -3
  369. package/uview-plus/components/u-loading-icon/u-loading-icon.vue +3 -1
  370. package/uview-plus/{libs/config/props → components/u-loading-page}/loadingPage.js +2 -1
  371. package/uview-plus/components/u-loading-page/props.js +19 -12
  372. package/uview-plus/components/u-loading-page/style.css +19 -4
  373. package/uview-plus/components/u-loading-page/u-loading-page.vue +15 -9
  374. package/uview-plus/components/u-loadmore/props.js +22 -21
  375. package/uview-plus/components/u-loadmore/style.css +17 -2
  376. package/uview-plus/components/u-loadmore/u-loadmore.vue +13 -9
  377. package/uview-plus/components/u-mask/u-mask.vue +122 -0
  378. package/uview-plus/{libs/config/props → components/u-modal}/modal.js +5 -1
  379. package/uview-plus/components/u-modal/props.js +40 -19
  380. package/uview-plus/components/u-modal/style.css +21 -2
  381. package/uview-plus/components/u-modal/style.scss +69 -65
  382. package/uview-plus/components/u-modal/u-modal.vue +184 -1
  383. package/uview-plus/components/u-navbar/_doc/changelog.md +6 -0
  384. package/uview-plus/components/u-navbar/_doc/package.json +89 -0
  385. package/uview-plus/components/u-navbar/_doc/readme.md +16 -0
  386. package/uview-plus/{libs/config/props → components/u-navbar}/navbar.js +2 -1
  387. package/uview-plus/components/u-navbar/props.js +26 -19
  388. package/uview-plus/components/u-navbar/style.css +17 -2
  389. package/uview-plus/components/u-navbar/u-navbar.vue +25 -12
  390. package/uview-plus/components/u-navbar-mini/props.js +51 -0
  391. package/uview-plus/components/u-navbar-mini/style.css +60 -0
  392. package/uview-plus/components/u-navbar-mini/style.scss +38 -0
  393. package/uview-plus/components/u-navbar-mini/u-navbar-mini.vue +89 -0
  394. package/uview-plus/components/u-navbar-wu/props.js +102 -0
  395. package/uview-plus/components/u-navbar-wu/u-navbar-wu.vue +196 -0
  396. package/uview-plus/components/u-no-network/props.js +7 -6
  397. package/uview-plus/components/u-no-network/style.css +17 -2
  398. package/uview-plus/components/u-no-network/u-no-network.vue +8 -6
  399. package/uview-plus/{libs/config/props → components/u-notice-bar}/noticeBar.js +3 -2
  400. package/uview-plus/components/u-notice-bar/props.js +21 -16
  401. package/uview-plus/components/u-notice-bar/style.css +17 -2
  402. package/uview-plus/components/u-notice-bar/u-notice-bar.vue +10 -4
  403. package/uview-plus/components/u-notify/props.js +13 -12
  404. package/uview-plus/components/u-notify/style.css +17 -2
  405. package/uview-plus/components/u-notify/u-notify.vue +20 -16
  406. package/uview-plus/components/u-number-box/_doc/changelog.md +19 -0
  407. package/uview-plus/components/u-number-box/_doc/package.json +88 -0
  408. package/uview-plus/components/u-number-box/_doc/readme.md +16 -0
  409. package/uview-plus/{libs/config/props → components/u-number-box}/numberBox.js +5 -1
  410. package/uview-plus/components/u-number-box/props.js +46 -25
  411. package/uview-plus/components/u-number-box/style.css +17 -2
  412. package/uview-plus/components/u-number-box/u-number-box.vue +72 -35
  413. package/uview-plus/components/u-number-keyboard/props.js +7 -6
  414. package/uview-plus/components/u-number-keyboard/style.css +19 -4
  415. package/uview-plus/components/u-number-keyboard/u-number-keyboard.vue +9 -6
  416. package/uview-plus/components/u-overlay/_doc/changelog.md +4 -0
  417. package/uview-plus/components/u-overlay/_doc/package.json +88 -0
  418. package/uview-plus/components/u-overlay/_doc/readme.md +16 -0
  419. package/uview-plus/components/u-overlay/props.js +8 -7
  420. package/uview-plus/components/u-overlay/style.css +17 -2
  421. package/uview-plus/components/u-overlay/u-overlay.vue +14 -5
  422. package/uview-plus/components/u-parse/node/node.vue +12 -4
  423. package/uview-plus/components/u-parse/parser.js +1337 -1333
  424. package/uview-plus/components/u-parse/props.js +48 -47
  425. package/uview-plus/components/u-parse/u-parse.vue +6 -6
  426. package/uview-plus/{libs/config/props → components/u-picker}/picker.js +10 -4
  427. package/uview-plus/components/u-picker/props.js +60 -18
  428. package/uview-plus/components/u-picker/style.css +29 -2
  429. package/uview-plus/components/u-picker/style.scss +12 -1
  430. package/uview-plus/components/u-picker/u-picker.vue +174 -58
  431. package/uview-plus/components/u-picker-column/props.js +4 -3
  432. package/uview-plus/components/u-picker-column/style.css +17 -2
  433. package/uview-plus/components/u-picker-column/u-picker-column.vue +3 -3
  434. package/uview-plus/components/u-picker-data/style.css +10 -0
  435. package/uview-plus/components/u-picker-data/style.scss +12 -0
  436. package/uview-plus/components/u-picker-data/u-picker-data.vue +110 -0
  437. package/uview-plus/components/u-popup/_doc/changelog.md +4 -0
  438. package/uview-plus/components/u-popup/_doc/package.json +92 -0
  439. package/uview-plus/components/u-popup/_doc/readme.md +16 -0
  440. package/uview-plus/{libs/config/props → components/u-popup}/popup.js +1 -1
  441. package/uview-plus/components/u-popup/props.js +19 -18
  442. package/uview-plus/components/u-popup/style.css +27 -2
  443. package/uview-plus/components/u-popup/style.scss +86 -75
  444. package/uview-plus/components/u-popup/u-popup.vue +250 -1
  445. package/uview-plus/components/u-popup-wu/keypress.js +45 -0
  446. package/uview-plus/components/u-popup-wu/u-popup-wu.vue +519 -0
  447. package/uview-plus/components/u-qrcode/qrcode.js +1235 -0
  448. package/uview-plus/components/u-qrcode/style.css +20 -0
  449. package/uview-plus/components/u-qrcode/style.scss +23 -0
  450. package/uview-plus/components/u-qrcode/u-qrcode.vue +3 -0
  451. package/uview-plus/components/u-radio/_doc/changelog.md +6 -0
  452. package/uview-plus/components/u-radio/_doc/package.json +88 -0
  453. package/uview-plus/components/u-radio/_doc/readme.md +25 -0
  454. package/uview-plus/components/u-radio/props.js +17 -16
  455. package/uview-plus/components/u-radio/style.css +17 -2
  456. package/uview-plus/components/u-radio/u-radio.vue +32 -27
  457. package/uview-plus/components/u-radio-group/props.js +26 -20
  458. package/uview-plus/{libs/config/props → components/u-radio-group}/radioGroup.js +4 -3
  459. package/uview-plus/components/u-radio-group/style.css +17 -2
  460. package/uview-plus/components/u-radio-group/u-radio-group.vue +12 -4
  461. package/uview-plus/components/u-rate/props.js +18 -17
  462. package/uview-plus/components/u-rate/style.css +17 -2
  463. package/uview-plus/components/u-rate/u-rate.vue +17 -14
  464. package/uview-plus/components/u-read-more/props.js +12 -11
  465. package/uview-plus/components/u-read-more/style.css +18 -2
  466. package/uview-plus/components/u-read-more/style.scss +23 -22
  467. package/uview-plus/components/u-read-more/u-read-more.vue +2 -118
  468. package/uview-plus/components/u-row/_doc/changelog.md +8 -0
  469. package/uview-plus/components/u-row/_doc/package.json +86 -0
  470. package/uview-plus/components/u-row/_doc/readme.md +16 -0
  471. package/uview-plus/components/u-row/props.js +7 -6
  472. package/uview-plus/components/u-row/style.css +17 -2
  473. package/uview-plus/components/u-row/u-row.vue +9 -7
  474. package/uview-plus/components/u-row-notice/props.js +11 -10
  475. package/uview-plus/components/u-row-notice/style.css +18 -2
  476. package/uview-plus/components/u-row-notice/style.scss +1 -0
  477. package/uview-plus/components/u-row-notice/u-row-notice.vue +17 -15
  478. package/uview-plus/components/u-safe-bottom/_doc/changelog.md +6 -0
  479. package/uview-plus/components/u-safe-bottom/_doc/package.json +86 -0
  480. package/uview-plus/components/u-safe-bottom/_doc/readme.md +16 -0
  481. package/uview-plus/components/u-safe-bottom/props.js +5 -3
  482. package/uview-plus/components/u-safe-bottom/u-safe-bottom.vue +3 -1
  483. package/uview-plus/components/u-scroll-list/nvue.js +1 -3
  484. package/uview-plus/components/u-scroll-list/props.js +10 -9
  485. package/uview-plus/components/u-scroll-list/style.css +18 -2
  486. package/uview-plus/components/u-scroll-list/style.scss +2 -0
  487. package/uview-plus/components/u-scroll-list/u-scroll-list.vue +17 -12
  488. package/uview-plus/components/u-search/props.js +42 -27
  489. package/uview-plus/{libs/config/props → components/u-search}/search.js +3 -2
  490. package/uview-plus/components/u-search/style.css +23 -2
  491. package/uview-plus/components/u-search/style.scss +8 -0
  492. package/uview-plus/components/u-search/u-search.vue +22 -8
  493. package/uview-plus/components/u-select/style.css +45 -0
  494. package/uview-plus/components/u-select/style.scss +47 -0
  495. package/uview-plus/components/u-select/u-select.vue +3 -0
  496. package/uview-plus/components/u-skeleton/props.js +15 -14
  497. package/uview-plus/components/u-skeleton/style.css +17 -2
  498. package/uview-plus/components/u-skeleton/u-skeleton.vue +22 -19
  499. package/uview-plus/components/u-sku-wu/_doc/changelog.md +27 -0
  500. package/uview-plus/components/u-sku-wu/_doc/package.json +93 -0
  501. package/uview-plus/components/u-sku-wu/_doc/readme.md +16 -0
  502. package/uview-plus/components/u-sku-wu/props.js +86 -0
  503. package/uview-plus/components/u-sku-wu/style.css +271 -0
  504. package/uview-plus/components/u-sku-wu/u-sku-wu.vue +864 -0
  505. package/uview-plus/components/u-slider/mpwxs.js +2 -1
  506. package/uview-plus/components/u-slider/nvue.js +2 -1
  507. package/uview-plus/components/u-slider/props.js +50 -14
  508. package/uview-plus/{libs/config/props → components/u-slider}/slider.js +3 -1
  509. package/uview-plus/components/u-slider/style.css +81 -1
  510. package/uview-plus/components/u-slider/style.scss +76 -0
  511. package/uview-plus/components/u-slider/u-slider.vue +446 -1
  512. package/uview-plus/components/u-status-bar/_doc/changelog.md +4 -0
  513. package/uview-plus/components/u-status-bar/_doc/package.json +86 -0
  514. package/uview-plus/components/u-status-bar/_doc/readme.md +16 -0
  515. package/uview-plus/components/u-status-bar/props.js +10 -4
  516. package/uview-plus/{libs/config/props → components/u-status-bar}/statusBar.js +2 -1
  517. package/uview-plus/components/u-status-bar/u-status-bar.vue +23 -8
  518. package/uview-plus/components/u-steps/props.js +11 -10
  519. package/uview-plus/components/u-steps/style.css +21 -2
  520. package/uview-plus/components/u-steps/style.scss +4 -0
  521. package/uview-plus/components/u-steps/u-steps.vue +9 -5
  522. package/uview-plus/components/u-steps-item/props.js +13 -7
  523. package/uview-plus/components/u-steps-item/style.css +19 -3
  524. package/uview-plus/components/u-steps-item/style.scss +3 -2
  525. package/uview-plus/components/u-steps-item/u-steps-item.vue +53 -25
  526. package/uview-plus/components/u-sticky/props.js +10 -9
  527. package/uview-plus/components/u-sticky/u-sticky.vue +21 -14
  528. package/uview-plus/components/u-subsection/props.js +13 -12
  529. package/uview-plus/components/u-subsection/style.css +31 -16
  530. package/uview-plus/components/u-subsection/style.scss +13 -13
  531. package/uview-plus/components/u-subsection/u-subsection.vue +35 -22
  532. package/uview-plus/components/u-swipe-action/props.js +10 -4
  533. package/uview-plus/components/u-swipe-action/u-swipe-action.vue +18 -3
  534. package/uview-plus/components/u-swipe-action-item/alipay.sjs +229 -0
  535. package/uview-plus/components/u-swipe-action-item/index.wxs +20 -15
  536. package/uview-plus/components/u-swipe-action-item/nvue - backup.js +3 -2
  537. package/uview-plus/components/u-swipe-action-item/nvue.js +4 -3
  538. package/uview-plus/components/u-swipe-action-item/other.js +178 -0
  539. package/uview-plus/components/u-swipe-action-item/props.js +15 -10
  540. package/uview-plus/components/u-swipe-action-item/style.css +18 -2
  541. package/uview-plus/components/u-swipe-action-item/style.scss +1 -0
  542. package/uview-plus/{libs/config/props → components/u-swipe-action-item}/swipeActionItem.js +1 -0
  543. package/uview-plus/components/u-swipe-action-item/u-swipe-action-item.vue +85 -28
  544. package/uview-plus/components/u-swiper/props.js +28 -27
  545. package/uview-plus/components/u-swiper/style.css +20 -2
  546. package/uview-plus/components/u-swiper/style.scss +3 -0
  547. package/uview-plus/{libs/config/props → components/u-swiper}/swiper.js +1 -1
  548. package/uview-plus/components/u-swiper/u-swiper.vue +63 -52
  549. package/uview-plus/components/u-swiper-indicator/props.js +9 -8
  550. package/uview-plus/components/u-swiper-indicator/style.css +17 -2
  551. package/uview-plus/components/u-swiper-indicator/u-swiper-indicator.vue +10 -6
  552. package/uview-plus/components/u-switch/props.js +15 -14
  553. package/uview-plus/components/u-switch/style.css +17 -2
  554. package/uview-plus/components/u-switch/u-switch.vue +16 -14
  555. package/uview-plus/components/u-tabbar/props.js +13 -11
  556. package/uview-plus/components/u-tabbar/style.css +17 -2
  557. package/uview-plus/components/u-tabbar/u-tabbar.vue +6 -5
  558. package/uview-plus/components/u-tabbar-item/props.js +10 -9
  559. package/uview-plus/components/u-tabbar-item/style.css +22 -2
  560. package/uview-plus/components/u-tabbar-item/style.scss +5 -0
  561. package/uview-plus/components/u-tabbar-item/u-tabbar-item.vue +8 -5
  562. package/uview-plus/components/u-table/props.js +4 -3
  563. package/uview-plus/components/u-table/style.css +17 -2
  564. package/uview-plus/components/u-table/u-table.vue +3 -3
  565. package/uview-plus/components/u-tabs/props.js +21 -15
  566. package/uview-plus/components/u-tabs/style.css +22 -3
  567. package/uview-plus/components/u-tabs/style.scss +5 -1
  568. package/uview-plus/{libs/config/props → components/u-tabs}/tabs.js +9 -8
  569. package/uview-plus/components/u-tabs/u-tabs.vue +78 -24
  570. package/uview-plus/components/u-tabs-item/props.js +4 -3
  571. package/uview-plus/components/u-tabs-item/u-tabs-item.vue +3 -3
  572. package/uview-plus/components/u-tag/props.js +44 -18
  573. package/uview-plus/components/u-tag/style.css +17 -2
  574. package/uview-plus/components/u-tag/tag.js +35 -0
  575. package/uview-plus/components/u-tag/u-tag.vue +177 -1
  576. package/uview-plus/components/u-td/props.js +4 -3
  577. package/uview-plus/components/u-td/style.css +17 -2
  578. package/uview-plus/components/u-td/u-td.vue +3 -3
  579. package/uview-plus/components/u-text/_doc/changelog.md +10 -0
  580. package/uview-plus/components/u-text/_doc/package.json +89 -0
  581. package/uview-plus/components/u-text/_doc/readme.md +20 -0
  582. package/uview-plus/components/u-text/props.js +30 -24
  583. package/uview-plus/components/u-text/style.css +17 -6
  584. package/uview-plus/components/u-text/style.scss +58 -62
  585. package/uview-plus/{libs/config/props → components/u-text}/text.js +4 -3
  586. package/uview-plus/components/u-text/u-text.vue +2 -143
  587. package/uview-plus/components/u-text/value.js +14 -12
  588. package/uview-plus/components/u-textarea/_doc/changelog.md +6 -0
  589. package/uview-plus/components/u-textarea/_doc/package.json +86 -0
  590. package/uview-plus/components/u-textarea/_doc/readme.md +25 -0
  591. package/uview-plus/components/u-textarea/props.js +28 -26
  592. package/uview-plus/components/u-textarea/style.css +17 -2
  593. package/uview-plus/components/u-textarea/u-textarea.vue +2 -221
  594. package/uview-plus/components/u-toast/style.css +18 -3
  595. package/uview-plus/{libs/config/props → components/u-toast}/toast.js +2 -2
  596. package/uview-plus/components/u-toast/u-toast.vue +31 -21
  597. package/uview-plus/components/u-toolbar/props.js +15 -9
  598. package/uview-plus/components/u-toolbar/style.css +24 -2
  599. package/uview-plus/components/u-toolbar/style.scss +5 -0
  600. package/uview-plus/{libs/config/props → components/u-toolbar}/toolbar.js +1 -1
  601. package/uview-plus/components/u-toolbar/u-toolbar.vue +34 -23
  602. package/uview-plus/components/u-tooltip/props.js +15 -14
  603. package/uview-plus/components/u-tooltip/style.css +17 -2
  604. package/uview-plus/{libs/config/props → components/u-tooltip}/tooltip.js +1 -1
  605. package/uview-plus/components/u-tooltip/u-tooltip.vue +22 -44
  606. package/uview-plus/components/u-tr/props.js +4 -3
  607. package/uview-plus/components/u-tr/style.css +16 -1
  608. package/uview-plus/components/u-tr/u-tr.vue +3 -3
  609. package/uview-plus/components/u-transition/_doc/changelog.md +14 -0
  610. package/uview-plus/components/u-transition/_doc/package.json +86 -0
  611. package/uview-plus/components/u-transition/_doc/readme.md +16 -0
  612. package/uview-plus/components/u-transition/props.js +8 -7
  613. package/uview-plus/components/u-transition/style.css +17 -2
  614. package/uview-plus/components/u-transition/transition.js +18 -164
  615. package/uview-plus/components/u-transition/transitionMixin.js +163 -0
  616. package/uview-plus/components/u-transition/u-transition.vue +8 -7
  617. package/uview-plus/components/u-transition-wu/createAnimation.js +148 -0
  618. package/uview-plus/components/u-transition-wu/props.js +32 -0
  619. package/uview-plus/components/u-transition-wu/u-transition.vue +300 -0
  620. package/uview-plus/components/u-upload/mixin.js +6 -4
  621. package/uview-plus/components/u-upload/props.js +73 -26
  622. package/uview-plus/components/u-upload/style.css +44 -8
  623. package/uview-plus/components/u-upload/style.scss +22 -0
  624. package/uview-plus/components/u-upload/u-upload.vue +463 -106
  625. package/uview-plus/{libs/config/props → components/u-upload}/upload.js +13 -4
  626. package/uview-plus/components/u-upload/utils.js +82 -49
  627. package/uview-plus/components/u-verification-code/u-verification-code.vue +161 -0
  628. package/uview-plus/components/u-view/style.css +26 -0
  629. package/uview-plus/components/u-view/style.scss +4 -0
  630. package/uview-plus/components/u-view/u-view.vue +3 -0
  631. package/uview-plus/components/u-waterfall/style.css +51 -0
  632. package/uview-plus/components/u-waterfall/style.scss +23 -0
  633. package/uview-plus/components/u-waterfall/u-waterfall.vue +3 -0
  634. package/uview-plus/index.css +2157 -943
  635. package/uview-plus/index.js +138 -57
  636. package/uview-plus/libs/config/config.js +46 -27
  637. package/uview-plus/libs/config/props.js +120 -94
  638. package/uview-plus/libs/css/color-libcss.scss +117 -0
  639. package/uview-plus/libs/css/color.scss +32 -155
  640. package/uview-plus/libs/css/common-libcss.scss +118 -14
  641. package/uview-plus/libs/css/common.scss +27 -12
  642. package/uview-plus/libs/css/components-libcss.scss +16 -1
  643. package/uview-plus/libs/css/components-wu.scss +30 -0
  644. package/uview-plus/libs/css/components.scss +21 -2
  645. package/uview-plus/libs/css/flex-libcss.scss +1868 -924
  646. package/uview-plus/libs/css/flex.scss +151 -83
  647. package/uview-plus/libs/css/vue-libcss.scss +8 -4
  648. package/uview-plus/libs/css/vue.scss +11 -10
  649. package/uview-plus/libs/function/calc.js +70 -0
  650. package/uview-plus/libs/function/cc.js +66 -0
  651. package/uview-plus/libs/function/color/color-convert/CHANGELOG.md +54 -0
  652. package/uview-plus/libs/function/color/color-convert/LICENSE +21 -0
  653. package/uview-plus/libs/function/color/color-convert/README.md +68 -0
  654. package/uview-plus/libs/function/color/color-convert/conversions.js +839 -0
  655. package/uview-plus/libs/function/color/color-convert/index.js +81 -0
  656. package/uview-plus/libs/function/color/color-convert/package.json +48 -0
  657. package/uview-plus/libs/function/color/color-convert/route.js +97 -0
  658. package/uview-plus/libs/function/color/color-name/LICENSE +8 -0
  659. package/uview-plus/libs/function/color/color-name/README.md +11 -0
  660. package/uview-plus/libs/function/color/color-name/index.js +152 -0
  661. package/uview-plus/libs/function/color/color-name/package.json +28 -0
  662. package/uview-plus/libs/function/color/color-string/LICENSE +21 -0
  663. package/uview-plus/libs/function/color/color-string/README.md +62 -0
  664. package/uview-plus/libs/function/color/color-string/index.js +244 -0
  665. package/uview-plus/libs/function/color/color-string/package.json +39 -0
  666. package/uview-plus/libs/function/color/color.js +496 -0
  667. package/uview-plus/libs/function/color/index.js +158 -0
  668. package/uview-plus/libs/function/color/is-arrayish/LICENSE +21 -0
  669. package/uview-plus/libs/function/color/is-arrayish/README.md +16 -0
  670. package/uview-plus/libs/function/color/is-arrayish/index.js +9 -0
  671. package/uview-plus/libs/function/color/is-arrayish/package.json +45 -0
  672. package/uview-plus/libs/function/color/is-arrayish/yarn-error.log +1443 -0
  673. package/uview-plus/libs/function/color/simple-swizzle/LICENSE +21 -0
  674. package/uview-plus/libs/function/color/simple-swizzle/README.md +39 -0
  675. package/uview-plus/libs/function/color/simple-swizzle/index.js +29 -0
  676. package/uview-plus/libs/function/color/simple-swizzle/package.json +36 -0
  677. package/uview-plus/libs/function/colorGradient.js +112 -110
  678. package/uview-plus/libs/function/debounce.js +18 -18
  679. package/uview-plus/libs/function/digit.js +6 -8
  680. package/uview-plus/libs/function/http.js +4 -0
  681. package/uview-plus/libs/function/index-wu.js +231 -0
  682. package/uview-plus/libs/function/index.js +639 -481
  683. package/uview-plus/libs/function/platform.js +18 -18
  684. package/uview-plus/libs/function/test.js +166 -136
  685. package/uview-plus/libs/function/throttle.js +20 -20
  686. package/uview-plus/libs/luch-request/core/Request.js +199 -198
  687. package/uview-plus/libs/mixin/button.js +6 -2
  688. package/uview-plus/libs/mixin/mixin.js +49 -13
  689. package/uview-plus/libs/mixin/mpMixin.js +7 -2
  690. package/uview-plus/libs/mixin/mpShare.js +24 -10
  691. package/uview-plus/libs/mixin/openType.js +37 -2
  692. package/uview-plus/libs/mixin/style.js +10 -9
  693. package/uview-plus/libs/mixin/touch.js +4 -2
  694. package/uview-plus/libs/util/async-validator.js +1343 -1343
  695. package/uview-plus/libs/util/dayjs.js +404 -0
  696. package/uview-plus/libs/util/gcanvas/bridge/bridge-weex.js +241 -0
  697. package/uview-plus/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
  698. package/uview-plus/libs/util/gcanvas/context-2d/FillStylePattern.js +8 -0
  699. package/uview-plus/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
  700. package/uview-plus/libs/util/gcanvas/context-2d/RenderingContext.js +666 -0
  701. package/uview-plus/libs/util/gcanvas/context-webgl/ActiveInfo.js +11 -0
  702. package/uview-plus/libs/util/gcanvas/context-webgl/Buffer.js +21 -0
  703. package/uview-plus/libs/util/gcanvas/context-webgl/Framebuffer.js +21 -0
  704. package/uview-plus/libs/util/gcanvas/context-webgl/GLenum.js +298 -0
  705. package/uview-plus/libs/util/gcanvas/context-webgl/GLmethod.js +142 -0
  706. package/uview-plus/libs/util/gcanvas/context-webgl/GLtype.js +23 -0
  707. package/uview-plus/libs/util/gcanvas/context-webgl/Program.js +21 -0
  708. package/uview-plus/libs/util/gcanvas/context-webgl/Renderbuffer.js +21 -0
  709. package/uview-plus/libs/util/gcanvas/context-webgl/RenderingContext.js +1191 -0
  710. package/uview-plus/libs/util/gcanvas/context-webgl/Shader.js +22 -0
  711. package/uview-plus/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
  712. package/uview-plus/libs/util/gcanvas/context-webgl/Texture.js +22 -0
  713. package/uview-plus/libs/util/gcanvas/context-webgl/UniformLocation.js +22 -0
  714. package/uview-plus/libs/util/gcanvas/context-webgl/classUtils.js +3 -0
  715. package/uview-plus/libs/util/gcanvas/env/canvas.js +74 -0
  716. package/uview-plus/libs/util/gcanvas/env/image.js +96 -0
  717. package/uview-plus/libs/util/gcanvas/env/tool.js +24 -0
  718. package/uview-plus/libs/util/gcanvas/index.js +39 -0
  719. package/uview-plus/libs/util/route.js +102 -106
  720. package/uview-plus/libs/vue.js +3 -0
  721. package/uview-plus/package-wu-tool.json +84 -0
  722. package/uview-plus/package-wu.json +112 -0
  723. package/uview-plus/package.json +106 -90
  724. package/uview-plus/readme-wu.md +148 -0
  725. package/uview-plus/types/comps/_common.d.ts +9 -0
  726. package/uview-plus/types/comps/actionSheet.d.ts +121 -0
  727. package/uview-plus/types/comps/album.d.ts +82 -0
  728. package/uview-plus/types/comps/alert.d.ts +55 -0
  729. package/uview-plus/types/comps/avatar.d.ts +85 -0
  730. package/uview-plus/types/comps/avatarGroup.d.ts +62 -0
  731. package/uview-plus/types/comps/backTop.d.ts +74 -0
  732. package/uview-plus/types/comps/badge.d.ts +76 -0
  733. package/uview-plus/types/comps/button.d.ts +169 -0
  734. package/uview-plus/types/comps/calendar.d.ts +164 -0
  735. package/uview-plus/types/comps/cell.d.ts +133 -0
  736. package/uview-plus/types/comps/cellGroup.d.ts +27 -0
  737. package/uview-plus/types/comps/checkbox.d.ts +69 -0
  738. package/uview-plus/types/comps/checkboxGroup.d.ts +93 -0
  739. package/uview-plus/types/comps/code.d.ts +69 -0
  740. package/uview-plus/types/comps/codeInput.d.ts +98 -0
  741. package/uview-plus/types/comps/col.d.ts +43 -0
  742. package/uview-plus/types/comps/collapse.d.ts +52 -0
  743. package/uview-plus/types/comps/collapseItem.d.ts +83 -0
  744. package/uview-plus/types/comps/countDown.d.ts +60 -0
  745. package/uview-plus/types/comps/countTo.d.ts +88 -0
  746. package/uview-plus/types/comps/datetimePicker.d.ts +146 -0
  747. package/uview-plus/types/comps/divider.d.ts +58 -0
  748. package/uview-plus/types/comps/empty.d.ts +72 -0
  749. package/uview-plus/types/comps/form.d.ts +76 -0
  750. package/uview-plus/types/comps/formItem.d.ts +68 -0
  751. package/uview-plus/types/comps/gap.d.ts +35 -0
  752. package/uview-plus/types/comps/grid.d.ts +34 -0
  753. package/uview-plus/types/comps/gridItem.d.ts +28 -0
  754. package/uview-plus/types/comps/icon.d.ts +93 -0
  755. package/uview-plus/types/comps/image.d.ts +119 -0
  756. package/uview-plus/types/comps/indexAnchor.d.ts +38 -0
  757. package/uview-plus/types/comps/indexItem.d.ts +18 -0
  758. package/uview-plus/types/comps/indexList.d.ts +39 -0
  759. package/uview-plus/types/comps/input.d.ts +234 -0
  760. package/uview-plus/types/comps/keyboard.d.ts +125 -0
  761. package/uview-plus/types/comps/line.d.ts +44 -0
  762. package/uview-plus/types/comps/lineProgress.d.ts +51 -0
  763. package/uview-plus/types/comps/link.d.ts +51 -0
  764. package/uview-plus/types/comps/list.d.ts +92 -0
  765. package/uview-plus/types/comps/listItem.d.ts +18 -0
  766. package/uview-plus/types/comps/loadMore.d.ts +108 -0
  767. package/uview-plus/types/comps/loadingIcon.d.ts +68 -0
  768. package/uview-plus/types/comps/loadingPage.d.ts +58 -0
  769. package/uview-plus/types/comps/modal.d.ts +115 -0
  770. package/uview-plus/types/comps/navbar.d.ts +113 -0
  771. package/uview-plus/types/comps/noNetwork.d.ts +40 -0
  772. package/uview-plus/types/comps/noticeBar.d.ts +85 -0
  773. package/uview-plus/types/comps/notify.d.ts +73 -0
  774. package/uview-plus/types/comps/numberBox.d.ts +155 -0
  775. package/uview-plus/types/comps/overlay.d.ts +46 -0
  776. package/uview-plus/types/comps/parse.d.ts +101 -0
  777. package/uview-plus/types/comps/picker.d.ts +115 -0
  778. package/uview-plus/types/comps/popup.d.ts +103 -0
  779. package/uview-plus/types/comps/radio.d.ts +77 -0
  780. package/uview-plus/types/comps/radioGroup.d.ts +97 -0
  781. package/uview-plus/types/comps/rate.d.ts +85 -0
  782. package/uview-plus/types/comps/readMore.d.ts +80 -0
  783. package/uview-plus/types/comps/row.d.ts +34 -0
  784. package/uview-plus/types/comps/safeBottom.d.ts +16 -0
  785. package/uview-plus/types/comps/scrollList.d.ts +51 -0
  786. package/uview-plus/types/comps/search.d.ts +172 -0
  787. package/uview-plus/types/comps/skeleton.d.ts +70 -0
  788. package/uview-plus/types/comps/slider.d.ts +79 -0
  789. package/uview-plus/types/comps/statusBar.d.ts +22 -0
  790. package/uview-plus/types/comps/steps.d.ts +48 -0
  791. package/uview-plus/types/comps/stepsItem.d.ts +41 -0
  792. package/uview-plus/types/comps/sticky.d.ts +48 -0
  793. package/uview-plus/types/comps/subsection.d.ts +64 -0
  794. package/uview-plus/types/comps/swipeAction.d.ts +24 -0
  795. package/uview-plus/types/comps/swipeActionItem.d.ts +58 -0
  796. package/uview-plus/types/comps/swiper.d.ts +142 -0
  797. package/uview-plus/types/comps/swiperIndicator.d.ts +37 -0
  798. package/uview-plus/types/comps/switch.d.ts +73 -0
  799. package/uview-plus/types/comps/tabbar.d.ts +54 -0
  800. package/uview-plus/types/comps/tabbarItem.d.ts +52 -0
  801. package/uview-plus/types/comps/tabs.d.ts +85 -0
  802. package/uview-plus/types/comps/tag.d.ts +93 -0
  803. package/uview-plus/types/comps/text.d.ts +110 -0
  804. package/uview-plus/types/comps/textarea.d.ts +158 -0
  805. package/uview-plus/types/comps/toast.d.ts +63 -0
  806. package/uview-plus/types/comps/tooltip.d.ts +71 -0
  807. package/uview-plus/types/comps/transition.d.ts +61 -0
  808. package/uview-plus/types/comps/upload.d.ts +204 -0
  809. package/uview-plus/types/comps.d.ts +101 -0
  810. package/uview-plus/types/index.d.ts +172 -0
  811. package/uview-plus/types/package.json +26 -0
  812. package/uview-ui/changelog.md +26 -0
  813. package/uview-ui/components/u--form/u--form.vue +1 -1
  814. package/uview-ui/components/u--image/u--image.vue +1 -1
  815. package/uview-ui/components/u--input/u--input.vue +1 -1
  816. package/uview-ui/components/u--text/u--text.vue +1 -1
  817. package/uview-ui/components/u--textarea/u--textarea.vue +1 -1
  818. package/uview-ui/components/u-action-sheet/props.js +1 -1
  819. package/uview-ui/components/u-action-sheet/style.css +1 -1
  820. package/uview-ui/components/u-avatar/style.css +1 -0
  821. package/uview-ui/components/u-avatar/style.scss +1 -0
  822. package/uview-ui/components/u-button/nvue-parse.scss +1 -1
  823. package/uview-ui/components/u-button/style.css +2 -2
  824. package/uview-ui/components/u-button/u-button.vue +7 -2
  825. package/uview-ui/components/u-button/vue-parse.scss +1 -1
  826. package/uview-ui/components/u-car-keyboard/style.css +1 -1
  827. package/uview-ui/components/u-checkbox/u-checkbox.vue +2 -2
  828. package/uview-ui/components/u-circle-progress/style.css +6 -6
  829. package/uview-ui/components/u-col/style.css +13 -13
  830. package/uview-ui/components/u-datetime-picker/props.js +4 -0
  831. package/uview-ui/components/u-datetime-picker/u-datetime-picker.vue +13 -2
  832. package/uview-ui/components/u-form-item/u-form-item.vue +1 -1
  833. package/uview-ui/components/u-icon/style.css +1 -1
  834. package/uview-ui/components/u-image/u-image.vue +3 -2
  835. package/uview-ui/components/u-input/style.css +3 -0
  836. package/uview-ui/components/u-input/style.scss +8 -0
  837. package/uview-ui/components/u-input/u-input.vue +5 -5
  838. package/uview-ui/components/u-loading-icon/style.css +1 -1
  839. package/uview-ui/components/u-loading-page/style.css +2 -2
  840. package/uview-ui/components/u-modal/props.js +5 -0
  841. package/uview-ui/components/u-modal/u-modal.vue +1 -1
  842. package/uview-ui/components/u-number-keyboard/style.css +2 -2
  843. package/uview-ui/components/u-parse/u-parse.vue +1 -1
  844. package/uview-ui/components/u-picker/u-picker.vue +5 -2
  845. package/uview-ui/components/u-popup/u-popup.vue +1 -1
  846. package/uview-ui/components/u-radio/props.js +1 -1
  847. package/uview-ui/components/u-radio/u-radio.vue +2 -2
  848. package/uview-ui/components/u-search/style.css +1 -1
  849. package/uview-ui/components/u-skeleton/u-skeleton.vue +2 -2
  850. package/uview-ui/components/u-steps-item/u-steps-item.vue +2 -2
  851. package/uview-ui/components/u-subsection/style.css +1 -1
  852. package/uview-ui/components/u-swipe-action-item/style.css +2 -2
  853. package/uview-ui/components/u-tabs/u-tabs.vue +10 -1
  854. package/uview-ui/components/u-toast/style.css +1 -1
  855. package/uview-ui/components/u-tooltip/u-tooltip.vue +1 -0
  856. package/uview-ui/components/u-upload/style.css +7 -4
  857. package/uview-ui/components/u-upload/style.scss +6 -0
  858. package/uview-ui/components/u-upload/u-upload.vue +6 -1
  859. package/uview-ui/index.js +51 -52
  860. package/uview-ui/libs/config/config.js +2 -2
  861. package/uview-ui/libs/config/props/datetimePicker.js +1 -0
  862. package/uview-ui/libs/config/props/modal.js +2 -1
  863. package/uview-ui/libs/mixin/mixin.js +3 -6
  864. package/uview-ui/package.json +5 -8
  865. package/plugins/uni-upgrade.js +0 -294
  866. package/uview-plus/components/u-slider/nvue - /345/211/257/346/234/254.js" +0 -175
  867. package/uview-plus/libs/config/props/icon.js +0 -36
  868. package/uview-plus/libs/config/props/tag.js +0 -29
  869. package/uview-plus/libs/config/props/transition.js +0 -18
  870. /package/uview-plus/{libs/config/props → components/u-alert}/alert.js +0 -0
  871. /package/uview-plus/{libs/config/props → components/u-avatar}/avatar.js +0 -0
  872. /package/uview-plus/{libs/config/props → components/u-car-keyboard}/carKeyboard.js +0 -0
  873. /package/uview-plus/{libs/config/props → components/u-cell}/cell.js +0 -0
  874. /package/uview-plus/{libs/config/props → components/u-cell-group}/cellGroup.js +0 -0
  875. /package/uview-plus/{libs/config/props → components/u-checkbox}/checkbox.js +0 -0
  876. /package/uview-plus/{libs/config/props → components/u-circle-progress}/circleProgress.js +0 -0
  877. /package/uview-plus/{libs/config/props → components/u-code}/code.js +0 -0
  878. /package/uview-plus/{libs/config/props → components/u-code-input}/codeInput.js +0 -0
  879. /package/uview-plus/{libs/config/props → components/u-col}/col.js +0 -0
  880. /package/uview-plus/{libs/config/props → components/u-collapse}/collapse.js +0 -0
  881. /package/uview-plus/{libs/config/props → components/u-count-down}/countDown.js +0 -0
  882. /package/uview-plus/{libs/config/props → components/u-count-to}/countTo.js +0 -0
  883. /package/uview-plus/{libs/config/props → components/u-divider}/divider.js +0 -0
  884. /package/uview-plus/{libs/config/props → components/u-empty}/empty.js +0 -0
  885. /package/uview-plus/{libs/config/props → components/u-gap}/gap.js +0 -0
  886. /package/uview-plus/{libs/config/props → components/u-grid}/grid.js +0 -0
  887. /package/uview-plus/{libs/config/props → components/u-grid-item}/gridItem.js +0 -0
  888. /package/uview-plus/{libs/config/props → components/u-image}/image.js +0 -0
  889. /package/uview-plus/{libs/config/props → components/u-index-anchor}/indexAnchor.js +0 -0
  890. /package/uview-plus/{libs/config/props → components/u-keyboard}/keyboard.js +0 -0
  891. /package/uview-plus/{libs/config/props → components/u-line}/line.js +0 -0
  892. /package/uview-plus/{libs/config/props → components/u-line-progress}/lineProgress.js +0 -0
  893. /package/uview-plus/{libs/config/props → components/u-list}/list.js +0 -0
  894. /package/uview-plus/{libs/config/props → components/u-list-item}/listItem.js +0 -0
  895. /package/uview-plus/{libs/config/props → components/u-loadmore}/loadmore.js +0 -0
  896. /package/uview-plus/{libs/config/props → components/u-no-network}/noNetwork.js +0 -0
  897. /package/uview-plus/{libs/config/props → components/u-notify}/notify.js +0 -0
  898. /package/uview-plus/{libs/config/props → components/u-number-keyboard}/numberKeyboard.js +0 -0
  899. /package/uview-plus/{libs/config/props → components/u-overlay}/overlay.js +0 -0
  900. /package/uview-plus/{libs/config/props → components/u-parse}/parse.js +0 -0
  901. /package/uview-plus/{libs/config/props → components/u-radio}/radio.js +0 -0
  902. /package/uview-plus/{libs/config/props → components/u-rate}/rate.js +0 -0
  903. /package/uview-plus/{libs/config/props → components/u-read-more}/readMore.js +0 -0
  904. /package/uview-plus/{libs/config/props → components/u-row}/row.js +0 -0
  905. /package/uview-plus/{libs/config/props → components/u-row-notice}/rowNotice.js +0 -0
  906. /package/uview-plus/{libs/config/props → components/u-scroll-list}/scrollList.js +0 -0
  907. /package/uview-plus/{libs/config/props → components/u-section}/section.js +0 -0
  908. /package/uview-plus/{libs/config/props → components/u-skeleton}/skeleton.js +0 -0
  909. /package/uview-plus/{libs/config/props → components/u-steps}/steps.js +0 -0
  910. /package/uview-plus/{libs/config/props → components/u-steps-item}/stepsItem.js +0 -0
  911. /package/uview-plus/{libs/config/props → components/u-sticky}/sticky.js +0 -0
  912. /package/uview-plus/{libs/config/props → components/u-subsection}/subsection.js +0 -0
  913. /package/uview-plus/{libs/config/props → components/u-swipe-action}/swipeAction.js +0 -0
  914. /package/uview-plus/{libs/config/props → components/u-swiper-indicator}/swipterIndicator.js +0 -0
  915. /package/uview-plus/{libs/config/props → components/u-switch}/switch.js +0 -0
  916. /package/uview-plus/{libs/config/props → components/u-tabbar}/tabbar.js +0 -0
  917. /package/uview-plus/{libs/config/props → components/u-tabbar-item}/tabbarItem.js +0 -0
  918. /package/uview-plus/{libs/config/props → components/u-textarea}/textarea.js +0 -0
@@ -0,0 +1,1058 @@
1
+ <template>
2
+ <view class="fui-container" @touchmove.stop.prevent="stop">
3
+ <view class="fui-image-cropper" @touchend="cutTouchEnd" @touchstart="cutTouchStart" @touchmove="cutTouchMove">
4
+ <view class="fui-content">
5
+ <view
6
+ class="fui-content-top fui-bg-transparent"
7
+ :style="{ height: cutY + 'px', transitionProperty: cutAnimation ? '' : 'background' }"
8
+ ></view>
9
+ <view class="fui-content-middle" :style="{ height: canvasHeight + 'px' }">
10
+ <view
11
+ class="fui-bg-transparent"
12
+ :style="{ width: cutX + 'px', transitionProperty: cutAnimation ? '' : 'background' }"
13
+ ></view>
14
+ <view
15
+ class="fui-cropper-box"
16
+ :style="{
17
+ width: canvasWidth + 'px',
18
+ height: canvasHeight + 'px',
19
+ borderColor: borderColor,
20
+ transitionProperty: cutAnimation ? '' : 'background'
21
+ }"
22
+ >
23
+ <view
24
+ v-for="(item, index) in 4"
25
+ :key="index"
26
+ class="fui-edge"
27
+ :class="[`fui-${index < 2 ? 'top' : 'bottom'}-${index === 0 || index === 2 ? 'left' : 'right'}`]"
28
+ :style="{
29
+ width: edgeWidth,
30
+ height: edgeWidth,
31
+ borderColor: edgeColor,
32
+ borderWidth: edgeBorderWidth,
33
+ left: index === 0 || index === 2 ? `-${edgeOffsets}` : 'auto',
34
+ right: index === 1 || index === 3 ? `-${edgeOffsets}` : 'auto',
35
+ top: index < 2 ? `-${edgeOffsets}` : 'auto',
36
+ bottom: index > 1 ? `-${edgeOffsets}` : 'auto'
37
+ }"
38
+ ></view>
39
+ </view>
40
+ <view class="fui-flex-auto fui-bg-transparent" :style="{ transitionProperty: cutAnimation ? '' : 'background' }"></view>
41
+ </view>
42
+ <view class="fui-flex-auto fui-bg-transparent" :style="{ transitionProperty: cutAnimation ? '' : 'background' }"></view>
43
+ </view>
44
+ <image
45
+ @load="imageLoad"
46
+ @error="imageLoad"
47
+ @touchstart="start"
48
+ @touchmove="move"
49
+ @touchend="end"
50
+ :style="{
51
+ width: imgWidth ? imgWidth + 'px' : 'auto',
52
+ height: imgHeight ? imgHeight + 'px' : 'auto',
53
+ transform: imgTransform,
54
+ transitionDuration: (cutAnimation ? 0.35 : 0) + 's'
55
+ }"
56
+ class="fui-cropper-image"
57
+ :src="imageUrl"
58
+ v-if="imageUrl"
59
+ mode="widthFix"
60
+ ></image>
61
+ </view>
62
+ <canvas
63
+ canvas-id="fui-image-cropper"
64
+ id="fui-image-cropper"
65
+ :disable-scroll="true"
66
+ :style="{ width: CROPPER_WIDTH * scaleRatio + 'px', height: CROPPER_HEIGHT * scaleRatio + 'px' }"
67
+ class="fui-cropper-canvas"
68
+ ></canvas>
69
+ <view class="fui-cropper-tabbar" v-if="!custom">
70
+ <view class="fui-op-btn" @tap.stop="back">取消</view>
71
+ <image :src="rotateImg" class="fui-rotate-img" @tap="setAngle"></image>
72
+ <view class="fui-op-btn" @tap.stop="getImage">完成</view>
73
+ </view>
74
+ </view>
75
+ </template>
76
+
77
+ <script>
78
+ /**
79
+ * 注意:组件中使用的图片地址,将文件复制到自己项目中
80
+ * 如果图片位置与组件同级,编译成小程序时图片会丢失
81
+ * 拷贝static下整个components文件夹
82
+ *也可直接转成base64(不建议)
83
+ * */
84
+ export default {
85
+ name: 'fuiImageCropper',
86
+ props: {
87
+ //图片路径
88
+ imageUrl: {
89
+ type: String,
90
+ default: ''
91
+ },
92
+ /*
93
+ 默认正方形,可修改大小控制比例
94
+ 裁剪框高度 px
95
+ */
96
+ height: {
97
+ type: Number,
98
+ default: 280
99
+ },
100
+ //裁剪框宽度 px
101
+ width: {
102
+ type: Number,
103
+ default: 280
104
+ },
105
+ //裁剪框最小宽度 px
106
+ minWidth: {
107
+ type: Number,
108
+ default: 100
109
+ },
110
+ //裁剪框最小高度 px
111
+ minHeight: {
112
+ type: Number,
113
+ default: 100
114
+ },
115
+ //裁剪框最大宽度 px
116
+ maxWidth: {
117
+ type: Number,
118
+ default: 360
119
+ },
120
+ //裁剪框最大高度 px
121
+ maxHeight: {
122
+ type: Number,
123
+ default: 360
124
+ },
125
+ //裁剪框border颜色
126
+ borderColor: {
127
+ type: String,
128
+ default: 'rgba(255,255,255,0.1)'
129
+ },
130
+ //裁剪框边缘线颜色
131
+ edgeColor: {
132
+ type: String,
133
+ default: '#FFFFFF'
134
+ },
135
+ //裁剪框边缘线宽度 w=h
136
+ edgeWidth: {
137
+ type: String,
138
+ default: '34rpx'
139
+ },
140
+ //裁剪框边缘线border宽度
141
+ edgeBorderWidth: {
142
+ type: String,
143
+ default: '6rpx'
144
+ },
145
+ //偏移距离,根据edgeBorderWidth进行调整
146
+ edgeOffsets: {
147
+ type: String,
148
+ default: '6rpx'
149
+ },
150
+ /**
151
+ * 如果宽度和高度都为true则裁剪框禁止拖动
152
+ * 裁剪框宽度锁定
153
+ */
154
+ lockWidth: {
155
+ type: Boolean,
156
+ default: false
157
+ },
158
+ //裁剪框高度锁定
159
+ lockHeight: {
160
+ type: Boolean,
161
+ default: false
162
+ },
163
+ //锁定裁剪框比例(放大或缩小)
164
+ lockRatio: {
165
+ type: Boolean,
166
+ default: false
167
+ },
168
+ //生成的图片尺寸相对剪裁框的比例
169
+ scaleRatio: {
170
+ type: Number,
171
+ default: 2
172
+ },
173
+ //图片的质量,取值范围为 (0, 1],不在范围内时当作1.0处理
174
+ quality: {
175
+ type: Number,
176
+ default: 0.8
177
+ },
178
+ //图片旋转角度
179
+ rotateAngle: {
180
+ type: Number,
181
+ default: 0
182
+ },
183
+ //图片最小缩放比
184
+ minScale: {
185
+ type: Number,
186
+ default: 0.5
187
+ },
188
+ //图片最大缩放比
189
+ maxScale: {
190
+ type: Number,
191
+ default: 2
192
+ },
193
+ //是否禁用触摸旋转(为false则可以触摸转动图片,limitMove为false生效)
194
+ disableRotate: {
195
+ type: Boolean,
196
+ default: true
197
+ },
198
+ //是否限制移动范围(剪裁框只能在图片内,为true不可触摸转动图片)
199
+ limitMove: {
200
+ type: Boolean,
201
+ default: true
202
+ },
203
+ //自定义操作栏(为true时隐藏底部操作栏)
204
+ custom: {
205
+ type: Boolean,
206
+ default: false
207
+ },
208
+ //值发生改变开始裁剪(custom为true时生效)
209
+ startCutting: {
210
+ type: [Number, Boolean],
211
+ default: 0
212
+ },
213
+ /**
214
+ * 是否返回base64(H5端默认base64)
215
+ * 支持平台:App,微信小程序,支付宝小程序,H5(默认url就是base64)
216
+ **/
217
+ isBase64: {
218
+ type: Boolean,
219
+ default: false
220
+ },
221
+ //裁剪时是否显示loadding
222
+ loadding: {
223
+ type: Boolean,
224
+ default: true
225
+ },
226
+ //旋转icon
227
+ rotateImg: {
228
+ type: String,
229
+ default: '/static/components/cropper/img_rotate.png'
230
+ }
231
+ },
232
+ data() {
233
+ return {
234
+ MOVE_THROTTLE: null, //触摸移动节流setTimeout
235
+ MOVE_THROTTLE_FLAG: true, //节流标识
236
+ TIME_CUT_CENTER: null,
237
+ CROPPER_WIDTH: 200, //裁剪框宽
238
+ CROPPER_HEIGHT: 200, //裁剪框高
239
+ CUT_START: null,
240
+ cutX: 0, //画布x轴起点
241
+ cutY: 0, //画布y轴起点0
242
+ touchRelative: [
243
+ {
244
+ x: 0,
245
+ y: 0
246
+ }
247
+ ], //手指或鼠标和图片中心的相对位置
248
+ flagCutTouch: false, //是否是拖动裁剪框
249
+ hypotenuseLength: 0, //双指触摸时斜边长度
250
+ flagEndTouch: false, //是否结束触摸
251
+ canvasWidth: 0,
252
+ canvasHeight: 0,
253
+ imgWidth: 0, //图片宽度
254
+ imgHeight: 0, //图片高度
255
+ scale: 1, //图片缩放比
256
+ angle: 0, //图片旋转角度
257
+ cutAnimation: false, //是否开启图片和裁剪框过渡
258
+ cutAnimationTime: null,
259
+ imgTop: 0, //图片上边距
260
+ imgLeft: 0, //图片左边距
261
+ ctx: null,
262
+ sysInfo: null
263
+ };
264
+ },
265
+ computed: {
266
+ imgTransform() {
267
+ return `translate3d(${this.imgLeft - this.imgWidth / 2}px,${this.imgTop - this.imgHeight / 2}px,0) scale(${
268
+ this.scale
269
+ }) rotate(${this.angle}deg)`;
270
+ }
271
+ },
272
+ watch: {
273
+ imageUrl(val, oldVal) {
274
+ this.imageReset();
275
+ this.showLoading();
276
+ uni.getImageInfo({
277
+ src: val,
278
+ success: (res) => {
279
+ //计算图片尺寸
280
+ this.imgComputeSize(res.width, res.height);
281
+ if (this.limitMove) {
282
+ //限制移动,不留空白处理
283
+ this.imgMarginDetectionScale();
284
+ }
285
+ },
286
+ fail: (err) => {
287
+ this.imgComputeSize();
288
+ if (this.limitMove) {
289
+ this.imgMarginDetectionScale();
290
+ }
291
+ }
292
+ });
293
+ },
294
+ //监听截取框宽高变化
295
+ canvasWidth(val) {
296
+ if (val < this.minWidth) {
297
+ this.canvasWidth = this.minWidth;
298
+ }
299
+ this.computeCutSize();
300
+ },
301
+ canvasHeight(val) {
302
+ if (val < this.minHeight) {
303
+ this.canvasHeight = this.minHeight;
304
+ }
305
+ this.computeCutSize();
306
+ },
307
+ rotateAngle(val) {
308
+ this.cutAnimation = true;
309
+ this.angle = val;
310
+ },
311
+ angle(val) {
312
+ this.moveStop();
313
+ if (this.limitMove && val % 90) {
314
+ this.angle = Math.round(val / 90) * 90;
315
+ }
316
+ this.imgMarginDetectionScale();
317
+ },
318
+ cutAnimation(val) {
319
+ //开启过渡260毫秒之后自动关闭
320
+ clearTimeout(this.cutAnimationTime);
321
+ if (val) {
322
+ this.cutAnimationTime = setTimeout(() => {
323
+ this.cutAnimation = false;
324
+ }, 260);
325
+ }
326
+ },
327
+ limitMove(val) {
328
+ if (val) {
329
+ if (this.angle % 90) {
330
+ this.angle = Math.round(this.angle / 90) * 90;
331
+ }
332
+ this.imgMarginDetectionScale();
333
+ }
334
+ },
335
+ cutY(value) {
336
+ this.cutDetectionPosition();
337
+ },
338
+ cutX(value) {
339
+ this.cutDetectionPosition();
340
+ },
341
+ startCutting(val) {
342
+ if (this.custom && val) {
343
+ this.getImage();
344
+ }
345
+ }
346
+ },
347
+ mounted() {
348
+ this.sysInfo = uni.getSystemInfoSync();
349
+ this.imgTop = this.sysInfo.windowHeight / 2;
350
+ this.imgLeft = this.sysInfo.windowWidth / 2;
351
+ this.CROPPER_WIDTH = this.width;
352
+ this.CROPPER_HEIGHT = this.height;
353
+ this.canvasHeight = this.height;
354
+ this.canvasWidth = this.width;
355
+ this.ctx = uni.createCanvasContext('fui-image-cropper', this);
356
+ this.setCutCenter();
357
+ //设置裁剪框大小>设置图片尺寸>绘制canvas
358
+ this.computeCutSize();
359
+ //检查裁剪框是否在范围内
360
+ this.cutDetectionPosition();
361
+ setTimeout(() => {
362
+ this.$emit('ready', {});
363
+ }, 200);
364
+ },
365
+ methods: {
366
+ //返回裁剪后图片信息
367
+ getImage() {
368
+ if (!this.imageUrl) {
369
+ uni.showToast({
370
+ title: '请选择图片',
371
+ icon: 'none'
372
+ });
373
+ return;
374
+ }
375
+ this.loadding && this.showLoading();
376
+ let draw = () => {
377
+ //图片实际大小
378
+ let imgWidth = this.imgWidth * this.scale * this.scaleRatio;
379
+ let imgHeight = this.imgHeight * this.scale * this.scaleRatio;
380
+ //canvas和图片的相对距离
381
+ let xpos = this.imgLeft - this.cutX;
382
+ let ypos = this.imgTop - this.cutY;
383
+ //旋转画布
384
+ this.ctx.translate(xpos * this.scaleRatio, ypos * this.scaleRatio);
385
+ this.ctx.rotate((this.angle * Math.PI) / 180);
386
+ this.ctx.drawImage(this.imageUrl, -imgWidth / 2, -imgHeight / 2, imgWidth, imgHeight);
387
+ this.ctx.draw(false, () => {
388
+ let params = {
389
+ width: this.canvasWidth * this.scaleRatio,
390
+ height: Math.round(this.canvasHeight * this.scaleRatio),
391
+ destWidth: this.canvasWidth * this.scaleRatio,
392
+ destHeight: Math.round(this.canvasHeight) * this.scaleRatio,
393
+ fileType: 'png',
394
+ quality: this.quality
395
+ };
396
+ let data = {
397
+ url: '',
398
+ base64: '',
399
+ width: this.canvasWidth * this.scaleRatio,
400
+ height: this.canvasHeight * this.scaleRatio
401
+ };
402
+ // #ifdef MP-ALIPAY
403
+
404
+ if (this.isBase64) {
405
+ this.ctx.toDataURL(params).then((dataURL) => {
406
+ data.base64 = dataURL;
407
+ this.loadding && uni.hideLoading();
408
+ this.$emit('cropper', data);
409
+ });
410
+ } else {
411
+ this.ctx.toTempFilePath({
412
+ ...params,
413
+ success: (res) => {
414
+ data.url = res.tempFilePath;
415
+ this.loadding && uni.hideLoading();
416
+ this.$emit('cropper', data);
417
+ }
418
+ });
419
+ }
420
+ // #endif
421
+
422
+ // #ifndef MP-ALIPAY
423
+ // #ifdef MP-BAIDU || MP-TOUTIAO || H5
424
+ this.isBase64 = false;
425
+ // #endif
426
+ if (this.isBase64) {
427
+ uni.canvasGetImageData({
428
+ canvasId: 'fui-image-cropper',
429
+ x: 0,
430
+ y: 0,
431
+ width: this.canvasWidth * this.scaleRatio,
432
+ height: Math.round(this.canvasHeight * this.scaleRatio),
433
+ success: (res) => {
434
+ const arrayBuffer = new Uint8Array(res.data);
435
+ const base64 = uni.arrayBufferToBase64(arrayBuffer);
436
+ data.base64 = base64;
437
+ this.loadding && uni.hideLoading();
438
+ this.$emit('cropper', data);
439
+ }
440
+ });
441
+ } else {
442
+ uni.canvasToTempFilePath(
443
+ {
444
+ ...params,
445
+ canvasId: 'fui-image-cropper',
446
+ success: (res) => {
447
+ data.url = res.tempFilePath;
448
+ // #ifdef H5
449
+ data.base64 = res.tempFilePath;
450
+ // #endif
451
+ this.loadding && uni.hideLoading();
452
+ this.$emit('cropper', data);
453
+ },
454
+ fail(res) {
455
+ console.log(res);
456
+ }
457
+ },
458
+ this
459
+ );
460
+ }
461
+ // #endif
462
+ });
463
+ };
464
+ if (this.CROPPER_WIDTH != this.canvasWidth || this.CROPPER_HEIGHT != this.canvasHeight) {
465
+ this.CROPPER_WIDTH = this.canvasWidth;
466
+ this.CROPPER_HEIGHT = this.canvasHeight;
467
+ this.ctx.draw();
468
+ this.$nextTick(() => {
469
+ setTimeout(() => {
470
+ draw();
471
+ }, 100);
472
+ });
473
+ } else {
474
+ draw();
475
+ }
476
+ },
477
+ /**
478
+ * 设置剪裁框和图片居中
479
+ */
480
+ setCutCenter() {
481
+ let sys = this.sysInfo || uni.getSystemInfoSync();
482
+ let cutY = (sys.windowHeight - this.canvasHeight) * 0.5;
483
+ let cutX = (sys.windowWidth - this.canvasWidth) * 0.5;
484
+ //顺序不能变
485
+ this.imgTop = this.imgTop - this.cutY + cutY;
486
+ this.cutY = cutY; //截取的框上边距
487
+ this.imgLeft = this.imgLeft - this.cutX + cutX;
488
+ this.cutX = cutX; //截取的框左边距
489
+ },
490
+ imageReset() {
491
+ // this.cutAnimation = true;
492
+ this.scale = 1;
493
+ this.angle = 0;
494
+ let sys = this.sysInfo || uni.getSystemInfoSync();
495
+ this.imgTop = sys.windowHeight / 2;
496
+ this.imgLeft = sys.windowWidth / 2;
497
+ },
498
+ imageLoad(e) {
499
+ this.imageReset();
500
+ uni.hideLoading();
501
+ this.$emit('imageLoad', {});
502
+ },
503
+ //检测剪裁框位置是否在允许的范围内(屏幕内)
504
+ cutDetectionPosition() {
505
+ let cutDetectionPositionTop = () => {
506
+ //检测上边距是否在范围内
507
+ if (this.cutY < 0) {
508
+ this.cutY = 0;
509
+ }
510
+ if (this.cutY > this.sysInfo.windowHeight - this.canvasHeight) {
511
+ this.cutY = this.sysInfo.windowHeight - this.canvasHeight;
512
+ }
513
+ },
514
+ cutDetectionPositionLeft = () => {
515
+ //检测左边距是否在范围内
516
+ if (this.cutX < 0) {
517
+ this.cutX = 0;
518
+ }
519
+ if (this.cutX > this.sysInfo.windowWidth - this.canvasWidth) {
520
+ this.cutX = this.sysInfo.windowWidth - this.canvasWidth;
521
+ }
522
+ };
523
+ //裁剪框坐标处理(如果只写一个参数则另一个默认为0,都不写默认居中)
524
+ if (this.cutY == null && this.cutX == null) {
525
+ let cutY = (this.sysInfo.windowHeight - this.canvasHeight) * 0.5;
526
+ let cutX = (this.sysInfo.windowWidth - this.canvasWidth) * 0.5;
527
+ this.cutY = cutY; //截取的框上边距
528
+ this.cutX = cutX; //截取的框左边距
529
+ } else if (this.cutY != null && this.cutX != null) {
530
+ cutDetectionPositionTop();
531
+ cutDetectionPositionLeft();
532
+ } else if (this.cutY != null && this.cutX == null) {
533
+ cutDetectionPositionTop();
534
+ this.cutX = (this.sysInfo.windowWidth - this.canvasWidth) / 2;
535
+ } else if (this.cutY == null && this.cutX != null) {
536
+ cutDetectionPositionLeft();
537
+ this.cutY = (this.sysInfo.windowHeight - this.canvasHeight) / 2;
538
+ }
539
+ },
540
+ /**
541
+ * 图片边缘检测-位置
542
+ */
543
+ imgMarginDetectionPosition(scale) {
544
+ if (!this.limitMove) return;
545
+ let left = this.imgLeft;
546
+ let top = this.imgTop;
547
+ scale = scale || this.scale;
548
+ let imgWidth = this.imgWidth;
549
+ let imgHeight = this.imgHeight;
550
+ if ((this.angle / 90) % 2) {
551
+ imgWidth = this.imgHeight;
552
+ imgHeight = this.imgWidth;
553
+ }
554
+ left = this.cutX + (imgWidth * scale) / 2 >= left ? left : this.cutX + (imgWidth * scale) / 2;
555
+ left =
556
+ this.cutX + this.canvasWidth - (imgWidth * scale) / 2 <= left
557
+ ? left
558
+ : this.cutX + this.canvasWidth - (imgWidth * scale) / 2;
559
+ top = this.cutY + (imgHeight * scale) / 2 >= top ? top : this.cutY + (imgHeight * scale) / 2;
560
+ top =
561
+ this.cutY + this.canvasHeight - (imgHeight * scale) / 2 <= top
562
+ ? top
563
+ : this.cutY + this.canvasHeight - (imgHeight * scale) / 2;
564
+ this.imgLeft = left;
565
+ this.imgTop = top;
566
+ this.scale = scale;
567
+ },
568
+ /**
569
+ * 图片边缘检测-缩放
570
+ */
571
+ imgMarginDetectionScale(scale) {
572
+ if (!this.limitMove) return;
573
+ scale = scale || this.scale;
574
+ let imgWidth = this.imgWidth;
575
+ let imgHeight = this.imgHeight;
576
+ if ((this.angle / 90) % 2) {
577
+ imgWidth = this.imgHeight;
578
+ imgHeight = this.imgWidth;
579
+ }
580
+ if (imgWidth * scale < this.canvasWidth) {
581
+ scale = this.canvasWidth / imgWidth;
582
+ }
583
+ if (imgHeight * scale < this.canvasHeight) {
584
+ scale = Math.max(scale, this.canvasHeight / imgHeight);
585
+ }
586
+ this.imgMarginDetectionPosition(scale);
587
+ },
588
+ /**
589
+ * 计算图片尺寸
590
+ */
591
+ imgComputeSize(width, height) {
592
+ //默认按图片最小边 = 对应裁剪框尺寸
593
+ let imgWidth = width,
594
+ imgHeight = height;
595
+ if (imgWidth && imgHeight) {
596
+ if (imgWidth / imgHeight > (this.canvasWidth || this.width) / (this.canvasHeight || this.height)) {
597
+ imgHeight = this.canvasHeight || this.height;
598
+ imgWidth = (width / height) * imgHeight;
599
+ } else {
600
+ imgWidth = this.canvasWidth || this.width;
601
+ imgHeight = (height / width) * imgWidth;
602
+ }
603
+ } else {
604
+ let sys = this.sysInfo || uni.getSystemInfoSync();
605
+ imgWidth = sys.windowWidth;
606
+ imgHeight = 0;
607
+ }
608
+ this.imgWidth = imgWidth;
609
+ this.imgHeight = imgHeight;
610
+ },
611
+ //改变截取框大小
612
+ computeCutSize() {
613
+ if (this.canvasWidth > this.sysInfo.windowWidth) {
614
+ this.canvasWidth = this.sysInfo.windowWidth;
615
+ } else if (this.canvasWidth + this.cutX > this.sysInfo.windowWidth) {
616
+ this.cutX = this.sysInfo.windowWidth - this.cutX;
617
+ }
618
+ if (this.canvasHeight > this.sysInfo.windowHeight) {
619
+ this.canvasHeight = this.sysInfo.windowHeight;
620
+ } else if (this.canvasHeight + this.cutY > this.sysInfo.windowHeight) {
621
+ this.cutY = this.sysInfo.windowHeight - this.cutY;
622
+ }
623
+ },
624
+ //开始触摸
625
+ start(e) {
626
+ this.flagEndTouch = false;
627
+ if (e.touches.length == 1) {
628
+ //单指拖动
629
+ this.touchRelative[0] = {
630
+ x: e.touches[0].clientX - this.imgLeft,
631
+ y: e.touches[0].clientY - this.imgTop
632
+ };
633
+ } else {
634
+ //双指放大
635
+ let width = Math.abs(e.touches[0].clientX - e.touches[1].clientX);
636
+ let height = Math.abs(e.touches[0].clientY - e.touches[1].clientY);
637
+ this.touchRelative = [
638
+ {
639
+ x: e.touches[0].clientX - this.imgLeft,
640
+ y: e.touches[0].clientY - this.imgTop
641
+ },
642
+ {
643
+ x: e.touches[1].clientX - this.imgLeft,
644
+ y: e.touches[1].clientY - this.imgTop
645
+ }
646
+ ];
647
+ this.hypotenuseLength = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
648
+ }
649
+ },
650
+ moveThrottle() {
651
+ if (this.sysInfo.platform == 'android') {
652
+ clearTimeout(this.MOVE_THROTTLE);
653
+ this.MOVE_THROTTLE = setTimeout(() => {
654
+ this.MOVE_THROTTLE_FLAG = true;
655
+ }, 800 / 40);
656
+ return this.MOVE_THROTTLE_FLAG;
657
+ } else {
658
+ this.MOVE_THROTTLE_FLAG = true;
659
+ }
660
+ },
661
+ move(e) {
662
+ if (this.flagEndTouch || !this.MOVE_THROTTLE_FLAG) return;
663
+ this.MOVE_THROTTLE_FLAG = false;
664
+ this.moveThrottle();
665
+ this.moveDuring();
666
+ if (e.touches.length == 1) {
667
+ //单指拖动
668
+ let left = e.touches[0].clientX - this.touchRelative[0].x,
669
+ top = e.touches[0].clientY - this.touchRelative[0].y;
670
+ //图像边缘检测,防止截取到空白
671
+ this.imgLeft = left;
672
+ this.imgTop = top;
673
+ this.imgMarginDetectionPosition();
674
+ } else {
675
+ //双指放大
676
+ let width = Math.abs(e.touches[0].clientX - e.touches[1].clientX),
677
+ height = Math.abs(e.touches[0].clientY - e.touches[1].clientY),
678
+ hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)),
679
+ scale = this.scale * (hypotenuse / this.hypotenuseLength),
680
+ current_deg = 0;
681
+ scale = scale <= this.minScale ? this.minScale : scale;
682
+ scale = scale >= this.maxScale ? this.maxScale : scale;
683
+ //图像边缘检测,防止截取到空白
684
+ // this.scale = scale;
685
+ this.imgMarginDetectionScale(scale);
686
+ //双指旋转(如果没禁用旋转)
687
+ let touchRelative = [
688
+ {
689
+ x: e.touches[0].clientX - this.imgLeft,
690
+ y: e.touches[0].clientY - this.imgTop
691
+ },
692
+ {
693
+ x: e.touches[1].clientX - this.imgLeft,
694
+ y: e.touches[1].clientY - this.imgTop
695
+ }
696
+ ];
697
+ if (!this.disableRotate) {
698
+ let first_atan = (180 / Math.PI) * Math.atan2(touchRelative[0].y, touchRelative[0].x);
699
+ let first_atan_old = (180 / Math.PI) * Math.atan2(this.touchRelative[0].y, this.touchRelative[0].x);
700
+ let second_atan = (180 / Math.PI) * Math.atan2(touchRelative[1].y, touchRelative[1].x);
701
+ let second_atan_old = (180 / Math.PI) * Math.atan2(this.touchRelative[1].y, this.touchRelative[1].x);
702
+ //当前旋转的角度
703
+ let first_deg = first_atan - first_atan_old,
704
+ second_deg = second_atan - second_atan_old;
705
+ if (first_deg != 0) {
706
+ current_deg = first_deg;
707
+ } else if (second_deg != 0) {
708
+ current_deg = second_deg;
709
+ }
710
+ }
711
+ this.touchRelative = touchRelative;
712
+ this.hypotenuseLength = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
713
+ //更新视图
714
+ this.angle = this.angle + current_deg;
715
+ this.scale = this.scale;
716
+ }
717
+ },
718
+ //结束操作
719
+ end(e) {
720
+ this.flagEndTouch = true;
721
+ this.moveStop();
722
+ },
723
+ //裁剪框处理
724
+ cutTouchMove(e) {
725
+ if (this.flagCutTouch && this.MOVE_THROTTLE_FLAG) {
726
+ if (this.lockRatio && (this.lockWidth || this.lockHeight)) return;
727
+ //节流
728
+ this.MOVE_THROTTLE_FLAG = false;
729
+ this.moveThrottle();
730
+ let width = this.canvasWidth,
731
+ height = this.canvasHeight,
732
+ cutY = this.cutY,
733
+ cutX = this.cutX,
734
+ size_correct = () => {
735
+ width = width <= this.maxWidth ? (width >= this.minWidth ? width : this.minWidth) : this.maxWidth;
736
+ height = height <= this.maxHeight ? (height >= this.minHeight ? height : this.minHeight) : this.maxHeight;
737
+ },
738
+ size_inspect = () => {
739
+ if (
740
+ (width > this.maxWidth || width < this.minWidth || height > this.maxHeight || height < this.minHeight) &&
741
+ this.lockRatio
742
+ ) {
743
+ size_correct();
744
+ return false;
745
+ } else {
746
+ size_correct();
747
+ return true;
748
+ }
749
+ };
750
+ height =
751
+ this.CUT_START.height +
752
+ (this.CUT_START.corner > 1 && this.CUT_START.corner < 4 ? 1 : -1) * (this.CUT_START.y - e.touches[0].clientY);
753
+ switch (this.CUT_START.corner) {
754
+ case 1:
755
+ width = this.CUT_START.width - this.CUT_START.x + e.touches[0].clientX;
756
+ if (this.lockRatio) {
757
+ height = width / (this.canvasWidth / this.canvasHeight);
758
+ }
759
+ if (!size_inspect()) return;
760
+ break;
761
+ case 2:
762
+ width = this.CUT_START.width - this.CUT_START.x + e.touches[0].clientX;
763
+ if (this.lockRatio) {
764
+ height = width / (this.canvasWidth / this.canvasHeight);
765
+ }
766
+ if (!size_inspect()) return;
767
+ cutY = this.CUT_START.cutY - (height - this.CUT_START.height);
768
+ break;
769
+ case 3:
770
+ width = this.CUT_START.width + this.CUT_START.x - e.touches[0].clientX;
771
+ if (this.lockRatio) {
772
+ height = width / (this.canvasWidth / this.canvasHeight);
773
+ }
774
+ if (!size_inspect()) return;
775
+ cutY = this.CUT_START.cutY - (height - this.CUT_START.height);
776
+ cutX = this.CUT_START.cutX - (width - this.CUT_START.width);
777
+ break;
778
+ case 4:
779
+ width = this.CUT_START.width + this.CUT_START.x - e.touches[0].clientX;
780
+ if (this.lockRatio) {
781
+ height = width / (this.canvasWidth / this.canvasHeight);
782
+ }
783
+ if (!size_inspect()) return;
784
+ cutX = this.CUT_START.cutX - (width - this.CUT_START.width);
785
+ break;
786
+ default:
787
+ break;
788
+ }
789
+ if (!this.lockWidth && !this.lockHeight) {
790
+ this.canvasWidth = width;
791
+ this.cutX = cutX;
792
+ this.canvasHeight = height;
793
+ this.cutY = cutY;
794
+ } else if (!this.lockWidth) {
795
+ this.canvasWidth = width;
796
+ this.cutX = cutX;
797
+ } else if (!this.lockHeight) {
798
+ this.canvasHeight = height;
799
+ this.cutY = cutY;
800
+ }
801
+ this.imgMarginDetectionScale();
802
+ }
803
+ },
804
+ cutTouchStart(e) {
805
+ let currentX = e.touches[0].clientX;
806
+ let currentY = e.touches[0].clientY;
807
+
808
+ /*
809
+ * (右下-1 右上-2 左上-3 左下-4)
810
+ * left_x [3,4]
811
+ * top_y [2,3]
812
+ * right_x [1,2]
813
+ * bottom_y [1,4]
814
+ */
815
+ let left_x1 = this.cutX - 24;
816
+ let left_x2 = this.cutX + 24;
817
+
818
+ let top_y1 = this.cutY - 24;
819
+ let top_y2 = this.cutY + 24;
820
+
821
+ let right_x1 = this.cutX + this.canvasWidth - 24;
822
+ let right_x2 = this.cutX + this.canvasWidth + 24;
823
+
824
+ let bottom_y1 = this.cutY + this.canvasHeight - 24;
825
+ let bottom_y2 = this.cutY + this.canvasHeight + 24;
826
+
827
+ if (currentX > right_x1 && currentX < right_x2 && currentY > bottom_y1 && currentY < bottom_y2) {
828
+ this.moveDuring();
829
+ this.flagCutTouch = true;
830
+ this.flagEndTouch = true;
831
+ this.CUT_START = {
832
+ width: this.canvasWidth,
833
+ height: this.canvasHeight,
834
+ x: currentX,
835
+ y: currentY,
836
+ corner: 1
837
+ };
838
+ } else if (currentX > right_x1 && currentX < right_x2 && currentY > top_y1 && currentY < top_y2) {
839
+ this.moveDuring();
840
+ this.flagCutTouch = true;
841
+ this.flagEndTouch = true;
842
+ this.CUT_START = {
843
+ width: this.canvasWidth,
844
+ height: this.canvasHeight,
845
+ x: currentX,
846
+ y: currentY,
847
+ cutY: this.cutY,
848
+ cutX: this.cutX,
849
+ corner: 2
850
+ };
851
+ } else if (currentX > left_x1 && currentX < left_x2 && currentY > top_y1 && currentY < top_y2) {
852
+ this.moveDuring();
853
+ this.flagCutTouch = true;
854
+ this.flagEndTouch = true;
855
+ this.CUT_START = {
856
+ width: this.canvasWidth,
857
+ height: this.canvasHeight,
858
+ cutY: this.cutY,
859
+ cutX: this.cutX,
860
+ x: currentX,
861
+ y: currentY,
862
+ corner: 3
863
+ };
864
+ } else if (currentX > left_x1 && currentX < left_x2 && currentY > bottom_y1 && currentY < bottom_y2) {
865
+ this.moveDuring();
866
+ this.flagCutTouch = true;
867
+ this.flagEndTouch = true;
868
+ this.CUT_START = {
869
+ width: this.canvasWidth,
870
+ height: this.canvasHeight,
871
+ cutY: this.cutY,
872
+ cutX: this.cutX,
873
+ x: currentX,
874
+ y: currentY,
875
+ corner: 4
876
+ };
877
+ }
878
+ },
879
+ cutTouchEnd(e) {
880
+ this.moveStop();
881
+ this.flagCutTouch = false;
882
+ },
883
+ //停止移动时需要做的操作
884
+ moveStop() {
885
+ //清空之前的自动居中延迟函数并添加最新的
886
+ clearTimeout(this.TIME_CUT_CENTER);
887
+ this.TIME_CUT_CENTER = setTimeout(() => {
888
+ //动画启动
889
+ if (!this.cutAnimation) {
890
+ this.cutAnimation = true;
891
+ }
892
+ this.setCutCenter();
893
+ }, 800);
894
+ },
895
+ //移动中
896
+ moveDuring() {
897
+ //清空之前的自动居中延迟函数
898
+ clearTimeout(this.TIME_CUT_CENTER);
899
+ },
900
+ showLoading() {
901
+ uni.showLoading({
902
+ title: '请稍候...',
903
+ mask: true
904
+ });
905
+ },
906
+ stop() {},
907
+ back() {
908
+ uni.navigateBack();
909
+ },
910
+ setAngle() {
911
+ this.cutAnimation = true;
912
+ this.angle = this.angle + 90;
913
+ }
914
+ }
915
+ };
916
+ </script>
917
+
918
+ <style scoped>
919
+ .fui-container {
920
+ width: 100vw;
921
+ height: 100vh;
922
+ background-color: rgba(0, 0, 0, 0.6);
923
+ position: fixed;
924
+ top: 0;
925
+ left: 0;
926
+ z-index: 1;
927
+ }
928
+
929
+ .fui-image-cropper {
930
+ width: 100vw;
931
+ height: 100vh;
932
+ position: absolute;
933
+ }
934
+
935
+ .fui-content {
936
+ width: 100vw;
937
+ height: 100vh;
938
+ position: absolute;
939
+ z-index: 9;
940
+ display: flex;
941
+ flex-direction: column;
942
+ pointer-events: none;
943
+ }
944
+
945
+ .fui-bg-transparent {
946
+ background-color: rgba(0, 0, 0, 0.6);
947
+ transition-duration: 0.35s;
948
+ }
949
+
950
+ .fui-content-top {
951
+ pointer-events: none;
952
+ }
953
+
954
+ .fui-content-middle {
955
+ width: 100%;
956
+ height: 200px;
957
+ display: flex;
958
+ box-sizing: border-box;
959
+ }
960
+
961
+ .fui-cropper-box {
962
+ position: relative;
963
+ /* transition-duration: 0.3s; */
964
+ border-style: solid;
965
+ border-width: 1rpx;
966
+ box-sizing: border-box;
967
+ }
968
+
969
+ .fui-flex-auto {
970
+ flex: auto;
971
+ }
972
+
973
+ .fui-cropper-image {
974
+ width: 100%;
975
+ border-style: none;
976
+ position: absolute;
977
+ top: 0;
978
+ left: 0;
979
+ z-index: 2;
980
+ -webkit-backface-visibility: hidden;
981
+ backface-visibility: hidden;
982
+ transform-origin: center;
983
+ }
984
+
985
+ .fui-cropper-canvas {
986
+ position: fixed;
987
+ z-index: 10;
988
+ left: -2000px;
989
+ top: -2000px;
990
+ pointer-events: none;
991
+ }
992
+
993
+ .fui-edge {
994
+ border-style: solid;
995
+ pointer-events: auto;
996
+ position: absolute;
997
+ box-sizing: border-box;
998
+ }
999
+
1000
+ .fui-top-left {
1001
+ border-bottom-width: 0 !important;
1002
+ border-right-width: 0 !important;
1003
+ }
1004
+
1005
+ .fui-top-right {
1006
+ border-bottom-width: 0 !important;
1007
+ border-left-width: 0 !important;
1008
+ }
1009
+
1010
+ .fui-bottom-left {
1011
+ border-top-width: 0 !important;
1012
+ border-right-width: 0 !important;
1013
+ }
1014
+
1015
+ .fui-bottom-right {
1016
+ border-top-width: 0 !important;
1017
+ border-left-width: 0 !important;
1018
+ }
1019
+
1020
+ .fui-cropper-tabbar {
1021
+ width: 100%;
1022
+ height: 120rpx;
1023
+ padding: 0 40rpx;
1024
+ box-sizing: border-box;
1025
+ position: fixed;
1026
+ left: 0;
1027
+ bottom: 0;
1028
+ z-index: 99;
1029
+ display: flex;
1030
+ align-items: center;
1031
+ justify-content: space-between;
1032
+ color: #ffffff;
1033
+ font-size: 32rpx;
1034
+ }
1035
+
1036
+ .fui-cropper-tabbar::after {
1037
+ content: ' ';
1038
+ position: absolute;
1039
+ top: 0;
1040
+ right: 0;
1041
+ left: 0;
1042
+ border-top: 1rpx solid rgba(255, 255, 255, 0.2);
1043
+ -webkit-transform: scaleY(0.5) translateZ(0);
1044
+ transform: scaleY(0.5) translateZ(0);
1045
+ transform-origin: 0 100%;
1046
+ }
1047
+
1048
+ .fui-op-btn {
1049
+ height: 80rpx;
1050
+ display: flex;
1051
+ align-items: center;
1052
+ }
1053
+
1054
+ .fui-rotate-img {
1055
+ width: 44rpx;
1056
+ height: 44rpx;
1057
+ }
1058
+ </style>