| | |
| | | if (code === '0' || code === 0) { |
| | | that.setData({ |
| | | value: that.data.value + data || '', |
| | | number: (that.data.value + data || '').length, |
| | | }); |
| | | } else { |
| | | $$.showToast({ |
| | |
| | | */ |
| | | onLoad(options) { |
| | | let { |
| | | type |
| | | type, |
| | | value |
| | | } = options |
| | | console.log('type', type); |
| | | this.setData({ |
| | | key: type |
| | | key: type, |
| | | value, |
| | | number: value?.length || 0, |
| | | }) |
| | | wx.getSetting({ |
| | | success(res) { |
| | | if (res.authSetting['scope.record'] === false) { |
| | | $$.hideLoading(); |
| | | $$.showModal({ |
| | | content: '抱歉!此功能需授权麦克风录音功能', |
| | | confirmText: '跳转授权', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | wx.openSetting({ |
| | | success(res) { |
| | | if (res.authSetting['scope.record']) { |
| | | $$.showToast({ |
| | | title: '授权成功' |
| | | }); |
| | | } else { |
| | | $$.showToast({ |
| | | title: '授权失败' |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | }) |