我的订单增加缩略图 仿淘宝 已买到的宝贝

2016-07-07 16:02 来源:www.chinab4c.com 作者:ecshop专家



先上效果图吧 我的订单改进后.jpg


原来的样子
我的订单改进前.jpg


首发在这里
http://laolee.org/my-orders-thumbnails-imitation-taobao-buy-baby.htm
付源码下载

或请见第四楼
修改代码的和附件

回答:



挺好的啊可以分享给我么。。。



修改user.php
找到
  1. $orders = get_user_orders($user_id, $pager['size'], $pager['start']);
复制代码




下面增加内容
  1. //把订单的详细内容查询出来
  2. if(is_array($orders) && count($orders) > 0) {
  3. $order_ids = '';
  4. $new_orders = array();
  5. foreach($orders as $val) {
  6. $order_ids .= $val['order_id'].',';
  7. }
  8. $order_ids = substr($order_ids,0,-1);

  9. $goods_info = array();
  10. $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)";
  11. $result = $db->query($sql);
  12. while($row = $db->fetch_array($result)) {
  13. $goods_info[$row['order_id']][] = $row;
  14. }

  15. foreach($orders as $key=>$val) {
  16. $val['goods'] = $goods_info[$val['order_id']];
  17. $val['goods_number'] = count($goods_info[$val['order_id']]);
  18. $new_orders[] = $val;
  19. }
  20. $orders = & $new_orders;
  21. }
复制代码






修改模板user_transaction.dwt
找到
  1. <h6>{$lang.label_order}</h6>
复制代码




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


  1. {* lee add 2013-6-28 开始 *}
  2. <link rel="stylesheet" rev="stylesheet" href="themes/default/bought.css" type="text/css">
  3. <style type="text/css">
  4. .mod1 span {
  5. display:inline;
  6. width: auto;
  7. height: auto;
  8. position: static;
  9. overflow: visible;
  10. }

  11. .pagebar {
  12. padding: 0 10px 0 0;
  13. text-align: right;
  14. }
  15. </style>
  16. <div class="main-wrap">
  17. <link rel="stylesheet" rev="stylesheet" href="themes/default/bought.css" type="text/css" media="all">
  18. <table class="bought-table" id="J_BoughtTable" data-spm="9">
  19. <colgroup>
  20. <col class="selector">
  21. <col class="baobei">
  22. <col class="price">
  23. <col class="quantity">
  24. <col class="after-service">
  25. <col class="amount">
  26. <col class="trade-status">
  27. <col class="operate">
  28. <col class="other">
  29. </colgroup>
  30. <thead>
  31. <tr class="col-name">
  32. <th></th>
  33. <th class="baobei">宝贝</th>
  34. <th class="price">单价(元)</th>
  35. <th class="quantity">数量</th>
  36. <th class="after-service">售后</th>
  37. <th class="amount">实付款(元)</th>
  38. <th class="trade-status">
  39. <div class="trade-status">
  40. 交易状态
  41. </div>
  42. </th>
  43. <th class="remark">交易操作</th>
  44. <th class="other">其它操作</th>
  45. </tr>
  46. </thead>

  47. <!--{foreach from=$orders item=item}-->
  48. <tbody class=" xcard">
  49. <tr class="sep-row">
  50. <td colspan="9"></td>
  51. </tr>
  52. <tr class="order-hd">
  53. <td colspan="9" style="padding-left:5px;">
  54. <span class="no">
  55. <label>
  56. <a href="user.php?act=order_detail&order_id={$item.order_id}" title="">订单编号:<span class="order-num">{$item.order_sn}</span></a>
  57. </label>
  58. </span>
  59. <span class="deal-time">成交时间:{$item.order_time}</span>
  60. </td>
  61. </tr>

  62. <!--{foreach from=$item.goods item=goods_info name=foo}-->
  63. <tr id="item{$goods_info.goods_id}" class="order-bd <!--{if $item.goods_number > 0 && $smarty.foreach.foo.iteration == $item.goods_number}-->last<!--{/if}-->">
  64. <td class="baobei" colspan="2">
  65. <a hidefocus="true" title="查看宝贝详情" href="goods.php?id={$goods_info.goods_id}" class="pic s50"><img alt="查看宝贝详情" src="{$goods_info.goods_thumb}"></a>
  66. <div class="desc">
  67. <a class="baobei-name" href="/shop/goods.php?id={$goods_info.goods_id}">{$goods_info.goods_name}</a>
  68. <!--
  69. <div class="spec"><span>颜色分类: **</span><span>参考身高: 均码 0-18月</span></div>

  70. -->
  71. </div>
  72. </td>
  73. <td class="price" title="{$goods_info.goods_price}">{$goods_info.goods_price}</td>
  74. <td class="quantity" title="{$goods_info.goods_number}">{$goods_info.goods_number}</td>
  75. <td class="after-service">
  76. <a href="javascript:void(0)" class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" title="">申请售后</a>
  77. <a href="javascript:void(0)" class="tousu-weiquan J_MakePoint J_HasBuy J_ApplyRepayTrigger" title="">投诉卖家</a>
  78. </td>

  79. <!--{if $smarty.foreach.foo.iteration == 1}-->
  80. <td class="amount" rowspan="{$item.goods_number}">
  81. <strong>{$item.total_fee}</strong>
  82. <p class="post-type"><!-- (含免运费:0.00 ) -->

  83. <!--<img alt="您已使用信用卡付款" title="您已使用信用卡付款" src="http://assets.taobaocdn.com/sys/common/icon/trade/xcard.png"/>-->
  84. </p></td>
  85. <td class="trade-status" rowspan="{$item.goods_number}">
  86. <a href="#" class="J_MakePoint status success">{$item.order_status}</a>
  87. <span>
  88. <span class="uinfo-icon"></span>
  89. <a href="user.php?act=order_detail&order_id={$item.order_id}" class="detail-link J_MakePoint">订单详情</a>
  90. </span>
  91. <!--<a href="#" class="view-logistics J_MakePoint"">查看物流</a>-->
  92. </td>
  93. <td class="operate" rowspan="{$item.goods_number}" colspan="2">
  94. <!--
  95. <span class="skin-white">
  96. <a href="#" class="small-btn J_MakePoint button">评价</a>
  97. </span>

  98. <a class="J_DelOrder J_MakePoint" href="javascript:void(0)">删除</a>
  99. <a class=" J_MakePoint" href="#">备忘</a>
  100. <div class="J_ShareSNS sns-share">
  101. <a href="#" class="J_MakePoint">分享</a>
  102. </div>

  103. -->
  104. {$item.handler}
  105. </td>

  106. <!--{/if}-->
  107. </tr>

  108. <!--{/foreach}-->
  109. </tbody>

  110. <!--{/foreach}-->
  111. <tfoot>
  112. <tr class="sep-row">
  113. <td colspan="9"></td>
  114. </tr>
  115. <tr class="** skin-gray">
  116. <td colspan="3"></td>
  117. <td class="page-nav-cell" colspan="6">
  118. <!-- #BeginLibraryItem "/library/pages.lbi" --><!-- #EndLibraryItem -->
  119. </td>
  120. </tr>
  121. </tfoot>
  122. </table></div>

  123. {* lee add 结束 *}
复制代码




附件 为增加和修改的代码 含css文件
for_order.zip (8.91 KB)


新站顺带求友情链接
http://laolee.org

还可以,试用几天先

好东西 顶顶,必须的顶分享精神很好 ,欢迎来我的群 群号 下面有

支持一下....

支持一下!谢谢

请问bought。css那个文件放在哪呢?




请问附件的css要放到哪里呢?