Commit ae3cfa0a by Ken Nakahira

提交更新代码

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