|
@@ -116,6 +116,7 @@
|
|
import {apiVoiceSectionList} from '@/api/voice'
|
|
import {apiVoiceSectionList} from '@/api/voice'
|
|
import {baseApiUrl} from '@/utils/config.js'
|
|
import {baseApiUrl} from '@/utils/config.js'
|
|
import CryptoJS from '@/utils/crypto.js'
|
|
import CryptoJS from '@/utils/crypto.js'
|
|
|
|
+import uniAsync from "@/utils/uni-async.js"; // uni api async 化
|
|
const recorderManager = wx.getRecorderManager();//录音实例
|
|
const recorderManager = wx.getRecorderManager();//录音实例
|
|
const innerAudioContext = uni.createInnerAudioContext();//播放音频实例
|
|
const innerAudioContext = uni.createInnerAudioContext();//播放音频实例
|
|
let TIMER=null//计时器
|
|
let TIMER=null//计时器
|
|
@@ -147,7 +148,8 @@ export default {
|
|
variety_name:'',
|
|
variety_name:'',
|
|
variety_id:'',
|
|
variety_id:'',
|
|
section_id:'',
|
|
section_id:'',
|
|
- section_name:''
|
|
|
|
|
|
+ section_name:'',
|
|
|
|
+ img_url:''
|
|
},
|
|
},
|
|
|
|
|
|
recorderStatus:'start',//当前录音状态 start开始 doing正在录音 stop停止录音 pause录音暂停
|
|
recorderStatus:'start',//当前录音状态 start开始 doing正在录音 stop停止录音 pause录音暂停
|
|
@@ -234,7 +236,18 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
//点击录音操作按钮
|
|
//点击录音操作按钮
|
|
- handleClickBtn(){
|
|
|
|
|
|
+ async handleClickBtn(){
|
|
|
|
+ const setRes=await uniAsync.getSetting()
|
|
|
|
+ console.log(setRes.authSetting['scope.record']);
|
|
|
|
+ if(!setRes.authSetting['scope.record']){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:'请打开麦克风交流',
|
|
|
|
+ icon:'none'
|
|
|
|
+ })
|
|
|
|
+ uni.openSetting()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
if(this.recorderStatus==='start'){
|
|
if(this.recorderStatus==='start'){
|
|
recorderManager.start({
|
|
recorderManager.start({
|
|
duration:600000,
|
|
duration:600000,
|
|
@@ -354,6 +367,7 @@ export default {
|
|
this.form.section_name=detail.SectionName
|
|
this.form.section_name=detail.SectionName
|
|
this.form.variety_name=this.options[this.mainActiveIndex].VarietyName
|
|
this.form.variety_name=this.options[this.mainActiveIndex].VarietyName
|
|
this.form.variety_id=this.options[this.mainActiveIndex].VarietyId
|
|
this.form.variety_id=this.options[this.mainActiveIndex].VarietyId
|
|
|
|
+ this.form.img_url=detail.ImgUrl
|
|
this.showFilter=false
|
|
this.showFilter=false
|
|
},
|
|
},
|
|
|
|
|
|
@@ -376,6 +390,7 @@ export default {
|
|
section_name:this.form.section_name,
|
|
section_name:this.form.section_name,
|
|
variety_id:Number(this.form.variety_id),
|
|
variety_id:Number(this.form.variety_id),
|
|
variety_name:this.form.variety_name,
|
|
variety_name:this.form.variety_name,
|
|
|
|
+ img_url:this.form.img_url,
|
|
author_id:Number(this.$store.state.user.userInfo.user_id),
|
|
author_id:Number(this.$store.state.user.userInfo.user_id),
|
|
author:this.$store.state.user.userInfo.real_name
|
|
author:this.$store.state.user.userInfo.real_name
|
|
}
|
|
}
|
|
@@ -397,6 +412,7 @@ export default {
|
|
icon:'success'
|
|
icon:'success'
|
|
})
|
|
})
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
|
+ uni.$emit('addVoiceSuccess')
|
|
uni.navigateBack()
|
|
uni.navigateBack()
|
|
}, 1000);
|
|
}, 1000);
|
|
}else{
|
|
}else{
|