album_cate.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_btn"}
  3. <a uri="{:url('Selleralbum/album_add')}" ds_type="dialog" dialog_title="{$Think.lang.album_class_add}" class="dssc-btn dssc-btn-green" style="right: 100px;">
  4. <i class="iconfont">&#xe728;</i>{$Think.lang.album_class_add}
  5. </a>
  6. {notempty name="aclass_info"}
  7. <a id="open_uploader" href="JavaScript:void(0);" class="dssc-btn dssc-btn-acidblue"><i class="iconfont">&#xe733;</i>{$Think.lang.album_class_list_img_upload}</a>
  8. <div class="upload-con" id="uploader" style="display: none;">
  9. <form method="post" action="" id="fileupload" enctype="multipart/form-data">
  10. <div class="upload-con-div">{$Think.lang.album_class_list_sel_img_class}{$Think.lang.ds_colon}
  11. <select name="category_id" id="category_id" class="select w80">
  12. {foreach name="aclass_info" item="v" }
  13. <option value='{$v.aclass_id}' class="w80">{$v.aclass_name}</option>
  14. {/foreach}
  15. </select>
  16. </div>
  17. <div class="upload-con-div">{$Think.lang.store_select_file}:
  18. <div class="dssc-upload-btn"> <a href="javascript:void(0);"><span>
  19. <input type="file" hidefocus="true" size="1" class="input-file" name="file" multiple="multiple"/>
  20. </span>
  21. <p><i class="iconfont">&#xe733;</i>{$Think.lang.album_class_list_img_upload}</p>
  22. </a> </div>
  23. </div>
  24. <div dstype="file_msg"></div>
  25. <div class="upload-pmgressbar" dstype="file_loading"></div>
  26. <div class="upload-txt"><span>{$Think.lang.album_batch_upload_description}{$Think.config.ds_config.image_max_filesize}KB{$Think.lang.album_batch_upload_description_1}</span> </div>
  27. </form>
  28. </div>
  29. {/notempty}
  30. {/block}
  31. {block name="seller_main"}
  32. <div id="pictureIndex" class="dssc-picture-folder">
  33. <table class="search-form">
  34. <tbody>
  35. <tr>
  36. <td>&nbsp;</td>
  37. <th>{$Think.lang.album_sort}</th>
  38. <td class="w100">
  39. <form name="select_sort" id="select_sort" class="sortord">
  40. <select name="sort" id="img_sort">
  41. <option value="4" {if condition="$Request.param.sort eq '4'"}selected{/if}>{$Think.lang.album_sort_desc}</option>
  42. <option value="5" {if condition="$Request.param.sort eq '5'"}selected{/if}>{$Think.lang.album_sort_asc}</option>
  43. <option value="0" {if condition="$Request.param.sort eq '0'"}selected{/if}>{$Think.lang.album_sort_time_desc}</option>
  44. <option value="1" {if condition="$Request.param.sort eq '1'"}selected{/if}>{$Think.lang.album_sort_time_asc}</option>
  45. <option value="2" {if condition="$Request.param.sort eq '2'"}selected{/if}>{$Think.lang.album_sort_class_name_desc}</option>
  46. <option value="3" {if condition="$Request.param.sort eq '3'"}selected{/if}>{$Think.lang.album_sort_class_name_asc}</option>
  47. </select>
  48. </form>
  49. </td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. {notempty name="aclass_info"}
  54. <div class="dssc-album">
  55. <ul>
  56. {foreach name="aclass_info" item="v" }
  57. <li class="hidden">
  58. <dl>
  59. <dt>
  60. <div class="covers">
  61. <a href="{:url('Selleralbum/album_pic_list',['id'=>$v.aclass_id])}">
  62. {if $v.aclass_cover != ''}
  63. <img id="aclass_cover" src="{:goods_cthumb($v['aclass_cover'], 240, session('store_id'))}">
  64. {else /}
  65. <i class="iconfont">&#xe6a2;</i>
  66. {/if}
  67. </a>
  68. </div>
  69. <h3 class="title"><a href="{:url('Selleralbum/album_pic_list',['id'=>$v.aclass_id])}">{$v.aclass_name}</a></h3>
  70. </dt>
  71. <dd class="buttons"><span ds_type="dialog" dialog_title="{$Think.lang.album_class_deit}" dialog_id='album_{$v.aclass_id}' dialog_width="480" uri="{:url('Selleralbum/album_edit',['id'=>$v.aclass_id])}"><a href="JavaScript:void(0);"><i class="iconfont">&#xe731;</i>{$Think.lang.album_class_edit}</a></span>
  72. {if $v.aclass_isdefault != '1'}
  73. <a href="javascript:void(0)" onclick="ds_ajaxget_confirm('{:url('Selleralbum/album_del',['id'=>$v.aclass_id])}','{$Think.lang.album_class_delete_confirm_message}');"><i class="iconfont">&#xe699;</i>{$Think.lang.album_class_delete}</a>
  74. {/if}
  75. </dd>
  76. </dl>
  77. </li>
  78. {/foreach}
  79. </ul>
  80. </div>
  81. {else /}
  82. <div class="warning-option"><i class="iconfont">&#xe64c;&nbsp;</i><span>{$Think.lang.no_record}</span></div>
  83. {/notempty}
  84. </div>
  85. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/js/fileupload/jquery.iframe-transport.js" charset="utf-8"></script>
  86. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/js/fileupload/jquery.ui.widget.js" charset="utf-8"></script>
  87. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/js/fileupload/jquery.fileupload.js" charset="utf-8"></script>
  88. <script type="text/javascript">
  89. $(function() {
  90. //鼠标触及区域li改变class
  91. $(".dssc-album ul li").hover(function() {
  92. $(this).addClass("hover");
  93. }, function() {
  94. $(this).removeClass("hover");
  95. });
  96. // ajax 上传图片
  97. var upload_num = 0; // 上传图片成功数量
  98. var index=0
  99. $('#fileupload').fileupload({
  100. dataType: 'json',
  101. url: "{:url('Selleralbum/image_upload')}",
  102. formData: function(form){
  103. var aclass_id=$("#category_id").val()
  104. setTimeout(function(){
  105. index=0
  106. },1000)
  107. return [{name:'index',value:++index},{name:'category_id',value:aclass_id?aclass_id:0}];
  108. },
  109. add: function (e,data) {
  110. $.each(data.files, function (index, file) {
  111. $('<div dstype="' + file.name.replace(/\./g, '_') + '"><p>'+ file.name +'</p><p class="loading"></p></div>').appendTo('div[dstype="file_loading"]');
  112. });
  113. data.submit();
  114. },
  115. done: function (e,data) {
  116. var param = data.result;
  117. $this = $('div[dstype="' + param.origin_file_name.replace(/\./g, '_') + '"]');
  118. $this.fadeOut(3000, function(){
  119. $(this).remove();
  120. if ($('div[dstype="file_loading"]').html() == '') {
  121. setTimeout("window.location.reload()", 1000);
  122. }
  123. });
  124. if(param.state == 'true'){
  125. upload_num++;
  126. $('div[dstype="file_msg"]').html('<i class="iconfont">&#xe64d;</i>'+'{$Think.lang.album_upload_complete_one}'+upload_num+'{$Think.lang.album_upload_complete_two}');
  127. } else {
  128. $this.find('.loading').html(param.message).removeClass('loading');
  129. }
  130. }
  131. });
  132. });
  133. $(function(){
  134. $("#img_sort").change(function(){
  135. $('#select_sort').submit();
  136. });
  137. });
  138. </script>
  139. {/block}