@gmcb/uv-ui 0.2.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/CHANGELOG.md +295 -0
  2. package/LICENSE +21 -0
  3. package/README.md +164 -0
  4. package/components/uv-action-sheet/props.js +50 -0
  5. package/components/uv-action-sheet/uv-action-sheet.vue +280 -0
  6. package/components/uv-album/uv-album.vue +312 -0
  7. package/components/uv-alert/props.js +45 -0
  8. package/components/uv-alert/uv-alert.vue +246 -0
  9. package/components/uv-avatar/props.js +85 -0
  10. package/components/uv-avatar/uv-avatar.vue +182 -0
  11. package/components/uv-avatar-group/props.js +53 -0
  12. package/components/uv-avatar-group/uv-avatar-group.vue +106 -0
  13. package/components/uv-back-top/props.js +58 -0
  14. package/components/uv-back-top/uv-back-top.vue +116 -0
  15. package/components/uv-badge/props.js +73 -0
  16. package/components/uv-badge/uv-badge.vue +176 -0
  17. package/components/uv-button/nvue.scss +46 -0
  18. package/components/uv-button/props.js +163 -0
  19. package/components/uv-button/uv-button.vue +529 -0
  20. package/components/uv-button/vue.scss +93 -0
  21. package/components/uv-calendar/calendar.js +546 -0
  22. package/components/uv-calendar/header.vue +104 -0
  23. package/components/uv-calendar/month.vue +616 -0
  24. package/components/uv-calendar/props.js +145 -0
  25. package/components/uv-calendar/uv-calendar.vue +390 -0
  26. package/components/uv-calendars/calendar-body.vue +376 -0
  27. package/components/uv-calendars/calendar-item.vue +248 -0
  28. package/components/uv-calendars/calendar.js +546 -0
  29. package/components/uv-calendars/i18n/en.json +12 -0
  30. package/components/uv-calendars/i18n/index.js +8 -0
  31. package/components/uv-calendars/i18n/zh-Hans.json +12 -0
  32. package/components/uv-calendars/i18n/zh-Hant.json +12 -0
  33. package/components/uv-calendars/util.js +435 -0
  34. package/components/uv-calendars/uv-calendars.vue +452 -0
  35. package/components/uv-cell/props.js +116 -0
  36. package/components/uv-cell/uv-cell.vue +209 -0
  37. package/components/uv-cell-group/props.js +15 -0
  38. package/components/uv-cell-group/uv-cell-group.vue +63 -0
  39. package/components/uv-checkbox/props.js +70 -0
  40. package/components/uv-checkbox/uv-checkbox.vue +371 -0
  41. package/components/uv-checkbox-group/props.js +84 -0
  42. package/components/uv-checkbox-group/uv-checkbox-group.vue +119 -0
  43. package/components/uv-code/props.js +35 -0
  44. package/components/uv-code/uv-code.vue +136 -0
  45. package/components/uv-code-input/props.js +83 -0
  46. package/components/uv-code-input/uv-code-input.vue +272 -0
  47. package/components/uv-col/props.js +30 -0
  48. package/components/uv-col/uv-col.vue +165 -0
  49. package/components/uv-collapse/props.js +20 -0
  50. package/components/uv-collapse/uv-collapse.vue +86 -0
  51. package/components/uv-collapse-item/props.js +60 -0
  52. package/components/uv-collapse-item/uv-collapse-item.vue +228 -0
  53. package/components/uv-column-notice/props.js +61 -0
  54. package/components/uv-column-notice/uv-column-notice.vue +176 -0
  55. package/components/uv-count-down/props.js +25 -0
  56. package/components/uv-count-down/utils.js +62 -0
  57. package/components/uv-count-down/uv-count-down.vue +169 -0
  58. package/components/uv-count-to/props.js +60 -0
  59. package/components/uv-count-to/uv-count-to.vue +187 -0
  60. package/components/uv-datetime-picker/props.js +130 -0
  61. package/components/uv-datetime-picker/uv-datetime-picker.vue +355 -0
  62. package/components/uv-divider/props.js +45 -0
  63. package/components/uv-divider/uv-divider.vue +113 -0
  64. package/components/uv-drop-down/uv-drop-down.vue +135 -0
  65. package/components/uv-drop-down-item/uv-drop-down-item.vue +169 -0
  66. package/components/uv-drop-down-popup/uv-drop-down-popup.vue +242 -0
  67. package/components/uv-empty/props.js +60 -0
  68. package/components/uv-empty/uv-empty.vue +126 -0
  69. package/components/uv-form/props.js +46 -0
  70. package/components/uv-form/uv-form.vue +209 -0
  71. package/components/uv-form/valid.js +1343 -0
  72. package/components/uv-form-item/props.js +49 -0
  73. package/components/uv-form-item/uv-form-item.vue +226 -0
  74. package/components/uv-gap/props.js +25 -0
  75. package/components/uv-gap/uv-gap.vue +36 -0
  76. package/components/uv-grid/props.js +20 -0
  77. package/components/uv-grid/uv-grid.vue +100 -0
  78. package/components/uv-grid-item/props.js +15 -0
  79. package/components/uv-grid-item/uv-grid-item.vue +223 -0
  80. package/components/uv-icon/icons.js +160 -0
  81. package/components/uv-icon/props.js +90 -0
  82. package/components/uv-icon/uv-icon.vue +226 -0
  83. package/components/uv-icon/uvicons.ttf +0 -0
  84. package/components/uv-image/props.js +100 -0
  85. package/components/uv-image/uv-image.vue +296 -0
  86. package/components/uv-index-anchor/props.js +30 -0
  87. package/components/uv-index-anchor/uv-index-anchor.vue +98 -0
  88. package/components/uv-index-item/uv-index-item.vue +87 -0
  89. package/components/uv-index-list/props.js +30 -0
  90. package/components/uv-index-list/uv-index-list.vue +461 -0
  91. package/components/uv-input/props.js +175 -0
  92. package/components/uv-input/uv-input.vue +348 -0
  93. package/components/uv-keyboard/props.js +95 -0
  94. package/components/uv-keyboard/uv-keyboard.vue +180 -0
  95. package/components/uv-keyboard-car/props.js +24 -0
  96. package/components/uv-keyboard-car/uv-keyboard-car.vue +347 -0
  97. package/components/uv-keyboard-number/props.js +19 -0
  98. package/components/uv-keyboard-number/uv-keyboard-number.vue +201 -0
  99. package/components/uv-line/props.js +34 -0
  100. package/components/uv-line/uv-line.vue +60 -0
  101. package/components/uv-line-progress/props.js +29 -0
  102. package/components/uv-line-progress/uv-line-progress.vue +146 -0
  103. package/components/uv-link/props.js +40 -0
  104. package/components/uv-link/uv-link.vue +83 -0
  105. package/components/uv-list/uv-list.vue +147 -0
  106. package/components/uv-list-item/uv-list-item.vue +535 -0
  107. package/components/uv-load-more/props.js +95 -0
  108. package/components/uv-load-more/uv-load-more.vue +152 -0
  109. package/components/uv-loading-icon/props.js +67 -0
  110. package/components/uv-loading-icon/uv-loading-icon.vue +347 -0
  111. package/components/uv-loading-page/props.js +55 -0
  112. package/components/uv-loading-page/uv-loading-page.vue +96 -0
  113. package/components/uv-modal/props.js +90 -0
  114. package/components/uv-modal/uv-modal.vue +245 -0
  115. package/components/uv-navbar/props.js +89 -0
  116. package/components/uv-navbar/uv-navbar.vue +245 -0
  117. package/components/uv-no-network/props.js +20 -0
  118. package/components/uv-no-network/uv-no-network.vue +222 -0
  119. package/components/uv-notice-bar/props.js +76 -0
  120. package/components/uv-notice-bar/uv-notice-bar.vue +110 -0
  121. package/components/uv-notify/props.js +45 -0
  122. package/components/uv-notify/uv-notify.vue +220 -0
  123. package/components/uv-number-box/props.js +118 -0
  124. package/components/uv-number-box/uv-number-box.vue +397 -0
  125. package/components/uv-overlay/props.js +25 -0
  126. package/components/uv-overlay/uv-overlay.vue +85 -0
  127. package/components/uv-parse/node/node.vue +576 -0
  128. package/components/uv-parse/parser.js +1335 -0
  129. package/components/uv-parse/uv-parse.vue +498 -0
  130. package/components/uv-pick-color/colors.js +217 -0
  131. package/components/uv-pick-color/props.js +47 -0
  132. package/components/uv-pick-color/uv-pick-color.vue +551 -0
  133. package/components/uv-picker/props.js +95 -0
  134. package/components/uv-picker/uv-picker.vue +329 -0
  135. package/components/uv-popup/keypress.js +45 -0
  136. package/components/uv-popup/uv-popup.vue +537 -0
  137. package/components/uv-preview-video/uv-preview-video.vue +52 -0
  138. package/components/uv-qrcode/cache.js +1 -0
  139. package/components/uv-qrcode/gcanvas/bridge/bridge-weex.js +241 -0
  140. package/components/uv-qrcode/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
  141. package/components/uv-qrcode/gcanvas/context-2d/FillStylePattern.js +8 -0
  142. package/components/uv-qrcode/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
  143. package/components/uv-qrcode/gcanvas/context-2d/RenderingContext.js +666 -0
  144. package/components/uv-qrcode/gcanvas/context-webgl/ActiveInfo.js +11 -0
  145. package/components/uv-qrcode/gcanvas/context-webgl/Buffer.js +21 -0
  146. package/components/uv-qrcode/gcanvas/context-webgl/Framebuffer.js +21 -0
  147. package/components/uv-qrcode/gcanvas/context-webgl/GLenum.js +298 -0
  148. package/components/uv-qrcode/gcanvas/context-webgl/GLmethod.js +142 -0
  149. package/components/uv-qrcode/gcanvas/context-webgl/GLtype.js +23 -0
  150. package/components/uv-qrcode/gcanvas/context-webgl/Program.js +21 -0
  151. package/components/uv-qrcode/gcanvas/context-webgl/Renderbuffer.js +21 -0
  152. package/components/uv-qrcode/gcanvas/context-webgl/RenderingContext.js +1191 -0
  153. package/components/uv-qrcode/gcanvas/context-webgl/Shader.js +22 -0
  154. package/components/uv-qrcode/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
  155. package/components/uv-qrcode/gcanvas/context-webgl/Texture.js +22 -0
  156. package/components/uv-qrcode/gcanvas/context-webgl/UniformLocation.js +22 -0
  157. package/components/uv-qrcode/gcanvas/context-webgl/classUtils.js +3 -0
  158. package/components/uv-qrcode/gcanvas/env/canvas.js +74 -0
  159. package/components/uv-qrcode/gcanvas/env/image.js +96 -0
  160. package/components/uv-qrcode/gcanvas/env/tool.js +24 -0
  161. package/components/uv-qrcode/gcanvas/index.js +39 -0
  162. package/components/uv-qrcode/props.js +85 -0
  163. package/components/uv-qrcode/qrcode.js +34 -0
  164. package/components/uv-qrcode/queue.js +41 -0
  165. package/components/uv-qrcode/uv-qrcode.vue +1038 -0
  166. package/components/uv-radio/props.js +65 -0
  167. package/components/uv-radio/uv-radio.vue +349 -0
  168. package/components/uv-radio-group/props.js +89 -0
  169. package/components/uv-radio-group/uv-radio-group.vue +115 -0
  170. package/components/uv-rate/props.js +73 -0
  171. package/components/uv-rate/uv-rate.vue +274 -0
  172. package/components/uv-read-more/props.js +62 -0
  173. package/components/uv-read-more/uv-read-more.vue +162 -0
  174. package/components/uv-row/props.js +20 -0
  175. package/components/uv-row/uv-row.vue +95 -0
  176. package/components/uv-row-notice/props.js +40 -0
  177. package/components/uv-row-notice/uv-row-notice.vue +341 -0
  178. package/components/uv-safe-bottom/uv-safe-bottom.vue +67 -0
  179. package/components/uv-scroll-list/nvue.js +29 -0
  180. package/components/uv-scroll-list/props.js +35 -0
  181. package/components/uv-scroll-list/scrollWxs.wxs +51 -0
  182. package/components/uv-scroll-list/uv-scroll-list.vue +218 -0
  183. package/components/uv-search/props.js +127 -0
  184. package/components/uv-search/uv-search.vue +311 -0
  185. package/components/uv-skeleton/props.js +65 -0
  186. package/components/uv-skeleton/uv-skeleton.vue +250 -0
  187. package/components/uv-skeletons/uv-skeletons.vue +247 -0
  188. package/components/uv-slider/props.js +58 -0
  189. package/components/uv-slider/uv-slider.vue +58 -0
  190. package/components/uv-status-bar/props.js +8 -0
  191. package/components/uv-status-bar/uv-status-bar.vue +54 -0
  192. package/components/uv-steps/props.js +40 -0
  193. package/components/uv-steps/uv-steps.vue +83 -0
  194. package/components/uv-steps-item/props.js +25 -0
  195. package/components/uv-steps-item/uv-steps-item.vue +347 -0
  196. package/components/uv-sticky/props.js +41 -0
  197. package/components/uv-sticky/uv-sticky.vue +223 -0
  198. package/components/uv-subsection/props.js +54 -0
  199. package/components/uv-subsection/uv-subsection.vue +269 -0
  200. package/components/uv-swipe-action/props.js +10 -0
  201. package/components/uv-swipe-action/uv-swipe-action.vue +65 -0
  202. package/components/uv-swipe-action-item/index - backup.wxs +256 -0
  203. package/components/uv-swipe-action-item/index.wxs +225 -0
  204. package/components/uv-swipe-action-item/nvue - backup.js +264 -0
  205. package/components/uv-swipe-action-item/nvue.js +182 -0
  206. package/components/uv-swipe-action-item/props.js +40 -0
  207. package/components/uv-swipe-action-item/uv-swipe-action-item.vue +200 -0
  208. package/components/uv-swipe-action-item/wxs.js +15 -0
  209. package/components/uv-swiper/props.js +136 -0
  210. package/components/uv-swiper/uv-swiper.vue +263 -0
  211. package/components/uv-swiper-indicator/props.js +30 -0
  212. package/components/uv-swiper-indicator/uv-swiper-indicator.vue +112 -0
  213. package/components/uv-switch/props.js +58 -0
  214. package/components/uv-switch/uv-switch.vue +182 -0
  215. package/components/uv-tabbar/props.js +50 -0
  216. package/components/uv-tabbar/uv-tabbar.vue +146 -0
  217. package/components/uv-tabbar-item/props.js +40 -0
  218. package/components/uv-tabbar-item/uv-tabbar-item.vue +146 -0
  219. package/components/uv-tabs/props.js +71 -0
  220. package/components/uv-tabs/uv-tabs.vue +391 -0
  221. package/components/uv-tags/props.js +104 -0
  222. package/components/uv-tags/uv-tags.vue +379 -0
  223. package/components/uv-text/props.js +113 -0
  224. package/components/uv-text/uv-text.vue +218 -0
  225. package/components/uv-text/value.js +87 -0
  226. package/components/uv-textarea/props.js +138 -0
  227. package/components/uv-textarea/uv-textarea.vue +238 -0
  228. package/components/uv-toast/uv-toast.vue +292 -0
  229. package/components/uv-toolbar/props.js +40 -0
  230. package/components/uv-toolbar/uv-toolbar.vue +109 -0
  231. package/components/uv-tooltip/props.js +60 -0
  232. package/components/uv-tooltip/uv-tooltip.vue +372 -0
  233. package/components/uv-transition/createAnimation.js +131 -0
  234. package/components/uv-transition/props.js +31 -0
  235. package/components/uv-transition/uv-transition.vue +320 -0
  236. package/components/uv-upload/mixin.js +22 -0
  237. package/components/uv-upload/props.js +130 -0
  238. package/components/uv-upload/utils.js +151 -0
  239. package/components/uv-upload/uv-upload.vue +488 -0
  240. package/components/uv-vtabs/props.js +79 -0
  241. package/components/uv-vtabs/uv-vtabs.vue +438 -0
  242. package/components/uv-vtabs-item/uv-vtabs-item.vue +68 -0
  243. package/components/uv-waterfall/props.js +69 -0
  244. package/components/uv-waterfall/uv-waterfall.vue +265 -0
  245. package/index.js +82 -0
  246. package/index.scss +7 -0
  247. package/libs/config/config.js +34 -0
  248. package/libs/css/color.scss +32 -0
  249. package/libs/css/common.scss +100 -0
  250. package/libs/css/components.scss +23 -0
  251. package/libs/css/variable.scss +111 -0
  252. package/libs/css/vue.scss +40 -0
  253. package/libs/function/colorGradient.js +134 -0
  254. package/libs/function/compress.js +27 -0
  255. package/libs/function/debounce.js +29 -0
  256. package/libs/function/digit.js +167 -0
  257. package/libs/function/index.js +734 -0
  258. package/libs/function/platform.js +75 -0
  259. package/libs/function/test.js +287 -0
  260. package/libs/function/throttle.js +30 -0
  261. package/libs/luch-request/adapters/index.js +132 -0
  262. package/libs/luch-request/core/InterceptorManager.js +51 -0
  263. package/libs/luch-request/core/Request.js +201 -0
  264. package/libs/luch-request/core/buildFullPath.js +20 -0
  265. package/libs/luch-request/core/defaults.js +33 -0
  266. package/libs/luch-request/core/dispatchRequest.js +6 -0
  267. package/libs/luch-request/core/mergeConfig.js +126 -0
  268. package/libs/luch-request/core/settle.js +16 -0
  269. package/libs/luch-request/helpers/buildURL.js +64 -0
  270. package/libs/luch-request/helpers/combineURLs.js +14 -0
  271. package/libs/luch-request/helpers/isAbsoluteURL.js +14 -0
  272. package/libs/luch-request/index.d.ts +197 -0
  273. package/libs/luch-request/index.js +2 -0
  274. package/libs/luch-request/utils/clone.js +264 -0
  275. package/libs/luch-request/utils.js +135 -0
  276. package/libs/mixin/button.js +13 -0
  277. package/libs/mixin/mixin.js +172 -0
  278. package/libs/mixin/mpMixin.js +8 -0
  279. package/libs/mixin/mpShare.js +13 -0
  280. package/libs/mixin/openType.js +47 -0
  281. package/libs/mixin/touch.js +59 -0
  282. package/libs/util/dayjs.js +216 -0
  283. package/libs/util/route.js +126 -0
  284. package/package.json +28 -0
  285. package/theme.scss +43 -0
@@ -0,0 +1,1038 @@
1
+ <template>
2
+ <view class="uqrcode"
3
+ :class="{ 'uqrcode-hide': hide }"
4
+ :style="{ width: `${templateOptions.width}px`, height: `${templateOptions.height}px` }">
5
+ <view class="uqrcode-canvas-wrapper">
6
+ <!-- 画布 -->
7
+ <!-- #ifndef APP-NVUE -->
8
+ <canvas class="uqrcode-canvas"
9
+ :id="canvasId"
10
+ :canvas-id="canvasId"
11
+ :type="canvasType"
12
+ :style="{
13
+ width: `${templateOptions.canvasWidth}px`,
14
+ height: `${templateOptions.canvasHeight}px`,
15
+ transform: templateOptions.canvasTransform
16
+ }"
17
+ v-if="templateOptions.canvasDisplay"
18
+ @click="onClick"></canvas>
19
+ <!-- #endif -->
20
+
21
+ <!-- nvue用gcanvas -->
22
+ <!-- #ifdef APP-NVUE -->
23
+ <gcanvas class="uqrcode-canvas"
24
+ ref="gcanvas"
25
+ :style="{
26
+ width: `${templateOptions.canvasWidth}px`,
27
+ height: `${templateOptions.canvasHeight}px`
28
+ }"
29
+ v-if="templateOptions.canvasDisplay"
30
+ @click="onClick"></gcanvas>
31
+ <!-- #endif -->
32
+ </view>
33
+
34
+ <!-- 加载效果 -->
35
+ <view class="uqrcode-makeing"
36
+ v-if="loading === undefined || !loading ? makeing : loading">
37
+ <slot name="loading">
38
+ <image class="uqrcode-makeing-image"
39
+ :style="{ width: `${templateOptions.size / 4}px`, height: `${templateOptions.size / 4}px` }"
40
+ src="data:image/gif;base64,R0lGODlhAAEAAfIEAOHh4SSsWuDg4N3d3f///wAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDYuMC1jMDAyIDc5LjE2NDQ4OCwgMjAyMC8wNy8xMC0yMjowNjo1MyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIyLjAgKFdpbmRvd3MpIiB4bXBNTTpJbnN0Y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66SmpqJYKwKipqjroqa3yKVWSsP64oaknSVmrj7deOauWu/bYq665QgmhhrgCRexl/1UOayxFy+bGpbNP/ipqsDxSGya0zxropLavFlsttjuC6ya343rbpLlFWosouQKwS6u426rLpLzA0hsus1Tie62+59q7pL/vAtwuvATT6K7CCCPrK7r18vutw9Hm9LDARCacI8T7SmulxjIuvDHGQ4JMJ8cBS7wuxa6GjPK9LLcMo8i2xiwzmi8PbPPNNPO6s8w9C/tzy0FnO7SrRZd7tKpJx7t0qU2bzGjUT4fadKxYn2xw1lwfvHXXYDP8ddhkN5pz2WhfjTbQZ68dttpuM9123De7PDbddZvJatZUk4x3xbsk6/Hfa/atMuGCWww4f4gXPrfYhzferbKTDy554hmBXxz55R0rXvlgnGvO1OJphS665+luTncCADs=">
41
+ </image>
42
+ </slot>
43
+ </view>
44
+
45
+ <!-- 错误处理 -->
46
+ <view class="uqrcode-error"
47
+ v-if="isError"
48
+ @click="onClick">
49
+ <slot name="error"
50
+ :error="error">
51
+ <text class="uqrcode-error-message">{{ error.errMsg }}</text>
52
+ </slot>
53
+ </view>
54
+
55
+ <!-- H5保存提示 -->
56
+ <!-- #ifdef H5 -->
57
+ <view class="uqrcode-h5-save"
58
+ v-if="isH5Save">
59
+ <slot name="h5save"
60
+ :tempFilePath="tempFilePath">
61
+ <image class="uqrcode-h5-save-image"
62
+ :src="tempFilePath"></image>
63
+ <text class="uqrcode-h5-save-text">{{ h5SaveIsDownload ? '若保存失败,' : '' }}请长按二维码进行保存</text>
64
+ </slot>
65
+ <view class="uqrcode-h5-save-close"
66
+ @click.stop="isH5Save = false">
67
+ <view class="uqrcode-h5-save-close-before"></view>
68
+ <view class="uqrcode-h5-save-close-after"></view>
69
+ </view>
70
+ </view>
71
+ <!-- #endif -->
72
+ </view>
73
+ </template>
74
+
75
+ <script>
76
+ import props from './props.js';
77
+ import mpMixin from '../../libs/mixin/mpMixin.js'
78
+ import mixin from '../../libs/mixin/mixin.js'
79
+ // #ifdef VUE3
80
+ import { toRaw } from 'vue';
81
+ // #endif
82
+ /* 引入uvQRCode核心js */
83
+ import UQRCode from './qrcode';
84
+ /* 引入nvue所需模块 */
85
+ // #ifdef APP-NVUE
86
+ import { enable, WeexBridge } from './gcanvas';
87
+ const modal = weex.requireModule('modal');
88
+ // #endif
89
+ /* 引入队列 */
90
+ import { queueDraw, queueLoadImage } from './queue';
91
+ /* 引入缓存图片 */
92
+ import { cacheImageList } from './cache';
93
+ let instance = null;
94
+ /**
95
+ * qrcode 二维码
96
+ * @description 二维码生成插件,可扩展性高,它支持自定义渲染二维码,可通过uQRCode API得到二维码绘制关键信息后,使用canvas、svg或js操作dom的方式绘制二维码图案。还可自定义二维码样式,如随机颜色、圆点、方块、块与块之间的间距等。
97
+ * @tutorial https://www.uvui.cn/components/qrcode.html
98
+ * @property {String} value 二维码内容 (start为true时必填 )
99
+ * @property {Object} options 二维码配置选项 (data|size|margin...)
100
+ * @property {String} fileType 导出的文件类型 (jpg | png)
101
+ * @property {String} start 是否初始化组件后就开始生成 (默认 true)
102
+ * @property {String} auto 是否数据发生改变自动重绘 (默认 false)
103
+ * @property {String} hide 隐藏组件。如果只需要导出二维码作为图片使用,可设置为true,不能在组件或组件父级元素设置v-if="false"、v-show="false"、style="display:none;"等实现隐藏效果,这样会导致导出二维码空白 (默认 false)
104
+ * @property {String} type canvas组件类型。微信小程序默认2d (默认 undefined)
105
+ * @property {String} queue 队列绘制 (默认 false)
106
+ * @property {String} isQueueLoadImage 是否队列加载图片,选择true将通过队列缓存所需要加载的图片。优点是加载重复资源可减少资源请求次数,节省网络资源,缺点是会转化为同步请求,资源不重复且多的情况下,等待时间会更久。总之,请求重复资源较多则选择true,请求不重复资源较多则选择false (默认 false)
107
+ * @property {String} loading loading态 (默认 false)
108
+ * @property {String} h5SaveIsDownload H5保存即自动下载(在支持的环境下),默认false为仅弹层提示用户需要长按图片保存,不会自动下载 (默认 false)
109
+ * @property {String} h5DownloadName H5下载名称
110
+ * @property {String} h5SaveTip H5保存二维码时候是否显示提示
111
+ * @example <uv-qrcode ref="uvqrcode" size="400rpx" canvas-id="qrcode" value="https://www.uvui.cn"></uv-qrcode>
112
+ */
113
+ export default {
114
+ name: 'uv-qrcode',
115
+ mixins: [mpMixin,mixin,props],
116
+ emits: ['click','change','complete'],
117
+ data() {
118
+ return {
119
+ canvasId: "",
120
+ canvas: undefined,
121
+ canvasType: undefined,
122
+ canvasContext: undefined,
123
+ makeDelegate: undefined,
124
+ drawDelegate: undefined,
125
+ toTempFilePathDelegate: undefined,
126
+ makeExecuted: false,
127
+ makeing: false,
128
+ drawing: false,
129
+ isError: false,
130
+ error: undefined,
131
+ isH5Save: false,
132
+ tempFilePath: '',
133
+ templateOptions: {
134
+ size: 0,
135
+ width: 0, // 组件宽度
136
+ height: 0,
137
+ canvasWidth: 0, // canvas宽度
138
+ canvasHeight: 0,
139
+ canvasTransform: '',
140
+ canvasDisplay: false
141
+ },
142
+ uqrcodeOptions: {
143
+ data: ''
144
+ },
145
+ plugins: [],
146
+ makeingPattern: [
147
+ [
148
+ [true, true, true, false, false, false, false, true, true, true],
149
+ [true, true, true, false, false, false, false, true, true, true],
150
+ [true, true, true, false, false, false, false, true, true, true],
151
+ [true, true, true, false, false, false, false, true, true, true],
152
+ [true, true, true, false, false, false, false, true, true, true],
153
+ [true, true, true, false, false, false, false, true, true, true],
154
+ [true, true, true, false, false, false, false, true, true, true],
155
+ [true, true, true, true, true, true, true, true, true, true],
156
+ [true, true, true, true, true, true, true, true, true, true],
157
+ [true, true, true, true, true, true, true, true, true, true]
158
+ ],
159
+ [
160
+ [true, true, true, true, true, true, true, true, true, true],
161
+ [true, true, true, true, true, true, true, true, true, true],
162
+ [true, true, true, true, true, true, true, true, true, true],
163
+ [true, true, true, false, false, false, false, true, true, true],
164
+ [true, true, true, false, false, false, false, true, true, true],
165
+ [true, true, true, false, false, false, false, true, true, true],
166
+ [true, true, true, false, false, false, false, false, false, false],
167
+ [true, true, true, true, true, true, false, true, true, true],
168
+ [true, true, true, true, true, true, false, true, true, true],
169
+ [true, true, true, true, true, true, false, true, true, true]
170
+ ],
171
+ [
172
+ [true, true, true, true, true, true, true, true, true, true],
173
+ [true, true, true, true, true, true, true, true, true, true],
174
+ [true, true, true, true, true, true, true, true, true, true],
175
+ [true, true, true, false, false, false, false, true, true, true],
176
+ [true, true, true, false, false, false, false, true, true, true],
177
+ [true, true, true, true, true, true, true, false, false, false],
178
+ [true, true, true, true, true, true, true, false, false, false],
179
+ [true, true, true, true, true, true, true, false, false, false],
180
+ [true, true, true, false, false, false, false, true, true, true],
181
+ [true, true, true, false, false, false, false, true, true, true]
182
+ ],
183
+ [
184
+ [true, true, true, true, true, true, true, true, true, true],
185
+ [true, true, true, true, true, true, true, true, true, true],
186
+ [true, true, true, true, true, true, true, true, true, true],
187
+ [true, true, true, false, false, false, false, false, false, false],
188
+ [true, true, true, false, false, false, false, false, false, false],
189
+ [true, true, true, false, false, false, false, false, false, false],
190
+ [true, true, true, false, false, false, false, false, false, false],
191
+ [true, true, true, true, true, true, true, true, true, true],
192
+ [true, true, true, true, true, true, true, true, true, true],
193
+ [true, true, true, true, true, true, true, true, true, true]
194
+ ]
195
+ ]
196
+ };
197
+ },
198
+ watch: {
199
+ type: {
200
+ handler(val) {
201
+ const types = ['2d'];
202
+ if (types.includes(val)) {
203
+ this.canvasType = val;
204
+ } else {
205
+ this.canvasType = undefined;
206
+ }
207
+ },
208
+ immediate: true
209
+ },
210
+ value: {
211
+ handler() {
212
+ if (this.auto) {
213
+ this.remake();
214
+ }
215
+ }
216
+ },
217
+ size: {
218
+ handler() {
219
+ if (this.auto) {
220
+ this.remake();
221
+ }
222
+ }
223
+ },
224
+ options: {
225
+ handler() {
226
+ if (this.auto) {
227
+ this.remake();
228
+ }
229
+ },
230
+ deep: true
231
+ },
232
+ makeing: {
233
+ handler(val) {
234
+ if (!val) {
235
+ if (typeof this.toTempFilePathDelegate === 'function') {
236
+ this.toTempFilePathDelegate();
237
+ }
238
+ }
239
+ }
240
+ }
241
+ },
242
+ created() {
243
+ this.canvasId = this.$uv.guid();
244
+ },
245
+ mounted() {
246
+ this.templateOptions.size = this.$uv.getPx(this.size);
247
+ this.templateOptions.width = this.templateOptions.size;
248
+ this.templateOptions.height = this.templateOptions.size;
249
+ this.templateOptions.canvasWidth = this.templateOptions.size;
250
+ this.templateOptions.canvasHeight = this.templateOptions.size;
251
+ if (this.canvasType == '2d') {
252
+ // #ifndef MP-WEIXIN
253
+ this.templateOptions.canvasTransform = `scale(${this.templateOptions.size / this.templateOptions.canvasWidth}, ${this.templateOptions.size /
254
+ this.templateOptions.canvasHeight})`;
255
+ // #endif
256
+ } else {
257
+ this.templateOptions.canvasTransform = `scale(${this.templateOptions.size / this.templateOptions.canvasWidth}, ${this.templateOptions.size /
258
+ this.templateOptions.canvasHeight})`;
259
+ }
260
+ if (this.start) {
261
+ this.$nextTick(()=>{
262
+ this.make();
263
+ })
264
+ }
265
+ },
266
+ methods: {
267
+ /**
268
+ * 获取模板选项
269
+ */
270
+ getTemplateOptions() {
271
+ var size = this.$uv.getPx(this.size);
272
+ return deepReplace(this.templateOptions, {
273
+ size,
274
+ width: size,
275
+ height: size
276
+ });
277
+ },
278
+ /**
279
+ * 获取插件选项
280
+ */
281
+ getUqrcodeOptions() {
282
+ return deepReplace(this.options, {
283
+ data: String(this.value),
284
+ size: Number(this.templateOptions.size)
285
+ });
286
+ },
287
+ /**
288
+ * 重置画布
289
+ */
290
+ resetCanvas(callback) {
291
+ this.templateOptions.canvasDisplay = false;
292
+ this.$nextTick(() => {
293
+ this.templateOptions.canvasDisplay = true;
294
+ this.$nextTick(() => {
295
+ callback && callback();
296
+ });
297
+ });
298
+ },
299
+ /**
300
+ * 绘制二维码
301
+ */
302
+ async draw(callback = {}, isDrawDelegate = false) {
303
+ if (typeof callback.success != 'function') {
304
+ callback.success = () => {};
305
+ }
306
+ if (typeof callback.fail != 'function') {
307
+ callback.fail = () => {};
308
+ }
309
+ if (typeof callback.complete != 'function') {
310
+ callback.complete = () => {};
311
+ }
312
+
313
+ if (this.drawing) {
314
+ if (!isDrawDelegate) {
315
+ this.drawDelegate = () => {
316
+ this.draw(callback, true);
317
+ };
318
+ return;
319
+ }
320
+ } else {
321
+ this.drawing = true;
322
+ }
323
+
324
+ if (!this.canvasId) {
325
+ console.error('[uQRCode]: canvasId must be set!');
326
+ this.isError = true;
327
+ this.drawing = false;
328
+ callback.fail({
329
+ errMsg: '[uQRCode]: canvasId must be set!'
330
+ });
331
+ callback.complete({
332
+ errMsg: '[uQRCode]: canvasId must be set!'
333
+ });
334
+ return;
335
+ }
336
+ if (!this.value) {
337
+ console.error('[uQRCode]: value must be set!');
338
+ this.isError = true;
339
+ this.drawing = false;
340
+ callback.fail({
341
+ errMsg: '[uQRCode]: value must be set!'
342
+ });
343
+ callback.complete({
344
+ errMsg: '[uQRCode]: value must be set!'
345
+ });
346
+ return;
347
+ }
348
+
349
+ /* 组件数据 */
350
+ this.templateOptions = this.getTemplateOptions();
351
+ /* uQRCode选项 */
352
+ this.uqrcodeOptions = this.getUqrcodeOptions();
353
+ /* 纠错等级兼容字母写法 */
354
+ if (typeof this.uqrcodeOptions.errorCorrectLevel === 'string') {
355
+ this.uqrcodeOptions.errorCorrectLevel = UQRCode.errorCorrectLevel[this.uqrcodeOptions.errorCorrectLevel];
356
+ }
357
+ /* nvue不支持动态修改gcanvas尺寸,除nvue外,默认使用useDynamicSize */
358
+ // #ifndef APP-NVUE
359
+ if (typeof this.options.useDynamicSize === 'undefined') {
360
+ this.uqrcodeOptions.useDynamicSize = true;
361
+ }
362
+ // #endif
363
+ // #ifdef APP-NVUE
364
+ if (typeof this.options.useDynamicSize === 'undefined') {
365
+ this.uqrcodeOptions.useDynamicSize = false;
366
+ }
367
+ // if (typeof this.options.drawReserve === 'undefined') {
368
+ // this.uqrcodeOptions.drawReserve = true;
369
+ // }
370
+ // #endif
371
+
372
+ /* 获取uQRCode实例 */
373
+ const qr = instance = new UQRCode();
374
+ /* 注册扩展 */
375
+ this.plugins.forEach(p => qr.register(p.plugin));
376
+ /* 设置uQRCode选项 */
377
+ qr.setOptions(this.uqrcodeOptions);
378
+ /* 调用制作二维码方法 */
379
+ qr.make();
380
+
381
+ /* 获取canvas上下文 */
382
+ let canvasContext = null;
383
+ // #ifndef APP-NVUE
384
+ if (this.canvasType === '2d') {
385
+ // #ifdef MP-WEIXIN
386
+ /* 微信小程序获取canvas2d上下文方式 */
387
+ const canvas = (this.canvas = await new Promise(resolve => {
388
+ uni
389
+ .createSelectorQuery()
390
+ .in(this) // 在组件内使用需要
391
+ .select(`#${this.canvasId}`)
392
+ .fields({
393
+ node: true,
394
+ size: true
395
+ })
396
+ .exec(res => {
397
+ resolve(res[0].node);
398
+ });
399
+ }));
400
+ canvasContext = this.canvasContext = canvas.getContext('2d');
401
+ /* 2d的组件设置宽高与实际canvas绘制宽高不是一个,打个比方,组件size=200,canvas.width设置为100,那么绘制出来就是100=200,组件size=400,canvas.width设置为800,绘制大小还是800=400,所以无需理会下方返回的dynamicSize是多少,按dpr重新赋值给canvas即可 */
402
+ this.templateOptions.canvasWidth = qr.size;
403
+ this.templateOptions.canvasHeight = qr.size;
404
+ this.templateOptions.canvasTransform = '';
405
+ /* 使用dynamicSize+scale,可以解决小块间出现白线问题,dpr可以解决模糊问题 */
406
+ const dpr = uni.getSystemInfoSync().pixelRatio;
407
+ canvas.width = qr.dynamicSize * dpr;
408
+ canvas.height = qr.dynamicSize * dpr;
409
+ canvasContext.scale(dpr, dpr);
410
+ /* 微信小程序获取图像方式 */
411
+ qr.loadImage = this.getLoadImage(function(src) {
412
+ /* 小程序下获取网络图片信息需先配置download域名白名单才能生效 */
413
+ return new Promise((resolve, reject) => {
414
+ const img = canvas.createImage();
415
+ img.src = src;
416
+ img.onload = () => {
417
+ resolve(img);
418
+ };
419
+ img.onerror = err => {
420
+ reject(err);
421
+ };
422
+ });
423
+ });
424
+ // #endif
425
+ // #ifndef MP-WEIXIN
426
+ /* 非微信小程序不支持2d,切换回uniapp获取canvas上下文方式 */
427
+ canvasContext = this.canvasContext = uni.createCanvasContext(this.canvasId, this);
428
+ /* 使用dynamicSize,可以解决小块间出现白线问题,再通过scale缩放至size,使其达到所设尺寸 */
429
+ this.templateOptions.canvasWidth = qr.dynamicSize;
430
+ this.templateOptions.canvasHeight = qr.dynamicSize;
431
+ this.templateOptions.canvasTransform = `scale(${this.templateOptions.size / this.templateOptions.canvasWidth}, ${this.templateOptions.size /
432
+ this.templateOptions.canvasHeight})`;
433
+ /* uniapp获取图像方式 */
434
+ qr.loadImage = this.getLoadImage(function(src) {
435
+ return new Promise((resolve, reject) => {
436
+ if (src.startsWith('http')) {
437
+ uni.getImageInfo({
438
+ src,
439
+ success: res => {
440
+ resolve(res.path);
441
+ },
442
+ fail: err => {
443
+ reject(err);
444
+ }
445
+ });
446
+ } else {
447
+ if (src.startsWith('.')) {
448
+ console.error('[uQRCode]: 本地图片路径仅支持绝对路径!');
449
+ throw new Error('[uQRCode]: local image path only supports absolute path!');
450
+ } else {
451
+ resolve(src);
452
+ }
453
+ }
454
+ });
455
+ });
456
+ // #endif
457
+ } else {
458
+ /* uniapp获取canvas上下文方式 */
459
+ canvasContext = this.canvasContext = uni.createCanvasContext(this.canvasId, this);
460
+ /* 使用dynamicSize,可以解决小块间出现白线问题,再通过scale缩放至size,使其达到所设尺寸 */
461
+ this.templateOptions.canvasWidth = qr.dynamicSize;
462
+ this.templateOptions.canvasHeight = qr.dynamicSize;
463
+ this.templateOptions.canvasTransform = `scale(${this.templateOptions.size / this.templateOptions.canvasWidth}, ${this.templateOptions.size /
464
+ this.templateOptions.canvasHeight})`;
465
+ /* uniapp获取图像方式 */
466
+ qr.loadImage = this.getLoadImage(function(src) {
467
+ return new Promise((resolve, reject) => {
468
+ /* getImageInfo在微信小程序的bug:本地路径返回路径会把开头的/或../移除,导致路径错误,解决方法:限制只能使用绝对路径 */
469
+ if (src.startsWith('http')) {
470
+ uni.getImageInfo({
471
+ src,
472
+ success: res => {
473
+ resolve(res.path);
474
+ },
475
+ fail: err => {
476
+ reject(err);
477
+ }
478
+ });
479
+ } else {
480
+ if (src.startsWith('.')) {
481
+ console.error('[uQRCode]: 本地图片路径仅支持绝对路径!');
482
+ throw new Error('[uQRCode]: local image path only supports absolute path!');
483
+ } else {
484
+ resolve(src);
485
+ }
486
+ }
487
+ });
488
+ });
489
+ }
490
+ // #endif
491
+ // #ifdef APP-NVUE
492
+ /* NVue获取canvas上下文方式 */
493
+ const gcanvas = this.$refs['gcanvas'];
494
+ const canvas = enable(gcanvas, {
495
+ bridge: WeexBridge
496
+ });
497
+ canvasContext = this.canvasContext = canvas.getContext('2d');
498
+ /* NVue获取图像方式 */
499
+ qr.loadImage = this.getLoadImage(function(src) {
500
+ return new Promise((resolve, reject) => {
501
+ /* getImageInfo在nvue的bug:获取同一个路径的图片信息,同一时间第一次获取成功,后续失败,猜测是写入本地时产生文件写入冲突,所以没有返回,特别是对于网络资源 --- 已实现队列绘制,已解决此问题 */
502
+ if (src.startsWith('.')) {
503
+ console.error('[uQRCode]: 本地图片路径仅支持绝对路径!');
504
+ throw new Error('[uQRCode]: local image path only supports absolute path!');
505
+ } else {
506
+ uni.getImageInfo({
507
+ src,
508
+ success: res => {
509
+ resolve(res.path);
510
+ },
511
+ fail: err => {
512
+ reject(err);
513
+ }
514
+ });
515
+ }
516
+ });
517
+ });
518
+ // #endif
519
+
520
+ /* 设置uQRCode实例的canvas上下文 */
521
+ qr.canvasContext = canvasContext;
522
+ /* 延时等待页面重新绘制完毕 */
523
+ setTimeout(() => {
524
+ /* 从插件获取具体要调用哪一个扩展函数 */
525
+ var plugin = this.plugins.find(p => p.name == qr.style);
526
+ var drawCanvasName = plugin ? plugin.drawCanvas : 'drawCanvas';
527
+ /* 虽然qr[drawCanvasName]是直接返回Promise的,但由于js内部this指向问题,故不能直接exec(qr[drawCanvasName])此方式执行,需要改成exec(() => qr[drawCanvasName]())才能正确获取this */
528
+ var drawCanvas;
529
+ if (this.queue) {
530
+ drawCanvas = () => queueDraw.exec(() => qr[drawCanvasName]());
531
+ // drawCanvas = () => queueDraw.exec(() => new Promise((resolve, reject) => {
532
+ // setTimeout(() => {
533
+ // qr[drawCanvasName]().then(resolve).catch(reject);
534
+ // }, 1000);
535
+ // }));
536
+ } else {
537
+ drawCanvas = () => qr[drawCanvasName]();
538
+ }
539
+ /* 调用绘制方法将二维码图案绘制到canvas上 */
540
+ drawCanvas()
541
+ .then(() => {
542
+ if (this.drawDelegate) {
543
+ /* 高频重绘纠正 */
544
+ let delegate = this.drawDelegate;
545
+ this.drawDelegate = undefined;
546
+ delegate();
547
+ } else {
548
+ this.drawing = false;
549
+ callback.success();
550
+ }
551
+ })
552
+ .catch(err => {
553
+ console.log(err);
554
+ if (this.drawDelegate) {
555
+ /* 高频重绘纠正 */
556
+ let delegate = this.drawDelegate;
557
+ this.drawDelegate = undefined;
558
+ delegate();
559
+ } else {
560
+ this.drawing = false;
561
+ this.isError = true;
562
+ callback.fail(err);
563
+ }
564
+ })
565
+ .finally(() => {
566
+ callback.complete();
567
+ });
568
+ }, 300);
569
+ },
570
+ /**
571
+ * 生成二维码
572
+ */
573
+ make(callback = {}) {
574
+ this.makeExecuted = true;
575
+ this.makeing = true;
576
+ this.isError = false;
577
+
578
+ if (typeof callback.success != 'function') {
579
+ callback.success = () => {};
580
+ }
581
+ if (typeof callback.fail != 'function') {
582
+ callback.fail = () => {};
583
+ }
584
+ if (typeof callback.complete != 'function') {
585
+ callback.complete = () => {};
586
+ }
587
+
588
+ this.resetCanvas(() => {
589
+ clearTimeout(this.makeDelegate);
590
+ this.makeDelegate = setTimeout(() => {
591
+ this.draw({
592
+ success: () => {
593
+ setTimeout(() => {
594
+ callback.success();
595
+ this.complete(true);
596
+ }, 300);
597
+ },
598
+ fail: err => {
599
+ callback.fail(err);
600
+ this.error = err;
601
+ this.complete(false, err.errMsg);
602
+ },
603
+ complete: () => {
604
+ callback.complete();
605
+ this.makeing = false;
606
+ }
607
+ });
608
+ }, 300);
609
+ });
610
+ },
611
+ /**
612
+ * 重新生成
613
+ */
614
+ remake(callback) {
615
+ this.$emit('change');
616
+ this.make(callback);
617
+ },
618
+ /**
619
+ * 生成完成
620
+ */
621
+ complete(success = true, errMsg = '') {
622
+ if (success) {
623
+ this.$emit('complete', {
624
+ success
625
+ });
626
+ } else {
627
+ this.$emit('complete', {
628
+ success,
629
+ errMsg
630
+ });
631
+ }
632
+ },
633
+ /**
634
+ * 导出临时路径
635
+ */
636
+ toTempFilePath(callback = {}) {
637
+ if (typeof callback.success != 'function') {
638
+ callback.success = () => {};
639
+ }
640
+ if (typeof callback.fail != 'function') {
641
+ callback.fail = () => {};
642
+ }
643
+ if (typeof callback.complete != 'function') {
644
+ callback.complete = () => {};
645
+ }
646
+
647
+ if (!this.makeExecuted) {
648
+ console.error('[uQRCode]: make() 方法从未调用!请先成功调用 make() 后再进行操作。');
649
+ var err = {
650
+ errMsg: '[uQRCode]: make() method has never been executed! please execute make() successfully before operating.'
651
+ };
652
+ callback.fail(err);
653
+ callback.complete(err);
654
+ return;
655
+ }
656
+
657
+ if (this.isError) {
658
+ callback.fail(this.error);
659
+ callback.complete(this.error);
660
+ return;
661
+ }
662
+
663
+ if (this.makeing) {
664
+ /* 如果还在生成状态,那当前操作将托管到委托,监听生成完成后再通过委托复调当前方法 */
665
+ this.toTempFilePathDelegate = () => {
666
+ this.toTempFilePath(callback);
667
+ };
668
+ return;
669
+ } else {
670
+ this.toTempFilePathDelegate = null;
671
+ }
672
+
673
+ // #ifndef APP-NVUE
674
+ if (this.canvasType === '2d') {
675
+ // #ifdef MP-WEIXIN
676
+ try {
677
+ let dataURL = null;
678
+ // #ifdef VUE3
679
+ dataURL = toRaw(this.canvas)
680
+ .toDataURL();
681
+ // #endif
682
+ // #ifndef VUE3
683
+ dataURL = this.canvas.toDataURL();
684
+ // #endif
685
+ callback.success({
686
+ tempFilePath: dataURL
687
+ });
688
+ callback.complete({
689
+ tempFilePath: dataURL
690
+ });
691
+ } catch (e) {
692
+ callback.fail(e);
693
+ callback.complete(e);
694
+ }
695
+ // #endif
696
+ } else {
697
+ uni.canvasToTempFilePath({
698
+ canvasId: this.canvasId,
699
+ fileType: this.fileType,
700
+ width: Number(this.templateOptions.canvasWidth),
701
+ height: Number(this.templateOptions.canvasHeight),
702
+ destWidth: Number(this.templateOptions.size),
703
+ destHeight: Number(this.templateOptions.size),
704
+ success: res => {
705
+ callback.success(res);
706
+ },
707
+ fail: err => {
708
+ callback.fail(err);
709
+ },
710
+ complete: () => {
711
+ callback.complete();
712
+ }
713
+ },
714
+ this
715
+ );
716
+ }
717
+ // #endif
718
+ // #ifdef APP-NVUE
719
+ const dpr = uni.getSystemInfoSync().pixelRatio;
720
+ this.canvasContext.toTempFilePath(
721
+ 0,
722
+ 0,
723
+ this.templateOptions.canvasWidth * dpr,
724
+ this.templateOptions.canvasHeight * dpr,
725
+ this.templateOptions.size * dpr,
726
+ this.templateOptions.size * dpr,
727
+ '',
728
+ 1,
729
+ res => {
730
+ callback.success(res);
731
+ callback.complete(res);
732
+ }
733
+ );
734
+ // #endif
735
+ },
736
+ /**
737
+ * 保存
738
+ */
739
+ save(callback = {}) {
740
+ if (typeof callback.success != 'function') {
741
+ callback.success = () => {};
742
+ }
743
+ if (typeof callback.fail != 'function') {
744
+ callback.fail = () => {};
745
+ }
746
+ if (typeof callback.complete != 'function') {
747
+ callback.complete = () => {};
748
+ }
749
+
750
+ this.toTempFilePath({
751
+ success: res => {
752
+ // #ifndef H5
753
+ if (this.canvasType === '2d') {
754
+ // #ifdef MP-WEIXIN
755
+ /* 需要将 data:image/png;base64, 这段去除 writeFile 才能正常打开文件,否则是损坏文件,无法打开 */
756
+ const reg = new RegExp('^data:image/png;base64,', 'g');
757
+ const dataURL = res.tempFilePath.replace(reg, '');
758
+ const fs = wx.getFileSystemManager();
759
+ const tempFilePath = `${wx.env.USER_DATA_PATH}/${new Date().getTime()}${
760
+ Math.random()
761
+ .toString()
762
+ .split('.')[1]
763
+ }.png`;
764
+ fs.writeFile({
765
+ filePath: tempFilePath, // 要写入的文件路径 (本地路径)
766
+ data: dataURL, // base64图片
767
+ encoding: 'base64',
768
+ success: res1 => {
769
+ uni.saveImageToPhotosAlbum({
770
+ filePath: tempFilePath,
771
+ success: res2 => {
772
+ callback.success(res2);
773
+ },
774
+ fail: err2 => {
775
+ callback.fail(err2);
776
+ },
777
+ complete: () => {
778
+ callback.complete();
779
+ }
780
+ });
781
+ },
782
+ fail: err => {
783
+ callback.fail(err);
784
+ },
785
+ complete: () => {
786
+ callback.complete();
787
+ }
788
+ });
789
+ // #endif
790
+ } else {
791
+ uni.saveImageToPhotosAlbum({
792
+ filePath: res.tempFilePath,
793
+ success: res1 => {
794
+ callback.success(res1);
795
+ },
796
+ fail: err1 => {
797
+ callback.fail(err1);
798
+ },
799
+ complete: () => {
800
+ callback.complete();
801
+ }
802
+ });
803
+ }
804
+ // #endif
805
+
806
+ // #ifdef H5
807
+ /* 可以在电脑浏览器下载,移动端iOS不行,安卓微信浏览器不行,安卓外部浏览器可以 */
808
+ this.isH5Save = this.h5SaveTip;
809
+ this.tempFilePath = res.tempFilePath;
810
+ if (this.h5SaveIsDownload) {
811
+ const aEle = document.createElement('a');
812
+ aEle.download = this.h5DownloadName; // 设置下载的文件名,默认是'下载'
813
+ aEle.href = res.tempFilePath;
814
+ document.body.appendChild(aEle);
815
+ aEle.click();
816
+ aEle.remove(); // 下载之后把创建的元素删除
817
+ }
818
+ callback.success({
819
+ errMsg: 'ok'
820
+ });
821
+ callback.complete({
822
+ errMsg: 'ok'
823
+ });
824
+ // #endif
825
+ },
826
+ fail: err => {
827
+ callback.fail(err);
828
+ callback.complete(err);
829
+ }
830
+ });
831
+ },
832
+ /**
833
+ * 注册click事件
834
+ */
835
+ onClick(e) {
836
+ this.$emit('click', e);
837
+ },
838
+ /**
839
+ * 获取实例
840
+ */
841
+ getInstance() {
842
+ return instance;
843
+ },
844
+ /**
845
+ * 注册扩展,组件仅支持注册type为style的drawCanvas扩展
846
+ * @param {Object} plugin
847
+ */
848
+ registerStyle(plugin) {
849
+ if (plugin.Type != 'style') {
850
+ console.warn('[uQRCode]: registerStyle 仅支持注册 style 类型的扩展!');
851
+ return {
852
+ errMsg: 'registerStyle 仅支持注册 style 类型的扩展!'
853
+ };
854
+ }
855
+ if (typeof plugin === 'function') {
856
+ this.plugins.push({
857
+ plugin,
858
+ name: plugin.Name,
859
+ drawCanvas: plugin.DrawCanvas
860
+ });
861
+ }
862
+ },
863
+ getLoadImage(loadImage) {
864
+ var that = this;
865
+ if (typeof loadImage == 'function') {
866
+ return function(src) {
867
+ /* 判断是否是队列加载图片的 */
868
+ if (that.isQueueLoadImage) {
869
+ /* 解决iOS APP||NVUE同时绘制多个二维码导致图片丢失需使用队列 */
870
+ return queueLoadImage.exec(() => {
871
+ return new Promise((resolve, reject) => {
872
+ setTimeout(() => {
873
+ const cache = cacheImageList.find(x => x.src == src);
874
+ if (cache) {
875
+ resolve(cache.img);
876
+ } else {
877
+ loadImage(src)
878
+ .then(img => {
879
+ cacheImageList.push({
880
+ src,
881
+ img
882
+ });
883
+ resolve(img);
884
+ })
885
+ .catch(err => {
886
+ reject(err);
887
+ });
888
+ }
889
+ }, 10);
890
+ });
891
+ });
892
+ } else {
893
+ return loadImage(src);
894
+ }
895
+ };
896
+ } else {
897
+ return function(src) {
898
+ return Promise.resolve(src);
899
+ };
900
+ }
901
+ }
902
+ }
903
+ };
904
+
905
+ /**
906
+ * 对象属性深度替换
907
+ * @param {Object} o 原始对象/默认对象/被替换的对象
908
+ * @param {Object} r 从这个对象里取值替换到o对象里
909
+ * @return {Object} 替换后的新对象
910
+ */
911
+ function deepReplace(o = {}, r = {}, c = false) {
912
+ let obj;
913
+ if (c) {
914
+ // 从源替换
915
+ obj = o;
916
+ } else {
917
+ // 不替换源,copy一份备份来替换
918
+ obj = {
919
+ ...o
920
+ };
921
+ }
922
+ for (let k in r) {
923
+ var vr = r[k];
924
+ if (vr != undefined) {
925
+ if (vr.constructor == Object) {
926
+ obj[k] = this.deepReplace(obj[k], vr);
927
+ } else if (vr.constructor == String && !vr) {
928
+ obj[k] = obj[k];
929
+ } else {
930
+ obj[k] = vr;
931
+ }
932
+ }
933
+ }
934
+ return obj;
935
+ }
936
+ </script>
937
+
938
+ <style scoped>
939
+ .uqrcode {
940
+ position: relative;
941
+ }
942
+ .uqrcode-hide {
943
+ position: fixed;
944
+ left: 7500rpx;
945
+ }
946
+ .uqrcode-canvas {
947
+ transform-origin: top left;
948
+ }
949
+ .uqrcode-makeing {
950
+ position: absolute;
951
+ top: 0;
952
+ right: 0;
953
+ bottom: 0;
954
+ left: 0;
955
+ z-index: 10;
956
+ /* #ifndef APP-NVUE */
957
+ display: flex;
958
+ /* #endif */
959
+ justify-content: center;
960
+ align-items: center;
961
+ }
962
+ .uqrcode-makeing-image {
963
+ /* #ifndef APP-NVUE */
964
+ display: block;
965
+ max-width: 120px;
966
+ max-height: 120px;
967
+ /* #endif */
968
+ }
969
+ .uqrcode-error {
970
+ position: absolute;
971
+ top: 0;
972
+ right: 0;
973
+ bottom: 0;
974
+ left: 0;
975
+ /* #ifndef APP-NVUE */
976
+ display: flex;
977
+ /* #endif */
978
+ justify-content: center;
979
+ align-items: center;
980
+ }
981
+ .uqrcode-error-message {
982
+ font-size: 12px;
983
+ color: #939291;
984
+ }
985
+ /* #ifdef H5 */
986
+ .uqrcode-h5-save {
987
+ position: fixed;
988
+ top: 0;
989
+ right: 0;
990
+ bottom: 0;
991
+ left: 0;
992
+ z-index: 100;
993
+ background-color: rgba(0, 0, 0, 0.68);
994
+ display: flex;
995
+ flex-direction: column;
996
+ justify-content: center;
997
+ align-items: center;
998
+ }
999
+ .uqrcode-h5-save-image {
1000
+ width: 512rpx;
1001
+ height: 512rpx;
1002
+ padding: 32rpx;
1003
+ }
1004
+ .uqrcode-h5-save-text {
1005
+ margin-top: 20rpx;
1006
+ font-size: 32rpx;
1007
+ font-weight: 700;
1008
+ color: #ffffff;
1009
+ }
1010
+ .uqrcode-h5-save-close {
1011
+ position: relative;
1012
+ margin-top: 72rpx;
1013
+ width: 60rpx;
1014
+ height: 60rpx;
1015
+ border: 2rpx solid #ffffff;
1016
+ border-radius: 60rpx;
1017
+ padding: 10rpx;
1018
+ }
1019
+ .uqrcode-h5-save-close-before {
1020
+ position: absolute;
1021
+ top: 50%;
1022
+ left: 50%;
1023
+ transform: translate(-50%, -50%) rotate(45deg);
1024
+ width: 40rpx;
1025
+ height: 4rpx;
1026
+ background: #ffffff;
1027
+ }
1028
+ .uqrcode-h5-save-close-after {
1029
+ position: absolute;
1030
+ top: 50%;
1031
+ left: 50%;
1032
+ transform: translate(-50%, -50%) rotate(-45deg);
1033
+ width: 40rpx;
1034
+ height: 4rpx;
1035
+ background: #ffffff;
1036
+ }
1037
+ /* #endif */
1038
+ </style>