This commit is contained in:
cclu 2023-04-12 19:06:57 +08:00
parent 3ed8af69d4
commit d29a5fc4e7
22 changed files with 785 additions and 347 deletions

View File

@ -5,7 +5,8 @@
"style":
{
"navigationBarTitleText": "驿达数智化看板",
"navigationStyle": "custom"
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{

View File

@ -43,7 +43,6 @@
<div style="display: flex;align-items: center;justify-content: space-between">
<p class="title">入区车流分析</p>
<div class="item">
<text class="value">日期</text>
<text class="value">{{time}}</text>
</div>
</div>
@ -54,9 +53,18 @@
<no-data v-else :type="'car'"/>
</div>
<div class="chartsItem" style="margin-top: 32px">
<p class="title">{{thisMonth?thisMonth:'-'}}月入区车辆累计</p>
<div>
<month-total :data="monthTotalList"/>
<analyse :analyseInfo="{analysisins_type: 1103,analysisins_format: 2000}" />
</div>
</div>
<div class="chartsItem" style="margin-top: 32px">
<div class="time">
<text class="thisTime">统计月份: </text>
<text class="thisTime"></text>
<div class="select">
<picker mode="date" fields="month" :value="single" :end="endData" @change="bindDateChange" >
<view class="time">
@ -67,10 +75,12 @@
</div>
</div>
<view class="tab" >
<view v-for="(item,index) in tabList" :key="index" :class="selectTab===item.value?'tabItem tabItemActive':'tabItem'" @click="handleChangeTab(item.value)">{{item.name}}{{index!==0?'':''}}</view>
<view v-for="(item,index) in tabList" :key="index" :class="selectTab===item.value?'tabItem tabItemActive':'tabItem'" @click="handleChangeTab(item.value)">{{item.name}}</view>
</view>
<p class="title">{{thisMonth?thisMonth:'-'}}月车辆归属地</p>
<div v-if="cityPlaceAll.length>0">
<div v-if="homePlace.length>0">
<home-place :homeData="homePlace" :homeCity="cityPlace" />
<analyse :analyseInfo="{analysisins_type: 1103,analysisins_format: 2000}" />
</div>
@ -86,16 +96,23 @@
</div>
<div class="chartsItem" style="margin-top: 32px">
<p class="title">{{thisMonth?thisMonth:'-'}}月车车辆类型-停留时间日均</p>
<div v-if="timeAnalysisData.length>0">
<div v-if="timeAnalysisData.series.length>0">
<time-analysis :data="timeAnalysisData"/>
<analyse :analyseInfo="{analysisins_type: 1105,analysisins_format: 2000}" />
</div>
<no-data v-else :type="'car'"/>
</div>
<div class="chartsItem" style="margin-top: 32px">
<div class="top">
<div class="topItem" >
<p class="title">{{thisMonth?thisMonth:'-'}}月入区率占比</p>
<text class="value">{{allEntry?allEntry:'-'}}%</text>
<div class="box" v-if="allEntry">
<text class="value">{{allEntry?allEntry:'-'}}%</text>
<view class="right">
<image class="arrowTop" :src="Number(addAllEntry)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<text class="text">{{addAllEntry?Math.abs(addAllEntry) + '%':'-' + '%'}}</text>
</view>
</div>
</div>
<div v-if="percentEntryData.length>0">
<percent-entry :data="percentEntryData" />
@ -121,7 +138,7 @@ 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 MonthTotal from "./components/car/monthTotal.vue";
import NoData from "./components/noData.vue";
import Analyse from "./components/analyse.vue";
export default {
@ -139,8 +156,9 @@ export default {
chartData:{},
selectTab: 0,
tabIsTrue: true,
tabList:[{name:'全部',value:0},{name:'东',value:1},{name:'西',value:2}],//
tabList:[],//
carNumAll : 0,//
monthTotalList:[],//
carData:[],//
homePlaceAll:[],//
homePlace:[],//
@ -159,17 +177,17 @@ export default {
endTime:'',
thisMonth:'',//
allEntry:'',//
endData:''//
addAllEntry:'',//
endData:'',//
}
},
components: {Analyse, NoData, PercentEntry, CarTypeTime, HomePlace, EntryZone,timeAnalysis},
components: {Analyse, NoData, PercentEntry, CarTypeTime, HomePlace, EntryZone,timeAnalysis,MonthTotal},
computed:{
isHaveData(){
return true
}
},
onLoad(option){
console.log('option',option)
this.backType = option.type
},
onShow(){
@ -207,7 +225,10 @@ export default {
}else{
this.serviceInfo = storeServiceInfo
}
console.log('this.serviceInfo',this.serviceInfo)
//
this.getServiceInfo()
//
this.getMonthTotalList()
//
this.getCarData()
//
@ -225,6 +246,27 @@ export default {
},
methods:{
//
async getServiceInfo(){
let id = ''
let currentService = uni.getStorageSync('currentService')
let nearService = uni.getStorageSync('nearService')
if (!currentService){
id = nearService.Serverpart_ID
}else{
id = currentService.Serverpart_ID
}
let req = {
ServerpartId:id
}
const total = await request.$webGet('CommercialApi/BaseInfo/GetServerpartInfo',req)
console.log('totalsdskadja',total)
let tabList = [{name:'全部',value:0}]
total.Result_Data.RegionInfo.forEach((item,index)=>{
tabList.push({name:item.SERVERPART_REGIONNAME,value:index+1})
})
this.tabList = tabList
},
//
bindDateChange(e){
const date = new Date(e.detail.value)
@ -325,20 +367,53 @@ export default {
// if (this.tabIsTrue){
this.selectTab = value
//
this.homePlace = this.homePlaceAll[this.selectTab]
this.cityPlace = this.cityPlaceAll[this.selectTab]
this.homePlace = this.homePlaceAll[this.selectTab]?this.homePlaceAll[this.selectTab]:[]
this.cityPlace = this.cityPlaceAll[this.selectTab]?this.cityPlaceAll[this.selectTab]:[]
//
this.carTypeTimeData = this.carTypeTimeDataAll[this.selectTab]
this.carTypeTimeData = this.carTypeTimeDataAll[this.selectTab]?this.carTypeTimeDataAll[this.selectTab]:[]
//
this.getTimeAnalysis(Serverpart_Region)
//
this.percentEntryData = this.percentEntryDataAll[this.selectTab]
// this.tabIsTrue = false
// setTimeout(()=>{
// this.tabIsTrue = true
// },2000)
this.getPercentEntry(this.tabList[this.selectTab].name)
// }
},
async getMonthTotalList(){
const req = {
StatisticsDate:this.endTime?this.endTime:this.time,
Serverpart_ID:this.serviceInfo.Serverpart_ID
}
const data = await request.$webGet('CommercialApi/BigData/GetMonthAnalysis',req)
let monthList = []
let carCount = []
let moneyCount = []
let info = []
data.Result_Data.List.forEach(item=>{
monthList.push(item.Statistics_Month + '月')
carCount.push(Number((item.Vehicle_Count / 10000).toFixed(0)))
moneyCount.push(Number((item.RevenueAmount / 10000).toFixed(0)))
// showTip
info.push({
allCarCount : item.Vehicle_Count,
region:item.RegionList,
rate:item.Entry_Rate,
money:item.RevenueAmount
})
})
let res = {
categories: monthList,
series:[{name:'车流量',data:carCount,type:'column',index:0,info:info},
{name:'交易金额',data:moneyCount,type:'line',index:1}]
}
this.monthTotalList = res
// categories: ["","","",""],
// series: [{name:'',data:[30,38,20,10]},
// {name:'',data:[20,17,23,32]},
// {name:'',data:[62,38,50,84]}]
},
getCarData(){
request.$webGet('CommercialApi/Revenue/GetBayonetEntryList',{
@ -362,6 +437,7 @@ export default {
Serverpart_ID:this.serviceInfo.Serverpart_ID,
ContainWhole:true
}).then(res=>{
console.log('resfdkfjdks',res)
//
let result = res.Result_Data.List
result.forEach(item=>{
@ -390,9 +466,11 @@ export default {
})
//
this.cityPlaceAll = cityList
console.log('this.cityPlaceAll',this.cityPlaceAll)
this.cityPlace = cityList[this.selectTab]
//
this.homePlaceAll = dataList
console.log('this.homePlaceAll',this.homePlaceAll)
this.homePlace = dataList[this.selectTab]
})
@ -456,17 +534,39 @@ export default {
TimeSpan: 2
}).then(res=>{
let result = res.Result_Data.List
this.timeAnalysisData = result
// this.timeAnalysisData = result
let categories = [0,2,4,6,8,10,12,14,16,18,20,22]
let series = []
result.forEach(item=>{
let obj = {name:'',data:[]}
obj.name = item.name
let valueList = []
item.data.forEach(subItem=>{
valueList.push(Number((subItem[1] * 60).toFixed(0)))
})
obj.data = valueList
series.push(obj)
})
let list = {
categories:categories,
series:series
}
this.timeAnalysisData = list
console.log('this.timeAnalysisData',this.timeAnalysisData)
})
// let res = [
// {name:'',data:[[3,3,10],[10,1.5,10],[18,0.5,5],[22,2.5,10]]},
// {name:'',data:[[3,1.5,10],[4,2.7,10],[14,2.3,10],[18,1.4,0.50]]},
// {name:'',data:[[2,0.7,2],[5,0.2,1],[7,0.7,3],[22,1.9,6]]}
// ]
// res = {
// categories: ["2018","2019","2020","2021","2022","2023"],
// series: [
// {name: "A", data: [35,8,25,37,4,20]},
// {name: "B", data: [70,40,65,100,44,68]},
// {name: "C", data: [100,80,95,150,112,132]}
// ]
// }
},
getPercentEntry(){
getPercentEntry(type){
const date = new Date(this.single)
const nowDate = new Date()
let nowMonth = nowDate.getMonth() + 1
@ -479,21 +579,36 @@ export default {
}else{
endTime = this.endTime
}
request.$webGet('CommercialApi/Revenue/GetSPBayonetList',{
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)
let req = {}
if (type==='全部' || !type){
req = {
Statistics_Date: this.endTime?endTime:this.time,
Province_Code:'340000',
Serverpart_ID :this.serviceInfo.Serverpart_ID,
GroupType:2,
ShowGrowthRate:true
}
}else{
req = {
Statistics_Date: this.endTime?endTime:this.time,
Province_Code:'340000',
Serverpart_ID :this.serviceInfo.Serverpart_ID,
GroupType:2,
ShowGrowthRate:true,
Serverpart_Region:type.slice(0,1)
}
}
request.$webGet('CommercialApi/Revenue/GetSPBayonetList',req).then(res=>{
this.percentEntryData = res.Result_Data.List
if (this.percentEntryData.length>0){
this.allEntry = res.Result_Data.List[0].Entry_Rate
this.addAllEntry = res.Result_Data.List[0].Entry_GrowthRate
}else{
this.allEntry = ''
this.addAllEntry = ''
}
})
}
}
@ -728,6 +843,54 @@ export default {
line-height: 20px;
}
}
.topItem{
display: flex;
justify-content: space-between;
align-items: center;
.title{
font-size: 17px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #160002;
line-height: 24px;
}
.box{
display: flex;
align-items: center;
.value{
font-size: 16px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 600;
color: #000;
line-height: 20px;
}
.right{
margin-left: 4px;
display: flex;
align-items: center;
.arrowTop {
width: 14px;
height: 14px;
margin-right: 4px;
}
.text {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #782717;
line-height: 20px;
margin-right: 4px;
}
.compare {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #c97e64;
line-height: 20px;
}
}
}
}
.time{
margin-bottom: 4px;
.thisTime{

View File

@ -25,7 +25,6 @@ export default {
watch:{
analyseInfo:{
handler(value){
console.log('analyseInfowatch',value)
this.getLabelDetail()
},
immediate:true,

View File

@ -37,7 +37,6 @@ export default {
watch: {
data: {
handler(value) {
console.log('value232312',value)
this.info = value
this.carTypeTimePath=''
this.handleCarData(value)
@ -51,10 +50,6 @@ export default {
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] + '辆';
@ -64,6 +59,7 @@ export default {
}
}
});
uChartsInstance[e.target.id].touchLegend(e);
},
//
handleCarData(value) {
@ -113,7 +109,7 @@ export default {
min: 0,
max: 100,
titleOffsetY: -5,
axisLineColor:"#F2F2F5"
axisLineColor:"#F2F2F5"
},
{
title:'单位: 分钟',

View File

@ -1,47 +1,47 @@
<template>
<div style="min-height: 100px;">
<div class="car">
<div class="item" style="left: -16px;width: calc(46% + 16px)">
<div class="item" style="left: -16px;width: calc(220px)">
<canvas style="left: 0" v-if="!carNumPath" class="carNum" canvas-id="carNum" id="carNum"/>
<image style="left: 0" v-if="carNumPath" class="carNum" :src="carNumPath"></image>
</div>
<div class="item" style="right: -16px;width: calc(54% + 16px)">
<div class="item" style="right: -16px;width: calc(200px)">
<canvas style="right: 0" v-if="!probabilityPath" class="carNum" canvas-id="probability" id="probability"/>
<image style="right: 0" v-if="probabilityPath" class="carNum" :src="probabilityPath"></image>
</div>
</div>
<div class="info">
<div class="item">
<text class="title">{{month}}月累计</text>
</div>
<div class="other">
<div class="item">
<p class="title">
<text class="text">入区</text>
<text class="textRight">{{allAddUpCount}}</text>
</p>
<div class="box">
<p class="value" v-for="(item,index) in dataList" :key="index">
<text class="text">{{item.Serverpart_Region + '区 '}}</text>
<text class="textRight">{{item.AddUpCount + '辆' }}</text>
</p>
</div>
<!-- <div class="info">-->
<!-- <div class="item">-->
<!-- <text class="title">{{month}}月累计</text>-->
<!-- </div>-->
<!-- <div class="other">-->
<!-- <div class="item">-->
<!-- <p class="title">-->
<!-- <text class="text">入区</text>-->
<!-- <text class="textRight">{{allAddUpCount}}</text>-->
<!-- </p>-->
<!-- <div class="box">-->
<!-- <p class="value" v-for="(item,index) in dataList" :key="index">-->
<!-- <text class="text">{{item.Serverpart_Region + '区 '}}</text>-->
<!-- <text class="textRight">{{item.AddUpCount + '辆' }}</text>-->
<!-- </p>-->
<!-- </div>-->
</div>
<div class="item">
<p class="title">
<text class="text">入区率</text>
<text class="textRight">{{ allEntryAddUpRate }}%</text>
</p>
<div class="box">
<p class="value" v-for="(item,index) in dataList" :key="index">
<text class="text">{{item.Serverpart_Region + '区 '}}</text>
<text class="textRight">{{item.EntryAddUp_Rate + '%' }}</text>
</p>
</div>
</div>
</div>
</div>
<!-- </div>-->
<!-- <div class="item">-->
<!-- <p class="title">-->
<!-- <text class="text">入区率</text>-->
<!-- <text class="textRight">{{ allEntryAddUpRate }}%</text>-->
<!-- </p>-->
<!-- <div class="box">-->
<!-- <p class="value" v-for="(item,index) in dataList" :key="index">-->
<!-- <text class="text">{{item.Serverpart_Region + '区 '}}</text>-->
<!-- <text class="textRight">{{item.EntryAddUp_Rate + '%' }}</text>-->
<!-- </p>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
</template>
@ -85,7 +85,6 @@ export default {
watch:{
carData:{
handler(value){
console.log('valuefirst',value)
if (value.length>0){
this.isShowData = true
}
@ -161,8 +160,6 @@ export default {
title:this.entryRate,
subtitle:"昨日入区率"
}
console.log('res1111',res)
console.log('probabilityRes1111',probabilityRes)
this.drawCharts('carNum' , res,configCarNum )
this.drawCharts2('probability',probabilityRes,config)
},
@ -170,12 +167,10 @@ export default {
const ctx = uni.createCanvasContext(id, this);
let _this = this
let phoneInfo = uni.getStorageSync('phoneInfo')
this.width = (phoneInfo.screenWidth ) / 2
console.log('this.width',this.width)
uChartsInstance[id] = new uCharts({
type: "ring",
context: ctx,
width: _this.width,
width: 200,
height: 208,
series: data.series,
animation: false,
@ -227,7 +222,7 @@ export default {
uChartsInstance[id] = new uCharts({
type: "ring",
context: ctx,
width: 215,
width: 210,
height: 208,
series: data.series,
animation: false,

View File

@ -6,12 +6,12 @@
<image v-if="homePlacePath" class="carNum" :src="homePlacePath"></image>
</div>
<div class="homeCity">
<div class="dashed box1"></div>
<div class="dashed box2"></div>
<div class="dashed box3"></div>
<div class="dashed box4"></div>
<div class="dashed box5"></div>
<div class="dashed box6"></div>
<!-- <div class="dashed box1"></div>-->
<!-- <div class="dashed box2"></div>-->
<!-- <div class="dashed box3"></div>-->
<!-- <div class="dashed box4"></div>-->
<!-- <div class="dashed box5"></div>-->
<!-- <div class="dashed box6"></div>-->
<view class="item" v-for="(item,index) in progressList" :key="index" @click="handleShow(index)">
<view class="top">
<p class="title">{{item.name}}</p>
@ -22,14 +22,14 @@
<view class="meng" v-if="selectIndex === index">{{item.value}}</view>
</view>
</view>
<div class="notice">
<text class="noticeInfo notice1">0%</text>
<text class="noticeInfo notice2">20%</text>
<text class="noticeInfo notice3">40%</text>
<text class="noticeInfo notice4">60%</text>
<text class="noticeInfo notice5">80%</text>
<text class="noticeInfo notice6">100%</text>
</div>
<!-- <div class="notice">-->
<!-- <text class="noticeInfo notice1">0%</text>-->
<!-- <text class="noticeInfo notice2">20%</text>-->
<!-- <text class="noticeInfo notice3">40%</text>-->
<!-- <text class="noticeInfo notice4">60%</text>-->
<!-- <text class="noticeInfo notice5">80%</text>-->
<!-- <text class="noticeInfo notice6">100%</text>-->
<!-- </div>-->
</div>
</div>
</div>
@ -104,7 +104,6 @@ export default {
},
//
handleCarData(value) {
console.log('value',value)
let list = []
value.forEach(item=>{
list.push(item.data)

View File

@ -0,0 +1,139 @@
<template>
<div class="main">
<canvas class="canvas" canvas-id="monthTotal" id="monthTotal" @tap="handleTap"/>
</div>
</template>
<script>
import uCharts from '@/components/u-charts.js';
var uChartsInstance = {};
export default {
name: "monthTotal",
data(){
return {
}
},
props: {
data: {
type: Object,
default: () => {}
}
},
watch: {
data: {
handler(value) {
this.handleCarData(value)
},
immediate:true,
deep:true
}
},
methods:{
handleTap(e){
uChartsInstance[e.target.id].showToolTip(e,{
formatter: (item, category, index, opts) => {
let text = ''
if (item.name === '车流量'){
text = `入区 ${opts.series[0].info[index].allCarCount} 辆, 入区率 ${opts.series[0].info[index].rate} %`
return text
}else{
return `金额 ${opts.series[0].info[index].money} 元, 单车价值 ${((opts.series[0].info[index].money) / opts.series[0].info[index].allCarCount).toFixed(2)}`
}
}
});
},
//
handleCarData(value) {
let res = {
categories: value.categories,
series: value.series
}
this.drawCharts('monthTotal', res)
},
drawCharts(id, data) {
const ctx = uni.createCanvasContext(id, this);
let phoneInfo = uni.getStorageSync('phoneInfo')
let width = phoneInfo.screenWidth-32
uChartsInstance[id] = new uCharts({
type: "mix",
context: ctx,
width: width,
height: 300,
categories: data.categories,
series: data.series,
animation: false,
rotate: false,
rotateLock: false,
canvas2d: true,
background: "#FFFFFF",
color: ["#1E80FF", "#00B6FF","#38C275","#6B6FFF","#6B85AE"],
padding: [35, 10, 5, 5],
dataLabel: false,
enableScroll: false,
xAxis: {
disabled: false,
disableGrid: true,
axisLine: false,
fontColor: '#777777',
fontSize:data.categories.length<10 ? 13 : 11
},
yAxis:{
showTitle:true,
data:[{
position: "left",
title: '车流量 / 万辆 ',
disabled: false,
axisLine: false,
titleOffsetY: -5,
titleOffsetX: 15,
min: 0,
},
{
position: "right",
title: '交易金额 / 万元',
disabled: false,
axisLine: false,
titleOffsetY: -5,
titleOffsetX: -15,
min: 0,
}]
},
legend: {
show: true,
position: "bottom",
lineHeight: 25,
float:'center'
},
extra: {
mix:{
column:{
type: "group",
width: 12,
activeBgColor: "#000000",
activeBgOpacity: 0.08
},
line:{
type: "curve",
width: 2,
activeType: "hollow"
}
}
}
});
},
}
}
</script>
<style scoped lang="scss">
.main{
width: 100%;
height: 300px;
.canvas{
width: 100%;
height: 100%;
}
}
</style>

View File

@ -21,7 +21,7 @@
<div class="big" :style="{width:big+'%',right:0+'%'}" @click="handleShow(2)">
<div class="text" v-if="rateList[2]" :style="{left:'60%'}">
<div class="icon" style="background: #0FC862"></div>
<text style="margin-right: 4px"></text>
<text style="margin-right: 4px"></text>
<text>{{big}}%</text>
</div>
</div>
@ -32,10 +32,16 @@
<div class="list">
<div class="listItem" v-for="(item,index) in dataList" :key="index">
<div class="left">
<div style="margin-right: 4px" :class="index===0?'icon1':index===1?'icon2':index===2?'icon3':'icon'"></div>
<div style="margin-right: 4px" :class="item.title==='小型车'?'icon1':item.title==='中型车'?'icon2':item.title==='大型车'?'icon3':'icon'"></div>
<p class="smallTitle">{{item.title}}</p>
</div>
<p class="smallRate">{{item.value + '%'}}</p>
<div style="display: flex;align-items: center">
<p class="smallRate">{{item.value + '%'}}</p>
<view class="right">
<image class="arrowTop" :src="Number(item.addValue)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<text class="text">{{item.addValue?Math.abs(item.addValue) + '%':'-' + '%'}}</text>
</view>
</div>
</div>
</div>
</div>
@ -51,8 +57,9 @@ export default {
components: {Analyse, NoData},
data() {
return {
dataList:[{title:'小型车',value:''},{title:'中型车',value:''},{title:'大货车',value:''}],
dataList:[{title:'小型车',value:'',addValue:''},{title:'中型车',value:'',addValue:''},{title:'大型车',value:'',addValue:''}],
progress:0,//
addProgress:0,//
min:0,//
middle:0,//
big:0,//
@ -73,7 +80,7 @@ export default {
watch: {
data: {
handler(value) {
this.dataList = [{title:'小型车',value:''},{title:'中型车',value:''},{title:'大车',value:''}]
this.dataList = [{title:'小型车',value:''},{title:'中型车',value:''},{title:'大车',value:''}]
this.handleCarData(value)
},
immediate:true,
@ -91,7 +98,6 @@ export default {
},
//
handleCarData(value) {
console.log('value',value)
let Vehicle_CountAll=0
let SectionFlow_CountAll=0
let minAll = 0
@ -112,7 +118,18 @@ export default {
this.dataList[0].value = (minAll / Vehicle_CountAll*100).toFixed(2)
this.dataList[1].value = (middleAll / Vehicle_CountAll*100).toFixed(2)
this.dataList[2].value = (bigAll / Vehicle_CountAll*100).toFixed(2)
this.dataList[0].addValue = value[0].MinVehicleEntry_Rate
this.dataList[1].addValue = value[0].MediumVehicleEntry_Rate
this.dataList[2].addValue = value[0].LargeVehicleEntry_GrowthRate
let list = []
this.dataList.forEach(item=>{
if (Number(item.value)===0){
}else{
list.push(item)
}
})
this.dataList = list
for (let i=1;i<this.dataList.length;i++){
for (let j=1;j<this.dataList.length - 1;j++){
if (Number(this.dataList[i].value)>Number(this.dataList[j].value)){
@ -122,7 +139,6 @@ export default {
}
}
}
},
}
}
@ -281,6 +297,33 @@ export default {
color: #160002;
line-height: 20px;
}
.right{
width: 70px;
margin-left: 4px;
display: flex;
align-items: center;
justify-content: flex-end;
.arrowTop {
width: 14px;
height: 14px;
margin-right: 4px;
}
.text {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #782717;
line-height: 20px;
margin-right: 4px;
}
.compare {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #c97e64;
line-height: 20px;
}
}
}
}
}

View File

@ -26,13 +26,14 @@ export default {
},
props: {
data: {
type: Array,
default: () => []
type: Object,
default: () => {}
}
},
watch: {
data: {
handler(value) {
console.log('valueWatch',value)
this.handleCarData(value)
},
immediate:true,
@ -47,27 +48,11 @@ export default {
},
//
handleCarData(value) {
let list = []
value.forEach(item=>{
list.push({name:item.name,data:item.data})
})
value.forEach(item=>{
item.data.forEach(item=>{
item[1] = Number(item[1])
item[2] = item[1]*5
})
})
console.log('list',list)
let res = {
series:
list
// [{name:'',data:[[3,3,10],[10,1.5,10],[18,0.5,5],[22,2.5,10]]},
// {name:'',data:[[3,1.5,10],[4,2.7,10],[14,2.3,10],[18,1.4,0.50]]},
// {name:'',data:[[2,0.7,2],[5,0.2,1],[7,0.7,3],[22,1.9,6]]}]
categories:value.categories,
series:value.series
}
console.log('res',res)
console.log('res123123',res)
this.drawCharts('timeAnalysis', res)
},
drawCharts(id, data) {
@ -76,10 +61,11 @@ export default {
let phoneInfo = uni.getStorageSync('phoneInfo')
this.width = phoneInfo.screenWidth - 16
uChartsInstance[id] = new uCharts({
type: "bubble",
type: "line",
context: ctx,
width: _this.width,
height: 170,
height: 240,
categories: data.categories,
series: data.series,
animation: false,
rotate: false,
@ -87,33 +73,33 @@ export default {
rotateLock: false,
background: "#FFFFFF",
color: ["#1E80FF", "#00B6FF","#0FC862"],
padding: [10, 30, 5, 5],
padding: [15, 30, 5, 5],
dataLabel: false,
enableScroll: false,
xAxis: {
disableGrid: true,
gridType: "solid",
splitNumber: 6,
boundaryGap: "justify",
min: 0,
max: 24,
axisLineColor:"#F2F2F5",
formatter:(val)=>{
if (val===0 || val===4 || val===8 || val===12 || val===16 || val===20 || val===23){
if (val===23){
return '24:00'
}else{
return `${val}:00`
}
}else{
return ''
}
}
},
yAxis: {
disabled: false,
disableGrid: false,
gridType: "solid",
splitNumber: 5,
gridColor:'#F2F2F5',
data: [
{
min: 0,
max: 5,
unit:'h',
axisLineColor:"#F2F2F5",
}
]
gridType: "dash",
dashLength: 2,
showTitle:true,
data:[{
title:'单位: 分钟',
titleOffsetY: -5,
min:0,
max:180,
}]
},
legend: {
show: true,
@ -123,9 +109,10 @@ export default {
},
extra: {
bubble: {
border: 1,
opacity: 0.25
line: {
type: "curve",
width: 2,
activeType: "hollow"
}
}
});
@ -141,6 +128,7 @@ export default {
width: 100%;
.timeAnalysis{
width: 100%;
height: 220px;
margin-top: 12px;
}
}

View File

@ -1,7 +1,7 @@
<template>
<div class="consumPrefer">
<canvas v-if="!preferPath" class="prefer" canvas-id="prefer" id="prefer"/>
<image v-if="preferPath" class="prefer" :src="preferPath"></image>
<canvas class="prefer" canvas-id="prefer" id="prefer" @tap="tap"/>
<!-- <image v-if="preferPath" class="prefer" :src="preferPath"></image>-->
</div>
</template>
@ -31,6 +31,9 @@ export default {
}
},
methods: {
tap(e){
uChartsInstance[e.target.id].touchLegend(e);
},
//
handleCarData(value) {
console.log('value11111',value)
@ -77,7 +80,7 @@ export default {
}
});
setTimeout( ()=>{
this.canvasToTempImage('prefer')
// this.canvasToTempImage('prefer')
},2000)
},
canvasToTempImage(id){

View File

@ -6,23 +6,23 @@
<p class="title">{{item.name}}</p>
</div>
<div class="progress">
<div class="small" :style="{background:item.name==='男'?'#CAD0DA':'#C6D3D7',width:item.small + '%'}" @click="handleShow(item,index,0)">{{item.small<16?'':item.small + '%'}}
<div class="small" v-if="Number(item.small)!==0" :style="{background:item.name==='男'?'#CAD0DA':'#C6D3D7',width:item.small + '%'}" @click="handleShow(item,index,0)">{{item.small<16?'':item.small + '%'}}
<div class="text" v-if="item.showList[0]">
<div class="icon"></div>
<div class="icon" :style="{background:item.name==='男性'?'#CAD0DA':'#C6D3D7'}"></div>
<text style="margin-right: 4px">低消费</text>
<text>{{item.small}}%</text>
</div>
</div>
<div class="normal" :style="{background:item.name==='男'?'#ACB9CD':'#AFC1C6',width:item.normal + '%',left:item.small+'%'}" @click="handleShow(item,index,1)">{{item.normal<16?'':item.normal+'%'}}
<div class="normal" v-if="Number(item.normal)!==0" :style="{background:item.name==='男'?'#ACB9CD':'#AFC1C6',width:item.normal + '%',left:item.small+'%'}" @click="handleShow(item,index,1)">{{item.normal<16?'':item.normal+'%'}}
<div class="text" v-if="item.showList[1]">
<div class="icon"></div>
<div class="icon" :style="{background:item.name==='男性'?'#ACB9CD':'#AFC1C6'}"></div>
<text style="margin-right: 4px">普通消费</text>
<text>{{item.normal}}%</text>
</div>
</div>
<div class="big" :style="{background:item.name==='男'?'#1E80FF':'#00C2FF',left:(Number(item.small)+Number(item.normal))+'%', width:item.big+'%'}" @click="handleShow(item,index,2)">{{item.big<16?'':item.big + '%'}}
<div class="big" v-if="Number(item.big)!==0" :style="{background:item.name==='男性'?'#1E80FF':'#00C2FF',left:(Number(item.small)+Number(item.normal))+'%', width:item.big+'%'}" @click="handleShow(item,index,2)">{{item.big<16?'':item.big + '%'}}
<div class="text" v-if="item.showList[2]">
<div class="icon"></div>
<div class="icon" :style="{background:item.name==='男性'?'#1E80FF':'#00C2FF'}"></div>
<text style="margin-right: 4px">高消费</text>
<text>{{item.big}}%</text>
</div>
@ -32,15 +32,15 @@
<div class="imgKey">
<div style="margin: 0 auto;display: flex">
<div class="item">
<div class="icon" :style="{background:item.name==='男'?'#CAD0DA':'#C6D3D7'}"></div>
<div class="icon" :style="{background:item.name==='男'?'#CAD0DA':'#C6D3D7'}"></div>
<p class="consume">低消费</p>
</div>
<div class="item">
<div class="icon" :style="{background:item.name==='男'?'#ACB9CD':'#AFC1C6'}"></div>
<div class="icon" :style="{background:item.name==='男'?'#ACB9CD':'#AFC1C6'}"></div>
<p class="consume">普通消费</p>
</div>
<div class="item">
<div class="icon" :style="{background:item.name==='男'?'#1E80FF':'#00C2FF'}"></div>
<div class="icon" :style="{background:item.name==='男'?'#1E80FF':'#00C2FF'}"></div>
<p class="consume">高消费</p>
</div>
</div>
@ -96,9 +96,6 @@ export default {
this.genderList[1].showList[number] = true
}
this.$forceUpdate()
console.log('index',index)
console.log('number',number)
console.log('this.genderList',this.genderList)
}
}
}
@ -178,7 +175,6 @@ export default {
.icon{
width: 10px;
height: 10px;
background: #1E80FF;
margin-right: 4px;
}
}
@ -230,7 +226,8 @@ export default {
border-radius:2px 0 0 2px;
.text{
position: absolute;
padding: 0 5px;
width: 130px;
height: 26px;
z-index: 9;
left: 50px;top: -25px;
background: rgba(0,0,0,0.6);

View File

@ -26,8 +26,8 @@
</div>
</div>
<div class="charts">
<canvas v-if="!customerSecondPath" class="sexRatio" canvas-id="gender" id="gender"/>
<image class="sexRatio" v-if="customerSecondPath" :src="customerSecondPath"></image>
<canvas class="sexRatio" canvas-id="gender" id="gender" @tap="tap"/>
<!-- <image class="sexRatio" v-if="customerSecondPath" :src="customerSecondPath"></image>-->
</div>
</div>
</template>
@ -63,6 +63,9 @@ export default {
}
},
methods:{
tap(e){
uChartsInstance[e.target.id].touchLegend(e);
},
handleShow(num){
let list = []
this.genderList.forEach(()=>{
@ -89,7 +92,7 @@ export default {
type: "bubble",
context: ctx,
width: _this.width,
height: 183,
height: 240,
series: data.series,
animation: false,
rotate: false,
@ -109,13 +112,13 @@ export default {
xAxis: {
disableGrid: true,
gridType: "solid",
splitNumber:4,
splitNumber: 5,
boundaryGap: "justify",
title:'年龄: /岁',
titleOffsetY: 15,
titleOffsetX: -30,
min: 0,
max: 80,
min: 10,
max: 60,
axisLineColor:'#F2F2F5'
},
yAxis: {
@ -144,7 +147,7 @@ export default {
}
});
setTimeout( ()=>{
this.canvasToTempImage('gender')
// this.canvasToTempImage('gender')
},2000)
},
canvasToTempImage(id){
@ -276,7 +279,7 @@ export default {
.charts{
margin-top: 20px;
width: 100%;
height: 180px;
height: 220px;
.sexRatio{
width: 100%;
height: 100%;

View File

@ -1,7 +1,7 @@
<template>
<div class="moneyCompare">
<canvas v-if="!comparePath" class="compare" canvas-id="compare" id="compare"/>
<image v-if="comparePath" class="compare" :src="comparePath"></image>
<canvas class="compare" canvas-id="compare" id="compare" @tap="tap"/>
<!-- <image v-if="comparePath" class="compare" :src="comparePath"></image>-->
</div>
</template>
@ -25,6 +25,7 @@ export default {
watch: {
data: {
handler(value) {
console.log('营收对比value',value)
this.comparePath = ''
this.handleCarData(value)
},
@ -33,40 +34,20 @@ export default {
}
},
methods: {
tap(e){
uChartsInstance[e.target.id].showToolTip(e, {
formatter: (item, category, index, opts) => {
return item.name + ":" + item.data;
}
});
uChartsInstance[e.target.id].touchLegend(e);
},
//
handleCarData(value) {
console.log('value1',value)
let res = value
let config = {
price:'',
max:0
}
if (value.type===0){
config.price = '单位: 万元'
config.max = this.getNumberHundred(value.max)
}else if(value.type===1){
config.price = '单位: 笔'
config.max = this.getNumber(value.max)
}else if(value.type===2){
config.price = '单位: 元'
config.max = this.getNumber(value.max)
}
console.log('config',config)
this.drawCharts('compare', res,config)
this.drawCharts('compare', res)
},
getNumber(value){
let number = Number(value) / 20
number = Math.ceil(number)
console.log('number',number)
return number * 20
},
getNumberHundred(value){
let number = Number(value) / 2000
number = Math.ceil(number)
console.log(number)
return number * 2000
},
drawCharts(id, data,config) {
drawCharts(id, data) {
const ctx = uni.createCanvasContext(id, this);
let _this = this
let phoneInfo = uni.getStorageSync('phoneInfo')
@ -94,19 +75,20 @@ export default {
},
xAxis: {
disableGrid: true
disableGrid: true,
axisLineColor:'#F2F2F5'
},
yAxis: {
showTitle:true,
showTitle:false,
splitNumber:4,
gridColor:'#F2F2F5',
data: [
{
min: 0,
max: config.max,
title: config.price,
titleOffsetX:15,
titleOffsetY:-5,
fontSize:12,
axisLineColor:'#F2F2F5'
}
]
},
@ -122,7 +104,7 @@ export default {
}
});
setTimeout( ()=>{
this.canvasToTempImage('compare')
// this.canvasToTempImage('compare')
},2000)
},
canvasToTempImage(id){

View File

@ -47,7 +47,6 @@ export default {
watch: {
data: {
handler(value) {
console.log('carDatawatch', value)
this.handleCarData(value)
}
}

View File

@ -1,7 +1,6 @@
<template>
<div class="revenueTrends">
<canvas v-if="!trendsPath" class="trends" canvas-id="trends" id="trends"/>
<image v-if="trendsPath" class="trends" :src="trendsPath"></image>
<canvas class="trends" canvas-id="trends" id="trends" @tap="handleTap"/>
</div>
</template>
@ -24,13 +23,32 @@ export default {
watch: {
data: {
handler(value) {
console.log('carDatawatch', value)
this.trendsPath = ''
this.handleCarData(value)
},
immediate: true
}
},
methods: {
handleTap(e){
console.log('e',e)
uChartsInstance[e.target.id].showToolTip(e,{
formatter: (item, category, index, opts) => {
const date = new Date()
let month = date.getMonth() + 1
if (item.name === '今年'){
if (index + 1 <= month){
return item.name + ":" + item.data + ',' + `同比增长${((opts.series[0].data[index] - opts.series[1].data[index]) /opts.series[1].data[index] * 100).toFixed(2)}%`;
}else{
return item.name + ":" + item.data
}
}else{
return item.name + ":" + item.data;
}
}
});
uChartsInstance[e.target.id].touchLegend(e);
},
//
handleCarData(value) {
let res = value
@ -39,7 +57,6 @@ export default {
getNumber(value){
let number = value / 40
number = Math.ceil(number)
console.log(number)
return number * 40
},
drawCharts(id, data) {
@ -58,12 +75,12 @@ export default {
rotate: false,
rotateLock: false,
background: "#FFFFFF",
color: ["#1E80FF"],
color: ["#1E80FF","#00B6FF"],
padding: [15, 15, 5, 5],
dataLabel: false,
enableScroll: false,
legend: {
show: false,
show: true,
position: "bottom",
lineHeight: 25,
float: 'center'
@ -71,21 +88,20 @@ export default {
},
xAxis: {
disableGrid: true,
axisLineColor:'#F2F2F5'
axisLineColor:'#F2F2F5'
},
yAxis: {
splitNumber:4,
showTitle:true,
showTitle:false,
gridColor:'#F2F2F5',
data:[
{
min:0,
max:_this.getNumber(data.max),
title:'单位: 万',
titleOffsetY:-5,
titleOffsetX:-5,
fontSize:12,
axisLineColor:'#F2F2F5'
axisLineColor:'#F2F2F5'
}
]
},
@ -101,7 +117,7 @@ export default {
}
});
setTimeout( ()=>{
this.canvasToTempImage('trends')
// this.canvasToTempImage('trends')
},2000)
},
canvasToTempImage(id){

View File

@ -4,25 +4,28 @@
:serverpartName="serviceInfo.SERVERPART_NAME" :spregionTypeName="serviceInfo.SPREGIONTYPE_NAME" :serviceInfo="serviceInfo"/>
<div class="charts">
<div class="time">
<text class="thisTime">统计月份: </text>
<div class="select">
<picker mode="date" fields="month" :value="single" @change="bindDateChange" >
<view class="time">
<view class="uni-input" style="background: transparent;padding: 0;height:100%">{{ single }}</view>
<image class="icon" src="/static/images/index/arrow_bottom.svg"></image>
</view>
</picker>
</div>
</div>
<div class="chartsItem">
<p class="title">{{thisMonth?thisMonth:'-'}}月客群分析</p>
<div style="display: flex;align-items: center;justify-content: space-between">
<p class="title">{{thisMonth?thisMonth:'-'}}月客单分析</p>
<div class="item">
<text class="value">{{time}}</text>
</div>
</div>
<div v-if="customer">
<customer-first :analyseInfo="{analysisins_type: 1202,analysisins_format: 2000}" :data="customer" />
</div>
<no-data v-else />
</div>
<div class="chartsItem" style="margin-top: 32px">
<div class="time">
<div class="select">
<picker mode="date" fields="month" :value="single" :end="endData" @change="bindDateChange" >
<view class="time">
<view class="uni-input" style="background: transparent;padding: 0;height:100%">{{ single }}</view>
<image class="icon" src="/static/images/index/arrow_bottom.svg"></image>
</view>
</picker>
</div>
<p class="title">{{thisMonth?thisMonth:'-'}}月客群分析</p>
<div v-if="genderBubbleList.res.length>0">
<customer-second :data="genderBubbleList" />
@ -31,6 +34,7 @@
<no-data v-else />
</div>
<div class="chartsItem" style="margin-top: 32px">
</div>
<p class="title">{{thisMonth?thisMonth:'-'}}月客群消费偏好</p>
<div v-if="consterPreferList.series.length>0">
<consum-prefer :data="consterPreferList" />
@ -93,6 +97,7 @@ export default {
},
single:'',//
thisMonth:'',//
endData:'', //
}
},
onLoad(option){
@ -101,6 +106,7 @@ export default {
this.serviceInfo = serviceInfo
//
this.time = option.time
this.endData = new Date()
},
onShow(){
let storeTime = uni.getStorageSync('lastDay')
@ -157,8 +163,6 @@ export default {
},
//
onRefresh(){
//customer
this.getCustomer()
//
this.getGenderBubbleList()
//
@ -338,7 +342,7 @@ export default {
const data = await request.$webGet('CommercialApi/Customer/GetCustomerConsumeRatio',req)
let res = []
data.Result_Data.List.forEach(item=>{
res.push({name:item.name,big:item.data[3].toFixed(2),normal:(item.data[1]+item.data[2]).toFixed(2),small:item.data[0].toFixed(2)})
res.push({name:item.name,big:(item.data[3]+item.data[2]).toFixed(2),normal:(item.data[1]).toFixed(2),small:item.data[0].toFixed(2)})
})
// let res=[{name:'',big:'14.8',normal:'41.7',small:'43.5'},
@ -455,6 +459,15 @@ export default {
color: #160002;
line-height: 24px;
}
.item{
.value{
font-size: 14px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 400;
color: #160002;
line-height: 20px;
}
}
}
}
}

View File

@ -36,14 +36,22 @@
</div>
</div>
<div class="subItem">
<p class="title" style="margin-top: 20px">{{selectTab===0?'营收对比':selectTab===1?'客单对比':selectTab===2?'均价对比':''}}</p>
<div style="display: flex;align-items: center;justify-content: space-between">
<p class="title" style="margin-top: 20px">{{selectTab===0?'营收对比':selectTab===1?'客单对比':selectTab===2?'均价对比':''}}</p>
<text v-if="selectTab===0" style="margin-top: 12px">单位: </text>
<text v-if="selectTab===1" style="margin-top: 12px">单位: </text>
<text v-if="selectTab===2" style="margin-top: 12px">单位: </text>
</div>
<div v-if="moneyCompareList.series.length>0">
<money-compare :data="moneyCompareList"/>
</div>
<no-data v-else/>
</div>
<div class="subItem ">
<p class="title" style="margin-top: 20px">营收趋势</p>
<div style="display: flex;align-items: center;justify-content: space-between">
<p class="title" style="margin-top: 20px">营收趋势</p>
<text style="margin-top: 12px">单位: 万元</text>
</div>
<div v-if="trendsList.series.length>0">
<revenue-trends :data="trendsList"/>
</div>
@ -95,7 +103,7 @@
<text class="comparePlan">比计划 </text>
<view class="box2">
<image class="addIcon" :src="Number(monthAdd)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{monthAdd?monthAdd + '%':'-'}}</p>
<p class="text">{{monthAdd?Math.abs(monthAdd) + '%':'-'}}</p>
</view>
</view>
</view>
@ -144,7 +152,7 @@
<text class="comparePlan">比计划 </text>
<div class="box2">
<image class="addIcon" :src="Number(yearAdd)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{yearAdd?yearAdd + '%':''}}</p>
<p class="text">{{yearAdd?Math.abs(yearAdd) + '%':''}}</p>
</div>
</view>
</view>
@ -314,9 +322,7 @@ export default {
Province_Code:'340000',
latitude:seat.latitude,
}
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,//
@ -346,7 +352,6 @@ export default {
SPRegionType_ID:this.serviceInfo.SPRegionType_ID
}
let totalData = await request.$webGet('CommercialApi/Contract/GetContractAnalysis',req)
console.log('totalData123',totalData)
this.revenueList = {
ContractProfitLoss:totalData.Result_Data.ContractProfitLoss,
ShopCount:totalData.Result_Data.ShopCount,
@ -381,7 +386,6 @@ export default {
this.selectTab = value
this.revenue = this.revenueAll[this.selectTab]
this.moneyCompareList = this.revenue.list
console.log('this.moneyCompareList',this.moneyCompareList)
},
async getMoneyCompareList(){
let req = {
@ -389,7 +393,6 @@ export default {
ServerpartId:this.serviceInfo.Serverpart_ID
}
const data = await request.$webGet('CommercialApi/Revenue/GetRevenueCompare',req)
console.log('data123123123',data)
let RevenueAmount = [] //
let RevenueMax = 0
let TicketCountList = [] //
@ -399,7 +402,7 @@ export default {
data.Result_Data.RevenueAmountList.forEach(item=>{
let list = []
item.data.forEach(subItem=>{
let number = (subItem[1] /10000).toFixed(0)
let number = (subItem[1] ).toFixed(0)
if (number>RevenueMax){
RevenueMax = number
}
@ -409,7 +412,6 @@ export default {
})
data.Result_Data.TicketCountList.forEach(item=>{
let list = []
console.log('data.Result_Data.TicketCountList',data.Result_Data.TicketCountList)
item.data.forEach(subItem=>{
let number = (subItem[1]).toFixed(0)
if (number > TicketMax){
@ -419,7 +421,6 @@ export default {
})
TicketCountList.push({name:item.name,data:list})
})
console.log('TicketMax',TicketMax)
data.Result_Data.AvgTicketAmountList .forEach(item=>{
let list = []
item.data.forEach(subItem=>{
@ -465,7 +466,6 @@ export default {
}
]
this.revenue = this.revenueAll[this.selectTab]
console.log('this.revenueAll',this.revenueAll)
// let res = {
// categories: ["1","2","3","4","5","6","7","8","9","10","11","12"],
// series: [
@ -494,7 +494,14 @@ export default {
StatisticsType:1,
ServerpartId:this.serviceInfo.Serverpart_ID
}
let yesReq = {
ProvinceCode:'340000',
StatisticsDate:y - 1,
StatisticsType:1,
ServerpartId:this.serviceInfo.Serverpart_ID
}
const data = await request.$webGet('CommercialApi/Revenue/GetRevenueTrend',req)
const yesData = await request.$webGet('CommercialApi/Revenue/GetRevenueTrend',yesReq)
let list = []
let max = 0
data.Result_Data.List.forEach(item=>{
@ -504,11 +511,19 @@ export default {
}
list.push(item.value)
})
let yesList = []
yesData.Result_Data.List.forEach(item=>{
item.value = Number((item.value/10000).toFixed(1))
yesList.push(item.value)
})
let res={
categories: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],
series:[{
name: "",
name: "今年",
data: list
},{
name: "去年",
data: yesList
}],
max:max
}

View File

@ -25,7 +25,7 @@
<text class="comparePlan">比计划 </text>
<view class="box2">
<image class="addIcon" :src="Number(info.Growth_Rate)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{info.Growth_Rate ?info.Growth_Rate + '%':'-'}}</p>
<p class="text">{{info.Growth_Rate ?Math.abs(info.Growth_Rate) + '%':'-'}}</p>
</view>
</view>
</view>
@ -56,7 +56,7 @@
<text class="comparePlan">比计划 </text>
<div class="box2">
<image class="addIcon" :src="Number(item.Growth_Rate)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{item.Growth_Rate?item.Growth_Rate + '%':''}}</p>
<p class="text">{{item.Growth_Rate?Math.abs(item.Growth_Rate) + '%':''}}</p>
</div>
</div>
</div>
@ -100,7 +100,7 @@
<text class="comparePlan">比计划 </text>
<view class="box2">
<image class="addIcon" :src="Number(info.Growth_Rate)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{info.Growth_Rate ?info.Growth_Rate + '%':'-'}}</p>
<p class="text">{{info.Growth_Rate ?Math.abs(info.Growth_Rate) + '%':'-'}}</p>
</view>
</view>
</view>
@ -131,7 +131,7 @@
<text class="comparePlan">比计划 </text>
<div class="box2">
<image class="addIcon" :src="Number(item.Growth_Rate)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{item.Growth_Rate?item.Growth_Rate + '%':''}}</p>
<p class="text">{{item.Growth_Rate?Math.abs(item.Growth_Rate) + '%':''}}</p>
</div>
</div>
</div>

View File

@ -24,7 +24,7 @@
<text class="comparePlan">比计划 </text>
<view class="box2">
<image class="addIcon" :src="Number(info.Growth_Rate)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{info.Growth_Rate ?info.Growth_Rate + '%':'-'}}</p>
<p class="text">{{info.Growth_Rate ?Math.abs(info.Growth_Rate) + '%':'-'}}</p>
</view>
</view>
</view>
@ -69,7 +69,7 @@
<text class="comparePlan">比计划 </text>
<div class="box2">
<image class="addIcon" :src="Number(info.Growth_Rate)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{info.Growth_Rate?info.Growth_Rate + '%':''}}</p>
<p class="text">{{info.Growth_Rate?Math.abs(info.Growth_Rate) + '%':''}}</p>
</div>
</view>
</view>
@ -105,7 +105,7 @@
<text class="comparePlan">比计划 </text>
<div class="box2">
<image class="addIcon" :src="Number(item.Growth_Rate)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{item.Growth_Rate?item.Growth_Rate + '%':''}}</p>
<p class="text">{{item.Growth_Rate?Math.abs(item.Growth_Rate) + '%':''}}</p>
</div>
</div>
</div>

View File

@ -38,7 +38,7 @@
<div class="customer-title">车辆归属地</div>
<div v-if="chartdata.countChart[canvasTab] && !lodingDetail">
<view class="operation-pie-content">
<!-- <uni-ec-canvas
<!-- <uni-ec-canvas
class="operation-stock-content"
id="carBelong"
ref="carBelong"
@ -127,7 +127,7 @@
if (this.chartdata.countChart[name]) {
//
const list = this.chartdata.countChart[name]
this.showClounm({
id: 'carBelong',
data: [{
@ -138,13 +138,13 @@
textColor: '#747474',
textSize: uni.upx2px(20),
formatter: (val) => {
return parseInt(val)+'辆'
}
}],
categories: list.OwnerCity
})
//
//
this.showPie({
id: 'carFunnel',
data: list.OwnerProvinceList.map(n => {
@ -167,6 +167,8 @@
data: data,
categories: categories
})
console.log('data123123',data)
}
}
@ -221,7 +223,7 @@
...params
})
if (data.Result_Code === 100 && data.Result_Data.List.length > 0) {
const [list] = data.Result_Data.List
this.chartdata.countChart[type] = list
@ -235,13 +237,13 @@
textColor: '#747474',
textSize: uni.upx2px(20),
formatter: (val) => {
return parseInt(val)+'辆'
}
}],
categories: list.OwnerCity
})
this.showPie({
id: 'carFunnel',
data: list.OwnerProvinceList.map(n => {
@ -274,7 +276,7 @@
this.getProportion(this.canvasTab, params)
this.getAnalysisDesc(this.canvasTab, params)
},
tap(e) {
rincanvas[e.target.id].touchLegend(e);
rincanvas[e.target.id].showToolTip(e);
@ -365,7 +367,7 @@
titleOffsetY: uni.upx2px(-20),
fontSize: uni.upx2px(24),
fontColor: '#777777',
}],
showTitle:true,
axisLineColor: "#eee",
@ -392,6 +394,7 @@
let data = {
series: []
}
console.log('obj21123',obj)
const ctx = uni.createCanvasContext(obj.id, this);
data.series = data.series.concat(obj.data)
rincanvas[obj.id] = new uCharts({

View File

@ -5,7 +5,8 @@
<div class="headerTop" :style="{ height: menu.bottom + 5 + 'px'}">
<view class="selectTime" :style="{ top: menu.top + (menu.height - 22) / 2 + 'px' }">
<image class="dateIcon" src="/static/images/index/dateTime.svg"></image>
<picker mode="date" :value="single" :start="startDate" :end="endData" @change="bindDateChange" >
<!-- <picker mode="date" :value="single" @change="bindDateChange" >-->
<picker mode="date" :value="single" :end="endData" @change="bindDateChange" >
<view class="time">
<text class="day">{{ thisDay }}</text>
<view class="uni-input" style="background: transparent;padding: 0;height:100%">{{ single }}</view>
@ -18,7 +19,8 @@
<view v-if="user.Membership_Id" >
<view class="topTitle">
<p class="title">对客营收</p>
<span class="text">门店上传: <text style="margin-left: 4px" :style="{color:isBig?'red':''}">{{showTableData.Revenue_Upload?showTableData.Revenue_Upload:'-'}}/{{allShopCount?allShopCount:'-'}}</text></span>
<text class="smallTitle">{{plan.RevenueMonth_Amount?plan.RevenueMonth_Amount:'-'}}<text class="month">({{thisMonth?thisMonth:'-'}}月累计)</text></text>
<!-- <span class="text">门店上传: <text style="margin-left: 4px" :style="{color:isBig?'red':''}">{{showTableData.Revenue_Upload?showTableData.Revenue_Upload:'-'}}/{{allShopCount?allShopCount:'-'}}</text></span>-->
</view>
<view class="box" @click="handlePage">
<view class="priceBox">
@ -27,10 +29,10 @@
</view>
</view>
<view class="addBox">
<text class="smallTitle">{{thisMonth?thisMonth:'-'}}月累计:<text style="margin-left: 4px">{{plan.RevenueMonth_Amount?plan.RevenueMonth_Amount:'-'}}</text></text>
<!-- <text class="smallTitle">{{plan.RevenueMonth_Amount?plan.RevenueMonth_Amount:'-'}}<text class="month">({{thisMonth?thisMonth:'-'}}月累计)</text></text>-->
<view class="right">
<image class="arrowTop" :src="Number(showTableData.compared)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/arrow_top.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/arrow_reduce.svg'"></image>
<text class="text">{{showTableData.compared?showTableData.compared + '%':'-' + '%'}}</text>
<image class="arrowTop" :src="Number(showTableData.compared)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<text class="text">{{showTableData.compared?Math.abs(showTableData.compared) + '%':'-' + '%'}}</text>
<text class="compare">(相比昨日)</text>
</view>
</view>
@ -77,12 +79,18 @@
</p>
<p class="price">{{showTableData.TotalOffAmount?showTableData.TotalOffAmount:'-' }}</p>
</view>
<view class="detailItem">
<p class="itemName">
分润到账<text class="itemUnit">/</text>
</p>
<p class="price">{{detailTypeList[1].yesterValue?detailTypeList[1].yesterValue:'-' }}</p>
</view>
<view class="detailItem">
<p class="itemName">
门店上传<text class="itemUnit"></text>
</p>
<p class="price" :style="{color:isBig?'red':''}">{{showTableData.Revenue_Upload?showTableData.Revenue_Upload:'-'}}/{{allShopCount?allShopCount:'-'}}</p>
</view>
<!-- <view class="detailItem">-->
<!-- <p class="itemName">-->
<!-- 分润到账<text class="itemUnit">/</text>-->
<!-- </p>-->
<!-- <p class="price">{{detailTypeList[1].yesterValue?detailTypeList[1].yesterValue:'-' }}</p>-->
<!-- </view>-->
<view class="detailItem">
<p class="itemName">
商品出售<text class="itemUnit">/</text>
@ -142,7 +150,7 @@
<p class="money" v-else>{{ item.yesterValue }}</p>
<view v-if="index === 0 || index === 2" class="active">
<image v-if="Number(item.add)!==0" class="addIcon" :src="Number(item.add)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<text v-if="Number(item.add)!==0" class="add" :style="{color:Number(item.add)<0?'#07C160':'#FA5151'}">{{ item.add>0?'+' + item.add:item.add }}</text>
<text v-if="Number(item.add)!==0" class="add" :style="{color:Number(item.add)<0?'#07C160':'#FA5151'}">{{ item.add?Math.abs(item.add):'' }}</text>
<text v-if="Number(item.add)!==0" class="yesterday">(相比昨日)</text>
</view>
<view class="otherBox" v-else>
@ -261,7 +269,7 @@
<text class="comparePlan">比计划 </text>
<view class="box2">
<image class="addIcon" :src="Number(monthAdd)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{monthAdd?monthAdd + '%':'-'}}</p>
<p class="text">{{monthAdd?Math.abs(monthAdd) + '%':'-'}}</p>
</view>
</view>
</view>
@ -310,7 +318,7 @@
<text class="comparePlan">比计划 </text>
<div class="box2">
<image class="addIcon" :src="Number(yearAdd)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
<p class="text">{{yearAdd?yearAdd + '%':''}}</p>
<p class="text">{{yearAdd?Math.abs(yearAdd) + '%':''}}</p>
</div>
</view>
</view>
@ -437,6 +445,7 @@ export default {
monthNoticeText:'',
yearNoticeText:'',
thisMonth:0,//
isSuccess:false,//
}
},
watch:{
@ -538,6 +547,16 @@ export default {
this.startDate = `${y}-${m}-${d - 8}`
}
this.endData = new Date()
setTimeout(()=>{
if (!this.isSuccess){
uni.showToast({
title: '加载失败,请下拉刷新重新加载',
icon: 'none',
duration: 3000
})
}
},10000)
},
onShow(){
// tabbar tabbar
@ -548,6 +567,10 @@ export default {
this.isShow = false
this.selectTab = 1
},
onPullDownRefresh:function(){
this.getData(this.option)
uni.stopPullDownRefresh();
},
methods:{
...mapActions(['memberLogin','getLoginCode']),
//
@ -561,7 +584,7 @@ export default {
//
let req = {
SearchParameter:{
STATISTICS_DATE:`${y}-${m}`,
// STATISTICS_DATE:`${y}-${m}`,
ANALYSISINS_TYPE:'1011',
ANALYSISINS_FORMAT:'3000'
},
@ -581,7 +604,7 @@ export default {
//
let reqYear = {
SearchParameter:{
STATISTICS_DATE:`${y}`,
// STATISTICS_DATE:`${y}`,
ANALYSISINS_TYPE:'1012',
ANALYSISINS_FORMAT:'3000'
},
@ -590,6 +613,7 @@ export default {
}
const totalData = await request.$webPost('CommercialApi/Analysis/GetANALYSISINSList',reqYear)
this.yearNoticeText = totalData.Result_Data.List[0].ANALYSIS_CONTENT
console.log('this.yearNoticeText ',this.yearNoticeText )
},
async nearestService(){
let seat = uni.getStorageSync('seatInfo');
@ -730,6 +754,9 @@ export default {
})
},
initYesterdayData(){
let flag1 = false
let flag2 = false
let flag3 = false
let _this = this
//
let yesterday = handleYesterday(this.lastDay)
@ -757,12 +784,13 @@ export default {
})
// data
_this.yesterdayAllPay = cashPay
flag1 = true
})
//
request.$webGet('CommercialApi/Revenue/GetMobileShare',data).then(res=>{
// data
this.ShareShopCountYes = res.Result_Data.ShareShop_Count
})
// request.$webGet('CommercialApi/Revenue/GetMobileShare',data).then(res=>{
// // data
// this.ShareShopCountYes = res.Result_Data.ShareShop_Count
// })
const date = new Date(this.lastDay)
const y = date.getFullYear()
@ -777,10 +805,10 @@ export default {
StatisticsStartDate:`${y}-${m}-01`,
StatisticsEndDate:this.lastDay,
}
request.$webGet('CommercialApi/Revenue/GetMobileShare',monthDate).then(res=>{
// data
this.monthPrice = res.Result_Data.Royalty_Price
})
// request.$webGet('CommercialApi/Revenue/GetMobileShare',monthDate).then(res=>{
// // data
// this.monthPrice = res.Result_Data.Royalty_Price
// })
//
const todayData = {
@ -795,37 +823,38 @@ export default {
this.detailTypeList[2].add = this.lastDayBillCount.DeliverBillGrowth_Count
this.detailTypeList[3].value = this.$util.fmoney(this.lastDayBillCount.MonthDeliver_Price )
this.detailTypeList[3].yesterValue = this.$util.fmoney(this.lastDayBillCount.Deliver_Price)
flag2 = true
})
//
const deliveData = {
Province_Code:'340000',
Statistics_Date: yesterday
}
request.$webGet('CommercialApi/Revenue/GetMallDeliver',deliveData).then(res=>{
// data
this.yesterdayBillCount = res.Result_Data.DeliverBill_Count
})
//
const buyPriceYes = {
Province_Code:'340000',
Statistics_Date: yesterday
}
request.$webGet('CommercialApi/Revenue/GetMallDeliver',buyPriceYes).then(res=>{
// data
this.buyPriceYes = res.Result_Data.Deliver_Price
})
// //
// const deliveData = {
// Province_Code:'340000',
// Statistics_Date: yesterday
// }
// request.$webGet('CommercialApi/Revenue/GetMallDeliver',deliveData).then(res=>{
// // data
// this.yesterdayBillCount = res.Result_Data.DeliverBill_Count
// })
// //
// const buyPriceYes = {
// Province_Code:'340000',
// Statistics_Date: yesterday
// }
// request.$webGet('CommercialApi/Revenue/GetMallDeliver',buyPriceYes).then(res=>{
// // data
// this.buyPriceYes = res.Result_Data.Deliver_Price
// })
//
const buyPrice = {
Province_Code:'340000',
StatisticsStartDate:`${y}-${m}-01`,
StatisticsEndDate:this.lastDay
}
request.$webGet('CommercialApi/Revenue/GetMallDeliver',buyPrice).then(res=>{
// data
this.buyPriceMonth = res.Result_Data.Deliver_Price
})
// //
// const buyPrice = {
// Province_Code:'340000',
// StatisticsStartDate:`${y}-${m}-01`,
// StatisticsEndDate:this.lastDay
// }
// request.$webGet('CommercialApi/Revenue/GetMallDeliver',buyPrice).then(res=>{
// // data
// this.buyPriceMonth = res.Result_Data.Deliver_Price
// })
//
const allPriceData = {
pushProvinceCode:'340000',
@ -833,6 +862,7 @@ export default {
ShowCompareRate: true
}
request.$webGet('CommercialApi/Revenue/GetSummaryRevenue',allPriceData).then(res=>{
flag3 = true
// data
let result = res.Result_Data
for(let key in result){
@ -852,12 +882,15 @@ export default {
})
}
}
this.modelProgress = result.BusinessTypeList
this.regionProgress = result.BusinessTradeList
this.areaProgress = result.SPRegionList
this.showTableData = result.RevenuePushModel
this.showTableData.compared = result.GrowthRate
this.todayAmount()
if (flag1 && flag2 && flag3 ){
this.todayAmount()
}
})
},
defaultMsg() {
@ -883,12 +916,34 @@ export default {
},
//
bindDateChange(e){
const date = new Date(e.detail.value).getTime()
this.single = timestampToTime(date)
this.lastDay = e.detail.value
uni.setStorageSync('lastDay',this.lastDay)
this.thisDay = getThisDay(new Date(e.detail.value).getDay())
this.onRefresh()
let isOnRefresh = false
let startTime = new Date(this.startDate).getTime()
let endTime = new Date(this.lastDay).getTime() - 8 * 3600 * 1000 //
const date = new Date(e.detail.value).getTime() - 8 * 3600 * 1000
let startDate = new Date(this.startDate)
let startMonth = startDate.getMonth() + 1
let startDay = startDate.getDate()
let endDate = new Date(this.lastDay)
let endMonth = endDate.getMonth() + 1
let endDay = endDate.getDate()
if (date > endTime || date < startTime){
isOnRefresh = false
}else{
isOnRefresh = true
}
if (isOnRefresh){
this.single = timestampToTime(date)
this.lastDay = e.detail.value
uni.setStorageSync('lastDay',this.lastDay)
this.thisDay = getThisDay(new Date(e.detail.value).getDay())
this.onRefresh()
}else{
uni.showToast({
title: `数据看板仅支持查看${startMonth}.${startDay}-${endMonth}.${endDay}的数据`,
icon:'none',
duration:3000
});
}
},
showPie(obj) {
let data = {
@ -1077,6 +1132,7 @@ export default {
}
}
uni.hideLoading()
this.isSuccess = true
_this.$forceUpdate()
})
},
@ -1209,6 +1265,22 @@ $iphoneHeight: env(safe-area-inset-bottom);
line-height: 40rpx;
margin-left: 8px;
}
.smallTitle{
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #782717;
line-height: 20px;
margin-right: 4px;
.month{
margin-left: 4px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #c97e64;
line-height: 20px;
}
}
}
@keyframes allPriceAnimation {
@ -1227,8 +1299,8 @@ $iphoneHeight: env(safe-area-inset-bottom);
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin: 4px 0;
justify-content: flex-start;
margin: 12px 0 0;
.allPrice {
font-size: 56rpx;
font-family: DINAlternate-Bold, DINAlternate;
@ -1250,7 +1322,7 @@ $iphoneHeight: env(safe-area-inset-bottom);
.addBox {
width: 100%;
margin-top: 5px;
margin-top: 12px;
display: flex;
justify-content: space-between;
align-items: center;
@ -1258,8 +1330,17 @@ $iphoneHeight: env(safe-area-inset-bottom);
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #c97e64;
color: #782717;
line-height: 20px;
margin-right: 4px;
.month{
margin-left: 4px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #c97e64;
line-height: 20px;
}
}
.right{
display: flex;

View File

@ -138,11 +138,11 @@ export default {
methods:{
//
handleGomap(item){
let seat = uni.getStorageSync('currentService')
let seat = uni.getStorageSync('seatInfo')
let key='STWBZ-DKCR4-J6UUF-FRD5I-3EBN2-GDBOT'
let referer ='goMap'
let startPoint = {
name:seat.SERVERPART_NAME,
name:'我的位置',
latitude:seat.latitude,
longitude:seat.longitude
}
@ -192,6 +192,7 @@ export default {
},
//
handleChangeService(e){
console.log('this.array',this.array)
this.selectIndex = Number(e.detail.value)
console.log('this.selectIndex',this.selectIndex)
this.getListData()
@ -238,10 +239,10 @@ export default {
async getListData(){
let id
let user = uni.getStorageSync('seatInfo')
if (!this.selectIndex){
let current = uni.getStorageSync('currentService')
let nearService = uni.getStorageSync('nearService')
if (!this.selectIndex && this.selectIndex!==0){
console.log('user',user.latitude)
let current = uni.getStorageSync('currentService')
let nearService = uni.getStorageSync('nearService')
if (!current){
id = nearService.SPRegionType_ID
}else{
@ -261,9 +262,11 @@ export default {
// id = this.array[this.selectIndex].value
// }
// }
console.log('id12213123',id)
let req = {
Province_Code: '340000',
SPRegionType_ID: id,
Serverpart_ID:current.Serverpart_ID,
longitude:user.longitude,
latitude:user.latitude
}