增加五边形评分接口

This commit is contained in:
lcc
2024-11-02 17:51:18 +08:00
parent 1f8c8b57ed
commit 63c9a970c1
4 changed files with 81 additions and 45 deletions
+1
View File
@@ -188,6 +188,7 @@ api = {
appScoreLists: "app/score/lists", //运营分排行
appScoreDetail: "app/score/detail", //运营分详情
appRadar: "app/score/radar", //雷达图数据
}
//远程图片存储地址
+6
View File
@@ -1080,5 +1080,11 @@ apiQuery.appScoreDetail = function(params){
HttpRequest(false, Config.api.appScoreDetail, 2, params, "GET", resolve, reject)
})
}
//雷达图
apiQuery.appRadar = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appRadar, 2, params, "GET", resolve, reject)
})
}
export default apiQuery;
+68 -41
View File
@@ -3,13 +3,14 @@ import _ from '../../commons/js/commons'
import * as echarts from '../../ecCanvas/components/ec-canvas/echarts';
const app = getApp()
let lineChartData = {};
function lineChart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
console.log('chart,',chart)
console.log('chart,', chart)
canvas.setChart(chart);
let option = lineChartData
chart.setOption(option);
@@ -61,7 +62,7 @@ Page({
setid: '',
is_biz: 0, //是否选择门店跳转过来
scoreData: [],
showLineChart: false,//是否显示Line图表
showLineChart: false, //是否显示Line图表
ecLine: {
onInit: lineChart
},
@@ -93,7 +94,8 @@ Page({
},
itemStyle: {
color: 'rgba(49,203,173,1)'
}
},
score_role_cur: 0
}
},
@@ -101,29 +103,34 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.setNavigationBarTitle({
'title': '个人运营分'
})
for (let key in options) {
this.setData({
[key]: options[key]
})
}
let _title = '个人运营分'
if (options['is_biz'] === '1') {
_title = '门店运营分'
}
wx.setNavigationBarTitle({
'title': _title
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
this.getChartsData()
},
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.getUserInfo()
this.getScore()
this.getScoreLists()
if (this.data.is_biz === '1') {
this.getChartsData()
}
},
/**
@@ -161,7 +168,7 @@ Page({
},
getChartsData(){
getChartsData() {
lineChartData = {
backgroundColor: "#ffffff",
xAxis: {
@@ -178,45 +185,46 @@ Page({
}
},
indicator: [{
name: '食品',
max: 500
},
{
name: '玩具',
max: 500
},
{
name: '服饰',
max: 500
},
{
name: '绘本',
max: 500
},
{
name: '医疗',
max: 500
}
name: '拓客能力',
max: 100
},
{
name: '跟进能力',
max: 100
},
{
name: '邀约能力',
max: 100
},
{
name: '成交能力',
max: 100
},
{
name: '交付能力',
max: 100
}
]
},
series: [{
name: '标题',
type: 'radar',
data: [{
value: [430, 340, 500, 300, 490],
value: [0, 0, 0, 0, 0],
name: '预算',
...this.data.chartOrangeStyle //...this.data.chartGreenStyle
}]
}]
};
setTimeout(() => {
// lineChart
this.setData({
showLineChart:true,
['ecLine.onInit']:lineChart,
let params = {}
_.apiQuery.appRadar(params).then(res => {
lineChartData.radar.indicator = res.data.indicator
lineChartData.series[0].data[0].value = res.data.series_value
this.setData({
showLineChart: true,
['ecLine.onInit']: lineChart,
})
}, 1000);
})
},
scrollToRule() {
@@ -233,9 +241,13 @@ Page({
//时间切换
changeDateTab(e) {
this.setData({
tab_date_cur: parseInt(e.currentTarget.dataset.index),
tab_rank_cur: 0
tab_date_cur: parseInt(e.currentTarget.dataset.index)
})
if (this.data.userInfo.group_id === 1 || this.data.userInfo.group_id === 2) {
this.setData({
tab_rank_cur: 1
})
}
this.getScore()
this.getScoreLists()
},
@@ -270,5 +282,20 @@ Page({
rank_data: res.data.lists,
})
})
}
},
//获取用户信息
getUserInfo() {
_.apiQuery.getUserInfo().then(res => {
this.setData({
userInfo: res
})
if (res.group_id > 2) {
this.setData({
score_role_cur: 1,
tab_rank_cur: 1
})
}
this.getScoreLists()
});
},
})
+6 -4
View File
@@ -9,7 +9,7 @@
<view bindtap="changeDateTab" data-index="{{index}}" class="font-34 relative {{(tab_date.length-1)==index?'':'mr70'}} tab-item transition-all {{tab_date_cur==index?'tab-item-cur':'color-999'}}">{{item.name}}</view>
</block>
</view>
<view wx:if="{{content}}" bindtap="scrollToRule" class="font-20 ulib-r750 bg-f6 color-999 pt5 pb5 pl10 pr10">
<view wx:if="{{is_biz==='0'}}" bindtap="scrollToRule" class="font-20 ulib-r750 bg-f6 color-999 pt5 pb5 pl10 pr10">
<text class="iconfont icon-tishi mr5"></text><text>规则说明</text>
</view>
</view>
@@ -53,9 +53,11 @@
<view class="text-center pt40">
<view class="ulib-r10 overflowhidden font-24 inline-block">
<block wx:for="{{tab_rank}}" wx:key="index">
<!--block wx:for="{{tab_rank}}" wx:key="index">
<view data-index="{{index}}" bindtap="changeRankTab" class="{{tab_rank_cur===index?'bg-ccc color-666':'bg-f6 color-999'}} transition-all pl20 pr20 pt10 pb10 inline-block">{{item.name}}</view>
</block>
</block-->
<view wx:if="{{is_biz==='0'}}" data-index="0" bindtap="changeRankTab" class="{{tab_rank_cur===0?'bg-ccc color-666':'bg-f6 color-999'}} transition-all pl20 pr20 pt10 pb10 inline-block">店内排名</view>
<view data-index="1" bindtap="changeRankTab" class="{{tab_rank_cur===1?'bg-ccc color-666':'bg-f6 color-999'}} transition-all pl20 pr20 pt10 pb10 inline-block">门店排名</view>
</view>
<view class="">
<block wx:for="{{rank_data}}" wx:key="index">
@@ -76,7 +78,7 @@
</view>
</view>
<view wx:if="{{scoreData.desc}}" id="richhtml" style="line-height:2;font-size:30rpx;" class="bg-fff mb30 box-shadow-000-10-10 ulib-r10 inner40">
<view wx:if="{{scoreData.desc && is_biz==='0'}}" id="richhtml" style="line-height:2;font-size:30rpx;" class="bg-fff mb30 box-shadow-000-10-10 ulib-r10 inner40">
<com-html content="{{scoreData.desc}}" lazy-load="{{true}}"></com-html>
</view>
</view>