人人商城

app-display.html 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. {template 'common/header'}
  2. <ul class="we7-page-tab">
  3. {loop $active_sub_permission $active_menu}
  4. {if permission_check_account_user($active_menu['permission_name'], false) && (empty($active_menu['is_display']) || is_array($active_menu['is_display']) && in_array($_W['account']['type'], $active_menu['is_display']))}
  5. <li {if $action == $active_menu['active']}class="active"{/if}><a href="{$active_menu['url']}">{$active_menu['title']}</a></li>
  6. {/if}
  7. {/loop}
  8. </ul>
  9. <div class="api" id="js-statistics-app-display" ng-controller="HorizontalBarCtrl" ng-cloak>
  10. <div class="panel we7-panel api-target" ng-if="needAccountApi">
  11. <div class="panel-heading">API余量</div>
  12. <div class="panel-body we7-padding-vertical">
  13. <div class="col-sm-4 text-center">
  14. <div class="title"><span class="">月访问总次数</span><a href="{php echo url('account/post', array('uniacid' => $_W['uniacid'], 'acid' => $_W['acid'], 'account_type' => $_W['account']['type']))}" class="pull-right color-default font-default" target="_blank">去设置</a></div>
  15. <div><span class="today">{$highest_visit}</span></div>
  16. </div>
  17. <div class="col-sm-4 text-center">
  18. <div class="title">月访问API余量</div>
  19. {php $month_remain = $highest_visit - $month_use}
  20. <div><span class="today">{php echo $month_remain > 0 ? $month_remain : 0}</span></div>
  21. </div>
  22. <div class="col-sm-4 text-center">
  23. <div class="title">API总剩余量<a href="{php echo url('home/welcome/ext', array('m' => 'store'))}" class="pull-right color-default font-default" target="_blank">去购买</a></div>
  24. <div><span class="today">{$api_remain_num}</span></div>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="panel we7-panel api-target">
  29. <div class="panel-heading">今日/昨日关键指标</div>
  30. <div class="panel-body we7-padding-vertical">
  31. <div class="col-sm-4 text-center">
  32. <div class="title">应用总访问数</div>
  33. <div>
  34. <span class="today">{$today_module_api['visit_sum']}</span>
  35. <span class="yesterday">/ {$yesterday_module_api['visit_sum']}</span>
  36. </div>
  37. </div>
  38. <div class="col-sm-4 text-center">
  39. <div class="title">应用平均访问数</div>
  40. <div>
  41. <span class="today">{$today_module_api['visit_avg']}</span>
  42. <span class="yesterday">/ {$yesterday_module_api['visit_avg']}</span>
  43. </div>
  44. </div>
  45. <div class="col-sm-4 text-center">
  46. <div class="title">应用最高访问数</div>
  47. <div>
  48. <span class="today">{$today_module_api['visit_highest']}</span>
  49. <span class="yesterday">/ {$yesterday_module_api['visit_highest']}</span>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="we7-margin-vertical color-dark font-lg" ng-if="needAccountApi">{$_W['account']['type_name']}API访问统计</div>
  55. <div class="panel we7-panel" ng-if="needAccountApi">
  56. <div class="panel-heading tab">
  57. <a href="javascript:;">关键指标详解</a>
  58. <a href="javascript:;" ng-class="{'active': accountDivideType == 'bysum'}" ng-click="changeDivideType('account', 'bysum')">{$_W['account']['type_name']}总访问数</a>
  59. <a href="javascript:;" ng-class="{'active': accountDivideType == 'byavg'}" ng-click="changeDivideType('account', 'byavg')">{$_W['account']['type_name']}平均访问数</a>
  60. <a href="javascript:;" ng-class="{'active': accountDivideType == 'byhighest'}" ng-click="changeDivideType('account', 'byhighest')">{$_W['account']['type_name']}最高访问数</a>
  61. </div>
  62. <div class="panel-body data-view">
  63. <div class="tab-bar-time clearfrix">
  64. <span class="we7-margin-right">时间</span>
  65. <div class="btn-group" role="group">
  66. <button type="button" class="btn btn-default" ng-class="{'active': accountTimeType == 'today'}" ng-click="getModuleApi('account', 'today')">今日统计</button>
  67. <button type="button" class="btn btn-default" ng-class="{'active': accountTimeType == 'week'}" ng-click="getModuleApi('account', 'week')">周统计</button>
  68. <button type="button" class="btn btn-default" ng-class="{'active': accountTimeType == 'month'}" ng-click="getModuleApi('account', 'month')">月统计</button>
  69. <div class="btn-group" role="group">
  70. <button class="btn btn-default daterange daterange-date" we7-date-range-picker ng-model="accountDateRange"><span>{{accountDateRange.startDate}} </span>至<span> {{accountDateRange.endDate}}</span> <i class="fa fa-calendar"></i></button>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="col-sm-12" id="chart-line" style="height:500px"></div>
  75. </div>
  76. </div>
  77. <div class="we7-margin-vertical color-dark font-lg">应用模块API统计</div>
  78. <div class="panel we7-panel">
  79. <div class="panel-heading tab">
  80. <a href="javascript:;">关键指标详解</a>
  81. <a href="javascript:;" ng-class="{'active': moduleDivideType == 'bysum'}" ng-click="changeDivideType('module', 'bysum')">总访问数</a>
  82. <a href="javascript:;" ng-class="{'active': moduleDivideType == 'byavg'}" ng-click="changeDivideType('module', 'byavg')">平均访问数</a>
  83. <a href="javascript:;" ng-class="{'active': moduleDivideType == 'byhighest'}" ng-click="changeDivideType('module', 'byhighest')">最高访问数</a>
  84. </div>
  85. <div class="panel-body data-view">
  86. <div class="tab-bar-time clearfrix">
  87. <span class="we7-margin-right">时间</span>
  88. <div class="btn-group" role="group">
  89. <button type="button" class="btn btn-default" ng-class="{'active': moduleTimeType == 'today'}" ng-click="getModuleApi('module', 'today')">今日统计</button>
  90. <button type="button" class="btn btn-default" ng-class="{'active': moduleTimeType == 'week'}" ng-click="getModuleApi('module', 'week')">周统计</button>
  91. <button type="button" class="btn btn-default" ng-class="{'active': moduleTimeType == 'month'}" ng-click="getModuleApi('module', 'month')">月统计</button>
  92. <div class="btn-group" role="group">
  93. <button class="btn btn-default daterange daterange-date" we7-date-range-picker ng-model="moduleDateRange"><span>{{moduleDateRange.startDate}} </span>至<span> {{moduleDateRange.endDate}}</span> <i class="fa fa-calendar"></i></button>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="col-sm-12">
  98. <div id="chart-horizontal-bar" style="height:1000px"></div>
  99. </div>
  100. <div class="col-sm-12">
  101. {if user_is_founder($_W['uid']) && !user_is_vice_founder()}
  102. <div class="we7-margin-vertical text-right">
  103. <a href="javascript:;" class="color-default" ng-click="changeStatus()">
  104. 解决访问统计没数据的方法 <span class="wi wi-angle-up"></span>
  105. </a>
  106. </div>
  107. <div class="distribution-steps" ng-show = "show==true">
  108. <div class="steps-container">
  109. <div>
  110. <div class="num">1</div>
  111. <div class="title">
  112. <span class="wi wi-warning-sign"></span>应用没有统计数据
  113. </div>
  114. <div class="content">
  115. 没有应用的统计数据,是因为模块内没有统计数据的代码,需要复制第2步的代码到对应的模块内。然后联系应用模块开发者更新提交代码,完成后即可生成统计数据。
  116. </div>
  117. </div>
  118. <div>
  119. <div class="num">2</div>
  120. <div class="title">
  121. <span class="wi wi-code"></span>复制代码
  122. </div>
  123. <div class="content">
  124. <textarea class="form-control code-container we7-margin-bottom-sm" ng-model="code">
  125. </textarea>
  126. <div><a href="javascript:;" id="copy-1" class="btn btn-primary" clipboard supported="supported" text="code"
  127. on-copied="success(1);">复制代码</a></div>
  128. </div>
  129. </div>
  130. <div>
  131. <div class="num">3</div>
  132. <div class="title">
  133. <span class="wi wi-help"></span>联系开发者
  134. </div>
  135. <div class="content">
  136. 找到没有统计数据的应用,联系<span class="color-default">应用模块的开发者</span>,让开发者将代码更新提交后,则可生成模块的统计数据。
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. {/if}
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. <script>
  147. require(['daterangepicker'], function() {
  148. angular.module('statisticsApp').value('config', {
  149. 'frame': "{FRAME}",
  150. 'links': {
  151. 'accountApi': "{php echo url('statistics/app/get_account_api')}",
  152. 'moduleApi': "{php echo url('statistics/app/get_module_api')}",
  153. },
  154. });
  155. angular.bootstrap($('#js-statistics-app-display'), ['statisticsApp']);
  156. })
  157. </script>
  158. {template 'common/footer'}