From 3ed8af69d4734ae9b7fde68541c388b877039b4c Mon Sep 17 00:00:00 2001 From: cclu <1106109051@qq.com> Date: Tue, 11 Apr 2023 19:00:34 +0800 Subject: [PATCH] update --- common/utils.js | 21 + manifest.json | 2 +- pages.json | 3 +- pages/commercialBI/businessPortrait.vue | 3 +- pages/commercialBI/carPortrait.vue | 245 +++++-- pages/commercialBI/components/analyse.vue | 6 +- .../components/bussiness/bestsellerShop.vue | 5 + .../components/car/carTypeTime.vue | 32 +- .../commercialBI/components/car/entryZone.vue | 213 +++++- .../commercialBI/components/car/homePlace.vue | 54 +- .../components/car/percentEntry.vue | 122 +++- .../components/car/timeAnalysis.vue | 18 +- .../components/format/bandNumber.vue | 1 + .../components/guest/businessType.vue | 10 +- .../components/guest/consumptionLevel.vue | 128 +++- .../components/guest/customerSecond.vue | 45 +- pages/commercialBI/components/headerTop.vue | 4 +- .../components/manager/contractGuarantee.vue | 4 +- .../components/manager/moneyCompare.vue | 21 +- pages/commercialBI/components/noData.vue | 9 +- pages/commercialBI/formatPortrait.vue | 3 +- pages/commercialBI/guestPortrait.vue | 180 ++++- pages/commercialBI/managePortrait.vue | 120 +++- pages/commercialBI/planDetail.vue | 645 ++++++++++++++---- pages/commercialBI/planMonth.vue | 89 ++- pages/index/index.vue | 171 +++-- pages/map/detail.vue | 81 ++- pages/map/index.vue | 52 +- 28 files changed, 1807 insertions(+), 480 deletions(-) diff --git a/common/utils.js b/common/utils.js index 855766d..7523553 100644 --- a/common/utils.js +++ b/common/utils.js @@ -249,7 +249,26 @@ function getThisMonth(value){ } return `${y}${m}` } +//有横杠 +function getThisMonthHave(value){ + const date = new Date(value) + let y = date.getFullYear() + let m = date.getMonth()+1 + if (m<10){ + m = '0'+m + } + return `${y}-${m}` +} +// 输入时间拿到月份 输出月份的字符串 +function getThisTimeMonth(value){ + const date = new Date(value) + let m = date.getMonth()+1 + if (m<10){ + m = '0'+m + } + return `${m}` +} // 视频播放 const EZUIPlayer = require('./ezuikit.js'); @@ -263,6 +282,8 @@ export default { cutDate, getThisMonthDay, getThisMonth, + getThisMonthHave, + getThisTimeMonth, fmoney, noDecimal, changeStringToDate, diff --git a/manifest.json b/manifest.json index 2c78a10..613af99 100644 --- a/manifest.json +++ b/manifest.json @@ -68,7 +68,7 @@ }, "plugins": { "routePlan": { - "version": "1.0.18", + "version": "1.0.19", "provider": "wx50b5593e81dd937a" } }, diff --git a/pages.json b/pages.json index 2e11181..ed95128 100644 --- a/pages.json +++ b/pages.json @@ -149,7 +149,8 @@ "style": { "navigationBarTitleText": "", - "navigationStyle": "custom" + "navigationStyle": "custom", + "disableScroll": true } } ], diff --git a/pages/commercialBI/businessPortrait.vue b/pages/commercialBI/businessPortrait.vue index 64f1f57..a86444a 100644 --- a/pages/commercialBI/businessPortrait.vue +++ b/pages/commercialBI/businessPortrait.vue @@ -90,8 +90,7 @@ export default { serviceInfo:{} ,//当前服务区信息 backType:'',//返回的页面类型 analyseInfo:{ - analysisins_type1: 1401, - analysisins_type2: 1402 + analysisins_type: 1401 }, } }, diff --git a/pages/commercialBI/carPortrait.vue b/pages/commercialBI/carPortrait.vue index d0e30e3..343c15f 100644 --- a/pages/commercialBI/carPortrait.vue +++ b/pages/commercialBI/carPortrait.vue @@ -40,27 +40,68 @@
-

入区车流分析

- +
+

入区车流分析

+
+ 日期: + {{time}} +
+
+
+ + +
+
+
+
+ 统计月份: +
+ + + {{ single }} + + + +
+
{{item.name}}{{index!==0?'区':''}} -

车辆归属地

- +

{{thisMonth?thisMonth:'-'}}月车辆归属地

+
+ + +
+
-

车辆类型占比与停留时间

- +

{{thisMonth?thisMonth:'-'}}月车辆类型占比-停留时间(日均)

+
+ + +
+
-

车辆价值与停留时间分析

- +

{{thisMonth?thisMonth:'-'}}月车车辆类型-停留时间(日均)

+
+ + +
+
-

入区率占比

- +
+

{{thisMonth?thisMonth:'-'}}月入区率占比

+ {{allEntry?allEntry:'-'}}% +
+
+ + +
+
@@ -80,9 +121,13 @@ import HomePlace from "./components/car/homePlace.vue"; import CarTypeTime from "./components/car/carTypeTime.vue"; import timeAnalysis from "./components/car/timeAnalysis.vue"; import PercentEntry from "./components/car/percentEntry.vue"; +import {timestampToTime} from "../../util/dateTime"; +import NoData from "./components/noData.vue"; +import Analyse from "./components/analyse.vue"; export default { name: "carPortrait", data(){ + const lastDay = this.$util.cutDate(new Date(), 'YYYY-MM-DD', -1) return { menu:{}, //手机参数 serviceArray:["123465","123465","123465","123465","123465"], // 选择服务区的列表 @@ -109,9 +154,15 @@ export default { serviceInfo:{}, //当前服务区信息 backType:'',//返回的页面类型 analyseText:'',//分析的文字 + single:'',//显示时间 + lastDay:lastDay, + endTime:'', + thisMonth:'',//几月 + allEntry:'',//一共的入区率占比 + endData:''//截止日期 } }, - components: {PercentEntry, CarTypeTime, HomePlace, EntryZone,timeAnalysis}, + components: {Analyse, NoData, PercentEntry, CarTypeTime, HomePlace, EntryZone,timeAnalysis}, computed:{ isHaveData(){ return true @@ -120,21 +171,27 @@ export default { onLoad(option){ console.log('option',option) this.backType = option.type - let serviceInfo = JSON.parse(option.serviceInfo) - this.serviceInfo = serviceInfo - console.log('this.serviceInfo',this.serviceInfo) - //跳转的时候带上时间 - this.time = option.time }, onShow(){ + let nowTime = new Date() + let y = nowTime.getFullYear() + let month = nowTime.getMonth() + 1 + if (month<10){ + month = '0'+ month + } + this.endData = `${y}-${month}` let storeTime = uni.getStorageSync('lastDay') if (storeTime){ this.time = storeTime } - let storeServiceInfo = uni.getStorageSync('currentService') - if (storeServiceInfo){ - this.serviceInfo = storeServiceInfo + this.single = this.$util.getThisMonthHave(this.time) + const date = new Date(this.single) + //设置日期选择器的开始时间和结束时间 + let m = date.getMonth() + 1 + if (m<10){ + m = '0' + m } + this.thisMonth = m // 获取手机参数对页面进行适配 let systemInfo = uni.getSystemInfoSync() // 把获取到的手机参数保存 @@ -143,9 +200,14 @@ export default { this.menu = uni.getMenuButtonBoundingClientRect() // 把获取图表数据的方法统一放在一起 然后去请求接口拿到数据 再分批传到相对应的图标组件 // 每个图表都是用组件的方式引入的 数据是通过prop传入的 + let storeServiceInfo = uni.getStorageSync('currentService') + let nearServiceInfo = uni.getStorageSync('nearService') if (!storeServiceInfo){ - this.nearestService() + this.serviceInfo = nearServiceInfo + }else{ + this.serviceInfo = storeServiceInfo } + console.log('this.serviceInfo',this.serviceInfo) // 入区车流分析 this.getCarData() // 车辆归属地 @@ -163,6 +225,30 @@ export default { }, methods:{ + // 时间选择器改变的时间 + bindDateChange(e){ + const date = new Date(e.detail.value) + let m = date.getMonth() + 1 + if (m<10){ + m = '0' + m + } + this.thisMonth = m + this.single = e.detail.value + let d = this.$util.getThisMonthDay(e.detail.value) + this.endTime = e.detail.value + '-' + d + this.onRefresh() + }, + //重新调一遍页面数据的方法 + onRefresh(){ + // 车辆归属地 + this.getHomeData() + // 车辆类型占比与停留时间 + this.getCarTypeTime() + // 车辆价值与停留时间分析 + this.getTimeAnalysis('') + //入区率占比 + this.getPercentEntry() + }, //获得标签 async getLabelDetail(){ //六个标签 @@ -202,23 +288,13 @@ export default { }, //当前最近的服务区数据 async nearestService(){ - let seat = uni.getStorageSync('seatInfo'); - let req = { - longitude:seat.longitude, - Province_Code:'340000', - latitude:seat.latitude, + let storeServiceInfo = uni.getStorageSync('currentService') + let nearServiceInfo = uni.getStorageSync('nearService') + if (storeServiceInfo){ + this.serviceInfo = storeServiceInfo + }else { + this.serviceInfo = nearServiceInfo } - console.log('req',req) - const data = await request.$webGet('CommercialApi/BaseInfo/GetServerpartList',req) - console.log('nearestService',data) - let res = { - SERVERPART_NAME:data.Result_Data.List[0].SERVERPART_NAME,//服务区 - SPREGIONTYPE_NAME:data.Result_Data.List[0].SPREGIONTYPE_NAME,//片区 - Serverpart_ID:data.Result_Data.List[0].SERVERPART_ID, - longitude:data.Result_Data.List[0].SERVERPART_X, - latitude:data.Result_Data.List[0].SERVERPART_Y, - } - uni.setStorageSync('currentService',res) }, //跳转到地图 handleGoSelectService() { @@ -263,21 +339,18 @@ export default { // },2000) // } - }, - bindPickerChange:function (e){ }, getCarData(){ - console.log('this.serviceInfo',this.serviceInfo) request.$webGet('CommercialApi/Revenue/GetBayonetEntryList',{ StatisticsDate: this.time, - Serverpart_ID :this.serviceInfo.Serverpart_ID + Serverpart_ID :this.serviceInfo.Serverpart_ID, + ShowAddUpCount:true }).then(res=>{ - console.log('res.Result_Data.List',res) this.carData = res.Result_Data.List }) }, getHomeData(){ - const date = new Date(this.time) + const date = new Date(this.endTime?this.endTime:this.time) let y = date.getFullYear() let m = date.getMonth() + 1 if (m<10){ @@ -326,7 +399,7 @@ export default { }, getCarTypeTime(){ request.$webGet('CommercialApi/Revenue/GetBayonetSTAList',{ - StatisticsDate:this.time, + StatisticsDate:this.endTime?this.endTime:this.time, Serverpart_ID:this.serviceInfo.Serverpart_ID, ContainWhole:true }).then(res=>{ @@ -335,12 +408,14 @@ export default { result.forEach(item=>{ let stayTime = [] let carType = [] + let valueList = [] let typeAll = 0 item.StayTimesList.forEach(subItem=>{ stayTime.push(Number(subItem.value)) }) item.VehicleCountList.forEach(subItem=>{ typeAll+=Number(subItem.value) + valueList.push(subItem.value) }) item.VehicleCountList.forEach(subItem=>{ @@ -354,7 +429,7 @@ export default { }) series.push({ index:0, - name:'车辆类型',data:carType + name:'车辆类型',data:carType,valueList:valueList }) }) this.carTypeTimeDataAll[0] ={categories:result[0].Vehicle_Type, series:[series[1],series[0]]} @@ -368,7 +443,7 @@ export default { // {name:'停留时间',data:[62,38,50,84]}] }, getTimeAnalysis(data){ - const date = new Date(this.time) + const date = new Date(this.endTime?this.endTime:this.time) let y = date.getFullYear() let m = date.getMonth()+1 m = m<10?'0'+m:m @@ -377,7 +452,8 @@ export default { EndMonth:`${y}${m}`, Province_Code:'340000', Serverpart_ID:this.serviceInfo.Serverpart_ID, - Serverpart_Region: data + Serverpart_Region: data, + TimeSpan: 2 }).then(res=>{ let result = res.Result_Data.List this.timeAnalysisData = result @@ -391,14 +467,33 @@ export default { // ] }, getPercentEntry(){ + const date = new Date(this.single) + const nowDate = new Date() + let nowMonth = nowDate.getMonth() + 1 + let nowYear = nowDate.getFullYear() + let m = date.getMonth() + 1 + let y = date.getFullYear() + let endTime = '' + if (m === nowMonth && nowYear === y){ + endTime = this.time + }else{ + endTime = this.endTime + } request.$webGet('CommercialApi/Revenue/GetSPBayonetList',{ - Statistics_Date: this.time, + Statistics_Date: this.endTime?endTime:this.time, Province_Code:'340000', Serverpart_ID :this.serviceInfo.Serverpart_ID, GroupType:2 }).then(res=>{ this.percentEntryDataAll = [ res.Result_Data.List, [res.Result_Data.List[0]], [res.Result_Data.List[1]]] this.percentEntryData = this.percentEntryDataAll[this.selectTab] + let Vehicle_CountAll=0 + let SectionFlow_CountAll=0 + this.percentEntryData.forEach(item=>{ + Vehicle_CountAll+= item.Vehicle_Count + SectionFlow_CountAll+= item.SectionFlow_Count + }) + this.allEntry = ((Vehicle_CountAll/SectionFlow_CountAll)*100).toFixed(2) }) } } @@ -614,6 +709,62 @@ export default { box-sizing: border-box; padding: 28px 16px 0; .chartsItem{ + .top{ + display: flex; + justify-content: space-between; + align-items: center; + .title{ + font-size: 34rpx; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 48rpx; + } + .value{ + font-size: 14px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 20px; + } + } + .time{ + margin-bottom: 4px; + .thisTime{ + font-size: 14px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 500; + color: #160002; + } + .select{ + margin-left: 8px; + display: inline-block; + .time { + display: flex; + align-items: center; + margin-right: 4px; + .day { + font-size: 32rpx; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #782717; + line-height: 44rpx; + margin-right: 4px; + } + .uni-input { + font-size: 14px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #ae664e; + line-height: 36rpx; + } + .icon { + width: 24px; + height: 16px; + } + } + } + } .tab{ width: 100%; height: 38px; diff --git a/pages/commercialBI/components/analyse.vue b/pages/commercialBI/components/analyse.vue index c1567f9..d607d58 100644 --- a/pages/commercialBI/components/analyse.vue +++ b/pages/commercialBI/components/analyse.vue @@ -60,7 +60,6 @@ export default { diff --git a/pages/commercialBI/components/bussiness/bestsellerShop.vue b/pages/commercialBI/components/bussiness/bestsellerShop.vue index 4fd2032..72d5a9e 100644 --- a/pages/commercialBI/components/bussiness/bestsellerShop.vue +++ b/pages/commercialBI/components/bussiness/bestsellerShop.vue @@ -122,9 +122,14 @@ export default { flex-direction: column; justify-content: center; align-items: center; + position: relative; .canvas{ width: 100%; height: 170px; + overflow: hidden; + .hotSales{ + position: absolute; + } } .list{ width: 90%; diff --git a/pages/commercialBI/components/car/carTypeTime.vue b/pages/commercialBI/components/car/carTypeTime.vue index 691b16f..17bb24b 100644 --- a/pages/commercialBI/components/car/carTypeTime.vue +++ b/pages/commercialBI/components/car/carTypeTime.vue @@ -1,13 +1,9 @@ @@ -29,6 +25,7 @@ export default { analysisins_type: 1104, analysisins_format: 2000 }, + num:0 } }, props: { @@ -40,17 +37,34 @@ export default { watch: { data: { handler(value) { - if (value){ - this.isShowData = true - } + console.log('value232312',value) this.info = value this.carTypeTimePath='' this.handleCarData(value) }, + immediate:true, deep:true } }, methods: { + //点击事件 + handleTap(e){ + uChartsInstance[e.target.id].showToolTip(e,{ + formatter: (item, category, index, opts) =>{ + console.log('item',item) + console.log('opts',opts) + console.log('category',category) + console.log('index',index) + if (this.num===0){ + this.num++ + return item.name + ":" + opts.series[0].valueList[index] + '辆'; + }else{ + this.num=0 + return item.name + ":" + item.data + '分'; + } + } + }); + }, // 处理传入的数据 handleCarData(value) { let res = { @@ -124,7 +138,7 @@ export default { } }); setTimeout( ()=>{ - this.canvasToTempImage('carTypeTime') + // this.canvasToTempImage('carTypeTime') },1000) }, canvasToTempImage(id){ diff --git a/pages/commercialBI/components/car/entryZone.vue b/pages/commercialBI/components/car/entryZone.vue index 2ecdde8..ca640bd 100644 --- a/pages/commercialBI/components/car/entryZone.vue +++ b/pages/commercialBI/components/car/entryZone.vue @@ -1,31 +1,56 @@ @@ -92,6 +136,23 @@ export default { font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; color: #FFFFFF; + .text{ + position: absolute; + padding: 0 5px; + z-index: 9; + left: 50px;top: -25px; + background: rgba(0,0,0,0.6); + color:#fff; + border-radius: 2px; + display: flex; + align-items: center; + .icon{ + width: 10px; + height: 10px; + background: #1E80FF; + margin-right: 4px; + } + } .big{ display: flex; align-items: center; @@ -102,6 +163,25 @@ export default { border-radius:0 2px 2px 0; box-sizing: border-box; padding-left: 4px; + .text{ + width: 120px; + height: 26px; + position: absolute; + z-index: 9; + left: 0;top: 0; + transform: translateX(-100%); + background: rgba(0,0,0,0.6); + color:#fff; + border-radius: 2px; + display: flex; + align-items: center; + .icon{ + width: 10px; + height: 10px; + background: #1E80FF; + margin-right: 4px; + } + } } .normal{ display: flex; @@ -110,6 +190,25 @@ export default { position: absolute; box-sizing: border-box; padding-left: 4px; + .text{ + width: 130px; + height: 26px; + position: absolute; + z-index: 9; + left: 0;top: 0; + transform: translateX(-100%); + background: rgba(0,0,0,0.6); + color:#fff; + border-radius: 2px; + display: flex; + align-items: center; + .icon{ + width: 10px; + height: 10px; + background: #1E80FF; + margin-right: 4px; + } + } } .normal:after{ position: absolute; @@ -129,6 +228,23 @@ export default { box-sizing: border-box; padding-left: 4px; border-radius:2px 0 0 2px; + .text{ + position: absolute; + padding: 0 5px; + z-index: 9; + left: 50px;top: -25px; + background: rgba(0,0,0,0.6); + color:#fff; + border-radius: 2px; + display: flex; + align-items: center; + .icon{ + width: 10px; + height: 10px; + background: #1E80FF; + margin-right: 4px; + } + } } .small:after{ position: absolute; diff --git a/pages/commercialBI/components/guest/customerSecond.vue b/pages/commercialBI/components/guest/customerSecond.vue index 51bd5ce..949082c 100644 --- a/pages/commercialBI/components/guest/customerSecond.vue +++ b/pages/commercialBI/components/guest/customerSecond.vue @@ -18,8 +18,12 @@
-
-
+
+ 男生{{man}}% +
+
+ 女生{{woman}}% +
@@ -38,7 +42,8 @@ export default { man:0, woman:0, width:0,//手机宽度 - customerSecondPath:''//路径 + customerSecondPath:'',//路径 + genderList:[false,false], } }, props: { @@ -52,10 +57,20 @@ export default { handler(value) { console.log('gender', value) this.handleCarData(value) - } + }, + deep:true, + immediate:true, } }, methods:{ + handleShow(num){ + let list = [] + this.genderList.forEach(()=>{ + list.push(false) + }) + this.genderList = list + this.genderList[num] = true + }, // 处理传入的数据 handleCarData(value) { this.man = value.man @@ -74,7 +89,7 @@ export default { type: "bubble", context: ctx, width: _this.width, - height: 193, + height: 183, series: data.series, animation: false, rotate: false, @@ -209,6 +224,16 @@ export default { background: #1E80FF; margin-right: 2px; border-radius: 2px 0 0 2px; + .meng{ + position: absolute; + display: inline-block; + padding: 0 5px; + z-index: 9; + left: 0;top: -10px; + background: rgba(0,0,0,0.6); + color:#fff; + border-radius: 2px; + } } .man:after{ position: absolute; @@ -226,6 +251,16 @@ export default { right: 0;top: 0; background: #00C2FF; border-radius: 0 2px 2px 0 ; + .meng{ + position: absolute; + display: inline-block; + padding: 0 5px; + z-index: 9; + right: 0;top: -10px; + background: rgba(0,0,0,0.6); + color:#fff; + border-radius: 2px; + } } .woman:after{ position: absolute; diff --git a/pages/commercialBI/components/headerTop.vue b/pages/commercialBI/components/headerTop.vue index f3a84e5..0007306 100644 --- a/pages/commercialBI/components/headerTop.vue +++ b/pages/commercialBI/components/headerTop.vue @@ -118,7 +118,7 @@ export default { let req = { SearchParameter:{ STATISTICS_DATE:storeTime, - ANALYSISINS_TYPE:this.analyseInfo.analysisins_type1, + ANALYSISINS_TYPE:this.analyseInfo.analysisins_type, ANALYSISINS_FORMAT:1000, ANALYSISINS_STATE:1, SERVERPART_ID:storeServiceInfo.Serverpart_ID, @@ -130,7 +130,7 @@ export default { let reqText = { SearchParameter:{ STATISTICS_DATE:storeTime, - ANALYSISINS_TYPE:this.analyseInfo.analysisins_type2, + ANALYSISINS_TYPE:this.analyseInfo.analysisins_type, ANALYSISINS_FORMAT:2000, ANALYSISINS_STATE:1, SERVERPART_ID:storeServiceInfo.Serverpart_ID, diff --git a/pages/commercialBI/components/manager/contractGuarantee.vue b/pages/commercialBI/components/manager/contractGuarantee.vue index 49ccd05..71866c5 100644 --- a/pages/commercialBI/components/manager/contractGuarantee.vue +++ b/pages/commercialBI/components/manager/contractGuarantee.vue @@ -1,8 +1,8 @@