Sfoglia il codice sorgente

修复通话录音不能播放

maotao 5 mesi fa
parent
commit
4f6c350f22
3 ha cambiato i file con 36 aggiunte e 22 eliminazioni
  1. 23 18
      components/IncidentAttachment.vue
  2. 5 1
      http/api.js
  3. 8 3
      pages/incidentList/incidentList.vue

+ 23 - 18
components/IncidentAttachment.vue

@@ -24,7 +24,7 @@
24 24
   import { defineEmits, ref, reactive, defineProps } from 'vue'
25 25
   import { onLoad } from '@dcloudio/uni-app'
26 26
   import { useLoginUserStore } from '@/stores/loginUser'
27
-  import { api_wechatRequesterIncident, api_callrecord } from "@/http/api.js"
27
+  import { api_wechatRequesterIncident, api_callrecord, api_getRecordCall } from "@/http/api.js"
28 28
 
29 29
   const emit = defineEmits(['cancelEmit', 'knowEmit']);
30 30
   const { incidentData } = defineProps({
@@ -93,24 +93,29 @@
93 93
     let postData = {
94 94
       idx: 0,
95 95
       sum: 1,
96
-      callrecord: {callAccept: incidentData.callID},
96
+			callAccept:incidentData.callID
97
+      // callrecord: {callAccept: incidentData.callID},
97 98
     };
98
-    api_callrecord(postData).then((res) => {
99
-        uni.hideLoading();
100
-        if(res.status == 200){
101
-          res.list = res.list || [];
102
-          if(res.list.length){
103
-            pageData.audioSrc = location.origin + res.list[0].recordingFileName;
104
-          }else{
105
-            pageData.audioSrc = '';
106
-          }
107
-        }else{
108
-          uni.showToast({
109
-            icon: 'none',
110
-            title: res.msg || '请求数据失败!'
111
-          });
112
-        }
113
-      });
99
+    api_callrecord(postData).then((res0) => {
100
+			if(res0.status==200){
101
+				api_getRecordCall({
102
+					path:res0.list[0].path,
103
+					hosId:loginUserStore.loginUser.user.currentHospital.id
104
+				}).then((res)=>{
105
+					uni.hideLoading();
106
+					if(res.state == 200){
107
+					  // res.list = res.list || [];
108
+					  pageData.audioSrc = location.origin + res.relativePath;
109
+					}else{
110
+					  uni.showToast({
111
+					    icon: 'none',
112
+					    title: res.error || '请求数据失败!'
113
+					  });
114
+					}
115
+				})
116
+			}
117
+			
118
+    });
114 119
   }
115 120
 
116 121
   onLoad((option) => {

+ 5 - 1
http/api.js

@@ -74,7 +74,11 @@ export function api_wechatRequesterIncident(data){
74 74
  * 获取通话音频
75 75
  */
76 76
 export function api_callrecord(data){
77
-  return post("/bpm/data/fetchDataList/callrecord", data);
77
+  return post("/simple/data/fetchDataList/callLog", data);
78
+}
79
+
80
+export function api_getRecordCall(data){
81
+  return post("/callLog/getRecordByPath", data);
78 82
 }
79 83
 
80 84
 /**

+ 8 - 3
pages/incidentList/incidentList.vue

@@ -215,7 +215,10 @@
215 215
 
216 216
   // 接单调用方案
217 217
   function receiveFn(incidentData){
218
-		let placeId = JSON.parse(JSON.stringify(incidentData.place.id))
218
+		let placeId = null
219
+		if(incidentData.place){
220
+			placeId = JSON.parse(JSON.stringify(incidentData.place.id))
221
+		}
219 222
     uni.showLoading({
220 223
       title: "加载中",
221 224
       mask: true,
@@ -224,8 +227,10 @@
224 227
     let postData = {
225 228
       incident: incidentData,
226 229
     }
227
-		postData.incident.place = {}
228
-		postData.incident.place.id = placeId
230
+		if(placeId){
231
+			postData.incident.place = {}
232
+			postData.incident.place.id = placeId
233
+		}
229 234
     api_incidentTask('receive', postData).then(res => {
230 235
       uni.hideLoading();
231 236
       if(res.state == 200){