{include="style"}
{include="nav"}

## 商品详情页DEMO

介绍商品属性输出、图集输出、评论显示等

当前位置：{$positions} > {$jz['title']}

{php $pictures = explode('||',$jz['pictures'])/} {foreach $pictures as $v} {php $pic = explode('|',$v);/} {/foreach}

### {$jz['title']}

{php $comment = show_comment($jz['tid'],$jz['id'])/} {php $star_num = $comment['average']/} {if($comment['data'])} {for $i=1;$i<=$star_num;$i++} {/for} {if(round($star_num)!=$star_num)} {/if} {if($star_num<5)} {for $i=1;$i<=(5-$star_num);$i++} {/for} {/if} {$star_num} - {$comment['count']} 票 {else} 0 - 0 票 {/if} 热度：{fun incrData('product',$jz['id'],'hits')}

### ￥{$jz['price']}

##### 库存：{$jz['stock_num']}

{if(checkCollect($type['id'],$jz['id']))}
{else}
{/if}

{$jz['description']}

{$jz['body']}

参数 | 值
--- | ---
{php $product_fields = get_fields_show($jz['tid'],$type['molds'])/} {foreach $product_fields as $v}
{$v['fieldname']} {if($v['fieldtype']==7)} | {fun get_key_field_select($jz[$v['field']],$type['molds'],$v['field'])} {else if($v['fieldtype']==8)} {fun implode(' ',get_key_field_select($jz[$v['field']],$type['molds'],$v['field']))} {else} | {$jz[$v['field']]} {/if}
{/foreach}

{if($comment['data'])} {foreach $comment['data'] as $v} {if($v['level']==0)}
{if($v['likes']!=0)}
{for $i=1;$i<=$v['likes'];$i++} {/for} {if(round($v['likes'])!=$v['likes'])} {/if} {if($v['likes']<5)} {for $i=1;$i<=(5-$v['likes']);$i++} {/for} {/if}
{/if} {$v['userinfo']['username']}, {fun date('Y-m-d H:i:s',$v['addtime'])}

{$v['body']}

{if($v['reply'])}
管理员：{$v['reply']}
{/if} {if($islogin)}

回复

{/if} {if($v['haschild'])}
{foreach $comment['data'] as $vv} {if($vv['zid']==$v['id'])} {$vv['userinfo']['username']}, {fun date('Y-m-d H:i:s',$vv['addtime'])}

{if($vv['pid']!=$v['id'])}@{fun get_comment_user($vv['pid'])} {/if} {$vv['body']}

{if($vv['reply'])}
管理员：{$vv['reply']}
{/if} {if($islogin)}

回复

{/if} {/if} {/foreach}
{/if}
{/if} {/foreach} {else}
暂无评论
{/if}
{if($islogin)}
评分： {php $user_star = M('comment')->find(" aid=".$jz['id']." and userid=".$member['id']." and likes!=0 ",' addtime desc')/} {if($user_star)} {for $i=1;$i<=$user_star['likes'];$i++} {/for} {if(round($user_star['likes'])!=$user_star['likes'])} {/if} {if($user_star['likes']<5)} {for $i=1;$i<=(5-$user_star['likes']);$i++} {/for} {/if} {else} {/if}
{else} 登录后才可以评论~立即登录 {/if}

### 相关商品

{loop table="$type['molds']" notin="id|$jz['id']" limit="3" as="v"}
【{$v['id']}】{$v['title']}
{php $star_num = show_comment($v['tid'],$v['id'],'average')/} {for $i=1;$i<=$star_num;$i++} {/for} {if(round($star_num)!=$star_num)} {/if} {if($star_num<5)} {for $i=1;$i<=(5-$star_num);$i++} {/for} {/if}

#### ￥{$v['price']}

{/loop}
{include="footer"}