Merge branch 'master' of 10.103.1.7:eshangweb/wechat_yxcl

This commit is contained in:
zzy 2022-06-13 09:26:19 +08:00
commit 02e7ac596e
7 changed files with 599 additions and 418 deletions

View File

@ -435,40 +435,84 @@ function getDataRange(minData, maxData) {
function measureText(text, fontSize, context) {
var width = 0;
text = String(text);
// text = String(text);
// #ifdef MP-ALIPAY || MP-BAIDU || APP-NVUE
context = false;
// #endif
if (context !== false && context !== undefined && context.setFontSize && context.measureText) {
context.setFontSize(fontSize);
return context.measureText(text).width;
context.setFontSize(fontSize);
if(text instanceof Array) {
let max = 0
text.map(n=>{
let len = getLen(n)
if(max<len){
max=len
}
})
return max
}else {
return getLen(text)
}
// context.setFontSize(fontSize);
// return context.measureText(text).width;
} else {
var text = text.split('');
for (let i = 0; i < text.length; i++) {
let item = text[i];
if (/[a-zA-Z]/.test(item)) {
width += 7;
} else if (/[0-9]/.test(item)) {
width += 5.5;
} else if (/\./.test(item)) {
width += 2.7;
} else if (/-/.test(item)) {
width += 3.25;
} else if (/:/.test(item)) {
width += 2.5;
} else if (/[\u4e00-\u9fa5]/.test(item)) {
width += 10;
} else if (/\(|\)/.test(item)) {
width += 3.73;
} else if (/\s/.test(item)) {
width += 2.5;
} else if (/%/.test(item)) {
width += 8;
} else {
width += 10;
}
}
return width * fontSize / 10;
return getLen(text)
// var text = text.split('');
// for (let i = 0; i < text.length; i++) {
// let item = text[i];
// if (/[a-zA-Z]/.test(item)) {
// width += 7;
// } else if (/[0-9]/.test(item)) {
// width += 5.5;
// } else if (/\./.test(item)) {
// width += 2.7;
// } else if (/-/.test(item)) {
// width += 3.25;
// } else if (/:/.test(item)) {
// width += 2.5;
// } else if (/[\u4e00-\u9fa5]/.test(item)) {
// width += 10;
// } else if (/\(|\)/.test(item)) {
// width += 3.73;
// } else if (/\s/.test(item)) {
// width += 2.5;
// } else if (/%/.test(item)) {
// width += 8;
// } else {
// width += 10;
// }
// }
// return width * fontSize / 10;
}
function getLen(text) {
text = String(text);
var text = text.split('');
var width = 0;
for (let i = 0; i < text.length; i++) {
let item = text[i];
if (/[a-zA-Z]/.test(item)) {
width += 7;
} else if (/[0-9]/.test(item)) {
width += 5.5;
} else if (/\./.test(item)) {
width += 2.7;
} else if (/-/.test(item)) {
width += 3.25;
} else if (/[\u4e00-\u9fa5]/.test(item)) {
width += 10;
} else if (/\(|\)/.test(item)) {
width += 3.73;
} else if (/\s/.test(item)) {
width += 2.5;
} else if (/%/.test(item)) {
width += 8;
} else {
width += 10;
}
}
return width * fontSize / 10;
}
}
@ -2270,6 +2314,7 @@ function drawPieText(series, opts, config, context, radius, center) {
labelShow: item.labelShow
};
});
for (let i = 0; i < seriesConvert.length; i++) {
let item = seriesConvert[i];
// line end
@ -2352,7 +2397,16 @@ function drawPieText(series, opts, config, context, radius, center) {
context.beginPath();
context.setFontSize(item.textSize * opts.pix || config.fontSize);
context.setFillStyle(item.textColor || opts.fontColor);
context.fillText(item.text, textStartX, textPosition.y + 3);
if(item.text instanceof Array) {
item.text.map((n,i)=>{
let y = textPosition.y + 3 +(i*(item.textSize || config.fontSize))
context.fillText(n, textStartX, y);
})
}else{
context.fillText(item.text, textStartX, textPosition.y + 3);
}
// context.fillText(item.text, textStartX, textPosition.y + 3);
context.closePath();
context.stroke();
context.closePath();

View File

@ -69,10 +69,8 @@
<div class="bgO" :style="{'width':item.bili+'%'}"></div>
</div>
</div>
</div>
</div>
</div>
</view>
</div>
@ -154,8 +152,8 @@
</div>
</template>
<template v-else>
<shopCell v-for="(item,i) in regionList" :key="i" :item='item' @toggleShow="toggleShow" :i='i'>
</shopCell>
<shopCell v-for="(item,i) in regionList" :key="i" :item='item' @toggleShow="toggleShow" :i='i' />
</template>
</view>
<template v-if="theRequest && theRequest.ProvinceCode==620000">
@ -176,7 +174,7 @@
import {
mapState
} from 'vuex';
import uCharts from '@/components/u-charts/u-charts.js';
import uCharts from '@/components/u-charts.js';
import shopCell from './components/listUnit.vue'
import AnhHead from './components/anhHead.vue'
import RankContent from './components/RankContent.vue'
@ -316,12 +314,13 @@
let data = {
series: []
}
const ctx = uni.createCanvasContext(obj.id, this);
data.series = data.series.concat(obj.data)
rincanvas[obj.id] = new uCharts({
$this: this,
canvasId: obj.id,
colors: obj.colors,
// $this: this,
// canvasId: obj.id,
context: ctx,
color: obj.colors,
type: 'ring',
fontSize: 12,
padding: [15, 15, 25, 15],
@ -339,7 +338,7 @@
height: uni.upx2px(510),
dataLabel: true,
extra: {
pie: {
ring: {
ringWidth: 40,
labelWidth: 16,
border: true,
@ -495,8 +494,14 @@
_data1.push({
...n,
textColor: '#999',
format: function(arg) {
return [n.name, (arg * 100).toFixed(2) + '%']
formatter: function(arg) {
if (typeof arg === 'number') {
return [n.name, (arg * 100).toFixed(2) + '%']
} else {
return [arg.name, (arg._proportion_ * 100).toFixed(2) + '%']
}
}
});

View File

@ -12,7 +12,6 @@
</div>
<view class="top-card">
<div class="box-center-box">
<div class="uni-flex ai-center jc-between">
<div class="main-amount-title">对客营收()</div>
<div class="tab-unit" @tap="showPop">
@ -24,9 +23,7 @@
</div>
</div>
<div class="uni-flex ai-base jc-between">
<span class="center-num">{{sMsg.totalMoneyShow}}</span>
<span class="budgetamount">
<text class="budget-title">计划营收():</text>
<text :class="sMsg.budgetAmount< sMsg.cashPay ? 'up-text-title':'down-text-title'">
@ -36,7 +33,6 @@
</span>
</div>
</div>
<div class="uni-flex jc-between box-center-box">
<div class="check-unit">
@ -74,9 +70,7 @@
<div class="check-price-color">{{$util.fmoney(sMsg.countave,2)}} <text></text></div>
</div>
</div>
</view>
</div>
<cover-view class="fixed-box page-title" :style="'transform: translateY('+fixedY+'px);opacity:'+opacity+';'">
<cover-view>{{sMsg.serverpartname || ''}}</cover-view>
@ -136,8 +130,7 @@
:class="{'active': nowShop==i}" @click="selectCate(i)">{{n.Bussiness_Name}}</div>
</scroll-view>
<div class="tab-content" v-if="cateBrandList.length">
<div class="shop-card" v-for="(m,i) in cateBrandList[nowShop].listBrandModel" :key="i"
@click="toBrandPage(m,i)">
<div class="shop-card" v-for="(m,i) in cateBrandList[nowShop].listBrandModel" :key="i" @click="toBrandPage(m,i)">
<div>
<image v-if="m.Brand_ICO" :src="m.Brand_ICO" mode="aspectFit"></image>
<image v-else src="/static/images/revenue/home.png" mode="aspectFit"></image>
@ -148,7 +141,6 @@
</div>
</div>
</div>
</view>
<view class="" v-show="nowTab==2">
@ -186,7 +178,7 @@
</template>
<script>
import uCharts from '@/components/u-charts/u-charts.js';
import uCharts from '@/components/u-charts.js';
import ServiceRevenuePie from './components/ServiceRevenuePie.vue'
import CustomerAnalysis from './components/CustomerAnalysis.vue'
import CarAnalysis from './components/CarAnalysis.vue'
@ -300,7 +292,6 @@
showFixed(options) {
this.scrollTop = options.scrollTop
let selfHeight = uni.upx2px(396)
if (options.scrollTop > selfHeight) {
@ -325,8 +316,7 @@
let btid = this.cateBrandList[nowShop].Business_Trade
let pages =
`/pages/everdayRenven/serviceDetail?bid=${item.Brand_Id}&shopid=${item.ServerpartShop_Id}&id=${theRequest.ServerpartIds}&time=${theRequest.time}&provinceId=${theRequest.ProvinceCode}&btid=${item.Business_Trade}`
let pages = `/pages/everdayRenven/serviceDetail?bid=${item.Brand_Id}&shopid=${item.ServerpartShop_Id}&id=${theRequest.ServerpartIds}&time=${theRequest.time}&provinceId=${theRequest.ProvinceCode}&btid=${item.Business_Trade}`
this.$util.toNextRoute('navigateTo', pages)
},
async selectCate(index) {
@ -377,8 +367,13 @@
n.textColor = '#D1D1D1'
n.textSize = uni.upx2px(26)
n.format = function(arg) {
return [n.name, (arg * 100).toFixed(2) + '%']
n.formatter = function(arg) {
if (typeof arg === 'number') {
return [n.name, (arg * 100).toFixed(2) + '%']
} else {
return [arg.name, (arg._proportion_ * 100).toFixed(2) + '%']
}
}
list.push(n)
}
@ -408,7 +403,6 @@
data: list,
colors: colors1,
});
}
},
operationBusniess(arr, data) { //
@ -422,9 +416,13 @@
name: n[1],
textColor: '#999',
data: data[n[0]], //+Number(data2[n[0]])
format: function(arg) {
return [n[1], (arg * 100).toFixed(2) + '%']
formatter: function(arg) {
if(typeof arg==='number'){
return [n[1],(arg * 100).toFixed(2) + '%']
}else{
return [arg.name,(arg._proportion_ * 100).toFixed(2) + '%']
}
// return [n[1], (arg * 100).toFixed(2) + '%']
}
});
}
@ -439,11 +437,13 @@
let data = {
series: []
}
const ctx = uni.createCanvasContext(obj.id, this);
data.series = data.series.concat(obj.data)
rincanvas[obj.id] = new uCharts({
$this: _self,
canvasId: obj.id,
colors: obj.colors,
// $this: _self,
// canvasId: obj.id,
context: ctx,
color: obj.colors,
type: 'ring',
padding: obj.id != 'modelCount' ? [15, 15, 25, 0] : '',
legend: {
@ -473,7 +473,7 @@
disablePieStroke: true,
dataPointShape: false,
extra: {
pie: {
ring: {
ringWidth: obj.id != 'modelCount' ? uni.upx2px(90) : 40,
labelWidth: uni.upx2px(40),
activeOpacity: 1,
@ -538,17 +538,14 @@
statictics_Time: theRequest.time,
pushProvinceCode: theRequest.ProvinceCode
}).then(res => {
if (res.Result_Code != 100) return
_this.pageData = res.Result_Data
if (res.Result_Data.listBusinessModel) {
let list = JSON.parse(JSON.stringify(res.Result_Data.listBusinessModel))
if (list.length > 0) {
let all = {
Bussiness_Name: '全部',
listBrandModel: []
}
list.map(n => {
@ -568,9 +565,7 @@
return
}
_this.cateBrandList = []
})
},
//
@ -579,7 +574,6 @@
const [totalData, busniessTypePie, busniessTradePie, busniessTradeFathPie] =
await anhuiYestodayRevenueData.getData(theRequest, true)
totalData.tickave = totalData.ticketCount > 0 ? this.$util.fmoney(totalData.cashPay / totalData
.ticketCount, 2) : 0
totalData.countave = totalData.totalCount > 0 ? this.$util.fmoney(totalData.cashPay / totalData
@ -622,8 +616,13 @@
_data1.push({
...n,
textColor: '#999',
format: function(arg) {
return [n.name, (arg * 100).toFixed(2) + '%']
formatter: function(arg) {
if(typeof arg==='number'){
return [n.name,(arg * 100).toFixed(2) + '%']
}else{
return [arg.name,(arg._proportion_ * 100).toFixed(2) + '%']
}
}
});
@ -656,16 +655,12 @@
}
let _data = res.Result_Data
_this.unUploadList = _data.List
})
},
},
onPageScroll(e) {
this.showFixed(e)
}
}
</script>

View File

@ -235,7 +235,7 @@
textColor: '#747474',
textSize: uni.upx2px(20),
formatter: (val) => {
console.log(val)
return parseInt(val)+'辆'
}
}],
@ -274,14 +274,11 @@
this.getProportion(this.canvasTab, params)
this.getAnalysisDesc(this.canvasTab, params)
},
// tapchart(e, id) {
// rincanvas[id].showToolTip(e)
// },
tap(e) {
rincanvas[e.target.id].touchLegend(e);
rincanvas[e.target.id].showToolTip(e);
},
showPie(obj) {
let data = {
series: []

View File

@ -6,10 +6,10 @@
<div v-show="!loading && !pageEmpty">
<div class="tab-btn" @tap="tabChange(canvasTab==1?2:1,opt)">{{canvasTab==1 ? '消费能力分析' : '消费人群分析'}}</div>
<div class="customer-title">{{canvasTab==1? '消费人群': '消费能力'}}占比</div>
<canvas canvas-id="sexCate" id="sexCate" class="operation-cate-content"></canvas>
<canvas canvas-id="sexCate" id="sexCate" class="operation-cate-content" @touchend="tap"></canvas>
<div class="customer-title">年龄层占比</div>
<canvas canvas-id="stockShare1" id="stockShare1" class="operation-stock-content" v-show="canvasTab==1" ></canvas>
<canvas canvas-id="stockShare2" id="stockShare2" class="operation-stock-content" v-show="canvasTab==2" ></canvas>
<canvas canvas-id="stockShare1" id="stockShare1" class="operation-stock-content" v-show="canvasTab==1" @touchend="tap"></canvas>
<canvas canvas-id="stockShare2" id="stockShare2" class="operation-stock-content" v-show="canvasTab==2" @touchend="tap"></canvas>
<div class="analysis-text" v-if="proportionList[canvasTab]">
<span class="key-text">分析</span><span>{{proportionList[canvasTab][1]}}</span>
</div>
@ -18,7 +18,7 @@
</template>
<script>
import uCharts from '@/components/u-charts/u-charts.js';
import uCharts from '@/components/u-charts.js';
let rincanvas = {}
export default {
@ -47,7 +47,6 @@
methods: {
refreshData(data) {
//
rincanvas['sexCate'].updateData({series:data[0]});
this.$forceUpdate()
},
@ -69,7 +68,7 @@
statisticsType: type,
...params
})
_this.loading=false
_this.loading = false
if (data.Result_Code === 100 && data.Result_Data.List.length > 0) {
const list = data.Result_Data.List
@ -77,22 +76,33 @@
let pieSerise = [{
name: list[0].name,
data: list[0].data[0],
format: function(arg) {
return [list[0].name, (arg * 100).toFixed(2) + '%']
formatter: function(arg) {
if (typeof arg === 'number') {
return [list[0].name, (arg * 100).toFixed(2) + '%']
} else {
return [arg.name, (arg._proportion_ * 100).toFixed(2) + '%']
}
// return [list[0].name, (arg * 100).toFixed(2) + '%']
}
},
{
name: list[1].name,
data: list[1].data[0],
format: function(arg) {
return [list[1].name, (arg * 100).toFixed(2) + '%']
formatter: function(arg) {
if (typeof arg === 'number') {
return [list[1].name, (arg * 100).toFixed(2) + '%']
} else {
return [arg.name, (arg._proportion_ * 100).toFixed(2) + '%']
}
}
}
]
let clounm = [{
name: list[2].name,
data: ([]).concat(list[2].data),
format: function(arg) {
formatter: function(arg) {
return [ arg + '%']
}
}]
@ -108,7 +118,7 @@
_this.showClounm({
id: 'stockShare'+type,
data: clounm,
categories: ['00后', '90后', '80后', '70后']
categories: ['00后', '90后', '80后', '70后'],
})
@ -126,21 +136,23 @@
...params
})
return data.Result_Data.Analysis_Content || ''
},
touchPie() {},
tap(e) {
rincanvas[e.target.id].touchLegend(e);
rincanvas[e.target.id].showToolTip(e);
},
showPie(obj) {
let data = {
series: []
}
const ctx = uni.createCanvasContext(obj.id, this);
data.series = data.series.concat(obj.data)
rincanvas[obj.id] = new uCharts({
$this: this,
canvasId: obj.id,
colors: ['#667ED5', '#F6B760'],
// $this: this,
// canvasId: obj.id,
context: ctx,
color: ['#667ED5', '#F6B760'],
type: 'ring',
fontSize: 12,
// padding: [15, 15, 25, 15],
@ -158,7 +170,7 @@
height: uni.upx2px(480),
dataLabel: true,
extra: {
pie: {
ring: {
ringWidth: 40,
labelWidth: 20,
border: true,
@ -175,16 +187,17 @@
let data = {
series: []
}
const ctx = uni.createCanvasContext(obj.id, this);
data.series = data.series.concat(obj.data)
new uCharts({
$this: this,
canvasId: obj.id,
rincanvas[obj.id] = new uCharts({
// $this: this,
// canvasId: obj.id,
context: ctx,
type: 'column',
legend: {
show: false
},
colors: ['#78BFB4'],
color: ['#78BFB4'],
fontSize: 12,
background: '#FFFFFF',
padding: [30, 12, 12, 12],
@ -205,7 +218,7 @@
disabled: false,
axisLine: false,
fontColor: '#777777',
format: (val) => {
formatter: (val) => {
return parseInt(val) + '%'
}
}],

View File

@ -419,7 +419,7 @@
import {
mapState
} from 'vuex';
import uCharts from '@/components/u-charts/u-charts.js';
import uCharts from '@/components/u-charts.js';
import shopCell from './components/listUnit.vue'
import RankContent from './components/RankContent.vue'
@ -538,7 +538,7 @@
},
touchPie(e, id) {
rincanvas[id].showToolTip(e, {
format: function(item) {
formatter: function(item) {
return item.name + ':' + item.data
}
});
@ -700,7 +700,7 @@
},
operationFn(data, ohterData) { //
var _this = this;
console.log(1)
if (data.SHOWBUSINESSTRADE == 1) { //
var colors1 = ['#5E67B4', '#4E5699', '#75B7AD', '#AFB7E6'];
var SHOWBUSINESSTRADE = [
@ -775,8 +775,13 @@
name: showName,
data: n.CASHPAY,
textColor: '#999',
format: function(arg) {
return [showName, (arg * 100).toFixed(2) + '%']
formatter: function(arg) {
if(typeof arg==='number'){
return [showName,(arg * 100).toFixed(2) + '%']
}else{
return [arg.name,(arg._proportion_ * 100).toFixed(2) + '%']
}
}
});
_data2.push({
@ -805,9 +810,14 @@
name: n[1],
textColor: '#999',
data: data[n[0]], //+Number(data2[n[0]])
format: function(arg) {
// labelText: '',
formatter: function(arg) {
return [n[1], (arg * 100).toFixed(2) + '%']
if(typeof arg==='number'){
return [n[1],(arg * 100).toFixed(2) + '%']
}else{
return [arg.name,(arg._proportion_ * 100).toFixed(2) + '%']
}
}
});
@ -831,15 +841,16 @@
let data = {
series: []
}
const ctx = uni.createCanvasContext(obj.id, this);
data.series = data.series.concat(obj.data)
rincanvas[obj.id] = new uCharts({
$this: this,
canvasId: obj.id,
colors: obj.colors,
// $this: this,
// canvasId: obj.id,
context: ctx,
color: obj.colors,
type: 'ring',
fontSize: 12,
padding: [15, 15, 25, 15],
// padding: [15, 15, 25, 15],
legend: {
show: false,
padding: 5,
@ -854,7 +865,7 @@
height: uni.upx2px(510),
dataLabel: true,
extra: {
pie: {
ring: {
ringWidth: 40,
labelWidth: 16,
border: true,
@ -866,10 +877,12 @@
});
},
showLine(obj) {
const ctx = uni.createCanvasContext(obj.id, this);
rincanvas[obj.id] = new uCharts({
$this: this,
canvasId: obj.id,
colors: ['#667ED5'],
// $this: this,
// canvasId: obj.id,
context: ctx,
color: ['#667ED5'],
type: 'area',
fontSize: 12,
legend: {
@ -883,7 +896,6 @@
categories: obj.categories,
series: obj.data,
animation: false,
xAxis: {
disabled: false,
disableGrid: true,
@ -895,12 +907,11 @@
// scrollAlign: 'left',//
},
yAxis: {
data: [{
disabled: false,
axisLine: false,
fontColor: '#B3B3B3',
format: (val) => {
formatter: (val) => {
return parseInt(val)
}
}],
@ -923,14 +934,16 @@
},
showClounm(obj) {
// rincanvas[obj.id] =
const ctx = uni.createCanvasContext(obj.id, this);
new uCharts({
$this: this,
canvasId: obj.id,
// $this: this,
// canvasId: obj.id,
context: ctx,
type: 'column',
legend: {
show: false
},
colors: ['#D1DBEF'],
color: ['#D1DBEF'],
fontSize: 12,
background: '#FFFFFF',
padding: [30, 12, 12, 12],
@ -951,7 +964,7 @@
disabled: false,
axisLine: false,
fontColor: '#B3B3B3',
format: (val) => {
formatter: (val) => {
return parseInt(val)
}
}],

File diff suppressed because it is too large Load Diff