4 Commits

Author SHA1 Message Date
袁磊 85ac605106 1 3 months ago
袁磊 9fc18223e7 1 3 months ago
袁磊 127d414379 1 4 months ago
袁磊 125292ff0a 1 4 months ago
  1. 2
      App.vue
  2. 4
      pages/setting/about.vue
  3. 24
      pages/setting/contact.vue
  4. 2
      pages/setting/setting.vue
  5. 20
      pages/user/login.vue
  6. 8
      static/style/nine-base-001.scss
  7. 76
      static/style/nine-base-002.scss
  8. 2
      static/style/nine-base-003.scss
  9. 2
      static/style/nine-btn-001.scss
  10. 20
      static/style/nine-image-001.scss
  11. 38
      static/style/nine-list-001.scss
  12. 2
      static/style/nine-nav-001.scss
  13. 100
      uni_modules/vrapile-im/pages/chat/chatFriend.vue
  14. 13
      uni_modules/vrapile-im/pages/home/chatHome.vue
  15. BIN
      uni_modules/vrapile-im/static/image/chat/chat-blue.png
  16. BIN
      uni_modules/vrapile-im/static/image/chat/chat.png
  17. BIN
      uni_modules/vrapile-im/static/image/chat/contacts-blue.png
  18. BIN
      uni_modules/vrapile-im/static/image/chat/contacts.png
  19. BIN
      uni_modules/vrapile-im/static/image/chat/emoji.png
  20. BIN
      uni_modules/vrapile-im/static/image/chat/gift.png
  21. BIN
      uni_modules/vrapile-im/static/image/chat/group-blue.png
  22. BIN
      uni_modules/vrapile-im/static/image/chat/group-icon.png
  23. BIN
      uni_modules/vrapile-im/static/image/chat/jianpan.png
  24. BIN
      uni_modules/vrapile-im/static/image/chat/mine-blue.png
  25. BIN
      uni_modules/vrapile-im/static/image/chat/mine.png
  26. BIN
      uni_modules/vrapile-im/static/image/chat/more.png
  27. BIN
      uni_modules/vrapile-im/static/image/chat/voice-left.png
  28. BIN
      uni_modules/vrapile-im/static/image/chat/voice-right.png
  29. BIN
      uni_modules/vrapile-im/static/image/chat/voice-saying.gif
  30. BIN
      uni_modules/vrapile-im/static/image/chat/voice.png
  31. BIN
      uni_modules/vrapile-im/static/image/emoji/danao.png
  32. BIN
      uni_modules/vrapile-im/static/image/emoji/daxiao.png
  33. BIN
      uni_modules/vrapile-im/static/image/emoji/shengqi.png
  34. BIN
      uni_modules/vrapile-im/static/image/emoji/sile.png
  35. BIN
      uni_modules/vrapile-im/static/image/emoji/xianwen.png
  36. 44
      uni_modules/vrapile-im/static/style/nine-chat-friend-001.scss
  37. 1
      uni_modules/vrapile-im/store/modules/chat.js
  38. 12
      uni_modules/vrapile-im/store/modules/socket.js

2
App.vue

@ -27,7 +27,7 @@
methods: { methods: {
initSysConfig(options) { initSysConfig(options) {
// //
this.globalData.systemInfo = uni.getSystemInfoSync()
this.globalData.systemInfo = uni.getDeviceInfo()
this.globalData.os = this.globalData.systemInfo.platform this.globalData.os = this.globalData.systemInfo.platform
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => { plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {

4
pages/setting/about.vue

@ -30,10 +30,10 @@
</view> </view>
<view class="ptb30"> <view class="ptb30">
<view class="text-center color-blue font-size15"> <view class="text-center color-blue font-size15">
九云科技有限公司服务协议
开放平台服务协议
</view> </view>
<view class="text-center font-size15"> <view class="text-center font-size15">
九云科技 版权所有
平台开发者 版权所有
</view> </view>
<view class="text-center font-size15"> <view class="text-center font-size15">
Copyright © 2024-2031 NineCloud. Copyright © 2024-2031 NineCloud.

24
pages/setting/contact.vue

@ -1,11 +1,11 @@
<template> <template>
<view class="nine-content-001"> <view class="nine-content-001">
<view class="text-center ptb120">
<view class="text-center ptb100">
<image class="image400" :src="url" mode="scaleToFill" ></image> <image class="image400" :src="url" mode="scaleToFill" ></image>
<view class="font-size18 mt10">微信账号{{account}}</view>
<view class="font-size14 mt10 color-gray">微信账号{{account}}</view>
</view> </view>
<view class="nine-nav-001"> <view class="nine-nav-001">
<view class="nine-nav-001-item ma10 ptb25">
<view class="nine-nav-001-item ptb25">
<view class="nine-nav-001-item-left"> <view class="nine-nav-001-item-left">
<text class="nine-nav-001-item-left-text">联系人</text> <text class="nine-nav-001-item-left-text">联系人</text>
</view> </view>
@ -13,7 +13,7 @@
<text class="nine-nav-001-item-left-text">{{name}}</text> <text class="nine-nav-001-item-left-text">{{name}}</text>
</view> </view>
</view> </view>
<view class="nine-nav-001-item ma10 ptb25">
<view class="nine-nav-001-item ptb25">
<view class="nine-nav-001-item-left"> <view class="nine-nav-001-item-left">
<text class="nine-nav-001-item-left-text">联系电话</text> <text class="nine-nav-001-item-left-text">联系电话</text>
</view> </view>
@ -21,15 +21,7 @@
<text class="nine-nav-001-item-left-text color-blue" @click="callPhone(phone)">{{phone}}</text> <text class="nine-nav-001-item-left-text color-blue" @click="callPhone(phone)">{{phone}}</text>
</view> </view>
</view> </view>
<view class="nine-nav-001-item ma10 ptb25">
<view class="nine-nav-001-item-left">
<text class="nine-nav-001-item-left-text">微信号</text>
</view>
<view class="nine-nav-001-item-right">
<text class="nine-nav-001-item-left-text">{{phone}}</text>
</view>
</view>
<view class="nine-nav-001-item ma10 ptb25">
<view class="nine-nav-001-item ptb25">
<view class="nine-nav-001-item-left"> <view class="nine-nav-001-item-left">
<text class="nine-nav-001-item-left-text">邮箱账号</text> <text class="nine-nav-001-item-left-text">邮箱账号</text>
</view> </view>
@ -38,12 +30,12 @@
</view> </view>
</view> </view>
</view> </view>
<view class="ptb30">
<view class="ptb20">
<view class="text-center color-blue font-size15"> <view class="text-center color-blue font-size15">
九云科技有限公司服务协议
开放平台服务协议
</view> </view>
<view class="text-center font-size15"> <view class="text-center font-size15">
九云科技 版权所有
平台开发者 版权所有
</view> </view>
<view class="text-center font-size15"> <view class="text-center font-size15">
Copyright © 2024-2031 NineCloud. Copyright © 2024-2031 NineCloud.

2
pages/setting/setting.vue

@ -2,7 +2,7 @@
<view class="nine-content-001"> <view class="nine-content-001">
<!-- 功能列表 --> <!-- 功能列表 -->
<view class="nine-nav-001"> <view class="nine-nav-001">
<view class="nine-nav-001-item mt10">
<view class="nine-nav-001-item">
<view class="nine-nav-001-item-left"> <view class="nine-nav-001-item-left">
<text class="nine-nav-001-item-left-text">公告中心</text> <text class="nine-nav-001-item-left-text">公告中心</text>
</view> </view>

20
pages/user/login.vue

@ -37,11 +37,23 @@
</view> </view>
<view class="nine-btn-save-001 ma20" @click="loginClick"> </view> <view class="nine-btn-save-001 ma20" @click="loginClick"> </view>
<!--#ifndef MP-WEIXIN--> <!--#ifndef MP-WEIXIN-->
<view class="text-center ma20">没有账号?
<view class="text-center mt30 mb20">没有账号?
<span class="ml10 color-blue" @click="registerClick"> <span class="ml10 color-blue" @click="registerClick">
立即注册 立即注册
</span> </span>
</view> </view>
<view class="text-center mt30 mb20">
<span class="ml10 color-blue" @click="visitorLogin">
演示账号登录
</span>
</view>
<!--#endif-->
<!--#ifdef MP-WEIXIN-->
<view class="text-center mt30 mb20">
<span class="ml10 color-blue" @click="wxLoginClick">
微信一键登录
</span>
</view>
<!--#endif--> <!--#endif-->
</view> </view>
</view> </view>
@ -131,6 +143,12 @@
this.verifyText = "发送验证码"; this.verifyText = "发送验证码";
} }
}, },
visitorLogin(){
this.loginType = 0;
this.userName = "visitor";
this.password = "visitor";
this.loginClick();
},
loginClick(){ loginClick(){
if(!this.userName){ if(!this.userName){
this.usernamefocus(); this.usernamefocus();

8
static/style/nine-base-001.scss

@ -27,12 +27,16 @@
.color-red{ color: red } .color-red{ color: red }
.color-green{ color: green } .color-green{ color: green }
.color-darkgreen{ color: darkgreen }
.color-white{ color: white } .color-white{ color: white }
.color-gray{ color: gray } .color-gray{ color: gray }
.color-blue{ color: blue } .color-blue{ color: blue }
.color-lightblue{ color: lightblue }
.color-yellow{ color: yellow } .color-yellow{ color: yellow }
.color-black{ color: black } .color-black{ color: black }
.color-f1f1f1{ color: #f1f1f1 } .color-f1f1f1{ color: #f1f1f1 }
.color-0294ee{ color: #0294ee }
.color-799dff{ color: #799dff }
.bgcolor-gray{ background-color: gray } .bgcolor-gray{ background-color: gray }
.bgcolor-green{ background-color: green } .bgcolor-green{ background-color: green }
@ -47,6 +51,7 @@
.bgcolor-eef0ff{ background-color: #eef0ff } .bgcolor-eef0ff{ background-color: #eef0ff }
.bgcolor-ff4769{ background-color: #ff4769 } .bgcolor-ff4769{ background-color: #ff4769 }
.bgcolor-f1f1f1{ background-color: #f1f1f1 } .bgcolor-f1f1f1{ background-color: #f1f1f1 }
.bgcolor-0294ee{ background-color: #0294ee }
.border-gray{ border: 3rpx solid gray } .border-gray{ border: 3rpx solid gray }
.border-lightblue{ border: 3rpx solid lightblue } .border-lightblue{ border: 3rpx solid lightblue }
@ -60,7 +65,9 @@
.border-eef0ff{ border: 3rpx solid #eef0ff } .border-eef0ff{ border: 3rpx solid #eef0ff }
.border-ff4769{ border: 3rpx solid #ff4769 } .border-ff4769{ border: 3rpx solid #ff4769 }
.border-f1f1f1{ border: 3rpx solid #f1f1f1 } .border-f1f1f1{ border: 3rpx solid #f1f1f1 }
.border-0294ee{ border: 3rpx solid #0294ee }
.border-radius5{ border-radius: 5rpx }
.border-radius10{ border-radius: 10rpx } .border-radius10{ border-radius: 10rpx }
.border-radius50{ border-radius: 50% } .border-radius50{ border-radius: 50% }
@ -150,6 +157,7 @@
.ptb0{ padding-top: 0rpx; padding-bottom: 0rpx } .ptb0{ padding-top: 0rpx; padding-bottom: 0rpx }
.ptb2{ padding-top: 2rpx; padding-bottom: 2rpx } .ptb2{ padding-top: 2rpx; padding-bottom: 2rpx }
.ptb5{ padding-top: 5rpx; padding-bottom: 5rpx } .ptb5{ padding-top: 5rpx; padding-bottom: 5rpx }
.ptb8{ padding-top: 8rpx; padding-bottom: 8rpx }
.ptb10{ padding-top: 10rpx; padding-bottom: 10rpx } .ptb10{ padding-top: 10rpx; padding-bottom: 10rpx }
.ptb15{ padding-top: 15rpx; padding-bottom: 15rpx } .ptb15{ padding-top: 15rpx; padding-bottom: 15rpx }
.ptb20{ padding-top: 20rpx; padding-bottom: 20rpx } .ptb20{ padding-top: 20rpx; padding-bottom: 20rpx }

76
static/style/nine-base-002.scss

@ -1,3 +1,30 @@
.height10{
height: 10%;
}
.height20{
height: 20%;
}
.height30{
height: 30%;
}
.height40{
height: 40%;
}
.height50{
height: 50%;
}
.height60{
height: 60%;
}
.height70{
height: 70%;
}
.height80{
height: 80%;
}
.height90{
height: 90%;
}
.height100{ .height100{
height: 100%; height: 100%;
} }
@ -13,6 +40,9 @@
.width30{ .width30{
width: 30%; width: 30%;
} }
.width33{
width: 33%;
}
.width45{ .width45{
width: 45%; width: 45%;
} }
@ -135,6 +165,33 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.desc-style-text {
white-space: pre-wrap;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.desc-style-header{
white-space: pre-wrap
}
.line-clamp-1{
-webkit-line-clamp: 1;
}
.line-clamp-2{
-webkit-line-clamp: 2;
}
.line-clamp-3{
-webkit-line-clamp: 3;
}
.line-clamp-4{
-webkit-line-clamp: 4;
}
.line-clamp-5{
-webkit-line-clamp: 5;
}
// 不占位隐藏 // 不占位隐藏
.display-none{ display: none } .display-none{ display: none }
@ -165,4 +222,23 @@
moz-transform: rotate(90deg); /* Firefox */ moz-transform: rotate(90deg); /* Firefox */
webkit-transform: rotate(90deg); /* Safari and Chrome */ webkit-transform: rotate(90deg); /* Safari and Chrome */
o-transform: rotate(90deg); /* Opera */ o-transform: rotate(90deg); /* Opera */
}
.z-index1{
z-index: 1;
}
.z-index2{
z-index: 2;
}
.z-index3{
z-index: 3;
}
.z-index11{
z-index: 11;
}
.z-index101{
z-index: 101;
}
.z-index1001{
z-index: 1001;
} }

2
static/style/nine-base-003.scss

@ -1,5 +1,5 @@
.nine-nomore-001{ .nine-nomore-001{
padding: 25rpx;
padding: 45rpx 25rpx;
text-align: center; text-align: center;
} }
.nine-nomore-001-span{ .nine-nomore-001-span{

2
static/style/nine-btn-001.scss

@ -9,7 +9,7 @@
padding: 20rpx; padding: 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
color: #fff; color: #fff;
background-color: #0000ff;
background-color: #0294ee;
text-align: center; text-align: center;
} }
// 退出登录 // 退出登录

20
static/style/nine-image-001.scss

@ -6,6 +6,10 @@
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
} }
.image45{
width: 45rpx;
height: 45rpx;
}
.image50{ .image50{
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
@ -26,6 +30,14 @@
width: 90rpx; width: 90rpx;
height: 90rpx; height: 90rpx;
} }
.image100{
width: 100rpx;
height: 100rpx;
}
.image120{
width: 120rpx;
height: 120rpx;
}
.image150{ .image150{
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;
@ -34,6 +46,14 @@
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
} }
.image300{
width: 300rpx;
height: 300rpx;
}
.image350{
width: 350rpx;
height: 350rpx;
}
.image400{ .image400{
width: 400rpx; width: 400rpx;
height: 400rpx; height: 400rpx;

38
static/style/nine-list-001.scss

@ -3,10 +3,46 @@
} }
.nine-list-001-item{ .nine-list-001-item{
background-color: #fff; background-color: #fff;
margin: 10rpx 0;
margin-bottom: 10rpx;
padding: 10rpx 30rpx; padding: 10rpx 30rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
.nine-list-001-item-view{
display: flex;
align-items: center;
padding: 10rpx 0;
}
.nine-list-001-item-span-line{
display: block;
width: 5rpx;
height: 22rpx;
margin-right: 10rpx;
border-radius: 3rpx;
background-color: #5e96ff;
}
.nine-list-001-item-span-point{
display: block;
width: 10rpx;
height: 10rpx;
margin-right: 10rpx;
border-radius: 50%;
background-color: red;
}
.nine-list-001-item-input{
padding: 15rpx 10rpx;
width: calc(100% - 20rpx);
background-color: #f9f9f9;
border-radius: 10rpx;
margin: 5rpx 0;
}
.nine-list-001-item-textarea{
padding: 10rpx;
width: calc(100% - 20rpx);
white-space: pre-wrap;
background-color: #f9f9f9;
border-radius: 10rpx;
margin: 5rpx 0;
}
.nine-list-001-item-image-image{ .nine-list-001-item-image-image{
width: 40rpx; width: 40rpx;
height: 30rpx; height: 30rpx;

2
static/style/nine-nav-001.scss

@ -12,7 +12,7 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-top: 5rpx;
margin-bottom: 5rpx;
padding: 20rpx 15rpx; padding: 20rpx 15rpx;
border-radius: 1rpx; border-radius: 1rpx;
border-style: solid; border-style: solid;

100
uni_modules/vrapile-im/pages/chat/chatFriend.vue

@ -16,9 +16,23 @@
<image class="chat-conversation-image-image" v-else :src="userInfo.avatar || defaultAvatar"></image> <image class="chat-conversation-image-image" v-else :src="userInfo.avatar || defaultAvatar"></image>
</view> </view>
<view class="chat-conversation-text"> <view class="chat-conversation-text">
<view class="chat-conversation-text-time" v-if="item.sendType == 1 && item.fromId != userInfo.userId">{{getUserName(item.fromId, item.fromName)}}</view>
<view class="chat-conversation-text-time">{{formatTime(item.sendTime)}}</view>
<view class="chat-conversation-text-text nine-user-select">{{item.content}}</view>
<view class="conversation-text-time" v-if="item.sendType == 1 && item.fromId != userInfo.userId">{{getUserName(item.fromId, item.toId, item.fromName)}}</view>
<view class="conversation-text-time">{{formatTime(item.sendTime)}}</view>
<view v-if="item.messageType==1" class="chat-conversation-text-text chat-conversation-text-image">
<image lazy-load="true" class="chat-conversation-text-image-image" :src="item.content" mode="widthFix"></image>
</view>
<view v-else-if="item.messageType==2" class="chat-conversation-text-text chat-conversation-text-emoji">
<template v-for="(image, index) in getEmojiList(item.content)" :key="'image-' + key">
<image lazy-load="true" class="chat-conversation-text-emoji-image" :src="getEmoji(image)"></image>
</template>
</view>
<view v-else-if="item.messageType==3" class="chat-conversation-text-text chat-conversation-text-voice">
<image class="chat-conversation-text-voice-image" src="/uni_modules/vrapile-im/static/image/chat/voice-right.png" mode="widthFix"></image>
<span class="chat-conversation-text-voice-number" :style="{'width': (40 + item.content*10) + 'rpx'}">{{item.content}}" </span>
</view>
<view v-else class="chat-conversation-text-text nine-user-select">
{{item.content}}
</view>
</view> </view>
</view> </view>
</view> </view>
@ -30,7 +44,11 @@
<view @click="handleVoice" class="chat-footer-send-voice"> <view @click="handleVoice" class="chat-footer-send-voice">
<image class="chat-footer-send-image" :src="iconVoice"></image> <image class="chat-footer-send-image" :src="iconVoice"></image>
</view> </view>
<view v-if="isVoice" @longpress="handleSay" class="chat-footer-send-say">
<view v-if="isVoice" class="chat-footer-send-say"
@touchstart="handleTouchStart"
@touchend="handleTouchEnd"
@longpress="startRecord"
@contextmenu.prevent="() => {}">
<span>按住 说话</span> <span>按住 说话</span>
</view> </view>
<view v-else class="chat-footer-send-input"> <view v-else class="chat-footer-send-input">
@ -68,6 +86,8 @@
isVoice: false, isVoice: false,
inputText: "", inputText: "",
startTime: 0,
// key // key
key: null, key: null,
@ -168,13 +188,31 @@
handleVoice() { handleVoice() {
this.isVoice = !this.isVoice; this.isVoice = !this.isVoice;
}, },
handleTouchStart(e){
this.startTime = Date.now();
//
e.preventDefault();
},
handleTouchEnd(e) {
this.handleSay();
//
e.preventDefault();
},
startRecord(e) {
//
e.preventDefault();
},
// //
handleSay() { handleSay() {
const duration = Date.now() - this.startTime
if (duration < 500) {
return
}
let sendInfo = { let sendInfo = {
code: 2, code: 2,
message: { message: {
// 0-|1-|2-|3-|4-
messageType: 0,
// 0-|1-|2-|3-|4-|5-|9-|99-
messageType: 3,
//id //id
toId: this.chatObject.id, toId: this.chatObject.id,
// //
@ -182,7 +220,7 @@
// //
fromName: this.userInfo.userName, fromName: this.userInfo.userName,
// //
content: "您发送了一条语音消息",
content: Math.ceil(duration/1000),
//0-|1- //0-|1-
sendType: this.chatObject.type, sendType: this.chatObject.type,
// //
@ -195,11 +233,24 @@
}, },
// //
handleEmoji() { handleEmoji() {
let emojiList = [
'daxiao.png',
'danao.png',
'shengqi.png',
'sile.png',
'xianwen.png'
]
let randomIndex
let content = []
do{
randomIndex = Math.floor(Math.random() * emojiList.length)
content.push(emojiList[randomIndex])
}while(randomIndex % 3 != 0);
let sendInfo = { let sendInfo = {
code: 2, code: 2,
message: { message: {
// 0-|1-|2-|3-|4-
messageType: 0,
// 0-|1-|2-|3-|4-|5-|9-|99-
messageType: 2,
//id //id
toId: this.chatObject.id, toId: this.chatObject.id,
// //
@ -207,7 +258,7 @@
// //
fromName: this.userInfo.userName, fromName: this.userInfo.userName,
// //
content: "您发送了一个表情消息",
content: content,
//0-|1- //0-|1-
sendType: this.chatObject.type, sendType: this.chatObject.type,
// //
@ -224,7 +275,7 @@
code: 2, code: 2,
message: { message: {
// 0-|1-|2-|3-|4- // 0-|1-|2-|3-|4-
messageType: 0,
messageType: 1,
//id //id
toId: this.chatObject.id, toId: this.chatObject.id,
// //
@ -232,7 +283,7 @@
// //
fromName: this.userInfo.userName, fromName: this.userInfo.userName,
// //
content: "您发送了一个更多的消息",
content: this.userInfo.avatar || "https://www.ninecloud.top/unine/static/image/app/nine-app-all.png",
//0-|1- //0-|1-
sendType: this.chatObject.type, sendType: this.chatObject.type,
// //
@ -305,10 +356,18 @@
this.chatObject["messageList"] = this.messageList; this.chatObject["messageList"] = this.messageList;
let lastMessage = res.data[res.data.length-1]; let lastMessage = res.data[res.data.length-1];
this.chatObject["messageLast"] = lastMessage; this.chatObject["messageLast"] = lastMessage;
let content = lastMessage["content"]
if(lastMessage["messageType"] == 3){
content = "[语音]"
}else if(lastMessage["messageType"] == 2){
content = "[表情]"
}else if(lastMessage["messageType"] == 1){
content = "[图片]"
}
if(lastMessage["sendType"] == 0){ if(lastMessage["sendType"] == 0){
this.chatObject["messageShow"] = lastMessage["content"];
this.chatObject["messageShow"] = content;
}else{ }else{
this.chatObject["messageShow"] = store.getters.getUserName(lastMessage["fromId"], lastMessage["fromName"]) + ": " + lastMessage["content"]
this.chatObject["messageShow"] = store.getters.getUserName(lastMessage["fromId"], lastMessage["fromName"]) + ": " + content
} }
this.chatObject["messageTime"] = this.formatDate(lastMessage["sendTime"]); this.chatObject["messageTime"] = this.formatDate(lastMessage["sendTime"]);
} }
@ -326,6 +385,19 @@
this.scrollToBottom(); this.scrollToBottom();
} }
}); });
},
getEmojiList(content){
if(typeof content === 'object'){
return content;
}
try{
return JSON.parse(content.replace(/(\w+\.png)/g, '"$1"'));
}catch(e){
return new Array;
}
},
getEmoji(image){
return '/uni_modules/vrapile-im/static/image/emoji/'+image
} }
} }
} }

13
uni_modules/vrapile-im/pages/home/chatHome.vue

@ -146,6 +146,7 @@
// //
handleHistoryMessage(i, scrollFlag){ handleHistoryMessage(i, scrollFlag){
let limit = this.getChatList[i]["messageList"].length + 10; let limit = this.getChatList[i]["messageList"].length + 10;
// /im/message/getMessageByPatchChatKey
getMessageByChatKey({ getMessageByChatKey({
type: this.getChatList[i].type, type: this.getChatList[i].type,
key: this.getChatList[i]["key"], key: this.getChatList[i]["key"],
@ -156,10 +157,18 @@
this.getChatList[i]["messageList"] = res.data; this.getChatList[i]["messageList"] = res.data;
let lastMessage = res.data[res.data.length-1]; let lastMessage = res.data[res.data.length-1];
this.getChatList[i]["messageLast"] = lastMessage; this.getChatList[i]["messageLast"] = lastMessage;
let content = lastMessage["content"]
if(lastMessage["messageType"] == 3){
content = "[语音]"
}else if(lastMessage["messageType"] == 2){
content = "[表情]"
}else if(lastMessage["messageType"] == 1){
content = "[图片]"
}
if(lastMessage["sendType"] == 0){ if(lastMessage["sendType"] == 0){
this.getChatList[i]["messageShow"] = lastMessage["content"];
this.getChatList[i]["messageShow"] = content;
}else{ }else{
this.getChatList[i]["messageShow"] = store.getters.getUserName(lastMessage["fromId"], lastMessage["fromName"]) + ": " + lastMessage["content"]
this.getChatList[i]["messageShow"] = store.getters.getUserName(lastMessage["fromId"], lastMessage["fromName"]) + ": " + content
} }
this.getChatList[i]["messageTime"] = this.formatDate(lastMessage["sendTime"]); this.getChatList[i]["messageTime"] = this.formatDate(lastMessage["sendTime"]);
} }

BIN
uni_modules/vrapile-im/static/image/chat/chat-blue.png

After

Width: 34  |  Height: 34  |  Size: 588 B

BIN
uni_modules/vrapile-im/static/image/chat/chat.png

After

Width: 34  |  Height: 34  |  Size: 802 B

BIN
uni_modules/vrapile-im/static/image/chat/contacts-blue.png

After

Width: 34  |  Height: 34  |  Size: 591 B

BIN
uni_modules/vrapile-im/static/image/chat/contacts.png

After

Width: 34  |  Height: 34  |  Size: 830 B

BIN
uni_modules/vrapile-im/static/image/chat/emoji.png

After

Width: 72  |  Height: 71  |  Size: 9.4 KiB

BIN
uni_modules/vrapile-im/static/image/chat/gift.png

After

Width: 32  |  Height: 32  |  Size: 4.9 KiB

BIN
uni_modules/vrapile-im/static/image/chat/group-blue.png

After

Width: 50  |  Height: 50  |  Size: 1.6 KiB

BIN
uni_modules/vrapile-im/static/image/chat/group-icon.png

After

Width: 30  |  Height: 30  |  Size: 502 B

BIN
uni_modules/vrapile-im/static/image/chat/jianpan.png

After

Width: 24  |  Height: 24  |  Size: 932 B

BIN
uni_modules/vrapile-im/static/image/chat/mine-blue.png

After

Width: 34  |  Height: 34  |  Size: 507 B

BIN
uni_modules/vrapile-im/static/image/chat/mine.png

After

Width: 34  |  Height: 34  |  Size: 770 B

BIN
uni_modules/vrapile-im/static/image/chat/more.png

After

Width: 72  |  Height: 71  |  Size: 8.2 KiB

BIN
uni_modules/vrapile-im/static/image/chat/voice-left.png

After

Width: 17  |  Height: 23  |  Size: 861 B

BIN
uni_modules/vrapile-im/static/image/chat/voice-right.png

After

Width: 17  |  Height: 23  |  Size: 912 B

BIN
uni_modules/vrapile-im/static/image/chat/voice-saying.gif

After

Width: 156  |  Height: 154  |  Size: 12 KiB

BIN
uni_modules/vrapile-im/static/image/chat/voice.png

After

Width: 72  |  Height: 72  |  Size: 9.5 KiB

BIN
uni_modules/vrapile-im/static/image/emoji/danao.png

After

Width: 44  |  Height: 44  |  Size: 1.6 KiB

BIN
uni_modules/vrapile-im/static/image/emoji/daxiao.png

After

Width: 44  |  Height: 44  |  Size: 1.6 KiB

BIN
uni_modules/vrapile-im/static/image/emoji/shengqi.png

After

Width: 44  |  Height: 44  |  Size: 1.5 KiB

BIN
uni_modules/vrapile-im/static/image/emoji/sile.png

After

Width: 44  |  Height: 44  |  Size: 1.2 KiB

BIN
uni_modules/vrapile-im/static/image/emoji/xianwen.png

After

Width: 46  |  Height: 44  |  Size: 1.6 KiB

44
uni_modules/vrapile-im/static/style/nine-chat-friend-001.scss

@ -107,6 +107,50 @@ html, body, #app{
padding: 5rpx; padding: 5rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
.chat-conversation-text-image{
padding: 5px;
width: 100%;
}
.chat-conversation-text-image-image{
width: 100%;
}
.chat-conversation-text-emoji{
flex-direction: row;
flex-wrap: wrap;
align-content: flex-start;
}
.chat-conversation-text-emoji-image{
width: 80rpx;
height: 80rpx;
margin: 2rpx;
}
.chat-conversation-text-voice{
flex-direction: row;
align-items: center;
padding: 15rpx;
}
.chat-conversation-text-voice-number{
text-align: left;
white-space: nowrap;
overflow: hidden;
flex: 1;
}
.chat-conversation-text-voice-image{
margin-right: 25rpx;
width: 30rpx;
height: 30rpx;
}
.chat-conversation-mine .chat-conversation-text-voice{
flex-direction: row-reverse;
}
.chat-conversation-mine .chat-conversation-text-voice-number{
text-align: right;
}
.chat-conversation-mine .chat-conversation-text-voice-image{
margin-right: 0rpx;
margin-left: 25rpx;
transform: rotate(180deg);
}
.chat-footer { .chat-footer {
position: fixed; position: fixed;

1
uni_modules/vrapile-im/store/modules/chat.js

@ -104,6 +104,7 @@ const chat = {
delete itemGroup["updateTime"]; delete itemGroup["updateTime"];
listGroup.push({type: 1, ...itemGroup}); listGroup.push({type: 1, ...itemGroup});
// 查询群组人员 // 查询群组人员
// 后面将作废此接口 改为批量查询 /im/groupUser/getPatchGroupUser
getGroupUser(itemGroup.id).then(res2 => { getGroupUser(itemGroup.id).then(res2 => {
for(let itemGroupUser of res2.data){ for(let itemGroupUser of res2.data){
delete itemGroupUser["createBy"]; delete itemGroupUser["createBy"];

12
uni_modules/vrapile-im/store/modules/socket.js

@ -36,10 +36,18 @@ const socket = {
// if(store.state.user.userInfo.userId && store.state.user.userInfo.userId != message["fromId"]){ // if(store.state.user.userInfo.userId && store.state.user.userInfo.userId != message["fromId"]){
store.state.chat.chatList[i]["messageNum"] += 1; store.state.chat.chatList[i]["messageNum"] += 1;
// } // }
let content = message["content"]
if(message["messageType"] == 3){
content = "[语音]"
}else if(message["messageType"] == 2){
content = "[表情]"
}else if(message["messageType"] == 1){
content = "[图片]"
}
if(store.state.chat.chatList[i]["type"] == 0){ if(store.state.chat.chatList[i]["type"] == 0){
store.state.chat.chatList[i]["messageShow"] = message["content"];
store.state.chat.chatList[i]["messageShow"] = content;
}else{ }else{
store.state.chat.chatList[i]["messageShow"] = store.getters.getUserName(message["fromId"], message["fromName"]) + ": " + message["content"]
store.state.chat.chatList[i]["messageShow"] = store.getters.getUserName(message["fromId"], message["fromName"]) + ": " + content
} }
storage.set(constant.chatList, store.state.chat.chatList); storage.set(constant.chatList, store.state.chat.chatList);
break; break;

Loading…
Cancel
Save