(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-42d72a5a"],{"0c09":function(t,e,a){"use strict";a("aee8")},"3b50":function(t,e,a){},aee8:function(t,e,a){},c958:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"cycling-statistics"},[a("div",{staticClass:"cycling-statistics-header"},[a("nav-back-bar",{attrs:{icon:"arrow-left",title:t.navTitle}})],1),a("div",{staticClass:"cycling-statistics-body"},[a("div",{staticClass:"total-statistics pd10"},[a("div",{staticClass:"full"},[a("div",[a("div",[t._v(t._s(t.$t("main.totalMileage")))]),a("div",[t._v(t._s(t.totalDis)),a("span",[t._v("Km")])])]),a("div",[a("div",[t._v(t._s(t.$t("main.totalTime")))]),a("div",[t._v(t._s(t.totalAcc)),a("span",[t._v("h")])])]),a("div",[a("div",[t._v(t._s(t.$t("main.statisticalDays")))]),t._m(0)])])]),a("div",{staticClass:"bar-wrapper"},[a("div",{staticClass:"item-date-wrapper"},t._l(t.mileages,(function(e){return a("div",{key:e.date},[t._v(t._s(e.date))])})),0),a("div",{staticClass:"item-bar-wrapper"},t._l(t.mileages,(function(e,i){return a("div",{key:i},[t._m(1,!0),a("div",[a("div",{staticClass:"bar"},[a("div",{staticClass:"bar-inner",style:{height:e.barHeight,backgroundColor:e.date==t.selcetdDate?"#007BFF":"#073361"}})])])])})),0)]),a("div",{staticClass:"ctrl-wrapper"},[a("div",{staticClass:"ctrl-wrapper-title"},[a("span",[t._v(t._s(t.$t("main.ridingStatistics")))]),a("span",[t._v(t._s(t.$t("main.unit"))+": km")])]),a("div",{staticClass:"ctrl-wrapper-mileage"},t._l(t.mileages,(function(e,i){return a("div",{key:i,on:{click:function(a){return t.onSelctedDate(e)}}},[a("div",{class:["full",e.date==t.selcetdDate?"active":""]},[a("span",{domProps:{textContent:t._s(e.value)}})])])})),0),a("div",{staticClass:"ctrl-wrapper-details"},[a("van-row",{attrs:{gutter:"10"}},t._l(t.todayDetail,(function(e,i){return a("van-col",{key:i,attrs:{span:"12"}},[a("div",{staticClass:"ctrl-wrapper-details-item"},[a("div",[a("span",{domProps:{textContent:t._s(e.value)}}),a("span",{staticClass:"unit",domProps:{textContent:t._s(e.unit)}})]),a("div",[a("span",{domProps:{textContent:t._s(e.label)}})])])])})),1)],1)])])])},s=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._v("5"),a("span",[t._v("d")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"item-line"})])}],n=(a("159b"),a("a9e3"),a("b680"),a("ac1f"),a("1276"),a("f5fa")),c=a("b562"),r={name:"cyclingStatistics",data:function(){return{navTitle:this.$t("main.ridingStatistics"),mileages:[],selcetdDate:"",totalDis:0,totalAcc:0,todayDetail:[{label:this.$t("main.ridingTime"),value:"0",unit:"h"},{label:this.$t("main.avgSpeed"),value:"0",unit:"Km/h"}]}},mounted:function(){var t=this;this.$toast.loading({forbidClick:!0}),Object(c["j"])(this.currentDeviceid,this.token).then((function(e){t.$toast.clear(),t.mileages=t.getMileageList(e.records),t.onSelctedDate(t.mileages[4])})).catch((function(){t.$toast.clear(),t.$toast(t.$t("tips.networkError"))}))},methods:{onSelctedDate:function(t){this.selcetdDate=t.date,this.todayDetail[0].value=t.totalacc,this.todayDetail[1].value=t.avgspeed},getMileageList:function(t){var e=this,a=[],i=0,s=0,n=0;return t.forEach((function(t){var c=e.getDateKey(t.statisticsday),r=parseInt(t.totalacc/1e3/60/60),l={date:c,value:Number((t.totaldistance/1e3).toFixed(2)),avgspeed:Number(t.avgspeed.toFixed(2)),totalacc:r};l.value>i&&(i=l.value),s+=l.value,n+=r,a.push(l)})),a.forEach((function(t){t.barHeight=0==i?"0%":t.value/i*100+"%"})),this.totalDis=Number(s.toFixed(2)),this.totalAcc=n,a},getDateKey:function(t){var e="",a=t.split("-");return e=Number(a[1])+"/"+Number(a[2]),e}},computed:{currentDeviceid:function(){return this.$store.state.currentDeviceid},token:function(){return this.$store.state.token}},components:{NavBackBar:n["a"]}},l=r,o=(a("0c09"),a("2877")),d=Object(o["a"])(l,i,s,!1,null,"34cd242a",null),u=d.exports;e["default"]=u},de6c:function(t,e,a){"use strict";a("3b50")},f5fa:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"nav-back-bar"},[a("van-nav-bar",{scopedSlots:t._u([{key:"left",fn:function(){return[a("van-icon",{staticStyle:{color:"#ffffff"},attrs:{name:t.icon,size:"18"},on:{click:t.onClickLeft}})]},proxy:!0},{key:"title",fn:function(){return[a("span",{staticStyle:{color:"#ffffff","font-size":"20px"},domProps:{textContent:t._s(t.title)}})]},proxy:!0}])})],1)},s=[],n={name:"NavBackBar",props:{title:{type:String,default:""},icon:{type:String,default:"cross"}},data:function(){return{}},methods:{onClickLeft:function(){this.$router.back()}}},c=n,r=(a("de6c"),a("2877")),l=Object(r["a"])(c,i,s,!1,null,"b680e24e",null),o=l.exports;e["a"]=o}}]);