|
|
@ -64,9 +64,12 @@ |
|
|
<text style="color:red;font-size:22rpx;">*长按“语音”按钮录入,系统将自动识别</text> |
|
|
<text style="color:red;font-size:22rpx;">*长按“语音”按钮录入,系统将自动识别</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-bottom"> |
|
|
<view class="popup-bottom"> |
|
|
<view class="popup-btn" @touchstart="kaishi" @touchend="jieshu">语音</view> |
|
|
<view class="popup-btn" @tap="clearText">清空</view> |
|
|
<view class="popup-btn" @tap="setDetail">确认</view> |
|
|
<view class="popup-btn" @tap="setDetail">确认</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="voice-btn" @touchstart="kaishi" @touchend="jieshu"> |
|
|
|
|
|
<img src="/static/images/maikefeng.png" style="width: 80%;height: 80%;margin: 10%;" alt=""> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</uni-popup> |
|
|
</uni-popup> |
|
|
@ -273,17 +276,22 @@ |
|
|
manager.stop() |
|
|
manager.stop() |
|
|
//有新的识别内容返回,则会调用此事件 |
|
|
//有新的识别内容返回,则会调用此事件 |
|
|
manager.onRecognize = (res) => { |
|
|
manager.onRecognize = (res) => { |
|
|
this.voiceText = res.result |
|
|
// this.voiceText = res.result |
|
|
} |
|
|
} |
|
|
manager.onStart = function(res) { |
|
|
manager.onStart = function(res) { |
|
|
this.voiceText = "onStart:" + res.msg + "正在录音" |
|
|
// this.voiceText = "onStart:" + res.msg + "正在录音" |
|
|
} |
|
|
} |
|
|
// 识别结束事件 |
|
|
// 识别结束事件 |
|
|
manager.onStop = (res) => { |
|
|
manager.onStop = (res) => { |
|
|
this.voiceText = res.result |
|
|
if (res.result == '') { |
|
|
if (res.result == '') { |
|
|
this.showRecordEmptyTip() |
|
|
this.showRecordEmptyTip() |
|
|
return |
|
|
return |
|
|
} |
|
|
|
|
|
if(this.voiceText == ''){ |
|
|
|
|
|
this.voiceText = res.result |
|
|
|
|
|
}else{ |
|
|
|
|
|
res.result = '\n' + res.result |
|
|
|
|
|
this.voiceText += res.result |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -508,6 +516,10 @@ |
|
|
this.tui.toast(res.message) |
|
|
this.tui.toast(res.message) |
|
|
} |
|
|
} |
|
|
}).catch((res) => {}) |
|
|
}).catch((res) => {}) |
|
|
|
|
|
}, |
|
|
|
|
|
//清空语音输入的文字 |
|
|
|
|
|
clearText(){ |
|
|
|
|
|
this.voiceText = '' |
|
|
}, |
|
|
}, |
|
|
//查看大图 |
|
|
//查看大图 |
|
|
largeImg(img) { |
|
|
largeImg(img) { |
|
|
@ -639,6 +651,7 @@ |
|
|
obj.createByName = item.createByName |
|
|
obj.createByName = item.createByName |
|
|
dataList.push(obj) |
|
|
dataList.push(obj) |
|
|
} |
|
|
} |
|
|
|
|
|
console.log(dataList); |
|
|
uni.setStorageSync('carList1', JSON.stringify(dataList)) |
|
|
uni.setStorageSync('carList1', JSON.stringify(dataList)) |
|
|
uni.setStorageSync('khName', '') |
|
|
uni.setStorageSync('khName', '') |
|
|
} |
|
|
} |
|
|
@ -1000,5 +1013,14 @@ |
|
|
border-bottom: 1px solid #eee; |
|
|
border-bottom: 1px solid #eee; |
|
|
border-top: 1px solid #eee; |
|
|
border-top: 1px solid #eee; |
|
|
color: #fff; |
|
|
color: #fff; |
|
|
|
|
|
} |
|
|
|
|
|
.voice-btn{ |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
bottom: -300rpx; |
|
|
|
|
|
left: 30%; |
|
|
|
|
|
width: 200rpx; |
|
|
|
|
|
height: 200rpx; |
|
|
|
|
|
background: #eee; |
|
|
|
|
|
border-radius: 50%; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |