template-web中循环 判断 计算
<script type="text/html" id="recipelist">
<table>
<tr>
<td class="w185" style="background-color:#ebf6ff;font-size:14px;font-weight:bold;">
<span class="s1">时间</span>
<p></p>
<span class="s2">分类</span>
</td>
<td class="td-title" style="background-color:#fff0e9;color:#f9803f;">早餐</td>
<td style="background-color:#fffae7;color:#dfad36;" class="td-title">中餐</td>
<td style="background-color:#effffa;color:#21b184;" class="td-title">晚餐</td>
</tr>
{{each}}
<tr class="td-content">
<td style="text-align:center;background-color:#f2f2f2">
<div style="font-size:15px;font-weight:bold;">{{$value.sunday}}</div>
<div>{{$value.recipe_date}}</div>
</td>
<td class="td-hover">
{{set BreakfastCount=$value.Breakfastdish.length}}
{{each $value.Breakfastdish}}
<span class="span-color{{$index%9}}" >
{{if $index!=BreakfastCount-1}}
{{$value.dish_name}}、
{{else}}
{{$value.dish_name}}
{{/if}}
</span>
{{/each}}
</td>
<td class="td-hover">
{{set InmealCount=$value.Inmealdish.length}}
{{each $value.Inmealdish}}
<span class="span-color{{$index%9}}">
{{if $index!=InmealCount-1}}
{{$value.dish_name}}、
{{else}}
{{$value.dish_name}}
{{/if}}
</span>
{{/each}}
</td>
<td class="td-hover">
{{set DinnerCount=$value.Dinnerdish.length}}
{{each $value.Dinnerdish}}
<span class="span-color{{$index%9}}">
{{if $index!=DinnerCount-1}}
{{$value.dish_name}}、
{{else}}
{{$value.dish_name}}
{{/if}}
</span>
{{/each}}
</td>
</tr>
{{/each}}
</table>
</script>