Commit 5d920132 by 前端

报告

1 parent d466031a
......@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布
* 5cdptest
*/
let index = 1;
let index = 2;
const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion;
......@@ -89,4 +89,21 @@ export const dsnUrl =
// 图片基地址
export const ImgUrl =
"https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat";
\ 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
......@@ -68,7 +68,7 @@ export default {
data,[],"/rop-dj-pairexc/router"
);
},
/**
/**
* 保存员工趣练记录
*/
setSparringSave(data) {
......@@ -77,4 +77,12 @@ export default {
data,[],"/rop-dj-pairexc/router"
);
},
/**
* 获取token
*/
getToken() {
return api.post(
"dj.api.smartcarlife.recepiton.customer.oss.getToken",
);
},
}
\ No newline at end of file
......@@ -269,7 +269,10 @@ Page({
const audioBox = this.selectComponent("#audioBox");
return audioBox.getList(step, defenseIndex);
},
//获取灵感建议
/**
* 获取灵感建议
* 如果进入攻防状态(defense),直接拿对应的灵感
*/
getInspiration() {
const { step, inspirationContent, roleInspiration,attackScript } = this.data;
console.log(inspirationContent,roleInspiration,'inspirationContent')
......@@ -353,14 +356,7 @@ Page({
round,
defense_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") {
setTimeout(() => {
this.toResult();
......
......@@ -2,20 +2,24 @@
page {
background-color: #F7F8FA;
}
.font-b {
color:#3989FE;
color: #3989FE;
}
.bg-box {
position:fixed;
inset:0;
z-index:-1;
position: fixed;
inset: 0;
z-index: -1;
width: 750rpx;
height: 640rpx;
background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7F8FA 96%);
height: 640rpx;
background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7F8FA 96%);
}
.chat-bar .navigation-bar {
position: relative;
box-shadow: none;
.end-btn {
position: absolute;
left: 32rpx;
......@@ -41,21 +45,26 @@ background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7
.chat-section {
margin-top: 28rpx;
.chat-list {
height: calc(100vh - 400rpx);
overflow:auto;
overflow: auto;
// padding: 0rpx 32rpx;
.chat-item {
margin-bottom:30rpx;
margin-bottom: 30rpx;
padding: 0rpx 32rpx;
.chat-left {
display:flex;
display: flex;
.avatar-icon {
width: 80rpx;
height: 80rpx;
margin-right: 16rpx;
border-radius: 50%;
}
.content-box {
// margin-top: 12rpx;
background: #FFFFFF;
......@@ -68,39 +77,46 @@ background: linear-gradient(to bottom, #DEF6FC 0%, #E3EAFF 27%, #D6E6FF 71%, #F7
box-sizing: border-box;
padding: 16rpx 24rpx;
}
.operation {
margin-top:12rpx;
.operation {
margin-top: 12rpx;
font-weight: 500;
font-size: 28rpx;
color: #3989FE;
background: #FFFFFF;
padding:20rpx 24rpx;
max-width: 520rpx;
.operation-top {
width: 180rpx;
height: 56rpx;
background: #EFF5FF;
border-radius: 28rpx;
display:flex;
align-items:center;
justify-content: center;
}
background: #FFFFFF;
padding: 20rpx 24rpx;
max-width: 520rpx;
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;
}
}
.content {
margin-top: 12rpx;
font-size: 30rpx;
color: #333333;
line-height: 44rpx;
}
}
}
.chat-right {
display: flex;
justify-content: flex-end;
.content-box {
width: 606rpx;
background: #F0F6FF;
......@@ -112,60 +128,69 @@ line-height: 44rpx;
box-sizing: border-box;
padding: 16rpx 24rpx;
margin-top: 12rpx;
.operation-box {
margin-top: 16rpx;
display:flex;
display: flex;
justify-content: space-between;
.operation {
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
color: #3989FE;
.suggest-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
color: #3989FE;
.suggest-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
}
}
}
.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;
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;
.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;
.line {
width: 100%;
height: 2rpx;
background-color: #F0F6FF;
margin: 28rpx 0;
}
}
}
}
}
.setting-btn {
display: inline-block;
width: 74rpx;
......@@ -174,11 +199,13 @@ line-height: 44rpx;
border-radius: 50%;
padding: 21rpx;
box-sizing: border-box;
.setting-icon {
width: 32rpx;
height: 32rpx;
}
}
}
.control-box {
position: fixed;
display: flex;
......@@ -190,6 +217,7 @@ line-height: 44rpx;
box-sizing: border-box;
padding-bottom: calc(24rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
.inspiration-btn {
display: inline-flex;
align-items: center;
......@@ -199,14 +227,17 @@ line-height: 44rpx;
background: #F0F6FF;
border-radius: 486rpx;
margin-right: 16rpx;
.icon {
width: 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 {
display: flex;
align-items: center;
......@@ -219,11 +250,12 @@ line-height: 44rpx;
color: #3275FA;
font-size: 28rpx;
font-weight: 500;
.icon {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
}
}
}
}
\ No newline at end of file
......@@ -7,6 +7,8 @@ const SpeechSynthesizer = require("~/utils/aliyun/tts")
const sleep = require("~/utils/aliyun/util").sleep
const formatTime = require("~/utils/aliyun/util").formatTime
const fs = wx.getFileSystemManager()
import getSignature from '../../upload/signature'
import uploadFile from '../../upload/uploadFile'
let timer = null
Component({
......@@ -42,12 +44,7 @@ Component({
*/
data: {
status: 'end',
list: [{
content: '您好,我是您的专属客户经理。这边推荐问界M7。',
role: 2,
times:20,
show:true
}],
list: [],
audioIndex: '',
ttsStart: false,
ttsText: "是的发生大客户"
......@@ -55,6 +52,7 @@ Component({
lifetimes: {
attached() {
this.connectSr()
this.getOssSignature()
},
detached() {
this.stopAudio()
......@@ -64,6 +62,11 @@ Component({
* 组件的方法列表
*/
methods: {
getOssSignature() {
getSignature().then(res => {
this.data.ossOption = res
})
},
async connectSr(options) {
try {
this.data.token = await getToken(ALIYUN.AKID,
......@@ -155,51 +158,53 @@ Component({
curPage.toBottom()
},
setAudio(index, filePath, type) {
if(!this.data['ctx_'+index])
this.data['ctx_'+index] = wx.createInnerAudioContext()
if (!this.data['ctx_' + index])
this.data['ctx_' + index] = wx.createInnerAudioContext()
const {
list,
audioIndex,
status
} = this.data;
if (type) {
const idx = list.findIndex(i=>i.id == index)
const idx = list.findIndex(i => i.id == index)
list[idx].filePath = filePath;
this.setData({list})
this.setData({
list
})
this.toBottom()
}
console.log(index, audioIndex, status,filePath)
this.data['ctx_'+index].src = filePath; // 替换为你的音频文件路径
console.log(index, audioIndex, status, filePath)
this.data['ctx_' + index].src = filePath; // 替换为你的音频文件路径
// 监听播放完成事件
const _this = this;
this.data['ctx_'+index].onEnded(() => {
this.data['ctx_' + index].onEnded(() => {
_this.setData({
status: 'ending'
})
console.log('结束...')
});
this.data['ctx_'+index].onPause(() => {
this.data['ctx_' + index].onPause(() => {
this.setData({
status: 'pause'
})
console.log('暂停...')
})
if (index === audioIndex && status == 'start') {
this.data['ctx_'+index].pause()
this.data['ctx_' + index].pause()
return
}
if (index === audioIndex && status == 'pause') {
this.data['ctx_'+index].play()
this.data['ctx_' + index].play()
return
}
this.stopAudio()
this.setData({
audioIndex: index
})
this.data['ctx_'+index].play();
this.data['ctx_' + index].play();
// 开始播放音频
this.data['ctx_'+index].onPlay(() => {
this.data['ctx_' + index].onPlay(() => {
this.setData({
status: 'start'
})
......@@ -209,9 +214,11 @@ Component({
},
//结束播放
stopAudio() {
const {audioIndex} = this.data
if(this.data['ctx_'+audioIndex])
this.data['ctx_'+audioIndex].stop()
const {
audioIndex
} = this.data
if (this.data['ctx_' + audioIndex])
this.data['ctx_' + audioIndex].stop()
},
//自己声音播放
playVoice: wx.$util.throttle(function (e) {
......@@ -222,7 +229,7 @@ Component({
this.setAudio(id, filePath)
}, 1000),
addList(val, isPlay) {
val.id = new Date().getTime()
val.id = new Date().getTime()
let {
list
} = this.data;
......@@ -233,6 +240,9 @@ Component({
})
if (val.role == 2) {
val.isReset = true
uploadFile(val.filePath,this.data.ossOption).then(res=>{
val.url = res
})
}
list = [...list, val]
this.setData({
......@@ -270,16 +280,17 @@ Component({
//重置
resetChat() {
let {
list,resetIndex
list,
resetIndex
} = this.data;
if(!list[list.length-1].content) {
if (!list[list.length - 1].content) {
wx.$util.showToast('AI还未回复')
return
}
list = list.slice(0,resetIndex);
list = list.slice(0, resetIndex);
let idx = list.length - 2;
list.forEach((item,k)=>{
if(item.role ==2) {
list.forEach((item, k) => {
if (item.role == 2) {
idx = k
}
})
......@@ -290,9 +301,9 @@ Component({
this.toBottom()
this.stopAudio()
},
/**
* @param index 1代表结束了,不播放音频
*/
/**
* @param index 1代表结束了,不播放音频
*/
setList(val, index) {
const {
list
......@@ -310,7 +321,7 @@ Component({
}, () => {
this.toBottom()
})
console.log(list,len)
console.log(list, len)
if (!index) this.playAudio(list[len].id)
},
handleHidden(e) {
......@@ -363,7 +374,7 @@ Component({
this.data.saveFd = res.fd
this.data.saveFile = savePath
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.voice = this.data.sex == 1 ? "aishuo" : "aixia"
try {
......
/* packageEquity/pages/aiCheck/components/AudioTts/AudioTts.wxss */
.chat-item {
padding: 0 32rpx 30rpx;
.chat-left {
display:flex;
.avatar-icon {
width: 80rpx;
height: 80rpx;
margin-right: 10rpx;
border-radius: 50%;
}
.content-box {
margin-top: 12rpx;
background: #FFFFFF;
font-size: 30rpx;
color: #333333;
line-height: 44rpx;
border-radius: 16rpx;
max-width: 560rpx;
box-sizing: border-box;
padding: 16rpx 24rpx;
}
}
.chat-right {
.chat-item {
padding: 0 32rpx 30rpx;
.chat-left {
display: flex;
.avatar-icon {
width: 80rpx;
height: 80rpx;
margin-right: 10rpx;
border-radius: 50%;
}
.content-box {
margin-top: 12rpx;
background: #FFFFFF;
font-size: 30rpx;
color: #333333;
line-height: 44rpx;
border-radius: 16rpx;
max-width: 560rpx;
box-sizing: border-box;
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;
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;
justify-content: space-between;
.operation {
display: flex;
justify-content: space-between;
.operation {
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
color: #3989FE;
.suggest-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
}
}
.chat-item-right-text {
}
}
.chat-item-right-text {
background-color: #FFFFFF;
border-radius: 16rpx;
padding: 24rpx 28rpx;
margin-top: 24rpx;
.chat-aspect {
display:grid;
display: grid;
background-image: linear-gradient(95deg, #E1F7FC 0%, #F3F7FF 27%, #E8F1FF 65%, #F7F2FF 100%);
border-radius: 12rpx;
padding:6rpx 0rpx;
margin-bottom: 20rpx;
border-radius: 12rpx;
padding: 6rpx 0rpx;
margin-bottom: 20rpx;
grid-template-columns: repeat(4, 1fr);
.aspect-item {
text-align:center;
text-align: center;
.aspect-name {
font-size: 24rpx;
color: #575C63;
color: #575C63;
}
.aspect-result {
font-size: 26rpx;
color: #FF8D1A;
.aspect-result {
font-size: 26rpx;
color: #FF8D1A;
}
}
}
.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;
}
}
}
.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 {
font-size: 30rpx;
color: #FFFFFF;
color: #FFFFFF;
display: flex;
align-items: center;
padding-right: 24rpx;
......@@ -117,32 +135,38 @@ color: #FF8D1A;
width: 208rpx;
height: 74rpx;
background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
border-radius: 37rpx 37rpx 0 37rpx;
border-radius: 37rpx 37rpx 0 37rpx;
margin-left: auto;
justify-content: flex-end;
.wifi-circle {
border: 5rpx solid #fff;
}
}
.loadding {
display: inline-block;
width: 14rpx;
height: 14rpx;
border-radius: 50%;
margin-right: 24rpx;
&.first {
background-color: rgba(57, 137, 254, 0.3);
}
}
&.second {
background-color: rgba(57, 137, 254, 0.5);
}
}
&.third {
background-color: rgba(57, 137, 254, 0.7);
}
}
}
.audio-left {
font-size: 30rpx;
color: #333333;
color: #333333;
box-sizing: border-box;
display: flex;
align-items: center;
......@@ -150,18 +174,21 @@ color: #FF8D1A;
width: 208rpx;
height: 74rpx;
background: #fff;
border-radius: 37rpx 37rpx 37rpx 0;
border-radius: 37rpx 37rpx 37rpx 0;
.wifi-circle {
border: 5rpx solid #666;
}
}
.wifi-symbol {
width: 40rpx;
height: 40rpx;
box-sizing: border-box;
z-index: 99;
.icon {
width: 40rpx;
height: 40rpx;
width: 40rpx;
height: 40rpx;
}
}
\ No newline at end of file
......@@ -100,4 +100,7 @@
</view>
</view>
</view>
<view class="chat-right" wx:if="{{!item.role}}">
</view>
</view>
\ No newline at end of file
......@@ -4,6 +4,7 @@ const {
const getToken = require("~/utils/aliyun/token").getToken
const SpeechRecognition = require("~/utils/aliyun/sr")
const sleep = require("~/utils/aliyun/util").sleep
let timer = null
Component({
/**
......@@ -98,10 +99,13 @@ Component({
this.setData({
times: ++times
})
}, 1000)
}, 1000)
let sr = this.data.sr
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
} catch (e) {
console.log("start failed:" + e)
......
......@@ -36,7 +36,7 @@
padding: 0rpx 40rpx;
text-align: center;
line-height: 40rpx;
margin: 40rpx 0rpx 20rpx;
margin: 30rpx 0rpx 20rpx;
}
.scoce-box {
......@@ -49,4 +49,31 @@
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
......@@ -36,7 +36,9 @@ Component({
}],
level:3,
level_c:3,
content:'非常棒!发音清晰度高,听众能够准确明白您的意思!'
content:'非常棒!发音清晰度高,听众能够准确明白您的意思!',
definitionList:['您的语调过于单调,听起来平淡无奇,容易让听众感到十分乏味或缺乏兴趣。','您的语调几乎不变,缺乏情感和活力,可能会让听众感到乏味。','您的语调有轻微的升降和强弱变化,足够表达基本的情感和强调,但变化不大。','您的语调有明显的升降和强弱变化,能够有效地传达情感和强调重点,使语言更加生动和吸引人。','您的语调变化丰富,能够充分表达复杂的情感和细微的差别,使语言表达更加生动和有感染力。'],
intonationList:['您的发音严重不准确,大量音节和音素模糊不清,听众很难理解说话者的意图,沟通效果极差。','您的发音不够准确,有些音节和音素模糊不清,听众可能需要更加集中注意力或请求重复才能理解全部内容。','您的发音基本准确,部分音节可能不够清晰,但大部分信息仍然可以传达给听众,偶尔需要听众集中注意力才能完全理解。','您的发音较为准确,大部分音节和音素清晰,偶尔有轻微的模糊,但不影响整体理解。','您的发音准确,每个音节和音素都清晰可辨,没有任何模糊或含糊的地方,听众可以轻松理解每一个词。']
},
/**
......
......@@ -7,4 +7,5 @@
<view class="report-panel">
<view class="report-title">语调</view>
<emoji emojiList="{{controlList}}" level="{{level_c}}"></emoji>
<view class="report-content">上党课海口市都是对的</view>
</view>
\ No newline at end of file
......@@ -24,7 +24,10 @@ Component({
text:'飞速'
}],
level:3,
content: '您的平均语速在150字/分钟,非常棒!这样能让听众更好的理解和接收你所传达的信息。'
star:3,
content: '您的平均语速在150字/分钟,非常棒!这样能让听众更好的理解和接收你所传达的信息。',
speedList:['您的语速极快,几乎听不出单词之间的停顿,可能会导致听众难以理解,尤其是在不熟悉的话题或复杂的讨论中。','您的语速极慢,每个词之间有明显的停顿,通常用于强调某些信息或确保听众能够完全理解。','您的语速较快,词汇之间的间隔较短,可能需要听众集中注意力才能跟上,但仍然可以保持清晰度。','您的语速较慢,适合于清晰的沟通和教学,给听众足够的时间来消化和理解信息。','您的语速适中,既不过快也不过慢,是大多数日常对话和正式演讲的理想速度,便于听众跟随和理解。'],
wordList:['您的语言表达充斥着大量不必要的重复词汇,几乎让人无法理解其意图,严重影响沟通效果。','您的冗余词汇使用过多,导致表达显得啰嗦,可能会让听者或读者感到困惑,需要仔细分辨才能理解核心信息。','您的表达中频繁出现冗余词汇,虽然不影响主要信息的传达,但会使语言显得有些啰嗦。','您偶尔出现一些不必要的词汇,但整体上不影响理解,语言仍然保持较高的清晰度。','您的语言表达简洁明了,没有任何不必要的冗余词汇,信息传达直接高效。'],
},
/**
......
......@@ -7,4 +7,10 @@
<view class="report-panel">
<view class="report-title">冗余词</view>
<view class="scoce-box"><text>6</text>个</view>
</view>
\ 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({
}],
level:3,
score:80.5,
star:3,
content:'您在处理客户针对延保产品的异议时展示出了一定的专业性,能够通过举例来说服客户!'
},
......
......@@ -6,6 +6,10 @@
<view class="report-panel other-bg">
<view class="report-title">攻防得分</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>
\ No newline at end of file
......@@ -24,6 +24,7 @@ Component({
text:'巅峰'
}],
level:3,
star:3,
},
/**
......
......@@ -6,4 +6,10 @@
<view class="report-panel other-bg">
<view class="report-title">质检得分</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>
\ No newline at end of file
......@@ -45,4 +45,38 @@ page {
width: 100%;
margin-top: 24rpx;
box-sizing: border-box;
}
\ 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
......@@ -22,4 +22,8 @@
<skilled wx:if="{{markIndex==4}}"></skilled>
<!--服务态度-->
<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>
\ 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
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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!