想在页面加入scroll-view, 然后跳警告
这个时候开发者工具和手机显示都正常,滚动功能也有
设置了enable-flex,值写"true"和"false"都有点问题
开发者工具中显示正常,包括滚动功能都可以,:
但是移动端显示有问题:
wxml代码:
<scroll-view scroll-y id="team_data" class="data_list team_data">
<block wx:for="{{datas}}" wx:key="index">
<view class="data_box">
<view class="box_top">
<block wx:if="{{BtnIndex == 0}}">
<view class="top_left" style="background-image: url('{{item.logo}}')">{{item.app_name}}</view>
<navigator url="/pages/data_time/data_time?btn_index={{BtnIndex}}">
<view class="top_right" style="width: 75px">时间明细</view>
</navigator>
</block>
<block wx:if="{{BtnIndex == 1}}">
<view class="top_left" style="background-image: url('{{item.logo}}')">{{item.app_name}}</view>
<navigator url="/pages/data_time/data_time?btn_index={{BtnIndex}}">
<view class="top_right" style="width: 103px">我的时间明细</view>
</navigator>
</block>
</view>
<view class="h20"></view>
<view class="fee_box box">
<view class="fee_left left">总收益</view>
<view class="fee_right right">{{item.fee}} (元)</view>
</view>
<view class="h16"></view>
<view class="payfee_box box">
<view class="payfee_left left">支出收益</view>
<view class="payfee_right right">{{item.payfee}} (元)</view>
</view>
<view class="h16"></view>
<view class="leftfee_box box">
<view class="leftfee_left left">剩余收益</view>
<view class="leftfee_right right">{{item.leftfee}} (元)</view>
</view>
<view class="h16"></view>
<view class="totalNum_box box">
<view class="totalNum_left left">订单任务(总计)</view>
<view class="totalNum_right right">{{item.totalNum}} (单)</view>
</view>
<view class="h16"></view>
<view class="validNum_box box">
<view class="totalNum_left left">订单任务(已审核)</view>
<view class="totalNum_right right">{{item.validNum}} (单)</view>
</view>
</view>
</block>
</scroll-view>
wxss代码:
.data_list{
flex: 1;
display: flex;
flex-direction: column;
}
.data_box{
padding: 20px 16px;
margin: 10px 12px;
border-radius: 7px;
background-color: #ffffff;
display: flex;
flex-direction: column;
}
.box_top{
height: 24px;
display: flex;
justify-content: space-around;
}
.top_left{
height: 24px;
line-height: 24px;
font-size: 16px;
padding-left: 36px;
flex: 1;
background-repeat: no-repeat;
background-position: left center;
background-size: 24px 24px;
}
.top_right{
/* width: 75px; */
height: 24px;
line-height: 24px;
font-size: 14px;
color: #666666;
}
.top_right::after{
content: '';
position: absolute;
width: 7px;
height: 7px;
margin-top: 8px;
margin-left: 8px;
border-style: solid;
border-width: 2px 2px 0 0 ;
border-color: #666666;
transform: rotate(45deg);
}
.box{
font-size: 14px;
color: #666666;
display: flex;
}
.left{
flex: 1;
}
.right{
flex: 1;
text-align: right;
}
.fee_box{
color: #ee781f;
}
还是我代码有问题?
不会的