Commit ecf70ae3 authored by Mac's avatar Mac

1

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