1 |
- require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/admin/statistics/index"],{"15cf":function(t,e,i){"use strict";var a=i("cc41"),n=i.n(a);n.a},"842d":function(t,e,i){"use strict";i.r(e);var a=i("dda6"),n=i.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);e["default"]=n.a},9420:function(t,e,i){"use strict";i.r(e);var a=i("a18f"),n=i("842d");for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);i("15cf");var r=i("f0c5"),o=Object(r["a"])(n["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);e["default"]=o.exports},a18f:function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,i=(t._self._c,t.$t("今天")),a=t.$t("昨天"),n=t.$t("最近7天"),s=t.$t("本月"),r=t.$t("自定义"),o=1==t.where.type?t.$t("营业额(元)"):null,h=1!=t.where.type?t.$t("订单量(份)"):null,c=t.$t("增长率"),l=t.$t("增长"),d=t.$t("单位"),u=1==t.where.type?t.$t("元."):null,f=1!=t.where.type?t.$t("份"):null,m=t.$t("详细数据"),p=t.$t("日期"),g=t.$t("订单数"),w=t.$t("成交额");t.$mp.data=Object.assign({},{$root:{m0:i,m1:a,m2:n,m3:s,m4:r,m5:o,m6:h,m7:c,m8:l,m9:d,m10:u,m11:f,m12:m,m13:p,m14:g,m15:w}})},n=[]},a3a2:function(t,e,i){"use strict";(function(t,e){var a=i("4ea4");i("4789");a(i("66fd"));var n=a(i("9420"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(n.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},cc41:function(t,e,i){},dda6:function(t,e,i){"use strict";(function(t){var a=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(i("0ced")),s=i("5171"),r=null,o=(new Date).getFullYear(),h=(new Date).getMonth()+1,c=(new Date).getDate(),l={name:"Statistics",components:{uniCalendar:function(){Promise.all([i.e("pages/admin/common/vendor"),i.e("pages/admin/components/uni-calendar/uni-calendar")]).then(function(){return resolve(i("d991"))}.bind(null,i)).catch(i.oe)}},props:{},data:function(){return{value:[[o,h,c-1],[o,h,c]],isrange:!0,weekSwitch:!1,ismulti:!1,monFirst:!0,clean:!1,lunar:!1,renderValues:[],monthRange:[],current:!1,where:{start:"",stop:"",type:""},types:"",time:"",title:"",growth_rate:"",increase_time:"",increase_time_status:"",time_price:"",loaded:!1,loading:!1,filter:{page:1,limit:10,start:"",stop:""},list:[],cWidth:"",cHeight:"",pixelRatio:1,textarea:"",LineA:{categories:["2012","2013","2014","2015","2016","2017"],series:[{data:[35,8,25,37,4,20]}]},info:{startDate:"",endDate:"",lunar:!1,range:!0,insert:!1,selected:[],showMonth:!1},type:"",before:"",after:""}},watch:{"$route.params":function(t){void 0!=t&&(this.setType(t.type),this.setTime(t.time),this.getIndex())}},onLoad:function(e){this.type=e.type,e.before&&(this.before=e.before),e.after&&(this.after=e.after),this.setType(e.type),this.setTime(e.time),this.cWidth=t.upx2px(690),this.cHeight=t.upx2px(500),this.getInfo()},computed:{monthRangeText:function(){return this.monthRange.length?this.$t("固定"):this.$t("指定范围")}},methods:{getIndex:function(){var t=[],e=[],i=this;(0,s.getStatisticsTime)(i.where).then((function(a){var n=a.data.chart,s=[],r=[];n.forEach((function(t){s.push(t.time),r.push(t.num)})),i.growth_rate=a.data.growth_rate,i.increase_time=a.data.increase_time,i.increase_time_status=a.data.increase_time_status,i.time_price=a.data.time,a.data.chart.forEach((function(i,a){t.push(i.time),e.push(i.num)})),i.LineA.categories=t,i.LineA.series[0].data=e,i.showLineA("canvasLineA",i.LineA)}),(function(t){i.$util.Tips({title:t})}))},setTime:function(t){this.time=t;var e=(new Date).getFullYear(),i=(new Date).getMonth()+1,a=(new Date).getDate();switch(this.list=[],this.filter.page=1,this.loaded=!1,this.loading=!1,t){case"today":this.where.start=new Date(Date.parse(e+"/"+i+"/"+a)).getTime()/1e3,this.where.stop=new Date(Date.parse(e+"/"+i+"/"+a)).getTime()/1e3+86400-1,this.title=this.$t("今天"),this.getIndex(),this.getInfo();break;case"yesterday":this.where.start=new Date(Date.parse(e+"/"+i+"/"+a)).getTime()/1e3-86400,this.where.stop=new Date(Date.parse(e+"/"+i+"/"+a)).getTime()/1e3-1,this.title=this.$t("昨天"),this.getIndex(),this.getInfo();break;case"month":this.where.start=new Date(e,(new Date).getMonth(),1).getTime()/1e3,this.where.stop=new Date(e,i,1).getTime()/1e3-1,this.title=this.$t("本月"),this.getIndex(),this.getInfo();break;case"seven":this.where.start=new Date(Date.parse(e+"/"+i+"/"+a)).getTime()/1e3+86400-604800,this.where.stop=new Date(Date.parse(e+"/"+i+"/"+a)).getTime()/1e3+86400-1,this.title=this.$t("最近7天"),this.getIndex(),this.getInfo();break;case"date":var n=this.before.split("-"),s=this.after.split("-"),r=this.getTimestamp(n[0],n[1],n[2],0,0,0),o=this.getTimestamp(s[0],s[1],s[2],23,59,59);this.where.start=r,this.where.stop=o,Promise.all([this.getIndex(),this.getInfo()]);break}},getTimestamp:function(t,e,i,a,n,s){return new Date(t,e-1,i,a,n,s).getTime()/1e3},setType:function(t){switch(t){case"price":this.where.type=1;break;case"order":this.where.type=2;break}},dateTitle:function(){t.navigateTo({url:"/pages/admin/custom_date/index?type="+this.type})},close:function(){this.current=!1},getInfo:function(){var t=this;t.loading||t.loaded||(t.loading=!0,t.filter.start=t.where.start,t.filter.stop=t.where.stop,(0,s.getStatisticsMonth)(t.filter).then((function(e){t.loading=!1,t.loaded=e.data.length<t.filter.limit,t.list.push.apply(t.list,e.data),t.filter.page=t.filter.page+1}),(function(e){t.$util.Tips({title:e})})))},showLineA:function(t,e){r=new n.default({$this:this,canvasId:t,type:"line",fontSize:11,padding:[15,15,0,15],legend:{show:!1,padding:5,lineHeight:11,margin:5},dataLabel:!0,dataPointShape:!0,dataPointShapeType:"hollow",background:"#FFFFFF",pixelRatio:this.pixelRatio,categories:e.categories,series:e.series,animation:!0,enableScroll:!0,xAxis:{disableGrid:!1,type:"grid",gridType:"dash",itemCount:4,scrollShow:!0,scrollAlign:"left"},yAxis:{gridType:"dash",splitNumber:8,min:0,max:30,format:function(t){return t.toFixed(0)}},width:this.cWidth*this.pixelRatio,height:this.cHeight*this.pixelRatio,extra:{line:{type:"straight"}}})},touchLineA:function(t){r.scrollStart(t)},moveLineA:function(t){r.scroll(t)},touchEndLineA:function(t){r.scrollEnd(t)},confirm:function(t){if(t.range.after&&t.range.before){var e=new Date(t.range.before+" 00:00:00").getTime()/1e3,i=new Date(t.range.after+" 23:59:59").getTime()/1e3;this.where.start=e,this.where.stop=i,this.list=[],this.filter.page=1,this.loaded=!1,this.loading=!1,Promise.all([this.getIndex(),this.getInfo()])}}},onReachBottom:function(){this.getInfo()}};e.default=l}).call(this,i("543d")["default"])}},[["a3a2","common/runtime","common/vendor","pages/admin/common/vendor"]]]);
|