微信

整个单元格点击进入详情,按钮事件进入操作界面

111

catchtap 阻止冒泡

   <view class="cell_detail" wx:for="{{weightList}}" wx:key="id" bindtap="goDetailHandler" data-type="{{item.id}}">
      <!-- 状态 -- 时间 -->
      <view class="cell_top" wx:if="{{item.shenhe_status == 2}}">
        <text class="status">待修改</text>
<!-- catchtap 事件阻止冒泡 -->
        <button class="status-btn" catchtap="goUpdateHandler" data-type="{{item.id}}">去修改</button>
      </view>
      <view class="cell_top" wx:elif="{{item.shenhe_status == 0 || item.shenhe_status == null}}">
        <text class="status" style="color: #1281FB;background-color: #E6F2FF;">待审核</text>
        <button class="status-btn" catchtap="goAuditHandler" data-type="{{item.id}}">去审核</button>
      </view>
      <view class="cell_top" wx:else>
        <text class="status" style="color: #36C98E;background-color: #ECFFF8;">已审核</text>
      </view>

uniAPP

@click.native.stop 阻止冒泡

  <view class="bbkh1" @click.native.stop="lookLocation($event)" >
							查看位置
						</view>
// 阻止前往详情事件
			lookLocation(e){
				e.preventDefault(); // 阻止事件冒泡穿透
				console.log('查看位置');
			},
posted on 2022-07-13 16:02  depressiom  阅读(483)  评论(0编辑  收藏  举报