| | |
| | | <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" /> |
| | |
| | | const recorderManager = uni.getRecorderManager() |
| | | |
| | | export default { |
| | | props: ['names'], |
| | | props: ['names','callname'], |
| | | data() { |
| | | return { |
| | | isrecord: false, |
| | |
| | | timer: '', |
| | | vlength: 0, |
| | | pageY: 0, |
| | | audio: "../../static/start-audio.png" |
| | | }; |
| | | }, |
| | | mounted() { |
| | | console.log(this.callname,1111) |
| | | }, |
| | | components: { |
| | | emoji, |
| | |
| | | }, |
| | | // 点击切换音频 |
| | | 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 = '' |
| | |
| | | latitude: res.latitude, |
| | | longitude: res.longitude |
| | | } |
| | | this.send(data, 3) |
| | | console.log('位置名称' + res.name) |
| | | console.log('详细地址' + res.address) |
| | | console.log('维度' + res.latitude) |
| | |
| | | //开始音频 |
| | | openAudio(val) { //Mains |
| | | // console.log(this.names) |
| | | // var socketOpen = false; |
| | | |
| | | |
| | | uni.navigateTo({ |
| | | url: '../videoCall/videoCall?state=' + val + '&type=audio' |
| | | }); |
| | |
| | | }, |
| | | //开始视频 |
| | | openVideo(val) { //Mains |
| | | // uni.onSocketOpen(function(res) { |
| | | // // socketOpen = true; |
| | | // console.log('持续连接成功') |
| | | // sendSocketMessage(); |
| | | // }); |
| | | |
| | | // function sendSocketMessage() { |
| | | // var data = { |
| | | // name: this.$store.state.puserName, |
| | | // id: this.names[1], |
| | | // // id: state.puserID, |
| | | // type: 'video' |
| | | // } |
| | | // // if (socketOpen) { |
| | | // uni.sendSocketMessage({ |
| | | // data: JSON.stringify(data) |
| | | // }); |
| | | // // } |
| | | // } |
| | | var url = '../videoCall/videoCall?state=' + val + '&type=video' + '&myname=' + this.names[0] + |
| | | '&toname=' + this.names[1] + '&callname=' + this.callname |
| | | console.log(url) |
| | | uni.navigateTo({ |
| | | url: '../videoCall/videoCall?state=' + val + '&type=video' + '&myname=' + this.names[0] + |
| | | '&toname=' + this.names[1] |
| | | url: url |
| | | }); |
| | | }, |
| | | //接收视频 |
| | | receiveVideo(val, room) { //Receiver |
| | | uni.navigateTo({ |
| | | url: '../videoCall/videoCall?state=' + val + '&type=video' + '&room=' + room |
| | | }); |
| | | } |
| | | // receiveVideo(val, room) { //Receiver |
| | | // uni.navigateTo({ |
| | | // url: '../videoCall/videoCall?state=' + val + '&type=video' + '&room=' + room |
| | | // }); |
| | | // } |
| | | }, |
| | | mounted() { |
| | | // uni.onSocketMessage(function(res) { |