marketing_promotion.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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_statmarketing}</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_type" id="search_type" class="querySelect">
  18. <option value="day" {if isset($search_arr.search_type) && $search_arr.search_type == 'day'}selected{/if}>{$Think.lang.search_type_day}</option>
  19. <option value="week" {if isset($search_arr.search_type) && $search_arr.search_type == 'week'}selected{/if}>{$Think.lang.search_type_week}</option>
  20. <option value="month" {if isset($search_arr.search_type) && $search_arr.search_type == 'month'}selected{/if}>{$Think.lang.search_type_month}</option>
  21. </select>
  22. </dd>
  23. <dd id="searchtype_day" style="display:none;">
  24. <input class="txt date" type="text" value="{:date('Y-m-d',$search_arr.day.search_time)}" id="search_time" name="search_time">
  25. </dd>
  26. <dd id="searchtype_week" style="display:none;">
  27. <select name="searchweek_year" class="querySelect">
  28. {foreach name="year_arr" item="v"}
  29. <option value="{$key}" {$search_arr.week.current_year == $key ?'selected':''}>{$v}</option>
  30. {/foreach}
  31. </select>
  32. <select name="searchweek_month" class="querySelect">
  33. {foreach name="month_arr" item="v"}
  34. <option value="{$key}" {$search_arr.week.current_month == $key ?'selected':''}>{$v}</option>
  35. {/foreach}
  36. </select>
  37. <select name="searchweek_week" class="querySelect">
  38. {foreach name="week_arr" item="v"}
  39. <option value="{$v.key}" {$search_arr.week.current_week == $v.key ? 'selected':''}>{$v.val}</option>
  40. {/foreach}
  41. </select>
  42. </dd>
  43. <dd id="searchtype_month" style="display:none;">
  44. <select name="searchmonth_year" class="querySelect">
  45. {foreach name="year_arr" item="v"}
  46. <option value="{$key}" {$search_arr.month.current_year == $key ? 'selected':''}>{$v}</option>
  47. {/foreach}
  48. </select>
  49. <select name="searchmonth_month" class="querySelect">
  50. {foreach name="month_arr" item="v"}
  51. <option value="{$key}" {$search_arr.month.current_month == $key ?'selected':''}>{$v}</option>
  52. {/foreach}
  53. </select>
  54. </dd>
  55. </dl>
  56. <div class="btn_group">
  57. <a href="javascript:void(0);" id="dssubmit" class="btn tooltip" >{$Think.lang.ds_query}</a>
  58. <a href="{:url('Statmarketing/promotion')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
  59. </div>
  60. </div>
  61. </form>
  62. <div class="explanation" id="explanation">
  63. <div class="title" id="checkZoom">
  64. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  65. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  66. </div>
  67. <ul>
  68. <li>{$Think.lang.stat_validorder_explain}</li>
  69. <li>{$Think.lang.statmarking_promotion_help1}</li>
  70. <li>{$Think.lang.statmarking_promotion_help2}</li>
  71. <li>{$Think.lang.statmarking_promotion_help3}</li>
  72. </ul>
  73. </div>
  74. <div class="stat-info">
  75. <span>{$Think.lang.statstore_ordernum}:
  76. <strong>{:intval($statcount.ordernum)}</strong>
  77. </span>
  78. <span>{$Think.lang.goodsnum}:
  79. <strong>{:intval($statcount.goodsnum)}</strong>
  80. </span>
  81. <span>{$Think.lang.statstore_orderamount}:
  82. <strong>{:ds_price_format($statcount.orderamount)}</strong>
  83. {$Think.lang.ds_yuan} </span>
  84. </div>
  85. <div id="stat_tabs" class="w100pre close_float ui-tabs">
  86. <div class="close_float tabmenu">
  87. <ul class="tab pngFix">
  88. <li><a href="#ordernum_div" ds_type="showlinelabels" data-param='{"type":"ordernum"}'>{$Think.lang.statstore_ordernum}</a></li>
  89. <li><a href="#goodsnum_div" ds_type="showlinelabels" data-param='{"type":"goodsnum"}'>{$Think.lang.goodsnum}</a></li>
  90. <li><a href="#orderamount_div" ds_type="showlinelabels" data-param='{"type":"orderamount"}'>{$Think.lang.statstore_orderamount}</a></li>
  91. </ul>
  92. </div>
  93. <!-- 下单量 -->
  94. <div id="ordernum_div" class="close_float"></div>
  95. <!-- 下单商品件数 -->
  96. <div id="goodsnum_div"></div>
  97. <!-- 下单金额 -->
  98. <div id="orderamount_div"></div>
  99. </div>
  100. <!-- pie stat start -->
  101. <div class="w100pre close_float" style="max-height:400px">
  102. <div id="statpie_ordernum" class="w18pre" style="float:left; padding-left:50px;"></div>
  103. <div id="statpie_goodsnum" class="w18pre" style="float:left; padding-left:50px;"></div>
  104. <div id="statpie_orderamount" class="w18pre" style="float:left; padding-left:50px;"></div>
  105. </div>
  106. <!-- pie stat end -->
  107. <!-- stat list start -->
  108. <table class="ds-default-table">
  109. <thead>
  110. <tr class="thead">
  111. <th>{$Think.lang.promotion_type}</th>
  112. <th class="align-center">{$Think.lang.statstore_ordernum}</th>
  113. <th class="align-center">{$Think.lang.goodsnum}</th>
  114. <th class="align-center">{$Think.lang.statstore_orderamount}({$Think.lang.ds_yuan})</th>
  115. </tr>
  116. <tbody id="datatable">
  117. {notempty name="statlist"}
  118. {foreach name="statlist" item="v"}
  119. <tr class="hover member">
  120. <td>{$v.goodstype_text}</td>
  121. <td class="align-center">{$v.ordernum}</td>
  122. <td class="align-center">{$v.goodsnum}</td>
  123. <td class="align-center">{$v.orderamount}</td>
  124. </tr>
  125. {/foreach}
  126. {else /}
  127. <tr class="no_data">
  128. <td colspan="11">{$Think.lang.no_record}</td>
  129. </tr>
  130. {/notempty}
  131. </tbody>
  132. </table>
  133. </div>
  134. <script src="{$Think.PLUGINS_SITE_ROOT}/highcharts/highcharts.js"></script>
  135. <script src="{$Think.PLUGINS_SITE_ROOT}/statistics.js"></script>
  136. <script>
  137. //切换登录卡
  138. $(function() {
  139. $('#stat_tabs').tabs();
  140. });
  141. //展示搜索时间框
  142. function show_searchtime(){
  143. s_type = $("#search_type").val();
  144. $("[id^='searchtype_']").hide();
  145. $("#searchtype_"+s_type).show();
  146. }
  147. $(function () {
  148. //统计数据类型
  149. var s_type = $("#search_type").val();
  150. $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});
  151. show_searchtime();
  152. $("#search_type").change(function(){
  153. show_searchtime();
  154. });
  155. //更新周数组
  156. $("[name='searchweek_month']").change(function(){
  157. var year = $("[name='searchweek_year']").val();
  158. var month = $("[name='searchweek_month']").val();
  159. $("[name='searchweek_week']").html('');
  160. $.getJSON(ADMINSITEURL+'/Common/getweekofmonth',{y:year,m:month},function(data){
  161. if(data != null){
  162. for(var i = 0; i < data.length; i++) {
  163. $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
  164. }
  165. }
  166. });
  167. });
  168. //linelabels
  169. getLineLabels('ordernum');
  170. $("[ds_type='showlinelabels']").click(function(){
  171. var data_str = $(this).attr('data-param');
  172. eval('data_str = '+data_str);
  173. getLineLabels(data_str.type);
  174. });
  175. $('#dssubmit').click(function(){
  176. $('#formSearch').submit();
  177. });
  178. //pie
  179. $('#statpie_ordernum').highcharts({$stat_json.ordernum});
  180. $('#statpie_goodsnum').highcharts({$stat_json.goodsnum});
  181. $('#statpie_orderamount').highcharts({$stat_json.orderamount});
  182. });
  183. //load linelabels
  184. function getLineLabels(stattype){
  185. var search_type = $("#search_type").val();
  186. if(!$("#"+stattype+'_div').html()){
  187. $("#"+stattype+'_div').load(ADMINSITEURL+'/Statmarketing/promotiontrend?search_type='+search_type+'&stattype='+stattype+'&t={$searchtime}');
  188. }
  189. }
  190. </script>