收藏
回答

cover-view文本显示不出来

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug cover-view 微信安卓客户端 7.0.8 2.9.3
<web-view src="https://wws.ximalaya.com/wws-lib/book/index/single/3/8075?libId=3676&dist=oEZ0yd" bindload="load" binderror="load"></web-view>
 
<!-- <image mode="widthFix" src="https://dt-test-1252491111.cos.ap-shanghai.myqcloud.com/yishengyishu/web.jpg"></image> -->
<block wx:if="{{banner}}">
  <cover-view class="banner start-center">
    <cover-view class="banner-title text-hidden" bindtap="switchBanner">
      {{banner.title}}
    </cover-view>
    <cover-view class="br"></cover-view>
    <cover-view class="banner-close center" bindtap="closeBanner">
      <cover-image src="https://dt-test-1252491111.cos.ap-shanghai.myqcloud.com/yishengyishu/close.png"></cover-image>
    </cover-view>
  </cover-view>
</block>
.banner{
  position: fixed;
  top: 80rpx;
  right: 30rpx;
  background: #e55850;
  min-width: 400rpx;
  max-width: 700rpx;
  border-radius: 10rpx;
}
 
.triangle{
  position: fixed;
  content: "";
  right: 11rpx;
  top: 96rpx;
  width: 0;
  height: 0;
  border-top: 16rpx solid transparent;
  border-bottom: 16rpx solid transparent;
  border-left: 20rpx solid #e55850;
}
 
.banner-title{
  height: 48rpx;
  line-height: 48rpx;
  color: #fff;
  font-size: 28rpx;
  padding: 0 30rpx;
  font-weight: 200;
  width: calc(100% - 72rpx);
}
 
.banner-close{
  width: 70rpx;
  height: 90rpx;
}
 
.banner-close cover-image{
  width: 60rpx;
  height: 60rpx;
}
 
.br{
  width: 1px;
  height: 42rpx;
  background: #fff;
}
 
.start-center{
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
var app = getApp();
Page({
  data: {
    banner: null,
  },
 
  load() {
    setTimeout(() => {
      this.setData({
        banner: {
          title: " 论语感悟",
          intro: "领略中国传统文化魅力,和于丹老师一起学习儒家经典。",
          url: "https://wws.ximalaya.com/wws-lib/book/index/single/3/8075?libId=3676&dist=oEZ0yd"
        }
      })
    }, 5000)
  }
})


cover-view中用cover-view包裹文本,文本显示不出来,去除包裹文本的cover-view时文本显示;

即节点.banner-title包裹文本,文本不显示,去除节点.banner-title,文本显示

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

1 个回答

登录 后发表内容
问题标签