微信 小程序组件 分页传参
<!-- 1分类菜单-->
<view class='edition-menu flex'>
<block wx:key="edmenu" wx:for="{{edmenu}}" wx:for-index="index">
<view class='flexcca' data-index='{{index}}' bindtap='keyMenu'>
<text class="menu-title {{item.active?'actitle':''}}">{{item.menunm}}</text>
<view class="menu-under {{item.active?'edactive':''}}"></view>
</view>
</block>
</view>
<!-- 2详情列表 -->
<view class='edition-detail'>
<view wx:if="{{edmenu[0].active?true:''}}" class='detail-item-box'>
<block wx:key="edlist0" wx:for="{{edlist0}}">
<view class='detail-item flex'>
<view class='item-pic'>
<image class='image-full' src='../../../imgs/user/useradd.png'></image>
</view>
<view class='item-text'>
<view>
<text>需求编号:2133124312523</text>
</view>
<view>
<text>采购数量:88米</text>
</view>
<view class='flexb'>
<text>品名:欧根纱</text>
<text style='color:#999;font-size:24rpx;'>2017-01-28</text>
</view>
</view>
</view>
<view class='detail-result flexba'>
<text></text>
<text>待审核</text>
</view>
</block>
</view>
<view wx:if="{{edmenu[1].active?true:''}}">
</view>
<view wx:if="{{edmenu[2].active?true:''}}">
</view>
</view>
//-------------------------------------------------------------
.edition-container{
font-size: 30rpx;
color: #333;
}
/* 1分类菜单 */
.edition-menu{
height: 80rpx;
border-top: 1px solid #f7f7f7;
border-bottom: 1px solid #f7f7f7;
box-sizing: border-box;
">#fff;
color: #666;
}
.edition-menu>view{
width: 33.33%;
}
.edition-menu .menu-title{
margin-top: 15rpx;
}
.edition-menu .menu-under{
width: 70rpx;
height: 5rpx;
">transparent ;
border-radius: 6rpx;
margin-top: 10rpx;
}
.edition-menu .actitle{
color: #839AAF;
}
.edition-menu .edactive{
">#839AAF;
}
/* 2详情列表 */
.detail-item{
/* height: 314rpx; */
">#fff;
padding:20rpx 24rpx;
}
.edition-detail .item-pic{
width: 160rpx;
height: 184rpx;
margin-right: 20rpx;
overflow: hidden;
}
.edition-detail .item-text{
font-size: 26rpx;
flex:1;
line-height:62rpx;
}
.edition-detail .detail-result{
height: 90rpx;
border-top: 1rpx solid #f7f7f7;
">#fff;
padding: 0 24rpx;
box-sizing: border-box;
color: #839AAF;
font-size: 26rpx;
}
//-------------------------------------------------
edmenu:[
{menunm:'待审核',active:true},
{ menunm: '审核未通过', active: false },
{ menunm: '审核通过', active: false }
],
edlist0: [
{ name: '欧根纱', regid: "34289734897", num: '66', date:'2017-01-28'}
],
edlist1: [],
edlist2: [],
// 焦点控制函数
keyMenu: function (e) {
var edmenu = this.data.edmenu;
var index = e.currentTarget.dataset.index
for (var i = 0; i < edmenu.length;i++){
edmenu[i].active=false;
}
edmenu[index].active = true;
this.setData({
edmenu: edmenu
})
},