main.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  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-green">
  26. <div class="inner">
  27. <h3>{{yfOrderSum}}</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-fuchsia">
  40. <div class="inner">
  41. <h3>{{thcOrderSum}}</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-yellow">
  54. <div class="inner">
  55. <h3>{{dfOrderSum}}</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.toOrderByShipStatus(2)" 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-light-blue">-->
  68. <!-- <div class="inner">-->
  69. <!-- <h3>{{yfkOrderSum}}</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.toOrderByPayStatus(0)" 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/offilineOrderList.html'
  194. });
  195. return;
  196. }
  197. let url = '../shop/offilineOrderList.html?orderType=1';
  198. let title='';
  199. if (shippingStatus == 0) {//已发货
  200. if (vm.yfOrderSum == 0) {
  201. iview.Message.error('没有数据!');
  202. return;
  203. }
  204. url+="&orderStatus=300"
  205. title="已发货"
  206. } else if (shippingStatus == 1) {//退款订单
  207. if (vm.thcOrderSum == 0) {
  208. iview.Message.error('没有数据!');
  209. return;
  210. }
  211. url+="&orderStatus=401"
  212. title="退款订单"
  213. } else if (shippingStatus == 2){//已付款
  214. if (vm.dfOrderSum == 0) {
  215. iview.Message.error('没有数据!');
  216. return;
  217. }
  218. url+="&orderStatus=201"
  219. title="已付款"
  220. }
  221. openWindow({
  222. top: true,
  223. type: 2,
  224. title: title,
  225. content: url
  226. });
  227. },
  228. toOrderByRefundStatus: function (refundStatus) {
  229. let url = '../shop/offilineOrderList.html?orderType=1';
  230. if (vm.thcOrderSum == 0) {
  231. iview.Message.error('没有数据!');
  232. return;
  233. }
  234. openWindow({
  235. top: true,
  236. type: 2,
  237. title: '订单申请维权信息',
  238. content: url
  239. });
  240. },
  241. toOrderByPayStatus: function (payStatus) {
  242. if (vm.yfkOrderSum == 0) {
  243. iview.Message.error('没有数据!');
  244. return;
  245. }
  246. openWindow({
  247. top: true,
  248. type: 2,
  249. title: '订单',
  250. content: '../shop/order.html?orderStatus=' + payStatus
  251. });
  252. },
  253. toOrderByOrderStatus: function (orderStatus) {
  254. if (vm.ywcOrderSum == 0) {
  255. iview.Message.error('没有数据!');
  256. return;
  257. }
  258. openWindow({
  259. top: true,
  260. type: 2,
  261. title: '订单',
  262. content: '../shop/order.html?orderStatus=' + orderStatus
  263. });
  264. },
  265. toUser: function () {
  266. openWindow({
  267. top: true,
  268. type: 2,
  269. title: '消费记录总数',
  270. area: ['90%', '95%'],
  271. content: '../cashier/salerecord.html'
  272. });
  273. },
  274. toGoods: function () {
  275. openWindow({
  276. top: true,
  277. type: 2,
  278. title: '所有商品',
  279. content: '../shop/goods.html'
  280. });
  281. }
  282. },
  283. created: function () {
  284. let vue = this;
  285. $.getJSON("../order/queryMainTotal", function (r) {//所有订单
  286. vue.orderSum = r.sum;
  287. });
  288. $.getJSON("../order/queryTotal?isOnfiilineOrder=1&orderStatus=300&orderType=1", function (r) {//已发货
  289. vue.yfOrderSum = r.sum;
  290. });
  291. // $.getJSON("../order/queryTotal?isOnfiilineOrder=1&orderStatus=0&orderType=1", function (r) {//待付款
  292. // vue.yfkOrderSum = r.sum;
  293. // });
  294. // $.getJSON("../order/queryTotal?isOnfiilineOrder=1&orderStatus=402", function (r) {//已完成
  295. // vue.ywcOrderSum = r.sum;
  296. // });
  297. $.getJSON("../order/queryTotal?isOnfiilineOrder=1&orderStatus=401&orderType=1", function (r) {//退款订单
  298. vue.thcOrderSum = r.sum;
  299. });
  300. $.getJSON("../mall2memberconsumptionrecords/queryTotal", function (r) {//消费记录总数
  301. vue.userSum = r.userSum;
  302. });
  303. $.getJSON("../goods/queryTotal", function (r) {//所有商品数
  304. vue.goodsSum = r.goodsSum;
  305. });
  306. $.getJSON("../order/queryTotal?orderStatus=201&isOnfiilineOrder=1&orderType=1", function (r) {//已付款
  307. vue.dfOrderSum = r.sum;
  308. // if (r.sum > 0) {
  309. // iview.Notice.info({
  310. // title: '您有待发货订单',
  311. // desc: '<a onclick="vm.toOrderByShipStatus(0)" class="small-box-footer">查看</a>',
  312. // duration: 0
  313. // });
  314. // let iN = new iNotify({
  315. // effect: 'flash',
  316. // interval: 500,
  317. // message: "待发订单",
  318. // audio: {
  319. // file: ['../statics/audio/dforder.mp3']
  320. // },
  321. // notification: {
  322. // title: "通知!",
  323. // body: '您有待发订单'
  324. // }
  325. // });
  326. // iN.setTitle(true).player();
  327. // }
  328. });
  329. // $.get("../orderrefund/queryTotal?isOnfflineOrder=1&refundStatus=1", function (r) {
  330. // // vue.thcOrderSum = r.sum;
  331. // if (r.sum > 0) {
  332. // iview.Notice.info({
  333. // title: '您有退款申请订单',
  334. // desc: '<a onclick="vm.toOrderByRefundStatus(1)" class="small-box-footer">查看</a>',
  335. // duration: 0
  336. // });
  337. // let iN = new iNotify({
  338. // effect: 'flash',
  339. // interval: 500,
  340. // message: "退款订单",
  341. // audio: {
  342. // file: ['../statics/audio/dforder.mp3']
  343. // },
  344. // notification: {
  345. // title: "通知!",
  346. // body: '您有退款申请订单'
  347. // }
  348. // });
  349. // iN.setTitle(true).player();
  350. // }
  351. // });
  352. $.getJSON("../order/getUserOrderInfo?type=yfkOrderUserSum", function (r) {
  353. vue.yfkOrderUserSum = r.result;
  354. });
  355. $.getJSON("../order/getUserOrderInfo?type=oderUserSum", function (r) {
  356. vue.oderUserSum = r.result;
  357. });
  358. $.getJSON("../order/getUserOrderInfo?type=todayUserOrder", function (r) {
  359. vue.todayUserOrder = r.result;
  360. });
  361. $.getJSON("../order/getUserOrderInfo?type=todayUserSales", function (r) {
  362. vue.todayUserSales = r.result;
  363. });
  364. $.getJSON("../order/getUserOrderInfo?type=incomeSum", function (r) {
  365. vue.incomeSum = r.result;
  366. });
  367. $.getJSON("../order/getUserOrderInfo?type=payedOrderCount", function (r) {
  368. vue.payedOrderCount = r.result;
  369. });
  370. $.getJSON("../footprint/queryTotal", function (r) {
  371. vue.hitCount = r.hitCount;
  372. });
  373. },
  374. updated: function () {
  375. let vue = this;
  376. vue.hygml = (vue.yfkOrderUserSum / vue.userSum * 100).toFixed(4);
  377. vue.mhydds = (vue.oderUserSum / vue.userSum).toFixed(2);
  378. vue.mhygws = (vue.payedOrderCount / vue.oderUserSum).toFixed(2);
  379. vue.average1000 = (vue.orderSum / vue.hitCount * 1000).toFixed(4);
  380. vue.averageSales1000 = (vue.incomeSum / vue.hitCount * 1000).toFixed(4);
  381. }
  382. });
  383. </script>
  384. </body>
  385. </html>