人人商城

welcome-platform.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <div class="page-header">
  2. <h4><i class="fa fa-comments"></i> 公众号信息</h4>
  3. </div>
  4. <div class="account">
  5. {loop $accounts $account}
  6. <div class="panel panel-default row">
  7. <div class="panel-body">
  8. <div class="clearfix">
  9. <div class="col-sm-7">
  10. <p>
  11. <strong>{$account['name']}</strong>
  12. <span class="label label-success" style="display:inline-block; margin-right:10px;">
  13. {if $account['level'] == 1}订阅号{/if}
  14. {if $account['level'] == 2}普通服务号{/if}
  15. {if $account['level'] == 3}认证订阅号{/if}
  16. {if $account['level'] == 4}认证服务号/认证媒体/政府订阅号{/if}
  17. </span>
  18. {if $account['type'] == ACCOUNT_OAUTH_LOGIN}
  19. <span class="text-success"><i class="fa fa-check-circle"></i> 登录授权</span>
  20. {else}
  21. {if $account['isconnect'] == 1}
  22. <span class="text-success"><i class="fa fa-check-circle"></i> 成功接入{$accounttypes[$account['type']]['title']}</span>
  23. {else}
  24. <span class="text-warning"><i class="fa fa-times-circle"></i> 未接入{$accounttypes[$account['type']]['title']}</span>
  25. {/if}
  26. {/if}
  27. </p>
  28. {if $account['type'] == ACCOUNT_NORMAL_LOGIN}
  29. <p><strong>接口地址: </strong> <a href="javascript:;" style="color:#66667C;">{$_W['siteroot']}api.php?id={$account['acid']}</a></p>
  30. <p><strong> Token: </strong> <a href="javascript:;" title="点击复制Token" style="color:#66667C;">{$account['token']}</a></p>
  31. {/if}
  32. </div>
  33. <div class="col-sm-5 text-right">
  34. <img src="{php echo tomedia('qrcode_'.$account['acid'].'.jpg')}?time={php echo time()}" class="img-responsive img-thumbnail" width="150" onerror="this.src='resource/images/gw-wx.gif'" />
  35. <img src="{php echo tomedia('headimg_'.$account['acid'].'.jpg')}?time={php echo time()}" class="img-responsive img-thumbnail" width="150" onerror="this.src='resource/images/gw-wx.gif'"/>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. {/loop}
  41. </div>
  42. <script>
  43. $('.account p a').each(function(){
  44. util.clip(this, $(this).text());
  45. });
  46. </script>
  47. {if $_W['acid'] == $_W['uniaccount']['default_acid']}
  48. <div class="panel panel-default" id="scroll">
  49. <div class="panel-heading">
  50. 今日关键指标
  51. </div>
  52. <div class="account-stat">
  53. <div class="account-stat-btn">
  54. <div>今日新关注<span>{$today_add_num}</span></div>
  55. <div>今日取消关注<span>{$today_cancel_num}</span></div>
  56. <div>今日净增关注<span>{$today_jing_num}</span></div>
  57. <div>累积关注<span>{$today_total_num}</span></div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="panel panel-default">
  62. <div class="panel-heading">
  63. 昨日关键指标
  64. </div>
  65. <div class="account-stat">
  66. <div class="account-stat-btn">
  67. <div>昨日新关注<span>{$yesterday_stat['new']}</span></div>
  68. <div>昨日取消关注<span>{$yesterday_stat['cancel']}</span></div>
  69. <div>昨日净增关注<span>{php echo intval($yesterday_stat['new']) - intval($yesterday_stat['cancel'])}</span></div>
  70. <div>累积关注<span>{$yesterday_stat['cumulate']}</span></div>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="panel panel-default">
  75. <div class="panel-heading">
  76. 关键指标详解
  77. <a class="text-danger" href="{php echo url('account/summary/', array('acid' => $_W['acid'], 'uniacid' => $_W['uniacid']));}" target="_blank">查看更多</a>
  78. </div>
  79. <div class="panel-body">
  80. <div class="pull-right">
  81. <div class="checkbox">
  82. <label style="color:#57B9E6;"><input checked type="checkbox"> 新关注人数</label>&nbsp;
  83. <label style="color:rgba(203,48,48,1)"><input checked type="checkbox"> 取消关注人数</label>&nbsp;
  84. <label style="color:rgba(149,192,0,1);;"><input checked type="checkbox"> 净增人数</label>&nbsp;
  85. <label style="color:#e7a017;"><input type="checkbox"> 累积关注人数</label>
  86. </div>
  87. </div>
  88. <div style="margin-top:20px">
  89. <canvas id="myChart1" width="1200" height="300"></canvas>
  90. </div>
  91. </div>
  92. </div>
  93. <script>
  94. require(['chart', 'daterangepicker'], function(c) {
  95. var chart = null;
  96. var chartDatasets = null;
  97. var templates = {
  98. flow1: {
  99. label: '新关注人数',
  100. fillColor : "rgba(36,165,222,0.1)",
  101. strokeColor : "rgba(36,165,222,1)",
  102. pointColor : "rgba(36,165,222,1)",
  103. pointStrokeColor : "#fff",
  104. pointHighlightFill : "#fff",
  105. pointHighlightStroke : "rgba(36,165,222,1)",
  106. },
  107. flow2: {
  108. label: '取消关注人数',
  109. fillColor : "rgba(203,48,48,0.1)",
  110. strokeColor : "rgba(203,48,48,1)",
  111. pointColor : "rgba(203,48,48,1)",
  112. pointStrokeColor : "#fff",
  113. pointHighlightFill : "#fff",
  114. pointHighlightStroke : "rgba(203,48,48,1)",
  115. },
  116. flow3: {
  117. label: '净增人数',
  118. fillColor : "rgba(149,192,0,0.1)",
  119. strokeColor : "rgba(149,192,0,1)",
  120. pointColor : "rgba(149,192,0,1)",
  121. pointStrokeColor : "#fff",
  122. pointHighlightFill : "#fff",
  123. pointHighlightStroke : "rgba(149,192,0,1)",
  124. },
  125. flow4: {
  126. label: '累计人数',
  127. fillColor : "rgba(231,160,23,0.1)",
  128. strokeColor : "rgba(231,160,23,1)",
  129. pointColor : "rgba(231,160,23,1)",
  130. pointStrokeColor : "#fff",
  131. pointHighlightFill : "#fff",
  132. pointHighlightStroke : "rgba(231,160,23,1)"
  133. }
  134. };
  135. function refreshData() {
  136. if(!chart || !chartDatasets) {
  137. return;
  138. }
  139. var visables = [];
  140. var i = 0;
  141. $('.checkbox input[type="checkbox"]').each(function(){
  142. if($(this).attr('checked')) {
  143. visables.push(i);
  144. }
  145. i++;
  146. });
  147. var ds = [];
  148. $.each(visables, function(){
  149. var o = chartDatasets[this];
  150. ds.push(o);
  151. });
  152. chart.datasets = ds;
  153. chart.update();
  154. }
  155. var url = './index.php?c=account&a=summary&acid={$_W['acid']}&uniacid={$_W['uniacid']}&#aaaa';
  156. $.post(url, function(data){
  157. var data = $.parseJSON(data)
  158. var datasets = data.datasets;
  159. if(!chart) {
  160. var label = data.label;
  161. var ds = $.extend(true, {}, templates);
  162. ds.flow1.data = datasets.new;
  163. ds.flow2.data = datasets.cancel;
  164. ds.flow3.data = datasets.increase;
  165. ds.flow4.data = datasets.cumulate;
  166. var lineChartData = {
  167. labels : label,
  168. datasets : [ds.flow1, ds.flow2, ds.flow3, ds.flow4]
  169. };
  170. var ctx = document.getElementById("myChart1").getContext("2d");
  171. chart = new Chart(ctx).Line(lineChartData, {
  172. responsive: true
  173. });
  174. chartDatasets = $.extend(true, {}, chart.datasets);
  175. }
  176. refreshData();
  177. });
  178. $('.checkbox input[type="checkbox"]').on('click', function(){
  179. $(this).attr('checked', !$(this).attr('checked'))
  180. refreshData();
  181. });
  182. });
  183. </script>
  184. {/if}
  185. <style>
  186. .account-stat{overflow:hidden; color:#666;}
  187. .account-stat .account-stat-btn{width:100%; overflow:hidden;}
  188. .account-stat .account-stat-btn > div{text-align:center; margin-bottom:5px;margin-right:2%; float:left;width:23%; height:80px; padding-top:10px;font-size:16px; border-left:1px #DDD solid;}
  189. .account-stat .account-stat-btn > div:first-child{border-left:0;}
  190. .account-stat .account-stat-btn > div span{display:block; font-size:30px; font-weight:bold}
  191. </style>
  192. <div class="page-header">
  193. <h4><i class="fa fa-android"></i> 基本回复统计情况</h4>
  194. </div>
  195. <div class="panel panel-default" style="padding:1em;">
  196. <nav role="navigation" class="navbar navbar-default navbar-static-top" id="clear" style="margin: -1em -1em 1em -1em;">
  197. <div class="container-fluid">
  198. <div class="navbar-header">
  199. <a href="javascript:;" class="navbar-brand">模块命中次数趋势图</a>
  200. </div>
  201. <ul class="nav navbar-nav nav-btns">
  202. <li class="active" id="basic"><a href="javascript:;">文字回复</a></li>
  203. <li id="news"><a href="javascript:;">图文回复</a></li>
  204. <li id="music"><a href="javascript:;">音乐回复</a></li>
  205. <li id="images"><a href="javascript:;">图片回复</a></li>
  206. <li id="voice"><a href="javascript:;">语音回复</a></li>
  207. <li id="video"><a href="javascript:;">视频回复</a></li>
  208. <li id="userapi"><a href="javascript:;">自定义接口回复</a></li>
  209. <li class="dropdown">
  210. <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">其他模块 <span class="caret"></span></a>
  211. <ul class="dropdown-menu" role="menu">
  212. {loop $modules_other $other}
  213. {if $modules[$other]['isrulefields']}
  214. <li id="{$modules[$other]['name']}"><a href="javascript:;">{$modules[$other]['title']}</a></li>
  215. {/if}
  216. {/loop}
  217. </ul>
  218. </li>
  219. </ul>
  220. </div>
  221. </nav>
  222. <div class="account-stat">
  223. <div class="account-stat-btn">
  224. <div>总回复规则数<span id="rule"></span></div>
  225. <div>今日命中次数<span id="today"></span></div>
  226. <div>本月命中次数<span id="month"></span></div>
  227. <div>
  228. <a href="" id="show" style="display:block; margin:5px 0;"><i class="fa fa-search"></i> 查看回复规则</a>
  229. <a href="" id="add" style="display:block;"><i class="fa fa-plus"></i> 新增回复规则</a>
  230. </div>
  231. </div>
  232. </div>
  233. <div style="margin-top:20px;">
  234. <canvas id="myChart" height="80"></canvas>
  235. </div>
  236. </div>
  237. <script>
  238. require(['chart'], function(c) {
  239. $('.dropdown').click(function(){
  240. $('.nav.nav-btns>li').removeClass('active');
  241. $(this).toggleClass('active');
  242. });
  243. var myLine = new Chart(document.getElementById("myChart").getContext("2d"));
  244. var datasets = '';
  245. var label = '';
  246. var lineChartData = null;
  247. var obj = null;
  248. var day_num = "{php echo $day_num;}";
  249. var show_url = "{php echo url('platform/reply/display')}m=";
  250. var add_url = "{php echo url('platform/reply/post')}m=";
  251. var data = null;
  252. var replystatistics_url = "{php echo url('home/welcome/replystatistics')}";
  253. $.post(replystatistics_url, {'m_name' : 'basic'}, function(data){
  254. data = $.parseJSON(data);
  255. $("#rule").html(data.stat.rule);
  256. $("#today").html(data.stat.today);
  257. $("#month").html(data.stat.month);
  258. $('#show').attr('href', show_url + data.stat.m_name);
  259. $('#add').attr('href', add_url + data.stat.m_name);
  260. lineChartData = {
  261. labels : data.key,
  262. datasets : [
  263. {
  264. fillColor : "rgba(36,165,222,0.1)",
  265. strokeColor : "rgba(36,165,222,1)",
  266. pointColor : "rgba(36,165,222,1)",
  267. pointStrokeColor : "#fff",
  268. pointHighlightFill : "#fff",
  269. pointHighlightStroke : "rgba(36,165,222,1)",
  270. data : data.value
  271. }
  272. ]
  273. }
  274. obj = myLine.Line(lineChartData, {responsive: true});
  275. });
  276. $('.nav.nav-btns li[class!="dropdown"]').on('click', function(){
  277. $('.nav.nav-btns li').removeClass('active');
  278. $(this).toggleClass('active');
  279. var m_name = $(this).attr('id');
  280. $.post(replystatistics_url, {'m_name' : m_name}, function(data){
  281. data = $.parseJSON(data);
  282. $("#rule").html(data.stat.rule);
  283. $("#today").html(data.stat.today);
  284. $("#month").html(data.stat.month);
  285. $('#show').attr('href', show_url + data.stat.m_name);
  286. $('#add').attr('href', add_url + data.stat.m_name);
  287. lineChartData = {
  288. labels : data.key,
  289. datasets : [
  290. {
  291. fillColor : "rgba(36,165,222,0.1)",
  292. strokeColor : "rgba(36,165,222,1)",
  293. pointColor : "rgba(36,165,222,1)",
  294. pointStrokeColor : "#fff",
  295. pointHighlightFill : "#fff",
  296. pointHighlightStroke : "rgba(36,165,222,1)",
  297. data : data.value
  298. }
  299. ]
  300. }
  301. obj = myLine.Line(lineChartData, {responsive: true});
  302. });
  303. });
  304. });
  305. </script>
  306. <div class="page-header">
  307. <h4><i class="fa fa-cogs"></i> 高级功能统计情况</h4>
  308. </div>
  309. <div class="panel panel-default">
  310. <div class="panel-body table-responsive">
  311. <table class="table">
  312. <thead>
  313. <tr>
  314. <th style="width:200px;">功能类别</th>
  315. <th>概况</th>
  316. </tr>
  317. </thead>
  318. <tbody>
  319. <tr>
  320. <td>常用服务</td>
  321. <td>
  322. <p>已启用:
  323. {loop $apis $row}
  324. {if $row['switch']}
  325. <span class="label label-info">{$row['title']}</span>
  326. {/if}
  327. {/loop}
  328. </p>
  329. <p>未启用:
  330. {loop $apis $row}
  331. {if empty($row['switch'])}
  332. <span class="label label-warning">{$row['title']}</span>
  333. {/if}
  334. {/loop}
  335. </p>
  336. </td>
  337. </tr>
  338. <tr>
  339. <td>自定义菜单</td>
  340. <td>
  341. <p>已启用:
  342. {loop $accounts $acc}
  343. {if $acc['level'] > 1}
  344. <span class="label label-info">{$acc['name']}</span>&nbsp;
  345. {/if}
  346. {/loop}
  347. </p>
  348. <p>未启用:
  349. {loop $accounts $acc}
  350. {if $acc['level'] < 2}
  351. <span class="label label-warning">{$acc['name']}&nbsp;(权限不足)</span>&nbsp;
  352. {/if}
  353. {/loop}
  354. </p>
  355. </td>
  356. </tr>
  357. <tr>
  358. <td>特殊回复</td>
  359. <td>
  360. {loop $ds $row}
  361. {if !empty($row['current'])}
  362. <p>
  363. {$row['title']}:
  364. <span class="label label-info">
  365. {loop $row['handles'] $item}
  366. {if $row['current'] == $item['name']}{$item['title']}{/if}
  367. {/loop}
  368. </span>&nbsp;
  369. </p>
  370. {/if}
  371. {/loop}
  372. </td>
  373. </tr>
  374. <tr>
  375. <td>二维码</td>
  376. <td>
  377. {loop $accounts $acc}
  378. {if $acc['level'] == 4}
  379. <p>{$acc['name']}:
  380. <span class="label label-info">临时({php echo intval($acc['qr1num']);}个)</span>&nbsp;
  381. <span class="label label-info">永久({php echo intval($acc['qr2num']);}个)</span>
  382. </p>
  383. {/if}
  384. {/loop}
  385. <p>总计:
  386. <span class="label label-info">临时({php echo intval($tyqr['qr1num']);}个)</span>&nbsp;
  387. <span class="label label-info">永久({php echo intval($tyqr['qr2num']);}个)</span>
  388. </p>
  389. </td>
  390. </tr>
  391. </tbody>
  392. </table>
  393. </div>
  394. </div>