diff --git a/src/views/ty/index.vue b/src/views/ty/index.vue index c675298..9c89b89 100644 --- a/src/views/ty/index.vue +++ b/src/views/ty/index.vue @@ -920,41 +920,26 @@ export default { // 总计 体育场馆的总数 getStat() { - let that = this - const groups ="110|210|310"; - // DAILY - homeApi.allTygGroupTimeNum({granularity:"daily",groupsId:groups}).then(res=>{ - // 24h 人流趋势 - that.daData = res.data.data; - const tmpdata = res.data.data.allTimeData; - let datas = [] - Object.values(tmpdata).forEach((value) => { - datas.push(value.num) - }); - // that.data24h = datas; - const day_tmp=res.data.data.groupsData - - //遍历加 - day_tmp.forEach(item=>{ - that.todayNum =+ item.noRepeatInNum - }); + - }) - // MONTHLY - homeApi.allTygGroupTimeNum({granularity:"monthly",groupsId:groups}).then(res=>{ - const day_tmp=res.data.data.groupsData - day_tmp.forEach(item=>{ - that.monthNum =+ item.noRepeatInNum - }); - }) - // YEARLY - homeApi.allTygGroupTimeNum({granularity:"yearly",groupsId:groups}).then(res=>{ - const day_tmp=res.data.data.groupsData - day_tmp.forEach(item=>{ - that.yearNum =+ item.noRepeatInNum - }); - }) + let that = this + let groups =""; + homeApi.getID().then(res=>{ + res.data.data.map(item=>{ + if(item.type==1){ + groups += "|"+item.groupId; + } + }) + }); + homeApi.allGroupNum({granularity:"daily",groupsId:groups}).then(res=>{ + const rtdata = res.data.returnData + that.todayNum = rtdata.day.noRepeatInNum + that.weekNum = rtdata.week.noRepeatInNum + that.monthNum = rtdata.month.noRepeatInNum + that.yearNum = rtdata.year.noRepeatInNum + }); + }, // 折线趋势图