uview-plus 3.3.37 → 3.3.38

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 (29) hide show
  1. package/changelog.md +5 -0
  2. package/components/u-album/album.js +2 -1
  3. package/components/u-album/props.js +5 -0
  4. package/components/u-album/u-album.vue +2 -0
  5. package/components/u-upload/u-upload.vue +45 -28
  6. package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
  7. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  8. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  9. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  10. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  11. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  12. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  13. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  14. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  15. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  16. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  17. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  18. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  19. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  20. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  21. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  22. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  23. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  24. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  25. package/libs/util/gcanvas/env/canvas.js +0 -0
  26. package/libs/util/gcanvas/env/image.js +0 -0
  27. package/libs/util/gcanvas/env/tool.js +0 -0
  28. package/libs/util/gcanvas/index.js +0 -0
  29. package/package.json +1 -1
package/changelog.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 3.3.38(2024-11-04)
2
+ fix: 修复视频预览报错 #510
3
+
4
+ add: album组件增加stop参数支持阻止事件冒泡
5
+
1
6
  ## 3.3.37(2024-10-21)
2
7
  fix: 修复因为修改组件名称前缀,导致h5打包后$parent方法内找不到父组件的问题
3
8
 
@@ -22,6 +22,7 @@ export default {
22
22
  rowCount: 3,
23
23
  showMore: true,
24
24
  autoWrap: false,
25
- unit: 'px'
25
+ unit: 'px',
26
+ stop: true,
26
27
  }
27
28
  }
@@ -76,6 +76,11 @@ export const props = defineMixin({
76
76
  unit: {
77
77
  type: [String],
78
78
  default: () => defProps.album.unit
79
+ },
80
+ // 阻止点击冒泡
81
+ stop: {
82
+ type: Boolean,
83
+ default: () => defProps.album.stop
79
84
  }
80
85
  }
81
86
  })
@@ -197,6 +197,8 @@ export default {
197
197
  current: url,
198
198
  urls
199
199
  })
200
+ // 是否阻止事件传播
201
+ this.stop && this.preventEvent(e)
200
202
  },
201
203
  // 获取图片的路径
202
204
  getSrc(item) {
@@ -12,7 +12,7 @@
12
12
  :src="item.thumb || item.url"
13
13
  :mode="imageMode"
14
14
  class="u-upload__wrap__preview__image"
15
- @tap="onPreviewImage(item)"
15
+ @tap="onPreviewImage(item, index)"
16
16
  :style="[{
17
17
  width: addUnit(width),
18
18
  height: addUnit(height)
@@ -21,7 +21,7 @@
21
21
  <view
22
22
  v-else
23
23
  class="u-upload__wrap__preview__other"
24
- @tap="onClickPreview($event, item)"
24
+ @tap="onClickPreview(item, index)"
25
25
  >
26
26
  <u-icon
27
27
  color="#80CBF9"
@@ -334,50 +334,67 @@
334
334
  );
335
335
  },
336
336
  // 预览图片
337
- onPreviewImage(item) {
338
- if (!item.isImage || !this.previewFullImage) return
337
+ onPreviewImage(previewItem, index) {
338
+ if (!previewItem.isImage || !this.previewFullImage) return
339
+ let current = 0;
340
+ const urls = [];
341
+ let imageIndex = 0;
342
+ for (var i = 0; i < this.lists.length; i++) {
343
+ const item = this.lists[i];
344
+ if (item.isImage || (item.type && item.type === 'image')) {
345
+ urls.push(item.url || item.thumb);
346
+ if (i === index) {
347
+ current = imageIndex;
348
+ }
349
+ imageIndex += 1;
350
+ }
351
+ }
352
+ if (urls.length < 1) {
353
+ return;
354
+ }
339
355
  uni.previewImage({
340
- // 先filter找出为图片的item,再返回filter结果中的图片url
341
- urls: this.lists.filter((item) => this.accept === 'image' || test.image(item.url || item.thumb)).map((item) => item.url || item.thumb),
342
- current: item.url || item.thumb,
356
+ urls: urls,
357
+ current: current,
343
358
  fail() {
344
359
  toast('预览图片失败')
345
360
  },
346
361
  });
347
362
  },
348
- onPreviewVideo(event) {
363
+ onPreviewVideo(index) {
349
364
  if (!this.previewFullImage) return;
350
- const {
351
- index
352
- } = event.currentTarget.dataset;
353
- const {
354
- lists
355
- } = this.data;
365
+ let current = 0;
366
+ const sources = [];
367
+ let videoIndex = 0;
368
+ for (var i = 0; i < this.lists.length; i++) {
369
+ const item = this.lists[i];
370
+ if (item.isVideo || (item.type && item.type === 'video')) {
371
+ sources.push(Object.assign(Object.assign({}, item), {
372
+ type: 'video'
373
+ }));
374
+ if (i === index) {
375
+ current = videoIndex;
376
+ }
377
+ videoIndex += 1;
378
+ }
379
+ }
380
+ if (sources.length < 1) {
381
+ return;
382
+ }
356
383
  // #ifdef MP-WEIXIN
357
384
  wx.previewMedia({
358
- sources: lists
359
- .filter((item) => isVideoFile(item))
360
- .map((item) =>
361
- Object.assign(Object.assign({}, item), {
362
- type: 'video'
363
- })
364
- ),
365
- current: index,
385
+ sources: sources,
386
+ current: current,
366
387
  fail() {
367
388
  toast('预览视频失败')
368
389
  },
369
390
  });
370
391
  // #endif
371
392
  },
372
- onClickPreview(event) {
373
- const {
374
- index
375
- } = event.currentTarget.dataset;
376
- const item = this.data.lists[index];
393
+ onClickPreview(item, index) {
377
394
  if (!this.previewFullImage) return;
378
395
  switch (item.type) {
379
396
  case 'video':
380
- this.onPreviewVideo(event);
397
+ this.onPreviewVideo(index);
381
398
  break;
382
399
  default:
383
400
  break;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3移动组件库。",
5
- "version": "3.3.37",
5
+ "version": "3.3.38",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",