main.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>欢迎页</title>
  5. #parse("sys/header.html")
  6. </head>
  7. <body>
  8. <div class="wrapper-content animated fadeIn" id="rrapp">
  9. <div class="row">
  10. <div class="col-md-3 col-sm-6 col-xs-12">
  11. <div class="small-box bg-red">
  12. <div class="inner">
  13. <h3>{{orderSum}}</h3>
  14. <p>所有订单</p>
  15. </div>
  16. <div class="icon">
  17. <i class="fa fa-shopping-bag"></i>
  18. </div>
  19. <a class="small-box-footer"></a>
  20. <!-- <a onclick="vm.toOrderByShipStatus()" class="small-box-footer">详情 <i-->
  21. <!-- class="fa fa-arrow-circle-right"></i></a>-->
  22. </div>
  23. </div>
  24. <div class="col-md-3 col-sm-6 col-xs-12">
  25. <div class="small-box bg-yellow">
  26. <div class="inner">
  27. <h3>{{dfOrderSum}}</h3>
  28. <p>待发货</p>
  29. </div>
  30. <div class="icon">
  31. <i class="fa fa-shopping-bag"></i>
  32. </div>
  33. <a class="small-box-footer"></a>
  34. <!-- <a onclick="vm.toOrderByShipStatus(0)" class="small-box-footer">详情 <i-->
  35. <!-- class="fa fa-arrow-circle-right"></i></a>-->
  36. </div>
  37. </div>
  38. <div class="col-md-3 col-sm-6 col-xs-12">
  39. <div class="small-box bg-green">
  40. <div class="inner">
  41. <h3>{{yfOrderSum}}</h3>
  42. <p>已发货</p>
  43. </div>
  44. <div class="icon">
  45. <i class="fa fa-shopping-bag"></i>
  46. </div>
  47. <a class="small-box-footer"></a>
  48. <!-- <a onclick="vm.toOrderByShipStatus(1)" class="small-box-footer">详情 <i-->
  49. <!-- class="fa fa-arrow-circle-right"></i></a>-->
  50. </div>
  51. </div>
  52. <div class="col-md-3 col-sm-6 col-xs-12">
  53. <div class="small-box bg-light-blue">
  54. <div class="inner">
  55. <h3>{{yfkOrderSum}}</h3>
  56. <p>待付款</p>
  57. </div>
  58. <div class="icon">
  59. <i class="fa fa-shopping-bag"></i>
  60. </div>
  61. <a class="small-box-footer"></a>
  62. <!-- <a onclick="vm.toOrderByPayStatus(0)" class="small-box-footer">详情 <i-->
  63. <!-- class="fa fa-arrow-circle-right"></i></a>-->
  64. </div>
  65. </div>
  66. <div class="col-md-3 col-sm-6 col-xs-12">
  67. <div class="small-box bg-fuchsia">
  68. <div class="inner">
  69. <h3>{{thcOrderSum}}</h3>
  70. <p>退款订单</p>
  71. </div>
  72. <div class="icon">
  73. <i class="fa fa-shopping-bag"></i>
  74. </div>
  75. <a class="small-box-footer"></a>
  76. <!-- <a onclick="vm.toOrderByRefundStatus(1)" class="small-box-footer">详情 <i-->
  77. <!-- class="fa fa-arrow-circle-right"></i></a>-->
  78. </div>
  79. </div>
  80. <div class="col-md-3 col-sm-6 col-xs-12">
  81. <div class="small-box bg-aqua">
  82. <div class="inner">
  83. <h3>{{ywcOrderSum}}</h3>
  84. <p>已完成</p>
  85. </div>
  86. <div class="icon">
  87. <i class="fa fa-shopping-bag"></i>
  88. </div>
  89. <a class="small-box-footer"></a>
  90. <!-- <a onclick="vm.toOrderByOrderStatus(402)" class="small-box-footer">详情 <i-->
  91. <!-- class="fa fa-arrow-circle-right"></i></a>-->
  92. </div>
  93. </div>
  94. <div class="col-md-3 col-sm-6 col-xs-12">
  95. <div class="small-box bg-red">
  96. <div class="inner">
  97. <h3>{{userSum}}</h3>
  98. <p>消费记录总数</p>
  99. </div>
  100. <div class="icon">
  101. <i class="fa fa-user-md"></i>
  102. </div>
  103. <a class="small-box-footer"></a>
  104. <!-- <a onclick="vm.toUser()" class="small-box-footer">详情 <i class="fa fa-arrow-circle-right"></i></a>-->
  105. </div>
  106. </div>
  107. <div class="col-md-3 col-sm-6 col-xs-12">
  108. <div class="small-box bg-red">
  109. <div class="inner">
  110. <h3>{{goodsSum}}</h3>
  111. <p>所有商品</p>
  112. </div>
  113. <div class="icon">
  114. <i class="fa fa-ship"></i>
  115. </div>
  116. <a class="small-box-footer"></a>
  117. <!-- <a onclick="vm.toGoods()" class="small-box-footer">详情 <i class="fa fa-arrow-circle-right"></i></a>-->
  118. </div>
  119. </div>
  120. </div>
  121. <table class="table table-hover table-responsive table-bordered">
  122. <tr>
  123. <th colspan="5">会员购买率:<span style="color: red;">{{hygml}}%</span>(会员购买率=已付款订单会员数÷会员总数)</th>
  124. </tr>
  125. <tr style='text-align: center;'>
  126. <th style="text-align: center;">消费记录总数</th>
  127. <th style="text-align: center;">已付款订单会员数</th>
  128. <th style="text-align: center;">有订单会员数</th>
  129. <th style="text-align: center;">今日订单数</th>
  130. <th style="text-align: center;">今日会员购物总额</th>
  131. </tr>
  132. <tr style='text-align: center;'>
  133. <td>{{userSum}}</td>
  134. <td>{{yfkOrderUserSum}}</td>
  135. <td>{{oderUserSum}}</td>
  136. <td>{{todayUserOrder}}</td>
  137. <td>{{todayUserSales}}</td>
  138. </tr>
  139. </table>
  140. <table class="table table-hover table-responsive table-bordered">
  141. <tr>
  142. <th colspan="3">每会员平均订单数及购物额</th>
  143. </tr>
  144. <tr style='text-align: center;'>
  145. <th style="text-align: center;">总收入</th>
  146. <th style="text-align: center;">每会员平均订单数(有订单会员数÷会员总数)</th>
  147. <th style="text-align: center;">每会员平均购物数(已支付订单数量÷有订单会员数)</th>
  148. </tr>
  149. <tr style='text-align: center;'>
  150. <td>{{incomeSum}}</td>
  151. <td>{{mhydds}}</td>
  152. <td>{{mhygws}}</td>
  153. </tr>
  154. </table>
  155. <!-- <table class="table table-hover table-responsive table-bordered">-->
  156. <!-- <tr>-->
  157. <!-- <th>总点击数:{{hitCount}}; 每千点击订单数:{{average1000}}; 每千点击购物额:{{averageSales1000}}</th>-->
  158. <!-- </tr>-->
  159. <!-- </table>-->
  160. </div>
  161. <script type="text/javascript">
  162. var vm = new Vue({
  163. el: '#rrapp',
  164. data: {
  165. orderSum: 0,
  166. dfOrderSum: 0,//待发货
  167. yfOrderSum: 0,//已发货
  168. yfkOrderSum: 0,//待付款
  169. ywcOrderSum: 0,//已完成
  170. thcOrderSum: 0,//退款
  171. userSum: 0,//消费记录总数
  172. goodsSum: 0,//所有商品数
  173. yfkOrderUserSum: 0,//已付款订单会员数
  174. oderUserSum: 0,//有订单会员数
  175. todayUserOrder: 0,//今日订单数
  176. todayUserSales: 0,//今日会员购物总额
  177. hygml: 0,//会员购买率
  178. incomeSum: 0,//总收入
  179. payedOrderCount: 0,//已支付订单数
  180. mhydds: 0,//每会员订单数
  181. mhygws: 0,//每会员购物数
  182. hitCount: 0,//总点击数
  183. average1000: 0,//每千点击订单数
  184. averageSales1000: 0//每千点击购物额
  185. },
  186. methods: {
  187. toOrderByShipStatus: function (shippingStatus) {
  188. if (!shippingStatus && shippingStatus != 0) {
  189. openWindow({
  190. top: true,
  191. type: 2,
  192. title: '订单',
  193. content: '../shop/order.html'
  194. });
  195. return;
  196. }
  197. let url = '../shop/order.html?shippingStatus=' + shippingStatus;
  198. if (shippingStatus == 0) {//待发货
  199. url += '&orderStatus=201&payStatus=2';
  200. if (vm.dfOrderSum == 0) {
  201. iview.Message.error('没有数据!');
  202. return;
  203. }
  204. } else if (shippingStatus == 1) {//已发货
  205. if (vm.yfOrderSum == 0) {
  206. iview.Message.error('没有数据!');
  207. return;
  208. }
  209. } else if (shippingStatus == 4) {//退款
  210. if (vm.thcOrderSum == 0) {
  211. iview.Message.error('没有数据!');
  212. return;
  213. }
  214. }
  215. openWindow({
  216. top: true,
  217. type: 2,
  218. title: '订单',
  219. content: url
  220. });
  221. },
  222. toOrderByRefundStatus: function (refundStatus) {
  223. let url = '../shop/offilineOrderList.html?orderType=1';
  224. if (vm.thcOrderSum == 0) {
  225. iview.Message.error('没有数据!');
  226. return;
  227. }
  228. openWindow({
  229. top: true,
  230. type: 2,
  231. title: '订单申请维权信息',
  232. content: url
  233. });
  234. },
  235. toOrderByPayStatus: function (payStatus) {
  236. if (vm.yfkOrderSum == 0) {
  237. iview.Message.error('没有数据!');
  238. return;
  239. }
  240. openWindow({
  241. top: true,
  242. type: 2,
  243. title: '订单',
  244. content: '../shop/order.html?orderStatus=' + payStatus
  245. });
  246. },
  247. toOrderByOrderStatus: function (orderStatus) {
  248. if (vm.ywcOrderSum == 0) {
  249. iview.Message.error('没有数据!');
  250. return;
  251. }
  252. openWindow({
  253. top: true,
  254. type: 2,
  255. title: '订单',
  256. content: '../shop/order.html?orderStatus=' + orderStatus
  257. });
  258. },
  259. toUser: function () {
  260. openWindow({
  261. top: true,
  262. type: 2,
  263. title: '会员列表',
  264. area: ['90%', '95%'],
  265. content: '../shop/shopuser.html'
  266. });
  267. },
  268. toGoods: function () {
  269. openWindow({
  270. top: true,
  271. type: 2,
  272. title: '商品',
  273. content: '../shop/goods.html'
  274. });
  275. }
  276. },
  277. created: function () {
  278. let vue = this;
  279. $.getJSON("../order/queryMainTotal", function (r) {
  280. vue.orderSum = r.sum;
  281. });
  282. $.getJSON("../order/queryTotal?orderStatus=201&payStatus=2&isOnfiilineOrder=0", function (r) {
  283. vue.dfOrderSum = r.sum;
  284. if (r.sum > 0) {
  285. iview.Notice.info({
  286. title: '您有待发货订单',
  287. desc: '<a onclick="vm.toOrderByShipStatus(0)" class="small-box-footer">查看</a>',
  288. duration: 0
  289. });
  290. let iN = new iNotify({
  291. effect: 'flash',
  292. interval: 500,
  293. message: "待发订单",
  294. audio: {
  295. file: ['../statics/audio/dforder.mp3']
  296. },
  297. notification: {
  298. title: "通知!",
  299. body: '您有待发订单'
  300. }
  301. });
  302. iN.setTitle(true).player();
  303. }
  304. });
  305. $.getJSON("../order/queryTotal?isOnfiilineOrder=0&shippingStatus=1", function (r) {
  306. vue.yfOrderSum = r.sum;
  307. });
  308. $.getJSON("../order/queryTotal?isOnfiilineOrder=0&orderStatus=0", function (r) {
  309. vue.yfkOrderSum = r.sum;
  310. });
  311. $.getJSON("../order/queryTotal?isOnfiilineOrder=0&orderStatus=402", function (r) {
  312. vue.ywcOrderSum = r.sum;
  313. });
  314. $.getJSON("../orderrefund/queryMainTotal", function (r) {
  315. console.log(r.sum)
  316. vue.thcOrderSum = r.sum;
  317. });
  318. $.get("../orderrefund/queryTotal?isOnfflineOrder=0&refundStatus=1", function (r) {
  319. vue.thcOrderSum = r.sum;
  320. if (r.sum > 0) {
  321. iview.Notice.info({
  322. title: '您有退款申请订单',
  323. desc: '<a onclick="vm.toOrderByRefundStatus(1)" class="small-box-footer">查看</a>',
  324. duration: 0
  325. });
  326. let iN = new iNotify({
  327. effect: 'flash',
  328. interval: 500,
  329. message: "退款订单",
  330. audio: {
  331. file: ['../statics/audio/dforder.mp3']
  332. },
  333. notification: {
  334. title: "通知!",
  335. body: '您有退款申请订单'
  336. }
  337. });
  338. iN.setTitle(true).player();
  339. }
  340. });
  341. $.getJSON("../order/getUserOrderInfo?type=yfkOrderUserSum", function (r) {
  342. vue.yfkOrderUserSum = r.result;
  343. });
  344. $.getJSON("../order/getUserOrderInfo?type=oderUserSum", function (r) {
  345. vue.oderUserSum = r.result;
  346. });
  347. $.getJSON("../order/getUserOrderInfo?type=todayUserOrder", function (r) {
  348. vue.todayUserOrder = r.result;
  349. });
  350. $.getJSON("../order/getUserOrderInfo?type=todayUserSales", function (r) {
  351. vue.todayUserSales = r.result;
  352. });
  353. $.getJSON("../order/getUserOrderInfo?type=incomeSum", function (r) {
  354. vue.incomeSum = r.result;
  355. });
  356. $.getJSON("../order/getUserOrderInfo?type=payedOrderCount", function (r) {
  357. vue.payedOrderCount = r.result;
  358. });
  359. $.getJSON("../footprint/queryTotal", function (r) {
  360. vue.hitCount = r.hitCount;
  361. });
  362. $.getJSON("../mall2memberconsumptionrecords/queryTotal", function (r) {
  363. vue.userSum = r.userSum;
  364. });
  365. $.getJSON("../goods/queryTotal", function (r) {
  366. vue.goodsSum = r.goodsSum;
  367. });
  368. },
  369. updated: function () {
  370. let vue = this;
  371. vue.hygml = (vue.yfkOrderUserSum / vue.userSum * 100).toFixed(4);
  372. vue.mhydds = (vue.oderUserSum / vue.userSum).toFixed(2);
  373. vue.mhygws = (vue.payedOrderCount / vue.oderUserSum).toFixed(2);
  374. vue.average1000 = (vue.orderSum / vue.hitCount * 1000).toFixed(4);
  375. vue.averageSales1000 = (vue.incomeSum / vue.hitCount * 1000).toFixed(4);
  376. }
  377. });
  378. </script>
  379. </body>
  380. </html>