uview-plus 3.3.60 → 3.3.61

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,8 @@
1
+ ## 3.3.61(2024-12-31)
2
+ fix: 修复微信getSystemInfoSync接口废弃警告
3
+
4
+ fix: 'u-status-bar' symbol missing
5
+
1
6
  ## 3.3.60(2024-12-30)
2
7
  feat: 日期组件支持禁用
3
8
 
@@ -37,7 +37,7 @@
37
37
  import { props } from './props';
38
38
  import { mpMixin } from '../../libs/mixin/mpMixin';
39
39
  import { mixin } from '../../libs/mixin/mixin';
40
- import { addUnit, sys} from '../../libs/function/index';
40
+ import { addUnit, getWindowInfo} from '../../libs/function/index';
41
41
  /**
42
42
  * dropdown 下拉菜单
43
43
  * @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
@@ -166,8 +166,8 @@
166
166
  getContentHeight() {
167
167
  // 这里的原理为,因为dropdown组件是相对定位的,它的下拉出来的内容,必须给定一个高度
168
168
  // 才能让遮罩占满菜单一下,直到屏幕底部的高度
169
- // sys()为uview-plus封装的获取设备信息的方法
170
- let windowHeight = sys().windowHeight;
169
+ // getWindowInfo()为uview-plus封装的获取设备信息的方法
170
+ let windowHeight = getWindowInfo().windowHeight;
171
171
  this.$uGetRect('.u-dropdown__menu').then(res => {
172
172
  // 这里获取的是dropdown的尺寸,在H5上,uniapp获取尺寸是有bug的(以前提出修复过,后来又出现了此bug,目前hx2.8.11版本)
173
173
  // H5端bug表现为元素尺寸的top值为导航栏底部到到元素的上边沿的距离,但是元素的bottom值确是导航栏顶部到元素底部的距离
@@ -105,7 +105,7 @@
105
105
  import { props } from './props';
106
106
  import { mpMixin } from '../../libs/mixin/mpMixin';
107
107
  import { mixin } from '../../libs/mixin/mixin';
108
- import { addUnit, sys, sleep, getPx } from '../../libs/function/index';
108
+ import { addUnit, getWindowInfo, sleep, getPx } from '../../libs/function/index';
109
109
 
110
110
  // #ifdef APP-NVUE
111
111
  // 由于weex为阿里的KPI业绩考核的产物,所以不支持百分比单位,这里需要通过dom查询组件的宽度
@@ -152,7 +152,7 @@
152
152
  // scroll-view的高度
153
153
  scrollViewHeight: 0,
154
154
  // 系统信息
155
- sys: sys(),
155
+ sys: {},
156
156
  scrolling: false,
157
157
  scrollIntoView: '',
158
158
  pageY: 0,
@@ -188,6 +188,7 @@
188
188
  created() {
189
189
  this.children = []
190
190
  this.anchors = []
191
+ this.sys = getWindowInfo()
191
192
  },
192
193
  mounted() {
193
194
  this.init()
@@ -320,7 +321,7 @@
320
321
  const {
321
322
  height
322
323
  } = size
323
- const sysData = sys()
324
+ const sysData = getWindowInfo()
324
325
  const windowHeight = sysData.windowHeight
325
326
  let customNavHeight = 0
326
327
  // 消除各端导航栏非原生和原生导致的差异,让索引列表字母对屏幕垂直居中
@@ -358,7 +359,7 @@
358
359
  let index = this.currentIndex;
359
360
  // 对H5的pageY进行修正,这是由于uni-app自作多情在H5中将触摸点的坐标跟H5的导航栏结合导致的问题
360
361
  // #ifdef H5
361
- // pageY += sys().windowTop
362
+ // pageY += getWindowInfo().windowTop
362
363
  // #endif
363
364
  // 对第一和最后一个字母做边界处理,因为用户可能在字母列表上触摸到两端的尽头后依然继续滑动
364
365
  // console.log('top1', top)
@@ -476,8 +477,8 @@
476
477
  let children = this.children
477
478
  // #ifdef APP-NVUE
478
479
  // nvue下获取的滚动条偏移为负数,需要转为正数
479
- let sys = uni.getSystemInfoSync()
480
- scrollTop = Math.abs(e.contentOffset.y) / 10
480
+ let sys = getWindowInfo()
481
+ scrollTop = Math.abs(e.contentOffset.y) / 10
481
482
  // console.log('native', e)
482
483
  // #endif
483
484
 
@@ -515,7 +516,7 @@
515
516
  if (scrollTop <= children[0].top || scrollTop >= children[len - 1].top + children[len - 1].height) {
516
517
  this.activeIndex = -1
517
518
  break
518
- } else if (!nextItem) {
519
+ } else if (!nextItem) {
519
520
  // 当不存在下一个item时,意味着历遍到了最后一个
520
521
  this.activeIndex = len - 1
521
522
  break
@@ -50,7 +50,7 @@
50
50
  import { props } from './props';
51
51
  import { mpMixin } from '../../libs/mixin/mpMixin';
52
52
  import { mixin } from '../../libs/mixin/mixin';
53
- import { addUnit, addStyle, deepMerge, sleep, sys } from '../../libs/function/index';
53
+ import { addUnit, addStyle, deepMerge, sleep, getWindowInfo } from '../../libs/function/index';
54
54
  // #ifdef APP-NVUE
55
55
  const dom = uni.requireNativePlugin('dom')
56
56
  // #endif
@@ -90,7 +90,7 @@
90
90
  innerScrollTop: 0,
91
91
  // vue下,scroll-view在上拉加载时的偏移值
92
92
  offset: 0,
93
- sys: sys()
93
+ sys: getWindowInfo()
94
94
  }
95
95
  },
96
96
  computed: {
@@ -19,7 +19,7 @@
19
19
  import { props } from './props';
20
20
  import { mpMixin } from '../../libs/mixin/mpMixin';
21
21
  import { mixin } from '../../libs/mixin/mixin';
22
- import { sys } from '../../libs/function/index';
22
+ import { getWindowInfo } from '../../libs/function/index';
23
23
  // #ifdef APP-NVUE
24
24
  const dom = uni.requireNativePlugin('dom')
25
25
  // #endif
@@ -39,7 +39,7 @@
39
39
  rect: {},
40
40
  index: 0,
41
41
  show: true,
42
- sys: sys()
42
+ sys: getWindowInfo()
43
43
  }
44
44
  },
45
45
  computed: {
@@ -4,7 +4,7 @@
4
4
  class="u-navbar__placeholder"
5
5
  v-if="fixed && placeholder"
6
6
  :style="{
7
- height: addUnit(getPx(height) + sys().statusBarHeight,'px'),
7
+ height: addUnit(getPx(height) + getWindowInfo().statusBarHeight,'px'),
8
8
  }"
9
9
  ></view>
10
10
  <view :class="[fixed && 'u-navbar--fixed']">
@@ -77,7 +77,7 @@
77
77
  import { props } from './props';
78
78
  import { mpMixin } from '../../libs/mixin/mpMixin';
79
79
  import { mixin } from '../../libs/mixin/mixin';
80
- import { addUnit, addStyle, getPx, sys } from '../../libs/function/index';
80
+ import { addUnit, addStyle, getPx, getWindowInfo } from '../../libs/function/index';
81
81
  /**
82
82
  * Navbar 自定义导航栏
83
83
  * @description 此组件一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用uni-app带的导航栏。
@@ -114,7 +114,7 @@
114
114
  methods: {
115
115
  addStyle,
116
116
  addUnit,
117
- sys,
117
+ getWindowInfo,
118
118
  getPx,
119
119
  // 点击左侧区域
120
120
  leftClick() {
@@ -46,7 +46,7 @@
46
46
  import { props } from './props';
47
47
  import { mpMixin } from '../../libs/mixin/mpMixin';
48
48
  import { mixin } from '../../libs/mixin/mixin';
49
- import { toast } from '../../libs/function/index';
49
+ import { toast, getDeviceInfo } from '../../libs/function/index';
50
50
  /**
51
51
  * noNetwork 无网络提示
52
52
  * @description 该组件无需任何配置,引入即可,内部自动处理所有功能和事件。
@@ -67,7 +67,7 @@
67
67
  }
68
68
  },
69
69
  mounted() {
70
- this.isIOS = (uni.getSystemInfoSync().platform === 'ios')
70
+ this.isIOS = (getDeviceInfo().platform === 'ios')
71
71
  uni.onNetworkStatusChange((res) => {
72
72
  this.isConnected = res.isConnected
73
73
  this.networkType = res.networkType
@@ -122,7 +122,7 @@ export default {
122
122
  return {
123
123
  ctrl: {},
124
124
  // #ifdef MP-WEIXIN
125
- isiOS: uni.getSystemInfoSync().system.includes('iOS')
125
+ isiOS: uni.getDeviceInfo().system.includes('iOS')
126
126
  // #endif
127
127
  }
128
128
  },
@@ -75,12 +75,16 @@ const config = {
75
75
  }
76
76
  }
77
77
  const tagSelector={}
78
+ // #ifdef APP || H5 || MP-WEIXIN
79
+ const { windowWidth } = uni.getWindowInfo()
80
+ const { system } = uni.getDeviceInfo()
81
+ // #endif
82
+ // #ifndef APP || H5 || MP-WEIXIN
78
83
  const {
79
84
  windowWidth,
80
- // #ifdef MP-WEIXIN
81
85
  system
82
- // #endif
83
86
  } = uni.getSystemInfoSync()
87
+ // #endif
84
88
  const blankChar = makeMap(' ,\r,\n,\t,\f')
85
89
  let idIndex = 0
86
90
 
@@ -51,7 +51,7 @@
51
51
  import { props } from './props';
52
52
  import { mpMixin } from '../../libs/mixin/mpMixin';
53
53
  import { mixin } from '../../libs/mixin/mixin';
54
- import { addUnit, addStyle, deepMerge, sleep, sys } from '../../libs/function/index';
54
+ import { addUnit, addStyle, deepMerge, sleep, getWindowInfo } from '../../libs/function/index';
55
55
  /**
56
56
  * popup 弹窗
57
57
  * @description 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义
@@ -139,7 +139,7 @@
139
139
  // 不使用css方案,是因为nvue不支持css的iPhoneX安全区查询属性
140
140
  const {
141
141
  safeAreaInsets
142
- } = sys()
142
+ } = getWindowInfo()
143
143
  if (this.mode !== 'center') {
144
144
  style.flex = 1
145
145
  }
@@ -11,7 +11,7 @@
11
11
  import { props } from "./props.js";
12
12
  import { mpMixin } from '../../libs/mixin/mpMixin';
13
13
  import { mixin } from '../../libs/mixin/mixin';
14
- import { addStyle, deepMerge, addUnit, sys } from '../../libs/function/index';
14
+ import { addStyle, deepMerge, addUnit, getWindowInfo } from '../../libs/function/index';
15
15
  /**
16
16
  * SafeBottom 底部安全区
17
17
  * @description 这个适配,主要是针对IPhone X等一些底部带指示条的机型,指示条的操作区域与页面底部存在重合,容易导致用户误操作,因此我们需要针对这些机型进行底部安全区适配。
@@ -36,7 +36,7 @@
36
36
  const style = {};
37
37
  // #ifdef APP-NVUE || MP-TOUTIAO
38
38
  // nvue下,高度使用js计算填充
39
- style.height = addUnit(sys().safeAreaInsets.bottom, 'px');
39
+ style.height = addUnit(getWindowInfo().safeAreaInsets.bottom, 'px');
40
40
  // #endif
41
41
  return deepMerge(style, addStyle(this.customStyle));
42
42
  },
@@ -12,7 +12,7 @@
12
12
  import { props } from './props';
13
13
  import { mpMixin } from '../../libs/mixin/mpMixin';
14
14
  import { mixin } from '../../libs/mixin/mixin';
15
- import { addUnit, addStyle, deepMerge, sys } from '../../libs/function/index';
15
+ import { addUnit, addStyle, deepMerge, getWindowInfo } from '../../libs/function/index';
16
16
  /**
17
17
  * StatbusBar 状态栏占位
18
18
  * @description 本组件主要用于状态填充,比如在自定导航栏的时候,它会自动适配一个恰当的状态栏高度。
@@ -33,12 +33,12 @@
33
33
  // #ifdef H5
34
34
  this.isH5 = true
35
35
  // #endif
36
- }
36
+ },
37
37
  computed: {
38
38
  style() {
39
39
  const style = {}
40
40
  // 状态栏高度,由于某些安卓和微信开发工具无法识别css的顶部状态栏变量,所以使用js获取的方式
41
- style.height = addUnit(sys().statusBarHeight, 'px')
41
+ style.height = addUnit(getWindowInfo().statusBarHeight, 'px')
42
42
  style.backgroundColor = this.bgColor
43
43
  return deepMerge(style, addStyle(this.customStyle))
44
44
  }
@@ -17,7 +17,7 @@
17
17
  import { props } from './props';
18
18
  import { mpMixin } from '../../libs/mixin/mpMixin';
19
19
  import { mixin } from '../../libs/mixin/mixin';
20
- import { addUnit, addStyle, deepMerge, getPx, guid, sys, os } from '../../libs/function/index';
20
+ import { addUnit, addStyle, deepMerge, getPx, guid, getDeviceInfo, os } from '../../libs/function/index';
21
21
  import zIndex from '../../libs/config/zIndex';
22
22
  /**
23
23
  * sticky 吸顶
@@ -150,7 +150,7 @@
150
150
  // #endif
151
151
 
152
152
  // 如果安卓版本高于8.0,依然认为是支持css sticky的(因为安卓7在某些机型,可能不支持sticky)
153
- if (os() === 'android' && Number(sys().system) > 8) {
153
+ if (os() === 'android' && Number(getDeviceInfo().system) > 8) {
154
154
  this.cssSticky = true
155
155
  }
156
156
 
@@ -95,7 +95,7 @@
95
95
  import { mpMixin } from '../../libs/mixin/mpMixin';
96
96
  import { mixin } from '../../libs/mixin/mixin';
97
97
  import defProps from '../../libs/config/props.js'
98
- import { addUnit, addStyle, deepMerge, getPx, sleep, sys } from '../../libs/function/index';
98
+ import { addUnit, addStyle, deepMerge, getPx, sleep, getWindowInfo } from '../../libs/function/index';
99
99
  /**
100
100
  * Tabs 标签
101
101
  * @description tabs标签组件,在标签多的时候,可以配置为左右滑动,标签少的时候,可以禁止滑动。 该组件的一个特点是配置为滚动模式时,激活的tab会自动移动到组件的中间位置。
@@ -253,7 +253,7 @@
253
253
  return total + curr.rect.width
254
254
  }, 0)
255
255
  // 此处为屏幕宽度
256
- const windowWidth = sys().windowWidth
256
+ const windowWidth = getWindowInfo().windowWidth
257
257
  // 将活动的tabs-item移动到屏幕正中间,实际上是对scroll-view的移动
258
258
  let scrollLeft = offsetLeft - (this.tabsRect.width - tabRect.rect.width) / 2 - (windowWidth - this.tabsRect
259
259
  .right) / 2 + this.tabsRect.left / 2
@@ -42,7 +42,7 @@
42
42
  <script>
43
43
  import { mpMixin } from '../../libs/mixin/mpMixin';
44
44
  import { mixin } from '../../libs/mixin/mixin';
45
- import { os, sys, deepMerge, type2icon } from '../../libs/function/index';
45
+ import { os, getWindowInfo, deepMerge, type2icon } from '../../libs/function/index';
46
46
  import color from '../../libs/config/color';
47
47
  import { hexToRgb } from '../../libs/function/colorGradient';
48
48
  /**
@@ -136,7 +136,7 @@
136
136
  },
137
137
  // 内容盒子的样式
138
138
  contentStyle() {
139
- const windowHeight = sys().windowHeight, style = {}
139
+ const windowHeight = getWindowInfo().windowHeight, style = {}
140
140
  let value = 0
141
141
  // 根据top和bottom,对Y轴进行窗体高度的百分比偏移
142
142
  if(this.tmpConfig.position === 'top') {
@@ -93,7 +93,7 @@
93
93
  import { props } from './props';
94
94
  import { mpMixin } from '../../libs/mixin/mpMixin';
95
95
  import { mixin } from '../../libs/mixin/mixin';
96
- import { addStyle, addUnit, getPx, guid, toast, sleep, sys } from '../../libs/function/index';
96
+ import { addStyle, addUnit, getPx, guid, toast, sleep, getWindowInfo } from '../../libs/function/index';
97
97
  // #ifdef APP-NVUE
98
98
  const dom = uni.requireNativePlugin('dom')
99
99
  // #endif
@@ -162,7 +162,7 @@
162
162
  const style = {
163
163
  transform: `translateY(${this.direction === 'top' ? '-100%' : '100%'})`,
164
164
  },
165
- sysInfo = sys()
165
+ sysInfo = getWindowInfo()
166
166
  if (this.tooltipInfo.width / 2 > this.textInfo.left + this.textInfo.width / 2 - this.screenGap) {
167
167
  this.indicatorStyle = {}
168
168
  style.left = `-${addUnit(this.textInfo.left - this.screenGap)}`
@@ -49,8 +49,13 @@ export function sleep(value = 30) {
49
49
  * @returns {string} 返回所在平台(小写)
50
50
  * @link 运行期判断平台 https://uniapp.dcloud.io/frame?id=判断平台
51
51
  */
52
- export function os() {
53
- return uni.getSystemInfoSync().platform.toLowerCase()
52
+ export function os() {
53
+ // #ifdef APP || H5 || MP-WEIXIN
54
+ return uni.getDeviceInfo().platform.toLowerCase()
55
+ // #endif
56
+ // #ifndef APP || H5 || MP-WEIXIN
57
+ return uni.getSystemInfoSync().platform.toLowerCase()
58
+ // #endif
54
59
  }
55
60
  /**
56
61
  * @description 获取系统信息同步接口
@@ -58,6 +63,26 @@ export function os() {
58
63
  */
59
64
  export function sys() {
60
65
  return uni.getSystemInfoSync()
66
+ }
67
+ export function getWindowInfo() {
68
+ let ret = {}
69
+ // #ifdef APP || H5 || MP-WEIXIN
70
+ ret = uni.getWindowInfo()
71
+ // #endif
72
+ // #ifndef APP || H5 || MP-WEIXIN
73
+ ret = sys()
74
+ // #endif
75
+ return ret
76
+ }
77
+ export function getDeviceInfo() {
78
+ let ret = {}
79
+ // #ifdef APP || H5 || MP-WEIXIN
80
+ ret = uni.getDeviceInfo()
81
+ // #endif
82
+ // #ifndef APP || H5 || MP-WEIXIN
83
+ ret = sys()
84
+ // #endif
85
+ return ret
61
86
  }
62
87
 
63
88
  /**
@@ -710,7 +735,8 @@ export default {
710
735
  getPx,
711
736
  sleep,
712
737
  os,
713
- sys,
738
+ sys,
739
+ getWindowInfo,
714
740
  random,
715
741
  guid,
716
742
  $parent,
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.60",
5
+ "version": "3.3.61",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",
@@ -78,7 +78,7 @@ declare interface ActionSheetProps {
78
78
  /**
79
79
  * 点击ActionSheet列表项时触发
80
80
  */
81
- onSelect?: () => any
81
+ onSelect?: (e: any) => any
82
82
  /**
83
83
  * 点击取消按钮时触发
84
84
  */