Commit ecf70ae3 authored by Mac's avatar Mac

1

parent bbf63be6
......@@ -92,8 +92,9 @@
}
.release .as-box{
width: 100%;
height: 235px;
height: 240px;
background: #FFFFFF;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
......@@ -123,6 +124,7 @@
flex-direction: row;
align-items: center;
justify-content: space-around;
margin-top: 5px;
}
.release .as-btn-item{
width: 85px;
......@@ -247,20 +249,24 @@
<!-- 音频模块 -->
<u-popup v-model="audioshow" mode="bottom" >
<view class="as-box">
<view class="as-yuyin"
@longpress="onStartRecoder"
@touchend="onEndRecoder"
>
<view style="width: 40px;height: 40px;display: flex;align-items: center;justify-content: center;
position: absolute;right: 0;top: 0;" @click="audioshow=false">
<u-icon name="cross" :size="50" color="#333"></u-icon>
</view>
<view class="as-yuyin">
<image v-if="gifshow==false" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mic.png" mode="widthFix" style="width: 37px;height: auto;"></image>
<image v-if="gifshow==true" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/luyin.gif" mode="widthFix" style="width: 37px;height: auto;"></image>
</view>
<text class="now-date">{{ reDate }}</text>
<text class="now-date">{{reDate2!=reDate && voicePath!=''?(reDate2+'/'):''}}{{ reDate }}</text>
<view class="as-btn">
<view class="as-btn-item" @click="audioshow=false">
取消
<view class="as-btn-item" @click="luyintype!=2? playVoice():''">
试听
</view>
<view class="as-btn-item" style="background: #40766E;color: #FFFFFF;" @click="onStartRecoder">
{{luyintype==1?'开始':(luyintype==2?'结束':'重录制')}}
</view>
<view class="as-btn-item" @click="asupload()">
<view class="as-btn-item" @click="luyintype!=2?asupload():''">
确定
</view>
</view>
......@@ -312,6 +318,7 @@
gifshow:false,
playshow:false,
controls:false,//显示默认控件
luyintype:1,
}
},
......@@ -429,6 +436,8 @@
console.log(r)
that.reDate = '00:00'
that.audioshow = true;
that.voicePath = ''
that.luyintype=1;
},fail(){
wx.showModal({
title: '录音管理器',
......@@ -445,6 +454,8 @@
})
that.reDate = '00:00'
that.audioshow = true;
that.voicePath = ''
that.luyintype=1;
} else {
wx.showToast({
title: '授权失败',
......@@ -468,6 +479,8 @@
}else{
that.reDate = '00:00'
that.audioshow = true;
that.voicePath = ''
that.luyintype=1;
}
}
})
......@@ -528,21 +541,32 @@
this.reDate = '00:00'
this.addMsg.FileList=[];
this.audioshow= true;
this.luyintype=1;
clearInterval(this.timer)
innerAudioContext.stop();//视频播放完停止
},
// 开始录制
onStartRecoder () {
console.log('长按')
if(this.luyintype==1){
this.gifshow = true
recorderManager.start({
duration: 600000,
format:'mp3'
})
},
// 录制结束
onEndRecoder () {
this.luyintype=2
}else if(this.luyintype==2){// 录制结束
console.log('结束')
this.gifshow = false
recorderManager.stop()
this.luyintype=3
}else{
this.reset()
}
},
shiting(){//试听
innerAudioContext.src = this.voicePath;
},
// 播放暂停录音
playVoice() {
......@@ -630,8 +654,14 @@
},
// 音频的上传
asupload(){
innerAudioContext.stop();//
clearInterval(this.timer)
let that = this
that.reDate2 = '00:00'
that.playshow=false
that.nowbofo=false;//控制播放的字段
that.sec = 0
that.min = 0
uni.uploadFile({
url: that.action,
filePath: that.voicePath,
......
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