收藏
回答

cover-view内wx:for中的内容在真机上不显示

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug cover-view 客户端 7.0.4 2.0.0

cover-view内wx:for中的内容在真机上不显示

问题代码加粗了


wxml文件:

<view class="custom" style="padding-top:0px">

<image src='/pages/images/head2.png'></image>

<view class='tarbar'>

<view class='tarbar-1'>

<view class='goback'  bindtap='goback' ><image src='/pages/images/goback.png' style='width:8px;height:14px'></image></view>

<view style='font-size:13px;margin-left:40rpx;text-align:center;'>{{onsiteName}}——{{offsiteName}}</view>

<view></view>

</view>

</view>

</view>

<!--<view class="empty_custom" style="padding-top:{{statusBarHeight}}px"></view>-->

<view class='container' style='margin-top:105px;'>

<map id="map"  longitude="{{cenLng}}" latitude="{{cenLat}}" scale="13" controls="{{controls}}"       bindcontroltap="controltap" markers="{{markers}}" bindmarkertap="markertap" polyline="{{polyline}}" bindregionchange="regionchange" show-location style="width: 100%; height: {{mheight}}px;">

</map>


<cover-view class='modal-dialog'>

<cover-view class='lineinfo'>

<cover-view class='lineinfo-im'>

<cover-view style='margin-top:10rpx;'><cover-image src='/pages/images/line/lineon.png' style='width:25px;height:28px;'></cover-image></cover-view>

<cover-view style='margin-top:10rpx;'>{{onsiteName}}</cover-view>

</cover-view>

<cover-view class='lineinfo-cen'>

<cover-view class='lineinfo-cen-on' style='border-bottom: 1px solid #fff;'>

<cover-view>{{start_time}}</cover-view>

<cover-view>¥{{price}}</cover-view>

</cover-view>

<cover-view class='lineinfo-cen-on'>

<cover-view>{{mileage}}公里</cover-view>

<cover-view>{{}}站</cover-view>

<cover-view>{{take_time}}分钟</cover-view>

</cover-view>

</cover-view>

<cover-view class='lineinfo-im'>

<cover-view style='margin-top:10rpx;'><cover-image src='/pages/images/line/lineoff.png' style='width:25px;height:28px;'></cover-image></cover-view>

<cover-view style='margin-top:10rpx;'>{{offsiteName}}</cover-view>

</cover-view>

</cover-view>

<cover-view class='arrowdown'  hidden='{{arrowdown}}'>

<cover-image src='/pages/images/line/arrow-down.png' bindtap='open_down' style='width:16px;height:9px;margin-top:20rpx;'></cover-image>

</cover-view>

<cover-view class='line-site' hidden='{{!arrowdown}}'>

<cover-view wx:for="{{markers}}" wx:key="id">

<cover-view class='tuijian' bindtap='switch' data-id='{{item.id}}' >

<cover-view class='map-line-text' style='width:95%;margin-top:20rpx;'>

<cover-view style='width:10%;'><cover-image src="{{item.iconPath}}" style='{{item.style}}' /></cover-view>

<cover-view style='width:70%;padding-top:5px;'>{{item.name}}</cover-view>

<cover-view style='width:20%;color:666;text-align:right;padding-top:5px;'>{{item.site_time}}</cover-view>

</cover-view>

</cover-view>

</cover-view>

<cover-view class='up-img' hidden='{{!arrowdown}}'>

<cover-image src="/pages/images/line/arrow-line-route.png" bindtap='kindToggle' style="width:16px;height:15px;z-index:99px"></cover-image>

</cover-view>

</cover-view>



</cover-view>

<cover-view class='nav1'  bindtap='{{tickstu?"tpticket":""}}'>

<cover-view class='nav'>

<cover-view class='bt' style='margin-left:30rpx;'>日票</cover-view>

</cover-view>

</cover-view>


<cover-view class='tickdate' hidden='{{dateflag}}'>

<cover-view class='dateBox' style='height:80rpx;padding-top:10rpx;'>

<cover-view class='boxwn'><cover-image src='/pages/images/line/arrow-left.png' bindtap='lastmonth' style='width:9px;height:16px;'></cover-image> </cover-view>

<cover-view style='width:80%;'>{{ year }} 年 {{ month}}月</cover-view>

<cover-view class='boxwn'><cover-image src='/pages/images/line/arrow-right.png' bindtap='nextmonth' style='width:9px;height:16px;'></cover-image></cover-view>

</cover-view>

<cover-view class="week">

<cover-view style='display: flex;flex-direction: row;font-size:14px,width:100%;'>

<cover-view style='width: {{ sysW+1 }}px; height: 80rpx; line-height: {{ sysW }}px;text-align:center;'></cover-view>

<cover-view style='width: {{ sysW+1 }}px; height: 80rpx; line-height: {{ sysW }}px;text-align:center;'></cover-view>

<cover-view style='width: {{ sysW+1 }}px; height: 80rpx; line-height: {{ sysW }}px;text-align:center;'></cover-view>

<cover-view style='width: {{ sysW+1 }}px; height: 80rpx; line-height: {{ sysW }}px;text-align:center;'></cover-view>

<cover-view style='width: {{ sysW+1 }}px; height: 80rpx; line-height: {{ sysW }}px;text-align:center;'></cover-view>

<cover-view style='width: {{ sysW+1 }}px; height: 80rpx; line-height: {{ sysW }}px;text-align:center;'></cover-view>

<cover-view style='width: {{ sysW+1 }}px; height: 80rpx; line-height: {{ sysW }}px;text-align:center;'></cover-view>


</cover-view>

</cover-view>

<cover-view  style='width:100%;' >

<cover-view class='box1' style='width: {{ (sysW+1) * 7 }}px;'>

//wx:for块内的内容在真机上都不显示,模拟器上正常

<block wx:for='{{ arr }}'>    

    <cover_view data-id='cch_{{item.id}}' bindtap='{{item.state==1&&!item.state1 ? "choose" : ""}}' style='background:{{item.bkcolor}};width: {{ sysW }}px; height: {{ sysW }}px; border-right:1rpx solid #ccc;border-bottom:1px solid #ccc;margin-top:5rpx;font-size:26rpx;text-align:center' >

        <cover_view style='display:flex;flex-direction:column;width: {{ sysW }}px; height: {{ sysW }}px;' wx:if='{{item.state==1}}'>

            <cover_view style='display:flex;flex-direction:row;height:40px;width:100%'><cover_view style="width:40%;text-align:center;">{{ item.day }}</cover_view><cover_view style="width:60%;text-align:center;color:{{item.color}}">{{item.name}}</cover_view></cover_view>

            <cover_view style='color:#fff;height:40px;'>¥{{item.curprice}}</cover_view>

            </cover_view>

        <cover_view style="line-height: {{ sysW }}px;" wx:else>{{item.day}}</cover_view>

    

    </cover_view>

</block>


</cover-view>

</cover-view>


<cover-view class='buytick'>

<cover-view class='ticklan'>

<cover-view style='width:30%;font-size:14px;margin-top:15rpx;'>¥{{total_price}}.00</cover-view>

<cover-view style='width:20%;font-size:12px;margin-top:25rpx;'>共{{tickets}}张</cover-view>

<cover-view class='bul'>

<cover-view class='but' bindtap='{{etflag?"buyticket":""}}' style='font-size:15px;padding-top:15rpx;'>购票</cover-view>

</cover-view>

</cover-view>

</cover-view>

</cover-view>

</view>

在真机调试实数据监测是正常的。监测数据如下


真机显示截屏:


模拟器显示:


有哪位大侠帮我看看,谢谢了!


回答关注问题邀请回答
收藏

2 个回答

  • 禾店短剧系统
    禾店短剧系统
    2021-05-24

    大侠来了,你却走了。。。

    2021-05-24
    有用 1
    回复
  • 疯狂的小辣椒
    疯狂的小辣椒
    2019-05-08

    你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

    2019-05-08
    有用
    回复
登录 后发表内容