微信小程序要調數據 微信小程序 for 循環詳解


現在要完成這樣的效果:

我的代碼是:

<view class="l-setlist clr" >
<template name="listab">
<image src="{{pic}}" class="fl setpic"></image>
<view class="fr">

<view class="listbox">
<navigator url="list/list">
<image src="{{pic01}}" class="fl"></image>
<text>{{tlt}}</text>
<view class="l-setxt">
<text class="fl">{{info}}</text>
<text class="fr">{{gay}}</text>
</view>
</navigator>
</view>

</view>
</template>
<view wx:for="{{listab}}" class="mt20 clr" >

<template is="listab" data="{{...item}}"/>

</view>
</view>

js代碼:

listab:[
{
pic:"../images/set1.png",
listmap:[
{
pic01:"../images/shop3.png",
tlt:"廚房瓷磚",
info:"套餐搭配價",
gay:"¥388"
},
{
pic01:"../images/shop3.png",
tlt:"廚房瓷磚",
info:"套餐搭配價",
gay:"¥389"
},
{
pic01:"../images/shop3.png",
tlt:"廚房瓷磚",
info:"套餐搭配價",
gay:"¥389"
}
]
},
{
pic:"../images/set2.png",
listmap:[
{
pic01:"../images/shop3.png",
tlt:"廚房瓷磚",
info:"套餐搭配價",
gay:"¥388"
},
{
pic01:"../images/shop3.png",
tlt:"廚房瓷磚",
info:"套餐搭配價",
gay:"¥389"
},
{
pic01:"../images/shop3.png",
tlt:"廚房瓷磚",
info:"套餐搭配價",
gay:"¥389"
}
]
},
{
pic:"../images/set3.png",
listmap:[
{
pic01:"../images/shop3.png",
tlt:"廚房瓷磚",
info:"套餐搭配價",
gay:"¥388"
},
{
pic01:"../images/shop3.png",
tlt:"廚房瓷磚",
info:"套餐搭配價",
gay:"¥389"
},
{
pic01:"../images/shop3.png",
tlt:"廚房瓷磚",
info:"套餐搭配價",
gay:"¥389"
}
]
}
]

怎么樣才能達到上面的效果,請高手多多指導


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM