Commit 7187387a authored by Mac's avatar Mac

1

parent 624cc72e
......@@ -78,6 +78,7 @@
flex-direction: row;
align-items: center;
justify-content: center;
padding: 0 10px;
}
.release .audio-o{
display: flex;
......@@ -131,6 +132,12 @@
color: #40766E;
border: 1px solid #40766E;
}
.release .audio-ot{
width: 1;flex:1;margin-right: 20px;display: flex;flex-direction: row;align-items: center;padding: 0 10px;justify-content: space-between;
height: 20px;
background: #EBEBEB;
border-radius: 4px;
}
</style>
<template>
......@@ -150,11 +157,21 @@
</u-upload>
<!-- 音频 -->
<view class="audio" v-if='addMsg.FileType==3'>
<view class="audio-o" @click="statraudio()">
<view class="audio-o" @click="statraudio()" v-if="addMsg.FileList.length==0">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound2.png" mode="widthFix" style="width: 20px;height: auto;"></image>
<text style="margin-left: 10px;">语音录制</text>
<text style="color: #BBBBBB;">(点击进入录制页面)</text>
</view>
<view v-if="addMsg.FileList.length>0" class="audio-o" style="justify-content: space-around;width: 100%;">
<view class="audio-ot" @click="playVoice">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound2.png" mode="widthFix" style="width: 20px;height: auto;"></image>
<text>{{reDate}}</text>
</view>
<view style="font-size: 14px;color: #40766E;">
重新录制
</view>
</view>
</view>
<view class="option-box" @click="getAddress()" style="margin-top: 10px;">
......@@ -195,6 +212,7 @@
<u-popup v-model="audioshow" mode="bottom" >
<view class="as-box">
<view class="as-yuyin"
@click="aa"
@longpress="onStartRecoder"
@touchend="onEndRecoder"
>
......@@ -388,15 +406,28 @@
})
},
// 开始录制
onStartRecoder () {
console.log('长按')
recorderManager.start({
duration: 600000
duration: 600000,
format:'mp3'
})
},
// 录制结束
onEndRecoder () {
recorderManager.stop()
},
// 播放暂停录音
playVoice() {
innerAudioContext.src = this.voicePath;
if (innerAudioContext.paused) {
innerAudioContext.play()
} else {
innerAudioContext.stop();
}
},
// 监听
onMonitorEvents(){
// 录制开始
......@@ -434,7 +465,7 @@
this.reDate = _m + ':' + _s
},
asupload(){
console.log(2)
let that = this
uni.uploadFile({
url: that.action,
......@@ -445,7 +476,9 @@
},
success: (uploadFileRes) => {
if(uploadFileRes.statusCode==200)
console.log(uploadFileRes);
console.log(JSON.parse(uploadFileRes.data));
that.addMsg.FileList=[]
that.addMsg.FileList.push(JSON.parse(uploadFileRes.data).data)
},
fail: function(res) {
console.log(res)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment