Commit cc68f5b9 by 王志慧

Merge branch 'SAAS+V4.42' of http://192.168.3.233:8090/saas_plus/dj-car-boutique…

…-work-wechat into SAAS+V4.42
2 parents 6e10f1ff d1fb87c5
...@@ -498,11 +498,12 @@ Page({ ...@@ -498,11 +498,12 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
async onLoad(options) { async onLoad(options) {
const {roleType,stage} = options
this.setSparringVerify() this.setSparringVerify()
const roleInfo = await carLifeApi.sparringRole({ const roleInfo = await carLifeApi.sparringRole({
currentPage: 1, currentPage: 1,
pageSize: 100, pageSize: 100,
roleType: 1 roleType
}) })
timer = setInterval(() => { timer = setInterval(() => {
duration++; duration++;
...@@ -510,12 +511,12 @@ Page({ ...@@ -510,12 +511,12 @@ Page({
const { const {
avatar, avatar,
roleName, roleName,
roleType,
attackScript, attackScript,
languageStyle: person_type languageStyle: person_type
} = roleInfo.data.list[0]; } = roleInfo.data.list[0];
this.getScriptList(attackScript); this.getScriptList(attackScript);
this.setData({ this.setData({
stage,
avatar, avatar,
person_type, person_type,
voice: VOICE[roleType - 1], voice: VOICE[roleType - 1],
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view class="chat-left"> <view class="chat-left">
<image class="avatar-icon" src="{{avatar}}"></image> <image class="avatar-icon" src="{{avatar}}"></image>
<view class="chat-box"> <view class="chat-box">
<view class="content-box">你已选择:<text class="font-b">{{roleName}}客户、接待环节</text></view> <view class="content-box">你已选择:<text class="font-b">{{roleName}}、{{stage}}环节</text></view>
<view class="operation"> <view class="operation">
<view class="operation-top"> <gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image> <view class="operation-top"> <gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image>
......
...@@ -13,7 +13,12 @@ import aiApi from "../../../../aiApi"; ...@@ -13,7 +13,12 @@ import aiApi from "../../../../aiApi";
import { import {
speechEmoji, speechEmoji,
soundEmoji, soundEmoji,
definitionEmoji definitionEmoji,
toneWords,
SpeechRateValue,
calculateStars,
calculateEmotion,
calculateIntonation
} from '../../contant' } from '../../contant'
let timer = null let timer = null
Component({ Component({
...@@ -291,14 +296,44 @@ Component({ ...@@ -291,14 +296,44 @@ Component({
aiApi.getVoice({ aiApi.getVoice({
file_link: url file_link: url
}).then(res => { }).then(res => {
console.log(res) const Sentences = res.Sentences
const Sentences_desc = this.getSentencesDetail(Sentences,this.data.list[i].content)
this.setData({ this.setData({
['list[' + i + '].voiceUrl']: url, ['list[' + i + '].voiceUrl']: url,
['list[' + i + '].Sentences']: res.Sentences ['list[' + i + '].Sentences']: Sentences,
['list[' + i + '].Sentences_desc']: Sentences_desc
}); });
console.log(this.data.list) console.log(this.data.list)
}) })
}, },
getSentencesDetail(Sentences,redundantWords) {
let totalSpeed = 0;
let totalEmotionValue = 0;
let SpeechRateAll = []
Sentences.forEach(i => {
totalSpeed += i.SpeechRate;
totalEmotionValue+= i.EmotionValue;
SpeechRateAll.push(i.SpeechRate)
})
const averageSpeed = totalSpeed / Sentences.length;
const averageEmotionValue = totalEmotionValue / Sentences.length
const val_1 = SpeechRateValue[calculateStars(averageSpeed)]
const val_2 = calculateIntonation(SpeechRateAll)
console.log(calculateEmotion,averageEmotionValue)
const val_3 = calculateEmotion(averageEmotionValue)
const val_4 = this.getNum(redundantWords)
console.log(val_1,val_2,val_3,val_4)
return [val_1,val_2,val_3,val_4]
},
getNum(words) {
// 构建一个正则表达式,匹配数组h中每个元素的叠词
const regex = new RegExp(`(${toneWords.map(str => str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')).join('|')})\\1+`, 'g');
const matches = words.match(regex) || [];
const wordNum = matches.reduce((cur, prev) => {
return cur + (prev.length - 1)
}, 0)
return wordNum >0?wordNum:'无'
},
getList(step, defenseIndex) { getList(step, defenseIndex) {
let { let {
list, list,
......
...@@ -73,19 +73,19 @@ ...@@ -73,19 +73,19 @@
<view class="chat-aspect"> <view class="chat-aspect">
<view class="aspect-item"> <view class="aspect-item">
<view class="aspect-name">语速</view> <view class="aspect-name">语速</view>
<view class="aspect-result">适中</view> <view class="aspect-result">{{item.Sentences_desc[0]}}</view>
</view> </view>
<view class="aspect-item"> <view class="aspect-item">
<view class="aspect-name">语调</view> <view class="aspect-name">语调</view>
<view class="aspect-result">适中</view> <view class="aspect-result">{{item.Sentences_desc[1]}}</view>
</view> </view>
<view class="aspect-item"> <view class="aspect-item">
<view class="aspect-name">清晰度</view> <view class="aspect-name">清晰度</view>
<view class="aspect-result">适中</view> <view class="aspect-result">{{item.Sentences_desc[2]}}</view>
</view> </view>
<view class="aspect-item"> <view class="aspect-item">
<view class="aspect-name">冗余词</view> <view class="aspect-name">冗余词</view>
<view class="aspect-result">适中</view> <view class="aspect-result">{{item.Sentences_desc[3]}}</view>
</view> </view>
</view> </view>
<view class="suggest"> <view class="suggest">
......
...@@ -10,15 +10,15 @@ export const saleEmoji = [{ ...@@ -10,15 +10,15 @@ export const saleEmoji = [{
text: '卓越' text: '卓越'
}] }]
export const speechEmoji = [{ export const speechEmoji = [{
text: '迟钝' text: '急速'
}, { }, {
text: '缓慢' text: '极慢'
}, { }, {
text: '适中' text: '快速'
}, { }, {
text: '流畅' text: '缓慢'
}, { }, {
text: '飞速' text: '适中'
}] }]
export const soundEmoji = [{ export const soundEmoji = [{
text: '平淡' text: '平淡'
...@@ -66,5 +66,72 @@ export const activeEmoji = [{ ...@@ -66,5 +66,72 @@ export const activeEmoji = [{
}] }]
export const toneWords = ['嗯', '额', '哦', '啊', '呵', '哈', '呀', '呢', '吗', '呗'] export const toneWords = ['嗯', '额', '哦', '啊', '呵', '哈', '呀', '呢', '吗', '呗']
export const toneList = ['您的语言表达充斥着大量不必要的重复词汇,几乎让人无法理解其意图,严重影响沟通效果。', '您的冗余词汇使用过多,导致表达显得啰嗦,可能会让听者或读者感到困惑,需要仔细分辨才能理解核心信息。', '您的表达中频繁出现冗余词汇,虽然不影响主要信息的传达,但会使语言显得有些啰嗦。', '您偶尔出现一些不必要的词汇,但整体上不影响理解,语言仍然保持较高的清晰度。', '您的语言表达简洁明了,没有任何不必要的冗余词汇,信息传达直接高效。'] export const toneList = ['您的语言表达充斥着大量不必要的重复词汇,几乎让人无法理解其意图,严重影响沟通效果。', '您的冗余词汇使用过多,导致表达显得啰嗦,可能会让听者或读者感到困惑,需要仔细分辨才能理解核心信息。', '您的表达中频繁出现冗余词汇,虽然不影响主要信息的传达,但会使语言显得有些啰嗦。', '您偶尔出现一些不必要的词汇,但整体上不影响理解,语言仍然保持较高的清晰度。', '您的语言表达简洁明了,没有任何不必要的冗余词汇,信息传达直接高效。']
export const definitionList = ['您的语调过于单调,听起来平淡无奇,容易让听众感到十分乏味或缺乏兴趣。', '您的语调几乎不变,缺乏情感和活力,可能会让听众感到乏味。', '您的语调有轻微的升降和强弱变化,足够表达基本的情感和强调,但变化不大。', '您的语调有明显的升降和强弱变化,能够有效地传达情感和强调重点,使语言更加生动和吸引人。', '您的语调变化丰富,能够充分表达复杂的情感和细微的差别,使语言表达更加生动和有感染力。']
export const intonationList = ['您的发音严重不准确,大量音节和音素模糊不清,听众很难理解说话者的意图,沟通效果极差。', '您的发音不够准确,有些音节和音素模糊不清,听众可能需要更加集中注意力或请求重复才能理解全部内容。', '您的发音基本准确,部分音节可能不够清晰,但大部分信息仍然可以传达给听众,偶尔需要听众集中注意力才能完全理解。', '您的发音较为准确,大部分音节和音素清晰,偶尔有轻微的模糊,但不影响整体理解。', '您的发音准确,每个音节和音素都清晰可辨,没有任何模糊或含糊的地方,听众可以轻松理解每一个词。']
\ No newline at end of file \ No newline at end of file
export const intonationList = ['您的语调过于单调,听起来平淡无奇,容易让听众感到十分乏味或缺乏兴趣。', '您的语调几乎不变,缺乏情感和活力,可能会让听众感到乏味。', '您的语调有轻微的升降和强弱变化,足够表达基本的情感和强调,但变化不大。', '您的语调有明显的升降和强弱变化,能够有效地传达情感和强调重点,使语言更加生动和吸引人。', '您的语调变化丰富,能够充分表达复杂的情感和细微的差别,使语言表达更加生动和有感染力。']
export const definitionList = ['您的发音严重不准确,大量音节和音素模糊不清,听众很难理解说话者的意图,沟通效果极差。', '您的发音不够准确,有些音节和音素模糊不清,听众可能需要更加集中注意力或请求重复才能理解全部内容。', '您的发音基本准确,部分音节可能不够清晰,但大部分信息仍然可以传达给听众,偶尔需要听众集中注意力才能完全理解。', '您的发音较为准确,大部分音节和音素清晰,偶尔有轻微的模糊,但不影响整体理解。', '您的发音准确,每个音节和音素都清晰可辨,没有任何模糊或含糊的地方,听众可以轻松理解每一个词。']
export const speechList = ['您的语速极快,几乎听不出单词之间的停顿,可能会导致听众难以理解,尤其是在不熟悉的话题或复杂的讨论中。', '您的语速极慢,每个词之间有明显的停顿,通常用于强调某些信息或确保听众能够完全理解。', '您的语速较快,词汇之间的间隔较短,可能需要听众集中注意力才能跟上,但仍然可以保持清晰度。', '您的语速较慢,适合于清晰的沟通和教学,给听众足够的时间来消化和理解信息。', '您的语速适中,既不过快也不过慢,是大多数日常对话和正式演讲的理想速度,便于听众跟随和理解。']
export const familiarList = ['您对延保流程十分生疏,建议多向优秀员工请教并多熟悉延保流程与话术。', '您对延保流程比较生疏,建议抽空熟悉延保流程与话术。', '您对延保流程掌握的一般,需要加强自己的销售话术。', '您对延保流程非常熟悉,能够在大部分环节引导客户购买延保产品。', '您对延保流程有着卓越的理解和掌握,能够在每个环节准确引导客户购买延保产品。']
export const calculateStars = (averageSpeed) => {
// 根据平均语速计算星级
switch (true) {
case averageSpeed >= 180:
return 1; // 1星
case averageSpeed < 100:
return 2; // 2星
case averageSpeed >= 100 && averageSpeed <= 120:
return 4; // 4星
case averageSpeed >= 121 && averageSpeed <= 150:
return 5; // 5星
case averageSpeed >= 151 && averageSpeed <= 180:
return 3; // 3星
default:
return 0; // 默认值,如果不在上述范围内
}
}
export const SpeechRateValue = {
1: '非常快速',
2: '非常缓慢',
3: '快速',
4: '缓慢',
5: '适中'
}
export const speechSpeed_MIN = 120
export const speechSpeed_MAX = 150
export const calculateEmotion = (emotion,isStar) => {
console.log(emotion,'emotion')
let star = ''
switch (true) {
case emotion >= 7:
star = 4
break;
case 6.5 < emotion < 7:
star = 3
break;
case emotion <= 5:
star = 0
break;
default:
star = 2
}
console.log(star,definitionEmoji[star])
return isStar?star:definitionEmoji[star].text
}
export const Emotion_MIN = 7;
export const Emotion_MAX = 9;
export const calculateIntonation = (list,isStar) => {
let previousRate = 0;
let richTones = -1;
let monotonousTones = 0;
list.forEach(i=>{
if (i !== previousRate) {
richTones++;
} else {
monotonousTones++;
}
previousRate = i
})
const tone = richTones > monotonousTones ? '丰富' : '平淡';
const star = richTones > monotonousTones ? 4 : 1;
return isStar?star:tone
}
export const Intonation_MIN = 3;
export const Intonation_MAX = 4;
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { import {
speechEmoji, speechEmoji,
toneWords, toneWords,
speechList,
toneList toneList
} from '../../../contant' } from '../../../contant'
Component({ Component({
...@@ -26,9 +27,8 @@ Component({ ...@@ -26,9 +27,8 @@ Component({
emojiList: speechEmoji, emojiList: speechEmoji,
level: 3, level: 3,
star: 3, star: 3,
content: '您的平均语速在150字/分钟,非常棒!这样能让听众更好的理解和接收你所传达的信息。',
speedList: ['您的语速极快,几乎听不出单词之间的停顿,可能会导致听众难以理解,尤其是在不熟悉的话题或复杂的讨论中。', '您的语速极慢,每个词之间有明显的停顿,通常用于强调某些信息或确保听众能够完全理解。', '您的语速较快,词汇之间的间隔较短,可能需要听众集中注意力才能跟上,但仍然可以保持清晰度。', '您的语速较慢,适合于清晰的沟通和教学,给听众足够的时间来消化和理解信息。', '您的语速适中,既不过快也不过慢,是大多数日常对话和正式演讲的理想速度,便于听众跟随和理解。'],
lineData: [], lineData: [],
speechList,
areaOptions: {} areaOptions: {}
}, },
...@@ -75,9 +75,18 @@ Component({ ...@@ -75,9 +75,18 @@ Component({
positionY, positionY,
wordNum, wordNum,
star, star,
words,
content: toneList[star - 1] content: toneList[star - 1]
}) })
}, },
jumpChat() {
const {words,positionX,positionY} = this.data
wx.$router.go("/packageEquity/pages/aiCheck/redundance/redundance", {
words,
positionX,
positionY,
})
},
parseJson(n) { parseJson(n) {
console.log(n) console.log(n)
if (n.fluency) { if (n.fluency) {
......
<!--packageEquity/pages/aiCheck/result/components/fluent/fluent.wxml--> <!--packageEquity/pages/aiCheck/result/components/fluent/fluent.wxml-->
<view class="report-panel"> <view class="report-panel">
<view class="report-title">语速</view> <view class="report-title">语速</view>
<emoji emojiList="{{emojiList}}" level="{{level}}"></emoji> <emoji emojiList="{{emojiList}}" level="{{detailInfo.star}}"></emoji>
<view class="report-content">{{content}}</view> <view class="report-content">{{speechList[detailInfo.star - 1]}}</view>
<line-chat title="语速变化曲线" lineData="{{lineData}}" areaOptions="{{areaOptions}}" ></line-chat> <line-chat title="语速变化曲线" lineData="{{lineData}}" areaOptions="{{areaOptions}}" ></line-chat>
</view> </view>
<view class="report-panel"> <view class="report-panel">
......
<!--packageEquity/pages/aiCheck/result/components/skilled/skilled.wxml--> <!--packageEquity/pages/aiCheck/result/components/skilled/skilled.wxml-->
<view class="report-panel"> <view class="report-panel">
<view class="report-title">熟练度</view> <view class="report-title">熟练度</view>
<emoji emojiList="{{emojiList}}" level="{{level}}"></emoji> <emoji emojiList="{{emojiList}}" level="{{detailInfo.star}}"></emoji>
</view> </view>
<view class="report-panel other-bg"> <view class="report-panel other-bg">
<view class="report-title">质检得分</view> <view class="report-title">质检得分</view>
<view class="scoce-box"><text>80</text>/100</view> <view class="scoce-box"><text>{{detailInfo.inspectionConversationCheck.score}}</text>/100</view>
<view class="start-box"> <view class="start-box">
<block wx:for="{{5}}" wx:key="index"> <block wx:for="{{5}}" wx:key="index">
<view class="star {{star>index?'star_1':'star_0'}}"></view> <view class="star {{detailInfo.star>index?'star_1':'star_0'}}"></view>
</block> </block>
</view> </view>
<view class="report-content">上党课海口市都是对的</view> <view class="report-content">上党课海口市都是对的</view>
......
...@@ -29,7 +29,7 @@ Page({ ...@@ -29,7 +29,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.$router.getData(reportItem =>{ wx.$router.getData(({reportItem,currentItem}) =>{
this.setTitle(0); this.setTitle(0);
const { const {
markList markList
......
...@@ -5,18 +5,29 @@ Page({ ...@@ -5,18 +5,29 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
words: [{ },
text: '额', back() {
num: 20 wx.navigateBack()
}, { },
text: '啊', onLoad() {
num: 20 wx.$router.getData(val =>{
}, { const {words,positionX,positionY} = val
text: '呵', // 构建一个正则表达式,匹配数组word中每个元素的叠词模式
num: 20 const regex = new RegExp(`(${positionX.join("|")})\\1+`, "g");
}],
selectWord: '额', // 使用 replace 方法移除叠词中的第一个
content: '我明白前能购买的愉快的经历,那我们现在这额产品做了对应的改进。您试下。我们的产品不仅包括了对应的啊产品创新,然后还新的智算法。我们有专业的售团队来解决啊,出了问题会第时间上门维,可以放心的啊。到我们有对应的客户群,您可以加入看其他客户的体验,啊然后我们现在的那个用户好评啊是99%以上。好,那呵们建议额比三家,我看之后可以随时欢迎继续到店来进行购买的,啊如果有任何需要可以和我联系。好,那没问题,您可以随时联系我。唉那您考呵清楚以后随时我,谢谢。' const content = words.replace(regex, (match, p1) =>
p1.repeat(match.length - 1)
);
this.setData({
content,
selectWord:positionX[0],
positionX,
positionY
},()=>{
this.setBold()
})
})
}, },
handleWord(e) { handleWord(e) {
const { const {
...@@ -41,12 +52,6 @@ Page({ ...@@ -41,12 +52,6 @@ Page({
); );
this.setData({content}) this.setData({content})
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
</navigation-bar> </navigation-bar>
<view class="box"> <view class="box">
<view class="word-box"> <view class="word-box">
<view class="word-item {{selectWord==item.text?'checked':''}}" data-word="{{item.text}}" bindtap="handleWord" wx:for="{{words}}"> <view class="word-item {{selectWord==item?'checked':''}}" data-word="{{item}}" bindtap="handleWord" wx:for="{{positionX}}">
{{item.text}} {{item}}
{{item.num}} {{positionY[index]}}
</view> </view>
</view> </view>
<view class="content-box"> <view class="content-box">
......
...@@ -173,14 +173,11 @@ page { ...@@ -173,14 +173,11 @@ page {
} }
} }
.canvas {
width: 750rpx;
height: 750rpx;
}
.canvas2 { .canvas {
width: 100%; width: 610rpx;
height: 448rpx; height: 448rpx;
margin: 0 auto;
} }
.star { .star {
...@@ -192,54 +189,101 @@ page { ...@@ -192,54 +189,101 @@ page {
position: relative; position: relative;
margin-top: 24rpx; margin-top: 24rpx;
.title {
font-size: 24rpx;
color: #333333;
}
.score-bg { .score-bg {
width: 100%; width: 432rpx;
height: 468rpx; height: 432rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 50%;
transform: translateX(-50%);
}
.categories {
.title {
font-size: 24rpx;
color: #333333;
display: flex;
align-items: center;
&::after {
content: '';
border-right: 2rpx solid #3275FA;
border-bottom: 2rpx solid #3275FA;
width: 10rpx;
height: 10rpx;
display: block;
margin-left: 4rpx;
transform: rotate(-45deg);
}
}
} }
.categories-1 { .categories-1 {
position: absolute; position: absolute;
top: 0; top: -12rpx;
left: 51%; left: 51%;
transform: translateX(-50%); transform: translateX(-50%);
.title {}
} }
.categories-2 { .categories-2 {
position: absolute; position: absolute;
top: 164rpx; top: 140rpx;
right: 3.9%; left: 562rpx;
transform: translateX(-50%);
} }
.categories-3 { .categories-3 {
position: absolute; position: absolute;
bottom: 44rpx; top: 370rpx;
right: 12.4%; left: 458rpx;
transform: translateX(-50%);
} }
.categories-4 { .categories-4 {
position: absolute; position: absolute;
bottom: 44rpx; top: 370rpx;
left: 22.4%; left: 164rpx;
} }
.categories-5 { .categories-5 {
position: absolute; position: absolute;
top: 164rpx; top: 140rpx;
left: 14.9%; left: 70rpx;
}
}
.type-4{
.canvas{
transform: rotate(-45deg);
}
.categories-1{
left: 96rpx;
transform: translateX(0);
top: 8rpx;
}
.categories-2{
left: 526rpx;
top: 8rpx;
}
.categories-3{
left: 526rpx;
top: 370rpx;
}
.categories-4{
left: 96rpx;
top: 370rpx;
}
}
.type-3{
.canvas{
transform: translateY(10%);
}
.categories-2{
left: 542rpx;
top: 390rpx;
}
.categories-3{
left: 80rpx;
top: 390rpx;
} }
} }
.report-box { .report-box {
margin: 32rpx; margin: 32rpx;
background: #FFFFFF; background: #FFFFFF;
...@@ -357,6 +401,7 @@ page { ...@@ -357,6 +401,7 @@ page {
font-weight: 500; font-weight: 500;
} }
} }
.center { .center {
width: 144rpx; width: 144rpx;
height: 144rpx; height: 144rpx;
......
...@@ -11,47 +11,25 @@ ...@@ -11,47 +11,25 @@
</navigation-bar> </navigation-bar>
<view class="wrapper" style="margin-top: {{navBarHeight}}px;height: calc(100vh - {{navBarHeight}}px - {{footerHeight}}px);" wx:if="{{tabId == 1}}"> <view class="wrapper" style="margin-top: {{navBarHeight}}px;height: calc(100vh - {{navBarHeight}}px - {{footerHeight}}px);" wx:if="{{tabId == 1}}">
<block wx:if="{{duration}}"> <block wx:if="{{duration}}">
<view class="canvas-box"> <view class="canvas-box type-{{reportItem.length}}">
<gl-image class="score-bg" src="/aiCheck/score-bg1.png"></gl-image> <gl-image class="score-bg" src="/aiCheck/radar-bg-{{reportItem.length}}.png"></gl-image>
<!-- <canvas disable-scroll="{{true}}" id="radarCanvas" type="2d" class="canvas canvas2" /> --> <!-- <canvas disable-scroll="{{true}}" id="radarCanvas" type="2d" class="canvas canvas2" /> -->
<canvas canvas-id="radarCanvas" disable-scroll="{{true}}" class="canvas canvas2"></canvas> <canvas canvas-id="radarCanvas" disable-scroll="{{true}}" class="canvas"></canvas>
<view class="categories-1"> <block wx:for="{{reportItem}}" wx:key="index">
<view class="title">销售技巧</view> <view class="categories categories-{{index + 1}}" bindtap="jump" data-item="{{item}}">
<block wx:for="{{star}}" wx:key="index"> <view class="title">{{item.reportItem}}</view>
<gl-image class="star" src="/aiCheck/star-{{item}}.png"></gl-image> <block wx:for="{{item.starList}}" wx:key="i" wx:for-item="i">
<gl-image class="star" src="/aiCheck/star-{{i}}.png"></gl-image>
</block> </block>
</view> </view>
<view class="categories-2">
<view class="title">流利度</view>
<block wx:for="{{star1}}" wx:key="index">
<gl-image class="star" src="/aiCheck/star-{{item}}.png"></gl-image>
</block> </block>
</view> </view>
<view class="categories-3">
<view class="title">语言表达</view>
<block wx:for="{{star2}}" wx:key="index">
<gl-image class="star" src="/aiCheck/star-{{item}}.png"></gl-image>
</block>
</view>
<view class="categories-4">
<view class="title">知识专业度</view>
<block wx:for="{{star3}}" wx:key="index">
<gl-image class="star" src="/aiCheck/star-{{item}}.png"></gl-image>
</block>
</view>
<view class="categories-5">
<view class="title">服务态度</view>
<block wx:for="{{star4}}" wx:key="index">
<gl-image class="star" src="/aiCheck/star-{{item}}.png"></gl-image>
</block>
</view>
</view>
<view class="report-box"> <view class="report-box">
<view class="score-box"> <view class="score-box">
<view class="score-item"> <view class="score-item">
<view>总得分</view> <view>总得分</view>
<view class="score"> <view class="score">
<view class="score-num">{{detailInfo.score || 0}}</view> <view class="score-num">{{score || 0}}</view>
/100 /100
</view> </view>
<text class="score-tips">90%的使用者在\n75-85之间</text> <text class="score-tips">90%的使用者在\n75-85之间</text>
...@@ -59,9 +37,9 @@ ...@@ -59,9 +37,9 @@
<view class="score-item"> <view class="score-item">
<view>练习时长</view> <view>练习时长</view>
<view class="score"> <view class="score">
<view class="score-num">2</view> <view class="score-num">{{minutes}}</view>
分 分
<view class="score-num">35</view> <view class="score-num">{{seconds}}</view>
秒 秒
</view> </view>
<text class="score-tips">80%的使用者在\n1分30秒-3分10秒之间</text> <text class="score-tips">80%的使用者在\n1分30秒-3分10秒之间</text>
......
...@@ -12,6 +12,7 @@ Page({ ...@@ -12,6 +12,7 @@ Page({
navBarHeight: 0, navBarHeight: 0,
text: '好胜心强,容易固执已见,建议多以<span class="blue">肯定、迎合</span>的话进行对练!', text: '好胜心强,容易固执已见,建议多以<span class="blue">肯定、迎合</span>的话进行对练!',
step: 'reception', step: 'reception',
stepName:'接待',
linkChainList: [ linkChainList: [
{ {
id: 1, id: 1,
...@@ -37,16 +38,34 @@ Page({ ...@@ -37,16 +38,34 @@ Page({
iconUrl: 'icon-dear', iconUrl: 'icon-dear',
type: 'referral' type: 'referral'
} }
] ],
key: Date.now()
},
// 设置音频
setAudio() {
this.aiAudio = wx.createInnerAudioContext({
useWebAudioImplement: true
})
// console.log(this.aiAudio)
}, },
selectCustomerType(e) { selectCustomerType(e) {
this.setData({ this.setData({
selectedIndex: e.currentTarget.dataset.index selectedIndex: e.currentTarget.dataset.index
}) })
console.log(e.currentTarget.dataset.index, this.data.customeTypeList)
this.aiAudio.src = this.data.customeTypeList[e.currentTarget.dataset.index].roleVoice
const {
paused
} = this.aiAudio
console.log(paused)
this.aiAudio.play()
this.setData({key: Date.now()})
}, },
selectStepType(e) { selectStepType(e) {
const {name,type} = e.currentTarget.dataset
this.setData({ this.setData({
step: e.currentTarget.dataset.type step:type,
stepName:name
}) })
}, },
// 头部返回上一级 // 头部返回上一级
...@@ -58,11 +77,10 @@ Page({ ...@@ -58,11 +77,10 @@ Page({
this.setData({show:!this.data.show}) this.setData({show:!this.data.show})
}, },
jump() { jump() {
const {selectedIndex,customeTypeList} = this.data const {selectedIndex,customeTypeList,stepName} = this.data
const {avatar,roleName,roleType,attackScript,roleDetail,languageStyle} = customeTypeList[selectedIndex] const {roleType} = customeTypeList[selectedIndex]
const sex = /性别:男/.test(roleDetail)?1:0
wx.navigateTo({ wx.navigateTo({
url: `/packageEquity/pages/aiCheck/chat/chat?avatar=${avatar}&sex=${sex}&roleName=${roleName}&roleType=${roleType}&attackScript=${attackScript}&person_type=${languageStyle}` url: `/packageEquity/pages/aiCheck/chat/chat?roleType=${roleType}&stage=${stepName}`
}) })
this.setData({show:false}) this.setData({show:false})
}, },
...@@ -88,7 +106,8 @@ Page({ ...@@ -88,7 +106,8 @@ Page({
if(item.roleName.includes('客户')) if(item.roleName.includes('客户'))
item.roleName = item.roleName.slice(0,-2) item.roleName = item.roleName.slice(0,-2)
}) })
this.setData({customeTypeList}) this.setData({ customeTypeList })
this.setAudio()
}) })
}, },
......
...@@ -472,7 +472,64 @@ page { ...@@ -472,7 +472,64 @@ page {
} }
} }
} }
.qr-box {
width: 212rpx;
height: 272rpx;
max-height: 272rpx;
max-width: 212rpx;
position: relative;
left: 50%;
top: 40rpx;
transform: translateX(-50%);
overflow: hidden;
// border: 0.1rem solid rgba(228, 12, 52, 0.2);
.line {
height: 100%;
width: 100%;
background: linear-gradient(180deg, rgba(0, 255, 51, 0) 43%, #3899FF 211%);
border-bottom: 3rpx solid #3899FF;
transform: translateY(-100%);
animation: radar-beam 2s infinite;
animation-timing-function: cubic-bezier(0.53, 0, 0.43, 0.99);
animation-delay: 1.4s;
}
}
.qr-box:after,
.qr-box:before,
.angle:after,
.angle:before {
content: '';
display: block;
position: absolute;
width: 12rpx;
height: 18rpx;
border: 0.2rem solid transparent;
}
.qr-box:after,
.qr-box:before {
top: 0;
border-top-color: #3899FF;
}
.angle:after,
.angle:before {
bottom: 0;
border-bottom-color: #3899FF;
}
.qr-box:before,
.angle:before {
left: 0;
border-left-color: #3899FF;
}
.qr-box:after,
.angle:after {
right: 0;
border-right-color: #3899FF;
}
} }
} }
...@@ -514,3 +571,14 @@ page { ...@@ -514,3 +571,14 @@ page {
} }
} }
} }
@keyframes radar-beam {
0% {
transform: translateY(-100%);
}
100% {
transform: translateY(0);
}
}
\ No newline at end of file \ No newline at end of file
...@@ -79,9 +79,18 @@ ...@@ -79,9 +79,18 @@
<gl-image class="icon" src="/aiCheck/setting/icon-character.webp" webp></gl-image> <gl-image class="icon" src="/aiCheck/setting/icon-character.webp" webp></gl-image>
<view class="label-title">性格</view> <view class="label-title">性格</view>
</view> </view>
<view class="chat-box">以自我为中心,决策迅速</view> <view class="chat-box">{{customeTypeList[selectedIndex].personalityTraits}}</view>
</view>
<image
src="{{customeTypeList[selectedIndex].detailImage}}"
webp
class="custom-img"
/>
<!-- 扫描 -->
<view class="qr-box">
<view class="line"></view>
<view class="angle"></view>
</view> </view>
<gl-image class="custom-img" src="/aiCheck/setting/custom-1.webp" webp></gl-image>
<view class="chat-item tag-box"> <view class="chat-item tag-box">
<view class="chat-label"> <view class="chat-label">
<gl-image class="icon" src="/aiCheck/setting/icon-tag.webp" webp></gl-image> <gl-image class="icon" src="/aiCheck/setting/icon-tag.webp" webp></gl-image>
...@@ -89,7 +98,7 @@ ...@@ -89,7 +98,7 @@
</view> </view>
<view class="chat-right"> <view class="chat-right">
<gl-image class="chat-bg" src="/aiCheck/setting/chat-box.webp" webp></gl-image> <gl-image class="chat-bg" src="/aiCheck/setting/chat-box.webp" webp></gl-image>
<view class="chat-text">基础质保就够了,没必要升级了</view> <view class="chat-text">{{customeTypeList[selectedIndex].petPhrase}}</view>
</view> </view>
</view> </view>
<view class="chat-item suggest-box"> <view class="chat-item suggest-box">
...@@ -97,7 +106,7 @@ ...@@ -97,7 +106,7 @@
<gl-image class="icon" src="/aiCheck/setting/icon-suggest.webp" webp></gl-image> <gl-image class="icon" src="/aiCheck/setting/icon-suggest.webp" webp></gl-image>
<view class="label-title">建议</view> <view class="label-title">建议</view>
</view> </view>
<rich-text class="chat-box" nodes="{{text}}"></rich-text> <rich-text class="chat-box" nodes="{{customeTypeList[selectedIndex].sparringSuggest}}"></rich-text>
</view> </view>
</view> </view>
<view class="title"> <view class="title">
...@@ -107,7 +116,7 @@ ...@@ -107,7 +116,7 @@
<view class="desciption">在延保四大环节中选择其一进行模拟对练,快速提升专项销售技能</view> <view class="desciption">在延保四大环节中选择其一进行模拟对练,快速提升专项销售技能</view>
<view class="link-box"> <view class="link-box">
<block wx:for="{{linkChainList}}" wx:key="{{item.id}}"> <block wx:for="{{linkChainList}}" wx:key="{{item.id}}">
<view class="link-item {{item.type == step ? 'selected' : ''}}" bindtap="selectStepType" data-type="{{item.type}}"> <view class="link-item {{item.type == step ? 'selected' : ''}}" data-name="{{item.name}}" bindtap="selectStepType" data-type="{{item.type}}">
<gl-image webp src="/aiCheck/setting/icon-reception.webp" class="icon"></gl-image> <gl-image webp src="/aiCheck/setting/icon-reception.webp" class="icon"></gl-image>
<view class="link-text">{{item.name}}</view> <view class="link-text">{{item.name}}</view>
</view> </view>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* @LastEditTime: 2024-07-16 11:37:49 * @LastEditTime: 2024-07-16 11:37:49
*/ */
// packageEquity/pages/aiCheck/start/components/introduction.js // packageEquity/pages/aiCheck/start/components/introduction.js
import aiApi from "../../../../../aiApi"
Component({ Component({
/** /**
...@@ -57,18 +58,10 @@ Component({ ...@@ -57,18 +58,10 @@ Component({
}, },
toExperience:wx.$util.throttle(function(e) { toExperience:wx.$util.throttle(function(e) {
console.log(11, e) console.log(11, e)
const {id, available} = e.currentTarget.dataset const {id, available} = e.currentTarget.dataset
if (available) { if (available) {
// 调用接口 // 调用接口
// this.setData({ this.setSparringVerify(id)
// isVisible: true
// })
// console.log(this.isVisible)
// return
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/scene/scene?id=${id}`
})
} else { } else {
wx.showToast({ wx.showToast({
title: '更多功能正在开发中...', title: '更多功能正在开发中...',
...@@ -76,6 +69,23 @@ Component({ ...@@ -76,6 +69,23 @@ Component({
duration: 2000 duration: 2000
}) })
} }
},1000) },1000),
async setSparringVerify(id) {
const {
merchantId,
uuid
} = wx.$util.getUserInfo()
const res = await aiApi.setSparringVerify({
staffUuid: uuid,
yqMerchantId: merchantId
})
this.setData({isVisible: !res.data.sparringAllow})
if (res.data.sparringAllow) {
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/scene/scene?id=${id}`
})
}
},
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Hi~ 欢迎来到AI趣练 Hi~ 欢迎来到AI趣练
</view> </view>
<view class="description-text"> <view class="description-text">
基于AI模拟对练,助你成为营销大师 基于AI模拟对练,助你成为营销大师{{isVisible}}
</view> </view>
</view> </view>
<!-- 介绍列表 --> <!-- 介绍列表 -->
......
...@@ -23,7 +23,7 @@ Page({ ...@@ -23,7 +23,7 @@ Page({
icon_check: '/aiCheck/icon-record-b.png', icon_check: '/aiCheck/icon-record-b.png',
type:2, type:2,
}], }],
tabIndex: 2, tabIndex: 1,
navBarHeight: 0, navBarHeight: 0,
footerHeight: 0 footerHeight: 0
}, },
......
...@@ -25,7 +25,7 @@ Component({ ...@@ -25,7 +25,7 @@ Component({
this.findConversationDetailByBatchId(data) this.findConversationDetailByBatchId(data)
this.findCbByBatchId(data) this.findCbByBatchId(data)
}, },
detached(){ detached() {
this.IntersectionObserver?.disconnect() this.IntersectionObserver?.disconnect()
} }
...@@ -49,8 +49,10 @@ Component({ ...@@ -49,8 +49,10 @@ Component({
mergedOffset mergedOffset
} = this.setProgress(), } = this.setProgress(),
item = dialogueList.find(e => e.mergedOffset == mergedOffset) item = dialogueList.find(e => e.mergedOffset == mergedOffset)
this.setData({
if (this.isScrollling) return isPlayIng: true
})
if (this.data.isScrollling) return
if (item && item.id) this.setTopId(item, true) if (item && item.id) this.setTopId(item, true)
}, },
setTopId(item, scroll = false) { setTopId(item, scroll = false) {
...@@ -63,7 +65,6 @@ Component({ ...@@ -63,7 +65,6 @@ Component({
wx.nextTick(() => this.setData({ wx.nextTick(() => this.setData({
activeId: item.text_id activeId: item.text_id
})) }))
console.log(dialogueList,centerIndex)
if (scroll) this.setData({ if (scroll) this.setData({
toId: dialogueList[centerIndex].text_id toId: dialogueList[centerIndex].text_id
}) })
...@@ -89,7 +90,9 @@ Component({ ...@@ -89,7 +90,9 @@ Component({
this.setData({ this.setData({
toId: item.text_id toId: item.text_id
}) })
this.isScrollling = true this.setData({
isScrollling:true
})
this.touchend() this.touchend()
}, },
seekPlay(e) { seekPlay(e) {
...@@ -331,12 +334,16 @@ Component({ ...@@ -331,12 +334,16 @@ Component({
}) })
}, },
touchstart() { touchstart() {
this.isScrollling = true this.setData({
isScrollling: true
})
this.clearTimer() this.clearTimer()
}, },
touchend() { touchend() {
this.touchTimer = setTimeout(() => { this.touchTimer = setTimeout(() => {
this.isScrollling = false this.setData({
isScrollling: false
})
this.clearTimer() this.clearTimer()
}, 3e3) }, 3e3)
}, },
...@@ -372,5 +379,15 @@ Component({ ...@@ -372,5 +379,15 @@ Component({
[`dialogueList[${index}].appealClass`]: 'appeal-disabled' [`dialogueList[${index}].appealClass`]: 'appeal-disabled'
}) })
}, },
onPause() {
this.setData({
isPlayIng: false
})
},
practiceHandle(e){
const {stage} = e.currentTarget.dataset
let thisPage = wx.$router.getPageInstance()
thisPage.practiceHandle(stage)
}
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -81,16 +81,19 @@ ...@@ -81,16 +81,19 @@
margin-left: var(--fontSize46); margin-left: var(--fontSize46);
width: var(--fontSize96); width: var(--fontSize96);
height: var(--fontSize48); height: var(--fontSize48);
background: #F24724;
border-radius: var(--fontSize26); border-radius: var(--fontSize26);
color: #fff; color: #F56C50;
text-align: center; text-align: center;
line-height: var(--fontSize48); line-height: var(--fontSize44);
font-size: var(--fontSize24); font-size: var(--fontSize24);
box-sizing: border-box;
border: 2rpx solid #F56C50;
} }
.appeal-disabled { .appeal-disabled {
border-color: #D0D2D6;
background: #D0D2D6; background: #D0D2D6;
color: #fff;
} }
} }
...@@ -456,6 +459,9 @@ ...@@ -456,6 +459,9 @@
height: 20rpx; height: 20rpx;
} }
} }
.radius{
border-radius:100%;
}
} }
.defence-item { .defence-item {
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</view> </view>
</block> </block>
<view class="ai-btn">快速练习</view> <view class="ai-btn" data-satge="{{item.conversationCheckDetailDTO.firstClassify}}" bindtap="practiceHandle">快速练习</view>
</view> </view>
</view> </view>
</block> </block>
...@@ -107,10 +107,12 @@ ...@@ -107,10 +107,12 @@
<block wx:for="{{axisList}}" wx:key="index"> <block wx:for="{{axisList}}" wx:key="index">
<block wx:if="{{item.inspectionConversationDetailId}}"> <block wx:if="{{item.inspectionConversationDetailId}}">
<view class="axis-item {{activeId == item.text_id?'axis-active':''}} {{item.colorName}}" style="top:{{item.top + 'px'}};"> <view class="axis-item {{activeId == item.text_id?'axis-active':''}} {{item.colorName}}" style="top:{{item.top + 'px'}};">
<view class="axis-dot"></view> <view class="axis-dot {{!isPlayIng && !isScrollling?'':'radius'}}" bindtap="seekPlay" data-item="{{item}}" data-scroll></view>
<block wx:if="{{!isPlayIng && !isScrollling}}">
<view class="axis-text" bindtap="seekPlay" data-item="{{item}}" data-scroll> <view class="axis-text" bindtap="seekPlay" data-item="{{item}}" data-scroll>
{{item.secondClassify}}+{{item.score}} {{item.secondClassify}}+{{item.score}}
</view> </view>
</block>
</view> </view>
</block> </block>
</block> </block>
......
...@@ -148,7 +148,7 @@ Component({ ...@@ -148,7 +148,7 @@ Component({
seconds = seconds < 10 ? `0${seconds}` : seconds seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}` return `${minutes}:${seconds}`
}, },
practiceHandle() { practiceHandle(e) {
const {stage} = e.currentTarget.dataset const {stage} = e.currentTarget.dataset
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
thisPage.practiceHandle(stage) thisPage.practiceHandle(stage)
......
...@@ -31,6 +31,10 @@ Page({ ...@@ -31,6 +31,10 @@ Page({
}, },
//音频暂停 //音频暂停
onPause() { onPause() {
const {
activeIndex
} = this.data
if (activeIndex == 0) this.dialogueRef().onPause()
this.qualityAudio.pause() this.qualityAudio.pause()
}, },
//播放 //播放
......
...@@ -69,8 +69,8 @@ const domain_items = { ...@@ -69,8 +69,8 @@ const domain_items = {
scrm: "https://scrm.dev.glsx.com.cn", scrm: "https://scrm.dev.glsx.com.cn",
}, },
dev: { dev: {
dj: "https://dj.dev.glsx.com.cn", // dj: "https://dj.dev.glsx.com.cn", 9585
// dj: 'http://192.168.3.226:9585', dj: 'http://192.168.3.226:9711',
scrm: "https://scrm.dev.glsx.com.cn", scrm: "https://scrm.dev.glsx.com.cn",
merchants: "http://rop-merchant.dev.glsx.com.cn", merchants: "http://rop-merchant.dev.glsx.com.cn",
AI: 'http://192.168.3.191:7864', AI: 'http://192.168.3.191:7864',
......
...@@ -722,7 +722,7 @@ function calYAxisData(series, opts, config) { ...@@ -722,7 +722,7 @@ function calYAxisData(series, opts, config) {
function drawPointShape(points, color, shape, context) { function drawPointShape(points, color, shape, context) {
context.beginPath(); context.beginPath();
context.setStrokeStyle("#ffffff"); // context.setStrokeStyle("#ffffff");
// context.setLineWidth(1); // context.setLineWidth(1);
context.setFillStyle(color); context.setFillStyle(color);
...@@ -740,7 +740,7 @@ function drawPointShape(points, color, shape, context) { ...@@ -740,7 +740,7 @@ function drawPointShape(points, color, shape, context) {
points.forEach(function (item, index) { points.forEach(function (item, index) {
if (item !== null) { if (item !== null) {
context.moveTo(item.x + 3.5, item.y); context.moveTo(item.x + 3.5, item.y);
context.arc(item.x, item.y, 4, 0, 2 * Math.PI, false); context.arc(item.x, item.y, 2, 0, 2 * Math.PI, false);
} }
}); });
} else if (shape === 'rect') { } else if (shape === 'rect') {
...@@ -1631,7 +1631,7 @@ function drawRadarDataPoints(series, opts, config, context) { ...@@ -1631,7 +1631,7 @@ function drawRadarDataPoints(series, opts, config, context) {
// 绘制区域数据 // 绘制区域数据
context.beginPath(); context.beginPath();
context.setFillStyle(eachSeries.color); context.setFillStyle(eachSeries.color);
context.setGlobalAlpha(0.6); context.setGlobalAlpha(series[0].alpha || 0.6);
eachSeries.data.forEach(function (item, index) { eachSeries.data.forEach(function (item, index) {
if (index === 0) { if (index === 0) {
context.moveTo(item.position.x, item.position.y); context.moveTo(item.position.x, item.position.y);
...@@ -1642,13 +1642,27 @@ function drawRadarDataPoints(series, opts, config, context) { ...@@ -1642,13 +1642,27 @@ function drawRadarDataPoints(series, opts, config, context) {
context.closePath(); context.closePath();
context.fill(); context.fill();
context.setGlobalAlpha(1); context.setGlobalAlpha(1);
if(config.drawLine){
context.beginPath();
context.setLineWidth(2)
context.setStrokeStyle(series[0].lineColor)
eachSeries.data.forEach(function (item, index) {
if (index === 0) {
context.moveTo(item.position.x, item.position.y);
} else {
context.lineTo(item.position.x, item.position.y);
}
});
context.closePath();
context.stroke()
}
if (opts.dataPointShape !== false) { if (opts.dataPointShape !== false) {
var shape = config.dataPointShape[seriesIndex % config.dataPointShape.length]; var shape = config.dataPointShape[seriesIndex % config.dataPointShape.length];
var points = eachSeries.data.map(function (item) { var points = eachSeries.data.map(function (item) {
return item.position; return item.position;
}); });
drawPointShape(points, eachSeries.color, shape, context); drawPointShape(points, (series[0].lineColor||eachSeries.color), shape, context);
} }
}); });
// draw label text // draw label text
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!