From 907cecf432e285305cd84fd5f7d12e8ca262e1a7 Mon Sep 17 00:00:00 2001 From: zhoudw <zhoudw@infobird.com> Date: Tue, 11 Jan 2022 09:42:46 +0800 Subject: [PATCH] 函数 --- src/views/iframe/iframe.vue | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/views/iframe/iframe.vue b/src/views/iframe/iframe.vue index b0fe525..beef655 100644 --- a/src/views/iframe/iframe.vue +++ b/src/views/iframe/iframe.vue @@ -92,7 +92,8 @@ 'uploadVoice' ], //必填,传入需要使用的接口名称 success: function (res) { - sendMsg({ + console.log(res,'企业微信初始化'); + _this.sendMsg({ action:'init', state:'ok', data:{} @@ -100,7 +101,7 @@ } }); wx.error(function(res){ - sendMsg({ + _this.sendMsg({ action:'init', state:'fail', data:{} @@ -110,7 +111,8 @@ case 'start': // 开始录音 wx.startRecord({ success: function (res) { - sendMsg({ + console.log(res,'开始录音成功'); + _this.sendMsg({ action:'start', state:'ok', data:{} @@ -118,7 +120,7 @@ } }); wx.error(function(res){ - sendMsg({ + _this.sendMsg({ action:'start', state:'fail', data:{} @@ -128,13 +130,15 @@ case 'stop': wx.stopRecord({ success: function (res) { + console.log(res,'停止录音成功'); var localId = res.localId; wx.uploadVoice({ localId: localId, // 需要识别的音频的本地Id,由录音相关接口获得,音频时长不能超过60秒 isShowProgressTips: 0, // 默认为1,显示进度提示 success: function (ures) { + console.log(ures,'上传录音成功'); let serverId = ures.serverId; - sendMsg({ + _this.sendMsg({ action:'stop', state:'ok', data:{ @@ -147,7 +151,7 @@ } }); wx.error(function(res){ - sendMsg({ + _this.sendMsg({ action:'start', state:'fail', data:{} -- Gitblit v1.8.0