小程序之数组
kind_xi:[{name:"百货"},{name:"百货"},{name:"百货"},{name:"百货"},{name:"百货"},{name:"百货"}]
循环:
<text wx:for="{{kind_xi}}">{{item.name}}\n</text> //以后的item即为指代的本数组
//对象里面含数组
list_all:[{id:1,logo:"../../image/D5F9ECB4E2F604A9E2159693E9D2A6E8.png",name:"精灵在线",jibie:[1,1,1,1,0],shou:"172",time:'65',qi:"20",pei:"4",fujia:"折扣商品9折起"},{id:2,logo:"../../image/D5F9ECB4E2F604A9E2159693E9D2A6E8.png",name:"精灵在线",jibie:[1,1,0,0,0],shou:"172",time:'65',qi:"20",pei:"4",fujia:"折扣商品9折起"},{id:3,logo:"../../image/D5F9ECB4E2F604A9E2159693E9D2A6E8.png",name:"精灵在线",jibie:[1,1,1,0,0],shou:"172",time:'65',qi:"30",pei:"6",fujia:"折扣商品9折起"},{id:4,logo:"../../image/D5F9ECB4E2F604A9E2159693E9D2A6E8.png",name:"精灵在线",jibie:[1,1,1,1,0],shou:"172",time:'65',qi:"50",pei:"5",fujia:"折扣商品9折起"},{id:5,logo:"../../image/D5F9ECB4E2F604A9E2159693E9D2A6E8.png",name:"精灵在线",jibie:[1,1,1,0,0],shou:"172",time:'65',qi:"20",pei:"4",fujia:"满20减3"},]
<view class="list">
<view class="list_all" wx:for="{{list_all}}">
<image src="{{item.logo}}"mode="widthFix"class="shop_logo"></image>
<view class="introduce">
<text class="name">{{item.name}}\n</text>
<block wx:for="{{item.jibie}}"> //block没有实际意义,包裹元素使用,把级别当做一个数组,接着循环
<image wx:if="{{item==1}}" src="../../image/x_03.png" mode="wdithFix"class="dj"></image>
<image wx:else src="../../image/x_05.png" mode="wdithFix"class="dj"></image>
</block>
<text class="intro_txt"><text class="left">月售{{item.shou}}</text><text class="right">{{item.time}}分钟</text>\n</text>
<text class="intro_txt">起送¥{{item.qi}} | 配送¥{{item.pei}}\n</text>
<text class="zhe">{{item.fujia}}</text>
</view>
</view>
</view>