| | |
| | | <view class="submit"> |
| | | <view class="submit-chat"> |
| | | <view class="bt-img"> |
| | | <image src="../../static/images/chatroom/voice.png" mode="" @tap="records" /> |
| | | <image :src="audio" mode="" @tap="records" /> |
| | | </view> |
| | | <textarea auto-height="true" class="chat-send btn" :class="{displaynone: isrecord}" @input="inputs" |
| | | v-model="msg" @focus="focus" /> |
| | |
| | | timer: '', |
| | | vlength: 0, |
| | | pageY: 0, |
| | | audio: "../../static/start-audio.png" |
| | | }; |
| | | }, |
| | | mounted() { |
| | |
| | | }, |
| | | // 点击切换音频 |
| | | records() { |
| | | if (this.audio == "../../static/start-audio.png") { |
| | | this.audio = "../../static/start-input.png" |
| | | } else { |
| | | this.audio = "../../static/start-audio.png" |
| | | } |
| | | this.isrecord = !this.isrecord |
| | | this.isemoji = false |
| | | this.ismore = false |
| | | |
| | | setTimeout(() => { |
| | | this._getElementHeight() |
| | | }, 10) |
| | | |
| | | }, |
| | | // 点击弹出表情 |
| | | emoji() { |
| | |
| | | }, |
| | | // 发送消息 |
| | | send(msg, type) { |
| | | |
| | | let data = { |
| | | message: msg, |
| | | types: type |
| | | } |
| | | |
| | | this.$emit('inputs', data) |
| | | setTimeout(() => { |
| | | this.msg = '' |
| | |
| | | clearInterval(this.timer) |
| | | recorderManager.stop() |
| | | recorderManager.onStop((res) => { |
| | | console.log(res, 4589) |
| | | let data = { |
| | | voice: res.tempFilePath, |
| | | time: this.vlength |