uview-plus 3.5.52 → 3.6.4

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.
package/changelog.md CHANGED
@@ -1,3 +1,33 @@
1
+ ## 3.6.4(2025-10-09)
2
+ 🐛fix: import rpx2px function and add to exports in index.js
3
+
4
+ ## 3.6.3(2025-10-09)
5
+ fix: 修复getWindowInfo微信小程序下报警告
6
+
7
+ ## 3.6.2(2025-10-05)
8
+ fix: 修复picker双向绑定 #753
9
+
10
+ ## 3.6.1(2025-10-01)
11
+ fix: 修复poster海报组件微信小程序图片绘制失败
12
+
13
+ ## 3.6.0(2025-09-30)
14
+ fix: 修复parse事件报错及统一事件名称小写
15
+
16
+ ## 3.5.57(2025-09-30)
17
+ improvment: 更换部分资源域名提升访问速度
18
+
19
+ ## 3.5.56(2025-09-29)
20
+ fix: 修复picker和datetime-picker在部分原生渲染时hasInput触发键盘弹起
21
+
22
+ ## 3.5.55(2025-09-29)
23
+ feat: waterfall新增after-add-one和after-add-all事件
24
+
25
+ ## 3.5.54(2025-09-25)
26
+ 🐞 fix: 解决索引列表初始化时获取不到高度导致的字母列表异常
27
+
28
+ ## 3.5.53(2025-09-19)
29
+ improvment: back-top示例组合式API改造
30
+
1
31
  ## 3.5.52(2025-09-19)
2
32
  fix: 优化tabbar的borderColor优先级
3
33
 
@@ -9,8 +9,8 @@
9
9
  v-model="inputValue"
10
10
  v-bind="inputPropsInner"
11
11
  ></up-input>
12
- <view class="input-cover">
13
- </view>
12
+ <cover-view class="input-cover">
13
+ </cover-view>
14
14
  </slot>
15
15
  </view>
16
16
  <u-picker
@@ -284,8 +284,10 @@
284
284
  return new Promise(resolve => {
285
285
  // 延时一定时间,以获取dom尺寸
286
286
  // #ifndef APP-NVUE
287
- this.$uGetRect('.u-index-list__scroll-view').then(size => {
288
- resolve(size)
287
+ this.$nextTick(() => {
288
+ this.$uGetRect('.u-index-list__scroll-view').then(size => {
289
+ resolve(size)
290
+ })
289
291
  })
290
292
  // #endif
291
293
 
@@ -19,7 +19,8 @@
19
19
  <script>
20
20
  import {
21
21
  addUnit,
22
- guid
22
+ guid,
23
+ rpx2px
23
24
  } from '../../libs/function/index.js';
24
25
  /**
25
26
  * lazyLoad 懒加载
@@ -114,7 +115,7 @@
114
115
  // 将threshold从rpx转为px
115
116
  getThreshold() {
116
117
  // 先取绝对值,因为threshold可能是负数,最后根据this.threshold是正数或者负数,重新还原
117
- let thresholdPx = uni.upx2px(Math.abs(this.threshold));
118
+ let thresholdPx = rpx2px(Math.abs(this.threshold));
118
119
  return this.threshold < 0 ? -thresholdPx : thresholdPx;
119
120
  },
120
121
  // 计算图片的高度,可能为auto,带%,或者直接数值
@@ -150,7 +150,7 @@ export default {
150
150
  mounted () {
151
151
  this.$nextTick(() => {
152
152
  // 修复可能导致死循环的问题
153
- for (this.root = this?.$parent; this.root && this.root?.$options.name !== 'mp-html'; this.root = this.root?.$parent);
153
+ for (this.root = this?.$parent; this.root && this.root?.$options.name !== 'up-parse'; this.root = this.root?.$parent);
154
154
  })
155
155
  // #ifdef H5 || APP-PLUS
156
156
  if (this.opts[0]) {
@@ -180,6 +180,7 @@ export default {
180
180
  }
181
181
  // #endif
182
182
  },
183
+ emits: ['linktap', 'imgtap', 'play', 'ready', 'error'],
183
184
  methods: {
184
185
  // #ifdef MP-WEIXIN
185
186
  toJSON () { return this },
@@ -42,7 +42,13 @@ export const props = defineMixin({
42
42
  type: Boolean,
43
43
  default: () => defProps.parse.showImgMenu
44
44
  },
45
- tagStyle: Object,
46
- useAnchor: null
47
- }
45
+ tagStyle: {
46
+ type: Object,
47
+ default: () => {}
48
+ },
49
+ useAnchor: {
50
+ type: Boolean,
51
+ default: null
52
+ }
53
+ }
48
54
  }
@@ -32,8 +32,8 @@
32
32
  * @property {Boolean | Number} use-anchor 是否使用锚点链接
33
33
  * @event {Function} load dom 结构加载完毕时触发
34
34
  * @event {Function} ready 所有图片加载完毕时触发
35
- * @event {Function} imgTap 图片被点击时触发
36
- * @event {Function} linkTap 链接被点击时触发
35
+ * @event {Function} imgtap 图片被点击时触发
36
+ * @event {Function} linktap 链接被点击时触发
37
37
  * @event {Function} play 音视频播放时触发
38
38
  * @event {Function} error 媒体加载出错时触发
39
39
  */
@@ -46,7 +46,7 @@ const plugins = []
46
46
  const dom = weex.requireModule('dom')
47
47
  // #endif
48
48
  export default {
49
- name: 'u-parse',
49
+ name: 'up-parse',
50
50
  data() {
51
51
  return {
52
52
  nodes: [],
@@ -103,7 +103,7 @@ export default {
103
103
  useAnchor: [Boolean, Number]
104
104
  },
105
105
  // #ifdef VUE3
106
- emits: ['load', 'ready', 'imgTap', 'linkTap', 'play', 'error'],
106
+ emits: ['load', 'ready', 'imgtap', 'linktap', 'play', 'error'],
107
107
  // #endif
108
108
  // #ifndef APP-PLUS-NVUE
109
109
  components: {
@@ -410,7 +410,7 @@ export default {
410
410
  break
411
411
  // 图片点击
412
412
  case 'onImgTap':
413
- this.$emit('imgTap', message.attrs)
413
+ this.$emit('imgtap', message.attrs)
414
414
  if (this.previewImg) {
415
415
  uni.previewImage({
416
416
  current: parseInt(message.attrs.i),
@@ -421,7 +421,7 @@ export default {
421
421
  // 链接点击
422
422
  case 'onLinkTap': {
423
423
  const href = message.attrs.href
424
- this.$emit('linkTap', message.attrs)
424
+ this.$emit('linktap', message.attrs)
425
425
  if (href) {
426
426
  // 锚点跳转
427
427
  if (href[0] === '#') {
@@ -11,7 +11,7 @@
11
11
  v-model="inputLabel"
12
12
  v-bind="inputPropsInner">
13
13
  </up-input>
14
- <view class="input-cover"></view>
14
+ <cover-view class="input-cover"></cover-view>
15
15
  </view>
16
16
  <u-popup
17
17
  :show="show || (hasInput && showByClickInput)"
@@ -38,6 +38,10 @@
38
38
  *
39
39
  * @example <up-poster :json="posterJson"></up-poster>
40
40
  */
41
+
42
+ import {
43
+ rpx2px
44
+ } from '../../libs/function/index.js';
41
45
  export default {
42
46
  name: 'up-poster',
43
47
  props: {
@@ -221,20 +225,23 @@ export default {
221
225
  uni.getImageInfo({
222
226
  src: item.src,
223
227
  success: (res) => {
228
+ // console.log('图片加载成功: ' + item.src, res);
224
229
  // 处理圆角
225
230
  if (css.radius) {
226
231
  const radius = this.convertRpxToPx(css.radius);
227
232
  this.clipRoundRect(ctx, left, top, width, height, radius);
228
233
  }
229
- ctx.drawImage(item.src, left, top, width, height);
234
+ // 不能用item.src,要用res.path。
235
+ ctx.drawImage(res.path, left, top, width, height);
230
236
  // 恢复剪切区域
231
237
  ctx.restore();
232
238
  resolve();
233
239
  },
234
- fail: () => {
240
+ fail: (e) => {
235
241
  // 图片加载失败时绘制占位符
236
242
  ctx.setFillStyle('#f5f5f5');
237
243
  ctx.fillRect(left, top, width, height);
244
+ console.log('图片加载失败: ' + item.src, e);
238
245
  resolve();
239
246
  }
240
247
  });
@@ -461,10 +468,10 @@ export default {
461
468
  convertRpxToPx(rpxValue) {
462
469
  if (typeof rpxValue === 'number') return rpxValue;
463
470
 
464
- // 使用uni-app自带的uni.rpx2px方法
471
+ // 使用rpx2px方法
465
472
  if (typeof rpxValue === 'string' && rpxValue.endsWith('rpx')) {
466
473
  const value = parseFloat(rpxValue);
467
- return uni.rpx2px(value);
474
+ return rpx2px(value);
468
475
  }
469
476
 
470
477
  return parseFloat(rpxValue) || 0;
@@ -173,7 +173,7 @@
173
173
  // #endif
174
174
  }
175
175
  },
176
- emits: ['update:modelValue'],
176
+ emits: ['update:modelValue', 'after-add-one', 'after-add-all'],
177
177
  methods: {
178
178
  // 初始化列数据数组
179
179
  initColumnList() {
@@ -254,16 +254,21 @@
254
254
  // 获取实际渲染后的元素高度而不是估算
255
255
  await sleep(this.addTime)
256
256
  await this.$nextTick(async () => {
257
- try {
258
- const rect = await this.$uGetRect(`#u-column-${minHeightIndex}`);
259
- // console.log(`#u-column-${minHeightIndex}`, rect.height)
260
- if (rect.height) {
261
- columnHeights[minHeightIndex] = rect.height
257
+ try {
258
+ const rect = await this.$uGetRect(`#u-column-${minHeightIndex}`);
259
+ // console.log(`#u-column-${minHeightIndex}`, rect.height)
260
+ if (rect.height) {
261
+ columnHeights[minHeightIndex] = rect.height;
262
+ // 加载一个后置事件
263
+ this.$emit('after-add-one', {
264
+ ...item,
265
+ height: rect.height
266
+ });
267
+ }
268
+ } catch (e) {
269
+ // console.log(e)
270
+ // columnHeights[i] = 0;
262
271
  }
263
- } catch (e) {
264
- // console.log(e)
265
- // columnHeights[i] = 0;
266
- }
267
272
  });
268
273
  // this.$nextTick(async () => {
269
274
  // try {
@@ -285,6 +290,11 @@
285
290
  // }
286
291
  // });
287
292
  }
293
+ // 加载所有后置事件
294
+ this.$emit('after-add-all', {
295
+ columnHeights: columnHeights,
296
+ newData: newData
297
+ });
288
298
  },
289
299
 
290
300
  // 复制而不是引用对象和数组
package/index.js CHANGED
@@ -22,7 +22,7 @@ import calc from './libs/function/calc.js'
22
22
  // 浮点计算
23
23
  import digit from './libs/function/digit.js'
24
24
  // 公共文件写入的方法
25
- import index from './libs/function/index.js'
25
+ import index, { rpx2px } from './libs/function/index.js'
26
26
 
27
27
  // 配置信息
28
28
  import config from './libs/config/config.js'
@@ -46,7 +46,7 @@ import i18n, { t } from './libs/i18n/index.js'
46
46
 
47
47
  // 导出
48
48
  let themeType = ['primary', 'success', 'error', 'warning', 'info'];
49
- export { route, http, debounce, throttle, calc, digit, platform, themeType, mixin, mpMixin, props, color, test, zIndex, fontUtil, i18n ,t}
49
+ export { route, http, debounce, throttle, calc, digit, platform, themeType, mixin, mpMixin, props, color, test, zIndex, fontUtil, i18n , rpx2px, t}
50
50
  export * from './libs/function/index.js'
51
51
  export * from './libs/function/colorGradient.js'
52
52
 
@@ -32,6 +32,20 @@ export function getPx(value, unit = false) {
32
32
  return unit ? `${parseInt(value)}px` : parseInt(value)
33
33
  }
34
34
 
35
+ /**
36
+ * @description 用于统一rpx2px方法,因uni-app现有API未统一。
37
+ * @param {number} value 用户传递值的rpx值
38
+ * @returns {number}
39
+ */
40
+ export function rpx2px(value) {
41
+ // #ifdef APP
42
+ return uni.upx2px(value)
43
+ // #endif
44
+ // #ifndef APP
45
+ return uni.rpx2px(value)
46
+ // #endif
47
+ }
48
+
35
49
  /**
36
50
  * @description 进行延时,以达到可以简写代码的目的 比如: await uni.$u.sleep(20)将会阻塞20ms
37
51
  * @param {number} value 堵塞时间 单位ms 毫秒
@@ -853,5 +867,6 @@ export default {
853
867
  page,
854
868
  pages,
855
869
  getValueByPath,
856
- genLightColor
870
+ genLightColor,
871
+ rpx2px
857
872
  }
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.5.52",
5
+ "version": "3.6.4",
6
6
  "description": "零云®uview-plus已兼容vue3支持多语言,120+全面的组件和便捷的工具会让您信手拈来。近期新增拖动排序、条码、图片裁剪、下拉刷新、虚拟列表、签名、Markdown等。",
7
7
  "keywords": [
8
8
  "uview",