|
@@ -72,7 +72,16 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
-
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext();
|
|
|
+ innerAudioContext.autoplay = true;
|
|
|
+ innerAudioContext.src = '../../../static/mp3/startscan.mp3';
|
|
|
+ innerAudioContext.onPlay(() => {
|
|
|
+ console.log('开始播放');
|
|
|
+ });
|
|
|
+ innerAudioContext.onError((res) => {
|
|
|
+ console.log(res.errMsg);
|
|
|
+ console.log(res.errCode);
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
//手动录入调用
|
|
@@ -86,6 +95,7 @@
|
|
|
tyreNum: this.number_a
|
|
|
}
|
|
|
}).then(res => {
|
|
|
+ console.log(res.data.code)
|
|
|
for (let i = 0; i < this.lisi.length; i++) {
|
|
|
if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
|
|
|
this.$refs.repeat.show({
|
|
@@ -103,7 +113,15 @@
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if (res.data.code == 500){
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: res.data.msg,
|
|
|
+ type: 'default',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
this.$refs.repeat.show({
|
|
|
title: '录入成功',
|
|
|
type: 'success',
|
|
@@ -128,7 +146,7 @@
|
|
|
console.log(this.lisi)
|
|
|
}).catch(err => {
|
|
|
this.$refs.repeat.show({
|
|
|
- title: "请重新录入",
|
|
|
+ title: "网络连接失败",
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|
|
@@ -160,12 +178,41 @@
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext();
|
|
|
+ innerAudioContext.autoplay = true;
|
|
|
+ innerAudioContext.src = '../../../static/mp3/rescan.mp3';
|
|
|
+ innerAudioContext.onPlay(() => {
|
|
|
+ console.log('开始播放');
|
|
|
+ });
|
|
|
+ innerAudioContext.onError((res) => {
|
|
|
+ console.log(res.errMsg);
|
|
|
+ console.log(res.errCode);
|
|
|
+ });
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ if (res.data.code == 500){
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: res.data.msg,
|
|
|
+ type: 'default',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext();
|
|
|
+ innerAudioContext.autoplay = true;
|
|
|
+ innerAudioContext.src = '../../../static/mp3/scanfailed.mp3';
|
|
|
+ innerAudioContext.onPlay(() => {
|
|
|
+ console.log('开始播放');
|
|
|
+ });
|
|
|
+ innerAudioContext.onError((res) => {
|
|
|
+ console.log(res.errMsg);
|
|
|
+ console.log(res.errCode);
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
this.number_s = ""
|
|
|
console.log("我成功啦")
|
|
|
console.log(res)
|
|
|
+
|
|
|
this.lisi.push({
|
|
|
specs: res.data.data[0].specs,
|
|
|
flagRegular: res.data.data[0].isRegular,
|
|
@@ -180,6 +227,16 @@
|
|
|
plyRating: res.data.data[0].plyRating,
|
|
|
scanWay: '1'
|
|
|
})
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext();
|
|
|
+ innerAudioContext.autoplay = true;
|
|
|
+ innerAudioContext.src = '../../../static/mp3/scansuccess.mp3';
|
|
|
+ innerAudioContext.onPlay(() => {
|
|
|
+ console.log('开始播放');
|
|
|
+ });
|
|
|
+ innerAudioContext.onError((res) => {
|
|
|
+ console.log(res.errMsg);
|
|
|
+ console.log(res.errCode);
|
|
|
+ });
|
|
|
this.$refs.repeat.show({
|
|
|
title: '扫码成功',
|
|
|
type: 'success',
|
|
@@ -213,7 +270,7 @@
|
|
|
scancodein() {
|
|
|
if (this.lisi == '') {
|
|
|
this.$refs.repeat.show({
|
|
|
- title: '请扫码后再点击!',
|
|
|
+ title: '请扫码或录入后再点击!',
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|