index.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_btn"}
  3. {if $isPlatformStore || config('ds_config.promotion_booth_price')==0}
  4. <a class="dssc-btn dssc-btn-green" href="javascript:void(0);" dstype="select_goods"><i class="iconfont">&#xe6db;</i>{$Think.lang.added_items}</a>
  5. {else /}
  6. {empty name="booth_quota"}
  7. <a class="dssc-btn dssc-btn-acidblue" href="{:url('Sellerpromotionbooth/booth_quota_add')}" title="{$Think.lang.purchased_packages}"><i class="iconfont">&#xe6a1;</i>{$Think.lang.purchased_packages}</a>
  8. {else}
  9. {if $booth_quota.boothquota_state == 1}
  10. <a class="dssc-btn dssc-btn-green" href="javascript:void(0);" dstype="select_goods" style="right:100px"><i class="iconfont">&#xe6db;</i>{$Think.lang.added_items}</a>
  11. {/if}
  12. <a class="dssc-btn dssc-btn dssc-btn-acidblue" href="{:url('Sellerpromotionbooth/booth_renew')}"><i class="iconfont">&#xe6a1;</i>{$Think.lang.subscription_fee}</a>
  13. {/empty}
  14. {/if}
  15. {/block}
  16. {block name="seller_main"}
  17. {if $isPlatformStore || config('ds_config.promotion_booth_price')==0}
  18. <div class="alert alert-block mt10">
  19. <ul>
  20. <li>{$Think.lang.subscription_fee_notice1}</li>
  21. {if config('ds_config.promotion_bundling_sum') != 0}
  22. <li>{$Think.lang.subscription_fee_notice2}{$Think.config.ds_config.promotion_booth_goods_sum}{$Think.lang.subscription_fee_notice3}</li>
  23. {/if}
  24. </ul>
  25. </div>
  26. {else}
  27. <!-- 有可用套餐,发布活动 -->
  28. <div class="alert alert-block mt10">
  29. {if empty($booth_quota) || $booth_quota['boothquota_state'] == 0}
  30. <strong>{$Think.lang.tips_package_activities}</strong>
  31. {else/}
  32. <strong>{$Think.lang.set_expiration_time}{$Think.lang.ds_colon}</strong> <strong style=" color:#F00;">{$booth_quota.boothquota_endtime|date="Y-m-d H:i:s"}</strong>
  33. {/if}
  34. <ul>
  35. <li>{$Think.lang.notice_package_renewal1}</li>
  36. <li>2、<strong style="color: red">{$Think.lang.notice_package_renewal2}</strong>。</li>
  37. <li>{$Think.lang.notice_package_renewal3}</li>
  38. {if config('ds_config.promotion_bundling_sum') != 0}
  39. <li>{$Think.lang.notice_package_renewal4}{$Think.config.ds_config.promotion_booth_goods_sum}{$Think.lang.subscription_fee_notice3}</li>
  40. {/if}
  41. </ul>
  42. </div>
  43. {/if}
  44. {if $isPlatformStore || config('ds_config.promotion_booth_price')==0 || (!empty($booth_quota) && $booth_quota['boothquota_state'] == 1)}
  45. <div nvtype="div_goods_select" class="div-goods-select" style="display: none;">
  46. <table class="search-form">
  47. <tr><th class="w150"><strong>{$Think.lang.search_store_items}</strong></th><td class="w160"><input dstype="search_goods_name" type="text w150" class="text" name="goods_name" value=""/></td>
  48. <td class="w70 tc">
  49. <input dstype="btn_search_goods" type="button" value="{$Think.lang.ds_search}" class="submit"/>
  50. </td>
  51. <td class="w10"></td>
  52. <td><p class="hint">{$Think.lang.show_all_goods_sold}</p></td>
  53. </tr>
  54. </table>
  55. <div dstype="div_goods_search_result" class="search-result"></div>
  56. <a dstype="btn_hide_goods_select" class="close" href="javascript:void(0);">X</a> </div>
  57. <table class="dssc-default-table">
  58. <thead>
  59. <tr>
  60. <th class="w10"></th>
  61. <th class="w50"></th>
  62. <th class="tl">{$Think.lang.name_commodity}</th>
  63. <th class="w180">{$Think.lang.price}</th>
  64. <th class="w110">{$Think.lang.ds_handle}</th>
  65. </tr>
  66. </thead>
  67. <tbody dstype="choose_goods_list">
  68. <tr dstype="tr_no_promotion" style="display:none;">
  69. <td colspan="20" class="norecord"><div class="no-promotion"><i class="zw"></i><span>{$Think.lang.add_platform_stand_items}</span></div></td>
  70. </tr>
  71. {notempty name="goods_list"}
  72. {foreach name="goods_list" item="val"}
  73. <tr class="bd-line">
  74. <td></td>
  75. <td><div class="pic-thumb"><a href="{$val.url}" target="black"><img src="{$val.goods_image}"/></a></div></td>
  76. <td class="tl">
  77. <dl class="goods-name">
  78. <dt><a href="{$val.url}" target="_blank">{$val.goods_name}</a></dt>
  79. <dd><a href="{:url('Search/index',['cate_id'=>$val.gc_id])}">{$goodsclass_list[$val['gc_id']]['gc_name']|default=lang('there_no_classification')}</a></dd>
  80. </dl>
  81. </td>
  82. <td class="goods-price">¥{$val.goods_price}</td>
  83. <td class="dscs-table-handle">
  84. <span><a class="btn-red" href='javascript:void(0);' dstype="del_choosed" data-param="{gid:{$val.goods_id}}"><i class="iconfont">&#xe725;</i><p>{$Think.lang.ds_del}</p></a></span></td>
  85. </tr>
  86. {/foreach}
  87. {/notempty}
  88. </tbody>
  89. </table>
  90. {else/}
  91. <table class="dssc-default-table dssc-promotion-buy">
  92. <tbody>
  93. <tr>
  94. <td colspan="20" class="norecord"><div class="no-promotion"><i class="zw"></i><span>{$Think.lang.buy_package_tips1}<br />{$Think.lang.buy_package_tips2}</span></div></td>
  95. </tr>
  96. </tbody>
  97. </table>
  98. {/if}
  99. <script>
  100. $(function(){
  101. // 验证是否已经选择商品
  102. choosed_goods();
  103. // 显示搜索框
  104. $('a[dstype="select_goods"]').click(function(){
  105. $('div[nvtype="div_goods_select"]').show();
  106. });
  107. // 隐藏搜索框
  108. $('a[dstype="btn_hide_goods_select"]').click(function(){
  109. $('div[nvtype="div_goods_select"]').hide();
  110. });
  111. // 搜索商品
  112. $('input[dstype="btn_search_goods"]').click(function(){
  113. _url = "{:url('Sellerpromotionbooth/booth_select_goods')}";
  114. $('div[dstype="div_goods_search_result"]').html('').load(_url, {'goods_name':$('input[dstype="search_goods_name"]').val()});
  115. });
  116. $('div[nvtype="div_goods_select"]').on('click', '.pagination li a', function(){
  117. $('div[dstype="div_goods_search_result"]').load($(this).attr('href'));
  118. return false;
  119. });
  120. // 选择商品
  121. $('div[nvtype="div_goods_select"]').on('click', 'a[dstype="a_choose_goods"]', function(){
  122. _url = "{:url('Sellerpromotionbooth/choosed_goods')}";
  123. eval('var data_str = ' + $(this).attr('data-param'));
  124. $.getJSON(_url, {gid : data_str.gid}, function(data){
  125. if (data.result == 'true') {
  126. // 插入数据
  127. $('<tr class="bd-line"></tr>')
  128. .append('<td></td>')
  129. .append('<td><div class="pic-thumb"><a target="_blank" href="' + data.goods_info.url + '"><img src="' + data.goods_info.goods_image + '"></a></div></td>')
  130. .append('<td class="tl"><dl class="goods-name"><dt><a target="_blank" href="' + data.goods_info.url + '">' + data.goods_info.goods_name + '</a></dt><dd>' + data.goods_info.gc_name + '</dd></dl></td>')
  131. .append('<td>' + data.goods_info.goods_price + '</td>')
  132. .append('<td class="dscs-table-handle"><span><a class="btn-red" href="javascript:void(0);" data-param="{gid:'+ data.goods_info.goods_id +'}" dstype="del_choosed"><i class="iconfont">&#xe725;</i><p>{$Think.lang.ds_del}</p></a></span></td>')
  133. .appendTo('tbody[dstype="choose_goods_list"]');
  134. // 验证是否已经选择商品
  135. choosed_goods();
  136. layer.msg(data.msg);
  137. } else {
  138. layer.msg(data.msg);
  139. }
  140. });
  141. });
  142. // 删除商品
  143. $('tbody[dstype="choose_goods_list"]').on('click','a[dstype="del_choosed"]', function(){
  144. $this = $(this);
  145. _url = "{:url('Sellerpromotionbooth/del_choosed_goods')}";
  146. eval('var data_str = ' + $(this).attr('data-param'));
  147. $.getJSON(_url, {gid : data_str.gid}, function(data){
  148. if (data.result == 'true') {
  149. $this.parents('tr:first').fadeOut("slow",function(){
  150. $(this).remove();
  151. choosed_goods();
  152. });
  153. layer.msg(data.msg);
  154. } else {
  155. showErroe(data.msg);
  156. }
  157. });
  158. });
  159. });
  160. // 验证是否已经选择商品
  161. function choosed_goods() {
  162. if ($('tbody[dstype="choose_goods_list"]').children('tr').length == 1) {
  163. $('tr[dstype="tr_no_promotion"]').show();
  164. } else {
  165. $('tr[dstype="tr_no_promotion"]').hide();
  166. }
  167. }
  168. </script>
  169. {/block}