Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
778c2059df
@ -85,7 +85,7 @@ export default {
|
||||
panelShow: true,
|
||||
ibpPart: '',
|
||||
showStation: '',
|
||||
stationList: '',
|
||||
stationList: [],
|
||||
showSelectStation: false,
|
||||
mapViewLoadedOver: false
|
||||
};
|
||||
|
@ -66,7 +66,7 @@ export default {
|
||||
}
|
||||
},
|
||||
stationList: {
|
||||
type: Object,
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
|
@ -75,7 +75,9 @@ export default {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
this.reloadTable();
|
||||
if (this.mapId) {
|
||||
this.reloadTable();
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
|
@ -31,6 +31,7 @@
|
||||
</div>
|
||||
</ul>
|
||||
<div v-if="recordSending" class="chat_record_tip">
|
||||
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
|
||||
<div class="record_icon" />
|
||||
<div class="record_tip_text">正在录音...</div>
|
||||
<div class="record_tip_confirm" @click="stopRecording()">确定</div>
|
||||
@ -75,6 +76,8 @@ export default {
|
||||
textList: [],
|
||||
recordSending:false,
|
||||
text: '',
|
||||
seconds:0,
|
||||
inter:null,
|
||||
recorders: null,
|
||||
sending: false,
|
||||
disabled:true,
|
||||
@ -147,7 +150,6 @@ export default {
|
||||
startRecording() {
|
||||
const that = this;
|
||||
if (!this.recordSending && !this.recorders && !this.microphone) {
|
||||
debugger;
|
||||
navigator.getUserMedia(
|
||||
{ audio: true } // 只启用音频
|
||||
, function (stream) {
|
||||
@ -158,6 +160,13 @@ export default {
|
||||
});
|
||||
that.recorders.startRecording();
|
||||
that.recordSending = true;
|
||||
that.inter = setInterval(() => {
|
||||
if (that.seconds < 60) {
|
||||
that.seconds++;
|
||||
} else {
|
||||
clearInterval(that.inter);
|
||||
}
|
||||
}, 1000);
|
||||
}, function (error) {
|
||||
switch (error.code || error.name) {
|
||||
case 'PERMISSION_DENIED':
|
||||
@ -209,40 +218,42 @@ export default {
|
||||
this.recorders.stopRecording(function(blobURL) {
|
||||
const data = URL.createObjectURL(that.recorders.getBlob());
|
||||
console.log('--------', data);
|
||||
clearInterval(that.inter);
|
||||
that.seconds = 0;
|
||||
const blob = that.recorders.getBlob();
|
||||
const fd = new FormData();
|
||||
fd.append('file', blob);
|
||||
chatWithAudio(fd, that.$route.query.group).then((res)=>{
|
||||
this.recordSending = false;
|
||||
this.$message({
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '语音发送成功',
|
||||
type: 'success'
|
||||
});
|
||||
}).catch(error => {
|
||||
// this.sending = false;
|
||||
this.recordSending = false;
|
||||
that.recordSending = false;
|
||||
const message = JSON.parse(error.message);
|
||||
if (message.err_no == 3301) {
|
||||
this.$message({
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '音频质量有问题',
|
||||
type: 'error'
|
||||
});
|
||||
} else if (message.err_no == 3308) {
|
||||
this.$message({
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '音频过长,建议60s以下',
|
||||
type: 'error'
|
||||
});
|
||||
} else if (message.err_no == 3314) {
|
||||
this.$message({
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '音频太短,建议重录',
|
||||
type: 'error'
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '网络问题,请重试',
|
||||
type: 'error'
|
||||
@ -309,8 +320,14 @@ export default {
|
||||
// }
|
||||
},
|
||||
cancleRecording() {
|
||||
this.recordSending = false;
|
||||
this.recorders = null;
|
||||
if (this.microphone) {
|
||||
clearInterval(this.inter);
|
||||
this.seconds = 0;
|
||||
this.microphone.stop();
|
||||
this.microphone = null;
|
||||
this.recordSending = false;
|
||||
this.recorders = null;
|
||||
}
|
||||
},
|
||||
playAudio(nor) {
|
||||
this.$refs.audio.src = nor.src;
|
||||
@ -435,6 +452,12 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
#record_progress_bar{
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background: #bbe5f5;
|
||||
}
|
||||
|
||||
.chat_record_tip{
|
||||
height: 28px;
|
||||
display: inline-block;
|
||||
@ -442,7 +465,6 @@ export default {
|
||||
width: 100%;
|
||||
font-size: 13px;
|
||||
border-top: 1px #d8dce5 solid;
|
||||
padding: 6px 0px 6px 4px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
@ -453,15 +475,21 @@ export default {
|
||||
height: 8px;
|
||||
background: #25d825;
|
||||
border-radius: 10px;
|
||||
margin-left: 3px;
|
||||
left: 7px;
|
||||
margin-right: 0px;
|
||||
box-shadow: -1px 0px 3px #6d6d6d;
|
||||
border: 1px #28d228 solid;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
}
|
||||
.record_tip_text{
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin-left: 3px;
|
||||
// padding: 8px 0px 6px 0px;
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left:20px
|
||||
}
|
||||
.record_tip_confirm{
|
||||
position: absolute;
|
||||
|
Loading…
Reference in New Issue
Block a user