赞
踩
<view class="item" wx:for="{{msgList}}" wx:key="*this">
<view class="bottom grey" bindtap="extand" data-id="{{item.mi}}" wx:if="{{!item.isShow}}">
<text>查看详情</text>
<van-icon name="down" size="24rpx" color="#999"/>
</view>
<view class="bottom grey" bindtap="shou" data-id="{{item.mi}}" wx:else>
<text>收起</text>
</view>
</view>
// 展开 extand(e) { let id = e.currentTarget.dataset.id let arrayItem = this.data.msgList; for (let item of arrayItem) { let index = arrayItem.findIndex((item) => item.mi === id) console.log(index,'index') arrayItem[index].isShow = true } this.setData({ msgList: arrayItem }) }, // 收起 shou(e){ let id = e.currentTarget.dataset.id let arrayItem = this.data.msgList; for (let item of arrayItem) { let index = arrayItem.findIndex((item) => item.mi === id) arrayItem[index].isShow = false } this.setData({ msgList: arrayItem }) },
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。