Prechádzať zdrojové kódy

Merge branch 'master' of git.huaml.com:zhh/front-end

shizhongqi 11 mesiacov pred
rodič
commit
52c29b8d4c

+ 31 - 21
ghsApp/src/utils/util.js

@@ -324,31 +324,41 @@ export async function callUp(mobile){
 
 //没有库存时的语音播放 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);
+    }
 }
 
 //点击声效 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);
+    }
 }
 
 //去重 姜枫 2021.05.05

+ 0 - 3
hdApp/src/mixins/product2.js

@@ -270,7 +270,6 @@ export default {
 			uni.removeStorageSync('selectList_'+that.selectJobType+'_target_'+that.selectJobId)
 			that.reSetSelectInfo({selectJobType:that.selectJobType,selectJobId:that.selectJobId})
 			//删除多颜色
-			//console.log(that.selectJobType+that.selectJobId)
 			if(that.selectJobType == 'bill'){
 				uni.removeStorageSync("xj"+that.selectJobId)
 			}
@@ -363,9 +362,7 @@ export default {
 				currentCount = currentCount.toFixed(2)
 				let currentNum = Number(item.bigNum) * item.ratio + Number(item.smallNum)
 				currentNum = currentNum.toFixed(2)
-				console.log(currentCount+' '+currentNum)
 				if (Number(currentCount) > Number(currentNum)) {
-					console.log('库存不足。。。')
 					this.$util.noStockRemind()
 					this.$msg("库存不足哦")
 					return

+ 31 - 21
hdApp/src/utils/util.js

@@ -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){