如果弹出层没有滚动事件,就直接在蒙板上加catchtouchmove="move" move:function(){};
如果弹出层有滚动事件,那么在弹出层出现的时候给底部的containerView加上一个class 消失的时候移除。
<view class="{{showSearchView?'tripList_root':''}}">
.tripList_root{
top:0px;
left: 0px;
width: 100%;
height: 100%;
overflow: hidden;
position: fixed;
z-index: 0;
}
3. 亲测有效。
<template name=“timeSelect”>
<view wx:if="{{id}}" class=“stop_bg_scroll” catchtouchmove=“preventTouchMove”>
<form bindsubmit=“bindsubmit” id=’{{id}}’>
<!-- 半透明遮挡层 -->
<view class=“dialog-mask” bindtap=“bindtap” id=“mask” style=“display:block;”></view>
<view class=‘time-time’>
<!-- 标题 -->
<view indicator-style=“height: 50px;” class=“time-title”>{{title}}{{yyyy}}-{{MM}}-{{dd}} {{HH}}:{{mm}}:{{ss}}
</view>
<!-- 时间滚动条 -->
<picker-view id="{{id}}" indicator-style=“height: 50px;” class=‘time-content’ value="{{value}}" bindchange="bindchange"name=“index”>
<picker-view-column>
<view wx:for="{{yyyys}}" style=“line-height: 50px”>{{item}}年</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{MMs}}" style=“line-height: 50px”>{{item}}月</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{dds}}" style=“line-height: 50px”>{{item}}日</view>
</picker-view-column>
</picker-view>
<view class=“time-footer”>
<button class=“time-cancel” formType=‘submit’ id=“cancel” data-status=“cancel”>取消</button>
<button class=“time-confirm” formType=‘submit’ id=“confirm” data-status=“confirm”>确定</button>
</view>
</view>
</form>
</view>
</template>
wxss:
.stop_bg_scroll{
top: 0px;
left: 0px;
width: 100%;
height: 100%;
overflow: hidden;
}
希望有用