update
This commit is contained in:
parent
8fcf510dbc
commit
0749ce1888
@ -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
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user