Commit 5d920132 by 前端

报告

1 parent d466031a
...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd"; ...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 1; let index = 2;
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;
...@@ -89,4 +89,21 @@ export const dsnUrl = ...@@ -89,4 +89,21 @@ 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",
};
\ No newline at end of file \ No newline at end of file
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
data,[],"/rop-dj-pairexc/router" data,[],"/rop-dj-pairexc/router"
); );
}, },
/** /**
* 保存员工趣练记录 * 保存员工趣练记录
*/ */
setSparringSave(data) { setSparringSave(data) {
...@@ -77,4 +77,12 @@ export default { ...@@ -77,4 +77,12 @@ export default {
data,[],"/rop-dj-pairexc/router" 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
...@@ -269,7 +269,10 @@ Page({ ...@@ -269,7 +269,10 @@ Page({
const audioBox = this.selectComponent("#audioBox"); const audioBox = this.selectComponent("#audioBox");
return audioBox.getList(step, defenseIndex); return audioBox.getList(step, defenseIndex);
}, },
//获取灵感建议 /**
* 获取灵感建议
* 如果进入攻防状态(defense),直接拿对应的灵感
*/
getInspiration() { getInspiration() {
const { step, inspirationContent, roleInspiration,attackScript } = this.data; const { step, inspirationContent, roleInspiration,attackScript } = this.data;
console.log(inspirationContent,roleInspiration,'inspirationContent') console.log(inspirationContent,roleInspiration,'inspirationContent')
...@@ -353,14 +356,7 @@ Page({ ...@@ -353,14 +356,7 @@ Page({
round, round,
defense_step, defense_step,
step: next_step, step: next_step,
}, });
() => {
// this.toBottom()
// const l = chatList.length - 1
// const audio_com = this.selectComponent(`#audio_${l}`);
// audio_com.onTtsStart()
}
);
if (next_step == "over") { if (next_step == "over") {
setTimeout(() => { setTimeout(() => {
this.toResult(); this.toResult();
......
...@@ -2,20 +2,24 @@ ...@@ -2,20 +2,24 @@
page { page {
background-color: #F7F8FA; background-color: #F7F8FA;
} }
.font-b { .font-b {
color:#3989FE; color: #3989FE;
} }
.bg-box { .bg-box {
position:fixed; position: fixed;
inset:0; inset: 0;
z-index:-1; z-index: -1;
width: 750rpx; width: 750rpx;
height: 640rpx; height: 640rpx;
background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7F8FA 96%); 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;
...@@ -41,21 +45,26 @@ background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7 ...@@ -41,21 +45,26 @@ background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7
.chat-section { .chat-section {
margin-top: 28rpx; margin-top: 28rpx;
.chat-list { .chat-list {
height: calc(100vh - 400rpx); height: calc(100vh - 400rpx);
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;
...@@ -68,39 +77,46 @@ background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7 ...@@ -68,39 +77,46 @@ background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7
box-sizing: border-box; box-sizing: border-box;
padding: 16rpx 24rpx; padding: 16rpx 24rpx;
} }
.operation {
margin-top:12rpx; .operation {
margin-top: 12rpx;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #3989FE; color: #3989FE;
background: #FFFFFF; background: #FFFFFF;
padding:20rpx 24rpx; padding: 20rpx 24rpx;
max-width: 520rpx; max-width: 520rpx;
.operation-top { border-radius: 16rpx;
width: 180rpx;
height: 56rpx; .operation-top {
background: #EFF5FF; width: 180rpx;
border-radius: 28rpx; height: 56rpx;
display:flex; background: #EFF5FF;
align-items:center; border-radius: 28rpx;
justify-content: center; display: flex;
} align-items: center;
justify-content: center;
}
.suggest-icon { .suggest-icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
margin-right: 12rpx; margin-right: 12rpx;
}
.content {
margin-top:12rpx;
font-size: 30rpx;
color: #333333;
line-height: 44rpx;
}
} }
.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;
...@@ -112,60 +128,69 @@ line-height: 44rpx; ...@@ -112,60 +128,69 @@ line-height: 44rpx;
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;
...@@ -174,11 +199,13 @@ line-height: 44rpx; ...@@ -174,11 +199,13 @@ line-height: 44rpx;
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;
...@@ -190,6 +217,7 @@ line-height: 44rpx; ...@@ -190,6 +217,7 @@ line-height: 44rpx;
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;
...@@ -199,14 +227,17 @@ line-height: 44rpx; ...@@ -199,14 +227,17 @@ line-height: 44rpx;
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-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
}
} }
&.active {
background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
}
}
.speak-btn { .speak-btn {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -219,11 +250,12 @@ line-height: 44rpx; ...@@ -219,11 +250,12 @@ line-height: 44rpx;
color: #3275FA; 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
...@@ -7,6 +7,8 @@ const SpeechSynthesizer = require("~/utils/aliyun/tts") ...@@ -7,6 +7,8 @@ const SpeechSynthesizer = require("~/utils/aliyun/tts")
const sleep = require("~/utils/aliyun/util").sleep const sleep = require("~/utils/aliyun/util").sleep
const formatTime = require("~/utils/aliyun/util").formatTime const formatTime = require("~/utils/aliyun/util").formatTime
const fs = wx.getFileSystemManager() const fs = wx.getFileSystemManager()
import getSignature from '../../upload/signature'
import uploadFile from '../../upload/uploadFile'
let timer = null let timer = null
Component({ Component({
...@@ -42,12 +44,7 @@ Component({ ...@@ -42,12 +44,7 @@ Component({
*/ */
data: { data: {
status: 'end', status: 'end',
list: [{ list: [],
content: '您好,我是您的专属客户经理。这边推荐问界M7。',
role: 2,
times:20,
show:true
}],
audioIndex: '', audioIndex: '',
ttsStart: false, ttsStart: false,
ttsText: "是的发生大客户" ttsText: "是的发生大客户"
...@@ -55,6 +52,7 @@ Component({ ...@@ -55,6 +52,7 @@ Component({
lifetimes: { lifetimes: {
attached() { attached() {
this.connectSr() this.connectSr()
this.getOssSignature()
}, },
detached() { detached() {
this.stopAudio() this.stopAudio()
...@@ -64,6 +62,11 @@ Component({ ...@@ -64,6 +62,11 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
getOssSignature() {
getSignature().then(res => {
this.data.ossOption = res
})
},
async connectSr(options) { async connectSr(options) {
try { try {
this.data.token = await getToken(ALIYUN.AKID, this.data.token = await getToken(ALIYUN.AKID,
...@@ -155,51 +158,53 @@ Component({ ...@@ -155,51 +158,53 @@ Component({
curPage.toBottom() curPage.toBottom()
}, },
setAudio(index, filePath, type) { setAudio(index, filePath, type) {
if(!this.data['ctx_'+index]) if (!this.data['ctx_' + index])
this.data['ctx_'+index] = wx.createInnerAudioContext() this.data['ctx_' + index] = wx.createInnerAudioContext()
const { const {
list, list,
audioIndex, audioIndex,
status status
} = this.data; } = this.data;
if (type) { if (type) {
const idx = list.findIndex(i=>i.id == index) const idx = list.findIndex(i => i.id == index)
list[idx].filePath = filePath; list[idx].filePath = filePath;
this.setData({list}) this.setData({
list
})
this.toBottom() this.toBottom()
} }
console.log(index, audioIndex, status,filePath) console.log(index, audioIndex, status, filePath)
this.data['ctx_'+index].src = filePath; // 替换为你的音频文件路径 this.data['ctx_' + index].src = filePath; // 替换为你的音频文件路径
// 监听播放完成事件 // 监听播放完成事件
const _this = this; const _this = this;
this.data['ctx_'+index].onEnded(() => { this.data['ctx_' + index].onEnded(() => {
_this.setData({ _this.setData({
status: 'ending' status: 'ending'
}) })
console.log('结束...') console.log('结束...')
}); });
this.data['ctx_'+index].onPause(() => { this.data['ctx_' + index].onPause(() => {
this.setData({ this.setData({
status: 'pause' status: 'pause'
}) })
console.log('暂停...') console.log('暂停...')
}) })
if (index === audioIndex && status == 'start') { if (index === audioIndex && status == 'start') {
this.data['ctx_'+index].pause() this.data['ctx_' + index].pause()
return return
} }
if (index === audioIndex && status == 'pause') { if (index === audioIndex && status == 'pause') {
this.data['ctx_'+index].play() this.data['ctx_' + index].play()
return return
} }
this.stopAudio() this.stopAudio()
this.setData({ this.setData({
audioIndex: index audioIndex: index
}) })
this.data['ctx_'+index].play(); this.data['ctx_' + index].play();
// 开始播放音频 // 开始播放音频
this.data['ctx_'+index].onPlay(() => { this.data['ctx_' + index].onPlay(() => {
this.setData({ this.setData({
status: 'start' status: 'start'
}) })
...@@ -209,9 +214,11 @@ Component({ ...@@ -209,9 +214,11 @@ Component({
}, },
//结束播放 //结束播放
stopAudio() { stopAudio() {
const {audioIndex} = this.data const {
if(this.data['ctx_'+audioIndex]) audioIndex
this.data['ctx_'+audioIndex].stop() } = this.data
if (this.data['ctx_' + audioIndex])
this.data['ctx_' + audioIndex].stop()
}, },
//自己声音播放 //自己声音播放
playVoice: wx.$util.throttle(function (e) { playVoice: wx.$util.throttle(function (e) {
...@@ -222,7 +229,7 @@ Component({ ...@@ -222,7 +229,7 @@ Component({
this.setAudio(id, filePath) this.setAudio(id, filePath)
}, 1000), }, 1000),
addList(val, isPlay) { addList(val, isPlay) {
val.id = new Date().getTime() val.id = new Date().getTime()
let { let {
list list
} = this.data; } = this.data;
...@@ -233,6 +240,9 @@ Component({ ...@@ -233,6 +240,9 @@ Component({
}) })
if (val.role == 2) { if (val.role == 2) {
val.isReset = true val.isReset = true
uploadFile(val.filePath,this.data.ossOption).then(res=>{
val.url = res
})
} }
list = [...list, val] list = [...list, val]
this.setData({ this.setData({
...@@ -270,16 +280,17 @@ Component({ ...@@ -270,16 +280,17 @@ Component({
//重置 //重置
resetChat() { resetChat() {
let { let {
list,resetIndex list,
resetIndex
} = this.data; } = this.data;
if(!list[list.length-1].content) { if (!list[list.length - 1].content) {
wx.$util.showToast('AI还未回复') wx.$util.showToast('AI还未回复')
return return
} }
list = list.slice(0,resetIndex); list = list.slice(0, resetIndex);
let idx = list.length - 2; let idx = list.length - 2;
list.forEach((item,k)=>{ list.forEach((item, k) => {
if(item.role ==2) { if (item.role == 2) {
idx = k idx = k
} }
}) })
...@@ -290,9 +301,9 @@ Component({ ...@@ -290,9 +301,9 @@ Component({
this.toBottom() this.toBottom()
this.stopAudio() this.stopAudio()
}, },
/** /**
* @param index 1代表结束了,不播放音频 * @param index 1代表结束了,不播放音频
*/ */
setList(val, index) { setList(val, index) {
const { const {
list list
...@@ -310,7 +321,7 @@ Component({ ...@@ -310,7 +321,7 @@ Component({
}, () => { }, () => {
this.toBottom() this.toBottom()
}) })
console.log(list,len) console.log(list, len)
if (!index) this.playAudio(list[len].id) if (!index) this.playAudio(list[len].id)
}, },
handleHidden(e) { handleHidden(e) {
...@@ -363,7 +374,7 @@ Component({ ...@@ -363,7 +374,7 @@ Component({
this.data.saveFd = res.fd this.data.saveFd = res.fd
this.data.saveFile = savePath this.data.saveFile = savePath
let param = this.data.tts.defaultStartParams() let param = this.data.tts.defaultStartParams()
const idx = list.findIndex(i=>i.id == index) const idx = list.findIndex(i => i.id == index)
param.text = list[idx].content; param.text = list[idx].content;
param.voice = this.data.sex == 1 ? "aishuo" : "aixia" param.voice = this.data.sex == 1 ? "aishuo" : "aixia"
try { try {
......
/* 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 {
width: 606rpx;
background: #F0F6FF;
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; 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;
.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: 24rpx;
.chat-aspect { .chat-aspect {
display:grid; display: grid;
background-image: linear-gradient(95deg, #E1F7FC 0%, #F3F7FF 27%, #E8F1FF 65%, #F7F2FF 100%); background-image: linear-gradient(95deg, #E1F7FC 0%, #F3F7FF 27%, #E8F1FF 65%, #F7F2FF 100%);
border-radius: 12rpx; border-radius: 12rpx;
padding:6rpx 0rpx; padding: 6rpx 0rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
.aspect-item { .aspect-item {
text-align:center; text-align: center;
.aspect-name { .aspect-name {
font-size: 24rpx; font-size: 24rpx;
color: #575C63; color: #575C63;
} }
.aspect-result {
font-size: 26rpx; .aspect-result {
color: #FF8D1A; 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;
font-size: 26rpx;
color: #333333;
letter-spacing: 0;
line-height: 44rpx;
} }
.line {
width: 100%;
height: 2rpx;
background-color: #F0F6FF;
margin: 28rpx 0;
}
} }
} }
.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;
}
} }
}
}
.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;
...@@ -117,32 +135,38 @@ color: #FF8D1A; ...@@ -117,32 +135,38 @@ color: #FF8D1A;
width: 208rpx; width: 208rpx;
height: 74rpx; height: 74rpx;
background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%); 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;
&.first { &.first {
background-color: rgba(57, 137, 254, 0.3); background-color: rgba(57, 137, 254, 0.3);
} }
&.second { &.second {
background-color: rgba(57, 137, 254, 0.5); background-color: rgba(57, 137, 254, 0.5);
} }
&.third { &.third {
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;
...@@ -150,18 +174,21 @@ color: #FF8D1A; ...@@ -150,18 +174,21 @@ color: #FF8D1A;
width: 208rpx; width: 208rpx;
height: 74rpx; height: 74rpx;
background: #fff; background: #fff;
border-radius: 37rpx 37rpx 37rpx 0; 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;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -100,4 +100,7 @@ ...@@ -100,4 +100,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="chat-right" wx:if="{{!item.role}}">
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -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({
/** /**
...@@ -98,10 +99,13 @@ Component({ ...@@ -98,10 +99,13 @@ 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) {
console.log("start failed:" + e) console.log("start failed:" + e)
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
padding: 0rpx 40rpx; padding: 0rpx 40rpx;
text-align: center; text-align: center;
line-height: 40rpx; line-height: 40rpx;
margin: 40rpx 0rpx 20rpx; margin: 30rpx 0rpx 20rpx;
} }
.scoce-box { .scoce-box {
...@@ -49,4 +49,31 @@ ...@@ -49,4 +49,31 @@
font-weight: 600; font-weight: 600;
font-size: 64rpx; font-size: 64rpx;
color: #3989FE; 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
...@@ -36,7 +36,9 @@ Component({ ...@@ -36,7 +36,9 @@ Component({
}], }],
level:3, level:3,
level_c:3, level_c:3,
content:'非常棒!发音清晰度高,听众能够准确明白您的意思!' content:'非常棒!发音清晰度高,听众能够准确明白您的意思!',
definitionList:['您的语调过于单调,听起来平淡无奇,容易让听众感到十分乏味或缺乏兴趣。','您的语调几乎不变,缺乏情感和活力,可能会让听众感到乏味。','您的语调有轻微的升降和强弱变化,足够表达基本的情感和强调,但变化不大。','您的语调有明显的升降和强弱变化,能够有效地传达情感和强调重点,使语言更加生动和吸引人。','您的语调变化丰富,能够充分表达复杂的情感和细微的差别,使语言表达更加生动和有感染力。'],
intonationList:['您的发音严重不准确,大量音节和音素模糊不清,听众很难理解说话者的意图,沟通效果极差。','您的发音不够准确,有些音节和音素模糊不清,听众可能需要更加集中注意力或请求重复才能理解全部内容。','您的发音基本准确,部分音节可能不够清晰,但大部分信息仍然可以传达给听众,偶尔需要听众集中注意力才能完全理解。','您的发音较为准确,大部分音节和音素清晰,偶尔有轻微的模糊,但不影响整体理解。','您的发音准确,每个音节和音素都清晰可辨,没有任何模糊或含糊的地方,听众可以轻松理解每一个词。']
}, },
/** /**
......
...@@ -7,4 +7,5 @@ ...@@ -7,4 +7,5 @@
<view class="report-panel"> <view class="report-panel">
<view class="report-title">语调</view> <view class="report-title">语调</view>
<emoji emojiList="{{controlList}}" level="{{level_c}}"></emoji> <emoji emojiList="{{controlList}}" level="{{level_c}}"></emoji>
<view class="report-content">上党课海口市都是对的</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -24,7 +24,10 @@ Component({ ...@@ -24,7 +24,10 @@ Component({
text:'飞速' text:'飞速'
}], }],
level:3, level:3,
content: '您的平均语速在150字/分钟,非常棒!这样能让听众更好的理解和接收你所传达的信息。' star:3,
content: '您的平均语速在150字/分钟,非常棒!这样能让听众更好的理解和接收你所传达的信息。',
speedList:['您的语速极快,几乎听不出单词之间的停顿,可能会导致听众难以理解,尤其是在不熟悉的话题或复杂的讨论中。','您的语速极慢,每个词之间有明显的停顿,通常用于强调某些信息或确保听众能够完全理解。','您的语速较快,词汇之间的间隔较短,可能需要听众集中注意力才能跟上,但仍然可以保持清晰度。','您的语速较慢,适合于清晰的沟通和教学,给听众足够的时间来消化和理解信息。','您的语速适中,既不过快也不过慢,是大多数日常对话和正式演讲的理想速度,便于听众跟随和理解。'],
wordList:['您的语言表达充斥着大量不必要的重复词汇,几乎让人无法理解其意图,严重影响沟通效果。','您的冗余词汇使用过多,导致表达显得啰嗦,可能会让听者或读者感到困惑,需要仔细分辨才能理解核心信息。','您的表达中频繁出现冗余词汇,虽然不影响主要信息的传达,但会使语言显得有些啰嗦。','您偶尔出现一些不必要的词汇,但整体上不影响理解,语言仍然保持较高的清晰度。','您的语言表达简洁明了,没有任何不必要的冗余词汇,信息传达直接高效。'],
}, },
/** /**
......
...@@ -7,4 +7,10 @@ ...@@ -7,4 +7,10 @@
<view class="report-panel"> <view class="report-panel">
<view class="report-title">冗余词</view> <view class="report-title">冗余词</view>
<view class="scoce-box"><text>6</text>个</view> <view class="scoce-box"><text>6</text>个</view>
</view>
\ No newline at end of file \ No newline at end of file
<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">上党课海口市都是对的</view>
</view>
...@@ -25,6 +25,7 @@ Component({ ...@@ -25,6 +25,7 @@ Component({
}], }],
level:3, level:3,
score:80.5, score:80.5,
star:3,
content:'您在处理客户针对延保产品的异议时展示出了一定的专业性,能够通过举例来说服客户!' content:'您在处理客户针对延保产品的异议时展示出了一定的专业性,能够通过举例来说服客户!'
}, },
......
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
<view class="report-panel other-bg"> <view class="report-panel other-bg">
<view class="report-title">攻防得分</view> <view class="report-title">攻防得分</view>
<view class="scoce-box"><text>{{score}}</text>/100</view> <view class="scoce-box"><text>{{score}}</text>/100</view>
<view class="start-box"></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> <view class="report-content">{{content}}</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -24,6 +24,7 @@ Component({ ...@@ -24,6 +24,7 @@ Component({
text:'巅峰' text:'巅峰'
}], }],
level:3, level:3,
star:3,
}, },
/** /**
......
...@@ -6,4 +6,10 @@ ...@@ -6,4 +6,10 @@
<view class="report-panel other-bg"> <view class="report-panel other-bg">
<view class="report-title">质检得分</view> <view class="report-title">质检得分</view>
<view class="scoce-box"><text>80</text>/100</view> <view class="scoce-box"><text>80</text>/100</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">上党课海口市都是对的</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -45,4 +45,38 @@ page { ...@@ -45,4 +45,38 @@ page {
width: 100%; width: 100%;
margin-top: 24rpx; margin-top: 24rpx;
box-sizing: border-box; box-sizing: border-box;
}
\ No newline at end of file \ No newline at end of file
height: calc(100vh - env(safe-area-inset-bottom) - 350rpx);
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
...@@ -22,4 +22,8 @@ ...@@ -22,4 +22,8 @@
<skilled wx:if="{{markIndex==4}}"></skilled> <skilled wx:if="{{markIndex==4}}"></skilled>
<!--服务态度--> <!--服务态度-->
<attitude wx:if="{{markIndex==5}}"></attitude> <attitude wx:if="{{markIndex==5}}"></attitude>
</view>
<view class="footer" id="footer">
<view class="back-home" bindtap="backHome">返回首页</view>
<view class="again" bindtap="again">再来一次</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
const {ossConfig} = require("~/config")
// 在h5端上传涉及到跨域,需在阿里云上配置跨域规则才能正常使用
module.exports = {
bucketName: ossConfig.BUKET_NAME,
folder: ossConfig.FOLDER,
uploadUrl: ossConfig.OSS_DOMAIN + '/', // 默认存在根目录后面要跟个'/' (在你当前小程序的后台的uploadFile 合法域名也要配上这个域名)
AccessKeySecret: ossConfig.ACCESSKEYSECRET, // AccessKeySecret 去你的阿里云上控制台上找
OSSAccessKeyId: ossConfig.ACCESSKEYID, // AccessKeyId 去你的阿里云上控制台上找
timeout: 87600 // 这个是上传文件时Policy的失效时间
}
This diff could not be displayed because it is too large.
import base64 from "./base64.js";
import Crypto from "./crypto.js";
import aiApi from "../../../aiApi";
import config from './config'
const getPolicyBase64 = function () {
let date = new Date();
date.setHours(date.getHours() + config.timeout);
let srcT = date.toISOString();
const policyText = {
expiration: srcT, //设置该Policy的失效时间,超过这个失效时间之后,就没有办法通过这个policy上传文件了
conditions: [
["content-length-range", 0, 1024 * 1024 * 1024], // 设置上传文件的大小限制(5m)
],
};
const policyBase64 = base64.encode(JSON.stringify(policyText));
return policyBase64;
};
// 生成签名
export default function () {
return new Promise(async (reslove) => {
aiApi.getToken({}).then((res) => {
const { lsaccessKeySecret, securityToken, lsaccessKeyId } = res.data;
const policyBase64 = getPolicyBase64();
console.log(policyBase64,lsaccessKeySecret)
const bytes = Crypto.HmacSHA1(policyBase64, lsaccessKeySecret);
const signature = Crypto.enc.Base64.stringify(bytes);
reslove({
signature,
securityToken,
lsaccessKeyId,
policyBase64
});
});
})
}
\ No newline at end of file \ No newline at end of file
import config from './config'
export default function (filePath,options) {
return new Promise(async (resolve, reject) => {
if (!filePath || filePath.length < 9) {
uni.showModal({
title: "文件错误",
content: "请重试",
showCancel: false,
});
reject("文件错误");
}
// 获取上传的文件类型
let fileTypeIndex = filePath.lastIndexOf("/");
let fileType = filePath.substring(fileTypeIndex + 1);
let aliyunFileKey = config.folder + fileType;
const aliyunServerURL = config.uploadUrl; // OSS地址
const { signature, securityToken, lsaccessKeyId,policyBase64 } = options
wx.uploadFile({
url: aliyunServerURL, // 开发者服务器url
filePath: filePath, // 要上传文件资源的路径
name: "file", // 必须填file
formData: {
key: aliyunFileKey,
policy: policyBase64,
OSSAccessKeyId: lsaccessKeyId,
success_action_status: "200", // 让服务端返回200, 不然默认会返回204
signature: signature,
"x-oss-security-token": securityToken, // 使用STS签名时必传。
},
success: function (res) {
console.log(res, 444);
if (res.statusCode != 200) {
reject(
new Error(
"上传错误:" +
JSON.stringify({
statusCode: res.statusCode,
filePath,
key: aliyunFileKey,
policy: policyBase64,
OSSAccessKeyId: lsaccessKeyId,
signature: signature,
"x-oss-security-token": securityToken,
})
)
);
}
resolve(aliyunServerURL + aliyunFileKey);
},
fail: function (err) {
err.domainName = aliyunServerURL;
reject(err);
},
});
});
};
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!