canvas最高层级导致canvas生成的百分比与自定义的底部导航栏重合
发布于 6 年前 作者 yan15 3624 次浏览 来自 官方Issues
<!--pages/getMyTask/getMyTask.wxml-->
<block wx:if="{{checklistItem}}">
  <view class="listItem" wx:for="{{checklistItem}}" wx:key="" wx:for-item="item" wx:for-index="idx" data-idx="{{idx}}" bindtap="chooseItem">
    <view class="listItem_part1">
      <image class="listItem_part1_img" src="{{idx==currentidx&&choose==true?srcOnradio:srcRadio}}"></image>
      <text class="listItem_part1_title listItem_part_text">{{item.name}}</text>
      <view wx:if="{{item.strBmbimIsControlTask=='N'}}" class="weui-badge weui-badge_dot "  style="position: absolute;"></view>
    </view>
    <view class="listItem_part2">
      <!-- <progress class="listItem_part2_progress" percent="{{item.PercentCom}}" backgroundColor="#F8F8F8" stroke-width="12" show-info /> -->
      <view class="listItem_part2_left">
        <view class="listItem_part2_date listItem_part_text">
          <text>开始时间:{{item.StartDate}}</text>
        </view>
        <view class="listItem_part2_date listItem_part_text">
          <text>结束时间:{{item.FinishDate}}</text>
        </view>
      </view>
      <view class="listItem_part2_right">
        <canvas class="cir" canvas-id="{{item.id}}"></canvas>
      </view>
    </view>
</view>
</block>
<view class=" {{length==0?'true':'hideTrue'}}"><text class="text_noData">暂无任务</text></view>
<view class="afterlastListitem">
  <image></image>
</view>
<view class="buttom_3button">
  <image class="buttom_3button_img" bindtap="gotoHomePage" src="{{srcHome}}"></image>
  <image class="buttom_3button_img" bindtap="getMyTask" src="{{srcWork}}"></image>
  <image class="buttom_3button_img" bindtap="getMyCompleteTask" src="{{srcComplete}}"></image>
</view>

如上图所示,底部导航栏(自定义的)与canvas生成的百分比重合

2 回复

使用cover-view覆盖

嗯,谢谢,已经解决。原来也试过用cover-view,但是我的底部导航栏由3个image,没注意到cover-view中只支持嵌套 cover-view、cover-image。修改如下:

<!-- <view class="buttom_3button">
  <image class="buttom_3button_img" bindtap="gotoHomePage" src="{{srcHome}}"></image>
  <image class="buttom_3button_img" bindtap="getMyTask" src="{{srcWork}}"></image>
  <image class="buttom_3button_img" bindtap="getMyCompleteTask" src="{{srcComplete}}"></image>
</view> -->
<cover-view class="buttom_3button">
  <cover-image class="buttom_3button_img" bindtap="gotoHomePage" src="{{srcHome}}"></cover-image>
  <cover-image class="buttom_3button_img" bindtap="getMyTask" src="{{srcWork}}"></cover-image>
   <cover-image class="buttom_3button_img" bindtap="getMyCompleteTask" src="{{srcComplete}}"></cover-image>
</cover-view>

同时还需要给canvas设置z-index:-1000

回到顶部