您的位置:首页 > 运维架构

我的订单增加缩略图 仿淘宝 已买到的宝贝 ecshop二次开发

2013-10-24 00:10 519 查看
先上效果图吧



原来的样子



找到

view plaincopy
to clipboardprint?

$orders = get_user_orders($user_id, $pager['size'], $pager['start']);

增加如下内容

view plaincopy
to clipboardprint?

//把订单的详细内容查询出来

if(is_array($orders) && count($orders) > 0) {

$order_ids = '';

$new_orders = array();

foreach($orders as $val) {

$order_ids .= $val['order_id'].',';

}

$order_ids = substr($order_ids,0,-1);

$goods_info = array();

$sql = "SELECT o.*,g.goods_thumb FROM ".$ecs->table('order_goods')." o LEFT JOIN ".$ecs->table('goods')." g ON(o.goods_id=g.goods_id) WHERE order_id IN($order_ids)";

$result = $db->query($sql);

while($row = $db->fetch_array($result)) {

$goods_info[$row['order_id']][] = $row;

}

foreach($orders as $key=>$val) {

$val['goods'] = $goods_info[$val['order_id']];

$val['goods_number'] = count($goods_info[$val['order_id']]);

$new_orders[] = $val;

}

$orders = & $new_orders;

}

修改模板user_transaction.dwt

找到

view plaincopy
to clipboardprint?

<h6>{$lang.label_order}</h6>

把原来的显示订单的那块删除 改为如下内容

view plaincopy
to clipboardprint?

{* lee add 2013-6-28 开始 *}

<link rel="stylesheet" rev="stylesheet" href="themes/default/bought.css" type="text/css">

<style type="text/css">

.mod1 span {

display:inline;

width: auto;

height: auto;

position: static;

overflow: visible;

}

.pagebar {

padding: 0 10px 0 0;

text-align: right;

}

</style>

<div class="main-wrap">

<link rel="stylesheet" rev="stylesheet" href="themes/default/bought.css" type="text/css" media="all">

<table class="bought-table" id="J_BoughtTable" data-spm="9">

<colgroup>

<col class="selector">

<col class="baobei">

<col class="price">

<col class="quantity">

<col class="after-service">

<col class="amount">

<col class="trade-status">

<col class="operate">

<col class="other">

</colgroup>

<thead>

<tr class="col-name">

<th></th>

<th class="baobei">宝贝</th>

<th class="price">单价(元)</th>

<th class="quantity">数量</th>

<th class="after-service">售后</th>

<th class="amount">实付款(元)</th>

<th class="trade-status">

<div class="trade-status">

交易状态

</div>

</th>

<th class="remark">交易操作</th>

<th class="other">其它操作</th>

</tr>

</thead>

<!--{foreach from=$orders item=item}-->

<tbody class=" xcard">

<tr class="sep-row">

<td colspan="9"></td>

</tr>

<tr class="order-hd">

<td colspan="9" style="padding-left:5px;">

<span class="no">

<label>

<a href="user.php?act=order_detail&order_id={$item.order_id}" title="">订单编号:<span class="order-num">{$item.order_sn}</span></a>

</label>

</span>

<span class="deal-time">成交时间:{$item.order_time}</span>

</td>

</tr>

<!--{foreach from=$item.goods item=goods_info name=foo}-->

<tr id="item{$goods_info.goods_id}" class="order-bd <!--{if $item.goods_number > 0 && $smarty.foreach.foo.iteration == $item.goods_number}-->last<!--{/if}-->">

<td class="baobei" colspan="2">

<a hidefocus="true" title="查看宝贝详情" href="goods.php?id={$goods_info.goods_id}" class="pic s50"><img alt="查看宝贝详情" src="{$goods_info.goods_thumb}"></a>

<div class="desc">

<a class="baobei-name" href="/shop/goods.php?id={$goods_info.goods_id}">{$goods_info.goods_name}</a>

<!--

<div class="spec"><span>颜色分类: **</span><span>参考身高: 均码 0-18月</span></div>

-->

</div>

</td>

<td class="price" title="{$goods_info.goods_price}">{$goods_info.goods_price}</td>

<td class="quantity" title="{$goods_info.goods_number}">{$goods_info.goods_number}</td>

<td class="after-service">

<a href="javascript:void(0)" class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" title="">申请售后</a>

<a href="javascript:void(0)" class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" title="">投诉卖家</a>

</td>

<!--{if $smarty.foreach.foo.iteration == 1}-->

<td class="amount" rowspan="{$item.goods_number}">

<strong>{$item.total_fee}</strong>

<p class="post-type"><!-- (含免运费:0.00 ) -->

<!--<img alt="您已使用信用卡付款" title="您已使用信用卡付款" src="http://assets.taobaocdn.com/sys/common/icon/trade/xcard.png"/>-->

</p></td>

<td class="trade-status" rowspan="{$item.goods_number}">

<a href="#" class="J_MakePoint status success">{$item.order_status}</a>

<span>

<span class="uinfo-icon"></span>

<a href="user.php?act=order_detail&order_id={$item.order_id}" class="detail-link J_MakePoint">订单详情</a>

</span>

<!--<a href="#" class="view-logistics J_MakePoint"">查看物流</a>-->

</td>

<td class="operate" rowspan="{$item.goods_number}" colspan="2">

<!--

<span class="skin-white">

<a href="#" class="small-btn J_MakePoint button">评价</a>

</span>

<a class="J_DelOrder J_MakePoint" href="javascript:void(0)">删除</a>

<a class=" J_MakePoint" href="#">备忘</a>

<div class="J_ShareSNS sns-share">

<a href="#" class="J_MakePoint">分享</a>

</div>

-->

{$item.handler}

</td>

<!--{/if}-->

</tr>

<!--{/foreach}-->

</tbody>

<!--{/foreach}-->

<tfoot>

<tr class="sep-row">

<td colspan="9"></td>

</tr>

<tr class="** skin-gray">

<td colspan="3"></td>

<td class="page-nav-cell" colspan="6">

<!-- #BeginLibraryItem "/library/pages.lbi" --><!-- #EndLibraryItem -->

</td>

</tr>

</tfoot>

</table></div>

{* lee add 结束 *}

样式文件直接用的淘宝的

附件中也附带了这个css

附件下载

for_order
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: