From ce19e7fed78c5eec4b160a86d7505114cca8b3b7 Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Sat, 29 Jul 2023 12:40:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=8E=B7=E5=8F=96=E7=B4=AF?= =?UTF-8?q?=E8=AE=A1=E6=9C=8D=E5=8A=A1=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ty/index.vue | 51 +++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 33 deletions(-) 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 + }); + }, // 折线趋势图