From 941107b1bd3c976d04a0bde3829e1534d0b54f8c Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期一, 29 六月 2020 16:46:58 +0800 Subject: [PATCH] 拉新免单券统计 --- childPath/charts/prize/free_coupon_collect.html | 5 + childPath/charts/prize/free_pull_new_count.html | 220 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 225 insertions(+), 0 deletions(-) diff --git a/childPath/charts/prize/free_coupon_collect.html b/childPath/charts/prize/free_coupon_collect.html index 2fcbc44..b368016 100644 --- a/childPath/charts/prize/free_coupon_collect.html +++ b/childPath/charts/prize/free_coupon_collect.html @@ -41,6 +41,7 @@ <ul class="layui-tab-title"> <li class="layui-this" lay-id="t1">鍏嶅崟鍒�</li> <li lay-id="t2">璧犻�佸厤鍗曞埜</li> + <li lay-id="t3">鎷夋柊鍏嶅崟鍒�</li> </ul> <div class="layui-tab-content" style="position: absolute; top: 36px; bottom: 0px; width: 100%; padding: 0px; overflow: hidden;"> <div class="layui-tab-item layui-show" style="position: absolute; top: 36px; bottom: 0px; width: 100%; padding: 0px; overflow: hidden;"> @@ -51,6 +52,10 @@ <iframe tab-id="t2" align="center" width="100%" height="100%" datasrc="free_give_count.html" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe> </div> + <div class="layui-tab-item" style="position: absolute; top: 36px; bottom: 0px; width: 100%; padding: 0px; overflow: hidden;"> + <iframe tab-id="t3" align="center" width="100%" height="100%" datasrc="free_pull_new_count.html" frameborder="no" border="0" + marginwidth="0" marginheight="0" scrolling="no"></iframe> + </div> </div> </div> </body> diff --git a/childPath/charts/prize/free_pull_new_count.html b/childPath/charts/prize/free_pull_new_count.html new file mode 100644 index 0000000..83e0f28 --- /dev/null +++ b/childPath/charts/prize/free_pull_new_count.html @@ -0,0 +1,220 @@ +<!DOCTYPE html> +<html> + + <head> + <meta charset="UTF-8"> + <meta http-equiv="X-UA-Compatible" content="chrome=1"/> + <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> + <title>鎷夋柊鍏嶅崟鍒�</title> + <link rel="stylesheet" type="text/css" href="../../../css/doui.min.css"/> + <script src="../../../js/doui.min.js" type="text/javascript" charset="utf-8"></script> + <script src="../../../js/requestHost.js" type="text/javascript" charset="utf-8"></script> + <script type="text/javascript"> + doui.importLoad({ + importArray: [ + // 闆锋墦涓嶅姩 + getHostPath() + "js/jquery.min.js", + getHostPath() + "js/vue.min.js", + // 瀛椾綋鍥炬爣 + getHostPath() + "fontAdmin/iconfont.css", + getHostPath() + "font/iconfont.css", + // dom妯℃澘 + getHostPath() + "css/admin-all.css", + getHostPath() + "js/admin-creat.js", + // Echarts鎻掍欢 + getHostPath() + "childPath/charts/echarts.common.min.js", + ], + }); + </script> + </head> + + <body class="fontPC"> + <div class="winSizeBox bg-white"> + + <!-- =============================================================== 鎼滅储绛涢��(椤堕儴) --> + <div id="thisHeader" style="width:7.5rem;"></div> + + <!-- =============================================================== 琛ㄦ牸 --> + <div id="thisTable" class="admin-main-overHeader"> + <!--鍥捐〃澶栧眰--> + <div id="main" style="width:100%; height:100%; padding:20px;"></div> + </div> + + </div> + </body> + +</html> + + +<script type="text/javascript"> + + // 鍥捐〃鐢虫槑 + var myChart = null; + // 鍥炬爣璁剧疆 + var option = { + // 琛ㄦ牸鏍囬 + title: { text: '' }, + // 鍧愭爣绯� + grid: { show: true }, + // 鎻愮ず妗� + tooltip: { + trigger: 'axis', + axisPointer: { type: 'cross' } + }, + // 鎻愪緵涓嬭浇涓哄浘 + toolbox: { feature: { saveAsImage: {} } }, + // 鍥句緥椤� + legend: { data: [] }, // 闇�瑕佹帴鍙h幏鍙� + // X杞� + xAxis: { + name: "鏃堕棿", + type: 'category', + boundaryGap: false, + data: [], // 闇�瑕佹帴鍙h幏鍙� + }, + // Y杞� + yAxis: { + name: "缁撴灉", + type: 'value', + axisLabel: { formatter: '{value} ' }, + axisPointer: { snap: true } + }, + // 鏁版嵁 + series: [], // 闇�瑕佹帴鍙h幏鍙� + }; + + // vue瀹炰緥鍖� + doui.onReady({ + success: function() + { + // ----------------------------------------------------- 椤堕儴 + // 鐢熸垚椤堕儴绛涢�夐」dom + adminDom.header.creat({ + el: "#thisHeader", + touchSearch: function (optC) + { + // 璇锋眰鍦板潃 + var myurl = gethttp() + "/admin/new/api/v1/countCharts/getCouponCharts"; + + // 璇锋眰鏁版嵁 + var mydata = { + dateType: optC.select.result, + }; + + + if (optC.change.result == 1){ + mydata.typeArray =["pullNewCouponNum"]; + } else { + mydata.typeArray =["pullNewCouponMoney"]; + } + + + // 鏍规嵁閫夋嫨淇敼 + if (mydata.dateType == "1") { + mydata.startTime = optC.input[0].result; // 寮�濮嬫椂闂� + mydata.endTime = optC.input[1]?optC.input[1].result:""; // 缁撴潫鏃堕棿 + } + + if (mydata.dateType == "2") { + mydata.year = optC.input[0].result; // 骞翠唤 + } + + // 鏁版嵁璇锋眰 + doui.showLoading("鍔犺浇鏁版嵁"); + doui.request({ + type: "jsonp", + url: myurl, + data: mydata, + success: function (res) + { + doui.hideLoading(); + if (res.code != 0) { doui.showToast(res.msg); } + else + { + // 鍥句緥閫夋嫨 + var legendData = new Array(); + // 鍒嗘瀽鏁版嵁 + for (var i = 0; i < res.data.line_list.length; i++) + { + legendData.push(res.data.line_list[i].name); + res.data.line_list[i].type = "line"; // 绾挎潯鏍峰紡 + res.data.line_list[i].smooth = true; // 绾挎潯骞虫粦 + res.data.line_list[i].stack = '鎬婚噺'; // 鏁版嵁鍫嗗彔 + } + // 鍥捐〃璧嬪�� + option.legend.data = legendData; // 鍥句緥椤� + option.xAxis.data = res.data.xAxis_list; // X杞存暟鎹� + option.series = res.data.line_list; // 绾挎潯鏁版嵁 + myChart.setOption(option, true); + } + } + }); + } + }); + // 涓嬫媺妗� + adminDom.header.select({ + show: true, + list: [ + { "key": "1", value: "鏃ヨ鍥�" }, + { "key": "2", value: "鏈堣鍥�" }, + { "key": "3", value: "骞磋鍥�" }, + ], + touch: function(back) + { + // 鏃ヨ鍥� + if (back == "1") { adminDom.header.input({ num: 2, type: "date", }); } + // 鏈堣鍥� + else if (back == "2") { adminDom.header.input({ num: 1, type: "number", placeholder: "瑕佹煡鐪嬬殑骞翠唤锛屽锛�2018" }); } + // 骞磋鍥� + else if (back == "3") { adminDom.header.input({ num: 1, type: "number", placeholder: "璇ユā寮忎笅鏃犻渶杈撳叆" }); } + } + }); + // 杈撳叆鎼滅储 + adminDom.header.input({ num: 2, type: "date", }); + // 涓嬫媺妗� + adminDom.header.change({ + show: true, + list: [ + { "key": "1", value: "鏁伴噺" }, + { "key": "2", value: "閲戦" }, + ], + }); + + // ----------------------------------------------------- 鍥炬爣澶� + // Echarts鍒濆鍖� + myChart = echarts.init(document.getElementById('main')); + myChart.resize({ height: this.autoHeight}); + myChart.resize({ width: this.autoWidth}); + + // ----------------------------------------------------- 鍒濆琛屼负 + // 鏃堕棿鍒濆鍖栦负鍓嶅崄澶� + initInputGet(); + // 璇锋眰鏁版嵁 + vm_header.search(); + } + }); + + + // 鍒濆鍖栦负鏈�杩�10澶� + function initInputGet () + { + // 鑾峰彇褰撳墠鏃堕棿鎴� + var timestampEnd = new Date().getTime() - (1000*60*60*24*1); + var timestampStart = timestampEnd - (1000*60*60*24*11); + // 寮�濮嬫椂闂磋浆鍖栦负璇嗗埆绫诲瀷 + var mo = new Date(timestampStart); + var month = mo.getMonth()+1; if (month < 10) { month = "0" + month; } + var day = mo.getDate(); if (day < 10) { day = "0" + day; } + var commonStart = mo.getFullYear() + "-" + month + "-" + day; + // 缁撴潫鏃堕棿杞寲涓鸿瘑鍒被鍨� + mo = new Date(timestampEnd); + month = mo.getMonth()+1; if (month < 10) { month = "0" + month; } + day = mo.getDate(); if (day < 10) { day = "0" + day; } + var commonEnd = mo.getFullYear() + "-" + month + "-" + day; + // 灏嗚緭鍏ュ垵濮嬪寲 + vm_header.input.result[0] = commonStart; + vm_header.input.result[1] = commonEnd; + } + + +</script> \ No newline at end of file -- Gitblit v1.8.0