码迷,mamicode.com
首页 > 微信 > 详细

微信小程序要调数据 微信小程序 for 循环详解

时间:2016-10-10 21:05:57      阅读:1673      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

现在要完成这样的效果:

我的代码是:

<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"
}
]
}
]

怎么样才能达到上面的效果,请高手多多指导

微信小程序要调数据 微信小程序 for 循环详解

标签:

原文地址:http://www.cnblogs.com/0liaoyi/p/5946924.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!