This commit is contained in:
cclu 2024-02-21 17:07:46 +08:00
parent 8fcf510dbc
commit 0749ce1888
3 changed files with 50 additions and 28 deletions

View File

@ -73,6 +73,7 @@
</template>
<script>
import request from '@/util/index.js'
import moment from "moment";
export default {
name: "map",
data(){
@ -90,16 +91,20 @@ export default {
dataList:[],//
showMore: false,//
curYear:'',
compareYear:''
compareYear:'',
searchTime:'',//
}
},
onLoad(query){
console.log('query',query)
if (query.time){
this.searchTime = query.time
}
//
let systemInfo = uni.getSystemInfoSync()
this.statusBarHeight = Number(systemInfo.statusBarHeight)
this.menu = uni.getMenuButtonBoundingClientRect()
console.log('query',query)
if (!query.longitude || !query.latitude){
let seat = uni.getStorageSync('seatInfo')
this.longitude = seat.longitude
@ -145,7 +150,6 @@ export default {
dayNumber = 6 + dNumber
}
this.howDayNumber = dayNumber
console.log('dayNumber',dayNumber)
// let dateList = []
// for (let i = 1;i<=dayNumber;i++){
// if (i<7){
@ -157,6 +161,7 @@ export default {
// this.scrollList = dateList
//
this.handleGetData()
this.handleTest()
},
methods:{
handleBack(){
@ -164,6 +169,20 @@ export default {
delta: 1
});
},
async handleTest(){
const req = {
Province_Code: '340000'
}
let data = await request.$webGet('CommercialApi/BaseInfo/GetServerpartList',req)
let list = data.Result_Data.List
let newList = []
list.forEach(item=>{
if (!item.SERVERPART_X || !item.SERVERPART_Y){
newList.push(item)
}
})
console.log('newList',newList)
},
handleChangeType(value){
this.pageType = value
},
@ -171,25 +190,24 @@ export default {
this.currentScroll = 'item'+ date
this.handleGetData()
},
async handleGetData(date){
async handleGetData(){
uni.showLoading({
title:'加载中'
})
let time = date?
date==='all'?this.nowDay:
this.currentScroll.split('item')[1]:
this.currentScroll.split('item')[1]
// let time = date?
// date==='all'?this.nowDay:
// this.currentScroll.split('item')[1]:
// this.currentScroll.split('item')[1]
let req = {
ProvinceCode:'340000',
Serverpart_ID:this.id,
Statistics_Date:time,
Statistics_Date:this.searchTime?moment(this.searchTime).format('YYYY-MM-DD'):moment().format('YYYY-MM-DD'),
}
let data = await request.$webGet('CommercialApi/BaseInfo/GetBrandAnalysis',req)
console.log('111',data)
if (data.Result_Code===100){
let list = data.Result_Data.ShopBrandList
console.log('list111',list)
let resList = []
let noResList = []
// 0
@ -200,13 +218,11 @@ export default {
noResList.push(item)
}
})
this.dataList = this.handleSortList(resList).concat(this.handleSortBrandIdList(noResList))
console.log('dataList',this.dataList)
uni.hideLoading()
}else{
uni.hideLoading()
}
uni.hideLoading()
},
handleChangeShowMore(){
this.showMore = !this.showMore

View File

@ -20,7 +20,7 @@
<!-- : 1个小时入区流量比5月同一时间流量增幅150%以上且每小时入区车辆超过100辆-->
<span class="notice" v-if="selectTab===1">{{ `: 1个小时入区流量比${showMonth}月同一时间流量增幅150%以上且每小时入区车辆超过100辆` }}</span>
<span class="notice" v-if="selectTab===2">: 前20个从今日零时起至今流量与月均同时段增幅情况</span>
</div>
</div>
<div class="boxRight">
<span class="day">{{showDay}}</span>
<img class="dayBox" src="https://eshangtech.com/ShopICO/ahyd-BID/newCommercial/dateBg.png"/>
@ -31,11 +31,11 @@
<div class="content">
<div class="contentTab">
<div :class="selectTab===1?'selectTab tabItem':'tabItem'" @click="handleTab(1)">
<span>{{`${startTime}时入区车流预警`}}</span>
<span>{{`${startTime===0?23:startTime-1}时入区车流预警`}}</span>
</div>
<div :class="selectTab===2?'selectTab2 tabItem':'tabItem'" @click="handleTab(2)">
<span>
{{endTime===24?`${endTime - 1}-0时入区车流排行`:`0-${startTime}时入区车流排行`}}
{{endTime===24?`${endTime - 1}-0时入区车流排行`:`0-${startTime===0?23:startTime-1}时入区车流排行`}}
</span>
</div>
</div>
@ -117,6 +117,7 @@
<script>
import request from '@/util/index.js'
import moment from "moment/moment";
export default {
name: "specialCase",
data(){
@ -193,9 +194,14 @@ export default {
this.showDay = d
const nowDate = new Date()
let h = nowDate.getHours()
this.startTime = h-1
// let h = 0
this.startTime = h
if (this.startTime===0){
this.searchText = `${y}-${nowM}-${nowD-1}`
let showDay = new Date(moment(this.searchText).subtract(1, 'day').format('YYYY-MM-DD')).getDate()
if (showDay<10){
showDay = '0'+showDay
}
this.showDay = showDay
}
// this.startTime = 19
//
@ -214,7 +220,7 @@ export default {
}
const total = await request.$webGet('CommercialApi/BaseInfo/GetServerpartInfo',req)
uni.navigateTo({
url:`/pages/commercialBI/map?longitude=${total.Result_Data.ServerpartInfo?total.Result_Data.ServerpartInfo.SERVERPART_X:''}&latitude=${total.Result_Data.ServerpartInfo?total.Result_Data.ServerpartInfo.SERVERPART_Y:''}&id=${item.SERVERPART_ID}`
url:`/pages/commercialBI/map?longitude=${total.Result_Data.ServerpartInfo?total.Result_Data.ServerpartInfo.SERVERPART_X:''}&latitude=${total.Result_Data.ServerpartInfo?total.Result_Data.ServerpartInfo.SERVERPART_Y:''}&id=${item.SERVERPART_ID}&time=${this.searchText}`
})
uni.hideLoading()
},
@ -236,8 +242,8 @@ export default {
})
if (val === 2 ){
const req= {
StatisticsDate:this.searchText,
StatisticsHour:this.startTime,
StatisticsDate:this.startTime === 0 ?moment(this.searchText).subtract(1, 'day').format('YYYY-MM-DD'):this.searchText,
StatisticsHour:this.startTime === 0?23:this.startTime-1,
StatisticsType:2,
ShowCount:20
}
@ -251,8 +257,8 @@ export default {
})
}else if(val === 1 ){
const req= {
StatisticsDate:this.searchText,
StatisticsHour:this.startTime,
StatisticsDate:this.startTime === 0?moment(this.searchText).subtract(1, 'day').format('YYYY-MM-DD'):this.searchText,
StatisticsHour:this.startTime === 0?23:this.startTime-1,
StatisticsType:1,
ShowCount:20
}

View File

@ -2061,8 +2061,8 @@ export default {
const req= {
// this.single
StatisticsDate: h===0 || h===24?moment(`${y}-${m}-${d}`).subtract(1, 'day').format('YYYY-MM-DD'):`${y}-${m}-${d}`,
StatisticsHour:h===0 || h===24?23:h - 1,
StatisticsDate: h===0?moment(`${y}-${m}-${d}`).subtract(1, 'day').format('YYYY-MM-DD'):`${y}-${m}-${d}`,
StatisticsHour:h===0?23:h - 1,
StatisticsType:1,
ShowCount:20
}