index.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. {include file="default/base/seller_top" /}
  2. <div class="seller_main">
  3. {include file="default/base/seller_left" /}
  4. <div class="seller_right">
  5. <div class="seller_items">
  6. {include file="default/base/seller_items" /}
  7. </div>
  8. <script type="text/javascript">
  9. function pre_submit()
  10. {
  11. var sels=$("#gcategory").find("select");
  12. var i=0;
  13. var txt="";
  14. sels.each(function(){
  15. i++;
  16. $(this).attr("name","cls_"+i);
  17. var tmp=$(this).find("option:selected").text();
  18. if(i!=3)tmp+="&gt;";
  19. txt+=tmp;
  20. });
  21. $("#cate_name").val(txt);
  22. return true;
  23. }
  24. </script>
  25. <!-- S setp -->
  26. <div class="p20">
  27. <ul class="add-goods-step">
  28. <li style="width:32%;" class="{if $step==1}current{/if}"><i class="icon iconfont">&#xe600;</i>
  29. <h6>STIP.1</h6>
  30. <h2>{$Think.lang.store_goods_import_step1}</h2>
  31. <i class="arrow iconfont">&#xe687;</i> </li>
  32. <li style="width:32%;" class="{if $step==4}current{/if}"><i class="icon iconfont">&#xe6a2;</i>
  33. <h6>STIP.2</h6>
  34. <h2>{$Think.lang.store_goods_import_step2}</h2>
  35. </ul>
  36. <!--S 分类选择区域-->
  37. <!--S 分类选择区域-->
  38. <div class="alert mt15 mb5"><strong>操作提示:</strong>
  39. <ul>
  40. <li>{$Think.lang.store_goods_import_csv_desc|raw}</li>
  41. </ul>
  42. </div>
  43. <form method="post" action="{:url('SellerTaobaoImport/index')}" enctype="multipart/form-data" id="goods_form" onsubmit="return pre_submit();">
  44. <div class="dssc-form-goods" {if ($step != '1')} style="display:none"{/if}>
  45. <dl>
  46. <dt><i class="required">*</i>CSV文件:</dt>
  47. <dd>
  48. <div class="handle">
  49. <div class="dssc-upload-btn"> <a href="javascript:void(0);"><span>
  50. <input type="file" hidefocus="true" size="15" name="csv" id="csv">
  51. </span></a></div>
  52. </div>
  53. <p class="hint">{$Think.lang.store_goods_import_file_csv_desc}</p>
  54. </dd>
  55. </dl>
  56. <dl>
  57. <dt><i class="required">*</i>{$Think.lang.store_goods_index_goods_class}{$Think.lang.ds_colon}</dt>
  58. <dd id="gcategory"> <span dstype="gc1">
  59. {if (!empty($gc_list)) }
  60. <select dstype="gc" data-param="{deep:1}">
  61. <option>{$Think.lang.ds_please_choose}</option>
  62. {foreach name='gc_list' item='val' }
  63. <option value="{$val.gc_id}">{$val.gc_name}</option>
  64. {/foreach}
  65. </select>
  66. {/if}
  67. </span> <span dstype="gc2"></span> <span dstype="gc3"></span>
  68. <p>请选择商品分类(必须选到最后一级)</p>
  69. <input type="hidden" id="gc_id" name="gc_id" value="" class="mls_id" />
  70. <input type="hidden" id="cate_name" name="cate_name" value="" class="mls_names"/>
  71. </dd>
  72. </dl>
  73. <!--transport info begin-->
  74. <dl>
  75. <dt>{$Think.lang.store_goods_index_goods_szd}{$Think.lang.ds_colon}</dt>
  76. <dd>
  77. <input type="hidden" value="" name="region" id="region">
  78. <input type="hidden" value="" name="province_id" id="_area_1">
  79. <input type="hidden" value="" name="city_id" id="_area_2">
  80. </dd>
  81. </dl>
  82. <dl>
  83. <dt>{$Think.lang.store_goods_index_store_goods_class}{$Think.lang.ds_colon}</dt>
  84. <dd><span class="new_add"><a href="javascript:void(0)" id="add_sgcategory" class="dssc-btn">{$Think.lang.store_goods_index_new_class}</a> </span>
  85. {if (!empty($store_class_goods)) }
  86. {foreach name='store_class_goods' item='v' }
  87. <select name="sgcate_id[]" class="sgcategory">
  88. <option value="0">{$Think.lang.ds_please_choose}</option>
  89. {foreach name='store_goods_class' item='val' }
  90. <option value="{$val.storegc_id}" {if ($v==$val['storegc_id'])}selected="selected"{/if}>{$val.storegc_name}</option>
  91. {if (isset($val['child']) && count($val['child'])>0)}
  92. {foreach name='val.child' item='child_val'}
  93. <option value="{$child_val.storegc_id}" {if ($v==$child_val['storegc_id']) }selected="selected"{/if}>&nbsp;&nbsp;&nbsp;&nbsp;{$child_val.storegc_name}</option>
  94. {/foreach}
  95. {/if}
  96. {/foreach}
  97. </select>
  98. {/foreach}
  99. {else}
  100. <select name="sgcate_id[]" class="sgcategory">
  101. <option value="0">{$Think.lang.ds_please_choose}</option>
  102. {if (!empty($store_goods_class))}
  103. {foreach name='store_goods_class' item='val' }
  104. <option value="{$val.storegc_id}">{$val.storegc_name}</option>
  105. {if (isset($val['child']) && count($val['child'])>0)}
  106. {foreach name='val.child' item='child_val'}
  107. <option value="{$child_val.storegc_id}">&nbsp;&nbsp;&nbsp;&nbsp;{$child_val.storegc_name}</option>
  108. {/foreach}
  109. {/if}
  110. {/foreach}
  111. {/if}
  112. </select>
  113. {/if}
  114. <p class="hint">{$Think.lang.store_goods_index_belong_multiple_store_class}</p>
  115. </dd>
  116. </dl>
  117. <dl>
  118. <dt>{$Think.lang.store_goods_import_unicode}</dt>
  119. <dd>
  120. <p>unicode </p>
  121. </dd>
  122. </dl>
  123. <dl>
  124. <dt>{$Think.lang.store_goods_import_file_type}</dt>
  125. <dd>
  126. <p>{$Think.lang.store_goods_import_file_csv}</p>
  127. </dd>
  128. </dl>
  129. <dl>
  130. <dt>&nbsp;</dt>
  131. <dd>
  132. <input type="submit" class="submit" value="{$Think.lang.store_goods_import_submit}" />
  133. </dd>
  134. </dl>
  135. </ul>
  136. </div>
  137. </form>
  138. </div>
  139. <!--step4-->
  140. <iframe {if $step=='4'}style="display:block"{else}style="display:none"{/if} id="uploadwjc" src="{:url('SellerTaobaoImport/import_image')}" height="800" width='100%' frameborder="0" >
  141. </iframe>
  142. <script src="{$Think.PLUGINS_SITE_ROOT}/jquery.ajaxContent.pack.js"></script>
  143. <script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
  144. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/js/fileupload/jquery.iframe-transport.js" charset="utf-8"></script>
  145. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/js/fileupload/jquery.ui.widget.js" charset="utf-8"></script>
  146. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/js/fileupload/jquery.fileupload.js" charset="utf-8"></script>
  147. <script src="{$Think.PLUGINS_SITE_ROOT}/jquery.mousewheel.js"></script>
  148. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/jquery.charCount.js"></script>
  149. <!--[if lt IE 8]>
  150. <script src="{$Think.BASE_SITE_ROOT}/js/json2.js"></script>
  151. <![endif]-->
  152. <script src="{$Think.HOME_SITE_ROOT}/js/sellergoods_add_step2.js"></script>
  153. <script>
  154. $(function() {
  155. $("#region").ds_region({show_deep:2,tip_type:1});
  156. // 查询下级分类,分类不存在显示当前分类绑定的规格
  157. $('select[dstype="gc"]').change(function(){
  158. $(this).parents('td:first').nextAll().html('');
  159. getClassSpec($(this));
  160. });
  161. });
  162. // ajax选择商品分类
  163. function getClassSpec($this) {
  164. var id = parseInt($this.val());
  165. var data_str = ''; eval('data_str =' + $this.attr('data-param'));
  166. var deep = data_str.deep;
  167. if (isNaN(id)) {
  168. // 清理分类
  169. clearClassHtml(parseInt(deep)+1);
  170. }
  171. document.getElementById('gc_id').value=id;
  172. $.getJSON('{:url("Sellerspec/ajax_class")}?id=' + id + '&deep=' + deep, function(data){
  173. if (data) {
  174. if (data.type == 'class') {
  175. nextClass(data.data, data.deep);
  176. }
  177. }
  178. });
  179. }
  180. // 下一级商品分类
  181. function nextClass(data, deep) {
  182. $('span[dstype="gc' + deep + '"]').html('').append('<select data-param="{deep:' + deep + '}"></select>')
  183. .find('select').change(function(){
  184. getClassSpec($(this));
  185. }).append('<option>{$Think.lang.ds_please_choose}</option>');
  186. $.each(data, function(i, n){
  187. if (n != null) {
  188. $('span[dstype="gc' + deep + '"] > select').append('<option value="' + n.gc_id + '">' + n.gc_name + '</option>');
  189. }
  190. document.getElementById('gc_id').value=n.gc_id;
  191. });
  192. // 清理分类
  193. clearClassHtml(parseInt(deep)+1);
  194. }
  195. // 清理二级分类信息
  196. function clearClassHtml(deep) {
  197. switch (deep) {
  198. case 2:
  199. $('span[dstype="gc2"]').empty();
  200. case 3:
  201. $('span[dstype="gc3"]').empty();
  202. break;
  203. }
  204. }
  205. </script>
  206. </div>
  207. </div>
  208. {include file="default/base/mall_footer" /}