store_hotrank.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.ds_statstore}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <div class="fixed-empty"></div>
  13. <form method="get" name="formSearch" id="formSearch">
  14. <div class="ds-search-form">
  15. <dl>
  16. <dd>
  17. <select name="search_sclass" id="search_sclass" class="querySelect">
  18. <option value="" selected >{$Think.lang.ds_storeclass}</option>
  19. {foreach name="store_class" item="v"}
  20. <option value="{$v.storeclass_id}" {$Request.param.search_sclass == $v.storeclass_id ?'selected':''}>{$v.storeclass_name}</option>
  21. {/foreach}
  22. </select>
  23. </dd>
  24. <dd>
  25. <select name="search_type" id="search_type" class="querySelect">
  26. <option value="day" {$Request.param.search_type == 'day'?'selected':''}>{$Think.lang.search_type_day}</option>
  27. <option value="week" {$Request.param.search_type == 'week'?'selected':''}>{$Think.lang.search_type_week}</option>
  28. <option value="month" {$Request.param.search_type == 'month'?'selected':''}>{$Think.lang.search_type_month}</option>
  29. </select>
  30. </dd>
  31. <dd id="searchtype_day" style="display:none;">
  32. <input class="txt date" type="text" value="{:date('Y-m-d',$search_arr.day.search_time)}" id="search_time" name="search_time">
  33. </dd>
  34. <dd id="searchtype_week" style="display:none;">
  35. <select name="searchweek_year" class="querySelect">
  36. {foreach name="year_arr" item="v"}
  37. <option value="{$key}" {if condition="$search_arr.week.current_year eq $key"}selected{/if}>{$v}</option>
  38. {/foreach}
  39. </select>
  40. <select name="searchweek_month" class="querySelect">
  41. {foreach name="month_arr" item="v"}
  42. <option value="{$key}" {if condition="$search_arr.week.current_month eq $key"}selected{/if}>{$v}</option>
  43. {/foreach}
  44. </select>
  45. <select name="searchweek_week" class="querySelect">
  46. {foreach name="week_arr" item="v"}
  47. <option value="{$v.key}" {if condition="$search_arr.week.current_week eq $v.key"}selected{/if}>{$v.val}</option>
  48. {/foreach}
  49. </select>
  50. </dd>
  51. <dd id="searchtype_month" style="display:none;">
  52. <select name="searchmonth_year" class="querySelect">
  53. {foreach name="year_arr" item="v"}
  54. <option value="{$key}" {if condition="$search_arr.month.current_year eq $key"}selected{/if}>{$v}</option>
  55. {/foreach}
  56. </select>
  57. <select name="searchmonth_month" class="querySelect">
  58. {foreach name="month_arr" item="v"}
  59. <option value="{$key}" {if condition="$search_arr.month.current_month eq $key"}selected{/if}>{$v}</option>
  60. {/foreach}
  61. </select>
  62. </dd>
  63. </dl>
  64. <div class="btn_group">
  65. <a href="javascript:void(0);" id="dssubmit" class="btn tooltip" title="">{$Think.lang.ds_query}</a>
  66. <a href="{:url('Statstore/hotrank')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
  67. </div>
  68. <span class="right" style="margin:12px 0px 6px 4px;">
  69. </span>
  70. </div>
  71. </form>
  72. <div class="explanation" id="explanation">
  73. <div class="title" id="checkZoom">
  74. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  75. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  76. </div>
  77. <ul>
  78. <li>{$Think.lang.stat_validorder_explain}</li>
  79. <li>{$Think.lang.statstore_store_hotrank_help1}</li>
  80. <li>{$Think.lang.statstore_store_hotrank_help2}</li>
  81. </ul>
  82. </div>
  83. <div id="stat_tabs" class="w100pre close_float ui-tabs" style="min-height:500px">
  84. <div class="close_float tabmenu">
  85. <ul class="tab pngFix">
  86. <li><a href="#orderamount_div" ds_type="showdata" data-param='{"type":"orderamount"}'>{$Think.lang.statstore_orderamount}</a></li>
  87. <li><a href="#ordernum_div" ds_type="showdata" data-param='{"type":"ordernum"}'>{$Think.lang.statstore_ordernum}</a></li>
  88. </ul>
  89. </div>
  90. <!-- 下单金额 -->
  91. <div id="orderamount_div" class="close_float" style="text-align:center;"></div>
  92. <!-- 下单量 -->
  93. <div id="ordernum_div" class="close_float" style="text-align:center;"></div>
  94. </div>
  95. <script src="{$Think.PLUGINS_SITE_ROOT}/statistics.js"></script>
  96. </div>
  97. <script>
  98. //展示搜索时间框
  99. function show_searchtime(){
  100. s_type = $("#search_type").val();
  101. $("[id^='searchtype_']").hide();
  102. $("#searchtype_"+s_type).show();
  103. }
  104. $(function () {
  105. //切换登录卡
  106. $('#stat_tabs').tabs();
  107. //统计数据类型
  108. var s_type = $("#search_type").val();
  109. $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});
  110. show_searchtime();
  111. $("#search_type").change(function(){
  112. show_searchtime();
  113. });
  114. //更新周数组
  115. $("[name='searchweek_month']").change(function(){
  116. var year = $("[name='searchweek_year']").val();
  117. var month = $("[name='searchweek_month']").val();
  118. $("[name='searchweek_week']").html('');
  119. $.getJSON(ADMINSITEURL+'/Common/getweekofmonth.html',{y:year,m:month},function(data){
  120. if(data != null){
  121. for(var i = 0; i < data.length; i++) {
  122. $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
  123. }
  124. }
  125. });
  126. });
  127. $('#dssubmit').click(function(){
  128. $('#formSearch').submit();
  129. });
  130. //加载统计数据
  131. getStatdata('orderamount');
  132. $("[ds_type='showdata']").click(function(){
  133. var data_str = $(this).attr('data-param');
  134. eval('data_str = '+data_str);
  135. getStatdata(data_str.type);
  136. });
  137. });
  138. //加载统计地图
  139. function getStatdata(type){
  140. //店铺分类
  141. var search_sclass = $("#search_sclass").val();
  142. $('#'+type+'_div').load(ADMINSITEURL+'/Statstore/hotrank_list.html?type='+type+'&search_sclass='+search_sclass+'&t={$searchtime}');
  143. }
  144. </script>