|
|
|
@ -37,32 +37,54 @@ export default { |
|
|
|
let title = msg.title |
|
|
|
let payload = JSON.stringify(msg.payload) |
|
|
|
plus.push.createMessage(content, payload, { |
|
|
|
title: title |
|
|
|
title: title, |
|
|
|
}) |
|
|
|
if (msg.payload.messageType == 4) { |
|
|
|
enquiryVoice() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (client === 'android') { |
|
|
|
let title = msg.title |
|
|
|
let content = msg.content |
|
|
|
plus.push.createMessage(content, JSON.stringify(msg.payload), { |
|
|
|
title: title |
|
|
|
title: title, |
|
|
|
}) |
|
|
|
if (msg.payload.messageType == 4) { |
|
|
|
enquiryVoice() |
|
|
|
} |
|
|
|
} |
|
|
|
// 在线语音播放 |
|
|
|
// if(mes.payload.messageType == 1){ |
|
|
|
|
|
|
|
// } |
|
|
|
}, |
|
|
|
false |
|
|
|
) |
|
|
|
}, 1000) |
|
|
|
// #endif |
|
|
|
let timer = null |
|
|
|
function enquiryVoice() { |
|
|
|
if (timer) { |
|
|
|
clearTimeout(timer) |
|
|
|
timer = null |
|
|
|
} |
|
|
|
timer = setTimeout(() => { |
|
|
|
const innerAudioContext = uni.createInnerAudioContext() |
|
|
|
innerAudioContext.autoplay = true |
|
|
|
innerAudioContext.src = 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/BasePaperInquiryVoice.mp3' |
|
|
|
innerAudioContext.onPlay(() => { |
|
|
|
console.log('开始播放') |
|
|
|
}) |
|
|
|
innerAudioContext.onError((res) => { |
|
|
|
console.log(res.errMsg) |
|
|
|
console.log(res.errCode) |
|
|
|
}) |
|
|
|
}, 3000) |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow: function () { |
|
|
|
// 先默认进入应用就清除所有消息 |
|
|
|
plus.runtime.setBadgeNumber(0) |
|
|
|
}, |
|
|
|
onHide: function () {} |
|
|
|
onHide: function () {}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
|