|
@@ -489,26 +489,27 @@
|
|
|
},
|
|
},
|
|
|
/******语音备注 *******/
|
|
/******语音备注 *******/
|
|
|
//语音备忘播放
|
|
//语音备忘播放
|
|
|
- async voicePlay(item) {
|
|
|
|
|
|
|
+ voicePlay(item) {
|
|
|
|
|
+ const url = uni.getStorageSync('fileBrowseEnvironmentS') + '/' + item;
|
|
|
|
|
+ // #ifdef WEB
|
|
|
|
|
+ const audio = new Audio(url);
|
|
|
|
|
+ audio.play().then(() => {
|
|
|
|
|
+ uni.showToast({ title: '开始播放', icon: "none", mask: true });
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ uni.showToast({ title: '播放失败', icon: "none", mask: true });
|
|
|
|
|
+ });
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ // #ifndef WEB
|
|
|
const innerAudioContext = uni.createInnerAudioContext();
|
|
const innerAudioContext = uni.createInnerAudioContext();
|
|
|
- // innerAudioContext.autoplay = true;
|
|
|
|
|
- innerAudioContext.src = uni.getStorageSync('fileBrowseEnvironmentS') + '/' + item;
|
|
|
|
|
|
|
+ innerAudioContext.src = url;
|
|
|
|
|
+ innerAudioContext.autoplay = true;
|
|
|
innerAudioContext.onPlay(() => {
|
|
innerAudioContext.onPlay(() => {
|
|
|
- // console.log('开始播放');
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '开始播放',
|
|
|
|
|
- icon: "none",
|
|
|
|
|
- mask: true,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ uni.showToast({ title: '开始播放', icon: "none", mask: true });
|
|
|
});
|
|
});
|
|
|
- innerAudioContext.onError((res) => {
|
|
|
|
|
- // console.log('播放失败');
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '播放失败',
|
|
|
|
|
- icon: "none",
|
|
|
|
|
- mask: true,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ innerAudioContext.onError(() => {
|
|
|
|
|
+ uni.showToast({ title: '播放失败', icon: "none", mask: true });
|
|
|
});
|
|
});
|
|
|
|
|
+ // #endif
|
|
|
},
|
|
},
|
|
|
//语音备忘删除
|
|
//语音备忘删除
|
|
|
async voiceDele(item, voiceIndex) {
|
|
async voiceDele(item, voiceIndex) {
|