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) { function measureText(text, fontSize, context) {
var width = 0; var width = 0;
text = String(text); // text = String(text);
// #ifdef MP-ALIPAY || MP-BAIDU || APP-NVUE // #ifdef MP-ALIPAY || MP-BAIDU || APP-NVUE
context = false; context = false;
// #endif // #endif
if (context !== false && context !== undefined && context.setFontSize && context.measureText) { if (context !== false && context !== undefined && context.setFontSize && context.measureText) {
context.setFontSize(fontSize); context.setFontSize(fontSize);
return context.measureText(text).width; 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 { } else {
var text = text.split(''); return getLen(text)
for (let i = 0; i < text.length; i++) { // var text = text.split('');
let item = text[i]; // for (let i = 0; i < text.length; i++) {
if (/[a-zA-Z]/.test(item)) { // let item = text[i];
width += 7; // if (/[a-zA-Z]/.test(item)) {
} else if (/[0-9]/.test(item)) { // width += 7;
width += 5.5; // } else if (/[0-9]/.test(item)) {
} else if (/\./.test(item)) { // width += 5.5;
width += 2.7; // } else if (/\./.test(item)) {
} else if (/-/.test(item)) { // width += 2.7;
width += 3.25; // } else if (/-/.test(item)) {
} else if (/:/.test(item)) { // width += 3.25;
width += 2.5; // } else if (/:/.test(item)) {
} else if (/[\u4e00-\u9fa5]/.test(item)) { // width += 2.5;
width += 10; // } else if (/[\u4e00-\u9fa5]/.test(item)) {
} else if (/\(|\)/.test(item)) { // width += 10;
width += 3.73; // } else if (/\(|\)/.test(item)) {
} else if (/\s/.test(item)) { // width += 3.73;
width += 2.5; // } else if (/\s/.test(item)) {
} else if (/%/.test(item)) { // width += 2.5;
width += 8; // } else if (/%/.test(item)) {
} else { // width += 8;
width += 10; // } else {
} // width += 10;
} // }
return width * fontSize / 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 labelShow: item.labelShow
}; };
}); });
for (let i = 0; i < seriesConvert.length; i++) { for (let i = 0; i < seriesConvert.length; i++) {
let item = seriesConvert[i]; let item = seriesConvert[i];
// line end // line end
@ -2352,7 +2397,16 @@ function drawPieText(series, opts, config, context, radius, center) {
context.beginPath(); context.beginPath();
context.setFontSize(item.textSize * opts.pix || config.fontSize); context.setFontSize(item.textSize * opts.pix || config.fontSize);
context.setFillStyle(item.textColor || opts.fontColor); 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.closePath();
context.stroke(); context.stroke();
context.closePath(); context.closePath();

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff