Commit d5f0d55b by 前端

Merge branch 'SAAS+V4.42' into 'master'

上线合并

See merge request !309
2 parents ec28e2ec c2a4404c
Showing 158 changed files with 3769 additions and 425 deletions
//app.js //app.js
// 初始化sentry // 初始化sentry
import sentryInit from '~/utils/sentryConfig/sentryInit' import sentryInit from '~/utils/sentryConfig/sentryInit'
sentryInit() const sentry = sentryInit()
wx.$sendSentry = function (e) {
sentry.captureException(e);
};
// 解决showLoading 和 showToast显示异常的问题 // 解决showLoading 和 showToast显示异常的问题
import fixWxShowToast from './utils/lib/fixWxShowToast' import fixWxShowToast from './utils/lib/fixWxShowToast'
fixWxShowToast() fixWxShowToast()
......
...@@ -144,7 +144,11 @@ ...@@ -144,7 +144,11 @@
"pages/aiCheck/start/start", "pages/aiCheck/start/start",
"pages/orderList/orderList", "pages/orderList/orderList",
"pages/equityQualityOrderList/equityQualityOrderList", "pages/equityQualityOrderList/equityQualityOrderList",
"pages/createDeafeatOrderBefore/createDeafeatOrderBefore" "pages/createDeafeatOrderBefore/createDeafeatOrderBefore",
"pages/receptionRecords/receptionRecords",
"pages/aiCheck/redundance/redundance",
"pages/aiCheck/detail/detail",
"pages/receptionDetail/receptionDetail"
] ]
}, },
{ {
...@@ -211,11 +215,15 @@ ...@@ -211,11 +215,15 @@
"preloadRule": { "preloadRule": {
"pages/tabWorkOrder/pages/index/index": { "pages/tabWorkOrder/pages/index/index": {
"network": "all", "network": "all",
"packages": ["tabWorkOrder"] "packages": [
"tabWorkOrder"
]
}, },
"tabIndex/pages/index/index": { "tabIndex/pages/index/index": {
"network": "all", "network": "all",
"packages": ["tabWorkOrder"] "packages": [
"tabWorkOrder"
]
} }
}, },
"resolveAlias": { "resolveAlias": {
...@@ -229,4 +237,4 @@ ...@@ -229,4 +237,4 @@
}, },
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"resizable": true "resizable": true
} }
\ No newline at end of file \ No newline at end of file
...@@ -203,7 +203,7 @@ class Calendar { ...@@ -203,7 +203,7 @@ class Calendar {
range(e) { range(e) {
const _this = this[_CalendarObject_] const _this = this[_CalendarObject_]
let { index, data, ind } = e.currentTarget.dataset let { index, data, ind } = e.currentTarget.dataset
let { allowSameDay, showConfirm, monthList, rangeDate } = _this.data let { allowSameDay, showConfirm, monthList, rangeDate, maxDayRange, maxDayRangeType } = _this.data
const start = Date.parse(rangeDate.start) const start = Date.parse(rangeDate.start)
if (rangeDate.end || start > Date.parse(data)) { if (rangeDate.end || start > Date.parse(data)) {
monthList = this.clearStatus({ monthList = this.clearStatus({
...@@ -215,6 +215,18 @@ class Calendar { ...@@ -215,6 +215,18 @@ class Calendar {
rangeDate.end = '' rangeDate.end = ''
} else { } else {
if (!allowSameDay && Date.parse(data) == Date.parse(rangeDate.start)) return if (!allowSameDay && Date.parse(data) == Date.parse(rangeDate.start)) return
if (maxDayRangeType == 'day') {
if (Date.parse(data) > (Date.parse(rangeDate.start) + (maxDayRange - 1) * 24 * 60 * 60 * 1000)) return wx.showToast({title: `选择范围不能超过${maxDayRange}天`, icon: 'none'})
}
if (maxDayRangeType == 'month') {
let start = new Date(rangeDate.start)
let end = new Date(data)
let months = (end.getFullYear() - start.getFullYear()) * 12 + (end.getMonth() - start.getMonth())
if (start.getDate() > end.getDate()) {
months--
}
if (months >= maxDayRange) return wx.showToast({title: `选择范围不能超过${maxDayRange}个月`, icon: 'none'})
}
monthList[index].data[ind].active = true monthList[index].data[ind].active = true
monthList[index].data[ind].end = true monthList[index].data[ind].end = true
rangeDate.end = data rangeDate.end = data
......
...@@ -82,7 +82,9 @@ export default { ...@@ -82,7 +82,9 @@ export default {
maxDate: String, maxDate: String,
/**隐藏水印 */ /**隐藏水印 */
hideMark: Boolean, hideMark: Boolean,
isComponents: Boolean isComponents: Boolean,
maxDayRange: Number, // 最大可选范围长度
maxDayRangeType: String // 最大可选范围类型
// dataDateStr: { // dataDateStr: {
// type: String, // type: String,
// observer: function (n) { // observer: function (n) {
......
...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd"; ...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 2; let index = 4;
const accountInfo = wx.getAccountInfoSync(); const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync(); const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion; const envName = accountInfo.miniProgram.envVersion;
...@@ -36,7 +36,7 @@ if (systemInfo.platform != "devtools") { ...@@ -36,7 +36,7 @@ if (systemInfo.platform != "devtools") {
case "develop": case "develop":
break; break;
case "trial": case "trial":
index = manual ? index : 2; index = manual ? index : 4;
break; break;
case "release": case "release":
index = release ? index : 3; index = release ? index : 3;
...@@ -89,4 +89,25 @@ export const dsnUrl = ...@@ -89,4 +89,25 @@ export const dsnUrl =
// 图片基地址 // 图片基地址
export const ImgUrl = export const ImgUrl =
"https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat";
\ No newline at end of file \ No newline at end of file
"https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat";
export const ossConfig = {
// 请求域名 格式:https://xxx.xxx.com
HTTP_REQUEST_URL: "http://127.0.0.1:8000/api",
// 阿里云oss域名 格式:https://xxx.oss-cn-xxx.aliyuncs.com
OSS_DOMAIN: "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com",
// 文件直传到阿里云oss时需用到
ACCESSKEYID: "LTAI5tCRcCUgd7bt1J7JY596",
ACCESSKEYSECRET: "kJos9mgylkR5ztosnDt8Asrc3ulgqy",
BUKET_NAME: "glsk-oss",
FOLDER: "quality/",
// 与后端约定的token字段名
TOKEN_NAME: "glsk-oss",
};
export const bytedanceConfig = {
url: 'https://openspeech.bytedance.com/api/v1/tts'
}
\ No newline at end of file \ No newline at end of file
...@@ -7,7 +7,8 @@ export default { ...@@ -7,7 +7,8 @@ export default {
data, data,
[], [],
"/router/sparring/1.0.0", "/router/sparring/1.0.0",
"AI" "AI",
false
); );
}, },
//获取防守建议 //获取防守建议
...@@ -37,7 +38,8 @@ export default { ...@@ -37,7 +38,8 @@ export default {
data, data,
[], [],
"/router/enhancement/1.0.0", "/router/enhancement/1.0.0",
"AI" "AI",
false
); );
}, },
//根据提供的历史消息、用户ID、批次ID和持续时间,获取销售能力模拟评测的结果,并将结果数据存储数据库。 //根据提供的历史消息、用户ID、批次ID和持续时间,获取销售能力模拟评测的结果,并将结果数据存储数据库。
...@@ -50,6 +52,49 @@ export default { ...@@ -50,6 +52,49 @@ export default {
"AI" "AI"
); );
}, },
getVoiceConfig(data = {}) {
return api.post(
"",
data,
[],
"/router/get/voice/config/1.0.0",
"AI",
false
);
},
getSensitive(data = {}) {
return api.post(
"",
data,
[],
"/router/is/sensitive/1.0.0",
"AI",
false
);
},
//同义化话术
getPhrases(data = {}) {
return api.post(
"",
data,
[],
"/router/similar/phrases/1.0.0",
"AI",
false
);
},
//根据提供的历史消息、用户ID、批次ID和持续时间,获取销售能力模拟评测的结果,并将结果数据存储数据库。
getVoice(data = {}) {
return api.post(
"",
data,
[],
"/router/get/voice/to/text/1.0.0",
"AI",
false
);
},
/** /**
* 分页查询趣练详情 * 分页查询趣练详情
*/ */
...@@ -64,11 +109,11 @@ export default { ...@@ -64,11 +109,11 @@ export default {
*/ */
getSparringPage(data) { getSparringPage(data) {
return api.post( return api.post(
"dj.api.carboutique.fun.sparring.record.page", "dj.api.carboutique.ai.sparring.staff.record.page",
data,[],"/rop-dj-pairexc/router" data,[],"/rop-dj-pairexc/router"
); );
}, },
/** /**
* 保存员工趣练记录 * 保存员工趣练记录
*/ */
setSparringSave(data) { setSparringSave(data) {
...@@ -77,4 +122,41 @@ export default { ...@@ -77,4 +122,41 @@ export default {
data,[],"/rop-dj-pairexc/router" data,[],"/rop-dj-pairexc/router"
); );
}, },
/**
* 保存员工趣练记录
*/
getReportDetail(data) {
return api.post(
"dj.api.carboutique.ai.sparring.report.detail",
data,[],"/rop-dj-pairexc/router"
);
},
/**
* ai对练入口验证
*/
setSparringVerify(data) {
return api.post(
"dj.api.carboutique.ai.sparring.verify",
data,[],"/rop-dj-pairexc/router"
);
},
/**
* ai对练入口验证
*/
getReportDetail(data) {
return api.post(
"dj.api.carboutique.ai.sparring.report.detail",
data,[],"/rop-dj-pairexc/router"
);
},
/**
* 获取token
*/
getToken() {
return api.post(
"dj.api.smartcarlife.recepiton.customer.oss.getToken",
);
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -201,7 +201,7 @@ export default { ...@@ -201,7 +201,7 @@ export default {
* 获取客户角色 * 获取客户角色
*/ */
sparringRole(data) { sparringRole(data) {
return api.post("dj.api.carboutique.ai.sparring.role.info.page", data,[],"/rop-dj-car-boutique/router"); return api.post("dj.api.carboutique.ai.sparring.role.info.page", data,[],"/rop-dj-pairexc/router");
}, },
/** /**
* 对练次数 * 对练次数
...@@ -250,5 +250,19 @@ selectrecmerchantList(data) { ...@@ -250,5 +250,19 @@ selectrecmerchantList(data) {
...params ...params
}) })
}, },
/**查询质检结果 */
getReceptionResultData(data){
let params = data || {}
return api.post('dj.api.smartcarlife.recepiton.findConversationCheckDetailByBatchId', {
...params
})
},
/**攻防明细*/
getDefenceDetail(data){
let params = data || {}
return api.post('dj.api.smartcarlife.app.inspection.defence.detail', {
...params
})
}
}; };
...@@ -12,10 +12,34 @@ var isIncludesItem = function (list, item) { ...@@ -12,10 +12,34 @@ var isIncludesItem = function (list, item) {
return list.indexOf(item) != -1 return list.indexOf(item) != -1
} }
var filterMerchantName = function (list) {
return list.join(',')
}
var isShowEmpty = function (listData) {
var listDataLength = 0
for (var i = 0; i < listData.length; i++) {
var curr = listData[i]
listDataLength += curr.receptionStaticInfoDTOList ? curr.receptionStaticInfoDTOList.length : 0
}
return listDataLength > 0
}
// 分转元
var convertCentsToYuan = function (cents) {
var dollars = 0
dollars = Math.floor(cents / 100) // 金额过万时取整不保留小数
if (cents <= 999999) dollars = (cents / 100).toFixed(2)
return dollars
}
/* /*
* 导出 * 导出
*/ */
module.exports = { module.exports = {
replaceItemText: replaceItemText, replaceItemText: replaceItemText,
isIncludesItem: isIncludesItem isIncludesItem: isIncludesItem,
filterMerchantName: filterMerchantName,
isShowEmpty: isShowEmpty,
convertCentsToYuan: convertCentsToYuan
} }
...@@ -380,55 +380,6 @@ Page({ ...@@ -380,55 +380,6 @@ Page({
this.initList(); this.initList();
// this.checkDailyRecport() // this.checkDailyRecport()
}, },
checkTask() {
return new Promise((resolve) => {
const { merchantId } = wx.$util.getUserInfo();
const time = wx.getStorageSync("aiTime");
if (time == new Date().format("yyyy-MM-dd")) {
resolve();
return;
}
wx.setStorageSync("aiTime", new Date().format("yyyy-MM-dd"));
const params = {
currentPage: 1,
sparringStatus: 0,
tryCount: 2,
taskState: 2,
pageSize: 1,
yqMerchantId: merchantId,
};
carLifeApi
.getSparringPage(params)
.then((res) => {
const { list = [] } = res.data;
if (list.length) {
if (wx.__HAS_NOTLOGIN_MODAL) return false;
this.addModalToQueue(
"对练任务提醒",
"您有未完成的对练任务,点击前往完成",
"前往完成",
true,
3,
(res) => {
if (res.confirm) {
const {
task: { aiType, promptOnOff },
staff: { id, tryCount },
} = list[0];
wx.$router.go(
`packageEquity.list?staffid=${id}&tryCount=${tryCount}&roleType=${aiType}&promptOnOff=${promptOnOff}`
);
}
}
);
}
resolve();
})
.catch(() => {
resolve();
});
});
},
checkStaffOrderStatus() { checkStaffOrderStatus() {
return new Promise((resolve) => { return new Promise((resolve) => {
let userInfo = wx.$util.getUserInfo(); let userInfo = wx.$util.getUserInfo();
...@@ -519,7 +470,6 @@ Page({ ...@@ -519,7 +470,6 @@ Page({
this.checkDailyRecport(), this.checkDailyRecport(),
this.checkDeliveryTarget(), this.checkDeliveryTarget(),
this.getMerchant4SMode(), this.getMerchant4SMode(),
this.checkTask(),
this.checkStaffOrderStatus(), this.checkStaffOrderStatus(),
]).then(() => { ]).then(() => {
this.showNextModal(); this.showNextModal();
...@@ -601,7 +551,6 @@ Page({ ...@@ -601,7 +551,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// this.checkTask()
wx.$eventbus.on("switch_tab", () => { wx.$eventbus.on("switch_tab", () => {
let e = { let e = {
detail: 3, detail: 3,
...@@ -656,7 +605,21 @@ Page({ ...@@ -656,7 +605,21 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {}, onShareAppMessage() {},
closeScreen() { // closeScreen() {
this.selectComponent("#page-1").back(); // this.selectComponent("#page-1").back();
// },
// 筛选确认
searchScreen(obj) {
console.log(obj)
let { tabIndex } = this.data;
this.selectComponent(`#page-${tabIndex}`)?.searchScreen &&
this.selectComponent(`#page-${tabIndex}`).searchScreen(obj)
},
// 筛选页面返回
containerBack() {
let { tabIndex } = this.data;
this.selectComponent(`#page-${tabIndex}`)?.back &&
this.selectComponent(`#page-${tabIndex}`).back()
}, },
}); });
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
"order-no-popup":"../../components/OrderNoPopup/OrderNoPopup", "order-no-popup":"../../components/OrderNoPopup/OrderNoPopup",
"tab-mine": "/components/TabMine/TabMine", "tab-mine": "/components/TabMine/TabMine",
"home": "../index/index", "home": "../index/index",
"makert-material":"../trainingMaterials/components/Materials/materials" "makert-material":"../trainingMaterials/components/Materials/materials",
"reception-screen": "../index/components/receptionScreen/receptionScreen",
"order-screen": "../carQuotation/components/OrderScreen/OrderScreen"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }
<!-- pages/equity/index.wxml --> <!-- pages/equity/index.wxml -->
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy> <glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<block wx:if="{{showScreen}}"> <block wx:if="{{showScreen}}">
<navigation-bar showBack class="navigation-header" showWhiteMenu bindback="closeScreen" navStyle="background-color:#fff;box-shadow:none;">筛选</navigation-bar> <navigation-bar showBack class="navigation-header" showWhiteMenu bindback="containerBack" navStyle="background-color:#fff;box-shadow:none;">筛选</navigation-bar>
</block> </block>
<block wx:else> <block wx:else>
<navigation-bar class="navigation-header" showWhiteMenu bindnavbarReady="navbarReady" showMenu="{{ staffUuid&&tabIndex == 1?false:true }}" showBack="{{staffUuid&&tabIndex == 1?true:false}}" navStyle="{{'background-color: rgba(0,0,0,0);box-shadow:none;' }}" bindback="back" bindshowMenuPopup="showMenuPopup" > <navigation-bar class="navigation-header" showWhiteMenu bindnavbarReady="navbarReady" showMenu="{{ staffUuid&&tabIndex == 1?false:true }}" showBack="{{staffUuid&&tabIndex == 1?true:false}}" navStyle="{{'background-color: rgba(0,0,0,0);box-shadow:none;' }}" bindback="back" bindshowMenuPopup="showMenuPopup" >
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<block wx:if="{{ navBarHeight && showPage }}"> <block wx:if="{{ navBarHeight && showPage }}">
<!-- wx:if="{{ tabIndex == 0}}" wx:if="{{ tabIndex == 1}}" --> <!-- wx:if="{{ tabIndex == 0}}" wx:if="{{ tabIndex == 1}}" -->
<quotation-list id="page-1" navBarHeight="{{ navBarHeight }}" class="pagedetail {{ tabIndex == 1?'':'hide' }}" mode="{{ mode }}" staffUuid="{{staffUuid}}" /> <quotation-list id="page-1" navBarHeight="{{ navBarHeight }}" class="pagedetail {{ tabIndex == 1?'':'hide' }}" mode="{{ mode }}" staffUuid="{{staffUuid}}" />
<home id="page-0" class="pagedetail {{ tabIndex == 0?'':'hide' }}" waitInputCount="{{waitInputCount}}" mode="{{ mode }}"></home> <home id="page-0" class="pagedetail {{ tabIndex == 0?'':'hide' }}" navBarHeight="{{ navBarHeight }}" waitInputCount="{{waitInputCount}}" mode="{{ mode }}" showScreen="{{showScreen}}"></home>
<equity-list id="page-2" outTabIndex="{{ tabIndex }}" navBarHeight="{{ navBarHeight }}" class="pagedetail {{ tabIndex == 2?'':'hide' }}" /> <equity-list id="page-2" outTabIndex="{{ tabIndex }}" navBarHeight="{{ navBarHeight }}" class="pagedetail {{ tabIndex == 2?'':'hide' }}" />
<makert-material id="page-3" navBarHeight="{{ navBarHeight }}" class="pagedetail {{tabIndex == 3?'':'hide'}}"></makert-material> <makert-material id="page-3" navBarHeight="{{ navBarHeight }}" class="pagedetail {{tabIndex == 3?'':'hide'}}"></makert-material>
<tab-mine showCollege="{{ enableBusinessSchool }}" id="page-4" class="pagedetail {{ tabIndex == 4?'':'hide' }}" navBarHeight="{{ navBarHeight }}"></tab-mine> <tab-mine showCollege="{{ enableBusinessSchool }}" id="page-4" class="pagedetail {{ tabIndex == 4?'':'hide' }}" navBarHeight="{{ navBarHeight }}"></tab-mine>
...@@ -49,4 +49,12 @@ ...@@ -49,4 +49,12 @@
wx:if="{{ showOrderpop }}" wx:if="{{ showOrderpop }}"
flag="{{ showOrderpop }}" flag="{{ showOrderpop }}"
/> --> /> -->
<order-no-popup wx:if="{{ tipsProps }}" show="{{ tipsProps }}" title="请选择支付订单号" bind:success="navigator" orderNoList="{{ orderNoList }}" />
\ No newline at end of file \ No newline at end of file
<order-no-popup wx:if="{{ tipsProps }}" show="{{ tipsProps }}" title="请选择支付订单号" bind:success="navigator" orderNoList="{{ orderNoList }}" />
<page-container show="{{ show_order_confirm || show_reception_confirm }}" duration="{{ 0 }}" overlay="{{ false }}" bind:afterleave="containerBack">
<view wx:if="{{ showReceptionRendering }}">
<reception-screen show="{{ show_reception_confirm }}" userInfo="{{ userInfo }}" dateTime="{{dateTime}}" isFilterUpgrade="{{isFilterUpgrade}}" isFilterDefeat="{{isFilterDefeat}}" maxDayRange="{{7}}" maxDayRangeType="day" navBarHeight="{{ navBarHeight }}" bindconfirm="searchScreen" />
</view>
<view wx:if="{{ showOrderRendering }}">
<order-screen show="{{ show_order_confirm }}" userInfo="{{ userInfo }}" navBarHeight="{{ navBarHeight }}" status="{{ orderStatus }}" bindconfirm="searchScreen" />
</view>
</page-container>
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/chat/chat.wxss */ /* packageEquity/pages/aiCheck/chat/chat.wxss */
page { page {
background-color: #fafafa; background-color: #F7F8FA;
} }
.font-b { .font-b {
color:#3989FE; color: #3989FE;
}
.bg-box {
position: fixed;
inset: 0;
z-index: -1;
width: 750rpx;
height: 640rpx;
background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7F8FA 96%);
} }
.chat-bar .navigation-bar { .chat-bar .navigation-bar {
position: relative; position: relative;
box-shadow: none; box-shadow: none;
.end-btn { .end-btn {
position: absolute; position: absolute;
left: 32rpx; left: 32rpx;
bottom: 12rpx; bottom: 12rpx;
width: 164rpx; width: 164rpx;
height: 64rpx; height: 64rpx;
background-color: #fff; background-color: rgba(255, 255, 255, 0.6);
border-radius: 50rpx; border-radius: 50rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -33,21 +45,26 @@ page { ...@@ -33,21 +45,26 @@ page {
.chat-section { .chat-section {
margin-top: 28rpx; margin-top: 28rpx;
.chat-list { .chat-list {
height: calc(100vh - 400rpx); height: calc(100vh - 340rpx - env(safe-area-inset-bottom));
overflow:auto; overflow: auto;
// padding: 0rpx 32rpx; // padding: 0rpx 32rpx;
.chat-item { .chat-item {
margin-bottom:30rpx; margin-bottom: 30rpx;
padding: 0rpx 32rpx; padding: 0rpx 32rpx;
.chat-left { .chat-left {
display:flex; display: flex;
.avatar-icon { .avatar-icon {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
margin-right: 16rpx; margin-right: 16rpx;
border-radius: 50%; border-radius: 50%;
} }
.content-box { .content-box {
// margin-top: 12rpx; // margin-top: 12rpx;
background: #FFFFFF; background: #FFFFFF;
...@@ -57,13 +74,51 @@ page { ...@@ -57,13 +74,51 @@ page {
// border-radius: 16rpx; // border-radius: 16rpx;
border-radius: 37rpx 37rpx 37rpx 0; border-radius: 37rpx 37rpx 37rpx 0;
max-width: 560rpx; max-width: 560rpx;
display: inline-block;
box-sizing: border-box; box-sizing: border-box;
padding: 16rpx 24rpx; padding: 16rpx 24rpx;
} }
.operation {
margin-top: 12rpx;
font-weight: 500;
font-size: 28rpx;
color: #3989FE;
background: #FFFFFF;
padding: 20rpx 24rpx;
max-width: 560rpx;
box-sizing: border-box;
border-radius: 16rpx;
.operation-top {
width: 180rpx;
height: 56rpx;
background: #EFF5FF;
border-radius: 28rpx;
display: flex;
align-items: center;
justify-content: center;
}
.suggest-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
.content {
margin-top: 12rpx;
font-size: 30rpx;
color: #333333;
line-height: 44rpx;
}
}
} }
.chat-right { .chat-right {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
.content-box { .content-box {
width: 606rpx; width: 606rpx;
background: #F0F6FF; background: #F0F6FF;
...@@ -75,60 +130,69 @@ page { ...@@ -75,60 +130,69 @@ page {
box-sizing: border-box; box-sizing: border-box;
padding: 16rpx 24rpx; padding: 16rpx 24rpx;
margin-top: 12rpx; margin-top: 12rpx;
.operation-box { .operation-box {
margin-top: 16rpx; margin-top: 16rpx;
display:flex; display: flex;
justify-content: space-between; justify-content: space-between;
.operation { .operation {
display: flex; display: flex;
align-items: center; align-items: center;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #3989FE; color: #3989FE;
.suggest-icon {
width: 32rpx; .suggest-icon {
height: 32rpx; width: 32rpx;
margin-right: 12rpx; height: 32rpx;
margin-right: 12rpx;
}
} }
} }
}
.chat-item-right-text { .chat-item-right-text {
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 16rpx; border-radius: 16rpx;
padding: 24rpx 28rpx; padding: 24rpx 28rpx;
margin-top: 24rpx; margin-top: 24rpx;
.title {
display: flex; .title {
align-items: center; display: flex;
font-weight: 500; align-items: center;
font-size: 28rpx; font-weight: 500;
color: #333333; font-size: 28rpx;
.suggest-icon { color: #333333;
width: 32rpx;
height: 32rpx; .suggest-icon {
margin-right: 12rpx; width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
} }
} }
}
.text { .text {
margin-top: 12rpx; margin-top: 12rpx;
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #333333; color: #333333;
letter-spacing: 0; letter-spacing: 0;
line-height: 44rpx; line-height: 44rpx;
} }
.line {
width: 100%; .line {
height: 2rpx; width: 100%;
background-color: #F0F6FF; height: 2rpx;
margin: 28rpx 0; background-color: #F0F6FF;
margin: 28rpx 0;
} }
} }
} }
} }
} }
.setting-btn { .setting-btn {
display: inline-block; display: inline-block;
width: 74rpx; width: 74rpx;
...@@ -137,11 +201,13 @@ page { ...@@ -137,11 +201,13 @@ page {
border-radius: 50%; border-radius: 50%;
padding: 21rpx; padding: 21rpx;
box-sizing: border-box; box-sizing: border-box;
.setting-icon { .setting-icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
}
} }
}
.control-box { .control-box {
position: fixed; position: fixed;
display: flex; display: flex;
...@@ -153,6 +219,7 @@ page { ...@@ -153,6 +219,7 @@ page {
box-sizing: border-box; box-sizing: border-box;
padding-bottom: calc(24rpx + constant(safe-area-inset-bottom)); padding-bottom: calc(24rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(24rpx + env(safe-area-inset-bottom)); padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
.inspiration-btn { .inspiration-btn {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
...@@ -162,31 +229,86 @@ page { ...@@ -162,31 +229,86 @@ page {
background: #F0F6FF; background: #F0F6FF;
border-radius: 486rpx; border-radius: 486rpx;
margin-right: 16rpx; margin-right: 16rpx;
.icon { .icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
}
&.active {
background-color: #3989FE;
}
} }
&.active {
background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
}
}
.speak-btn { .speak-btn {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex: 1; flex: 1;
background: #3989FE; background-image: linear-gradient(95deg, #E1F7FC 0%, #E8F0FF 27%, #E8F1FF 65%, #F0EBFF 100%);
border-radius: 486rpx; border-radius: 486rpx;
height: 80rpx; height: 80rpx;
// line-height: 80rpx; // line-height: 80rpx;
color: #fff; color: #3275FA;
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
.icon { .icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
margin-right: 8rpx; margin-right: 8rpx;
}
} }
} }
}
\ No newline at end of file \ No newline at end of file
}
}
.wrapper-pop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
}
.icon-tips {
width: 160rpx;
height: 160rpx;
position: absolute;
top: -26rpx;
left: 50%;
transform: translateX(-50%);
}
.wrapper-content {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 590rpx;
height: 432rpx;
background: #FFFFFF;
box-shadow: 0 -8rpx 12rpx 0 rgba(0, 0, 0, 0.05);
border-radius: 32rpx;
text-align: center;
.title {
font-weight: 500;
font-size: 32rpx;
color: #292D33;
margin-top: 112rpx;
}
.content {
font-size: 28rpx;
color: #5A5E66;
margin-top: 20rpx;
padding: 0 70rpx;
}
.btn {
margin: 48rpx auto;
width: 333rpx;
height: 80rpx;
background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
border-radius: 486rpx;
color: #fff;
font-weight: 500;
font-size: 28rpx;
line-height: 80rpx;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
</view> </view>
</view> </view>
</navigation-bar> </navigation-bar>
<view class="bg-box"></view>
<view class="chat-section"> <view class="chat-section">
<view class="chat-list"> <view class="chat-list">
<scroll-view scroll-y="true" scroll-x="false" style="height:100%" scroll-top="{{scrollTop}}"> <scroll-view scroll-y="true" scroll-x="false" style="height:100%" scroll-top="{{scrollTop}}">
...@@ -16,20 +17,34 @@ ...@@ -16,20 +17,34 @@
<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-top"> <gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image>
对练建议</view>
<view class="content">{{roleDesc}}</view>
</view>
</view> </view>
</view> </view>
</view> </view>
<audio-tts showSpeechPopup="{{showSpeechPopup}}" chatList="{{chatList}}" sex="{{sex}}" avatar="{{avatar}}" id="audioBox"></audio-tts></scroll-view> <audio-tts wx:if="{{roleName}}" isDemo="{{isDemo}}" showSpeechPopup="{{showSpeechPopup}}" roleName="{{roleName}}" chatList="{{chatList}}" voice="{{voice}}" avatar="{{avatar}}" id="audioBox"></audio-tts></scroll-view>
</view> </view>
<view class="control-box" style="{{controlBoxStyle}}"> <view class="control-box" style="{{controlBoxStyle}}">
<view class="inspiration-btn {{popType == 'inspiration' ? 'active' : ''}}" bindtap="openPopup" data-type="inspiration"><gl-image class="icon" src="/aiCheck/{{popType == 'inspiration' ? 'inspiration-icon-white' : 'inspiration-icon'}}.png"></gl-image></view> <view class="inspiration-btn {{popType == 'inspiration' ? 'active' : ''}}" bindtap="openPopup" data-type="inspiration"><gl-image class="icon" src="/aiCheck/{{popType == 'inspiration' ? 'inspiration-icon-white' : 'inspiration-icon'}}.png"></gl-image></view>
<view class="inspiration-btn {{popType == 'script' ? 'active' : ''}}" bindtap="openPopup" data-type="script"><gl-image class="icon" src="/aiCheck/{{popType == 'script' ? 'script-icon-white' : 'script-icon'}}.png"></gl-image></view> <view class="inspiration-btn {{popType == 'script' ? 'active' : ''}}" bindtap="handleScript" data-type="script"><gl-image class="icon" src="/aiCheck/{{popType == 'script' ? 'script-icon-white' : 'script-icon'}}.png"></gl-image></view>
<view class="speak-btn" bindtap="handleSpeak"><gl-image class="icon" src="/aiCheck/tape-icon.png"></gl-image>点击说话</view> <view class="speak-btn" bindtap="handleSpeak"><gl-image class="icon" src="/aiCheck/speech-icon.png"></gl-image>点击说话</view>
</view> </view>
</view> </view>
<!-- 弹窗组件 --> <!-- 弹窗组件 -->
<scene-popup avatar="{{avatar}}" bind:handleMask="handleMask" popType="{{popType}}" show="{{showScenePopup}}" inspirationContent="{{inspirationContent}}" scriptList="{{scriptList}}" bindcancel="cancel" bind:handleScript="handleScript" bindscene="handleScene"></scene-popup> <scene-popup avatar="{{avatar}}" bind:handleMask="handleMask" popType="{{popType}}" show="{{showScenePopup}}" inspirationContent="{{inspirationContent}}" scriptList="{{scriptList}}" bindcancel="cancel" bind:handleScript="handleScript" bindscene="handleScene"></scene-popup>
<speech-popup bindsend="send" show="{{showSpeechPopup}}" inspirationContent="{{inspirationContent}}" bindclose="closeSpeechPopup"></speech-popup > <speech-popup bindsend="send" show="{{showSpeechPopup}}" inspirationContent="{{inspirationContent}}" bindclose="closeSpeechPopup"></speech-popup>
<view class="wrapper-pop" wx:if="{{isVisible}}">
<view class="wrapper-content">
<gl-image class="icon-tips" webp src="/aiCheck/icon-tips.webp"></gl-image>
<view class="title">温馨提示</view>
<view class="content">您的对练试用次数已用完,请等待管理员为您分配对练任务</view>
<view class="btn" bind:tap="back">我知道了</view>
</view>
</view>
/* packageEquity/pages/aiCheck/components/AudioTts/AudioTts.wxss */ /* packageEquity/pages/aiCheck/components/AudioTts/AudioTts.wxss */
.chat-item { .chat-item {
padding: 0 32rpx 30rpx; padding: 0 32rpx 30rpx;
.chat-left {
display:flex; .chat-left {
.avatar-icon { display: flex;
width: 80rpx;
height: 80rpx; .avatar-icon {
margin-right: 10rpx; width: 80rpx;
border-radius: 50%; height: 80rpx;
} margin-right: 10rpx;
.content-box { border-radius: 50%;
margin-top: 12rpx; }
background: #FFFFFF;
font-size: 30rpx; .content-box {
color: #333333; margin-top: 12rpx;
line-height: 44rpx; background: #FFFFFF;
border-radius: 16rpx; font-size: 30rpx;
max-width: 560rpx; color: #333333;
box-sizing: border-box; line-height: 44rpx;
padding: 16rpx 24rpx; border-radius: 16rpx;
} max-width: 560rpx;
} box-sizing: border-box;
.chat-right { padding: 16rpx 24rpx;
}
}
.chat-right {
display: flex;
justify-content: flex-end;
.content-box {
background: #E7F0FF;
font-size: 30rpx;
color: #000000;
line-height: 44rpx;
border-radius: 16rpx;
width: 560rpx;
box-sizing: border-box;
padding: 20rpx 24rpx 16rpx;
margin-top: 12rpx;
.operation-box {
margin-top: 16rpx;
display: flex; display: flex;
justify-content: flex-end; justify-content: space-between;
.content-box {
width: 606rpx; .operation {
background: #F0F6FF; display: flex;
font-size: 30rpx;
color: #000000;
line-height: 44rpx;
border-radius: 16rpx;
max-width: 560rpx;
box-sizing: border-box;
padding: 16rpx 24rpx;
margin-top: 12rpx;
.operation-box {
margin-top: 16rpx;
display:flex;
justify-content: space-between;
.operation {
display: flex;
align-items: center; align-items: center;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #3989FE; color: #3989FE;
&:last-child {
margin-left: auto;
;
}
.suggest-icon { .suggest-icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
margin-right: 12rpx; margin-right: 12rpx;
}
}
} }
.chat-item-right-text { }
}
.chat-item-right-text {
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 16rpx; border-radius: 16rpx;
padding: 24rpx 28rpx; padding: 24rpx 28rpx;
margin-top: 24rpx; margin-top: 20rpx;
.chat-aspect {
display: grid;
background-image: linear-gradient(95deg, #E1F7FC 0%, #F3F7FF 27%, #E8F1FF 65%, #F7F2FF 100%);
border-radius: 12rpx;
padding: 6rpx 0rpx;
margin-bottom: 20rpx;
grid-template-columns: repeat(4, 1fr);
.aspect-item {
text-align: center;
.aspect-name {
font-size: 24rpx;
color: #575C63;
}
.aspect-result {
font-size: 26rpx;
color: #FF8D1A;
}
}
}
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
.suggest-icon { .suggest-icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
margin-right: 12rpx; margin-right: 12rpx;
}
} }
} }
.text { }
margin-top: 12rpx;
font-weight: 400; .text {
font-size: 26rpx; margin-top: 12rpx;
color: #333333; font-weight: 400;
letter-spacing: 0; font-size: 26rpx;
color: #333333;
letter-spacing: 0;
line-height: 44rpx;
}
.line {
width: 100%;
height: 2rpx;
background-color: #F0F6FF;
margin: 24rpx 0;
}
}
}
.chat-defense {
display: flex;
justify-content: flex-end;
margin-bottom: 32rpx;
.defense-box {
display: flex;
width: 560rpx;
height: 186rpx;
margin-right: 32rpx;
background-image: linear-gradient(179deg, #E0EAFF 0%, #FFFFFF 44%);
padding: 16rpx 20rpx;
box-sizing: border-box;
border-radius: 16rpx;
border: 2rpx solid #B2C6FE;
.defense-img {
width: 56rpx;
height: 56rpx;
margin-right: 12rpx;
image {
width: 56rpx;
height: 56rpx;
}
}
.defense-desc {
.defense-title {
font-weight: 600;
font-size: 30rpx;
color: #1B233D;
line-height: 44rpx; line-height: 44rpx;
} }
.line {
width: 100%; .defense-content {
height: 2rpx; font-size: 26rpx;
background-color: #F0F6FF; color: #7A8299;
margin: 28rpx 0;
}
} }
} }
} }
}
}
.audio-right { .audio-right {
font-size: 30rpx; font-size: 30rpx;
color: #FFFFFF; color: #FFFFFF;
display: flex; display: flex;
align-items: center; align-items: center;
padding-right: 24rpx; padding-right: 24rpx;
box-sizing: border-box; box-sizing: border-box;
width: 208rpx; width: 208rpx;
height: 74rpx; height: 74rpx;
background: #3989FE; background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
border-radius: 37rpx 37rpx 0 37rpx; border-radius: 37rpx 37rpx 0 37rpx;
margin-left: auto; margin-left: auto;
justify-content: flex-end; justify-content: flex-end;
.wifi-circle { .wifi-circle {
border: 5rpx solid #fff; border: 5rpx solid #fff;
} }
} }
.loadding { .loadding {
display: inline-block; display: inline-block;
width: 14rpx; width: 14rpx;
height: 14rpx; height: 14rpx;
border-radius: 50%; border-radius: 50%;
margin-right: 24rpx; margin-right: 24rpx;
animation: load 1s ease-in infinite;
&.first { &.first {
animation-delay:0.13s;
background-color: rgba(57, 137, 254, 0.3); background-color: rgba(57, 137, 254, 0.3);
} }
&.second { &.second {
animation-delay:0.26s;
background-color: rgba(57, 137, 254, 0.5); background-color: rgba(57, 137, 254, 0.5);
} }
&.third { &.third {
animation-delay:0.39s;
background-color: rgba(57, 137, 254, 0.7); background-color: rgba(57, 137, 254, 0.7);
}
} }
}
.audio-left { .audio-left {
font-size: 30rpx; font-size: 30rpx;
color: #333333; color: #333333;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -131,18 +225,35 @@ ...@@ -131,18 +225,35 @@
width: 208rpx; width: 208rpx;
height: 74rpx; height: 74rpx;
background: #fff; background: #fff;
border-radius: 37rpx 37rpx 37rpx 0; border-radius: 37rpx 37rpx 37rpx 0;
&.loadding-box {
width: 154rpx;
border-radius: 37rpx 37rpx 37rpx 0;
}
.wifi-circle { .wifi-circle {
border: 5rpx solid #666; border: 5rpx solid #666;
} }
} }
.wifi-symbol { .wifi-symbol {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
box-sizing: border-box; box-sizing: border-box;
z-index: 99; z-index: 99;
.icon { .icon {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
}
}
@keyframes load {
0% {
opacity: 1;
}
100% {
opacity: 0.2;
} }
} }
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/aiCheck/components/AudioTts/AudioTts.wxml--> <!--packageEquity/pages/aiCheck/components/AudioTts/AudioTts.wxml-->
<view class="chat-item" wx:for="{{list}}"> <view class="chat-item" wx:for="{{list}}">
<view class="chat-left" wx:if="{{item.role == 1}}"> <block wx:if="{{item.role == 1}}">
<image class="avatar-icon" src="{{avatar}}"></image> <view class="chat-defense" wx:if="{{item.isOpenDefense}}">
<view class="chat-box"> <view class="defense-box">
<!-- <audio-tts id="audio_{{index}}" audioInfo="{{item}}"></audio-tts> --> <view class="defense-img">
<view class="audio-box" wx:if="{{item.filePath}}"> <gl-image class="icon" src="/aiCheck/defense.png"></gl-image>
<view class="audio-left" data-file="{{item.filePath}}" data-id="{{item.id}}" bindtap="playVoice">
<view class="wifi-symbol">
<gl-image class="icon" wx:if="{{audioIndex === item.id && status == 'start'}}" src="/aiCheck/audio_b.gif"></gl-image>
<gl-image class="icon" wx:else src="/aiCheck/audio_b.png"></gl-image>
</view>
<text>{{item.times}}"</text>
</view> </view>
<view class="defense-desc">
<view class="defense-title">
攻防已开启
</view>
<view class="defense-content">
您已开启攻防,此时大模型会展示出不想购买的意愿,您可以针对此场景进行专项演练!
</view>
</view> </view>
<view class="audio-left" wx:else> </view>
<view class="first loadding"></view> </view>
<view class="second loadding"></view> <view class="chat-left">
<view class="third loadding"></view> <image class="avatar-icon" src="{{avatar}}"></image>
<view class="chat-box">
<!-- <audio-tts id="audio_{{index}}" audioInfo="{{item}}"></audio-tts> -->
<view class="audio-box" wx:if="{{item.filePath}}">
<view class="audio-left" data-file="{{item.filePath}}" data-id="{{item.id}}" bindtap="playVoice">
<view class="wifi-symbol">
<gl-image class="icon" wx:if="{{audioIndex === item.id && status == 'start'}}" src="/aiCheck/audio_b.gif">
</gl-image>
<gl-image class="icon" wx:else src="/aiCheck/audio_b.png"></gl-image>
</view>
<text>{{item.times}}"</text>
</view>
</view>
<view class="audio-left loadding-box" wx:else>
<view class="first loadding"></view>
<view class="second loadding"></view>
<view class="third loadding"></view>
</view>
<view class="content-box" wx:if="{{item.content}}">{{item.content}}</view>
</view> </view>
<view class="content-box" wx:if="{{item.content}}">{{item.content}}</view>
</view> </view>
</view> </block>
<view class="chat-right" wx:if="{{item.role == 2}}"> <view class="chat-right" wx:if="{{item.role == 2}}">
<view class="chat-box"> <view class="chat-box">
<view class="audio-right" data-file="{{item.filePath}}" data-id="{{item.id}}" bindtap="playVoice"> <view class="audio-right" data-file="{{item.filePath}}" data-id="{{item.id}}" bindtap="playVoice">
<text>{{item.times}}"</text> <text>{{item.times}}"</text>
<view class="wifi-symbol"> <view class="wifi-symbol">
<gl-image class="icon" wx:if="{{audioIndex === item.id && status == 'start'}}" src="/aiCheck/audio_w.gif"></gl-image> <gl-image class="icon" wx:if="{{audioIndex === item.id && status == 'start'}}" src="/aiCheck/audio_w.gif">
</gl-image>
<gl-image class="icon" wx:else src="/aiCheck/audio_w.png"></gl-image> <gl-image class="icon" wx:else src="/aiCheck/audio_w.png"></gl-image>
</view> </view>
</view> </view>
...@@ -47,38 +66,58 @@ ...@@ -47,38 +66,58 @@
<gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image> <gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image>
改进建议 改进建议
</view> </view>
</view> </view>
<block wx:else> <block wx:else>
<view class="chat-item-right-text"> <view class="chat-item-right-text">
<view class="suggest"> <view class="chat-aspect" wx:if="{{item.speed}}">
<view class="title"> <view class="aspect-item">
<gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image> <view class="aspect-name">语速</view>
改进建议 <view class="aspect-result">{{item.speed}}</view>
</view>
<view class="aspect-item">
<view class="aspect-name">语调</view>
<view class="aspect-result">{{item.intonation}}</view>
</view>
<view class="aspect-item">
<view class="aspect-name">清晰度</view>
<view class="aspect-result">{{item.definition}}</view>
</view>
<view class="aspect-item">
<view class="aspect-name">冗余词</view>
<view class="aspect-result">{{item.redundant}}</view>
</view>
</view> </view>
<view class="text"> {{item.suggestions_for_improvement}}</view> <view class="suggest">
</view> <view class="title">
<view class="line"></view> <gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image>
<view class="polish"> 改进建议
<view class="title"> </view>
<gl-image class="suggest-icon" src="/aiCheck/polish-icon.png"></gl-image> <view class="text"> {{item.suggestions_for_improvement}}</view>
润色表达 </view>
<view class="line"></view>
<view class="polish">
<view class="title">
<gl-image class="suggest-icon" src="/aiCheck/polish-icon.png"></gl-image>
润色表达
</view>
<view class="text">
<rich-text nodes="{{item.refine_the_expression}}"></rich-text>
</view>
</view> </view>
<view class="text"><rich-text nodes="{{item.refine_the_expression}}"></rich-text></view>
</view>
</view>
<view class="operation-box">
<view class="operation" bindtap="resetChat" wx:if="{{index == resetIndex}}">
<gl-image class="suggest-icon" src="/aiCheck/reset.png"></gl-image>
重录
</view> </view>
<view class="operation" bindtap="handleHidden" data-index="{{index}}"> <view class="operation-box">
<gl-image class="suggest-icon" src="/aiCheck/expand.png"></gl-image> <view class="operation" bindtap="resetChat" wx:if="{{index == resetIndex}}">
收起 <gl-image class="suggest-icon" src="/aiCheck/reset.png"></gl-image>
重录
</view>
<view class="operation" bindtap="handleHidden" data-index="{{index}}">
<gl-image class="suggest-icon" src="/aiCheck/expand.png"></gl-image>
收起
</view>
</view> </view>
</block>
</view>
</block>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
position: absolute; position: absolute;
left: 0; left: 0;
width: 100%; width: 100%;
background: #FFFFFF; background-image: linear-gradient(117deg, #F0EBFF 0%, #E1F7FC 100%);
border-radius: var(--fontSize20) var(--fontSize20) 0 0; border-radius: 32rpx 32rpx 0 0;
animation: show-popup .5s forwards; animation: show-popup .5s forwards;
box-sizing: border-box; box-sizing: border-box;
padding: 0 var(--fontSize32); padding: 0 var(--fontSize32);
......
...@@ -4,6 +4,7 @@ const { ...@@ -4,6 +4,7 @@ const {
const getToken = require("~/utils/aliyun/token").getToken const getToken = require("~/utils/aliyun/token").getToken
const SpeechRecognition = require("~/utils/aliyun/sr") const SpeechRecognition = require("~/utils/aliyun/sr")
const sleep = require("~/utils/aliyun/util").sleep const sleep = require("~/utils/aliyun/util").sleep
let timer = null let timer = null
Component({ Component({
/** /**
...@@ -80,6 +81,10 @@ Component({ ...@@ -80,6 +81,10 @@ Component({
}, },
onSrStart: async function () { onSrStart: async function () {
if (!this.data.sr) { if (!this.data.sr) {
const {
name
} = wx.$util.getUserInfo();
wx.$sendSentry(name+'语音识别连接失败')
console.log("sr is null") console.log("sr is null")
return return
} }
...@@ -98,12 +103,16 @@ Component({ ...@@ -98,12 +103,16 @@ Component({
this.setData({ this.setData({
times: ++times times: ++times
}) })
}, 1000) }, 1000)
let sr = this.data.sr let sr = this.data.sr
try { try {
await sr.start(sr.defaultStartParams()) let param = sr.defaultStartParams();
console.log(param,'param')
// param.audio_address = 'https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/27199017763051.mp3'
await sr.start(param)
this.data.srStart = true this.data.srStart = true
} catch (e) { } catch (e) {
wx.$sendSentry('语音转文字连接失败' + JSON.stringify(e))
console.log("start failed:" + e) console.log("start failed:" + e)
return return
} }
...@@ -143,6 +152,7 @@ Component({ ...@@ -143,6 +152,7 @@ Component({
}) })
wx.getRecorderManager().onError((res) => { wx.getRecorderManager().onError((res) => {
console.log("recording failed:" + res) console.log("recording failed:" + res)
wx.$sendSentry('语音转文字失败' + JSON.stringify(res))
// this.connectSr() // this.connectSr()
}) })
try { try {
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
} }
.loading-item { .loading-item {
width: 10rpx; width: 8rpx;
height: 20rpx; height: 20rpx;
border-radius: 5rpx; border-radius: 5rpx;
margin-right: 10rpx; margin-right: 10rpx;
...@@ -137,7 +137,9 @@ ...@@ -137,7 +137,9 @@
.loading-item:nth-of-type(3n) { .loading-item:nth-of-type(3n) {
animation-delay: .38s; animation-delay: .38s;
} }
.loading-item:nth-of-type(4n) {
animation-delay: .28s;
}
@keyframes audio-eff { @keyframes audio-eff {
0% { 0% {
height: 0; height: 0;
...@@ -184,7 +186,7 @@ ...@@ -184,7 +186,7 @@
width: 478rpx; width: 478rpx;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
background: #3989FE; background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
border-radius: 486rpx; border-radius: 486rpx;
font-size: 28rpx; font-size: 28rpx;
color: #FFFFFF; color: #FFFFFF;
......
<!--packageEquity/pages/aiCheck/components/SpeechPopup/SpeechPopup.wxml--> <!--packageEquity/pages/aiCheck/components/SpeechPopup/SpeechPopup.wxml-->
<pop-up class="speech-popup" title="{{content?'对话灵感':'正在录音'}}" show="{{show}}" height="{{content ? '848rpx':'530rpx'}}" bindcancel="onClose"> <pop-up class="speech-popup" title="正在录音" show="{{show}}" height="530rpx" bindcancel="onClose">
<!-- <view class="inspiration-title"> <!-- <view class="inspiration-title">
<view wx:if="{{content}}">对话灵感</view> --> <view wx:if="{{content}}">对话灵感</view> -->
<!-- <view class="inspiration-title-icon" bindtap="openInspiration"> <!-- <view class="inspiration-title-icon" bindtap="openInspiration">
...@@ -8,20 +8,8 @@ ...@@ -8,20 +8,8 @@
</view> --> </view> -->
<!-- <view class="inspiration-title-description">用自己的话说出来效果更佳~</view> --> <!-- <view class="inspiration-title-description">用自己的话说出来效果更佳~</view> -->
<!-- </view> --> <!-- </view> -->
<view class="inspiration-content" wx:if="{{content}}">
<scroll-view scroll-y class="inspiration-scroll">
<view class="content">{{content}}</view>
</scroll-view>
<!-- <block wx:else>
<view class="first loadding"></view>
<view class="second loadding"></view>
<view class="third loadding"></view>
</block>
<view wx:if="{{!content}}" class="loadding-text">对话灵感生成中...</view> -->
</view>
<view class="inspiration-line" wx:if="{{content}}">用自己的话说出来效果更佳</view>
<view class="loading-box"> <view class="loading-box">
<view class="loading-item" wx:for="{{36}}"> <view class="loading-item" wx:for="{{50}}">
</view> </view>
</view> </view>
<view class="time-box"> <view class="time-box">
......
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999999;
} }
.popup-content {
background-image: linear-gradient(117deg, #F0EBFF 0%, #E1F7FC 100%);
border-radius: 32rpx 32rpx 0 0;
}
.customer-list { .customer-list {
.customer-item { .customer-item {
display: inline-flex; display: inline-flex;
...@@ -13,18 +19,21 @@ ...@@ -13,18 +19,21 @@
width: calc(50% - 16rpx); width: calc(50% - 16rpx);
padding: 8rpx; padding: 8rpx;
margin-top: 28rpx; margin-top: 28rpx;
.avatar { .avatar {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
border-radius: 50%; border-radius: 50%;
margin-right: 16rpx; margin-right: 16rpx;
} }
&.selected {
background-color: #3989FE; &.selected {
color: #fff; background-color: #3989FE;
} color: #fff;
} }
} }
}
.preserve { .preserve {
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
...@@ -36,122 +45,150 @@ ...@@ -36,122 +45,150 @@
text-align: center; text-align: center;
line-height: 80rpx; line-height: 80rpx;
margin-top: 40rpx; margin-top: 40rpx;
} }
// 灵感样式 // 灵感样式
.popup { .popup {
padding: 32rpx 0; padding: 24rpx 0 32rpx;
} }
.inspiration-pop { .inspiration-pop {
.inspiration-title { .inspiration-title {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
&-icon { &-icon {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 216rpx;
height: 72rpx; height: 72rpx;
background: #F0F6FF;
border-radius: 486rpx; border-radius: 486rpx;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #3989FE; color: linear-gradient(to right, #714DFF 0%, #3888FF 100%);
.inspiration-icon { .inspiration-icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
margin-right: 8rpx; margin-right: 8rpx;
}
} }
&-description {
font-size: 28rpx;
color: #999999;
}
} }
.inspiration-content {
margin-top: 28rpx; &-description {
background: #FAFAFA;
border-radius: 16rpx;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #999999;
letter-spacing: 0; }
line-height: 48rpx; }
padding: 24rpx 0;
width: 100%; .inspiration-content {
box-sizing: border-box; margin-top: 16rpx;
.inspiration-scroll { background: #FAFAFA;
max-height: 330rpx; border-radius: 16rpx;
.content { font-size: 28rpx;
padding: 0 28rpx; color: #333333;
box-sizing: border-box; letter-spacing: 0;
} line-height: 48rpx;
} padding: 24rpx 0;
.inspiration-loadding { width: 100%;
box-sizing: border-box;
.inspiration-scroll {
height: 330rpx;
.content {
padding: 0 28rpx; padding: 0 28rpx;
box-sizing: border-box; box-sizing: border-box;
}
} }
}
.inspiration-loadding {
padding: 0 28rpx;
box-sizing: border-box;
}
} }
}
.script-pop { .script-pop {
.describe { .describe {
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999999;
} }
.list {
.item { .list {
display: flex; .item {
margin-top: 28rpx; display: flex;
.avatar { margin-top: 28rpx;
width: 80rpx;
height: 80rpx; .avatar {
border-radius: 50%; width: 80rpx;
margin-right: 16rpx; height: 80rpx;
border-radius: 50%;
margin-right: 16rpx;
}
.content {
flex: 1;
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
line-height: 44rpx;
background: #F0F6FF;
border-radius: 16rpx;
padding: 16rpx 24rpx;
.try {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 28rpx;
color: #3989FE;
.script-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
} }
.content {
flex: 1;
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
line-height: 44rpx;
background: #F0F6FF;
border-radius: 16rpx;
padding: 16rpx 24rpx;
.try {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 28rpx;
color: #3989FE;
.script-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
}
}
} }
} }
}
} }
}
.loadding { .loadding {
display: inline-block; display: inline-block;
width: 14rpx; width: 14rpx;
height: 14rpx; height: 14rpx;
border-radius: 50%; border-radius: 50%;
margin-right: 24rpx; margin-right: 24rpx;
animation: load 1s ease-in infinite;
&.first { &.first {
animation-delay:0.13s;
background-color: rgba(57, 137, 254, 0.3); background-color: rgba(57, 137, 254, 0.3);
} }
&.second { &.second {
animation-delay:0.26s;
background-color: rgba(57, 137, 254, 0.5); background-color: rgba(57, 137, 254, 0.5);
} }
&.third { &.third {
animation-delay:0.39s;
background-color: rgba(57, 137, 254, 0.7); background-color: rgba(57, 137, 254, 0.7);
}
} }
}
.loadding-text { .loadding-text {
margin-top: 16rpx; margin-top: 16rpx;
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999999;
}
\ No newline at end of file \ No newline at end of file
}
@keyframes load {
0% {
opacity: 1;
}
100% {
opacity: 0.2;
}
}
\ No newline at end of file \ No newline at end of file
<pop-up class="scene-popup" bindcancel="cancel" bindmask="handleMask" hasClose="{{config.hasClose[popType]}}" title="{{config.titleObj[popType]}}" show="{{show}}" height="{{config.heightObj[popType]}}"> <pop-up class="scene-popup" bindcancel="cancel" bindmask="handleMask" hasClose="{{config.hasClose[popType]}}"
title="{{config.titleObj[popType]}}" show="{{show}}" height="{{config.heightObj[popType]}}">
<block wx:if="{{popType == 'scene'}}"> <block wx:if="{{popType == 'scene'}}">
<view class="popup-discription">客户类型</view> <view class="popup-discription">客户类型</view>
<view class="customer-list"> <view class="customer-list">
<block wx:for="{{customeTypeList}}" wx:key="{{item.id}}"> <block wx:for="{{customeTypeList}}" wx:key="{{item.id}}">
<view class="customer-item {{index === selectedIndex ? 'selected' : ''}}" bindtap="selectCustomerType" data-index="{{index}}"> <view class="customer-item {{index === selectedIndex ? 'selected' : ''}}" bindtap="selectCustomerType"
data-index="{{index}}">
<gl-image class="avatar" src="/avatar/{{item.imgUrl}}.png"></gl-image> <gl-image class="avatar" src="/avatar/{{item.imgUrl}}.png"></gl-image>
<view>{{item.name}}</view> <view>{{item.name}}</view>
</view> </view>
...@@ -15,29 +17,28 @@ ...@@ -15,29 +17,28 @@
<view class="inspiration-pop popup"> <view class="inspiration-pop popup">
<view class="inspiration-title"> <view class="inspiration-title">
<view class="inspiration-title-icon"> <view class="inspiration-title-icon">
<gl-image class="inspiration-icon" src="/aiCheck/inspiration-icon.png"></gl-image> <gl-image class="inspiration-icon" src="/aiCheck/inspiration.png"></gl-image>
对话灵感 AI提示
</view> </view>
<view class="inspiration-title-description">用自己的话说出来效果更佳~</view> <view class="inspiration-title-description">用自己的话说出来效果更佳~</view>
</view> </view>
<view class="inspiration-content"> <view class="inspiration-content">
<scroll-view scroll-y class="inspiration-scroll"> <scroll-view scroll-y class="inspiration-scroll">
<view class="inspiration-loadding" wx:if="{{!content}}">
<view class="first loadding"></view>
<view class="second loadding"></view>
<view class="third loadding"></view>
</view>
<view class="content">{{content}}</view> <view class="content">{{content}}</view>
</scroll-view> </scroll-view>
<view class="inspiration-loadding" wx:if="{{!content}}">
<view class="first loadding"></view>
<view class="second loadding"></view>
<view class="third loadding"></view>
</view>
</view> </view>
<view wx:if="{{!content}}" class="loadding-text">对话灵感生成中...</view>
</view> </view>
</block> </block>
<block wx:if="{{popType == 'script'}}"> <block wx:if="{{popType == 'script'}}">
<view class="script-pop"> <view class="script-pop">
<view class="describe">可选择具体的攻防场景来模拟对练</view> <view class="describe">可选择具体的攻防场景来模拟对练</view>
<view class="list"> <view class="list">
<block wx:for="{{scriptList}}" wx:key="index" > <block wx:for="{{scriptList}}" wx:key="index">
<view class="item" bindtap="selectScript" data-index="{{index}}" data-content="{{item.content}}"> <view class="item" bindtap="selectScript" data-index="{{index}}" data-content="{{item.content}}">
<image class="avatar" src="{{avatar}}"></image> <image class="avatar" src="{{avatar}}"></image>
<view class="content"> <view class="content">
......
export const saleEmoji = [{
text: '较差'
}, {
text: '一般'
}, {
text: '良好'
}, {
text: '优秀'
}, {
text: '卓越'
}]
export const speechEmoji = [{
text: '急速'
}, {
text: '极慢'
}, {
text: '快速'
}, {
text: '缓慢'
}, {
text: '适中'
}]
export const soundEmoji = [{
text: '单调'
}, {
text: '平和'
}, {
text: '适中'
}, {
text: '激昂'
}, {
text: '丰富'
}]
export const skilledEmoji = [{
text: '生疏'
}, {
text: '一般'
}, {
text: '熟练'
}, {
text: '精通'
}, {
text: '精湛'
}]
export const definitionEmoji = [{
text: '模糊'
}, {
text: '含糊'
}, {
text: '适中'
}, {
text: '明白'
}, {
text: '清晰'
}]
export const activeEmoji = [{
text: '消极'
}, {
text: '冷淡'
}, {
text: '一般'
}, {
text: '积极'
}, {
text: '热情'
}]
export const toneWords = ['嗯', '额', '哦', '啊', '呵', '哈', '呀', '呢', '吗', '呗']
export const toneList = ['您的语言表达充斥着大量不必要的重复词汇,几乎让人无法理解其意图,严重影响沟通效果。', '您的冗余词汇使用过多,导致表达显得啰嗦,可能会让听者或读者感到困惑,需要仔细分辨才能理解核心信息。', '您的表达中频繁出现冗余词汇,虽然不影响主要信息的传达,但会使语言显得有些啰嗦。', '您偶尔出现一些不必要的词汇,但整体上不影响理解,语言仍然保持较高的清晰度。', '您的语言表达简洁明了,没有任何不必要的冗余词汇,信息传达直接高效。']
export const intonationList = ['您的语调过于单调,听起来平淡无奇,容易让听众感到十分乏味或缺乏兴趣。', '您的语调几乎不变,缺乏情感和活力,可能会让听众感到乏味。', '您的语调有轻微的升降和强弱变化,足够表达基本的情感和强调,但变化不大。', '您的语调有明显的升降和强弱变化,能够有效地传达情感和强调重点,使语言更加生动和吸引人。', '您的语调变化丰富,能够充分表达复杂的情感和细微的差别,使语言表达更加生动和有感染力。']
export const definitionList = ['您的发音严重不准确,大量音节和音素模糊不清,听众很难理解说话者的意图,沟通效果极差。', '您的发音不够准确,有些音节和音素模糊不清,听众可能需要更加集中注意力或请求重复才能理解全部内容。', '您的发音基本准确,部分音节可能不够清晰,但大部分信息仍然可以传达给听众,偶尔需要听众集中注意力才能完全理解。', '您的发音较为准确,大部分音节和音素清晰,偶尔有轻微的模糊,但不影响整体理解。', '您的发音准确,每个音节和音素都清晰可辨,没有任何模糊或含糊的地方,听众可以轻松理解每一个词。']
export const speechList = ['您的语速极快,几乎听不出单词之间的停顿,可能会导致听众难以理解,尤其是在不熟悉的话题或复杂的讨论中。', '您的语速极慢,每个词之间有明显的停顿,通常用于强调某些信息或确保听众能够完全理解。', '您的语速较快,词汇之间的间隔较短,可能需要听众集中注意力才能跟上,但仍然可以保持清晰度。', '您的语速较慢,适合于清晰的沟通和教学,给听众足够的时间来消化和理解信息。', '您的语速适中,既不过快也不过慢,是大多数日常对话和正式演讲的理想速度,便于听众跟随和理解。']
export const familiarList = ['您对延保流程十分生疏,建议多向优秀员工请教并多熟悉延保流程与话术。', '您对延保流程比较生疏,建议抽空熟悉延保流程与话术。', '您对延保流程掌握的一般,需要加强自己的销售话术。', '您对延保流程非常熟悉,能够在大部分环节引导客户购买延保产品。', '您对延保流程有着卓越的理解和掌握,能够在每个环节准确引导客户购买延保产品。']
export const calculateStars = (averageSpeed) => {
// 根据平均语速计算星级
switch (true) {
case averageSpeed > 210:
return 1; // 1星
case averageSpeed < 120:
return 2; // 2星
case averageSpeed >= 120 && averageSpeed < 151:
return 4; // 4星
case averageSpeed >= 151 && averageSpeed < 181:
return 5; // 5星
case averageSpeed >= 181 && averageSpeed <= 210:
return 3; // 3星
default:
return 0; // 默认值,如果不在上述范围内
}
}
export const SpeechRateValue = {
1: '急速',
2: '极慢',
3: '快速',
4: '缓慢',
5: '适中'
}
export const speechSpeed_MIN = 150
export const speechSpeed_MAX = 180
export const calculateEmotion = (emotion, isStar) => {
console.log(emotion, 'emotion')
let star = ''
switch (true) {
case emotion >= 7:
star = 5;
break;
case 6.5 < emotion && emotion < 7:
star = 4;
break;
case emotion <= 5:
star = 1;
break;
case emotion > 5.5 && emotion <= 6.5:
star = 3;
break;
default:
star = 2;
}
return isStar ? star : definitionEmoji[star - 1].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 ? 5 : 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
.report-panel {
background-color: #FFFFFF;
border-radius: 16rpx;
padding: 20rpx 0;
margin-bottom: 24rpx;
}
.report-panel.other-bg {
background-image: linear-gradient(180deg, #F0F6FF 0%, #FFFFFF 34%);
}
.report-panel .report-title {
font-size: 28rpx;
color: #292D33;
height: 28rpx;
line-height: 28rpx;
position: relative;
padding-left: 30rpx;
font-weight: 600;
}
.report-panel .report-title::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 6rpx;
height: 28rpx;
background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
border-radius: 0 6rpx 6rpx 0;
}
.report-content {
font-size: 26rpx;
color: #666666;
padding: 0rpx 40rpx;
text-align: center;
line-height: 40rpx;
margin: 30rpx 0rpx 20rpx;
}
.scoce-box {
text-align: center;
font-size: 24rpx;
color: #333333;
}
.scoce-box text {
font-weight: 600;
font-size: 64rpx;
color: #3989FE;
}
.start-box {
display: flex;
justify-content: center;
}
.start-box .star {
width: 24rpx;
height: 24rpx;
display: inline-block;
clip-path: polygon(50% 0%,
61% 35%,
98% 35%,
68% 57%,
79% 91%,
50% 70%,
21% 91%,
32% 57%,
2% 35%,
39% 35%);
}
.star_1 {
background: #FFC300;
}
.star_0 {
background: #E6E7EB;
}
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/result/components/attitude/attitude.js
import {activeEmoji} from '../../../contant'
Component({
/**
* 组件的属性列表
*/
properties: {
detailInfo: {
type: Object,
observer: function (n) {
this.getStar()
}
},
},
/**
* 组件的初始数据
*/
data: {
emojiList: activeEmoji,
level:3,
content: '您对延保业务的全流程场景较熟悉,礼貌接待客户并向客户详细介绍了车辆使用与延保产品!'
},
/**
* 组件的方法列表
*/
methods: {
getStar() {
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"emoji":"../emoji/emoji"
}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/result/components/attitude/attitude.wxss */
@import "../../common.wxss";
.good-panel {
margin-top: 200rpx;
text-align: center;
.good-img {
margin: 0 auto;
width: 128rpx;
height: 131.2rpx;
}
.good-desc {
font-size: 24rpx;
color: #999EA8;
line-height: 32rpx;
margin-top: 30rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/aiCheck/result/components/attitude/attitude.wxml-->
<view class="report-panel">
<view class="report-title">积极程度</view>
<emoji emojiList="{{emojiList}}" level="{{detailInfo.star}}"></emoji>
<view class="report-content">{{detailInfo.content}}</view>
</view>
<view class="good-panel">
<view class="good-img"><gl-image class="icon" src="/aiCheck/good.png"></gl-image></view>
<view class="good-desc">再接再厉,成为营销大师!</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/result/components/deliver/deliver.js
import {
soundEmoji,
definitionEmoji,
definitionList,
intonationList
} from '../../../contant'
Component({
/**
* 组件的属性列表
*/
properties: {
detailInfo: {
type: Object,
observer: function (n) {
this.getDetail()
}
},
},
/**
* 组件的初始数据
*/
data: {
emojiList: definitionEmoji,
controlList: soundEmoji,
level: 3,
level_c: 3,
content: '非常棒!发音清晰度高,听众能够准确明白您的意思!'
},
/**
* 组件的方法列表
*/
methods: {
getDetail() {
const {
deliver
} = this.data.detailInfo,
definition = JSON.parse(deliver.definition || {}),
intonation = JSON.parse(deliver.intonation || {})
this.setData({
definition_star:definition.star,
intonation_star:intonation.star,
definitionText: definitionList[definition.star - 1],
intonationText:intonationList[intonation.star - 1],
definition_lineData: {
y: definition.y,
x: definition.x
},
definition_areaOptions: {
min: definition.min,
max: definition.max
},
intonation_lineData: {
y: intonation.y,
x: intonation.x
},
intonation_areaOptions: {
min: intonation.min,
max: intonation.max
},
})
},
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"emoji":"../emoji/emoji",
"line-chat": "../lineChat/lineChat"
}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/result/components/deliver/deliver.wxss */
@import "../../common.wxss";
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/aiCheck/result/components/deliver/deliver.wxml-->
<view class="report-panel">
<view class="report-title">清晰度</view>
<emoji emojiList="{{emojiList}}" level="{{definition_star}}"></emoji>
<view class="report-content">{{definitionText}}</view>
<line-chat title="清晰度变化曲线" lineData="{{definition_lineData}}" areaOptions="{{definition_areaOptions}}" ></line-chat>
</view>
<view class="report-panel">
<view class="report-title">语调</view>
<emoji emojiList="{{controlList}}" level="{{intonation_star}}"></emoji>
<view class="report-content">{{intonationText}}</view>
<line-chat title="语调变化曲线" lineData="{{intonation_lineData}}" areaOptions="{{intonation_areaOptions}}" ></line-chat>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/result/components/emoji/emoji.js
Component({
/**
* 组件的属性列表
*/
properties: {
emojiList: {
observer(n) {
console.log(n)
}
},
level: {
observer(n) {
console.log(n)
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/result/components/emoji/emoji.wxss */
.emoji-panel {
margin: 18rpx 0rpx;
display: flex;
padding: 0rpx 54rpx;
justify-content: space-between;
.emoji-item {
position: relative; z-index: 10;
&:last-child {
&::after {
display: none;
}
}
&.active {
z-index: 10;
.emoji-desc {
font-size: 32rpx;
color: #3275FA;
font-weight: 600;
margin-top: 10rpx;
}
.emoji-img {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: #ffffff;
box-shadow: 0 4rpx 12rpx 0 #b4bccc40;
display: flex;
align-items: center;
justify-content: center;
}
}
&.checked {
&:nth-child(1) {
&::after {
background-image: linear-gradient(90deg, #92DAFF 1%, #84BAFF 100%);
}
}
&:nth-child(2) {
&::after {
background-image: linear-gradient(90deg, #84BAFF 1%, #779DFF 100%);
}
}
&:nth-child(3) {
&::after {
background-image: linear-gradient(90deg, #779DFF 1%, #697AFE 100%);
}
}
&:nth-child(4) {
&::after {
background-image: linear-gradient(90deg, #697AFE 1%, #636DFF 100%);
}
}
.emoji-desc {
color: #292D33;
}
}
&::after {
content: '';
position: absolute;
height: 12rpx;
background: #F2F3F5;
width: 100rpx;
top: 30rpx;
left:54rpx;
z-index: -1;
}
.emoji-img {
width: 80rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
image {
width: 64rpx;
height: 64rpx;
}
}
.emoji-desc {
font-size: 26rpx;
color: #999EA8;
text-align: center;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/aiCheck/result/components/emoji/emoji.wxml-->
<view class="emoji-panel">
<view class="emoji-item {{level>index+1?'checked':level==index+1?'active':''}}" wx:for="{{emojiList}}">
<view class="emoji-img">
<gl-image class="icon" src="/aiCheck/l{{level>=index+1?'c':'s'}}_{{index+1}}.png"></gl-image>
</view>
<view class="emoji-desc">{{item.text}}</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/result/components/fluent/fluent.js
import {
speechEmoji,
toneWords,
speechList,
toneList
} from '../../../contant'
Component({
/**
* 组件的属性列表
*/
properties: {
detailInfo: {
type: Object,
observer: function (n) {
this.getNum()
this.parseJson(n)
}
},
},
/**
* 组件的初始数据
*/
data: {
emojiList: speechEmoji,
level: 3,
star: 3,
lineData: [],
speechList,
areaOptions: {}
},
/**
* 组件的方法列表
*/
methods: {
getNum() {
// 构建一个正则表达式,匹配数组h中每个元素的叠词
const regex = new RegExp(`(${toneWords.map(str => str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')).join('|')})\\1+`, 'g');
console.log(this.data.detailInfo)
const {
fluency: {
redundantWords
}
} = this.data.detailInfo
let words = ''
try {
words = JSON.parse(redundantWords).content
} catch (error) {}
const matches = words.match(regex) || [];
let redundantWordsList = new Map()
matches.forEach((i) => {
const l = i.slice(0, 1);
console.log(l);
const v = redundantWordsList.get(l);
console.log(v);
if (v) {
redundantWordsList.set(l, v + (i.length - 1));
} else {
redundantWordsList.set(l, i.length - 1);
}
});
const positionX = [...redundantWordsList.keys()]
const positionY = [...redundantWordsList.values()];
const wordNum = positionY.reduce((cur, prev) => {
return cur + prev
}, 0)
let star = 5 - Math.ceil(wordNum / 2)
if (star < 1) {
star = 1
}
this.setData({
positionX,
positionY,
wordNum,
star,
words,
content: toneList[star - 1]
})
},
jumpChat() {
const {words,positionX,positionY} = this.data
wx.$router.go("/packageEquity/pages/aiCheck/redundance/redundance", {
words,
positionX,
positionY,
})
},
parseJson(n) {
console.log(n)
if (n.fluency) {
const speechSpeed = JSON.parse(n.fluency.speechSpeed || {})
this.setData({
speechSpeed,
lineData: {
y: speechSpeed.y,
x: speechSpeed.x
},
areaOptions: {
min: speechSpeed.min,
max: speechSpeed.max
}
})
}
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"emoji": "../emoji/emoji",
"line-chat": "../lineChat/lineChat",
"pie-chat": "../pieChat/pieChat"
}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/result/components/fluent/fluent.wxss */
@import "../../common.wxss";
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/aiCheck/result/components/fluent/fluent.wxml-->
<view class="report-panel">
<view class="report-title">语速</view>
<emoji emojiList="{{emojiList}}" level="{{speechSpeed.star}}"></emoji>
<view class="report-content">{{speechList[speechSpeed.star - 1]}}</view>
<line-chat title="语速变化曲线" lineData="{{lineData}}" areaOptions="{{areaOptions}}" ></line-chat>
</view>
<view class="report-panel">
<view class="report-title">冗余词</view>
<view class="scoce-box"><text>{{wordNum}}</text>个</view>
<view class="start-box">
<block wx:for="{{5}}" wx:key="index">
<view class="star {{star>index?'star_1':'star_0'}}"></view>
</block>
</view>
<view class="report-content">{{content}}</view>
<pie-chat bindclick="jumpChat" numData="{{positionY}}" chatData="{{positionX}}"></pie-chat>
</view>
const _ctx_ = Symbol('_ctx_')
const _pixelRatio_ = Symbol('_pixelRatio_')
const _canvas_ = Symbol('_canvas_')
const _params_ = Symbol('_params_')
class DrawLineChart {
[_ctx_] = null;
[_pixelRatio_] = null;
[_canvas_] = null;
[_params_] = null;
maxYNum = null;
currentSegment = 1;
constructor(el, params, componentsThis) {
const query = wx.createSelectorQuery().in(componentsThis)
query.select(el).fields({
node: true,
size: true
}).exec((res) => {
console.log(res)
const canvas = res[0].node,
ctx = canvas.getContext('2d'),
dpr = wx.getSystemInfoSync().pixelRatio,
width = res[0].width * dpr,
height = res[0].height * dpr
canvas.width = width
canvas.height = height
this[_canvas_] = canvas
this[_ctx_] = ctx
this[_pixelRatio_] = dpr
this[_params_] = params
let max = Math.max(...params.data)
if (max < params?.areaData?.max) max = params.areaData.max
this.maxYNum = max + max / 10 || 10
this.drawLine(params.data)
})
}
drawXLine() {
const {
height,
width
} = this[_canvas_],
lineNum = 5
this[_ctx_].lineWidth = this.toRpx(1)
for (let i = 0; i < lineNum; i++) {
const y = height / lineNum * i
this[_ctx_].beginPath()
this[_ctx_].strokeStyle = '#E5E5EF'
this[_ctx_].setLineDash([this.toRpx(6), this.toRpx(4)])
this[_ctx_].moveTo(0, y)
this[_ctx_].lineTo(width, y)
this[_ctx_].stroke()
this[_ctx_].save()
}
this[_ctx_].beginPath()
this[_ctx_].strokeStyle = '#E5E5EF'
this[_ctx_].setLineDash([], 0)
this[_ctx_].moveTo(0, height)
this[_ctx_].lineTo(width, height)
this[_ctx_].stroke()
this[_ctx_].save()
}
drawAreaView() {
const {
height,
width
} = this[_canvas_], {
areaData
} = this[_params_],
min = height - (height / this.maxYNum * (areaData.min || 0)),
max = height - (height / this.maxYNum * (areaData.max || 10))
this[_ctx_].beginPath()
this[_ctx_].fillStyle = '#3275fa1a'
this[_ctx_].fillRect(this.toRpx(4), max, width - this.toRpx(8), min - max)
this[_ctx_].save()
}
drawLine(data) {
const {
height,
width
} = this[_canvas_], {
maxYNum
} = this,
maxXNum = data.length,
curveData = []
for (let i = 0; i < maxXNum; i++) {
curveData.push({
x: width / maxXNum * i + (width / maxXNum / 2),
y: height - (height / maxYNum * data[i])
})
}
this.drawCurve(curveData)
}
drawCurve(curveData, currentSegment = 1) {
const {
width,
height
} = this[_canvas_]
if (currentSegment < curveData.length - 1) {
this[_ctx_].clearRect(0, 0, width, height)
this.drawXLine()
this.drawAreaView()
this[_ctx_].lineWidth = this.toRpx(2)
const gradient = this[_ctx_].createLinearGradient(0, 0, width, 0);
gradient.addColorStop(0, '#51D3F4'); // 起点颜色
gradient.addColorStop(1, '#002EF1'); // 终点颜色
this[_ctx_].strokeStyle = gradient;
this[_ctx_].beginPath();
this[_ctx_].moveTo(curveData[0].x, curveData[0].y);
for (let i = 1; i <= currentSegment; i++) {
const p1 = curveData[i];
const p2 = curveData[i + 1];
const cp1 = {
x: p1.x + (p2.x - p1.x) * 0.5,
y: p1.y
};
const cp2 = {
x: p2.x - (p2.x - p1.x) * 0.5,
y: p2.y
};
this[_ctx_].bezierCurveTo(cp1.x, cp1.y, cp2.x, cp2.y, p2.x, p2.y);
this[_ctx_].shadowOffsetX = 0
this[_ctx_].shadowOffsetY = this.toRpx(8)
this[_ctx_].shadowBlur = this.toRpx(4)
this[_ctx_].shadowColor = '#c5cee080'
}
// 处理最后一个点
if (currentSegment == curveData.length - 2) {
const lastPoint = curveData[curveData.length - 1];
this[_ctx_].lineTo(lastPoint.x, lastPoint.y)
}
this[_ctx_].stroke();
this[_ctx_].restore()
}
currentSegment += 1
// 如果还有未绘制的曲线段,则请求下一帧动画
if (currentSegment <= curveData.length) {
// setTimeout(() => {
this[_canvas_].requestAnimationFrame(() => {
this.drawCurve(curveData, currentSegment)
})
// this.drawCurve(curveData, currentSegment)
// }, 1e3 / 30)
}
}
toRpx(val) {
return this[_pixelRatio_] * val
}
}
export default DrawLineChart
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/detail/components/lineChat/lineChat.js
import DrawLineChart from './DrawLine'
Component({
/**
* 组件的属性列表
*/
properties: {
title: String,
lineData: Object,
areaOptions: {
type: Object,
value: {
min: 2,
max: 4
}
},
maxYNum: {
type: Number,
value: 10
}
},
lifetimes: {
ready() {
const {
lineData,
maxYNum,
areaOptions
} = this.data
new DrawLineChart('#line', {
data: lineData.y,
areaData: areaOptions,
maxYNum
}, this)
}
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/detail/components/lineChat/lineChat.wxss */
.line-chat-box {
width: 638rpx;
height: 436rpx;
background: #F7F8FA;
border-radius: 16rpx;
box-sizing: border-box;
padding: 24rpx;
margin: 24rpx auto 0;
.title {
display: flex;
align-items: center;
font-size: 26rpx;
color: #292D33;
padding-bottom: 24rpx;
.tips {
margin-left: auto;
display: flex;
align-items: center;
font-size: 24rpx;
color: #666666;
line-height: 32rpx;
&::before {
content: '';
width: 24rpx;
height: 12rpx;
background: #E5EDFE;
display: block;
margin-right: 12rpx;
}
}
}
.canvas {
width: 574rpx;
height: 282rpx;
margin: 0 auto;
}
.time-box {
width: 574rpx;
font-size: 24rpx;
color: #999EA8;
text-align: center;
line-height: 32rpx;
margin: 14rpx auto 0;
position: relative;
height:32rpx;
.time-num{
position: absolute;
top: 0;
}
.left{
left: 8rpx;
}
.right{
right: 8rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<view class="line-chat-box">
<view class="title">
{{title}}
<view class="tips">目标范围</view>
</view>
<canvas type="2d" id="line" class="canvas" />
<view class="time-box">
<block wx:for="{{lineData.x}}" wx:key="index">
<block wx:if="{{index == 0 || index == lineData.x.length - 1}}">
<view class="time-num {{index == 0?'left':'right'}}">{{item}}</view>
</block>
</block>
</view>
</view>
\ No newline at end of file \ No newline at end of file
const _ctx_ = Symbol('_ctx_')
const _pixelRatio_ = Symbol('_pixelRatio_')
const _canvas_ = Symbol('_canvas_')
const _params_ = Symbol('_params_')
const PI = Math.PI
class DrawPieChart {
[_ctx_] = null;
[_pixelRatio_] = null;
[_canvas_] = null;
[_params_] = null;
arcInfo = null;
constructor(el, params, componentsThis) {
const query = wx.createSelectorQuery().in(componentsThis)
query.select(el).fields({
node: true,
size: true
}).exec((res) => {
const canvas = res[0].node,
ctx = canvas.getContext('2d'),
dpr = wx.getSystemInfoSync().pixelRatio,
width = res[0].width * dpr,
height = res[0].height * dpr
canvas.width = width
canvas.height = height
this[_canvas_] = canvas
this[_ctx_] = ctx
this[_pixelRatio_] = dpr
this[_params_] = params
this[_ctx_].clearRect(0, 0, width, height)
this.arcInfo = {
x: width / 2,
y: width / 2,
innerRadius: this.toRpx(40),
outerRadius: this.toRpx(60),
lineWidth: this.toRpx(20),
arcRadius: this.toRpx(50)
}
this.drawBackground(params)
})
}
drawBackground(params) {
const {
x,
y,
innerRadius,
outerRadius
} = this.arcInfo
this[_ctx_].beginPath()
this[_ctx_].arc(x, y, innerRadius, 0, 2 * PI)
this[_ctx_].arc(x, y, outerRadius, 0, 2 * PI, true)
this[_ctx_].fillStyle = '#fff'
this[_ctx_].fill()
this[_ctx_].save()
const {
data,
colorList
} = params,
totalSum = data.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
this.drawArc({
data,
colorList
}, totalSum, 0, PI * 1.5)
}
drawArc({
data,
colorList
}, totalSum, index = 0, startAngle) {
const {
x,
y,
lineWidth,
arcRadius
} = this.arcInfo,
gapAngle = data.length == 1 ? 0 : Math.PI / 300
let endAngle = startAngle + (Math.PI * 2 * (data[index] / totalSum)) - gapAngle;
this[_ctx_].beginPath()
this[_ctx_].strokeStyle = colorList[index]
this[_ctx_].lineWidth = lineWidth
this[_ctx_].arc(x, y, arcRadius, startAngle + gapAngle, endAngle)
this[_ctx_].stroke()
this[_ctx_].save()
// 计算扇形中心的角度和坐标
const centerAngle = (startAngle + endAngle) / 2,
textX = x + arcRadius * Math.cos(centerAngle),
textY = y + arcRadius * Math.sin(centerAngle)
// 设置文本样式
const [, font] = this[_ctx_].font.split('px')
this[_ctx_].textBaseline = 'middle';
this[_ctx_].textAlign = 'center';
this[_ctx_].font = `400 ${this.toRpx(14)}px ${font}`
this[_ctx_].fillStyle = '#fff';
// 绘制文本
this[_ctx_].fillText(data[index]?.toString() || '', textX, textY);
index += 1
if (index < data.length) {
this[_canvas_].requestAnimationFrame(() => {
this.drawArc({
data,
colorList
}, totalSum, index, endAngle + gapAngle)
})
}
}
toRpx(val) {
return this[_pixelRatio_] * val
}
}
export default DrawPieChart
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/detail/components/pieChat/pieChat.js
const colorList = ['#5D95FF',
'#63D7E1',
'#5FD190',
'#AED14B',
'#FFB13B',
'#F7CD23',
'#F48670',
'#F8A9DE',
'#D8A2FC',
'#858DFF',
]
import DrawPieChart from './DrawPie'
Component({
/**
* 组件的属性列表
*/
properties: {
numData: Array,
chatData: Array
},
lifetimes: {
ready() {
const {
numData
} = this.data
if (numData.length) new DrawPieChart('#pie', {
data: numData,
colorList
}, this)
}
},
/**
* 组件的初始数据
*/
data: {
colorList
},
/**
* 组件的方法列表
*/
methods: {
click(e) {
const {
item
} = e.currentTarget.dataset
this.triggerEvent('click', item)
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/detail/components/pieChat/pieChat.wxss */
.pie-chat-box {
width: 638rpx;
min-height: 384rpx;
background: #F7F8FA;
border-radius: 16rpx;
box-sizing: border-box;
padding: 24rpx;
margin: 48rpx auto 0;
.title {
font-size: 26rpx;
color: #292D33;
margin-bottom: 16rpx;
}
.pie-box {
display: flex;
align-items: center;
.pie {
width: 240rpx;
height: 240rpx;
background-color: #fff;
margin: 0 58rpx 0 72rpx;
position: relative;
border-radius: 100%;
border: 3rpx solid #FFFFFF;
.text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
font-size: 28rpx;
color: #292D33;
}
.canvas {
width: 240rpx;
height: 240rpx;
}
}
.chat-list {
display: flex;
flex-direction: column;
gap: 16rpx 0;
.chat-item {
display: flex;
align-items: center;
font-size: 24rpx;
color: #292D33;
line-height: 32rpx;
width: 220rpx;
box-sizing: border-box;
padding: 0 20rpx;
.color {
width: 20rpx;
height: 20rpx;
border-radius: 2rpx;
margin-right: 12rpx;
}
.num {
margin-left: 80rpx;
}
}
.hover {
background: rgba(50, 117, 250, .1);
}
}
}
}
.nothing{
display:flex;
align-items: center;
flex-direction: column;
margin: 40rpx auto 0;
}
.good-img {
margin: 0 auto;
width: 128rpx;
height: 131.2rpx;
}
.good-desc {
font-size: 24rpx;
color: #999EA8;
line-height: 32rpx;
margin-top: 30rpx;
}
\ No newline at end of file \ No newline at end of file
<view class="pie-chat-box">
<view class="title">冗余词统计</view>
<view class="pie-box">
<block wx:if="{{chatData.length}}">
<view class="pie">
<canvas type="2d" id="pie" class="canvas"></canvas>
<view class="text">冗余词</view>
</view>
<view class="chat-list">
<block wx:for="{{chatData}}" wx:key="index">
<view class="chat-item" hover-class="hover" bindtap="click" data-item="{{item}}">
<view class="color" style="background-color: {{colorList[index]}};"></view>
{{item}}
<view class="num">{{numData[index]}}</view>
</view>
</block>
</view>
</block>
<block wx:else>
<view class="nothing">
<view class="good-img">
<gl-image class="icon" src="/aiCheck/good.png"></gl-image>
</view>
<view class="good-desc">无冗余词</view>
</view>
</block>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/receptionDetail/components/quality/index.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
Component({
/**
* 组件的属性列表
*/
properties: {
list: {
type: Object,
observer: function (n) {
this.setAudio(0)
this.setData({
isShow: true
})
}
},
avatar: String
},
lifetimes: {
attached() {
wx.$eventbus.on('set_skilled_scroll', n => {
console.log(n>10)
this.setData({isFixed:n>50})
})
},
detached() {
this.onPause()
}
},
/**
* 组件的初始数据
*/
data: {
scrollTop: '',
IMG_URL,
isShow: false,
activeIndex: 0,
qualityAudio: '',
status: ''
},
/**
* 组件的方法列表
*/
methods: {
setAudio() {
this.qualityAudio = wx.createInnerAudioContext({
useWebAudioImplement: true
})
this.qualityAudio.onPause(() => {
this.setData({
status: 'pause'
})
})
//监听音频的播放事件
this.qualityAudio.onPlay(() => {
this.setData({
status: 'start'
})
})
// this.qualityAudio.onTimeUpdate(this.onTimeUpdate)
this.qualityAudio.onEnded(() => {
this.setData({
status: 'ending',
})
})
},
handleShow(e) {
let {
findex,
sindex
} = e.currentTarget.dataset;
let {
activeIndex,
list
} = this.data;
list[activeIndex].conversationDetailList[findex].detailList[sindex].isdown = !list[activeIndex].conversationDetailList[findex].detailList[sindex].isdown
this.setData({
list
})
},
changeClassifyType(e) {
let {
index
} = e.currentTarget.dataset
this.setData({
activeIndex: index,
scrollTop: 0
})
this.onPause()
},
play() {
const {
paused
} = this.qualityAudio
if (paused) this.qualityAudio.play()
},
onPause() {
const {
audioIndex
} = this.data
// this.qualityAudio.pause()
if (this.data[audioIndex]) {
this.data[audioIndex].pause()
}
},
//结束播放
stopAudio() {
const {
audioIndex
} = this.data
if (this.data['ctx_' + audioIndex])
this.data['ctx_' + audioIndex].stop()
},
seek(e) {
let {
url,
index
} = e.currentTarget.dataset;
if (!this.data[index]) {
this.data[index] = wx.createInnerAudioContext()
}
this.data[index].onEnded(() => {
this.setData({
status: 'ending'
})
});
//监听音频的播放事件
this.data[index].onPlay(() => {
this.setData({
status: 'start'
})
})
this.data[index].onPause(() => {
this.setData({
status: 'pause'
})
})
const {
audioIndex,
status
} = this.data
console.log(index, audioIndex)
if (audioIndex) {
this.data[audioIndex].pause()
}
this.setData({
audioIndex: index
})
this.data[index].src = url
this.data[index].play();
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/receptionDetail/components/quality/index.wxss */
.quality-wrap {
.classify-wrap {
display: flex;
align-items: center;
width: 100%;
height: var(--fontSize112);
background: #EDF4FF;
border-radius: var(--fontSize16) var(--fontSize16) 0 0;
&.sticky-box {
position: sticky;
top: 0rpx;
z-index: 999;
}
}
.classify-list {
height: var(--fontSize112);
padding: var(--fontSize16) 0;
box-sizing: border-box;
flex: 1;
text-align: center;
.title {
font-weight: 400;
font-size: var(--fontSize28);
color: #757980;
letter-spacing: 0;
line-height: var(--fontSize40);
}
.score {
font-weight: 600;
font-size: var(--fontSize28);
color: #347BFF;
line-height: var(--fontSize40);
.fail {
color: #F24724;
}
}
}
.active {
background: #FFFFFF;
border-radius: var(--fontSize16) var(--fontSize16) 0 0;
.title {
color: #292D33;
font-weight: 500;
}
}
}
.quality-reception-wrap {
.link-list {
background-color: #fff;
margin-bottom: var(--fontSize24);
border-radius: 0 0 var(--fontSize16) var(--fontSize16);
.link-title {
width: 100%;
height: var(--fontSize80);
display: flex;
align-items: center;
background-image: linear-gradient(93deg, #E1F7FC 0%, #F3F7FF 27%, #F7F2FF 40%, #E8F1FF 65%, #F7F2FF 100%);
font-size: var(--fontSize28);
color: #000000;
font-weight: 500;
border-radius: var(--fontSize16) var(--fontSize16) 0 0;
}
}
}
.link-title {
.dot {
width: var(--fontSize8);
height: var(--fontSize8);
background: #000000;
border-radius: 50%;
margin: 0 var(--fontSize16) 0 var(--fontSize24);
}
.score {
font-weight: 600;
font-size: var(--fontSize28);
color: #347BFF;
margin-left: var(--fontSize16);
}
.fail {
font-weight: 500;
font-size: var(--fontSize24);
color: #F24724;
margin: 0 var(--fontSize44) 0 auto;
}
.failStage {
color: #F24724;
}
.success {
font-weight: 500;
font-size: var(--fontSize24);
color: #35C376;
margin: 0 var(--fontSize44) 0 auto;
}
}
.quality-content {
height: auto;
background-color: #fff;
border-radius: 0 0 var(--fontSize16) var(--fontSize16);
.content {
position: relative;
width: 100%;
height: auto;
display: flex;
align-items: center;
padding: var(--fontSize24) var(--fontSize74) var(--fontSize24) var(--fontSize16);
box-sizing: border-box;
margin-bottom: var(--fontSize12);
.trumpet-box {
width: var(--fontSize40);
height: var(--fontSize40);
border-radius: 50%;
position: absolute;
right: var(--fontSize20);
margin: 0 auto;
}
.trumpet {
width: var(--fontSize40);
height: var(--fontSize40);
}
}
.text {
font-weight: 400;
font-size: var(--fontSize28);
color: #292D33;
margin-left: var(--fontSize16);
}
.left {
position: relative;
.avatar {
width: var(--fontSize80);
height: var(--fontSize80);
border-radius: 50%;
}
.duration {
position: absolute;
top: var(--fontSize70);
left: 50%;
transform: translateX(-50%);
padding: 0 var(--fontSize9);
height: var(--fontSize28);
background: #FFFFFF;
border: var(--fontSize2) solid #F0F6FF;
border-radius: var(--fontSize28);
font-size: var(--fontSize20);
color: #999EA8;
}
}
}
.hit {
background: #F0F6FF;
margin-bottom: 0 !important;
}
.hit-content {
width: 100%;
background: #F5F5F5;
.matching {
display: flex;
font-size: var(--fontSize24);
color: #B38442;
height: var(--fontSize80);
align-items: center;
padding: var(--fontSize12) var(--fontSize24);
box-sizing: border-box;
.title {
display: flex;
align-items: center;
justify-content: center;
width: var(--fontSize172);
height: var(--fontSize56);
background-image: linear-gradient(90deg, #ff8e0c1a 0%, #ffba7b1a 100%);
border-radius: var(--fontSize28);
margin-right: var(--fontSize8);
.arrow {
width: var(--fontSize36);
height: var(--fontSize36);
transition: all .25s;
}
}
.score {
font-weight: 600;
margin-left:var(--fontSize8);
}
}
}
.verbal-warp {
padding: var(--fontSize24) var(--fontSize28);
background: #FFFFFF;
border-radius: var(--fontSize16);
margin: 0 var(--fontSize24);
.title {
display: flex;
align-items: center;
font-weight: 500;
font-size: var(--fontSize28);
color: #333333;
margin-bottom: var(--fontSize20);
.improve {
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize12);
}
}
.suggest-content {
font-weight: 400;
font-size: var(--fontSize26);
color: #292D33;
line-height: var(--fontSize44);
white-space: pre-wrap;
}
}
.exercise {
display: flex;
align-items: center;
justify-content: center;
color: #347BFF;
font-size: var(--fontSize26);
font-weight: 500;
padding: var(--fontSize20) 0;
.improve {
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize8);
}
}
.line {
width: 100%;
height: var(--fontSize2);
background: #EDEDED;
margin-bottom: var(--fontSize24);
}
.more {
width: var(--fontSize296);
height: var(--fontSize56);
border: var(--fontSize1) solid #C3C3C3;
border-radius: 26rpx;
text-align: center;
line-height: var(--fontSize56);
margin: 0 auto;
color: #757980;
font-size: var(--fontSize24);
}
.no-hit-content {
padding-bottom:var(--fontSize24);
.verbal-warp {
background: #FAFAFA;
margin-top: var(--fontSize24);
}
}
.empty-box {
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
width: var(--fontSize646);
height: var(--fontSiz124);
opacity: 0.6;
background: #FFFFFF;
border-radius: var(--fontSize16);
padding: var(--fontSize24) 0;
.no-data-img {
width: var(--fontSize76);
height: var(--fontSize76);
}
.list-not-text {
font-weight: 400;
font-size: var(--fontSize24);
color: #8A8C90;
margin-left: var(--fontSize16);
}
}
.no-data {
text-align: center;
padding-top: var(--fontSize128);
}
.no-data-img {
width: var(--fontSize172);
height: var(--fontSize172);
}
.list-not {
font-size: var(--fontSize24);
text-align: center;
color: #999EA8;
}
.axis-active {
.appeal-disabled {
display: block !important;
}
}
.more-bg{
padding:var(--fontSize24) 0;
background-color: #fff;
}
.pd2{
padding-bottom:var(--fontSize24);
.matching {
height: auto;
.arrow {
transform: rotate(90deg);
}
.content-box {
animation: move-up .2s forwards;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/receptionDetail/components/quality/index.wxml-->
<view class="quality-wrap">
<block wx:if="{{isShow}}">
<view class="classify-wrap {{isFixed?'sticky-box':''}}">
<view class="classify-list {{activeIndex==index?'active':''}}" wx:for="{{list}}" data-index="{{index}}" bind:tap="changeClassifyType">
<view class="title">{{item.stage}}</view>
<view class="score"><text class="{{(item.totalGetScore/item.totalScore)<0.5?'fail':''}}">{{item.totalGetScore||item.totalGetScore===0?item.totalGetScore:'-'}}</text>/{{item.totalScore||item.totalScore===0?item.totalScore:'-'}}</view>
</view>
</view>
<view scroll-y class="quality-reception-wrap">
<block wx-if="{{list[activeIndex].conversationDetailList.length}}">
<view class="link-list" wx:for="{{list[activeIndex].conversationDetailList}}" wx:for-item='i' wx:for-index='ind' wx:key='ind'>
<view class="link-title">
<view class="dot"></view>{{i.firstClassify}}-{{i.secondClassify}} <view class="score"><text class="{{(i.score/i.rawScore)<0.5?'failStage':''}}">{{i.score||i.score===0?i.score:'-'}}</text>/{{i.rawScore||i.rawScore?i.rawScore:'-'}}</view>
<view class="{{i.detailList?'success':'fail'}}">{{i.detailList?'意图匹配':'意图不匹配'}}</view>
</view>
<view class="quality-content">
<blcok wx:for="{{i.detailList}}" wx:for-item="c" wx:for-index='cind' wx:key='cind'>
<view class="content {{c.hit?'hit':''}}">
<view class="left">
<gl-image class="avatar" wx:if="{{c.role==2}}" webp src="/equity/reception/role-1.png" />
<image class="avatar" wx:else webp src="{{avatar}}" ></image>
<view class="duration">{{c.time}}</view>
</view>
<view class="text">{{c.content}}</view>
<view class="trumpet-box" wx:if="{{c.hit && c.role == 2}}">
<gl-image class="trumpet" wx:if="{{audioIndex == activeIndex+'-'+ind +'-'+cind && status == 'start'}}" webp src="/equity/stop.png" data-index="{{activeIndex+'-'+ind +'-'+cind}}" data-url="{{c.voiceUrl}}" bind:tap="onPause"/>
<gl-image class="trumpet" wx:else webp src="/equity/play.png" data-index="{{activeIndex+'-'+ind +'-'+cind}}" data-url="{{c.voiceUrl}}" bind:tap="seek" />
</view>
</view>
<view class="hit-content {{c.isdown?'pd2':''}}" wx:if="{{c.hit}}">
<view class="matching" bind:tap="handleShow" data-fIndex="{{ind}}" data-sIndex="{{cind}}">
<view class="title"> 意图匹配
<gl-image class="arrow" webp src="/equity/reception/suggestions-arrow.png" />
</view>
<view>{{i.firstClassify}}/{{i.secondClassify}}<text class="score">{{i.score}}分</text></view>
</view>
<block wx:if="{{c.isdown}}">
<view class="line"></view>
<view class="verbal-warp" wx:if="{{i.suggestions}}">
<view class="title">
<gl-image class="improve" webp src="/improve.png" />话术建议
</view>
<view class="suggest-content">{{i.suggestions}}</view>
<!-- <rich-text class="suggest-content" nodes="{{c.suggestions}}"></rich-text> -->
</view>
<view class="empty-box" wx:else>
<image class="no-data-img" src="{{IMG_URL}}empty_data.png" />
<view class="list-not-text">暂无数据</view>
</view>
<!-- <view class="exercise">
<gl-image class="improve" webp src="/improve.png" />快速练习
</view> -->
</block>
</view>
</blcok>
<view class="no-hit-content" wx:if="{{!i.detailList}}">
<view class="verbal-warp" wx:if="{{i.suggestions}}">
<view class="title">
<gl-image class="improve" webp src="/improve.png" />话术建议
</view>
<!-- <rich-text class="suggest-content" nodes="{{i.suggestions}}"></rich-text> -->
<view class="suggest-content">{{i.suggestions}}</view>
<!-- <text class="suggest-content">{{i.suggestions}}</text> -->
</view>
<view class="empty-box" wx:else>
<image class="no-data-img" src="{{IMG_URL}}empty_data.png" />
<view class="list-not-text">暂无数据</view>
</view>
<!-- <view class="exercise" bind:tap="practiceHandle">
<gl-image class="improve" webp src="/improve.png" />快速练习
</view> -->
</view>
<!-- <view class="more" wx:if="{{i.detailList}}" bind:tap="lookMore" data-fIndex="{{ind}}">查看更多</view> -->
</view>
</view>
</block>
<block wx:else>
<view class="no-data">
<gl-image class="no-data-img" webp src="/equity/empty.png" />
<view class="list-not">分析中,稍等...</view>
</view>
</block>
</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/result/components/sale/sale.js
import {saleEmoji} from '../../../contant'
Component({
/**
* 组件的属性列表
*/
properties: {
detailInfo: {
type: Object,
observer: function (n) {
this.setData({
defenceDetail:n.defenceScriptCheck
})
}
},
avatar:String
},
/**
* 组件的初始数据
*/
data: {
emojiList: saleEmoji,
level:3,
score:80.5,
star:3,
content:'您在处理客户针对延保产品的异议时展示出了一定的专业性,能够通过举例来说服客户!',
isShow:true,
activeIndex:0,
list:{
detailList:[
{
defScore:6
},
{
defScore:6
},
{
defScore:6
},
{
defScore:6
},
{
defScore:6
}
]
}
},
/**
* 组件的方法列表
*/
methods: {
changeAttackType(e) {
let {
index
} = e.currentTarget.dataset
this.setData({
activeIndex: index
})
},
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"emoji":"../emoji/emoji"
}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/result/components/sale/sale.wxss */
@import "../../common.wxss";
/* packageEquity/pages/receptionDetail/components/attack/index.wxss */
.attack-bout {
height: var(--fontSize112);
border-radius: var(--fontSize16) var(--fontSize16) 0 0;
display: flex;
align-items: center;
.attack-list {
max-width: 33%;
flex: 1;
flex-shrink: 0;
height: var(--fontSize112);
padding: var(--fontSize16) 0;
box-sizing: border-box;
text-align: center;
border-radius: 0 0 0 var(--fontSize16);
background: #EDF4FF;
.title {
font-weight: 400;
font-size: var(--fontSize28);
color: #757980;
letter-spacing: 0;
line-height: var(--fontSize40);
}
.score {
font-weight: 600;
font-size: var(--fontSize28);
color: #347BFF;
line-height: var(--fontSize40);
text {
font-size: var(--fontSize20);
font-weight: 500;
}
}
}
.active {
background: #FFFFFF;
border-radius: var(--fontSize16) var(--fontSize16) 0 0;
.title {
color: #292D33;
font-weight: 500;
}
}
}
.no-data {
text-align: center;
padding-top: var(--fontSize128);
}
.no-data-img {
width: var(--fontSize172);
height: var(--fontSize172);
}
.list-not {
font-size: var(--fontSize24);
text-align: center;
color: #999EA8;
}
.scroll-view {
width: var(--fontSize694);
background: #EDF4FF;
height: var(--fontSize112);
}
.attach-list-scroll {
.attack-list {
width: var(--fontSize156);
flex: none;
}
}
.attack-list {
padding: var(--fontSize32);
background:#fff;
border-radius: 16rpx;
.question {
display: flex;
align-items: center;
margin-bottom: var(--fontSize32);
.avatar {
width: var(--fontSize80);
height: var(--fontSize80);
margin-right: var(--fontSize16);
}
.content {
flex:1;
padding: var(--fontSize16) var(--fontSize24);
background: #F7F8FA;
border-radius: var(--fontSize16);
font-weight: 400;
font-size: var(--fontSize30);
color: #333333;
letter-spacing: 0;
line-height: var(--fontSize44);
}
}
.answer {
padding: var(--fontSize24);
height: auto;
background-image: linear-gradient(127deg, #F0FCFF 0%, #F0F5FF 51%, #F8F5FF 100%);
border-radius: var(--fontSize20);
.content {
font-weight: 500;
font-size: var(--fontSize30);
color: #333333;
letter-spacing: 0;
line-height: var(--fontSize44);
margin-bottom: var(--fontSize16);
}
}
}
.chat-item-right-text {
background-color: #FFFFFF;
border-radius: 16rpx;
padding: 24rpx 28rpx;
margin-top: 24rpx;
.title {
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
color: #333333;
.suggest-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
}
}
.text {
margin-top: 12rpx;
font-weight: 400;
font-size: 26rpx;
color: #333333;
letter-spacing: 0;
line-height: 44rpx;
}
.line {
width: 100%;
height: 2rpx;
background-color: #F0F6FF;
margin: 28rpx 0;
}
<!--packageEquity/pages/aiCheck/result/components/sale/sale.wxml-->
<view class="report-panel">
<view class="report-title">销售技巧</view>
<emoji emojiList="{{emojiList}}" level="{{detailInfo.star}}"></emoji>
</view>
<view class="report-panel other-bg">
<view class="report-title">攻防得分</view>
<view class="scoce-box"><text>{{detailInfo.defenceScriptCheck.avgDefence}}</text>/100</view>
<view class="start-box">
<block wx:for="{{5}}" wx:key="index">
<view class="star {{detailInfo.star>index?'star_1':'star_0'}}"></view>
</block>
</view>
<view class="report-content">{{detailInfo.defenceScriptCheck.summary}}</view>
</view>
<view class="attack-wrap">
<block wx:if="{{isShow}}">
<block wx:if="{{defenceDetail&&defenceDetail.aiSparringDefencecScriptDetailList&&defenceDetail.aiSparringDefencecScriptDetailList.length>0}}">
<scroll-view scroll-x class="scroll-view" wx:if="{{defenceDetail.aiSparringDefencecScriptDetailList.length>0}}">
<view class="attack-bout {{defenceDetail.aiSparringDefencecScriptDetailList.length>4?'attach-list-scroll':''}}">
<view class="attack-list {{activeIndex==index?'active':''}}" wx:for="{{defenceDetail.aiSparringDefencecScriptDetailList}}" data-index="{{index}}" bind:tap="changeAttackType">
<view class="title">攻防回合{{index+1}}</view>
<view class="score">{{ item.defScore ? item.defScore : "-" }}<text>分</text></view>
</view>
</view>
</scroll-view>
</block>
<block wx:else>
<view class="no-data">
<gl-image class="no-data-img" webp src="/equity/empty.png" />
<view class="list-not">分析中,稍等...</view>
</view>
</block>
</block>
</view>
<view class="attack-list">
<view class="question">
<image class="avatar" webp src="{{avatar}}" ></image>
<view class="content">{{defenceDetail.aiSparringDefencecScriptDetailList[activeIndex].question}}</view>
</view>
<view class="answer">
<view class="content">{{defenceDetail.aiSparringDefencecScriptDetailList[activeIndex].answer}}</view>
<view class="chat-item-right-text">
<view class="suggest">
<view class="title">
<gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image>
改进建议
</view>
<view class="text">{{defenceDetail.aiSparringDefencecScriptDetailList[activeIndex].suggestionsForImprovement}}</view>
</view>
<view class="line"></view>
<view class="polish">
<view class="title">
<gl-image class="suggest-icon" src="/aiCheck/polish-icon.png"></gl-image>
润色表达
</view>
<view class="text">
<rich-text nodes="{{defenceDetail.aiSparringDefencecScriptDetailList[activeIndex].refineTheExpression}}"></rich-text>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/result/components/skilled/skilled.js
import {
skilledEmoji,
familiarList
} from '../../../contant'
Component({
/**
* 组件的属性列表
*/
properties: {
detailInfo: {
type: Object,
observer: function (n) {
this.initData(n)
}
},
scrollTop: {
type: Number,
observer: function (n) {
this.setFixed(n>10)
}
},
avatar: String
},
/**
* 组件的初始数据
*/
data: {
familiarList,
emojiList: skilledEmoji,
level: 3,
star: 3,
sort: ['接待环节', '车辆交付', '需求挖掘', '促成交'],
list: []
},
/**
* 组件的方法列表
*/
methods: {
setFixed(isFixed) {
},
initData(n) {
let data = n.inspectionConversationCheck
data.aiSparringCheckDetailDTOList.forEach(item => {
item.stage = item.stage.slice(0, 4)
if (item.stage == '结束环节') {
item.stage = '促成交'
}
item.conversationDetailList = []
data.conversationDetailList.forEach(con => {
con.suggestions = con.suggestions ? con.suggestions.replace(/<\/br>/g, '\n') : ''
if (con.suggestions == '-') con.suggestions = ''
if (con.detailList && con.detailList.length) {
con.detailList.forEach(detail => {
detail.time = this.formatTime(detail.mergedOffset)
if (detail.id == con.detail.id) {
detail.hit = true
detail.isdown = false
}
})
}
con.firstClassify = con.firstClassify.slice(0, 4)
if (con.firstClassify == '结束环节') {
con.firstClassify = '促成交'
}
if (con.firstClassify.indexOf(item.stage) != -1) {
item.conversationDetailList.push(con)
}
})
})
this.setData({
list: data.aiSparringCheckDetailDTOList,
// isShow:true
}, () => {
this.handleSort()
})
},
handleSort() {
let {
list,
sort
} = this.data;
list.sort((a, b) => {
// 找到a和b在predefinedOrder中的索引
let indexA = sort.indexOf(a.stage);
let indexB = sort.indexOf(b.stage);
// 如果索引相同,则元素相等,返回0
if (indexA === indexB) {
return 0;
}
// 如果a的索引小于b的索引,则a应该排在b前面,返回-1
if (indexA < indexB) {
return -1;
}
// 否则,b应该排在a前面,返回1
return 1;
});
this.setData({
list
})
},
formatTime(num) {
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"emoji":"../emoji/emoji",
"quality": "../quality/index"
}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/result/components/skilled/skilled.wxss */
@import "../../common.wxss";
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/aiCheck/result/components/skilled/skilled.wxml-->
<view class="report-panel">
<view class="report-title">熟练度</view>
<emoji emojiList="{{emojiList}}" level="{{detailInfo.star}}"></emoji>
</view>
<view class="report-panel other-bg">
<view class="report-title">质检得分</view>
<view class="scoce-box"><text>{{detailInfo.inspectionConversationCheck.score}}</text>/100</view>
<view class="start-box">
<block wx:for="{{5}}" wx:key="index">
<view class="star {{detailInfo.star>index?'star_1':'star_0'}}"></view>
</block>
</view>
<view class="report-content">{{familiarList[detailInfo.star - 1]}}</view>
</view>
<quality list="{{list}}" avatar="{{avatar}}"></quality>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/detail/detail.js
Page({
/**
* 页面的初始数据
*/
data: {
markList: ['销售技巧', '流利度', '语音表达', '熟练度', '服务态度'],
markIndex: 1,
},
onScroll(e) {
if(this.data.title == '熟练度')
wx.$eventbus.emit('set_skilled_scroll',e.detail.scrollTop)
},
handleMark(e) {
const {
item
} = e.target.dataset;
this.setData({
title: item.reportItem,
scrollTop:0
})
setTimeout(()=>{
this.setData({
scrollTop:0
})
},300)
},
again() {
const {
id,
entry
} = this.data;
if (id) {
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/scene/scene`,
});
} else if(entry == 'other'){
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/scene/scene`,
});
} else {
wx.navigateBack({
delta: 2,
});
}
},
back() {
wx.$router.back();
},
backHome() {
const pages = getCurrentPages();
const prevPage = pages[pages.length - 3];
const {entry} = this.data
if(entry == 'other'){
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/start/start`,
});
return
}
if (prevPage.route == "packageEquity/pages/aiCheck/start/start") {
wx.navigateBack({
delta: 2,
});
prevPage.setData({
tabIndex: 1
});
} else {
wx.navigateBack({
delta: 3,
});
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$router.getData(({
reportItem,
currentItem,
id,
avatar,
entry
}) => {
console.log(currentItem)
// this.setTitle(0);
const {
markList
} = this.data
// 使用 filter 方法代替 find 方法
const reportItems = markList.map(item => reportItem.find(report => report.reportItem === item) || null);
this.setData({
id,
reportItems,
avatar,
entry,
title: currentItem.reportItem
});
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"sale":"./components/sale/sale",
"fluent":"./components/fluent/fluent",
"deliver":"./components/deliver/deliver",
"skilled":"./components/skilled/skilled",
"attitude":"./components/attitude/attitude"
},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/detail/detail.wxss */
page {
overflow:hidden;
}
.bg {
box-sizing: border-box;
width: 100%;
height: 800rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/aiCheck/resultBg.png') no-repeat;
background-size: 100%;
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
page {
background-color: #FAFAFA;
}
.navigation-title {
text-align: center;
}
.navigation-header .navigation-bar {
background-color: transparent;
box-shadow: none;
/* color: #fff; */
}
.mark-box {
display: grid;
grid-template-columns: repeat(5, 1fr);
margin-top: 180rpx;
height: 80rpx;
line-height:80rpx;
.mark-item {
text-align: center;
font-size: 28rpx;
color: #757980;
&.checked {
color: #292D33;
font-weight: 600;
}
}
}
.scroll-box {
height: calc(100vh - env(safe-area-inset-bottom) - 400rpx);
}
.main-box {
background: #F7F8FA;
border-radius: 32rpx;
padding: 32rpx;
width: 100%;
box-sizing: border-box;
box-sizing: border-box;
}
.footer {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
display: flex;
justify-content: center;
background-color: #fff;
padding: 24rpx 32rpx env(safe-area-inset-bottom);
font-weight: 500;
font-size: 28rpx;
box-sizing: border-box;
.back-home {
background: #F0F6FF;
border-radius: 486rpx;
color: #3989FE;
width: calc( 50% - 20rpx );
line-height: 40px;
height: 80rpx;
text-align: center;
margin-right: 20rpx;
}
.again {
background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
border-radius: 243rpx;
color: #FFFFFF;
width: calc( 50% - 20rpx );
line-height: 80rpx;
height: 80rpx;
text-align: center;
}
}
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/aiCheck/detail/detail.wxml-->
<view class="bg"></view>
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{ true }}" bindback="back">
<view class="navigation-title">
<view class="result-title">
{{title}}
</view>
</view>
</navigation-bar>
<view class="mark-box">
<block wx:for="{{reportItems}}">
<view wx:if="{{item}}" class="mark-item {{title == item.reportItem?'checked':''}}" data-item="{{item}}"
bindtap="handleMark">{{item.reportItem}}</view>
</block>
</view>
<scroll-view class="scroll-box" scroll-y="true" bindscroll="onScroll" scroll-top="{{scrollTop}}">
<view class="main-box">
<!--销售技巧-->
<sale detailInfo="{{reportItems[0]}}" avatar="{{avatar}}" wx:if="{{markList[0] == title && reportItems[0]}}"></sale>
<!--流利度-->
<fluent detailInfo="{{reportItems[1]}}" wx:if="{{markList[1] == title && reportItems[1]}}"></fluent>
<!--语音表达-->
<deliver detailInfo="{{reportItems[2]}}" wx:if="{{markList[2] == title && reportItems[2]}}"></deliver>
<!--熟练度-->
<skilled detailInfo="{{reportItems[3]}}" scrollTop="{{scrollY}}" avatar="{{avatar}}" wx:if="{{markList[3] == title && reportItems[3]}}"></skilled>
<!--服务态度-->
<attitude detailInfo="{{reportItems[4]}}" wx:if="{{markList[4] == title && reportItems[4]}}"></attitude>
</view>
</scroll-view>
<view class="footer" id="footer">
<view class="back-home" bindtap="backHome">返回首页</view>
<view class="again" bindtap="again">再来一次</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/redundance/redundance.js
Page({
/**
* 页面的初始数据
*/
data: {
},
back() {
wx.navigateBack()
},
onLoad() {
wx.$router.getData(val =>{
const {words,positionX,positionY} = val
// 构建一个正则表达式,匹配数组word中每个元素的叠词模式
const regex = new RegExp(`(${positionX.join("|")})\\1+`, "g");
// 使用 replace 方法移除叠词中的第一个
const content = words.replace(regex, (match, p1) =>
p1.repeat(match.length - 1)
);
this.setData({
content,
selectWord:positionX[0],
positionX,
positionY
},()=>{
this.setBold()
})
})
},
handleWord(e) {
const {
word
} = e.target.dataset;
this.setData({
selectWord: word
},()=>{
this.setBold()
})
},
setBold() {
let {content,selectWord} = this.data
console.log(content)
const pattern = new RegExp(selectWord, "g");
// 使用正则表达式替换文本
content = content.replace(/<span style="color:#3989FE;">(.*?)<\/span>/g,'$1').replace(
pattern,
function (match) {
return '<span style="color:#3989FE;">' + match + "</span>";
}
);
this.setData({content})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/redundance/redundance.wxss */
.bg {
box-sizing: border-box;
width: 100%;
height: 800rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/aiCheck/resultBg.png') no-repeat;
background-size: 100%;
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
page {
background-color: #FAFAFA;
}
.navigation-title {
text-align: center;
}
.navigation-header .navigation-bar {
background-color: transparent;
box-shadow: none;
/* color: #fff; */
}
.box {
background: #FFFFFF;
border-radius: 32rpx;
padding: 32rpx;
position: absolute;
top: var(--fontSize180);
width: 100%;
box-sizing: border-box;
height: calc(100vh - var(--fontSize180));
.word-box {
display: flex;
gap: 0 12rpx;
.word-item {
width: 120rpx;
height: 60rpx;
text-align:center;
line-height: 60rpx;
background: #F7F8FA;
border-radius: 8rpx;
font-size: 28rpx;
color: #5A5E66;
&.checked {
background: #347bff1a;
color: #3275FA;
}
}
}
.content-box {
color: #333333;
font-size: 30rpx;
line-height: 56rpx;
margin-top: 32rpx;
}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/aiCheck/redundance/redundance.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/aiCheck/redundance/redundance.wxml-->
<view class="bg"></view>
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{ true }}" bindback="back">
<view class="navigation-title">
<view class="result-title">
冗余词
</view>
</view>
</navigation-bar>
<view class="box">
<view class="word-box">
<view class="word-item {{selectWord==item?'checked':''}}" data-word="{{item}}" bindtap="handleWord" wx:for="{{positionX}}">
{{item}}
{{positionY[index]}}
</view>
</view>
<view class="content-box">
<rich-text nodes="{{content}}"></rich-text>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -9,68 +9,70 @@ ...@@ -9,68 +9,70 @@
</view> </view>
</view> </view>
</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 + 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}} {{score == null?'pending':''}}">
<gl-image class="score-bg" src="/aiCheck/score-bg1.png"></gl-image> <view style="position: relative;">
<canvas canvas-id="radarCanvas" disable-scroll="{{true}}" class="canvas canvas2"></canvas> <view class="canvas-view">
<view class="categories-1"> <block wx:if="{{radarImg}}">
<view class="title">销售技巧</view> <image src="{{radarImg}}" class="canvas Img" />
<block wx:for="{{star}}" wx:key="index"> </block>
<gl-image class="star" src="/aiCheck/star-{{item}}.png"></gl-image> <block wx:else>
</block> <view class="loading-box"></view>
</view> <canvas canvas-id="radarCanvas" disable-scroll="{{true}}" class="canvas hide-canvas"></canvas>
<view class="categories-2"> </block>
<view class="title">流利度</view> </view>
<block wx:for="{{star1}}" wx:key="index">
<gl-image class="star" src="/aiCheck/star-{{item}}.png"></gl-image>
</block>
</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>
<block wx:for="{{reportItem}}" wx:key="index">
<view class="categories categories-{{index + 1}}" bindtap="jump" data-item="{{item}}">
<view class="title">{{item.reportItem}}</view>
<block wx:if="{{score == null && item.reportItem == '服务态度'}}">
<view class="pending-text">分析中...</view>
</block>
<block wx:else>
<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>
</block>
</view>
<view class="tips">
<gl-image class="icon-tips" src="/aiCheck/icon-tips.png"></gl-image>
点击各项指标可查看详细分析报告
</view> </view>
<view class="report-box"> <view class="report-box">
<view class="score-box"> <view class="score-box">
<view>总得分</view> <view class="score-item">
<view class="score"> <view>总得分</view>
<view class="score-num">{{detailInfo.score}}</view> <view class="score" wx:if="{{score != null}}">
/100 <view class="score-num">{{score || 0}}</view>
</view> /100
</view> </view>
<view class="report-content"> <view wx:else class="no-score">计算中...</view>
<view class="report-item"> <text class="score-tips">90%的使用者在\n75-85之间</text>
<gl-image class="report-icon" src="/aiCheck/time-icon.png"></gl-image>
<view class="report-text">本次销售能力模拟评测时长:{{duration}}</view>
</view>
<view class="report-item">
<gl-image class="report-icon" src="/aiCheck/like-icon.png"></gl-image>
<view class="report-text">非常棒,亢余词占比低于4%,能让语言表达更加直接和简洁。</view>
</view> </view>
<view class="report-item"> <view class="score-item">
<gl-image class="report-icon" src="/aiCheck/edit-icon.png"></gl-image> <view>练习时长</view>
<view class="report-text">{{detailInfo.summary}}</view> <view class="score">
<view class="score-num">{{minutes}}</view>
分
<view class="score-num">{{seconds}}</view>
秒
</view>
<text class="score-tips">80%的使用者在\n1分30秒-3分10秒之间</text>
</view> </view>
</view> </view>
</view> <view class="circle-box">
<view class="footer" id="footer"> <view class="center box-center">对练总结</view>
<view class="back-home" bindtap="backHome">返回首页</view> <view class="circle-bg box-center"></view>
<view class="again" bindtap="again">再来一次</view> <block wx:for="{{descriptionList}}" wx:key="index">
<view class="circle-item {{item.dialogueItem != '敏感词'?'':'red'}} {{item.className}}" style="top:{{item.y + 'rpx'}};left:{{item.x + 'rpx'}}">
<view class="circle-title">{{item.dialogueItem}}</view>
<view class="circle-depict" wx:if="{{item.description}}">{{item.description}}</view>
</view>
</block>
</view>
</view> </view>
</block> </block>
<block wx:else> <block wx:else>
...@@ -95,12 +97,30 @@ ...@@ -95,12 +97,30 @@
<view class="chat-item-right" wx:else> <view class="chat-item-right" wx:else>
<view class="chat-content">{{item.content}}</view> <view class="chat-content">{{item.content}}</view>
<view class="chat-item-right-text"> <view class="chat-item-right-text">
<view class="chat-aspect" wx:if="{{item.speed}}">
<view class="aspect-item">
<view class="aspect-name">语速</view>
<view class="aspect-result">{{item.speed || '无'}}</view>
</view>
<view class="aspect-item">
<view class="aspect-name">语调</view>
<view class="aspect-result">{{item.intonation || '无'}}</view>
</view>
<view class="aspect-item">
<view class="aspect-name">清晰度</view>
<view class="aspect-result">{{item.definition || '无'}}</view>
</view>
<view class="aspect-item">
<view class="aspect-name">冗余词</view>
<view class="aspect-result">{{item.redundant || '无'}}</view>
</view>
</view>
<view class="suggest"> <view class="suggest">
<view class="title"> <view class="title">
<gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image> <gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image>
改进建议 改进建议
</view> </view>
<view class="text">{{item.suggestions_for_improvement}}</view> <view class="text">{{item.suggestions_for_improvement || item.improve || '无'}}</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="polish"> <view class="polish">
...@@ -109,7 +129,7 @@ ...@@ -109,7 +129,7 @@
润色表达 润色表达
</view> </view>
<view class="text"> <view class="text">
<rich-text nodes="{{item.refine_the_expression}}"></rich-text> <rich-text nodes="{{item.refine_the_expression || item.polish || '无'}}"></rich-text>
</view> </view>
</view> </view>
</view> </view>
...@@ -117,4 +137,11 @@ ...@@ -117,4 +137,11 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view>
\ No newline at end of file \ No newline at end of file
</view>
<block wx:if="{{tabId == 1}}">
<view class="footer" id="footer">
<view class="back-home" bindtap="backHome">返回首页</view>
<view class="again" bindtap="again">再来一次</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiCheck/scene/scene.js // packageEquity/pages/aiCheck/scene/scene.js
import carLifeApi from '../../../carEquityApi' import carLifeApi from '../../../carEquityApi'
import {
setConfigInfo
} from "~/store/index";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
show:false, show: false,
selectedIndex: 0, selectedIndex: 0,
customeTypeList: [], customeTypeList: [],
navBarHeight: 0,
footerHeight: 0,
text: '好胜心强,容易固执已见,建议多以<span class="blue">肯定、迎合</span>的话进行对练!',
step: 'reception',
stepName: '接待',
linkChainList: [{
id: 1,
name: '接待',
iconUrl: 'icon-reception',
type: 'reception',
suggest: '此环节模拟交付专员把客户介绍给驻店专员,建议使用敬语,尊称客户,恭喜客户提车,主动向客户介绍工作环节并进行自我介绍!'
},
{
id: 2,
name: '车辆交付',
iconUrl: 'icon-car',
type: 'delivery',
suggest: '此环节模拟驻店专员已完成对于客户的接待,即将向客户介绍新车使用注意事项、保养要求和基础质保政策,建议在介绍过程中主动了解客户的用车周期,用车环境,给介绍延保产品时进行铺垫!'
},
{
id: 3,
name: '需求挖掘',
iconUrl: 'icon-demand',
type: 'defense',
suggest: '此环节模拟驻店专员已完成了新车使用、保养要求和基础质保政策的介绍,即将向客户介绍延保产品,此环节容易触发攻防,建议多以延保相对基础质保的优势,当天购买价格有优惠,大部分客户均选择购买等为主进行推荐!'
},
{
id: 4,
name: '促成交',
iconUrl: 'icon-dear',
type: 'referral',
suggest: '此环节模拟驻店专员已完成了延保产品的介绍,即将根据客户是否展示购买意愿进行话术演练,建议对明显展示不想购买意愿的客户使用逼单话术进行进一步沟通!'
}
],
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
}) })
const {
isDemo
} = this.data
this.aiAudio.src = isDemo ? this.data.customeTypeList[e.currentTarget.dataset.index].roleVoiceHs : 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) {
const {
name,
type
} = e.currentTarget.dataset
this.setData({
step: type,
stepName: name
})
}, },
// 头部返回上一级 // 头部返回上一级
back() { back() {
...@@ -21,34 +88,74 @@ Page({ ...@@ -21,34 +88,74 @@ Page({
}, },
// 开始练习 // 开始练习
startPractice() { startPractice() {
this.setData({show:!this.data.show}) this.setData({
show: !this.data.show
})
}, },
jump() { jump() {
const {selectedIndex,customeTypeList} = this.data const {selectedIndex,customeTypeList,stepName, step, linkChainList,isDemo,entry} = this.data
const {avatar,roleName,roleType,attackScript,roleDetail,languageStyle} = customeTypeList[selectedIndex] const { roleType } = customeTypeList[selectedIndex]
const sex = /性别:男/.test(roleDetail)?1:0 const { suggest } = linkChainList.find(item => item.type == step)
console.log(roleType, stepName, suggest,isDemo)
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}&suggest=${suggest}&isDemo=${isDemo}&entry=${entry}`
}) })
this.setData({show:false}) this.setData({
show: false
})
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
wx.createSelectorQuery().select('#footer').boundingClientRect(rect => {
this.setData({
footerHeight: rect.height
})
}).exec()
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { async onLoad(options) {
const {stage} = options;
if(stage) {
await 1
const {linkChainList} = this.data;
const findChain = linkChainList.find((link) => link.name == stage);
this.setData({
stepName: findChain.name,
step: findChain.type,
show:true,
entry:'other'
})
}
const {
aiPhone
} = await setConfigInfo({});
const {
phone
} = wx.$util.getUserInfo()
this.setData({
isDemo: aiPhone.includes(phone)
})
this.getRole() this.getRole()
}, },
getRole() { getRole() {
carLifeApi.sparringRole({ carLifeApi.sparringRole({
currentPage: 1, currentPage: 1,
pageSize: 100, pageSize: 100,
}).then(res=>{ }).then(res => {
const customeTypeList = res.data.list const customeTypeList = res.data.list
customeTypeList.forEach(item=>{ customeTypeList.forEach(item => {
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()
}) })
}, },
...@@ -63,7 +170,10 @@ Page({ ...@@ -63,7 +170,10 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.setData({
step: 'reception',
selectedIndex: 0
})
}, },
/** /**
......
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!