Commit 81f5bec4 by 前端

记录

1 parent 77164386
...@@ -196,17 +196,14 @@ Page({ ...@@ -196,17 +196,14 @@ Page({
}).then(res => { }).then(res => {
let { let {
refine_the_expression, refine_the_expression,
suggestions_for_improvement suggestions_for_improvement,
highlight = ["我"]
} = res; } = 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) { refine_the_expression = refine_the_expression.replace(pattern, function (match) {
return '<text>' + match + '</text>'; return '<p style="color:#3989FE;">' + match + '</p>';
});
suggestions_for_improvement = suggestions_for_improvement.replace(pattern, function (match) {
return '<text>' + match + '</text>';
}); });
const audioBox = this.selectComponent('#audioBox'); const audioBox = this.selectComponent('#audioBox');
audioBox.setList({ audioBox.setList({
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<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}}</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="polish"> <view class="polish">
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<gl-image class="suggest-icon" src="/aiCheck/polish-icon.png"></gl-image> <gl-image class="suggest-icon" src="/aiCheck/polish-icon.png"></gl-image>
润色表达 润色表达
</view> </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> </view>
<view class="operation-box" wx:if="{{index == resetIndex}}"> <view class="operation-box" wx:if="{{index == resetIndex}}">
......
...@@ -97,7 +97,7 @@ Page({ ...@@ -97,7 +97,7 @@ Page({
console.log(res) console.log(res)
this.setData({ this.setData({
detailInfo: res, detailInfo: res,
duration: this.convertSecondsToMinutesAndSeconds(res.duration.replace(/\D+/g,'')), duration: this.convertSecondsToMinutesAndSeconds(res.duration),
star: this.getStar(res.sales_techniques), star: this.getStar(res.sales_techniques),
star1: this.getStar(res.fluency), star1: this.getStar(res.fluency),
star2: this.getStar(res.language_expression), star2: this.getStar(res.language_expression),
...@@ -113,9 +113,14 @@ Page({ ...@@ -113,9 +113,14 @@ Page({
checkResult, checkResult,
sparringContent sparringContent
} = res.data } = res.data
const chatList = JSON.parse(JSON.parse(sparringContent)) try {
this.setData({chatList,duration:8}) const chatList = JSON.parse(JSON.parse(sparringContent))
// this.setDetail(JSON.parse(checkResult)) this.setData({chatList})
this.setDetail(JSON.parse(checkResult))
} catch (error) {
}
}) })
}, },
handleSave(list, result, uuid, batchId) { handleSave(list, result, uuid, batchId) {
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<gl-image class="suggest-icon" src="/aiCheck/polish-icon.png"></gl-image> <gl-image class="suggest-icon" src="/aiCheck/polish-icon.png"></gl-image>
润色表达 润色表达
</view> </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> </view>
</view> </view>
......
...@@ -45,7 +45,7 @@ Component({ ...@@ -45,7 +45,7 @@ Component({
try { try {
i.checkResult = JSON.parse(i.checkResult) i.checkResult = JSON.parse(i.checkResult)
if(i.checkResult.duration) if(i.checkResult.duration)
i.checkResult.duration = i.checkResult.duration.replace(/\D+/g,'') i.checkResult.duration = this.convertSecondsToMinutesAndSeconds(i.checkResult.duration)
} catch (error) { } catch (error) {
} }
}) })
...@@ -56,6 +56,15 @@ Component({ ...@@ -56,6 +56,15 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { 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) { toReport(e) {
const id = e.currentTarget.dataset.id const id = e.currentTarget.dataset.id
wx.navigateTo({ wx.navigateTo({
......
/* packageEquity/pages/aiCheck/start/components/RecordList.wxss */ /* packageEquity/pages/aiCheck/start/components/RecordList.wxss */
.record-list { .record-list {
margin: 40rpx 32rpx; margin: 40rpx 32rpx;
height: calc(100vh - 350rpx);
overflow:auto;
.record-item { .record-item {
display: flex; display: flex;
align-items: center; align-items: center;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!