Commit ae3cfa0a by Ken Nakahira

提交更新代码

parents 028ad081 bb1cd57f
......@@ -368,9 +368,10 @@
:style="{height: boxHeight + 'rpx'}"
:scroll-into-view="bottomElement_pangbai"
class="pangbai_content"
id="pangbaiBox"
>
<view id="scrollView">
<view class="npc" :style="{fontSize: fontSize + 'rpx'}">
<view class="npc" :style="{fontSize: fontSize + 'rpx'}" id="pangbaiCntainer">
{{yyds_pangbai}}
</view>
<!-- 最后一个元素,用于滚动定位 -->
......@@ -378,7 +379,7 @@
</view>
</scroll-view>
<image
@click="nextTips"
@click="debouncedNextTips"
src="../../static/UI/继续.png"
class="tre"
mode="scaleToFill"
......@@ -512,6 +513,7 @@ export default {
total_val:[],
fontSize:0,
boxHeight:210,
debouncedNextTips:null,
quotedData:[]
}
},
......@@ -576,6 +578,7 @@ export default {
//获取历史聊天记录 根据历史记录处理决定 websocket 的连接
this.getHistory()
this.calcFontSize(26)
this.created()
//讲完话以后 向服务器发送数据
recorderManager.onStop( res=> {
......@@ -698,17 +701,46 @@ export default {
this.loadingBG = true
},
nextTips(){
//结算当前语音的递归 进行下一次语音
// 结算当前语音的递归 进行下一次语音
// this.EPlayer.onEnded()
this.jumping = true
clearInterval(this.Strem)
this.EPlayer.stop()
if(!this.kill){
this.yyds_pangbai += this.str
}
this.jumping = false
this.EPlayer.onended()
this.$nextTick(() => {
this.jumping = true
clearInterval(this.Strem)
if(this.EPlayer) {
this.EPlayer.stop()
}
if(this.glod_dp && this.str != "") {
console.log('Text Appended')
this.realVoice(this.str)
} else {
this.yyds_pangbai += this.str
}
this.str = ''
this.jumping = false
this.EPlayer.onended()
console.log('------------------')
});
},
realVoice(text){
this.yyds_dp = text
this.yyds_pangbai += " “ "+text+ " ” "
},
debounce(fn, interval) {
var timer;
var gapTime = interval;//间隔时间,如果interval不传,则默认1000ms
return function() {
clearTimeout(timer);
var context = this;
var args = arguments;//保存此处的arguments,因为setTimeout是全局的,arguments不是防抖函数需要的。
timer = setTimeout(function() {
fn.apply(context,args);
}, gapTime);
};
},
created() {
// Bind the debounced version of nextTips
this.debouncedNextTips = this.debounce(this.nextTips, 750);
},
handleCloseDialog(){
this.show = false
},
......@@ -1751,7 +1783,7 @@ export default {
if (Cobj2.content != "") {
setTimeout(() => {
this.FetchAbuffer(Cobj2, voicer, Sarry)
}, 1000)
}, 500)
}
}).catch(err=>{
console.log(1223,err)
......@@ -1780,7 +1812,7 @@ export default {
if (Cobj.content != "") {
setTimeout(() => {
this.FetchAbuffer_real(Cobj, voicer, Sarry)
}, 1000)
}, 500)
}
})
},
......@@ -1788,47 +1820,49 @@ export default {
execFile(data,ISLIU_content){
// let arrObj = data;
// const content = arrObj[0].text;
// //quoted为真 或为假 表示 真假音线
// quoted为真 或为假 表示 真假音线
// const voicer = arrObj[0].quoted ?
// this.currentPageData.voiceGroups[1] :
// this.currentPageData.voiceGroups[0]
// const voicer = arrObj[0].quoted ? this.currentPageData.voiceGroups[1] : this.currentPageData.voiceGroups[0];
let arrObj = data;
console.log('arrObj_execFile',arrObj)
const content = arrObj[0].text;
const voicer = arrObj[0].voicer;
this.GoSay(content,voicer,(text, falg)=>{
if(arrObj[0].quoted){
if(text!==""&&!falg){
this.glod_dp = true
// this.glod_user = false
this.yyds_dp = text
this.yyds_pangbai += " “ "+text+ " ” "
}
if (falg) {
console.log('GoSound讲话完毕!')
arrObj.shift()
console.log('arrObj',arrObj)
if(arrObj.length!==0){
this.execFile(arrObj)
}
}
}else{
if(text!==""&&!falg){
this.kill = false
this.delayText(text)
}
if (falg) {
console.log('GoSay讲话完毕!')
this.kill = true
arrObj.shift()
console.log('arrObj',arrObj)
if(arrObj.length!==0){
this.execFile(arrObj)
}
}
}
if(!arrObj || arrObj.length == 0) {return}
if(arrObj[0].quoted){
if(text!==""&&!falg){
console.log('Quote Added')
this.glod_dp = true
// this.glod_user = false
this.yyds_dp = text
this.yyds_pangbai += " “ "+text+ " ” "
}
if (falg) {
console.log('GoSound讲话完毕!')
arrObj.shift()
console.log('arrObj',arrObj)
if(arrObj.length!==0){
this.execFile(arrObj)
}
}
}else {
if (text !== "" && !falg) {
this.kill = false
this.delayText(text)
}
if (falg) {
console.log('GoSay讲话完毕!')
this.kill = true
arrObj.shift()
console.log('arrObj', arrObj)
if (arrObj.length !== 0) {
this.execFile(arrObj)
}
}
}
})
// if(this.soundVoice[voicer]){
......@@ -1888,7 +1922,7 @@ export default {
if(count.length==0){
clearInterval(this.Strem)
}
}, 100);
}, 50);
},
createSSML(text, voiceName) {
......@@ -1904,11 +1938,13 @@ export default {
// GoSound 真人音线
GoSound(content, voicer, CB) {
// 要读的文字 声线 回调
console.log('First')
const that = this
let Sarry = [];
this.Cobj = this.computeLen({ content });
this.str = this.Cobj.Sr
this.glod_dp = true
uni.request({
url: 'https://admin.mindepoch.com:8089/VoiceMode/GetVoiceEcho',
method: 'post',
......@@ -1984,6 +2020,8 @@ export default {
that.jumping = false
Rfunc()
}else{
console.log('Checkpoint')
this.str = Sobj.S
that.tempFilePath2 = wx.env.USER_DATA_PATH + `/tempAudio_${new Date().getTime()}.mp3`;
FileSystemManager.writeFile({
filePath: that.tempFilePath2,
......@@ -2010,7 +2048,7 @@ export default {
if (that.Cobj.content != "") {
setTimeout(() => {
that.FetchAbuffer_real(that.Cobj, voicer, Sarry, CB)
}, 5000)
}, 2000)
}
},
fail:(err)=>{
......@@ -2066,6 +2104,7 @@ export default {
console.log('oooGoSayooo')
this.EPlayer.cb = CB
var Rfunc = () => {
console.log('Sarry',Sarry)
if(this.jumping){
return
}
......@@ -2103,6 +2142,8 @@ export default {
this.jumping = false
Rfunc()
}else{
console.log('Checkpoint')
this.str = Sobj.S
this.tempFilePath2 = wx.env.USER_DATA_PATH + `/tempAudio_${new Date().getTime()}.mp3`;
// const mark = that.Cobj2.Sr
FileSystemManager.writeFile({
......@@ -2128,7 +2169,7 @@ export default {
if (this.Cobj2.content != "") {
setTimeout(() => {
this.FetchAbuffer(this.Cobj2, voicer, Sarry, CB)
}, 5000)
}, 2000)
}
},
......@@ -3143,7 +3184,7 @@ export default {
bottom:0;
left:50%;
transform:translateX(-50%);
padding-bottom: 30rpx;
padding-bottom: 40rpx;
}
.pangbai_title{
height: 76rpx;
......@@ -3315,7 +3356,6 @@ export default {
.tre{
position:absolute;
right:30rpx;
bottom:-250rpx;
width:36rpx;
height:27rpx;
z-index:99;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -958,7 +958,7 @@ to {
left:50%;
-webkit-transform:translateX(-50%);
transform:translateX(-50%);
padding-bottom: 30rpx;
padding-bottom: 40rpx;
}
.pangbai_title.data-v-57280228{
height: 76rpx;
......@@ -1128,7 +1128,6 @@ to {
.tre.data-v-57280228{
position:absolute;
right:30rpx;
bottom:-250rpx;
width:36rpx;
height:27rpx;
z-index:99;
......
......@@ -6,6 +6,11 @@
},
"setting": {
"urlCheck": false,
"es6": false,
"postcss": false,
"minified": false,
"newFeature": true,
"bigPackageSizeSupport": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment