- 微信sdk支付 “errmsg”:"chooseWXPay"
报错: 微信sdk支付 “errmsg”:"chooseWXPay":permission denied结果: 无法支付 环境: Android 8.1.0; PAAM00 Build/OPM1.171019.011; 复现: 偶现,小概率
2019-07-15 - 这个bug简直无话可说
[代码]const query = wx.createSelectorQuery() query.select([代码][代码]'.main-container'[代码][代码]).boundingClientRect(res => { console.log([代码][代码]'.main-container'[代码][代码], e.scrollTop, res.top) [代码][代码]this[代码][代码].setData({ [代码][代码]//节点的上边界坐标 headFixed: res.top <= 0, }) }).exec() [代码] [代码] [代码][代码]query.select([代码][代码]'.fixed-head'[代码][代码]).boundingClientRect(res => { console.log([代码][代码]'.fixed-head'[代码][代码], e.scrollTop, res.top) [代码][代码]this[代码][代码].setData({ [代码][代码]//节点的上边界坐标 headFixed: res.top <= 0, }) }).exec() [代码] [代码] [代码][代码]query.select([代码][代码]'.scroll-view-container'[代码][代码]).boundingClientRect(res => { console.log([代码][代码]'.scroll-view-container'[代码][代码], e.scrollTop, res.top) [代码][代码]this[代码][代码].setData({ [代码][代码]//节点的上边界坐标 headFixed: res.top <= 0, }) }).exec()[代码][图片] 选择不同元素,获取数据完全一样????
2018-11-23 - onShareAppMessage 处理多个顺序异步请求能且只能执行一个
[代码]onShareAppMessage() {[代码][代码] [代码][代码]// 生成带场景值的小程序码[代码][代码] [代码][代码]entry.generationMiniProgramCode(path, JSON.stringify(param), result => {[代码][代码] [代码][代码]let o = {[代码][代码] [代码][代码]title: [代码][代码]'VIP微课,音乐人的在线大学'[代码][代码],[代码][代码] [代码][代码]// path: path + '?scene=' + result.scene,[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log([代码][代码]'分享success'[代码][代码])[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]// 记录用户分享行为[代码][代码] [代码][代码]entry.postUserShare(path, result.scene, shareResult => {[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'分享成功'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]'none'[代码][代码],[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail(res) {[代码][代码] [代码][代码]console.log([代码][代码]'fail'[代码][代码])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]o[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码]
2018-05-16 - 安卓系统不触发背景音乐播放器的stop及pause回调
[代码]setMusicMonitor() {[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码] [代码][代码]let node = [代码][代码]this[代码][代码].data.nodes.find(x => x.id === that.data.audioId)[代码][代码] [代码][代码]const backgroundAudioManager = app.globalData.backgroundAudioManager[代码][代码] [代码][代码]wx.onBackgroundAudioPlay(e => {[代码][代码] [代码][代码]console.log([代码][代码]'playing...'[代码][代码])[代码][代码] [代码][代码]app.globalData.g_isBackgroundAudioManagerPaused = [代码][代码]false[代码][代码] [代码][代码]node && !node.isPlayingMusic ? that.onMusicTap({[代码][代码] [代码][代码]currentTarget: node[代码][代码] [代码][代码]}) : [代码][代码]null[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onBackgroundAudioPause(e => {[代码][代码] [代码][代码]console.log([代码][代码]'pausing...'[代码][代码])[代码][代码] [代码][代码]app.globalData.g_isBackgroundAudioManagerPaused = [代码][代码]true[代码][代码] [代码][代码]node && node.isPlayingMusic ? that.onMusicTap({[代码][代码] [代码][代码]currentTarget: node[代码][代码] [代码][代码]}) : [代码][代码]null[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onBackgroundAudioStop(e => {[代码][代码] [代码][代码]console.log([代码][代码]'stopping...'[代码][代码])[代码][代码] [代码][代码]let node = that.data.nodes.find(x => x.id === that.data.audioId)[代码][代码] [代码][代码]if[代码] [代码](node) {[代码][代码] [代码][代码]// TODO: 关闭背景音乐 从头播放有bug[代码][代码] [代码][代码]// let meaningFulStopPoint = app.globalData.g_duration - app.globalData.g_listened < .5 ? app.globalData.g_duration : app.globalData.g_listened[代码][代码] [代码][代码]course.putCourseDuration([代码][代码]this[代码][代码].data.courseid, node.id, 1000 * convertTimeToSeconds(node.duration), 1000 * convertTimeToSeconds(node.duration), )[代码][代码] [代码][代码]}[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]nodes: that.data.nodes.map(x => {[代码][代码] [代码][代码]if[代码] [代码](x.id === that.data.audioId) {[代码][代码] [代码][代码]x.isPlayingMusic = [代码][代码]false[代码][代码] [代码][代码]x.listened = processTotalDuration(0)[代码][代码] [代码][代码]x.percent = 0[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]x[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]let nexAudio = that.data.nodes[that.data.nextAudioIndex][代码][代码] [代码][代码]that.onMusicTap({[代码][代码] [代码][代码]currentTarget: nexAudio[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码]
2018-05-08 - 音频播放IOS上最后2s无法播放
模拟机上完好,真机运行总是有最后两秒钟无法播放(还剩2s就触发了停止播放)。求助,推测是小程序时间更新的延迟性导致。SOS [代码]methods: {[代码][代码] [代码][代码]setMusicMonitor() {[代码][代码] [代码][代码]const backgroundAudioManager = app.globalData.backgroundAudioManager[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码] [代码][代码]let node = [代码][代码]this[代码][代码].data.node[代码][代码] [代码][代码]//点击播放图标和总控开关都会触发这个函数[代码][代码] [代码][代码]wx.onBackgroundAudioPlay(e => {[代码][代码] [代码][代码]console.log([代码][代码]'playing...'[代码][代码])[代码][代码] [代码][代码]node.isPlayingMusic ? [代码][代码]null[代码] [代码]: that.onMusicTap()[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onBackgroundAudioPause(e => {[代码][代码] [代码][代码]console.log([代码][代码]'pausing...'[代码][代码])[代码][代码] [代码][代码]node.isPlayingMusic ? that.onMusicTap() : [代码][代码]null[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onBackgroundAudioStop(e => {[代码][代码] [代码][代码]if[代码] [代码](app.globalData.g_trackAudioProgress.get(node.id)) {[代码][代码] [代码][代码]// 循环播放 TODO:[代码][代码] [代码][代码]if[代码] [代码](app.globalData.g_trackAudioProgress.get(node.id).stopPoint >= app.globalData.g_trackAudioProgress.get(node.id).duration - 3) {[代码][代码] [代码][代码]app.globalData.g_trackAudioProgress.set(node.id, {[代码][代码] [代码][代码]duration: backgroundAudioManager.duration,[代码][代码] [代码][代码]stopPoint: 0[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]console.log([代码][代码]'stopping...'[代码][代码], app.globalData.g_trackAudioProgress.get(node.id))[代码][代码] [代码][代码]node.isPlayingMusic ? that.onMusicTap() : [代码][代码]null[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]onMusicTap(event) {[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码] [代码][代码]let node = [代码][代码]this[代码][代码].data.node[代码][代码] [代码][代码]let isPlayingMusic = node.isPlayingMusic[代码][代码] [代码][代码]// let audioProgress = app.globalData.g_trackAudioProgress.get(node.id)[代码][代码] [代码][代码]const backgroundAudioManager = app.globalData.backgroundAudioManager[代码][代码] [代码][代码]node.isPlayingMusic = [代码][代码]this[代码][代码].data.node.isPlayingMusic[代码][代码] [代码][代码]node.stopPoint = processTotalDuration([代码][代码]this[代码][代码].data.node.listened)[代码] [代码] [代码][代码]backgroundAudioManager.onTimeUpdate(e => {[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]duration: processTotalDuration(backgroundAudioManager.duration),[代码][代码] [代码][代码]currentTime: processTotalDuration(backgroundAudioManager.currentTime),[代码][代码] [代码][代码]percent: parseInt(100 * (backgroundAudioManager.currentTime / backgroundAudioManager.duration))[代码][代码] [代码][代码]})[代码][代码] [代码][代码]app.globalData.g_trackAudioProgress.set(node.id, {[代码][代码] [代码][代码]duration: backgroundAudioManager.duration,[代码][代码] [代码][代码]stopPoint: backgroundAudioManager.currentTime[代码][代码] [代码][代码]})[代码][代码] [代码][代码]if[代码] [代码](app.globalData.g_trackAudioProgress.get(node.id)) {[代码][代码] [代码][代码]// 循环播放 TODO:[代码][代码] [代码][代码]if[代码] [代码](app.globalData.g_trackAudioProgress.get(node.id).stopPoint >= (app.globalData.g_trackAudioProgress.get(node.id).duration) - 3) {[代码][代码] [代码][代码]app.globalData.g_trackAudioProgress.set(node.id, {[代码][代码] [代码][代码]duration: backgroundAudioManager.duration,[代码][代码] [代码][代码]stopPoint: 0,[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]console.log(app.globalData.g_trackAudioProgress.get(node.id))[代码][代码] [代码][代码]})[代码][代码] [代码][代码]// 穿透:改变数据源(course-text)里[代码][代码] [代码][代码]this[代码][代码].triggerEvent([代码][代码]'customevent'[代码][代码], node, {[代码][代码] [代码][代码]bubbles: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]// 再加事件绑定[代码][代码] [代码][代码]this[代码][代码].setMusicMonitor()[代码][代码] [代码][代码]if[代码] [代码](isPlayingMusic) {[代码][代码] [代码][代码]// 暂停回调[代码][代码] [代码][代码]backgroundAudioManager.pause(e => {[代码][代码] [代码][代码]console.log([代码][代码]'will plause'[代码][代码])[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]backgroundAudioManager.src = `${node.content}`[代码][代码] [代码][代码]backgroundAudioManager.title = node.title[代码][代码] [代码][代码]// 首次点击,从node中获取时间,之后从audioProgress获取[代码][代码] [代码][代码]backgroundAudioManager.startTime = that.data.isFirstTap ? convertTimeToSeconds(that.data.node.listened) : app.globalData.g_trackAudioProgress.get(node.id) && app.globalData.g_trackAudioProgress.get(node.id).stopPoint[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]isFirstTap: [代码][代码]false[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log([代码][代码]'will play'[代码][代码])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码] [代码][代码]}[代码]
2018-05-03