@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,537 @@
1
+ <template>
2
+ <view
3
+ v-if="showPopup"
4
+ class="uv-popup"
5
+ :class="[popupClass, isDesktop ? 'fixforpc-z-index' : '']"
6
+ :style="[{zIndex: zIndex}]"
7
+ @touchmove.prevent.stop
8
+ >
9
+ <view @touchstart="touchstart">
10
+ <!-- 遮罩层 -->
11
+ <uv-overlay
12
+ key="1"
13
+ v-if="maskShow && overlay"
14
+ :show="showTrans"
15
+ :duration="duration"
16
+ :custom-style="overlayStyle"
17
+ :opacity="overlayOpacity"
18
+ :zIndex="zIndex"
19
+ @click="onTap"
20
+ ></uv-overlay>
21
+ <uv-transition
22
+ key="2"
23
+ :mode="ani"
24
+ name="content"
25
+ :custom-style="transitionStyle"
26
+ :duration="duration"
27
+ :show="showTrans"
28
+ @click="onTap"
29
+ >
30
+ <view
31
+ class="uv-popup__content"
32
+ :style="[contentStyle]"
33
+ :class="[popupClass]"
34
+ @click="clear"
35
+ >
36
+ <uv-status-bar v-if="safeAreaInsetTop"></uv-status-bar>
37
+ <slot />
38
+ <uv-safe-bottom v-if="safeAreaInsetBottom"></uv-safe-bottom>
39
+ <view
40
+ v-if="closeable"
41
+ @tap.stop="close"
42
+ class="uv-popup__content__close"
43
+ :class="['uv-popup__content__close--' + closeIconPos]"
44
+ hover-class="uv-popup__content__close--hover"
45
+ hover-stay-time="150"
46
+ >
47
+ <uv-icon
48
+ name="close"
49
+ color="#909399"
50
+ size="18"
51
+ bold
52
+ ></uv-icon>
53
+ </view>
54
+ </view>
55
+ </uv-transition>
56
+ </view>
57
+ <!-- #ifdef H5 -->
58
+ <keypress v-if="maskShow" @esc="onTap" />
59
+ <!-- #endif -->
60
+ </view>
61
+ </template>
62
+
63
+ <script>
64
+ // #ifdef H5
65
+ import keypress from './keypress.js'
66
+ // #endif
67
+ import mpMixin from '../../libs/mixin/mpMixin.js'
68
+ import mixin from '../../libs/mixin/mixin.js'
69
+ /**
70
+ * PopUp 弹出层
71
+ * @description 弹出层组件,为了解决遮罩弹层的问题
72
+ * @tutorial https://www.uvui.cn/components/popup.html
73
+ * @property {String} mode = [top|center|bottom|left|right] 弹出方式
74
+ * @value top 顶部弹出
75
+ * @value center 中间弹出
76
+ * @value bottom 底部弹出
77
+ * @value left 左侧弹出
78
+ * @value right 右侧弹出
79
+ * @property {Number} duration 动画时长,默认300
80
+ * @property {Boolean} overlay 是否显示遮罩,默认true
81
+ * @property {Boolean} overlayOpacity 遮罩透明度,默认0.5
82
+ * @property {Object} overlayStyle 遮罩自定义样式
83
+ * @property {Boolean} closeOnClickOverlay = [true|false] 蒙版点击是否关闭弹窗,默认true
84
+ * @property {Number | String} zIndex 弹出层的层级
85
+ * @property {Boolean} safeAreaInsetTop 是否留出顶部安全区(状态栏高度),默认false
86
+ * @property {Boolean} safeAreaInsetBottom 是否为留出底部安全区适配,默认true
87
+ * @property {Boolean} closeable 是否显示关闭图标,默认false
88
+ * @property {Boolean} closeIconPos 自定义关闭图标位置,`top-left`-左上角,`top-right`-右上角,`bottom-left`-左下角,`bottom-right`-右下角,默认top-right
89
+ * @property {String} bgColor 主窗口背景色
90
+ * @property {String} maskBackgroundColor 蒙版颜色
91
+ * @property {Boolean} customStyle 自定义样式
92
+ * @event {Function} change 打开关闭弹窗触发,e={show: false}
93
+ * @event {Function} maskClick 点击遮罩触发
94
+ */
95
+ export default {
96
+ name: 'uv-popup',
97
+ components: {
98
+ // #ifdef H5
99
+ keypress
100
+ // #endif
101
+ },
102
+ mixins: [mpMixin, mixin],
103
+ emits: ['change', 'maskClick', 'close'],
104
+ props: {
105
+ // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
106
+ // message: 消息提示 ; dialog : 对话框
107
+ mode: {
108
+ type: String,
109
+ default: 'center'
110
+ },
111
+ // 动画时长,单位ms
112
+ duration: {
113
+ type: [String, Number],
114
+ default: 300
115
+ },
116
+ // 层级
117
+ zIndex: {
118
+ type: [String, Number],
119
+ default: 10075
120
+ },
121
+ bgColor: {
122
+ type: String,
123
+ default: '#ffffff'
124
+ },
125
+ safeArea: {
126
+ type: Boolean,
127
+ default: true
128
+ },
129
+ // 是否显示遮罩
130
+ overlay: {
131
+ type: Boolean,
132
+ default: true
133
+ },
134
+ // 点击遮罩是否关闭弹窗
135
+ closeOnClickOverlay: {
136
+ type: Boolean,
137
+ default: true
138
+ },
139
+ // 遮罩的透明度,0-1之间
140
+ overlayOpacity: {
141
+ type: [Number, String],
142
+ default: 0.4
143
+ },
144
+ // 自定义遮罩的样式
145
+ overlayStyle: {
146
+ type: [Object, String],
147
+ default: ''
148
+ },
149
+ // 是否为iPhoneX留出底部安全距离
150
+ safeAreaInsetBottom: {
151
+ type: Boolean,
152
+ default: true
153
+ },
154
+ // 是否留出顶部安全距离(状态栏高度)
155
+ safeAreaInsetTop: {
156
+ type: Boolean,
157
+ default: false
158
+ },
159
+ // 是否显示关闭图标
160
+ closeable: {
161
+ type: Boolean,
162
+ default: false
163
+ },
164
+ // 自定义关闭图标位置,top-left为左上角,top-right为右上角,bottom-left为左下角,bottom-right为右下角
165
+ closeIconPos: {
166
+ type: String,
167
+ default: 'top-right'
168
+ },
169
+ // mode=center,也即中部弹出时,是否使用缩放模式
170
+ zoom: {
171
+ type: Boolean,
172
+ default: true
173
+ },
174
+ round: {
175
+ type: [Number, String],
176
+ default: 0
177
+ },
178
+ ...uni.$uv?.props?.popup
179
+ },
180
+ watch: {
181
+ /**
182
+ * 监听type类型
183
+ */
184
+ type: {
185
+ handler: function(type) {
186
+ if (!this.config[type]) return
187
+ this[this.config[type]](true)
188
+ },
189
+ immediate: true
190
+ },
191
+ isDesktop: {
192
+ handler: function(newVal) {
193
+ if (!this.config[newVal]) return
194
+ this[this.config[this.mode]](true)
195
+ },
196
+ immediate: true
197
+ },
198
+ // H5 下禁止底部滚动
199
+ showPopup(show) {
200
+ // #ifdef H5
201
+ // fix by mehaotian 处理 h5 滚动穿透的问题
202
+ document.getElementsByTagName('body')[0].style.overflow = show ? 'hidden' : 'visible'
203
+ // #endif
204
+ }
205
+ },
206
+ data() {
207
+ return {
208
+ ani: [],
209
+ showPopup: false,
210
+ showTrans: false,
211
+ popupWidth: 0,
212
+ popupHeight: 0,
213
+ config: {
214
+ top: 'top',
215
+ bottom: 'bottom',
216
+ center: 'center',
217
+ left: 'left',
218
+ right: 'right',
219
+ message: 'top',
220
+ dialog: 'center',
221
+ share: 'bottom'
222
+ },
223
+ transitionStyle: {
224
+ position: 'fixed',
225
+ left: 0,
226
+ right: 0
227
+ },
228
+ maskShow: true,
229
+ mkclick: true,
230
+ popupClass: this.isDesktop ? 'fixforpc-top' : 'top',
231
+ direction: ''
232
+ }
233
+ },
234
+ computed: {
235
+ isDesktop() {
236
+ return this.popupWidth >= 500 && this.popupHeight >= 500
237
+ },
238
+ bg() {
239
+ if (this.bgColor === '' || this.bgColor === 'none' || this.$uv.getPx(this.round)>0) {
240
+ return 'transparent'
241
+ }
242
+ return this.bgColor
243
+ },
244
+ contentStyle() {
245
+ const style = {};
246
+ if (this.bgColor) {
247
+ style.backgroundColor = this.bg
248
+ }
249
+ if(this.round) {
250
+ const value = this.$uv.addUnit(this.round)
251
+ const mode = this.direction?this.direction:this.mode
252
+ style.backgroundColor = this.bgColor
253
+ if(mode === 'top') {
254
+ style.borderBottomLeftRadius = value
255
+ style.borderBottomRightRadius = value
256
+ } else if(mode === 'bottom') {
257
+ style.borderTopLeftRadius = value
258
+ style.borderTopRightRadius = value
259
+ } else if(mode === 'center') {
260
+ style.borderRadius = value
261
+ }
262
+ }
263
+ return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle))
264
+ }
265
+ },
266
+ // #ifndef VUE3
267
+ // TODO vue2
268
+ destroyed() {
269
+ this.setH5Visible()
270
+ },
271
+ // #endif
272
+ // #ifdef VUE3
273
+ // TODO vue3
274
+ unmounted() {
275
+ this.setH5Visible()
276
+ },
277
+ // #endif
278
+ created() {
279
+ // TODO 处理 message 组件生命周期异常的问题
280
+ this.messageChild = null
281
+ // TODO 解决头条冒泡的问题
282
+ this.clearPropagation = false
283
+ },
284
+ methods: {
285
+ setH5Visible() {
286
+ this.close();
287
+ // #ifdef H5
288
+ // fix by mehaotian 处理 h5 滚动穿透的问题
289
+ document.getElementsByTagName('body')[0].style.overflow = 'visible'
290
+ // #endif
291
+ },
292
+ /**
293
+ * 公用方法,不显示遮罩层
294
+ */
295
+ closeMask() {
296
+ this.maskShow = false
297
+ },
298
+ // TODO nvue 取消冒泡
299
+ clear(e) {
300
+ // #ifndef APP-NVUE
301
+ e.stopPropagation()
302
+ // #endif
303
+ this.clearPropagation = true
304
+ },
305
+
306
+ open(direction) {
307
+ // fix by mehaotian 处理快速打开关闭的情况
308
+ if (this.showPopup) {
309
+ return
310
+ }
311
+ let innerType = ['top', 'center', 'bottom', 'left', 'right', 'message', 'dialog', 'share']
312
+ if (!(direction && innerType.indexOf(direction) !== -1)) {
313
+ direction = this.mode
314
+ }else {
315
+ this.direction = direction;
316
+ }
317
+ if (!this.config[direction]) {
318
+ return this.$uv.error(`缺少类型:${direction}`);
319
+ }
320
+ this[this.config[direction]]()
321
+ this.$emit('change', {
322
+ show: true,
323
+ type: direction
324
+ })
325
+ },
326
+ close(type) {
327
+ this.showTrans = false
328
+ this.$emit('close');
329
+ this.$emit('change', {
330
+ show: false,
331
+ type: this.mode
332
+ })
333
+ clearTimeout(this.timer)
334
+ // // 自定义关闭事件
335
+ this.timer = setTimeout(() => {
336
+ this.showPopup = false
337
+ }, 300)
338
+ },
339
+ // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
340
+ touchstart() {
341
+ this.clearPropagation = false
342
+ },
343
+ onTap() {
344
+ if (this.clearPropagation) {
345
+ // fix by mehaotian 兼容 nvue
346
+ this.clearPropagation = false
347
+ return
348
+ }
349
+ this.$emit('maskClick')
350
+ if (!this.closeOnClickOverlay) return
351
+ this.close()
352
+ },
353
+ /**
354
+ * 顶部弹出样式处理
355
+ */
356
+ top(type) {
357
+ this.popupClass = this.isDesktop ? 'fixforpc-top' : 'top'
358
+ this.ani = ['slide-top']
359
+ this.transitionStyle = {
360
+ position: 'fixed',
361
+ zIndex: this.zIndex,
362
+ left: 0,
363
+ right: 0,
364
+ backgroundColor: this.bg
365
+ }
366
+ // TODO 兼容 type 属性 ,后续会废弃
367
+ if (type) return
368
+ this.showPopup = true
369
+ this.showTrans = true
370
+ this.$nextTick(() => {
371
+ if (this.messageChild && this.mode === 'message') {
372
+ this.messageChild.timerClose()
373
+ }
374
+ })
375
+ },
376
+ /**
377
+ * 底部弹出样式处理
378
+ */
379
+ bottom(type) {
380
+ this.popupClass = 'bottom'
381
+ this.ani = ['slide-bottom']
382
+ this.transitionStyle = {
383
+ position: 'fixed',
384
+ zIndex: this.zIndex,
385
+ left: 0,
386
+ right: 0,
387
+ bottom: 0,
388
+ backgroundColor: this.bg
389
+ }
390
+ // TODO 兼容 type 属性 ,后续会废弃
391
+ if (type) return
392
+ this.showPopup = true
393
+ this.showTrans = true
394
+ },
395
+ /**
396
+ * 中间弹出样式处理
397
+ */
398
+ center(type) {
399
+ this.popupClass = 'center'
400
+ this.ani = this.zoom?['zoom-in', 'fade']:['fade'];
401
+ this.transitionStyle = {
402
+ position: 'fixed',
403
+ zIndex: this.zIndex,
404
+ /* #ifndef APP-NVUE */
405
+ display: 'flex',
406
+ flexDirection: 'column',
407
+ /* #endif */
408
+ bottom: 0,
409
+ left: 0,
410
+ right: 0,
411
+ top: 0,
412
+ justifyContent: 'center',
413
+ alignItems: 'center'
414
+ }
415
+ // TODO 兼容 type 属性 ,后续会废弃
416
+ if (type) return
417
+ this.showPopup = true
418
+ this.showTrans = true
419
+ },
420
+ left(type) {
421
+ this.popupClass = 'left'
422
+ this.ani = ['slide-left']
423
+ this.transitionStyle = {
424
+ position: 'fixed',
425
+ zIndex: this.zIndex,
426
+ left: 0,
427
+ bottom: 0,
428
+ top: 0,
429
+ backgroundColor: this.bg,
430
+ /* #ifndef APP-NVUE */
431
+ display: 'flex',
432
+ flexDirection: 'column'
433
+ /* #endif */
434
+ }
435
+ // TODO 兼容 type 属性 ,后续会废弃
436
+ if (type) return
437
+ this.showPopup = true
438
+ this.showTrans = true
439
+ },
440
+ right(type) {
441
+ this.popupClass = 'right'
442
+ this.ani = ['slide-right']
443
+ this.transitionStyle = {
444
+ position: 'fixed',
445
+ zIndex: this.zIndex,
446
+ bottom: 0,
447
+ right: 0,
448
+ top: 0,
449
+ backgroundColor: this.bg,
450
+ /* #ifndef APP-NVUE */
451
+ display: 'flex',
452
+ flexDirection: 'column'
453
+ /* #endif */
454
+ }
455
+ // TODO 兼容 type 属性 ,后续会废弃
456
+ if (type) return
457
+ this.showPopup = true
458
+ this.showTrans = true
459
+ }
460
+ }
461
+ }
462
+ </script>
463
+ <style lang="scss" scoped>
464
+ .uv-popup {
465
+ position: fixed;
466
+ /* #ifndef APP-NVUE */
467
+ z-index: 99;
468
+
469
+ /* #endif */
470
+ &.top,
471
+ &.left,
472
+ &.right {
473
+ /* #ifdef H5 */
474
+ top: var(--window-top);
475
+ /* #endif */
476
+ /* #ifndef H5 */
477
+ top: 0;
478
+ /* #endif */
479
+ }
480
+
481
+ .uv-popup__content {
482
+ /* #ifndef APP-NVUE */
483
+ display: block;
484
+ overflow: hidden;
485
+ /* #endif */
486
+ position: relative;
487
+
488
+ &.left,
489
+ &.right {
490
+ /* #ifdef H5 */
491
+ padding-top: var(--window-top);
492
+ /* #endif */
493
+ /* #ifndef H5 */
494
+ padding-top: 0;
495
+ /* #endif */
496
+ flex: 1;
497
+ }
498
+ &__close {
499
+ position: absolute;
500
+
501
+ &--hover {
502
+ opacity: 0.4;
503
+ }
504
+ }
505
+
506
+ &__close--top-left {
507
+ top: 15px;
508
+ left: 15px;
509
+ }
510
+
511
+ &__close--top-right {
512
+ top: 15px;
513
+ right: 15px;
514
+ }
515
+
516
+ &__close--bottom-left {
517
+ bottom: 15px;
518
+ left: 15px;
519
+ }
520
+
521
+ &__close--bottom-right {
522
+ right: 15px;
523
+ bottom: 15px;
524
+ }
525
+ }
526
+ }
527
+
528
+ .fixforpc-z-index {
529
+ /* #ifndef APP-NVUE */
530
+ z-index: 999;
531
+ /* #endif */
532
+ }
533
+
534
+ .fixforpc-top {
535
+ top: 0;
536
+ }
537
+ </style>
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <uv-popup ref="popup" @change="change">
3
+ <view class="video-view" v-if="show">
4
+ <video class="video" :src="getSec" :autoplay="autoplay"></video>
5
+ </view>
6
+ </uv-popup>
7
+ </template>
8
+ <script>
9
+ export default {
10
+ props: {
11
+ src: {
12
+ type: String,
13
+ default: ''
14
+ },
15
+ autoplay: {
16
+ type: Boolean,
17
+ default: true
18
+ }
19
+ },
20
+ data() {
21
+ return {
22
+ videoSrc: '',
23
+ show: false
24
+ }
25
+ },
26
+ computed: {
27
+ getSec() {
28
+ return this.src || this.videoSrc;
29
+ }
30
+ },
31
+ methods: {
32
+ open(url) {
33
+ this.videoSrc = url;
34
+ this.$refs.popup.open();
35
+ },
36
+ close() {
37
+ this.$refs.popup.close();
38
+ },
39
+ change(e) {
40
+ this.show = e.show;
41
+ }
42
+ }
43
+ }
44
+ </script>
45
+ <style scoped lang="scss">
46
+ .video-view {
47
+ width: 750rpx;
48
+ .video {
49
+ width: 750rpx;
50
+ }
51
+ }
52
+ </style>
@@ -0,0 +1 @@
1
+ export const cacheImageList = [];