人人商城

index.html 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. {template '_header'}
  2. <div class="page-header">当前位置:<span class="text-primary">首页</span></div>
  3. <style>
  4. .tab-content>.tab-pane {margin-top: 10px;}
  5. .tab-content>.tab-pane>.fui-list-group {border-bottom: 0;}
  6. </style>
  7. <div class="page-content transparent">
  8. <div class="row">
  9. <div class="col-md-4">
  10. <div class="ibox h300">
  11. <div class="ibox-title">
  12. <h5><i class="icow icow-shop"></i>商城信息</h5>
  13. {ifp 'sysset.shop.edit'}
  14. <ul >
  15. <a href="{php echo webUrl('sysset/shop')}" class="text-primary">修改</a>
  16. </ul>
  17. {/if}
  18. </div>
  19. <div class="ibox-content">
  20. <ul class="fui-cell-group">
  21. <li class="fui-cell">商城名称:<span class="text">{$shop_data['name']}</span></li>
  22. <li class="fui-cell">商城介绍:<span class="text">{$shop_data['description']}</span></li>
  23. <li class="fui-cell">使用应用:<span class='text-no'>{$pluginnum}</span>个 <a href="{php echo webUrl('plugins')}" class="text-primary">查看</a></li>
  24. </ul>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="col-md-8">
  29. <div class="ibox h300">
  30. <div class="ibox-content no-border">
  31. <ul class="fui-list-group">
  32. {ifp 'goods'}
  33. <li class="fui-list">
  34. <a href="{php echo webUrl('goods',array('goodsfrom'=>'out'))}">
  35. <div class="fui-list-media">
  36. <span class="icow text-info icow-goodsL"></span>
  37. </div>
  38. <div class="fui-list-inner">
  39. <h5 class="goods_totals">-</h5>
  40. <p>已售罄商品</p>
  41. </div>
  42. </a>
  43. </li>
  44. {/if}
  45. {ifp 'order.list.status1'}
  46. <li class="fui-list">
  47. <a href="{php echo webUrl('order/list/status1')}">
  48. <div class="fui-list-media">
  49. <span class="icow text-green icow-fahuo"></span>
  50. </div>
  51. <div class="fui-list-inner">
  52. <h5 class="order_status1">-</h5>
  53. <p>{if $is_openmerch==1}自营{/if}待发货订单</p>
  54. </div>
  55. </a>
  56. </li>
  57. {/if}
  58. {ifp 'order.list.status4'}
  59. <li class="fui-list">
  60. <a href="{php echo webUrl('order/list/status4')}">
  61. <div class="fui-list-media">
  62. <span class="icow text-primary icow-tuihuo"></span>
  63. </div>
  64. <div class="fui-list-inner">
  65. <h5 class="order_status4">-</h5>
  66. <p>{if $is_openmerch==1}自营{/if}维权中订单</p>
  67. </div>
  68. </a>
  69. </li>
  70. {/if}
  71. {ifp 'finance.log.withdraw'}
  72. <li class="fui-list">
  73. <a href="{php echo webUrl('finance/log/withdraw',array('status'=>0))}">
  74. <div class="fui-list-media">
  75. <span class="icow text-warning icow-shenhe"></span>
  76. </div>
  77. <div class="fui-list-inner">
  78. <h5 class="finance_total">-</h5>
  79. <p>待审核提现</p>
  80. </div>
  81. </a>
  82. </li>
  83. {/if}
  84. </ul>
  85. {if $hascommission}
  86. <ul class="fui-list-group noborder">
  87. {ifp 'commission.agent'}
  88. <li class="fui-list">
  89. <a href="{php echo webUrl('commission/agent')}">
  90. <div class="fui-list-media">
  91. <span class="icow text-primary icow-vip"></span>
  92. </div>
  93. <div class="fui-list-inner">
  94. <h5 class="commission_agent_total">-</h5>
  95. <p>分销总数</p>
  96. </div>
  97. </a>
  98. </li>
  99. <li class="fui-list">
  100. <a href="{php echo webUrl('commission/agent')}">
  101. <div class="fui-list-media">
  102. <span class="icow text-warning icow-huiyuan2"></span>
  103. </div>
  104. <div class="fui-list-inner">
  105. <h5 class="commission_agent_status0_total">-</h5>
  106. <p>待审核分销商</p>
  107. </div>
  108. </a>
  109. </li>
  110. {/if}
  111. {ifp 'commission.apply.view1'}
  112. <li class="fui-list">
  113. <a href="{php echo webUrl('commission/apply',array('status'=>1))}">
  114. <div class="fui-list-media">
  115. <span class="icow text-green icow-yongjinmingxi"></span>
  116. </div>
  117. <div class="fui-list-inner">
  118. <h5 class="commission_apply_status1_total">-</h5>
  119. <p>待审核佣金申请</p>
  120. </div>
  121. </a>
  122. </li>
  123. {/if}
  124. {ifp 'commission.apply.view2'}
  125. <li class="fui-list">
  126. <a href="{php echo webUrl('commission/apply',array('status'=>2))}">
  127. <div class="fui-list-media">
  128. <span class="icow text-info icow-tixian1"></span>
  129. </div>
  130. <div class="fui-list-inner">
  131. <h5 class="commission_apply_status2_total">-</h5>
  132. <p>待打款佣金申请</p>
  133. </div>
  134. </a>
  135. </li>
  136. {/if}
  137. </ul>
  138. {/if}
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. {ifp 'order'}
  144. {if $ordercol}
  145. <div class="row">
  146. <div class="col-md-{$ordercol}">
  147. <div class="ibox" style="position: relative;">
  148. <div class="ibox-title">
  149. <h5><i class="icow">&#xe622;</i>订单概述</h5>
  150. <ul class="nav nav-tabs" id="orderinfo">
  151. <li class="active"><a data-toggle="tab" href="#order_count_0" onclick="get_order(0)">今日</a></li>
  152. <li><a data-toggle="tab" href="#order_count_1" onclick="get_order(1)">昨日</a></li>
  153. <li><a data-toggle="tab" href="#order_count_7" onclick="get_order(7)">最近七日</a></li>
  154. <li><a data-toggle="tab" href="#order_count_30" onclick="get_order(30)">本月</a></li>
  155. </ul>
  156. </div>
  157. <div class="ibox-content">
  158. <div class="tab-content" style="height: auto;">
  159. <div class="tab-pane active" id="order_count_0">
  160. <div class="fui-list-group">
  161. <div class="fui-list no-padding">
  162. <div class="fui-list-inner">
  163. <h4 class="text-warning order_count_0 _popover-tips" data-content="成交量:已付款订单数<br>交易量:下单总数(含未付款订单)">-</h4>
  164. 成交量/交易量(件)
  165. </div>
  166. </div>
  167. <div class="fui-list no-padding">
  168. <div class="fui-list-inner">
  169. <h4 class="text-warning order_price_0 _popover-tips" data-content="成交额:已付款订单金额(含运费)<br>交易额:下单总额(含运费)">-</h4>
  170. 成交额/交易额(元)
  171. </div>
  172. </div>
  173. <div class="fui-list no-padding">
  174. <div class="fui-list-inner">
  175. <h4 class="text-warning order_avg_0 _popover-tips" data-content="成交额/下单去重会员数(含维权订单)">-</h4>
  176. 人均消费(元)
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. <div class="tab-pane" id="order_count_1">
  182. <div class="fui-list-group">
  183. <div class="fui-list no-padding">
  184. <div class="fui-list-inner">
  185. <h4 class="text-warning order_count_1 _popover-tips" data-content="成交量:已付款订单数<br>交易量:下单总数(含未付款订单)">-</h4>
  186. 成交量/交易量(件)
  187. </div>
  188. </div>
  189. <div class="fui-list no-padding">
  190. <div class="fui-list-inner">
  191. <h4 class="text-warning order_price_1 _popover-tips" data-content="成交额:已付款订单金额(含运费)<br>交易额:下单总额(含运费)">-</h4>
  192. 成交额/交易额(元)
  193. </div>
  194. </div>
  195. <div class="fui-list no-padding">
  196. <div class="fui-list-inner">
  197. <h4 class="text-warning order_avg_1 _popover-tips" data-content="成交额/下单去重会员数(含维权订单)">-</h4>
  198. 人均消费(元)
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. <div class="tab-pane" id="order_count_7">
  204. <div class="fui-list-group">
  205. <div class="fui-list no-padding">
  206. <div class="fui-list-inner">
  207. <h4 class="text-warning order_count_7 _popover-tips" data-content="成交量:已付款订单数<br>交易量:下单总数(含未付款订单)">-</h4>
  208. 成交量/交易量(件)
  209. </div>
  210. </div>
  211. <div class="fui-list no-padding">
  212. <div class="fui-list-inner">
  213. <h4 class="text-warning order_price_7 _popover-tips" data-content="成交额:已付款订单金额(含运费)<br>交易额:下单总额(含运费)">-</h4>
  214. 成交额/交易额(元)
  215. </div>
  216. </div>
  217. <div class="fui-list no-padding">
  218. <div class="fui-list-inner">
  219. <h4 class="text-warning order_avg_7 _popover-tips" data-content="成交额/下单去重会员数(含维权订单)">-</h4>
  220. 人均消费(元)
  221. </div>
  222. </div>
  223. </div>
  224. </div>
  225. <div class="tab-pane" id="order_count_30">
  226. <div class="fui-list-group">
  227. <div class="fui-list no-padding">
  228. <div class="fui-list-inner">
  229. <h4 class="text-warning order_count_30 _popover-tips" data-content="成交量:已付款订单数<br>交易量:下单总数(含未付款订单)">-</h4>
  230. 成交量/交易量(件)
  231. </div>
  232. </div>
  233. <div class="fui-list no-padding">
  234. <div class="fui-list-inner">
  235. <h4 class="text-warning order_price_30 _popover-tips" data-content="成交额:已付款订单金额(含运费)<br>交易额:下单总额(含运费)">-</h4>
  236. 成交额/交易额(元)
  237. </div>
  238. </div>
  239. <div class="fui-list no-padding">
  240. <div class="fui-list-inner">
  241. <h4 class="text-warning order_avg_30 _popover-tips" data-content="成交额/下单去重会员数(含维权订单)">-</h4>
  242. 人均消费(元)
  243. </div>
  244. </div>
  245. </div>
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. <div class="ibox">
  251. <div class="ibox-content" style="border: 0;">
  252. <div class="row relative">
  253. <div class="ibox-loading" id="echarts-line-chart-loading"></div>
  254. <div class="col-md-12">
  255. <div class="" id="echarts-line-chart" style="height:156px; margin-top: 8px"></div>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. <div class="col-md-{$ordercol}">
  262. <div class="ibox h300">
  263. <div class="ibox-title">
  264. <h5><i class="icow">&#xe615;</i>商品销量排行</h5>
  265. <ul class="nav nav-tabs" id="sale">
  266. <li class="active"><a data-toggle="tab" href="#goods_rank_0" onclick="get_goods(0)">今日</a></li>
  267. <li><a data-toggle="tab" href="#goods_rank_1" onclick="get_goods(1)">昨日</a></li>
  268. <li><a data-toggle="tab" href="#goods_rank_7" onclick="get_goods(7)">最近七日</a></li>
  269. {ifp 'statistics.goods'}
  270. <li><a href="{php echo webUrl('statistics/goods')}">更多</a></li>
  271. {/if}
  272. </ul>
  273. </div>
  274. <div class="ibox-content">
  275. <div class="tab-content relative">
  276. <div class="ibox-loading" id="goods-rank-loading"></div>
  277. <div class="tab-pane active" id="goods_rank_0">
  278. <table class="table table-hover">
  279. <thead>
  280. <tr>
  281. <th width="40px">排名</th>
  282. <th width="">商品名称</th>
  283. <th width="20%">成交数量</th>
  284. <th width="20%">成交金额</th>
  285. </tr>
  286. </thead>
  287. <tbody>
  288. </tbody>
  289. </table>
  290. </div>
  291. <div class="tab-pane" id="goods_rank_1">
  292. <table class="table table-hover">
  293. <thead>
  294. <tr>
  295. <th width="40px">排名</th>
  296. <th width="">商品名称</th>
  297. <th width="20%">成交数量</th>
  298. <th width="20%">成交金额</th>
  299. </tr>
  300. </thead>
  301. <tbody>
  302. </tbody>
  303. </table>
  304. </div>
  305. <div class="tab-pane" id="goods_rank_7">
  306. <table class="table table-hover">
  307. <thead>
  308. <tr>
  309. <th width="40px">排名</th>
  310. <th width="">商品名称</th>
  311. <th width="20%">成交数量</th>
  312. <th width="20%">成交金额</th>
  313. </tr>
  314. </thead>
  315. <tbody>
  316. </tbody>
  317. </table>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. {/if}
  325. {/if}
  326. </div>
  327. <script type="text/javascript">
  328. myrequire(['echarts'], function () {
  329. var hasLineChart = $("#echarts-line-chart").length>0;
  330. if(hasLineChart){
  331. var lineChart = echarts.init(document.getElementById("echarts-line-chart"));
  332. }
  333. window.onresize = function () {
  334. if(hasLineChart) {
  335. lineChart.resize();
  336. }
  337. };
  338. $.ajax({
  339. type: "GET",
  340. url: "{php echo webUrl('order/list/ajaxgettotals', array('merch' => -1))}",
  341. dataType: "json",
  342. success: function (data) {
  343. var res = data.result;
  344. $(".order_status1").text(res.status1);
  345. $(".order_status4").text(res.status4);
  346. $.ajax({
  347. type: "GET",
  348. url: "{php echo webUrl('shop/ajax')}",
  349. dataType: "json",
  350. success: function (data) {
  351. var res = data.result;
  352. $(".goods_totals").text(res.goods_totals);
  353. $(".finance_total").text(res.finance_total);
  354. $(".commission_agent_total").text(res.commission_agent_total);
  355. $(".commission_agent_status0_total").text(res.commission_agent_status0_total);
  356. $(".commission_apply_status1_total").text(res.commission_apply_status1_total);
  357. $(".commission_apply_status2_total").text(res.commission_apply_status2_total);
  358. }
  359. });
  360. }
  361. });
  362. //获取今日交易情况
  363. get_order(0);
  364. $.ajax({
  365. type: "GET",
  366. // async: false,
  367. url: "{php echo webUrl('order/ajaxtransaction')}",
  368. dataType: "json",
  369. success: function (json) {
  370. var lineoption = {
  371. title: {
  372. text: '近七日交易走势',
  373. top: '100',
  374. textStyle: {
  375. fontWeight: 'normal',
  376. fontSize: 12,
  377. color: '#404040',
  378. fontFamily: 'Microsoft YaHei UI',
  379. }
  380. },
  381. tooltip: {
  382. trigger: 'axis'
  383. },
  384. legend: {
  385. data: ['交易量','成交量','交易额','成交额']
  386. },
  387. grid: {
  388. x: 50,
  389. x2: 50,
  390. y2: 30
  391. },
  392. calculable: true,
  393. xAxis: [
  394. {
  395. type: 'category',
  396. boundaryGap: false,
  397. data: json.price_key,
  398. axisLine: {
  399. lineStyle: {
  400. width: '0'
  401. }
  402. },
  403. },
  404. ],
  405. yAxis: [
  406. {
  407. type: 'value',
  408. axisLine: {
  409. lineStyle: {
  410. width: '0'
  411. }
  412. },
  413. axisLabel: {
  414. formatter: '{value}'
  415. }
  416. }
  417. ],
  418. series: [
  419. {
  420. name: '交易额',
  421. type: 'line',
  422. data: json.allprice_value,
  423. markPoint: {
  424. data: [
  425. {
  426. type: 'max',
  427. name: '最大值'
  428. },
  429. {
  430. type: 'min', name: '最小值'
  431. }
  432. ]
  433. },
  434. markLine: {
  435. data: [
  436. {type: 'average', name: '平均值'}
  437. ]
  438. },
  439. itemStyle: {
  440. normal: {
  441. color: '#ffc000'
  442. }
  443. }
  444. },
  445. {
  446. name: '成交额',
  447. type: 'line',
  448. data: json.price_value,
  449. markPoint: {
  450. data: [
  451. {
  452. type: 'max',
  453. name: '最大值'
  454. },
  455. {
  456. type: 'min', name: '最小值'
  457. }
  458. ]
  459. },
  460. markLine: {
  461. data: [
  462. {type: 'average', name: '平均值'}
  463. ]
  464. },
  465. itemStyle: {
  466. normal: {
  467. color: '#ff5555'
  468. }
  469. }
  470. },
  471. {
  472. name: '交易量',
  473. type: 'line',
  474. data: json.allcount_value,
  475. markLine: {
  476. data: [
  477. {type: 'average', name: '平均值'}
  478. ]
  479. },
  480. itemStyle: {
  481. normal: {
  482. color: '#44abf7'
  483. }
  484. }
  485. },
  486. {
  487. name: '成交量',
  488. type: 'line',
  489. data: json.count_value,
  490. markLine: {
  491. data: [
  492. {type: 'average', name: '平均值'}
  493. ]
  494. },
  495. itemStyle: {
  496. normal: {
  497. color: '#30af84'
  498. }
  499. }
  500. }
  501. ]
  502. };
  503. if(hasLineChart) {
  504. lineChart.setOption(lineoption);
  505. lineChart.resize();
  506. }
  507. $("#echarts-line-chart-loading").hide();
  508. $("#echarts-line-chart").show();
  509. }
  510. });
  511. //获取今日销量排行
  512. get_goods(0);
  513. });
  514. //获取订单概述
  515. function get_order(day) {
  516. $.ajax({
  517. type: "GET",
  518. url: "{php echo webUrl('order/ajaxorder')}&day="+day,
  519. dataType: "json",
  520. success: function (data) {
  521. var json = data.result;
  522. $(".order_count_"+day).text(json.order.order_count+"/"+json.order.allorder_count);
  523. $(".order_price_"+day).text(json.order.order_price +"/"+json.order.allorder_price);
  524. $(".order_avg_"+day).text(json.order.avg);
  525. }
  526. });
  527. }
  528. //获取商品销售排行榜
  529. function get_goods(day) {
  530. $("#goods-rank-loading").show();
  531. var goodsUrl = "{php echo webUrl('goods/edit')}&id=";
  532. $.ajax({
  533. type: "GET",
  534. url: "{php echo webUrl('shop/ajaxgoods')}&day="+day,
  535. dataType: "json",
  536. success: function (data) {
  537. if(data.status==1 && !$.isEmptyObject(data.result.obj)){
  538. $.each(data.result.obj, function (id, obj) {
  539. $("#"+id+" tbody").empty();
  540. if($.isEmptyObject(obj)){
  541. var html = '<tfoot><tr><td colspan="4" style="line-height: 250px; text-align: center;">暂无数据</td></tr></tfoot>';
  542. $("#"+id+" table").append(html).find("thead").hide();
  543. }else{
  544. $.each(obj, function (index, goods) {
  545. var index = index+1, title = goods.title||'空', url = goodsUrl+goods.id;
  546. var html = '<tr><td>'+index+'</td><td><a href="'+url+'">'+title+'</a></td><td>'+goods.count+'</td><td class="text-warning">'+goods.money+'</td></tr>';
  547. $("#"+id+" tbody").append(html);
  548. });
  549. }
  550. })
  551. }
  552. $("#goods-rank-loading").hide();
  553. }
  554. });
  555. }
  556. $('._popover-tips').popover({
  557. trigger: 'hover',
  558. delay: { "show": 500, "hide": 100 },
  559. content: $(this).data('fuck'),
  560. placement: 'top',
  561. title: false,
  562. animation: true,
  563. html: 'true',
  564. }).on('mouseenter', function () {
  565. // console.log($(this))
  566. // console.log($(this).text())
  567. $(this).popover("show");
  568. })
  569. </script>
  570. {template '_footer'}