search_goods.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. {include file='default/base/seller_top'/}
  2. <form id="search_form">
  3. <input type="hidden" name="type" value="{$Request.param.type}" />
  4. <div class="wrapper" id="fix_goods">
  5. <table class="dssc-default-table mb15">
  6. <thead>
  7. <tr>
  8. <th class="tl" style="padding-left: 10px" colspan="2">{$Think.lang.ds_goods_name}</th>
  9. <th class="w90">{$Think.lang.ds_goods_price}</th>
  10. <th class="w90">{$Think.lang.ds_sort}</th>
  11. <th class="w90">{$Think.lang.ds_handle}</th></tr>
  12. </thead>
  13. <tbody dstype="bundling_data" class="bd-line tip">
  14. <tr{notempty name="goods_id"} style="display:none;"{/notempty}>
  15. <td colspan="20" class="norecord">
  16. <div class="no-promotion">
  17. <i class="zh"></i>
  18. <span>{$Think.lang.ds_no_record}</span></div>
  19. </td>
  20. </tr>{notempty name="goods_id"} {foreach name="goods_id" item="val"}
  21. <tr id="bundling_tr_{$val.goods_id}" class="off-shelf">
  22. <td class="w50">
  23. <div class="shelf-state">
  24. <div class="pic-thumb">
  25. <img src="{:goods_cthumb($val.goods_image,240,$val.store_id)}" ncname="{$val.goods_image}" dstype="bundling_data_img"></div></div>
  26. </td>
  27. <td class="tl">
  28. <dl class="goods-name">
  29. <dt style="width: 300px;">{$val.goods_name}</dt></dl>
  30. </td>
  31. <td class="goods-price w90" dstype="bundling_data_price">{$val.goods_price}</td>
  32. <td class="w90"><input data-goods="{$val.goods_id}" type="number" min="0" max="255" size="1" name="{$Request.param.name|default='goods_id'}[{$val.goods_id}][sort]" value="{if(isset($goods_id[$val['goods_id']]['sort']))}{$goods_id[$val['goods_id']]['sort']}{else}255{/if}" /></td>
  33. <td class="dscs-table-handle w90">
  34. <span>
  35. <a onclick="bundling_operate_delete($('#bundling_tr_{$val.goods_id}'), {$val.goods_id})" href="JavaScript:void(0);" class="btn-orange">
  36. <i class="iconfont">&#xe754;</i>
  37. <p>{$Think.lang.ds_del}</p>
  38. </a>
  39. </span>
  40. </td>
  41. </tr>{/foreach} {/notempty}</tbody>
  42. </table>
  43. <div class="div-goods-select-box">
  44. <div class="div-goods-select">
  45. <table class="search-form">
  46. <tbody>
  47. <tr>
  48. <th></th>
  49. <td><input type="text" name="keyword" class="text w200" value="{$Request.get.keyword}" /><a onclick="$('#search_form').submit()" dstype="search_a" class="dssc-btn"><i class="iconfont">&#xe718;</i>{$Think.lang.ds_search}</a></td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. <div class="search-result" style="width:739px;">
  54. {notempty name="goods_list"}
  55. <ul class="goods-list" dstype="bundling_goods_add_tbody" style=" width:760px;">
  56. {foreach name="goods_list" item="val"}
  57. <li dstype="{$val.goods_id}">
  58. <div class="goods-thumb"><img src="{:goods_cthumb($val.goods_image,240,$val.store_id)}" dstype="{$val.goods_image}" /></div>
  59. <dl class="goods-info">
  60. <dt><a href="#" target="_blank" title="{$val.goods_name}
  61. {if $val.goods_serial != ''}{$val.goods_serial}{/if}">{$val.goods_name}</a></dt>
  62. <dd>{$Think.lang.ds_goods_price}¥{$val.goods_price}</dd>
  63. <dd>{$Think.lang.goods_storage}{$val.goods_storage}</dd>
  64. </dl>
  65. <div data-param="{gid:{$val.goods_id},image:'{$val.goods_image}',src:'{:goods_cthumb($val.goods_image,240,$val.store_id)}',gname:'{$val.goods_name}',gprice:'{$val.goods_price}',gstorang:'{$val.goods_storage}'}">{if isset($goods_id) && isset($goods_id[$val['goods_id']])}<a href="JavaScript:void(0);" class="dssc-btn-mini dssc-btn-orange" onclick="bundling_operate_delete($('#bundling_tr_{$val.goods_id}'), {$val.goods_id})"><i class="iconfont">&#xe754;</i>{$Think.lang.ds_del}</a>{else}<a href="JavaScript:void(0);" class="dssc-btn-mini dssc-btn-green" onclick="bundling_goods_add($(this))"><i class="iconfont">&#xe6db;</i>{$Think.lang.ds_add}</a>{/if}</div>
  66. </li>
  67. {/foreach}
  68. </ul>
  69. {else /}
  70. <div class="norecord">
  71. <div class="warning-option"><i class="iconfont">&#xe64c;</i><span>{$Think.lang.no_record}</span></div>
  72. </div>
  73. {/notempty}
  74. {notempty name="goods_list"}
  75. <div class="pagination">{$show_page|raw}</div>
  76. {/notempty}
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="footer-btn">
  82. <input class="btn" type="button" value="{$Think.lang.ds_save}" onclick="saveGoods()" />
  83. </div>
  84. </form>
  85. <script>
  86. function saveGoods(){
  87. var html=''
  88. var count=0
  89. $('*[data-goods]').each(function(){
  90. $(this).attr('value',$(this).val())
  91. html+=$(this).parent().html()
  92. count++
  93. })
  94. window.parent.saveGoods(html,'{$Request.param.id}',count)
  95. var index=parent.layer.getFrameIndex(window.name)
  96. parent.layer.close(index)
  97. }
  98. /* 添加商品 */
  99. function bundling_goods_add(o){
  100. eval('var _data = ' + o.parent().attr('data-param'));
  101. // 隐藏第一个tr
  102. $('tbody[dstype="bundling_data"]').children(':first').hide();
  103. // 插入数据
  104. $('<tr id="bundling_tr_' + _data.gid + '"></tr>')
  105. .append('<td class="w50 "><div class="pic-thumb"><img dstype="bundling_data_img" ncname="' + _data.image + '" src="' + _data.src + '" onload="javascript:ResizeImage(this,60,60)"></span></div></td>')
  106. .append('<td class="tl"><dl class="goods-name"><dt style="width: 300px;">' + _data.gname + '</dt></dl></td>')
  107. .append('<td class="w90 goods-price" dstype="bundling_data_price">' + _data.gprice + '</td>')
  108. .append('<td class="w90"><input data-goods="' + _data.gid + '" type="number" min="0" max="255" size="1" name="{$Request.param.name|default='goods_id'}[' + _data.gid + '][sort]" value="255" /></td>')
  109. .append('<td class="dscs-table-handle w90"><span><a href="javascript:void(0);" onclick="bundling_operate_delete($(\'#bundling_tr_' + _data.gid + '\'), ' + _data.gid + ')" class="btn-orange"><i class="iconfont">&#xe754;</i><p>{$Think.lang.ds_del}</p></a></span></td>')
  110. .fadeIn().appendTo('tbody[dstype="bundling_data"]');
  111. $('li[dstype="' + _data.gid + '"]').children(':last').html('<a href="JavaScript:void(0);" class="dssc-btn-mini dssc-btn-orange" onclick="bundling_operate_delete($(\'#bundling_tr_' + _data.gid + '\'), ' + _data.gid + ')"><i class="iconfont">&#xe754;</i>{$Think.lang.ds_del}</a>');
  112. }
  113. /* 删除商品 */
  114. function bundling_operate_delete(o, id){
  115. o.remove();
  116. check_bundling_data_length();
  117. $('li[dstype="'+id+'"]').children(':last').html('<a href="JavaScript:void(0);" onclick="bundling_goods_add($(this))" class="dssc-btn-mini dssc-btn-green"><i class="iconfont">&#xe6db;</i>{$Think.lang.ds_add}</a>');
  118. }
  119. function check_bundling_data_length(){
  120. if ($('tbody[dstype="bundling_data"] tr').length == 1) {
  121. $('tbody[dstype="bundling_data"]').children(':first').show();
  122. }
  123. }
  124. </script>
  125. <style>
  126. body{min-width:inherit}
  127. .btn {
  128. width:inherit;
  129. display: inline-block;
  130. border: none;
  131. padding: 0px 18px;
  132. height: 38px;
  133. line-height: 38px;
  134. border-radius: 3px;
  135. background-color: #419dfd;
  136. color: #fff!important;
  137. vertical-align: middle;
  138. text-align: center;
  139. cursor: pointer;
  140. font-size: 14px;
  141. }
  142. .wrapper{padding:15px;width:inherit}
  143. .search-form{color:#999;width:100%;border-bottom: 1px solid #e5e5e5;background: #f5f5f5;}
  144. .search-form th{font-size:12px;line-height:22px;text-align:right;width:50px;padding:8px 8px 8px 0;}
  145. .search-form th.w250{width:250px}
  146. .search-form td{text-align:left;padding:20px 10px;}
  147. .search-form input.text{vertical-align:middle;width:148px;}
  148. .search-form .add-on{vertical-align:top;}
  149. .search-form input[type="submit"],
  150. .search-form input.submit,
  151. .search-form a.submit{font:12px/30px "microsoft yahei";width:64px;height:30px;padding:0;cursor:pointer;border-radius:2px}
  152. .search-form input[type="submit"]:hover{}
  153. .dssc-default-table{line-height:20px;width:100%;border-spacing: 0;border-collapse:collapse;border: none;clear:both;margin-top:10px;margin-bottom:10px}
  154. .dssc-default-table tbody tr.collapsed{display: none;}
  155. .dssc-default-table thead tr, .dssc-default-table tbody tr{}
  156. .dssc-default-table thead th{line-height:25px;color:#333;background-color:#F5F5F5;text-align:center;height:25px;padding:10px 0;font-weight:600;font-size:13px;}
  157. .dssc-default-table thead td, .dssc-default-table tfoot th{background-color:#FFF;height:22px;padding:5px 0;border-bottom:solid 1px #E6E6E6;}
  158. .dssc-default-table tfoot th{border-top:solid 1px #E6E6E6;}
  159. .dssc-default-table thead td label, .dssc-default-table tfoot th label{color:#555;display:inline;float:left;margin-right:10px;cursor:pointer;}
  160. .dssc-default-table tbody th{background-color:#FAFAFA;border:solid #E6E6E6;border-width:1px 0;padding:4px 0;}
  161. .dssc-default-table tbody th span{display:inline-block;vertical-align:middle;margin-right:30px;}
  162. .dssc-default-table tbody th span.goods-name{text-overflow:ellipsis;white-space:nowrap;width:240px;height:20px;overflow:hidden;}
  163. .dssc-default-table tbody td{color:#999;background-color:#FFF;text-align:center;padding:10px 0;}
  164. .dssc-default-table tbody td strong{color:#666;}
  165. .dssc-default-table tfoot td{background-color:#FFF;text-align:center;padding:10px 0;}
  166. .dssc-default-table td .pic-thumb{line-height:0;background-color:#FFF;text-align:center;vertical-align:middle;width:40px;height:40px;border:solid 1px #F5F5F5;overflow:hidden;margin-left:20px}
  167. .dssc-default-table td .pic-thumb img{max-width:40px;max-height:40px;margin-top:expression(32-this.height/2);*margin-top:expression(16-this.height/2)/*IE6,7*/;}
  168. .dssc-default-table td .goods-name{border:none;}
  169. .dssc-default-table td .goods-name dt{font-size:12px;color:#333;text-overflow:ellipsis;display:block;text-align:left;max-width:320px!important;max-height:36px;padding-bottom:4px;overflow:hidden;}
  170. .dssc-default-table td .goods-name dt span{line-height:16px;color:#FFF;background-color:#999;display:inline-block;*display:inline/*IE7*/;height:16px;padding:1px 4px;margin-right:2px;*zoom:1;box-shadow:inset 1px 1px 0 rgba(255,255,255,0.25);cursor:default;}
  171. .dssc-default-table td .goods-name dt span.type-virtual{background-color:#3598DC;}
  172. .dssc-default-table td .goods-name dt span.type-fcode{background-color:#9C59B8;}
  173. .dssc-default-table td .goods-name dt span.type-presell{background-color:#1ABC9D;}
  174. .dssc-default-table td .goods-name dt span.type-appoint{background-color:;}
  175. .dssc-default-table td .goods-name dt a{color:#005EA6;}
  176. .dssc-default-table td .goods-name dt a:hover{color:#DA542E;}
  177. .dssc-default-table td .goods-name dd{line-height:16px;display:block;height:16px;}
  178. .dssc-default-table td .goods-name .sale-type{background-color:#DA542E;padding:1px 4px;color:#FFFFFF}
  179. .dssc-default-table td .goods-name dd.serve{height:18px;padding-top:2px;}
  180. .dssc-default-table td .goods-name dd.serve span{color:#555;vertical-align:middle;display:inline-block;*display:inline/*IE7*/;margin-right:6px;position:relative;z-index:1;*zoom:1;cursor:default;}
  181. .dssc-default-table td .goods-name dd.serve i{font-size:18px;line-height:20px;}
  182. .dssc-default-table td .goods-name dd.serve i.commend{font-size:12px;background-color:#CCC;color:#FFF !important;line-height:16px;text-align:center;display:block;width:16px;height:16px;border-radius:2px;}
  183. .dssc-default-table td .goods-name dd.serve .open i{color:#3598DC;}
  184. .dssc-default-table td .goods-name dd.serve .open i.commend{background-color:#E84C3D;}
  185. .dssc-default-table td .goods-name dd.serve span .QRcode{background:#F5F5F5;display:none;width:160px;padding:5px;border:solid 1px #CCC;position:absolute;z-index:99;top:-90px;right:-170px;box-shadow:0 0 5px rgba(0,0,0,0.15);}
  186. .dssc-default-table td .goods-name dd.serve span .QRcode a{line-height:20px;display:block;text-align:right;}
  187. .dssc-default-table td .goods-name dd.serve span .QRcode p{line-height:0;background-color:#FFF;text-align:center;vertical-align:middle;display:table-cell;*display:block;width:160px;height:160px;overflow:hidden;}
  188. .dssc-default-table td .goods-name dd.serve span .QRcode img{max-width:160px;max-height:160px;margin-top:expression(160-this.height/2);}
  189. .dssc-default-table td .goods-name dd.serve span:hover .QRcode{display:block;}
  190. .div-goods-select-box{position:relative;z-index:1;zoom:1;}
  191. .div-goods-select{background-color:#FFF;margin-bottom:60px;border:solid 1px #E6E6E6;position:relative;z-index:1;zoom:1;}
  192. .div-goods-select .search-result{width:949px;margin:0 auto;overflow:hidden;}
  193. .div-goods-select .search-result .goods-list{font-size:0;*word-spacing:-1px/*IE6、7*/;width:950px;border:solid #E6E6E6;border-width:0 0 1px 0;margin-right:-1px;}
  194. .div-goods-select .search-result .goods-list li{font:12px/32px arial,"宋体";vertical-align:top;letter-spacing:normal;word-spacing:normal;display:inline-block;*display:inline/*IE7*/;width:149px;padding:10px 20px;margin:0 0 -1px 0;border-style:solid;border-color:#E6E6E6;border-width:0 1px 1px 0;overflow:hidden;zoom:1;}
  195. .div-goods-select .search-result .goods-thumb{line-height:0;background-color:#FFF;text-align:center;vertical-align:middle;display:table-cell;*display:block;width:140px;height:140px;padding:4px;overflow:hidden;}
  196. .div-goods-select .search-result .goods-thumb img{max-width:140px;max-height:140px;margin-top:expression(140-this.height/2);*margin-top:expression(70-this.height/2)/*IE6,7*/;}
  197. .div-goods-select .search-result .goods-info{border:none;}
  198. .div-goods-select .search-result .goods-info dt{text-align:left;width:auto;display:block;line-height:16px;height:32px;padding:0;overflow:hidden;}
  199. .div-goods-select .search-result .goods-info dd{line-height:20px;height:auto !important;padding:5px 0;}
  200. .div-goods-select .norecord{font-size:12px;color:#AAA;text-align:center;display:block;padding:40px 0;}
  201. .dssc-btn-mini{font:normal 12px/20px arial;color:#fff;background-color:#3480c1;text-align:center;vertical-align:middle;display:inline-block;height:20px;padding:0 10px;margin-right:2px;border-style:solid;border-width:1px;border-color:#3480c1;cursor:pointer;border-radius:2px; }
  202. .dssc-btn-mini:hover{text-decoration:none;color:#fff;background-color:#1e629c;border-color:#1e629c;}
  203. .dssc-btn{font:normal 12px/20px "microsoft yahei";text-decoration:none;color:#fff !important;background-color:#3480c1;text-align:center;vertical-align:middle;display:inline-block;height:20px;padding:4px 10px;border:solid 1px;border-color:#3480c1;cursor:pointer;border-radius:2px;}
  204. .dssc-btn:hover{text-decoration:none;color:#fff;background-color:#1e629c;border-color:#1e629c;}
  205. .dssc-btn-mini i, .dssc-btn i{font-size:14px;vertical-align:middle;margin-right:4px;}
  206. .dssc-btn-green, .dssc-btn-orange,
  207. .dssc-btn-green:hover, .dssc-btn-orange:hover, .dscs-table-handle .btn-orange-current{color:#FFF;}
  208. .dssc-btn-green,
  209. .dscs-table-handle .btn-green:hover{background-color:#0ecc6a;border-color:#0ecc6a;}
  210. .dssc-btn-orange,
  211. .dscs-table-handle .btn-orange:hover,
  212. .dscs-table-handle .btn-orange-current{background-color:#FAA732;margin:0;border-style:solid;border-width:1px;border-color:#FAA732 !important;}
  213. .dssc-btn-green:hover{background-color:#19ba62;border-color:#19ba62;}
  214. .dssc-btn-orange:hover{background-color:#F89406;border-color:#F89406;}
  215. .footer-btn{
  216. text-align: center;
  217. padding: 20px;
  218. position:fixed;
  219. z-index: 2;
  220. bottom:0;
  221. left:0;
  222. right:0;
  223. background-color: #fff;
  224. border-top: 1px solid #eee;
  225. }
  226. </style>