十年網(wǎng)站開(kāi)發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶(hù) + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營(yíng)維護(hù)+專(zhuān)業(yè)推廣+無(wú)憂(yōu)售后,網(wǎng)站問(wèn)題一站解決
今天就跟大家聊聊有關(guān)使用小程序如何實(shí)現(xiàn)錄音功能,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
首先判斷權(quán)限
getPermission: function() { var that = this; wx.getSetting({ success(res) { console.log(res.authSetting) if (res.authSetting["scope.record"] === false) { wx.showModal({ title: '是否錄音', content: '是否錄音', success: function (tip) { if (tip.confirm) { wx.openSetting({ success: function (data) { if (data.authSetting["scope.record"] === true) { wx.showToast({ title: '授權(quán)成功', icon: 'success', duration: 1000 }) that.startLuYin() //授權(quán)成功之后,再調(diào)用chooseLocation選擇地方 } else { wx.showToast({ title: '授權(quán)失敗', icon: 'success', duration: 1000 }) } } }) } } }) }else{ that.startLuYin() } } }) },