Skip to content

Commit 6011fa3

Browse files
committed
uview last to 220118-16:39:58
1 parent 475e256 commit 6011fa3

6 files changed

Lines changed: 24 additions & 20 deletions

File tree

uni_modules/uview-ui/components/u-back-top/u-back-top.vue

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,7 @@
6464
return style
6565
},
6666
show() {
67-
let top
68-
// 如果是rpx,转为px
69-
if (/rpx$/.test(this.top)) {
70-
top = uni.rpx2px(parseInt(this.top))
71-
} else {
72-
// 如果px,通过parseInt获取其数值部分
73-
top = parseInt(this.top)
74-
}
75-
return this.scrollTop > top
67+
return uni.$u.getPx(this.scrollTop) > uni.$u.getPx(this.top)
7668
},
7769
contentStyle() {
7870
const style = {}

uni_modules/uview-ui/components/u-number-box/u-number-box.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@
134134
computed: {
135135
getCursorSpacing() {
136136
// 判断传入的单位,如果为px单位,需要转成px
137-
const number = parseInt(this.cursorSpacing)
138-
return /rpx$/.test(String(this.cursorSpacing)) ? uni.upx2px(number) : number
137+
return uni.$u.getPx(this.cursorSpacing)
139138
},
140139
// 按钮的样式
141140
buttonStyle() {

uni_modules/uview-ui/components/u-sticky/u-sticky.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,7 @@
135135
observer && observer.disconnect()
136136
},
137137
getStickyTop() {
138-
if (/rpx$/.test(this.customNavHeight)) {
139-
// rpx单位需要转为px单位,才能直接相加
140-
this.stickyTop = parseInt(this.offsetTop) + parseInt(uni.rpx2px(this.customNavHeight))
141-
} else {
142-
// 无论customNavHeight为数值(默认px单位),还是12px(parseInt后为12)之类转换后都为数值,可以直接相加
143-
this.stickyTop = parseInt(this.offsetTop) + parseInt(this.customNavHeight)
144-
}
138+
this.stickyTop = uni.$u.getPx(this.offsetTop) + uni.$u.getPx(this.customNavHeight)
145139
},
146140
async checkSupportCssSticky() {
147141
// #ifdef H5

uni_modules/uview-ui/components/u-subsection/u-subsection.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export default {
159159
// subsection模式下,激活时默认为白色的文字
160160
if (this.mode === "subsection") {
161161
style.color =
162-
this.current === index ? "#fff" : this.activeColor;
162+
this.current === index ? "#fff" : this.inactiveColor;
163163
} else {
164164
// button模式下,激活时文字颜色默认为activeColor
165165
style.color =

uni_modules/uview-ui/components/u-upload/utils.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,25 @@ export function chooseFile({
127127
// #endif
128128
break
129129
// #endif
130+
default:
131+
// 此为保底选项,在accept不为上面任意一项的时候选取全部文件
132+
// #ifdef MP-WEIXIN
133+
wx.chooseMessageFile({
134+
count: multiple ? maxCount : 1,
135+
type: 'all',
136+
success: (res) => resolve(formatFile(res)),
137+
fail: reject
138+
})
139+
// #endif
140+
// #ifdef H5
141+
// 需要hx2.9.9以上才支持uni.chooseFile
142+
uni.chooseFile({
143+
count: multiple ? maxCount : 1,
144+
type: 'all',
145+
success: (res) => resolve(formatFile(res)),
146+
fail: reject
147+
})
148+
// #endif
130149
}
131150
})
132151
}

uni_modules/uview-ui/libs/config/props/navbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
navbar: {
1414
safeAreaInsetTop: true,
1515
placeholder: false,
16-
fixed: false,
16+
fixed: true,
1717
border: false,
1818
leftIcon: 'arrow-left',
1919
leftText: '',

0 commit comments

Comments
 (0)