Commit 81f5bec4 by 前端

记录

1 parent 77164386
......@@ -196,17 +196,14 @@ Page({
}).then(res => {
let {
refine_the_expression,
suggestions_for_improvement
suggestions_for_improvement,
highlight = ["我"]
} = res;
const list = ['是', '说', '都','的']
// 构建正则表达式
const pattern = new RegExp('(' + list.join('|') + ')', 'g');
const pattern = new RegExp('(' + highlight.join('|') + ')', 'g');
// 使用正则表达式替换文本
refine_the_expression = refine_the_expression.replace(pattern, function (match) {
return '<text>' + match + '</text>';
});
suggestions_for_improvement = suggestions_for_improvement.replace(pattern, function (match) {
return '<text>' + match + '</text>';
return '<p style="color:#3989FE;">' + match + '</p>';
});
const audioBox = this.selectComponent('#audioBox');
audioBox.setList({
......
......@@ -54,7 +54,7 @@
<gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image>
改进建议
</view>
<view class="text">{{item.suggestions_for_improvement}}</view>
<view class="text"> {{item.suggestions_for_improvement}}</view>
</view>
<view class="line"></view>
<view class="polish">
......@@ -62,7 +62,7 @@
<gl-image class="suggest-icon" src="/aiCheck/polish-icon.png"></gl-image>
润色表达
</view>
<view class="text">{{item.refine_the_expression}}</view>
<view class="text"><rich-text nodes="{{item.refine_the_expression}}"></rich-text></view>
</view>
</view>
<view class="operation-box" wx:if="{{index == resetIndex}}">
......
......@@ -97,7 +97,7 @@ Page({
console.log(res)
this.setData({
detailInfo: res,
duration: this.convertSecondsToMinutesAndSeconds(res.duration.replace(/\D+/g,'')),
duration: this.convertSecondsToMinutesAndSeconds(res.duration),
star: this.getStar(res.sales_techniques),
star1: this.getStar(res.fluency),
star2: this.getStar(res.language_expression),
......@@ -113,9 +113,14 @@ Page({
checkResult,
sparringContent
} = res.data
const chatList = JSON.parse(JSON.parse(sparringContent))
this.setData({chatList,duration:8})
// this.setDetail(JSON.parse(checkResult))
try {
const chatList = JSON.parse(JSON.parse(sparringContent))
this.setData({chatList})
this.setDetail(JSON.parse(checkResult))
} catch (error) {
}
})
},
handleSave(list, result, uuid, batchId) {
......
......@@ -84,7 +84,7 @@
<gl-image class="suggest-icon" src="/aiCheck/polish-icon.png"></gl-image>
润色表达
</view>
<view class="text">{{item.refine_the_expression}}</view>
<view class="text"><rich-text nodes="{{item.refine_the_expression}}"></rich-text></view>
</view>
</view>
</view>
......
......@@ -45,7 +45,7 @@ Component({
try {
i.checkResult = JSON.parse(i.checkResult)
if(i.checkResult.duration)
i.checkResult.duration = i.checkResult.duration.replace(/\D+/g,'')
i.checkResult.duration = this.convertSecondsToMinutesAndSeconds(i.checkResult.duration)
} catch (error) {
}
})
......@@ -56,6 +56,15 @@ Component({
* 组件的方法列表
*/
methods: {
convertSecondsToMinutesAndSeconds(seconds) {
var minutes = Math.floor(seconds / 60); // 计算分钟数
var remainingSeconds = seconds % 60; // 计算剩余的秒数
// 如果剩余的秒数小于10,则前面添加0以保持格式一致
if (remainingSeconds < 10) {
remainingSeconds = '0' + remainingSeconds;
}
return minutes + '分' + remainingSeconds + '秒'; // 返回转换后的格式
},
toReport(e) {
const id = e.currentTarget.dataset.id
wx.navigateTo({
......
/* packageEquity/pages/aiCheck/start/components/RecordList.wxss */
.record-list {
margin: 40rpx 32rpx;
height: calc(100vh - 350rpx);
overflow:auto;
.record-item {
display: flex;
align-items: center;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!