|
|
@@ -303,16 +303,21 @@ export const unique = (arr) => {
|
|
|
|
|
|
//点击声效 shish
|
|
|
export const hitRemind = () =>{
|
|
|
- if(uni.getSystemInfoSync().platform != 'windows'){
|
|
|
- const innerAudioContext = uni.createInnerAudioContext()
|
|
|
- innerAudioContext.autoplay = true
|
|
|
- innerAudioContext.src = '/static/hit.mp3'
|
|
|
- innerAudioContext.onPlay()
|
|
|
- innerAudioContext.onError()
|
|
|
- innerAudioContext.onPause(function() {
|
|
|
- innerAudioContext.destroy()
|
|
|
- })
|
|
|
- }
|
|
|
+ try {
|
|
|
+ if(uni.getSystemInfoSync().platform != 'windows'){
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext()
|
|
|
+ innerAudioContext.autoplay = true
|
|
|
+ innerAudioContext.src = '/static/hit.mp3'
|
|
|
+ innerAudioContext.onPlay()
|
|
|
+ innerAudioContext.onError()
|
|
|
+ innerAudioContext.onPause(function() {
|
|
|
+ innerAudioContext.destroy()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ // 开发环境兼容处理
|
|
|
+ console.warn('开发环境音频播放异常(可忽略):', e);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -413,17 +418,22 @@ export const isScanEnv = () =>{
|
|
|
|
|
|
//没有库存时的语音播放 shish
|
|
|
export const noStockRemind = () =>{
|
|
|
- if(uni.getSystemInfoSync().platform != 'windows'){
|
|
|
- const innerAudioContext = uni.createInnerAudioContext()
|
|
|
- innerAudioContext.autoplay = true
|
|
|
- innerAudioContext.src = "/static/noStock.mp3"
|
|
|
- innerAudioContext.volume = 1
|
|
|
- innerAudioContext.onPlay()
|
|
|
- innerAudioContext.onError()
|
|
|
- innerAudioContext.onPause(function() {
|
|
|
- innerAudioContext.destroy()
|
|
|
- })
|
|
|
- }
|
|
|
+ try{
|
|
|
+ if(uni.getSystemInfoSync().platform != 'windows'){
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext()
|
|
|
+ innerAudioContext.autoplay = true
|
|
|
+ innerAudioContext.src = "/static/noStock.mp3"
|
|
|
+ innerAudioContext.volume = 1
|
|
|
+ innerAudioContext.onPlay()
|
|
|
+ innerAudioContext.onError()
|
|
|
+ innerAudioContext.onPause(function() {
|
|
|
+ innerAudioContext.destroy()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ // 开发环境兼容处理
|
|
|
+ console.warn('开发环境音频播放异常(可忽略):', e);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
export async function callUp(mobile){
|