Commit 30ca30b5 by 李伟康

commit 话术质检需求

1 parent 12a35335
Showing 27 changed files with 833 additions and 62 deletions
......@@ -105,7 +105,9 @@
"pages/clueList/clueList",
"pages/clueDetail/clueDetail",
"pages/residentTarget/residentTarget",
"pages/aiInspection/aiInspection"
"pages/aiInspection/aiInspection",
"pages/aiInspectionDetail/aiInspectionDetail",
"pages/aiInspectionReception/aiInspectionReception"
]
},
{
......
......@@ -61,7 +61,8 @@ page {
}
.isFullSucreen {
padding-bottom: 34px !important;
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.isFullSucreen-bottom {
......
......@@ -5,16 +5,18 @@ Page({
* 页面的初始数据
*/
data: {
num: 88,
flag: true,
list:[new Array(10)]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad(options) {},
changeDate(e) {
console.log(e)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......
{
"usingComponents": {
"circular":"./components/circular/circular"
"circular":"./components/circular/circular",
"date-box":"./components/dateBox/dateBox",
"data-box":"./components/dataBox/dataBox",
"content-item":"./components/contentItem/contentItem"
},
"navigationBarTitleText": "话术质检"
}
\ No newline at end of file
......@@ -64,14 +64,16 @@ page {
}
}
}
.date-box {
height: var(--fontSize88);
background-color: #fff;
.content-box{
padding:var(--fontSize20) 0;
}
.data-box {
height: var(--fontSize176);
background-color: #fff;
.padding-box {
font-weight: 500;
font-size: var(--fontSize28);
color: #BEC1C7;
width: 100%;
text-align: center;
margin-top: var(--fontSize284);
}
}
\ No newline at end of file
......@@ -10,14 +10,30 @@
</view>
<view class="arc-box">
<view class="arc">
<circular num="20"></circular>
<circular num="{{num}}"></circular>
</view>
<view class="arc-tips">今日综合质检评分</view>
</view>
</view>
<view class="date-box"></view>
<view class="data-box"></view>
<date-box bindchange="changeDate"></date-box>
<data-box></data-box>
<view class="content-box">
<block wx:if="{{flag}}">
<block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index">
<block wx:for="{{item}}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<content-item item="{{i}}"></content-item>
</block>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<block wx:else>
<view class="padding-box">
质检分析中,请耐心等待
</view>
</block>
</block>
</view>
</view>
\ No newline at end of file
......@@ -12,7 +12,8 @@ const Arc_Background = [
'#80ACFF',
'#4D8AFF',
'#196AFF'
]
],
Start_Angle = 0.79 * Math.PI
Component({
/**
* 组件的属性列表
......@@ -54,36 +55,25 @@ Component({
compInst: true
}),
ctx = canvas.getContext('2d'),
startAngle = 0.79 * Math.PI,
startAngle = Start_Angle,
angle = Math.PI / 3.5
ctx.lineWidth = this.toRpx(2)
ctx.lineCap = 'round'
ctx.lineJoin = 'round'
ctx.strokeStyle = '#fff'
this.ctx = ctx
this.arcInfo = {
x: width / 2,
y: width / 2,
innerRadius: this.toRpx(58),
outerRadius: this.toRpx(34),
angle
}
this.canvas = canvas
await this.drawBackground()
if (data) this.fillArc(startAngle, 0, startAngle + angle)
else {
this.drawText({
text: '···',
x: width / 4,
y: width / 4,
fontSize: 30,
color: '#196AFF',
fontWeight: 600,
textAlign: 'center',
textBaseline: 'middle'
})
this.drawTips()
}
else this.drawTips()
} catch (error) {
console.log(error)
wx.$util.showToast(error || '出错了,请重试')
}
},
async drawBackground() {
......@@ -92,20 +82,21 @@ Component({
arcInfo: {
x,
y,
angle
angle,
innerRadius,
outerRadius
}
} = this,
innerRadius = this.toRpx(58),
outerRadius = this.toRpx(34)
let startAngle = 0.79 * Math.PI
} = this
let startAngle = Start_Angle
for (let i = 0; i < 5; i++) {
ctx.beginPath()
ctx.arc(x, y, innerRadius, startAngle, startAngle + angle)
ctx.arc(x, y, outerRadius, startAngle + angle, startAngle, true)
if (i == 0) ctx.closePath()
ctx.fillStyle = Arc_Background[i]
ctx.stroke()
ctx.fill()
ctx.stroke()
startAngle += angle
}
ctx.save()
......@@ -117,6 +108,16 @@ Component({
y,
} = this.arcInfo
this.drawText({
text: data || '···',
x: x / 2,
y: y / 2,
fontSize: 30,
color: '#196AFF',
fontWeight: 600,
textAlign: 'center',
textBaseline: 'middle'
})
this.drawText({
text: data ? '分数' : '计算中…',
x: x / 2,
y: (y + 44) / 2,
......@@ -134,11 +135,14 @@ Component({
arcInfo: {
x,
y,
angle
angle,
innerRadius,
outerRadius
},
data: {
num
}
} = this,
innerRadius = this.toRpx(58),
outerRadius = this.toRpx(34),
a = startAngle
let b = startAngle + Math.PI / 70
ctx.beginPath()
......@@ -149,29 +153,53 @@ Component({
ctx.save()
this.drawImg()
setTimeout(() => {
if (index == part - 1) {
const blockNum = Start_Angle + (angle * index),
remainder = (endAngle - blockNum) / 20 * ((num % 20) == 0 ? 20 : num % 20) + blockNum
if (b == remainder) {
this.refactor(remainder)
this.drawTips(num)
return
}
}
if (b <= endAngle) this.fillArc(b, index, endAngle)
else {
if (index < part - 1) {
this.fillArc(endAngle, index + 1, startAngle + angle)
} else {
const {
num
} = this.data
this.drawText({
text: num,
x: x / 2,
y: y / 2,
fontSize: 30,
color: '#196AFF',
fontWeight: 600,
textAlign: 'center',
textBaseline: 'middle'
})
this.drawTips(num)
}
} else this.drawTips(num)
}
}, 10)
},
refactor(remainder) {
const {
ctx,
part,
arcInfo: {
x,
y,
angle,
innerRadius,
outerRadius
}
} = this
let startAngle = Start_Angle
for (let i = 0; i < part; i++) {
ctx.beginPath()
if (i == part - 1) {
ctx.arc(x, y, innerRadius, startAngle, remainder)
ctx.arc(x, y, outerRadius, remainder, startAngle, true)
} else {
ctx.arc(x, y, innerRadius, startAngle, startAngle + angle)
ctx.arc(x, y, outerRadius, startAngle + angle, startAngle, true)
}
ctx.fillStyle = Arc_Data_Background[i]
ctx.stroke()
ctx.fill()
startAngle += angle
}
ctx.save()
this.drawImg()
},
drawText(params) {
const {
ctx
......@@ -194,7 +222,6 @@ Component({
ctx.textAlign = textAlign || 'left'
ctx.textBaseline = textBaseline || 'top'
ctx.fillStyle = color
console.log(ctx)
ctx.fillText(text, x, y)
ctx.save()
this.drawImg()
......
// packageEquity/pages/aiInspection/components/contentItem/contentItem.js
Component({
/**
* 组件的属性列表
*/
properties: {
item: Object
},
/**
* 组件的初始数据
*/
data: {
contentObject: [{
label: '接待时间',
key: ''
},
{
label: '录音时长',
key: ''
},
{
label: '预计营销结果',
key: '',
colorEnum: {
0: '#F24724',
1: '#35C376'
}
}
]
},
/**
* 组件的方法列表
*/
methods: {
jumpDetail() {
const {
item
} = this.data
wx.$router.go('aiInspectionDetail', item)
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageEquity/pages/aiInspection/components/contentItem/contentItem.wxss */
.item {
width: calc(710 / 750 * 100%);
height: var(--fontSize340);
background: #FFFFFF;
box-shadow: 0 var(--fontSize4) var(--fontSize16) 0 #cdcdd180;
border-radius: var(--fontSize16);
margin: 0 auto var(--fontSize20);
.title {
display: flex;
align-items: center;
height: var(--fontSize86);
padding: 0 var(--fontSize32);
font-weight: 500;
font-size: var(--fontSize28);
color: #292D33;
border-bottom: var(--fontSize1) solid #EFF0F2;
.sub {
flex: 1;
display: flex;
align-items: center;
.num {
margin-left: var(--fontSize24);
font-weight: 700;
font-size: var(--fontSize36);
}
}
}
.content {
padding: var(--fontSize16) var(--fontSize32);
.sub-item {
display: flex;
align-items: center;
margin-bottom: var(--fontSize16);
.label {
font-size: var(--fontSize24);
color: #999EA8;
margin-right: var(--fontSize40);
width: var(--fontSize144);
}
.value {
font-size: var(--fontSize24);
color: #292D33;
}
}
.btn {
display: flex;
align-items: center;
justify-content: center;
margin: auto 0 0 auto;
width: var(--fontSize164);
height: var(--fontSize52);
background: #FFFFFF;
border: var(--fontSize2) solid #347BFF;
border-radius: var(--fontSize32);
font-weight: 500;
font-size: var(--fontSize28);
color: #347BFF;
}
}
}
\ No newline at end of file
<view class="item">
<view class="title">
<view class="sub">
接待批次
<view class="num">1</view>
</view>
<view class="sub">
得分
<view class="num">1</view>
</view>
</view>
<view class="content">
<block wx:for="{{contentObject}}" wx:for-item="i" wx:for-index="ind">
<view class="sub-item">
<view class="label">{{i.label}}</view>
<view class="value" style="color:{{colorEnum?colorEnum[item.status]:''}};">{{item[i.key]||'恒河猴'}}</view>
</view>
</block>
<view class="btn" bindtap="jumpDetail">质检详情</view>
</view>
</view>
\ No newline at end of file
// packageEquity/pages/aiInspection/components/dataBox/dataBox.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
dataObject: [{
title: '预计接待批次',
tips: 'AI根据当日提交的营销录音做出的预估接待批次数',
key: ''
},
{
title: '当日到店量',
tips: '驻店员工在当日驻店日报中填写的到店流量(会员权益/延保),即本人在当天接待的权益延保业务客户数',
key: ''
},
{
title: '异常占比',
tips: '异常占比=【预计接待批次 - 当日到店量(会员权益/延保)】/ 预计接待批次数',
key: '',
unit: '%'
}
]
},
/**
* 组件的方法列表
*/
methods: {
showTips(e) {
console.log(e)
const {
title,
tips
} = e.currentTarget.dataset.item
wx.showModal({
title,
content: tips,
showCancel: false,
confirmColor: '#347BFF'
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageEquity/pages/aiInspection/components/dataBox/dataBox.wxss */
.data-box {
height: var(--fontSize176);
background-color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 var(--fontSize34);
.data-item {
width: calc(216 / 750 * 100%);
height: var(--fontSize136);
background: #F6FCFE;
border-radius: var(--fontSize16);
box-sizing: border-box;
padding: var(--fontSize24);
min-width: var(--fontSize216);
.data-title {
display: flex;
align-items: center;
font-weight: 500;
font-size: var(--fontSize22);
color: #5A5E66;
margin-bottom: var(--fontSize8);
line-height: var(--fontSize36);
.icon {
margin-left: var(--fontSize4);
width: var(--fontSize32);
height: var(--fontSize32);
flex-shrink: 0;
}
}
.data-value {
font-weight: 700;
font-size: var(--fontSize36);
color: #292D33;
display: flex;
align-items: baseline;
.unit {
font-size: var(--fontSize24);
margin-left: var(--fontSize4);
}
}
}
}
\ No newline at end of file
<view class="data-box">
<block wx:for="{{dataObject}}" wx:key="index">
<view class="data-item" bindtap="showTips" data-item="{{item}}">
<view class="data-title">
{{item.title}}
<block wx:if="{{item.tips}}">
<view class="icon">
<gl-image src="/equity/tips.png"></gl-image>
</view>
</block>
</view>
<view class="data-value">
12
<block wx:if="{{item.unit}}">
<view class="unit">{{item.unit}}</view>
</block>
</view>
</view>
</block>
</view>
\ No newline at end of file
// packageEquity/pages/aiInspection/components/dateBox/dateBox.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
lifetimes: {
ready() {
this.init()
}
},
/**
* 组件的初始数据
*/
data: {
today: new Date().format('yyyy-MM-dd'),
},
/**
* 组件的方法列表
*/
methods: {
init() {
const now = new Date().format('yyyy/MM/dd')
this.setData({
currentDay: new Date().format('yyyy年MM月dd日'),
todayTime: new Date(now).getTime(),
minTime: new Date('2024/1/1').getTime(),
currentDayTime: new Date(now).getTime()
})
},
selectDay(e) {
let {
date
} = e.detail,
currentDay = new Date(date.replace(/-/g, '/'))
this.setData({
currentDay: currentDay.format('yyyy年MM月dd日'),
currentDayTime: currentDay.getTime(),
})
this.triggerEvent('change', date)
this.selectComponent('#calendar').resetData(date)
},
choose(e) {
const {
index
} = e.target.dataset, {
currentDayTime
} = this.data
let currentDay = new Date(currentDayTime)
currentDay.setDate(currentDay.getDate() + Number(index))
let y = currentDay.getFullYear(),
m = currentDay.getMonth() + 1 < 10 ? `0${currentDay.getMonth() + 1}` : currentDay.getMonth() + 1,
d = currentDay.getDate() < 10 ? `0${currentDay.getDate()}` : currentDay.getDate()
this.selectDay({
detail: {
date: `${y}-${m}-${d}`
}
})
},
showCalendar(e) {
let calendarModule = this.selectComponent('#calendar')
calendarModule.showCalendar && calendarModule.showCalendar(e)
},
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageEquity/pages/aiInspection/components/dateBox/dateBox.wxss */
.date-box {
height: var(--fontSize88);
background-color: #fff;
display: flex;
align-items: center;
font-size: var(--fontSize28);
color: #181A1F;
padding: 0 var(--fontSize32);
position: relative;
.date-btn {
display: flex;
align-items: center;
line-height: var(--fontSize40);
.icon {
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize8);
}
}
.date-val {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: calc(276 / 750 * 100%);
height: var(--fontSize64);
background: #F7F8FA;
border-radius: var(--fontSize8);
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: var(--fontSize28);
color: #181A1F;
line-height: var(--fontSize40);
.icon{
width: var(--fontSize40);
height: var(--fontSize40);
margin-left: var(--fontSize2);
}
}
.next {
margin-left: auto;
.icon{
margin-left: var(--fontSize8);
margin-right: 0;
}
}
}
\ No newline at end of file
<view class="date-box">
<block wx:if="{{minTime != currentDayTime}}">
<view class="date-btn" bindtap="choose" data-index="-1">
<gl-image class="icon" src="/equity/arrow-left.png" />
上一天
</view>
</block>
<view class="date-val" bindtap="showCalendar" data-type="show">
{{currentDay}}
<gl-image class="icon" src="/equity/date-arrow.png" />
</view>
<block wx:if="{{todayTime != currentDayTime}}">
<view class="date-btn next" bindtap="choose" data-index="1">
下一天
<gl-image class="icon" src="/equity/arrow-right.png" />
</view>
</block>
</view>
<calendar shortcut bindselect='selectDay' calenderColor='#347BFF' vertical minDate="2024-1-1" isComponents id="calendar" maxDate="{{today}}" >
</calendar>
\ No newline at end of file
// packageEquity/pages/aiInspectionDetail/aiInspectionDetail.js
Page({
/**
* 页面的初始数据
*/
data: {
overviewList:[
{
title:'话术评分',
key:''
},
{
title:'预计营销结果',
key:'',
fontSize: 'var(--fontSize28)'
},
{
title:'开始录音时间',
key:''
},
{
title:'对话时长',
key:''
}
],
list:new Array(10)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "质检详情"
}
\ No newline at end of file
page {
background-color: #F7F8FA;
}
.flex {
display: flex;
align-items: center;
}
.layout {
.overview-box {
height: 256rpx;
background: #FFFFFF;
padding: 0 20rpx;
margin-bottom: 20rpx;
.overview-title {
font-weight: 600;
font-size: 28rpx;
color: #292D33;
height: 80rpx;
padding-left: 16rpx;
}
.overview-list {
height: 156rpx;
background: #F6FCFE;
border-radius: 16rpx;
.overview-item {
flex: 1;
flex-shrink: 0;
height: 100%;
flex-direction: column;
justify-content: center;
.title {
font-weight: 500;
font-size: 22rpx;
color: #5A5E66;
line-height: 36rpx;
margin-bottom: 8rpx;
}
.value {
font-weight: 700;
color: #292D33;
font-size: 36rpx;
}
}
}
}
.content-box {
.item {
width: calc(710 / 750 * 100%);
background: #FFFFFF;
box-shadow: 0 4rpx 16rpx 0 #cdcdd180;
border-radius: 16rpx;
margin: 0 auto 20rpx;
.title {
height: 88rpx;
padding: 0 32rpx;
border-bottom: 1rpx solid #EFF0F2;
margin-bottom: 16rpx;
font-weight: 500;
font-size: 28rpx;
color: #292D33;
.score {
margin-left: auto;
font-weight: 400;
font-size: 24rpx;
color: #292D33;
.num {
font-weight: 600;
font-size: 24rpx;
color: #292D33;
.highlight {
font-weight: 700;
font-size: 36rpx;
color: #347BFF;
}
}
}
}
.content {
padding: 0 32rpx 8rpx;
.sub-item {
margin-bottom: 16rpx;
font-size: 24rpx;
.label {
color: #5A5E66;
}
.value {
margin-left: auto;
color: #292D33;
}
}
}
}
}
}
\ No newline at end of file
<view class="layout isFullSucreen">
<view class="overview-box">
<view class="overview-title flex">大模型话术质检分析</view>
<view class="overview-list flex">
<block wx:for="{{overviewList}}" wx:key="index">
<view class="overview-item flex">
<view class="title">{{item.title}}</view>
<view class="value">50</view>
</view>
</block>
</view>
</view>
<view class="content-box">
<block wx:for="{{list}}" wx:key="index">
<view class="item">
<view class="title flex">
接待环节
<view class="score flex">
得分:
<view class="num flex"><view class="highlight">15</view>/20</view>
</view>
</view>
<view class="content">
<view class="sub-item flex">
<view class="label">介绍延保</view>
<view class="value">5/5</view>
</view>
</view>
</view>
</block>
</view>
</view>
\ No newline at end of file
// packageEquity/pages/aiInspectionReception/aiInspectionReception.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
/* packageEquity/pages/aiInspectionReception/aiInspectionReception.wxss */
\ No newline at end of file
<!--packageEquity/pages/aiInspectionReception/aiInspectionReception.wxml-->
<text>packageEquity/pages/aiInspectionReception/aiInspectionReception.wxml</text>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!