|
@@ -188,6 +188,7 @@
|
|
|
<script>
|
|
|
import {apiVoiceSectionList,apiVoiceSendMsg,apiVoiceAdd,apiVoiceEdit,apiVoicePublish,apiVoiceDetail} from '@/api/voice'
|
|
|
import {baseApiUrl} from '@/utils/config.js'
|
|
|
+import {apiGetSceneToParams} from '@/api/common'
|
|
|
import CryptoJS from '@/utils/crypto.js'
|
|
|
import uniAsync from "@/utils/uni-async.js"; // uni api async 化
|
|
|
import {uploadImg,commonUploadAudio} from '@/utils/upload'
|
|
@@ -265,10 +266,7 @@ export default {
|
|
|
this.listenVoice()
|
|
|
this.getOptionsList()
|
|
|
|
|
|
- if(options.voiceId){
|
|
|
- this.voiceId=Number(options.voiceId)
|
|
|
- this.getVoiceDetail()
|
|
|
- }
|
|
|
+ this.init(options)
|
|
|
},
|
|
|
onShow(){
|
|
|
innerAudioContext = uni.createInnerAudioContext()
|
|
@@ -283,6 +281,20 @@ export default {
|
|
|
clearInterval(TIMER)
|
|
|
},
|
|
|
methods: {
|
|
|
+ async init(options){
|
|
|
+ if(options.scene){
|
|
|
+ const res=await apiGetSceneToParams({scene_key:options.scene})
|
|
|
+ if(res.code===200){
|
|
|
+ const obj=JSON.parse(res.data)
|
|
|
+ this.voiceId=Number(obj.voiceId)
|
|
|
+ this.getVoiceDetail()
|
|
|
+ }
|
|
|
+ }else if(options.voiceId){
|
|
|
+ this.voiceId=Number(options.voiceId)
|
|
|
+ this.getVoiceDetail()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
//语音详情
|
|
|
async getVoiceDetail(){
|
|
|
uni.setNavigationBarTitle({ title: '编辑语音' })
|