如图所示两个栏目分别弹出不同的的从底部弹出的弹层 怎么定位当前的view对应的弹层呢<view class='item'><view bindtap="showModal">已选择</view><view class="mask" bindtap="hideModal" wx:if="{{ModalStatus}}"></view><view animation="{{animationData}}" class="commodity_attr_box" wx:if="{{ModalStatus}}"> <view class='product_info box-center-v border'>规格弹出层</view></view></view><view class='item'><view bindtap="showModal">配送至</view><view class="mask" bindtap="hideModal" wx:if="{{ModalStatus}}"></view><view animation="{{animationData}}" class="commodity_attr_box" wx:if="{{ModalStatus}}"> <view class='product_info box-center-v border'>地址弹出层</view></view></view>showModal: function () { // 显示遮罩层 var animation = wx.createAnimation({ duration:300, timingFunction: "ease", delay: 0, }) this.animation = animation animation.translateY(600).step() this.setData({ animationData: animation.export(), ModalStatus: true }) setTimeout(function () { animation.translateY(0).step() this.setData({ animationData: animation.export() }) }.bind(this), 200) }, //隐藏对话框 hideModal: function () { // 隐藏遮罩层 var animation = wx.createAnimation({ duration: 200, timingFunction: "linear", delay: 0 }) this.animation = animation animation.translateY(400).step() this.setData({ animationData: animation.export(), }) setTimeout(function () { animation.translateY(0).step() this.setData({ animationData: animation.export(), ModalStatus: false }) }.bind(this), 200) }
添加回答
举报
0/150
提交
取消