Merge pull request '状态' (#175) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/175
This commit is contained in:
		
						commit
						5ae02daab8
					
				@ -68,6 +68,7 @@
 | 
			
		||||
		</div>
 | 
			
		||||
		<div class="record-loading" v-if="audio.recording"></div>
 | 
			
		||||
		<video style="width:100%;height: 100%" :src="video.url" v-if="video.visible" id="videoPlayer" autoplay="true" @fullscreenchange="onVideoFullScreenChange"  @play="onVideoPlayStart"></video>
 | 
			
		||||
		<u-toast ref="uToast" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@ -191,6 +192,13 @@
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			sendMessage() {//发送消息
 | 
			
		||||
				if(!this.imService.status){
 | 
			
		||||
					this.$refs.uToast.show({
 | 
			
		||||
						title: '连接聊天中,请稍候',
 | 
			
		||||
						type: 'warning'
 | 
			
		||||
					})
 | 
			
		||||
					return
 | 
			
		||||
				}
 | 
			
		||||
				if (this.content.trim() != '') {
 | 
			
		||||
					this.imService.sendPrivateTextMessage(this.friend.uuid, this.content);
 | 
			
		||||
					let that = this
 | 
			
		||||
@ -209,6 +217,13 @@
 | 
			
		||||
				this.imService.loadPrivateHistoryMessage(this.friend.uuid, lastMessageTimeStamp);
 | 
			
		||||
			},
 | 
			
		||||
			onRecordStart () {
 | 
			
		||||
				if(!this.imService.status){
 | 
			
		||||
					this.$refs.uToast.show({
 | 
			
		||||
						title: '连接聊天中,请稍候',
 | 
			
		||||
						type: 'warning'
 | 
			
		||||
					})
 | 
			
		||||
					return
 | 
			
		||||
				}
 | 
			
		||||
				try{
 | 
			
		||||
					recorderManager.start();
 | 
			
		||||
				}catch(e){
 | 
			
		||||
@ -231,6 +246,13 @@
 | 
			
		||||
				}
 | 
			
		||||
			},
 | 
			
		||||
			sendVideo () {//发送文件
 | 
			
		||||
				if(!this.imService.status){
 | 
			
		||||
					this.$refs.uToast.show({
 | 
			
		||||
						title: '连接聊天中,请稍候',
 | 
			
		||||
						type: 'warning'
 | 
			
		||||
					})
 | 
			
		||||
					return
 | 
			
		||||
				}
 | 
			
		||||
				uni.chooseVideo({
 | 
			
		||||
					success : (res) => {
 | 
			
		||||
						console.log(res)
 | 
			
		||||
@ -239,6 +261,13 @@
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			sendImage() {
 | 
			
		||||
				if(!this.imService.status){
 | 
			
		||||
					this.$refs.uToast.show({
 | 
			
		||||
						title: '连接聊天中,请稍候',
 | 
			
		||||
						type: 'warning'
 | 
			
		||||
					})
 | 
			
		||||
					return
 | 
			
		||||
				}
 | 
			
		||||
				uni.chooseImage({
 | 
			
		||||
					count :1,
 | 
			
		||||
					success :(res) => {
 | 
			
		||||
@ -248,6 +277,7 @@
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			showImageFullScreen (e) {
 | 
			
		||||
				
 | 
			
		||||
				var imagesUrl = [e.currentTarget.dataset.url];
 | 
			
		||||
				uni.previewImage({
 | 
			
		||||
					urls: imagesUrl
 | 
			
		||||
 | 
			
		||||
@ -37,6 +37,7 @@ function IMService() {
 | 
			
		||||
        host:'hangzhou.goeasy.io',//qos=1
 | 
			
		||||
        appkey:'BC-453aa755c4ea48148abefc55a86df283'
 | 
			
		||||
    });
 | 
			
		||||
    this.status = false
 | 
			
		||||
    //当前“我”
 | 
			
		||||
    this.currentUser = null;
 | 
			
		||||
    //我的好友
 | 
			
		||||
@ -236,10 +237,12 @@ IMService.prototype.connectIM = function () {
 | 
			
		||||
IMService.prototype.initialIMListeners = function () {
 | 
			
		||||
    this.im.on(GoEasyIM.EVENT.CONNECTED, () => {
 | 
			
		||||
        console.log('连接成功.')
 | 
			
		||||
        this.status = true
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    this.im.on(GoEasyIM.EVENT.DISCONNECTED, () => {
 | 
			
		||||
        console.log('连接断开.')
 | 
			
		||||
        this.status = false
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    //监听好友上下线
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user