(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e1eb79d6"],{"0ff5":function(t,e,i){"use strict";i("35dd")},"35dd":function(t,e,i){},"3b50":function(t,e,i){},"5cbf":function(t,e,i){},"932b":function(t,e,i){"use strict";i("5cbf")},da9d:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"city-ranking"},[i("div",{staticClass:"city-ranking-header"},[i("nav-back-bar",{attrs:{icon:"arrow-left",title:t.navTitle}}),i("div",{staticClass:"pd10"},[i("div",{staticClass:"city-ranking-card"},[t._m(0),i("div",[i("div",{staticClass:"card-content"},[t._m(1),i("div",{staticClass:"card-content-ranking"},[i("div",[t._v("ECO")]),i("div",[t._v("排名:"+t._s(t.ranking))])]),i("div",{staticClass:"card-content-mileage"},[i("span",[t._v(t._s(t.selfMileage)+"Km")])])]),i("div",{staticClass:"card-footer"},[t._m(2),i("div",[t._v(t._s(t.$t("main.timeFrame"))+" : "+t._s(t.startday)+" ~ "+t._s(t.endday))])])])])])],1),i("div",{staticClass:"city-ranking-body"},[t._l(t.itemList,(function(t){return i("div",[i("city-ranking-item",{attrs:{item:t}})],1)})),0==t.itemList.length?i("div",{staticStyle:{"padding-top":"50px"}},[i("van-empty",{attrs:{description:t.$t("tips.noData")}})],1):t._e()],2)])},a=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{staticClass:"city-ranking-card-circular"})])},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"card-content-logo"},[i("div",{staticClass:"full"})])},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"card-footer-icon"},[i("div")])}],s=(i("b680"),i("a9e3"),i("b562")),c=i("f5fa"),r=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"city-ranking-item"},[i("div",[i("div",{style:t.indexStyle},[t._v(t._s(t.item.index))]),i("div",[i("div",{staticClass:"min-logo"}),i("div",{staticClass:"ranking-content"},[i("div",{staticClass:"device-name"},[i("span",[t._v(t._s(t.item.deviceid))])]),i("div",{staticClass:"device-name"},[i("span",[t._v(t._s(t.item.devicename))])])])]),i("div",[t._v(t._s(t.item.totaldistance)+"KM")])])])},o=[],d={name:"cityRankingItem",props:{item:{type:Object,default:function(){return{index:1}}}},computed:{indexStyle:function(){var t=this.item.index,e="";switch(t){case 1:e="#FF0000";break;case 2:e="#FF6F00";break;case 3:e="#007BFF";break;default:e="#7B90B8"}return{color:e}}},data:function(){return{}}},l=d,f=(i("0ff5"),i("2877")),u=Object(f["a"])(l,r,o,!1,null,null,null),v=u.exports,m=v,k={name:"cityRanking",data:function(){return{navTitle:this.$t("main.cityRanking"),itemList:[],startday:"",endday:"",selfMileage:"0",ranking:this.$t("main.noRanking")}},computed:{token:function(){return this.$store.state.token},currentDeviceid:function(){return this.$store.state.currentDeviceid}},mounted:function(){var t=this;this.$toast.loading({forbidClick:!0}),Object(s["g"])(this.token).then((function(e){var i=e.status,n=e.records,a=e.startday,s=e.endday;0==i?(t.itemList=t.getItemList(n),t.calcSelfRanking(n),t.startday=a,t.endday=s):t.$toast(t.$t("tips.networkError")),t.$toast.clear()}))},methods:{getItemList:function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i];n.totaldistance>0&&(n.index=i+1,n.totaldistance=(n.totaldistance/1e3).toFixed(2),e.length<50&&e.push(n))}return e},calcSelfRanking:function(t){for(var e=this.currentDeviceid,i=null,n=0;n<t.length;n++){var a=t[n];a.deviceid==e&&(this.selfMileage=a.totaldistance,Number(a.totaldistance)>0&&(i=n+1))}null!=i&&(this.ranking=i)}},components:{NavBackBar:c["a"],cityRankingItem:m}},g=k,p=(i("932b"),Object(f["a"])(g,n,a,!1,null,"aafbe974",null)),_=p.exports;e["default"]=_},de6c:function(t,e,i){"use strict";i("3b50")},f5fa:function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"nav-back-bar"},[i("van-nav-bar",{scopedSlots:t._u([{key:"left",fn:function(){return[i("van-icon",{staticStyle:{color:"#ffffff"},attrs:{name:t.icon,size:"18"},on:{click:t.onClickLeft}})]},proxy:!0},{key:"title",fn:function(){return[i("span",{staticStyle:{color:"#ffffff","font-size":"20px"},domProps:{textContent:t._s(t.title)}})]},proxy:!0}])})],1)},a=[],s={name:"NavBackBar",props:{title:{type:String,default:""},icon:{type:String,default:"cross"}},data:function(){return{}},methods:{onClickLeft:function(){this.$router.back()}}},c=s,r=(i("de6c"),i("2877")),o=Object(r["a"])(c,n,a,!1,null,"b680e24e",null),d=o.exports;e["a"]=d}}]);