File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 = {}
Original file line number Diff line number Diff line change 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 () {
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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 =
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 : '' ,
You can’t perform that action at this time.
0 commit comments