<div class="main f_r">
	<div class='tabs_content'>
		<div class="node">
			<table class="list_table m_10" width="100%" cellpadding="0" cellspacing="0">
				<col width="160px" />
				<col />
				<col width="80px" />
				<col width="60px"/>
				<thead><tr><th>商品名称</th><th>内容</th><th>咨询时间</th><th>回复</th></tr></thead>
				<tbody>
					{set:$queryConsultList = Api::run('getUcenterConsult',$this->user['user_id'])}
					{foreach:items = $queryConsultList->find()}
					<tr>
						<td><a href="{url:/site/products/id/$item[gid]}" target="_black">{$item['name']}</a></td>
						<td>{$item['question']}</td>
						<td>{echo:substr($item['time'],0,10)}</td>
						<td>
							{if:$item['status']==1}
							<a class="blue bold" href="javascript:void(0);" onclick='show_msg(this, {echo:JSON::encode($item)} )'>查看</a>
							{else:}
							未回复
							{/if}
						</td>
					</tr>
					{/foreach}

					<tr id='show_msg' class="show" style="display:none">
						<td colspan="4">
							<i class="close f_r" onclick='$(this).parent().parent().hide()'></i>
							商家在[<span id="reply_time"></span>]给您做了如下解答:
							<p class="gray indent mt_10" id='answer'></p>
						</td>
					</tr>
				</tbody>
				<tfoot><tr><td colspan="4" class="t_l">{$queryConsultList->getPageBar()}</td></tr></tfoot>
			</table>
		</div>
	</div>
</div>
<script type="text/javascript">
function show_msg(_self,obj)
{
    $('#show_msg').insertAfter($(_self).parent().parent());
    $('#show_msg').show();

	//设置数据
	obj.answer ? $('#show_msg').show() : $('#show_msg').hide();
    for(var i in obj)
    {
    	$('#show_msg #'+i).text(obj[i]);
    }
}
</script>
