智慧保安互联网APP
shuishen
2021-11-25 919cf3e086c89141a2cabd4e92a1776f6b32679a
components/submit/submit.vue
@@ -3,7 +3,7 @@
      <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" />
@@ -87,6 +87,7 @@
            timer: '',
            vlength: 0,
            pageY: 0,
            audio: "../../static/start-audio.png"
         };
      },
      mounted() {
@@ -105,12 +106,19 @@
         },
         // 点击切换音频
         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() {
@@ -170,10 +178,12 @@
         },
         // 发送消息
         send(msg, type) {
            let data = {
               message: msg,
               types: type
            }
            this.$emit('inputs', data)
            setTimeout(() => {
               this.msg = ''
@@ -225,6 +235,7 @@
            clearInterval(this.timer)
            recorderManager.stop()
            recorderManager.onStop((res) => {
               console.log(res, 4589)
               let data = {
                  voice: res.tempFilePath,
                  time: this.vlength