优化原生底部与picker的层级

master
chen 2022-08-18 18:15:23 +08:00
parent fc73801043
commit 288993254b
5 changed files with 22 additions and 6 deletions

2
app.js
View File

@ -19,7 +19,7 @@ App({
wx.setStorageSync('urlPath', urlPath);
let hInfo = wx.getAccountInfoSync();
// console.log(hInfo.envVersion);//develop:开发版 trial体验版 release正式版
if(hInfo.miniProgram.envVersion != "develop"){
if(hInfo.miniProgram.envVersion == "release"){
console.log = () =>{}
}
// this.setOpenid()

View File

@ -27,9 +27,20 @@ Component({
"selectedIconPath": "/img/nav/menuIndex.png",
"text": "我要碳中和"
}
]
],
opacityNum:1
},
onload() {
},
attached() {
wx.setStorageSync('opacity',1);
setInterval(()=>{
this.setData({
opacityNum:wx.getStorageSync('opacity')
})
},100)
},
attached() {},
methods: {
switchTab(e) {
// console.log(e)

View File

@ -1,5 +1,5 @@
<!--miniprogram/custom-tab-bar/index.wxml-->
<cover-view class="tab-bar-border">
<cover-view class="tab-bar-border" style="opacity: {{opacityNum}};">
<cover-view class="border">
</cover-view>

View File

@ -2,7 +2,12 @@
var urlPath = require('../../config.js');
Page({
// 隐藏底部导航
hideEv(){
wx.setStorageSync('opacity',0);
},
bindDateChange: function(e) {
wx.setStorageSync('opacity',1);
this.setData({
[e.mark.type + '_date']: e.detail.value
})

View File

@ -30,13 +30,13 @@
</view>
<view class="picker-box">
<picker mode="date" value="{{start_date}}" class="time-picker" start="2015-09-01" end="2050-09-01" mark:type="start" bindchange="bindDateChange">
<view class="picker">
<view class="picker" bindtap="hideEv">
{{start_date?start_date:'请选择开始时间'}}
</view>
</picker>
<picker mode="date" value="{{end_date}}" class="time-picker" start="2015-09-01" end="2050-09-01" mark:type="end" bindchange="bindDateChange">
<view class="picker">
<view class="picker" bindtap="hideEv">
{{end_date?end_date:'请选择结束时间'}}
</view>
</picker>