渲染数据

This commit is contained in:
lcc
2024-10-17 10:29:23 +08:00
parent 2496fb50d3
commit 4fbc2dbf05
8 changed files with 175 additions and 200 deletions
+5 -1
View File
@@ -69,6 +69,7 @@ api = {
appStatisticsOcust: "app/statistics/ocust", //数据分析-订单数据
appStatisticsHcust: "app/statistics/hcust", //首页-客户图标数据
appStatisticsHorder: "app/statistics/horder", //首页-订单图表数据
appScore: "app/score", //首页-最新运营分
appStatisticsStats: "app/statistics/stats", //获取渠道经理数据分析入口数据
appStatisticsStats_days: "app/statistics/stats_days", //获取渠道经理数据分析数据
@@ -183,7 +184,10 @@ api = {
appSign: "app/sign", //用户签到
appSeriesMbrand: "app/series/mbrand" //获取车系品牌
appSeriesMbrand: "app/series/mbrand", //获取车系品牌
appScoreLists: "app/score/lists", //运营分排行
appScoreDetail: "app/score/detail", //运营分详情
}
//远程图片存储地址
+22
View File
@@ -397,6 +397,13 @@ apiQuery.getAppStatisticsHorder = function(params){
})
}
//首页-最新运营分
apiQuery.getAppScore = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appScore, 2, params, "GET", resolve, reject)
})
}
//更新用户店铺id
apiQuery.putAppUserResetbiz = function (params) {
return new Promise(function (resolve, reject) {
@@ -1059,4 +1066,19 @@ apiQuery.getMbrand = function (params) {
HttpRequest(false, Config.api.appSeriesMbrand, 2, params, "GET", resolve, reject)
})
}
//运营分排行列表
apiQuery.appScoreLists = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appScoreLists, 2, params, "GET", resolve, reject)
})
}
//运营分详情
apiQuery.appScoreDetail = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appScoreDetail, 2, params, "GET", resolve, reject)
})
}
export default apiQuery;
+23 -2
View File
@@ -140,6 +140,7 @@ Page({
isShowGoods:false,
});
this.getAppUserCal()
this.getScore()
// this.getAppTransferRemind()
// this.getAppInventoryRemind()
// this.getAppGoodsRemind()
@@ -181,6 +182,7 @@ Page({
});
this.getUserInfo()
this.getAppUserCal()
this.getScore()
// this.getAppTransferRemind()
// this.getAppInventoryRemind()
// this.getAppGoodsRemind()
@@ -342,6 +344,11 @@ Page({
this.setData({
userInfo: res
})
if(res.group_id>2){
this.setData({
score_role_cur:1
})
}
});
},
@@ -544,10 +551,23 @@ Page({
//0924
changeScoreRoleTab(e){
this.setData({
score_role_cur:e.currentTarget.dataset.index
score_role_cur:parseInt(e.currentTarget.dataset.index)
})
this.getScore()
},
//加载最新运营分
getScore(){
let params = {};
if(this.data.score_role_cur){
params['type'] = 1;
}
_.apiQuery.getAppScore(params).then(res => {
this.setData({
scoreData:res.data,
score_trend:res.data.score_trend ?? 1
})
})
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
this.setData({
@@ -558,6 +578,7 @@ Page({
});
this.getAppUserCal()
this.getAppStatisticsHcust()
this.getScore()
//this.getAppStatisticsHorder()
// this.getAppTransferRemind()
// this.getAppInventoryRemind()
+10 -12
View File
@@ -65,33 +65,31 @@
<text class="font-36">最新运营分</text>
<view class="text-right pt10">
<view class="ulib-r10 fn-flex overflowhidden font-24">
<view data-index="0" bindtap="changeScoreRoleTab" class="{{score_role_cur===0?'bg-ccc':'bg-fff'}} transition-all pl15 pr15 pt5 pb5" wx:if="{{userInfo.group_id==='1'||userInfo.group_id==='2'}}">个人</view>
<view data-index="1" bindtap="changeScoreRoleTab" class="{{score_role_cur===1?'bg-ccc':'bg-fff'}} transition-all pl15 pr15 pt5 pb5" wx:if="{{userInfo.group_id>1}}">门店</view>
<!--
<block wx:for="{{score_role_tab}}" wx:key="index">
<view data-index="{{index}}" bindtap="changeScoreRoleTab" class="{{score_role_cur===index?'bg-ccc':'bg-fff'}} transition-all pl15 pr15 pt5 pb5">{{item.name}}</view>
</block>
-->
</view>
</view>
</view>
<view class="fn-flex fn-flex-middle pt20 pb20 relative">
<view class="mr20 pt20">
<van-circle
value="{{ 30 }}"
stroke-width="10"
text="50"
layer-color="#ebebeb"
size="60"
color="{{score_trend>1?score_down_color:score_up_color}}"></van-circle>
<van-circle value="{{ scoreData.percentage }}" stroke-width="10" text="{{scoreData.score}}" layer-color="#ebebeb" size="60" color="{{score_trend>1?score_down_color:score_up_color}}"></van-circle>
</view>
<view class="fn-flex-item line-height-16">
<view class="fn-flex fn-flex-middle font-30">
<image src="{{score_trend>1?icon_trend_down:icon_trend_up}}" class="img-28x28 block mr10"/>
<text>较上日上升100分</text>
<image src="{{score_trend>1?icon_trend_down:icon_trend_up}}" class="img-28x28 block mr10" />
<text>{{scoreData.title}}</text>
</view>
<view class="font-24 color-999">
<view>*更新于09月10日</view>
<view>当前显示为昨日运营情况评分</view>
<view>{{scoreData.u_time_text}}</view>
<view>{{scoreData.sub_title}}</view>
</view>
</view>
<view data-url="" bindtap="pushLink" class="font-30 color-999 text-middle"><text>详情</text><i class="iconfont icon-gengduo ml5 font-30"></i></view>
<view data-url="/pages/score/index?is_biz={{score_role_cur}}" bindtap="pushLink" class="font-30 color-999 text-middle"><text>详情</text><i class="iconfont icon-gengduo ml5 font-30"></i></view>
</view>
</view>
<!-- 0924 end -->
+17 -67
View File
@@ -20,72 +20,8 @@ Page({
score_up_color: '#31cbad',
score_down_color: '#ff895b',
score_trend: 1, //用这个参数控制样式:1 上升 、2 下降
list: [{
name: '基础分',
score: 60,
trend: 1,
data: [{
name: '正常开工',
score: '+180'
}]
}, {
name: '线索分',
score: 660,
trend: 1,
data: [{
name: '线索建档',
score: '+180'
},{
name: '添加微信',
score: '+180'
},{
name: '跟进小记',
score: '+180'
},{
name: '语音通话',
score: '+180'
},{
name: '二次派发',
score: '+180'
},{
name: '首次跟进',
score: '+180'
}]
}, {
name: '订单分',
score: 260,
trend: 1,
data: [{
name: '成交数',
score: '+180'
},{
name: '成交率',
score: '+180'
},{
name: '开票率',
score: '+180'
},{
name: '交付率',
score: '+180'
}]
}, {
name: '扣分项',
score: 260,
trend: 2,
data: [{
name: '逾期未跟进',
score: '-80'
},{
name: '战败未处理',
score: '-180'
},{
name: '开票后录单',
score: '-180'
},{
name: '建档即订单',
score: '-180'
}]
}]
list: [],
res_data: [],
},
/**
@@ -108,7 +44,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.getScoreDetail()
},
/**
@@ -144,5 +80,19 @@ Page({
*/
onShareAppMessage() {
},
//获取排行列表
getScoreDetail() {
let params = {};
params['day_type'] = this.data.tab_date_cur
params['type'] = this.data.tab_rank_cur
_.apiQuery.appScoreDetail(params).then(res => {
this.setData({
list: res.data.data,
score_trend: res.data.score_trend,
res_data: res.data
})
})
}
})
+7 -10
View File
@@ -5,19 +5,16 @@
<view class="inner40 relative fn-flex fn-flex-middle fn-flex-between">
<view class="text-left">
<view class="font-28 color-666">昨日运营分</view>
<view class="font-72" style="color:{{score_trend>1?score_down_color:score_up_color}}">798</view>
<view class="font-72" style="color:{{score_trend>1?score_down_color:score_up_color}}">{{res_data.score}}</view>
</view>
<view class="text-right">
<view class="font-28 color-666">上一日运营分</view>
<view class="font-72" style="color:{{score_trend>1?score_down_color:score_up_color}}">798</view>
<view class="font-72" style="color:{{score_trend>1?score_down_color:score_up_color}}">{{res_data.up_data_score}}</view>
</view>
<view
class="ulib-r750 fn-flex fn-flex-middle absolute box-center-middle font-28 pl20 pr20 pt10 pb10 overflowhidden"
style="border:2rpx solid {{score_trend>1?score_down_color:score_up_color}};"
>
<view class="ulib-r750 fn-flex fn-flex-middle absolute box-center-middle font-28 pl20 pr20 pt10 pb10 overflowhidden" style="border:2rpx solid {{score_trend>1?score_down_color:score_up_color}};">
<view class="absolute left-0 top-0 right-0 bottom-0 opacity-10" style="background-color:var(--circle-text-color);"></view>
<image src="{{score_trend>1?icon_trend_down:icon_trend_up}}" class="relative img-28x28 block mr10"/>
<text class="color-666 relative">较上日上升100分</text>
<image src="{{score_trend>1?icon_trend_down:icon_trend_up}}" class="relative img-28x28 block mr10" />
<text class="color-666 relative">{{res_data.change_text}}</text>
</view>
</view>
<view class="ml30 mr30 pb30">
@@ -33,8 +30,8 @@
<view class="fn-flex-item">
<block wx:for="{{item.data}}" wx:for-item="it" wx:for-index="idx" wx:key="idx">
<view class="fn-flex fn-flex-middle fn-flex-between pt10 pb10 font-26 color-666">
<view >{{it.name}}</view>
<view >{{it.score}}</view>
<view>{{it.name}}</view>
<view>{{it.score}}</view>
</view>
</block>
</view>
+62 -81
View File
@@ -25,35 +25,11 @@ Page({
name: '昨日'
}, {
id: 2,
name: '月'
name: '月'
}],
tab_date_cur: 0,
score_detail_data: [{
name: '998',
tip: '运营分'
}, {
name: '=',
tip: ''
}, {
name: '98',
tip: '运营分'
}, {
name: '+',
tip: ''
}, {
name: '98',
tip: '运营分'
}, {
name: '+',
tip: ''
}, {
name: '98',
tip: '运营分'
}, {
name: '+',
tip: ''
}, {
name: '98',
tip: '运营分'
}],
@@ -66,59 +42,11 @@ Page({
name: '门店排名'
}],
tab_rank_cur: 0,
rank_data: [{
name: '张三',
is_manager: true,
trend: 1, //1 上升 、2 下降
score: '180分'
}, {
name: '张三',
is_manager: false,
trend: 2, //1 上升 、2 下降
score: '5分'
}, {
name: '张三',
is_manager: false,
trend: 2, //1 上升 、2 下降
score: '80分'
}, {
name: '张三',
is_manager: false,
trend: 1, //1 上升 、2 下降
score: '80分'
}, {
name: '张三',
is_manager: false,
trend: 2, //1 上升 、2 下降
score: '5分'
}, {
name: '张三',
is_manager: false,
trend: 2, //1 上升 、2 下降
score: '80分'
}, {
name: '张三',
is_manager: false,
trend: 1, //1 上升 、2 下降
score: '80分'
}, {
name: '张三',
is_manager: false,
trend: 2, //1 上升 、2 下降
score: '5分'
}, {
name: '张三',
is_manager: false,
trend: 2, //1 上升 、2 下降
score: '80分'
}, {
name: '张三',
is_manager: false,
trend: 1, //1 上升 、2 下降
score: '80分'
}],
content: '<p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p><p>asdfasdf</p>',
setid: ''
rank_data: [],
content: '',
setid: '',
is_biz: 0, //是否选择门店跳转过来
scoreData: [],
},
/**
@@ -128,6 +56,11 @@ Page({
wx.setNavigationBarTitle({
'title': '个人运营分'
})
for (let key in options) {
this.setData({
[key]: options[key]
})
}
},
/**
@@ -141,7 +74,8 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.getScore()
this.getScoreLists()
},
/**
@@ -179,9 +113,56 @@ Page({
},
scrollToRule(){
scrollToRule() {
this.setData({
setid: 'richhtml'
})
},
//推送链接
pushLink(e) {
if (e.currentTarget.dataset.url) {
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//时间切换
changeDateTab(e) {
this.setData({
tab_date_cur: parseInt(e.currentTarget.dataset.index),
tab_rank_cur: 0
})
this.getScore()
this.getScoreLists()
},
//切换排行类型
changeRankTab(e) {
this.setData({
tab_rank_cur: parseInt(e.currentTarget.dataset.index)
})
this.getScoreLists()
},
//首页积分信息
getScore() {
let params = {};
params['day_type'] = this.data.tab_date_cur
if (this.data.is_biz == 1) {
params['type'] = 1
}
_.apiQuery.getAppScore(params).then(res => {
this.setData({
scoreData: res.data,
score_trend: res.data.score_trend ?? 1
})
})
},
//获取排行列表
getScoreLists() {
let params = {};
params['day_type'] = this.data.tab_date_cur
params['type'] = this.data.tab_rank_cur
_.apiQuery.appScoreLists(params).then(res => {
this.setData({
rank_data: res.data.lists,
})
})
}
})
+29 -27
View File
@@ -1,12 +1,12 @@
<!-- pages/score/index.wxml -->
<view class="container relative" style="min-height:100vh;--circle-text-color:{{score_trend>1?score_down_color:score_up_color}};">
<scroll-view class="relative" scroll-y="{{true}}" scroll-into-view="{{setid}}" scroll-with-animation="{{true}}" style="height:100vh">
<scroll-view class="relative" scroll-y="{{true}}" scroll-into-view="{{setid}}" scroll-with-animation="{{true}}" style="height:100vh">
<view class="absolute left-0 top-0 bottom-0 right-0 bg-size-fullwidth bg-no-repeat bg-pos-top" style="background-image:url({{score_trend>1?score_index_bg_down:score_index_bg_up}});"></view>
<view class="relative inner30">
<view class="fn-flex fn-flex-middle fn-flex-between inner20">
<view class="fn-flex">
<block wx:for="{{tab_date}}" wx:key="index">
<view 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>
<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">
@@ -15,35 +15,37 @@
</view>
<view class="fn-flex fn-flex-column fn-flex-middle mb40">
<view class="font-66 text-bold pt30">
<van-circle
value="{{ 30 }}"
stroke-width="15"
text="500"
layer-color="#ebebeb"
size="120"
color="{{score_trend>1?score_down_color:score_up_color}}"></van-circle>
<van-circle value="{{ scoreData.percentage }}" stroke-width="15" text="{{scoreData.score}}" layer-color="#ebebeb" size="120" color="{{score_trend>1?score_down_color:score_up_color}}"></van-circle>
</view>
<view class="fn-flex fn-flex-middle fn-flex-center pt30 color-666 font-32">
<image src="{{score_trend>1?icon_trend_down:icon_trend_up}}" class="img-32x32 block mr10"/>
<text>较上日上升100分</text>
<image src="{{score_trend>1?icon_trend_down:icon_trend_up}}" class="img-32x32 block mr10" />
<text>{{scoreData.title}}</text>
</view>
<view class="fn-flex fn-flex-middle fn-flex-center pt15 font-26 color-999">
<view>*更新于09月10日</view>
<view>当前显示为昨日运营情况评分</view>
<view>{{scoreData.u_time_text}}</view>
<view>{{scoreData.sub_title}}</view>
</view>
</view>
<view class="bg-fff mb30 box-shadow-000-10-10 ulib-r10 pt40 pb40">
<view class="fn-flex fn-flex-middle fn-flex-center text-center">
<block wx:for="{{score_detail_data}}" wx:key="index">
<block wx:if="{{scoreData.score_list && scoreData.score_list.length>0}}">
<view class="fn-flex fn-flex-middle fn-flex-center text-center">
<view class="pr15 pl15">
<view class="font-34">{{item.name}}</view>
<view class="mt5 color-666 font-22">{{item.tip}}</view>
<view class="font-34">{{scoreData.score}}</view>
<view class="mt5 color-666 font-22">运营分</view>
</view>
</block>
</view>
<view class="text-center pt20">
<view class="ulib-r10 font-24 link-detail relative link-detail inline-block pt10 pb10 pl20 pr20 overflowhidden"><text>查看明细</text><text class="iconfont icon-gengduo ml5"></text></view>
</view>
<view>=</view>
<block wx:for="{{scoreData.score_list}}" wx:key="index">
<view>{{item.operator}}</view>
<view class="pr15 pl15">
<view class="font-34">{{item.value}}</view>
<view class="mt5 color-666 font-22">{{item.name}}</view>
</view>
</block>
</view>
<view class="text-center pt20">
<view data-url="/pages/score/detail" bindtap="pushLink" class="ulib-r10 font-24 link-detail relative link-detail inline-block pt10 pb10 pl20 pr20 overflowhidden"><text>查看明细</text><text class="iconfont icon-gengduo ml5"></text></view>
</view>
</block>
<view class="text-center pt40">
<view class="ulib-r10 overflowhidden font-24 inline-block">
@@ -58,20 +60,20 @@
<text class="text-center mr20" style="width:38rpx;" wx:if="{{index>2}}">{{index+1}}</text>
<image wx:else class="img-38x38 mr20" src="{{index==0?icon_score_top_1:index==1?icon_score_top_2:icon_score_top_3}}" />
<text>{{item.name}}</text>
<view class="ulib-r750 color-fff font-20 pl15 pr15 pb5 ml15" style="background-color:{{score_up_color}};" wx:if="{{item.is_manager}}">店长</view>
<view class="ulib-r750 color-fff font-20 pl15 pr15 pb5 ml15" style="background-color:{{score_up_color}};" wx:if="{{item.tip}}">{{item.tip}}</view>
</view>
<view class="fn-flex fn-flex-middle font-28 color-666" style="width:130rpx;">
<image src="{{item.trend>1?icon_trend_down:icon_trend_up}}" class="img-32x32 block mr10"/>
<image src="{{item.trend>1?icon_trend_down:icon_trend_up}}" class="img-32x32 block mr10" />
<text>{{item.score}}</text>
</view>
</view>
</block>
</view>
</view>
</view>
<view wx:if="{{content}}" id="richhtml" class="bg-fff mb30 box-shadow-000-10-10 ulib-r10 inner40">
<com-html content="{{content}}" lazy-load="{{true}}"></com-html>
<view wx:if="{{scoreData.desc}}" id="richhtml" class="bg-fff mb30 box-shadow-000-10-10 ulib-r10 inner40">
<com-html content="{{scoreData.desc}}" lazy-load="{{true}}"></com-html>
</view>
</view>
</scroll-view>