| | |
| | | clearInterval(this.timer) |
| | | recorderManager.stop() |
| | | recorderManager.onStop((res) => { |
| | | console.log(res, 4589) |
| | | let data = { |
| | | voice: res.tempFilePath, |
| | | time: this.vlength |
| | |
| | | latitude: res.latitude, |
| | | longitude: res.longitude |
| | | } |
| | | this.send(data, 3) |
| | | console.log('位置名称' + res.name) |
| | | console.log('详细地址' + res.address) |
| | | console.log('维度' + res.latitude) |
| | |
| | | |
| | | <!-- 头部 --> |
| | | <u-navbar style="position: relative;" :is-fixed="false" :border-bottom="true" :is-back="true" :title="recName" |
| | | back-icon-color="#fff" :background="{ background: '#0BB9C8' }" title-color="#fff"> |
| | | back-icon-color="#fff" :background="{ background: '#0BB9C8' }" :placeholder="true" title-color="#fff"> |
| | | |
| | | <view slot='right'> |
| | | <!-- <view slot='right'> |
| | | <u-icon @click="chatMessageDetail" class="set-icon" name="more-dot-fill" color="#fff" size="28"> |
| | | </u-icon> |
| | | </view> |
| | | </view> --> |
| | | </u-navbar> |
| | | |
| | | |
| | |
| | | </view> |
| | | <!-- voice --> |
| | | <view class="message" v-if="item.messageType == 2"> |
| | | <view class="msg-text voice" :style="{width:item.postMessage.time * 4 + 50 + 'px'}" |
| | | <view class="msg-text voice" :style="{width:item.postMessage.time * 4 + 60 + 'px'}" |
| | | @tap="playVoice(item.postMessage)"> |
| | | |
| | | <image src="../../static/images/chatroom/sound.png" mode="" class="voice-img" /> |
| | |
| | | </view> |
| | | <!-- voice --> |
| | | <view class="message" v-if="item.messageType == 2"> |
| | | <view class="msg-text voice" :style="{width:item.postMessage.time * 4 + 50 + 'px'}" |
| | | <view class="msg-text voice" :style="{width:item.postMessage.time * 4 + 60 + 'px'}" |
| | | @tap="playVoice(item.postMessage)"> |
| | | {{ item.postMessage.time }}" |
| | | <image src="@/static/images/chatroom/sound.png" mode="" class="voice-img" /> |
| | |
| | | |
| | | if (this.isJSON(option.data) == true) { |
| | | data = JSON.parse(option.data) |
| | | |
| | | } |
| | | |
| | | |
| | | console.log(data, 55555555555555555555555) |
| | | this.name = ['wo', option.chatID]; |
| | | // console.log(data) |
| | | if (typeof data.recipientName == "undefined") { |
| | | this.callName = data.realName; |
| | | } else { |
| | |
| | | let that = this; |
| | | uni.getSystemInfo({ |
| | | success(e) { |
| | | // console.log(e); |
| | | let { |
| | | windowWidth, |
| | | windowHeight, |
| | |
| | | .exec(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | onUnload() { |
| | | var innerAudioContext = this.innerAudioContext = uni.createInnerAudioContext() |
| | | |
| | | innerAudioContext.destroy() |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | that.recAvatar = resdata[i].avatar; |
| | | that.recName = resdata[i].realName; |
| | | } |
| | | |
| | | } |
| | | let msg = res.data.data.chatRecordsIPage |
| | | that.getData = msg; |
| | |
| | | } |
| | | |
| | | that.msgs.unshift(msg[i]) |
| | | |
| | | } |
| | | |
| | | that.$nextTick(() => { |
| | |
| | | }, |
| | | // 音频播放 |
| | | playVoice(e) { |
| | | console.log(e, 'ok') |
| | | |
| | | var innerAudioContext = this.innerAudioContext = uni.createInnerAudioContext() |
| | | // innerAudioContext.autoplay = false |
| | |
| | | }, |
| | | // 接收输入内容 |
| | | inputs(e) { |
| | | |
| | | console.log(e, 999) |
| | | |
| | | var that = this; |
| | | this.isanimation = true |
| | | let len = this.msgs.length - 1 |
| | |
| | | mesagess = e.message |
| | | } |
| | | |
| | | |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/chat-records/insertSingleChat", |
| | | method: "post", |
| | |
| | | }, |
| | | success: (res) => { |
| | | |
| | | console.log(res, 89898) |
| | | |
| | | } |
| | | }); |
| | | |
| | | this.msgs.push(sendMsg) |
| | | |
| | | console.log(this.msgs, 789) |
| | | |
| | | this.$nextTick(() => { |
| | | this.scrollToView = 'msg' + len |
| | | }) |
| | |
| | | heights(e) { |
| | | this.inputh = e |
| | | this.goBottom() |
| | | // console.log('高度' + e) |
| | | }, |
| | | // 滚动到底部 |
| | | goBottom() { |
| | |
| | | </view> |
| | | <!-- voice --> |
| | | <view class="message" v-if="item.message_type == 2"> |
| | | <view class="msg-text voice" :style="{width:item.post_message.time * 4 + 'px'}" |
| | | @tap="playVoice(item.post_message.voice)"> |
| | | <view class="msg-text voice" :style="{width:item.post_message.time * 4 + 60 + 'px'}" |
| | | @tap="playVoice(item.post_message)"> |
| | | |
| | | <image src="../../static/images/chatroom/sound.png" mode="" class="voice-img" /> |
| | | {{ item.post_message.time }} " |
| | | {{ item.post_message.time }}" |
| | | |
| | | </view> |
| | | </view> |
| | | <!-- location --> |
| | |
| | | </view> |
| | | <!-- voice --> |
| | | <view class="message" v-if="item.message_type == 2"> |
| | | <view class="msg-text voice" :style="{width:item.post_message.time * 4 + 'px'}" |
| | | @tap="playVoice(item.post_message.voice)"> |
| | | {{ item.post_message.time }} " |
| | | <view class="msg-text voice" :style="{width:item.post_message.time * 4 + 60 + 'px'}" |
| | | @tap="playVoice(item.post_message)"> |
| | | {{ item.post_message.time }}" |
| | | <image src="@/static/images/chatroom/sound.png" mode="" class="voice-img" /> |
| | | </view> |
| | | </view> |
| | |
| | | import filter from '@/config/filter.js' |
| | | import submit from '@/components/submit/submit.vue' |
| | | import WxStorage from "../../static/lib/wxStorage.js" |
| | | const innerAudioContext = uni.createInnerAudioContext() |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | msg[i].message = '../../static/images/index/friend-list/' + msg[i].message |
| | | that.imgMsg.unshift(msg[i].message) |
| | | } |
| | | |
| | | if (that.isJSON(msg[i].post_message) == true) { |
| | | msg[i].post_message = JSON.parse(msg[i].post_message) |
| | | } |
| | | |
| | | |
| | | that.msgs.unshift(msg[i]) |
| | | } |
| | | |
| | |
| | | this.isload = true |
| | | // 开启加载 |
| | | this.begainloading = true |
| | | |
| | | console.log(that.msgs, 456) |
| | | |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | |
| | | isJSON(str) { |
| | | |
| | | if (typeof str == 'string') { |
| | | try { |
| | | var obj = JSON.parse(str); |
| | | if (typeof obj == 'object' && obj) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | } catch (e) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | }, |
| | | |
| | | // 预览图片 |
| | | previewImage(e) { |
| | | |
| | |
| | | }, |
| | | // 音频播放 |
| | | playVoice(e) { |
| | | console.log('ok') |
| | | innerAudioContext.src = e |
| | | |
| | | var innerAudioContext = this.innerAudioContext = uni.createInnerAudioContext() |
| | | // innerAudioContext.autoplay = false |
| | | innerAudioContext.src = e.voice |
| | | innerAudioContext.play() |
| | | |
| | | setTimeout(() => { |
| | | innerAudioContext.destroy() |
| | | }, e.time * 1000) |
| | | |
| | | }, |
| | | // 接收输入内容 |
| | | inputs(e) { |
| | | console.log(e, 123) |
| | | var that = this; |
| | | this.isanimation = true |
| | | let len = this.msgs.length - 1 |
| | |
| | | let sendMsg = { |
| | | sender_id: that.senId, |
| | | post_message: e.message, |
| | | message_type: 0, |
| | | message_type: e.types, |
| | | status: 0, |
| | | post_time: nowTime, |
| | | avatar: that.senAvatar |
| | | } |
| | | |
| | | |
| | | var mesagess = null; |
| | | |
| | | if (e.message instanceof Object) { |
| | | mesagess = JSON.stringify(e.message) |
| | | } else { |
| | | mesagess = e.message |
| | | } |
| | | |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/chatgroupc/submit", |
| | | method: "post", |
| | | data: { |
| | | senderId: that.senId, |
| | | postMessage: e.message, |
| | | messageType: 0, |
| | | postMessage: mesagess, |
| | | messageType: e.types, |
| | | status: 0, |
| | | postTime: sentTime, |
| | | gid: that.recipientId |