Browse Source

修改页面bug、并优化页面

master
liaoxinyu 2 months ago
parent
commit
41e929ad57
  1. 46
      App.vue
  2. 5
      api/message.js
  3. 2
      components/cu-custom.vue
  4. 428
      components/message/im-input.vue
  5. 21
      components/message/user-select.vue
  6. 4
      pages/compass/Informationdetails.vue
  7. 45
      pages/compass/friendscircledetails.vue
  8. 34
      pages/compass/moments.vue
  9. 14
      pages/compass/personalcircleoffriends.vue
  10. 12
      pages/compass/sendtoMoments.vue
  11. 23
      pages/contacts/detail.vue
  12. 116
      pages/contacts/friend.vue
  13. 2
      pages/contacts/group.vue
  14. 2
      pages/contacts/index.vue
  15. 4
      pages/contacts/search.vue
  16. 15
      pages/index/search.vue
  17. 9
      pages/index/userSelection.vue
  18. 1
      pages/login/register.vue
  19. 82
      pages/message/chat.vue
  20. 31
      pages/message/detail.vue
  21. 8
      pages/message/group/groupUser.vue
  22. 22
      pages/message/record.vue
  23. 32
      pages/mine/index.vue
  24. 5
      pages/mine/profile.vue
  25. 2
      static/css/main.css
  26. 3
      uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
  27. 4
      utils/utils.js

46
App.vue

@ -32,16 +32,16 @@
// keepAlive = uni.requireNativePlugin('Ba-KeepAlive');
// #endif
export default {
async created() {
created() {
// #ifdef APP-PLUS
await db.createDatabase()
db.createDatabase()
await homeData.createTalbe();
await getSystemInfo.createTalbe();
await getMessageList.createTalbe();
await groupInfo.createTalbe();
await groupUserList.createTalbe();
await getUserInfo.createTalbe();
homeData.createTalbe();
getSystemInfo.createTalbe();
getMessageList.createTalbe();
groupInfo.createTalbe();
groupUserList.createTalbe();
getUserInfo.createTalbe();
// #endif
// console.info('1111111');
},
@ -155,6 +155,7 @@
this.socketIo.traderDetailIndex = 100 // tabIndex
},
onShow: function() {
uni.setStorageSync('FileImg',false)
// #ifdef APP-PLUS
// ,
if (uni.getSystemInfoSync().platform === 'android' && keepAlive) {
@ -381,6 +382,12 @@
case 'simple':
case 'group':
// ,
// if(data.user_id==userInfo.user_id&&data.type=="text"&&res['type']=='simple'&&data.fromUser.id!=="-2"){
// const list = []
// list.push(data)
// this.insertdata(list)
// // console.log('123456');
// }
if (data.fromUser.id != userInfo.user_id) {
const contact = msgStore.getContact(data.toContactId,data);
//
@ -428,8 +435,9 @@
}
})
// console.log(list);
console.log(list);
this.insertdata(list)
uni.$emit('initContacts', true)
// #endif
}
this.appendMessage(res);
@ -488,12 +496,14 @@
this.deleteList1('user')
// #endif
break;
uni.$emit('initContacts', true)
//
case "delGroupAllMsg":
// #ifdef APP-PLUS
this.deleteList1('group')
// #endif
break;
uni.$emit('initContacts', true)
case "delMessageAll":
// #ifdef APP-PLUS
if(data.form_user){
@ -506,7 +516,10 @@
// #endif
break;
case "delSystemAllMsg":
uni.$emit('initContacts', true)
// #ifdef APP-PLUS
this.delAllMsg()
// #endif
break;
//
case "editGroupName":
@ -642,6 +655,21 @@
console.error('获取目录失败:', error);
}
});
// emoji
docDir.getDirectory('emoji', { create: false }, (emojiDir) => {
emojiDir.removeRecursively(() => {
console.log('emoji 文件夹删除成功')
uni.setStorageSync('FileImg',false);
},(error) => {
console.error('emoji 文件夹删除失败:', error)
});
}, (error) => {
if (error.code === 1) {
console.log('emoji 文件夹不存在,无需删除');
} else {
console.error('获取 emoji 文件夹失败:', error);
}
});
}, function(error) {
console.error('无法访问 _doc 目录:', error);
});

5
api/message.js

@ -363,4 +363,9 @@ msgApi.getAdminNotice= (params) =>{
msgApi.viewOriginalImage= (params) =>{
return postJsonRequest('enterprise/files/viewOriginalImage', params)
}
// 获取邀请好友邀请码
msgApi.getMoveInviteLink= (params) =>{
return postJsonRequest('enterprise/friend/getMoveInviteLink', params)
}
export default msgApi;

2
components/cu-custom.vue

@ -26,7 +26,7 @@
data() {
return {
StatusBar: this.StatusBar,
CustomBar: this.CustomBar
CustomBar: this.CustomBar?this.CustomBar:45
};
},
name: 'custom',

428
components/message/im-input.vue

@ -4,9 +4,9 @@
<view class="im-footer bg-gray" v-if="contactid!==-2">
<view class="im-menus f-28" v-show="!isFocus || contact.is_group!=1" style="margin-bottom: 8rpx;" :class="[recShow ? 'cuIcon-keyboard' : 'cuIcon-sound']" hover-class="tap" @tap="showRec"></view>
<view class="im-menus f-24" v-show="isFocus && contact.is_group==1" style="margin-bottom: 13rpx;" @tap="modelName='userModel'">@</view>
<view class="im-msgarea" style="flex: 0.97;">
<view class="im-msgarea" style="flex: 0.97;width: 400rpx;">
<!-- im-flex1 -->
<editor id="editor" class="solid-bottom bg-white im-input c-333" :adjust-position="false" maxlength="300" cursor-spacing="10"
<editor id="editor" style="width: 100%;line-break: anywhere;" class="solid-bottom bg-white im-input c-333" :adjust-position="false" maxlength="300" cursor-spacing="10"
@focus="InputFocus" @blur="InputBlur" @input="changeMsgText" @ready="onEditorReady" :read-only="readOnly" v-show="recShow==false"> </editor>
<view class="toolBox" v-show="recShow==true">
<view class="recorder" :class="{active:isUseRecorder}" @touchstart.prevent="startRecorder"
@ -51,16 +51,16 @@
<view class="upload-emoji" @tap="uploadEmoji"><text class="cuIcon-add c-999" style="vertical-align: sub;"></text></view>
</view>
<view v-for="(item,index) in currentEmojiList" class="im-emoji-item" :key="index">
<block v-for="(iteme,indexe) in imglist" :key="indexe" v-if="network_log == 'none'">
<!-- <block v-for="(iteme,indexe) in imglist" :key="indexe" v-if="network_log == 'none'">
<view v-if="iteme.name==item.name">
<image :src="iteme.path" style="width:100rpx;height:100rpx" mode="aspectFit" :fade-show="false" lazy-load @tap="chooseDiyEmoji(item)" v-if="emojiName=='favors'"></image>
<image :src="iteme.path" style="width:44rpx;;height:44rpx" mode="aspectFit" lazy-load @tap="chooseEmoji(item)" v-else></image>
</view>
</block>
<block v-else>
<block v-else> -->
<image :src="item.src" style="width:100rpx;height:100rpx" mode="aspectFit" :fade-show="false" lazy-load @tap="chooseDiyEmoji(item)" v-if="emojiName=='favors'"></image>
<image :src="item.src" style="width:44rpx;;height:44rpx" mode="aspectFit" lazy-load @tap="chooseEmoji(item)" v-else></image>
</block>
<!-- </block> -->
</view>
</view>
</scroll-view>
@ -197,7 +197,8 @@ export default {
boardHeight:0,
inputMsg1:"",
network_log:'',
imglist:[]
imglist:[],
FileImg:uni.getStorageSync('FileImg')
}
},
watch:{
@ -261,7 +262,7 @@ export default {
this.currentEmojiList=emoji[0]['children'];
this.getEmojiList();
// #ifdef APP-PLUS
this.downloadFileImg()
// this.downloadFileImg()
// #endif
uni.getSystemInfo({
success: res => {
@ -312,10 +313,10 @@ export default {
}
} catch (e){return null;}
// #endif
this.network_log = uni.getStorageSync('network_log')
if(this.network_log == 'none'){
this.getImagePath()
}
// this.network_log = uni.getStorageSync('network_log')
// if(this.network_log == 'none'){
// this.getImagePath()
// }
},
methods:{
updateKeyboardHeightChange(res){
@ -385,11 +386,12 @@ export default {
this.modelName='';
},
setAtList(item){
const val = {user_id:item.user_id,realname:item.realname?item.realname:item.realname1}
this.isAt=true;
this.closeModel();
this.edit.addLink({
prefix: '@',
data: item
data: item.avatar?val:item
})
},
//
@ -699,73 +701,161 @@ export default {
})
},
//
chooseFile:function(){
let self=this;
// #ifdef H5
uni.chooseFile({
count: 5, //100
success: function (res) {
self.appendFile(res);
}
});
// #endif
// #ifdef MP
wx.chooseMessageFile({
count: 5, //100
success: function (res) {
self.appendFile(res);
}
});
// #endif
// chooseFile:function(){
// let self=this;
// // #ifdef H5
// uni.chooseFile({
// count: 5, //100
// success: function (res) {
// self.appendFile(res);
// }
// });
// // #endif
// // #ifdef MP
// wx.chooseMessageFile({
// count: 5, //100
// success: function (res) {
// self.appendFile(res);
// }
// });
// // #endif
// #ifdef APP-PLUS
const lemonjkFileSelect = uni.requireNativePlugin('lemonjk-FileSelect');
lemonjkFileSelect.showPicker({
pathScope: "/Download", // showPicker
mimeType: "*/*",
utisType:"public.data",
multi:'yes',
}, result => {
// ,
if(result.code==1001){
uni.showModal({
title:"需要文件访问权限",
content:"您还未授权本应用读取文件。为保证您可以正常上传文件,请在权限设置页面打开文件访问权限(不同手机厂商表述可能略有差异)请根据自己手机品牌设置",
confirmText:"去授权",
cancelText:"算了",
success(e) {
if(e.confirm){
//
lemonjkFileSelect.gotoSetting();
}
}
})
}
let type='file';
let imageExts=['jpg','jpeg','png','bmp','gif'];
let videoExts=['mp4','3gp','avi','m2v','mkv','mov'];
result.files.forEach((item)=>{
if(imageExts.includes(item.fileExtension)){
type='image';
}else if(videoExts.includes(item.fileExtension)){
type='video';
}else{
type='file';
}
let filePath='file://'+item.filePath;
const message={
type:type,
status:'going',
fileName:item.FileName,
fileSize:item.fileSize,
content:filePath
};
this.$emit('send',Object.assign(this.msgItem(), message),filePath);
})
})
// #endif
// // #ifdef APP-PLUS
// const lemonjkFileSelect = uni.requireNativePlugin('lemonjk-FileSelect');
// lemonjkFileSelect.showPicker({
// pathScope: "/Download", // showPicker
// mimeType: "*/*",
// utisType:"public.data",
// multi:'yes',
// }, result => {
// // ,
// if(result.code==1001){
// uni.showModal({
// title:"访",
// content:"访",
// confirmText:"",
// cancelText:"",
// success(e) {
// if(e.confirm){
// //
// lemonjkFileSelect.gotoSetting();
// }
// }
// })
// }
// let type='file';
// let imageExts=['jpg','jpeg','png','bmp','gif'];
// let videoExts=['mp4','3gp','avi','m2v','mkv','mov'];
// result.files.forEach((item)=>{
// if(imageExts.includes(item.fileExtension)){
// type='image';
// }else if(videoExts.includes(item.fileExtension)){
// type='video';
// }else{
// type='file';
// }
// let filePath='file://'+item.filePath;
// const message={
// type:type,
// status:'going',
// fileName:item.FileName,
// fileSize:item.fileSize,
// content:filePath
// };
// this.$emit('send',Object.assign(this.msgItem(), message),filePath);
// })
// })
// // #endif
// },
chooseFile: function() {
let self = this;
//
const allowedExtensions = ['pdf', 'doc', 'docx', 'txt', 'xls', 'xlsx', 'ppt', 'pptx', 'zip', 'rar'];
// #ifdef H5
uni.chooseFile({
count: 5,
accept: '.' + allowedExtensions.join(',.'), //
success: function(res) {
const filteredFiles = res.tempFiles.filter(file => {
const ext = file.name.split('.').pop().toLowerCase();
return allowedExtensions.includes(ext);
});
if (filteredFiles.length > 0) {
self.appendFile({ tempFiles: filteredFiles });
} else {
uni.showToast({ title: '只能上传PDF/Word/Excel等文档', icon: 'none' });
}
}
});
// #endif
// #ifdef MP
wx.chooseMessageFile({
count: 5,
type: 'file', //
success: function(res) {
const filteredFiles = res.tempFiles.filter(file => {
const ext = file.name.split('.').pop().toLowerCase();
return allowedExtensions.includes(ext);
});
if (filteredFiles.length > 0) {
self.appendFile({ tempFiles: filteredFiles });
} else {
uni.showToast({ title: '只能上传PDF/Word/Excel等文档', icon: 'none' });
}
}
});
// #endif
// #ifdef APP-PLUS
const lemonjkFileSelect = uni.requireNativePlugin('lemonjk-FileSelect');
lemonjkFileSelect.showPicker({
pathScope: "/Download",
mimeType: "application/*", // MIME
utisType: "public.data",
multi: 'yes'
}, result => {
if (result.code == 1001) {
uni.showModal({
title: "需要文件访问权限",
content: "请授权文件访问权限",
confirmText: "去授权",
success(e) {
if (e.confirm) lemonjkFileSelect.gotoSetting();
}
});
return;
}
//
const validFiles = result.files.filter(item => {
const ext = item.fileExtension.toLowerCase();
return allowedExtensions.includes(ext);
});
if (validFiles.length === 0) {
uni.showToast({ title: '只能上传PDF/Word/Excel等文档', icon: 'none' });
return;
}
validFiles.forEach(item => {
const message = {
type: 'file', //
status: 'going',
fileName: item.FileName,
fileSize: item.fileSize,
content: 'file://' + item.filePath
};
this.$emit('send', Object.assign(this.msgItem(), message), message.content);
});
});
// #endif
},
//
appendFile(res){
const tempFiles=res.tempFiles;
@ -1084,98 +1174,102 @@ export default {
})
},
downloadFileImg(){
var self1 = this;
this.currentEmojiList.forEach((res)=>{
// console.log(res);
uni.downloadFile({ url: res.src,success: (downloadResult) => {
self1.saveToPermanentStorage(downloadResult.tempFilePath);
}})
});
},
// App
saveToPermanentStorage(tempPath) {
return new Promise((resolve, reject) => {
//
plus.io.resolveLocalFileSystemURL(
'_doc',
(docDir) => {
//
docDir.getDirectory(
'emoji',
{ create: true, exclusive: false },
(entry) => {
//
const fileName = this.getFileName(tempPath);
const fileName1 = this.getFileName(docDir.fullPath + 'emoji/' +fileName);
// console.log(fileName);
// console.log(fileName1);
//
entry.getFile(fileName1,{ create: false }, //
(fileEntry) => {
// console.log('');
//
reject(new Error('文件已存在: ' + fileName));
},
(error) => {
// console.log(error);
//
if (error.code === 14) { // 1
this.copyFile(tempPath, entry, fileName, resolve, reject);
} else {
reject(error);
}
}
);
},
(error) => {
reject(error);
}
);
},
(error) => {
reject(error);
}
);
});
},
// downloadFileImg(){
// if(this.FileImg==false){
// // console.log('123456');
// var self1 = this;
// this.currentEmojiList.forEach((res)=>{
// // console.log(res);
// uni.downloadFile({ url: res.src,success: (downloadResult) => {
// self1.saveToPermanentStorage(downloadResult.tempFilePath);
// }})
// });
// }
// },
// // App
// saveToPermanentStorage(tempPath) {
// return new Promise((resolve, reject) => {
// //
// plus.io.resolveLocalFileSystemURL(
// '_doc',
// (docDir) => {
// //
// docDir.getDirectory(
// 'emoji',
// { create: true, exclusive: false },
// (entry) => {
// //
// const fileName = this.getFileName(tempPath);
// uni.setStorageSync('FileImg',true);
// const fileName1 = this.getFileName(docDir.fullPath + 'emoji/' +fileName);
// // console.log(fileName);
// // console.log(fileName1);
// //
// entry.getFile(fileName1,{ create: false }, //
// (fileEntry) => {
// // console.log('');
// //
// reject(new Error(': ' + fileName));
// },
// (error) => {
// // console.log(error);
// //
// if (error.code === 14) { // 1
// this.copyFile(tempPath, entry, fileName, resolve, reject);
// } else {
// reject(error);
// }
// }
// );
// },
// (error) => {
// reject(error);
// }
// );
// },
// (error) => {
// reject(error);
// }
// );
// });
// },
//
copyFile(tempPath, targetDir, fileName, resolve, reject) {
plus.io.resolveLocalFileSystemURL(
tempPath,
(tempEntry) => {
tempEntry.copyTo(
targetDir,
fileName,
(newEntry) => {
resolve(newEntry.toLocalURL());
},
(error) => {
reject(error);
}
);
},
(error) => {
reject(error);
}
);
},
//
getFileName(path) {
const index = path.lastIndexOf('/');
let fileName = path.substr(index + 1);
fileName = fileName.replace(/\(\d+\)(?=\.[^./]+$)/, '');
return fileName;
},
async getImagePath(){
this.imglist = await getSavedImages3()
this.imglist.map(item => {
item.path = plus.io.convertLocalFileSystemURL(item.path)
item.name = item.name.replace(/\.png$/i, '');
});
// console.info('',this.imglist);
},
// //
// copyFile(tempPath, targetDir, fileName, resolve, reject) {
// plus.io.resolveLocalFileSystemURL(
// tempPath,
// (tempEntry) => {
// tempEntry.copyTo(
// targetDir,
// fileName,
// (newEntry) => {
// resolve(newEntry.toLocalURL());
// },
// (error) => {
// reject(error);
// }
// );
// },
// (error) => {
// reject(error);
// }
// );
// },
// //
// getFileName(path) {
// const index = path.lastIndexOf('/');
// let fileName = path.substr(index + 1);
// fileName = fileName.replace(/\(\d+\)(?=\.[^./]+$)/, '');
// return fileName;
// },
// async getImagePath(){
// this.imglist = await getSavedImages3()
// this.imglist.map(item => {
// item.path = plus.io.convertLocalFileSystemURL(item.path)
// item.name = item.name.replace(/\.png$/i, '');
// });
// // console.info('',this.imglist);
// },
}
}
</script>

21
components/message/user-select.vue

@ -7,7 +7,8 @@
</view>
</view>
<view class="gui-padding" style="padding-bottom: 120rpx;" v-if="!keywords">
<view class="gui-padding" v-if="!keywords">
<!-- style="padding-bottom: 120rpx;" -->
<view class="cu-list menu">
<view class="cu-item arrow" v-if="isAuth" @tap="atAll">
<view class='cu-avatar mr-15 group-bg sm'>
@ -17,11 +18,22 @@
</view>
</view>
</view>
<uni-data-checkbox :multiple="multiple" class="user-list-select" @change="chooseUser" v-model="changeUser" :localdata="lists"></uni-data-checkbox>
<scroll-view scroll-y="true" style="height: 100vh;padding-bottom: 40%;" v-if="num==1">
<uni-data-checkbox style="white-space: pre-wrap;line-break: anywhere;" :multiple="multiple" class="user-list-select" @change="chooseUser" v-model="changeUser" :localdata="lists"></uni-data-checkbox>
</scroll-view>
<view style="padding-bottom: 120rpx;" v-else>
<uni-data-checkbox style="white-space: pre-wrap;line-break: anywhere;" :multiple="multiple" class="user-list-select" @change="chooseUser" v-model="changeUser" :localdata="lists"></uni-data-checkbox>
</view>
<Empty v-if="!lists.length" noDatatext="无联系人" textcolor="#999" ></Empty>
</view>
<view class="gui-padding" style="padding-bottom: 120rpx;" v-if="keywords">
<uni-data-checkbox :multiple="multiple" class="user-list-select" @change="chooseSearchUser" v-model="searcheUser" :localdata="searchList"></uni-data-checkbox>
<scroll-view scroll-y="true" style="height: 100vh;padding-bottom: 40%;" v-if="num==1">
<uni-data-checkbox style="white-space: pre-wrap;line-break: anywhere;" :multiple="multiple" class="user-list-select" @change="chooseSearchUser" v-model="searcheUser" :localdata="searchList"></uni-data-checkbox>
</scroll-view>
<view style="padding-bottom: 120rpx;" v-else>
<uni-data-checkbox style="white-space: pre-wrap;line-break: anywhere;" :multiple="multiple" class="user-list-select" @change="chooseSearchUser" v-model="searcheUser" :localdata="searchList"></uni-data-checkbox>
</view>
<Empty v-if="!searchList.length" noDatatext="未搜索到数据" textcolor="#999" ></Empty>
</view>
<view class="cu-bar bg-white tabbar border shop footer-opt">
@ -48,7 +60,8 @@
type:{type:Number, default:0},//12345
contact_id:{type:String, default:''},
multiple:{type:Boolean, default:true},
user_ids:{type:Object, default:{}}
user_ids:{type:Object, default:{}},
num:{type:Number, default:0}
},
data() {
return {

4
pages/compass/Informationdetails.vue

@ -17,7 +17,7 @@
<view>
<view style="color: #576b95;font-size: 16px;margin-bottom: 10rpx;">{{item.option_user.nickname}}</view>
<view v-if="item.content">
<mp-html container-style="overflow: hidden;display:inline;white-space: pre-wrap;font-size: 13px;" :content="emojiToHtml(item.content)"/>
<mp-html container-style="overflow: hidden;display:inline;white-space: pre-wrap;font-size: 13px;line-break: anywhere;" :content="emojiToHtml(item.content)"/>
</view>
<view v-if="item.type==1">
<uni-icons type="heart" size="15" color="#576b95"></uni-icons>
@ -25,7 +25,7 @@
<view style="font-size: 10px;margin-top: 10rpx;">{{item.create_time}}</view>
</view>
<view v-if="item.file.src">
<image :src="apiUrl+item.file.src" mode="widthFix" style="width: 80rpx;border-radius: 10rpx;"></image>
<image :src="apiUrl+item.file.src" mode="widthFix" style="width: 80rpx;border-radius: 10rpx;margin-left: 20px;"></image>
</view>
</view>
</view>

45
pages/compass/friendscircledetails.vue

@ -3,13 +3,13 @@
<template #backText></template>
<template #content>详情</template>
</cu-custom>
<scroll-view scroll-y style="height: 92vh;">
<scroll-view scroll-y style="height: 92vh;background-color: #fff;">
<view class="cu-card dynamic no-card">
<view class="cu-item shadow">
<view class="cu-list menu-avatar">
<view class="cu-item" style="margin-top: 20px;" v-if="list.user">
<view class="cu-item" style="margin-top: 20px;height: 160rpx;" v-if="list.user">
<view class="cu-avatar round lg" :style="[{backgroundImage:'url('+list.user.avatar+')'}]"></view>
<view class="content flex-sub">
<view class="content flex-sub" style="word-break: break-word;white-space: pre-wrap;line-break: anywhere;">
<view>{{list.user.nickname}}</view>
<view class="text-gray text-sm flex justify-between">
{{list.create_time}}
@ -17,10 +17,10 @@
</view>
</view>
</view>
<view class="text-content">
<view class="text-content" v-if="list.content">
<!-- <mp-html container-style="overflow: hidden;display:inline;white-space: pre-wrap" :content="emojiToHtml(list.content)"/> -->
<view class="text-content" v-if="contenthtml(list.content)" @click="handleLink(list.content)" v-html="list.content"></view>
<view class="text-content" v-html="list.content" v-else></view>
<view class="text-content" style="word-break: break-word;white-space: pre-wrap;line-break: anywhere;" v-if="contenthtml(list.content)" @click="handleLink(list.content)" v-html="list.content"></view>
<view class="text-content" style="word-break: break-word;white-space: pre-wrap;line-break: anywhere;" v-html="list.content.replace(/\n/g, '<br>')" v-else></view>
</view>
<view class="grid" style="margin: 0px 24rpx;">
<view class="grid" style="margin: 2rpx 0px;padding: 0px 8rpx;" v-for="(itemss,indexs) in list.files" :key="indexs">
@ -32,7 +32,7 @@
<view class="relative-shadow" @tap="handlePlay(itemss)" style="">
<view class="cuIcon-video icon-center f-28 c-white"></view>
</view>
<im-image style="position: absolute;top: 0px;" :src="apiUrl+itemss.privacy" ></im-image>
<im-image style="position: absolute;top: 0%;" :src="apiUrl+itemss.privacy" ></im-image>
</view>
</view>
</view>
@ -43,10 +43,14 @@
</view>
</view>
<view class="text-gray text-sm text-right padding">
<text @click="onLike(list.id)" :class="['cuIcon-appreciatefill', list.is_like === 1 ? 'text-red' : 'margin-lr-xs']"></text> {{list.likes?list.likes.length:0}}
<text @click="onComment(null)" class="cuIcon-messagefill margin-lr-xs"></text> {{list.comment?list.comment.length:0}}
<text v-if="list.user_id==userInfo.user_id" class="cuIcon-delete" style="margin-left: 5px;" @click="Delete(list.id)">删除</text>
<view style="display: flex;align-items: center;justify-content: space-between;">
<view class="text-gray text-sm padding" style="color: #383bff;" v-if="list.user_id==userInfo.user_id">{{list.privacy == 2?'部分可见':list.privacy == 3?'私密':list.privacy == 4?'不给谁看':''}}</view>
<view v-else></view>
<view class="text-gray text-sm text-right padding">
<text @click="onLike(list.id)" :class="['cuIcon-appreciatefill', list.is_like === 1 ? 'text-red' : 'margin-lr-xs']"></text> {{list.likes?list.likes.length:0}}
<text @click="onComment(null)" class="cuIcon-messagefill margin-lr-xs"></text> {{list.comment?list.comment.length:0}}
<text v-if="list.user_id==userInfo.user_id" class="cuIcon-delete" style="margin-left: 5px;" @click="Delete(list.id)">删除</text>
</view>
</view>
<view v-show="boll" style="margin: 5px 15px;position: relative;box-shadow:0px 0px 5px rgba(0, 0, 0, 0.2);">
@ -61,7 +65,7 @@
<scroll-view scroll-y class="icon" v-if="isFocus">
<view class="im-flex im-wrap im-justify-content-start im-align-items-center pd-10">
<view v-for="(item,index) in currentEmojiList" class="im-emoji-item" :key="index">
<image :src="item.src" style="width:44rpx;;height:44rpx" mode="aspectFit" lazy-load @tap="chooseEmoji(item)"></image>
<image :src="item.src" style="width:44rpx;height:44rpx;" mode="aspectFit" lazy-load @tap="chooseEmoji(item)"></image>
</view>
</view>
</scroll-view>
@ -252,21 +256,26 @@
this.boll = !this.boll
if(id){
uni.setStorageSync('pid',id)
}else{
uni.removeStorageSync('pid')
}
},
Delete(id){
const _this = this
uni.showModal({
title: "提示",
content: "是否要删除该图片",
content: "是否要删除该内容",
success: (res) => {
if (res.confirm) {
_this.$api.compaApi.Deleteapost({posts_id:id}).then(res => {
if(_this.userid){
_this.init(_this.userid)
}else{
_this.init()
}
// if(_this.userid){
// _this.init(_this.userid)
// }else{
// _this.init()
// }
uni.navigateBack({
delta:1
})
})
}else if (res.cancel) {
console.log('用户点击取消');

34
pages/compass/moments.vue

@ -43,8 +43,8 @@
</view>
</view>
</view>
<view class="text-content" v-if="contenthtml(item.content)" @click="handleLink(item.content)" v-html="item.content"></view>
<view class="text-content" v-html="item.content" v-else></view>
<view class="text-content" style="word-break: break-word;" v-if="contenthtml(item.content)" @click="handleLink(item.content)" v-html="item.content"></view>
<view class="text-content" style="word-break: break-word;" v-html="item.content" v-else></view>
<view class="grid" style="margin: 0px 24rpx;">
<view class="grid" style="margin: 2rpx 0px;padding: 0px 8rpx;" v-for="(itemss,indexs) in item.files" :key="indexs">
@ -69,12 +69,16 @@
</view>
</view>
<view class="text-gray text-sm text-right padding">
<!-- <text class="cuIcon-attentionfill margin-lr-xs"></text> 10 -->
<!-- +item.is_like -->
<text @click="onLike(item.id)" :class="['cuIcon-appreciatefill', item.is_like === 1 ? 'text-red' : 'margin-lr-xs']"></text> {{item.likes.length}}
<text @click="onComment(index)" class="cuIcon-messagefill margin-lr-xs"></text> {{item.comment.length}}
<text v-if="item.user_id==userInfo.user_id" class="cuIcon-delete" style="margin-left: 5px;" @click="Delete(item.id)">删除</text>
<view style="display: flex;align-items: center;justify-content: space-between;">
<view class="text-gray text-sm padding" style="color: #383bff;" v-if="item.user_id==userInfo.user_id">{{item.privacy_describe == '公开'?'':item.privacy_describe}}</view>
<view v-else></view>
<view class="text-gray text-sm text-right padding">
<!-- <text class="cuIcon-attentionfill margin-lr-xs"></text> 10 -->
<!-- +item.is_like -->
<text @click="onLike(item.id)" :class="['cuIcon-appreciatefill', item.is_like === 1 ? 'text-red' : 'margin-lr-xs']"></text> {{item.likes.length}}
<text @click="onComment(index)" class="cuIcon-messagefill margin-lr-xs"></text> {{item.comment.length}}
<text v-if="item.user_id==userInfo.user_id" class="cuIcon-delete" style="margin-left: 5px;" @click="Delete(item.id)">删除</text>
</view>
</view>
<view v-show="numindex === index&&boll" style="margin: 5px 15px 5px 15px;position: relative;box-shadow:0px 0px 5px rgba(0, 0, 0, 0.2);">
@ -92,7 +96,7 @@
<scroll-view scroll-y class="icon" v-if="isFocus">
<view class="im-flex im-wrap im-justify-content-start im-align-items-center pd-10">
<view v-for="(item,index) in currentEmojiList" class="im-emoji-item" :key="index">
<image :src="item.src" style="width:44rpx;;height:44rpx" mode="aspectFit" lazy-load @tap="chooseEmoji(item)"></image>
<image :src="item.src" style="width:44rpx;height:44rpx;" mode="aspectFit" lazy-load @tap="chooseEmoji(item)"></image>
</view>
</view>
</scroll-view>
@ -189,6 +193,7 @@
refreshing: false,
status: 'more',//
inputMsg:'',
bool: 0,
//
contentText: {
contentdown: '查看更多',
@ -220,10 +225,14 @@
}
});
this.emojiMap=emojiMap;
this.page = 1;
this.wechatMomentsList();
},
onShow() {
this.page = 1
this.wechatMomentsList()
if(this.bool==1){
this.page = 1;
this.wechatMomentsList();
}
},
methods: {
onRefresh() {
@ -274,6 +283,7 @@
res.location = location
res.content = res.content.replace(/\n/g, '<br>')
})
this.bool = 0
if (this.page === 1) {
this.list = res.data
} else {
@ -298,11 +308,13 @@
// console.log('');
},
tomoments(){
this.bool = 1;
uni.navigateTo({
url:'/pages/compass/sendtoMoments'
})
},
tonotice(){
this.bool = 1;
uni.navigateTo({
url:'/pages/compass/Informationdetails'
})

14
pages/compass/personalcircleoffriends.vue

@ -41,13 +41,13 @@
<!-- 动态内容展开时显示 -->
<view v-if="!collapsedYears.includes(year)" class="moments-list">
<view v-for="(item, index) in yearGroup" :key="item.id" class="moment-item" @click="JumpDetails(item.id)">
<view class="meta-info">
<view class="meta-info" style="width: 120rpx;">
<text class="time">{{ formatTime(item.create_time) }}</text>
</view>
<view class="content1">
<view v-if="item.files" v-for="(items, indexs) in item.files" :key="indexs">
<view v-if="items.type==1"><image :src="configurl+items.src" :data-src="configurl+items.src" class="post-image" mode="aspectFill" @tap.stop="previewImage"/></view>
<view v-if="items.type==2">
<view v-if="items.type==2&&items.privacy">
<view class='course-video' style="width: 80px;height: 90px;">
<view class="relative-shadow" @tap.stop="handlePlay(items)">
<view class="cuIcon-video icon-center f-28 c-white"></view>
@ -59,7 +59,7 @@
<!-- <image :src="configurl+items.privacy" :data-src="configurl+items.privacy" class="post-image1" mode="aspectFill" @tap.stop="previewImage"/> -->
</view>
</view>
<view style="margin-left: 20rpx;">
<view style="margin-left: 20rpx;width: 320rpx;" class="container">
<mp-html container-style="overflow: hidden;display:inline;word-break: break-word;" :content="emojiToHtml(item.content)"/>
</view>
</view>
@ -310,4 +310,12 @@
left: 50%;
padding: 0 4rpx 0 6rpx;
}
.container {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 5; /* 根据行高计算,约5行(假设行高20px) */
overflow: hidden;
text-overflow: ellipsis;
max-height: 100px; /* 最大高度限制 */
}
</style>

12
pages/compass/sendtoMoments.vue

@ -202,11 +202,11 @@
list.push(res.user_id)
})
uni.navigateTo({
url: `/pages/index/userSelection?type=${5}&user_ids=${JSON.stringify(list)}`
url: `/pages/index/userSelection?type=${5}&user_ids=${JSON.stringify(list)}&num=${1}`
})
}else{
uni.navigateTo({
url: `/pages/index/userSelection?type=${5}`
url: `/pages/index/userSelection?type=${5}&num=${1}`
// url: '/pages/index/userSelection?type='+type+'&contact_id=' + this.contact.id
})
}
@ -219,11 +219,11 @@
list1.push(res.user_id)
})
uni.navigateTo({
url: `/pages/index/userSelection?type=${6}&user_ids=${JSON.stringify(list1)}`
url: `/pages/index/userSelection?type=${6}&user_ids=${JSON.stringify(list1)}&num=${1}`
})
}else{
uni.navigateTo({
url: `/pages/index/userSelection?type=${6}`
url: `/pages/index/userSelection?type=${6}&num=${1}`
// url: '/pages/index/userSelection?type='+type+'&contact_id=' + this.contact.id
})
}
@ -328,7 +328,7 @@
this.positioningList.content = res.data.location_address
this.params.posts_id = res.data.posts_id
this.params.privacy = res.data.privacy
if(res.data.files[0].type==1){
if(res.data.files[0]&&res.data.files[0].type==1){
this.img_arr1 = res.data.files
}else{
this.img_arr1 = res.data.files
@ -344,7 +344,7 @@
this.user2 = res.data.privacy_user
uni.setStorageSync('selectUser1', this.user2);
}
// console.log(res);
console.log(res.data.privacy);
// this.list = res.data
}
})

23
pages/contacts/detail.vue

@ -10,7 +10,7 @@
</block>
<view v-else class='cu-avatar lg radius mr-15' @tap="showAvatar(detail)" :style="'background-image:url('+detail.avatar+')'"></view>
<view class='im-flex im-justify-content-start im-columns'>
<view class='im-flex im-justify-content-start im-columns' style="white-space: pre-wrap;line-break: anywhere;width: 560rpx;">
<view class="mb-5">{{detail.friend?.nickname?detail.friend.nickname:detail.realname}}</view>
<view class="text-gray">{{detail.account}}</view>
</view>
@ -21,7 +21,7 @@
<text class="cuIcon-edit text-green"></text>
<text>备注</text>
</view>
<view class="action">
<view class="action" style="white-space: pre-wrap;line-break: anywhere;width: 560rpx;text-align: right;">
<text class="text-grey text-sm">{{detail.friend.nickname || '未设置'}}</text>
<text class="text-grey text-sm ml-5 cuIcon-write"></text>
</view>
@ -31,7 +31,7 @@
<text class="cuIcon-mail text-green"></text>
<text>昵称</text>
</view>
<view class="action">
<view class="action" style="white-space: pre-wrap;line-break: anywhere;width: 560rpx;text-align: right;">
<text class="text-grey text-sm">{{detail.realname}}</text>
</view>
</view>
@ -40,7 +40,7 @@
<text class="cuIcon-mail text-green"></text>
<text>邮箱</text>
</view>
<view class="action">
<view class="action" style="white-space: pre-wrap;line-break: anywhere;width: 560rpx;text-align: right;">
<text class="text-grey text-sm">{{detail.email ?? ''}}</text>
</view>
</view>
@ -49,7 +49,7 @@
<text class="cuIcon-safe text-green"></text>
<text>性别</text>
</view>
<view class="action">
<view class="action" style="white-space: pre-wrap;line-break: anywhere;width: 560rpx;text-align: right;">
<text class="text-grey text-sm">{{ sex(detail.sex)}}</text>
</view>
</view>
@ -58,7 +58,7 @@
<text class="cuIcon-location text-green"></text>
<text>IP</text>
</view>
<view class="action">
<view class="action" style="white-space: pre-wrap;line-break: anywhere;width: 560rpx;text-align: right;">
<text class="text-grey text-sm" v-if="detail.last_login_ip">{{ detail.last_login_ip || "未知"}} {{detail.location || "未知"}}</text>
<text class="text-grey text-sm" v-else>未知</text>
</view>
@ -68,7 +68,7 @@
<view class="flex justify-center" style="width: 1.6em;margin-right: 0.3125rem;"><uni-icons type="pyq" size="15" color="#45ba5b"></uni-icons></view>
<view>朋友圈</view>
</view>
<view class="action">
<view class="action" style="white-space: pre-wrap;line-break: anywhere;width: 540rpx;text-align: right;">
<text class="text-grey cuIcon-right"></text>
</view>
</view>
@ -149,6 +149,7 @@
}
},
onLoad(options) {
uni.setStorageSync('detailrefresh',1);
const _this = this
this.network_log = uni.getStorageSync('network_log')
if(_this.network_log == 'none'){
@ -168,7 +169,9 @@
this.detail=res.data;
const list = []
list.push(res.data)
// #ifdef APP-PLUS
this.insertUserInfo(list)
// #endif
}
})
},
@ -264,14 +267,14 @@
if (res.confirm) {
if(res.content==''){
return uni.showToast({
title:'请输入备注!',
icon:'error'
title:'请输入验证信息!',
icon:'none'
})
}
this.$api.friendApi.addFriend({user_id:this.detail.user_id,remark:res.content}).then((e)=>{
if(e.code==0){
uni.showToast({
title:e.msg,
title:'发送成功',
icon:'none'
})
this.getInfo()

116
pages/contacts/friend.vue

@ -14,7 +14,7 @@
<view class="cu-item" v-if="!params.is_mine" v-for="(x,index) in list" :key="index">
<view class='cu-avatar md radius mr-15' :style="[{backgroundImage:'url('+x.create_user_info.avatar+')'}]">
</view>
<view class="content padding-tb-sm" @tap='openDetails(x.create_user_info.user_id)'>
<view class=" padding-tb-sm" style="width: 460rpx;white-space: pre-wrap;line-break: anywhere;" @tap='openDetails(x.create_user_info.user_id)'>
<view class="text-grey" v-if="!params.is_mine">
<text class="text-blue">{{x.create_user_info.realname}} </text> 申请添加您为好友
</view>
@ -49,6 +49,21 @@
<Empty v-if="!list.length" noDatatext="暂无群聊" textcolor="#999" ></Empty>
</view>
<uni-popup ref="inputDialog" type="dialog" background-color="#fff" :mask-click="false">
<view style="width: 600rpx;">
<view @click="close" style="text-align: right;margin-right: 10px;margin-top: 10px;">X</view>
<view style="padding: 20rpx 40rpx 60rpx 40rpx;text-align: center;">
<view>
<view style="text-align: center;font-size: 16px;">提示</view>
<view style="margin-top: 10px;font-size: 16px;">你确定同意该好友的请求吗</view>
</view>
</view>
<view class="Dialogbox">
<view class="Dialogreject" @click="reject">拒绝</view>
<view class="Dialogaccept" @click="accept">接受</view>
</view>
</view>
</uni-popup>
</view>
</template>
@ -69,6 +84,7 @@
current: 0,
list: [],
total:0,
friend_id:0,
params: {
page: 1,
limit: 10,
@ -82,6 +98,9 @@
this.getList();
},
methods: {
close(){
this.$refs.inputDialog.close()
},
getList(){
this.$api.friendApi.applyList(this.params).then((res)=>{
if(res.code==0){
@ -115,36 +134,85 @@
url:"/pages/contacts/search"
})
},
optApply(x){
uni.showModal({
title: '提示',
content:"你确定同意该好友的请求吗",
cancelText:"拒绝",
cancelColor:'#e54d42',
confirmText:"接受",
success: (res)=>{
let status=0;
if (res.confirm) {
status=1
}
this.$api.friendApi.acceptApply({friend_id:x.friend_id,status:status}).then((e)=>{
if(e.code==0){
uni.showToast({
title:'添加好友成功',
icon:'none'
})
msgStore.sysUnread--;
this.getList();
}
accept(){
this.$api.friendApi.acceptApply({friend_id:this.friend_id,status:1}).then((e)=>{
if(e.code==0){
uni.showToast({
title:'添加好友成功',
icon:'none'
})
msgStore.sysUnread--;
this.getList();
this.$refs.inputDialog.close()
}
})
},
reject(){
this.$api.friendApi.acceptApply({friend_id:this.friend_id,status:0}).then((e)=>{
if(e.code==0){
uni.showToast({
title:'已拒绝',
icon:'none'
})
msgStore.sysUnread--;
this.getList();
this.$refs.inputDialog.close()
}
})
},
optApply(x){
this.$refs.inputDialog.open();
this.friend_id = x.friend_id;
// uni.showModal({
// title: '',
// content:"",
// cancelText:"",
// cancelColor:'#e54d42',
// confirmText:"",
// success: (res)=>{
// let status=0;
// if (res.confirm) {
// status=1
// }
// this.$api.friendApi.acceptApply({friend_id:x.friend_id,status:status}).then((e)=>{
// if(e.code==0){
// uni.showToast({
// title:'',
// icon:'none'
// })
// msgStore.sysUnread--;
// this.getList();
// }
// })
// }
// })
}
}
}
</script>
<style scoped>
<style scoped lang="less">
::v-deep .uni-popup__wrapper{
border-radius: 10px;
}
.Dialogbox{
display: flex;
margin-top: 40rpx;
justify-content: space-around;
}
.Dialogreject{
color: #fff;
width: 50%;
text-align: center;
padding: 30rpx 0rpx;
background-color: red;
}
.Dialogaccept{
color: #fff;
width: 50%;
text-align: center;
padding: 30rpx 0rpx;
background-color: #39b54a;
}
</style>

2
pages/contacts/group.vue

@ -16,7 +16,7 @@
</block>
<view v-else class='cu-avatar lg radius mr-15' :style="[{backgroundImage:'url('+items.avatar+')'}]">
</view>
<view class="content">
<view class="content" style="white-space: pre-wrap;line-break: anywhere;">
<view class="c-333">{{items.displayName}}</view>
</view>
<view class="action">

2
pages/contacts/index.vue

@ -51,7 +51,7 @@
<view class="online-status-small" v-if="items.is_online && items.is_group==0 && globalConfig.chatInfo.online==1" ></view>
</view>
<view class="content">
<view class="content" style="white-space: pre-wrap;line-break: anywhere;padding-right: 40rpx;">
<view class="c-333">{{items.displayName}}</view>
</view>
</view>

4
pages/contacts/search.vue

@ -25,8 +25,8 @@
<view class="c-333">{{items.realname}}</view>
</view>
<view class="action ml-10">
<view class="text-blue" v-if="items.friend" @tap.stop="sendMsg(items.user_id)">发消息</view>
<view class="text-blue" v-if="!items.friend">查看</view>
<view class="text-blue" v-if="items.friend&&items.friend.status==1" @tap.stop="sendMsg(items.user_id)">发消息</view>
<view class="text-blue" v-else>查看</view>
</view>
</view>
</view>

15
pages/index/search.vue

@ -15,12 +15,19 @@
<view v-if="type<3 && contacts.length>0">
<view class="padding">联系人</view>
<view class="cu-list menu-avatar no-padding">
<view class="cu-item" v-for="(items,sub) in contacts" :key="sub" @tap='openDetails(items)'>
<!-- <view class="cu-item" v-for="(items,sub) in contacts" :key="sub" @tap='openDetails(items)'>
<view class='cu-avatar lg radius mr-15' :style="[{backgroundImage:'url('+items.avatar+')'}]">
</view>
<view class="content">
<view class="c-333">{{items.displayName}}</view>
</view>
</view> -->
<view v-for="(items,sub) in contacts" :key="sub" @tap='openDetails(items)' style="background-color: #fff;padding: 15px;border-bottom: 1px solid #f7f7f7;display: flex;align-items: center;">
<view class='cu-avatar lg radius mr-15' :style="[{backgroundImage:'url('+items.avatar+')'}]">
</view>
<view>
<view class="c-333 text-overflow" style="width: 240px;">{{items.displayName}}</view>
</view>
</view>
</view>
</view>
@ -108,5 +115,9 @@
</script>
<style scoped>
.text-overflow{
text-overflow: ellipsis;
overflow: hidden !important;
white-space: nowrap !important;
}
</style>

9
pages/index/userSelection.vue

@ -7,7 +7,7 @@
<view class="mr-10 f-16" @tap="save">{{type==3 ? '转发' : '完成'}}</view>
</template>
</cu-custom>
<user-select :type="type" :contact_id="contact_id" :user_ids="user_ids" ref="userSelect"></user-select>
<user-select :type="type" :contact_id="contact_id" :user_ids="user_ids" :num="num" ref="userSelect"></user-select>
</view>
</template>
@ -34,7 +34,8 @@
relayState: false,
scrollLeft:300,
content:'',
curMsg:{}
curMsg:{},
num:0
}
},
watch: {
@ -57,6 +58,7 @@
this.type = options.type ? options.type : 1;
this.contact_id = options.contact_id ? options.contact_id : '';
this.content = options.content ? options.content : '';
this.num = options.num ? options.num : 0;
if (options.type == 2) {
this.title="添加成员";
//
@ -78,9 +80,8 @@
// #endif
} else if (options.type == 4) {
this.title="选择提醒的人";
} else if(options.type == 5){
} else if(options.type == 5&&options.user_ids){
this.user_ids = JSON.parse(options.user_ids)
// console.log(this.user_ids);
}else if(options.type == 6){
if(options.user_ids){
this.user_ids = JSON.parse(options.user_ids)

1
pages/login/register.vue

@ -137,6 +137,7 @@
});
return false;
}
this.regForm.inviteCode = this.$route.query.inviteCode ?? ''
this.$api.LoginApi.register(this.regForm).then(res => {
if (res.code == 0) {
setTimeout(()=>{

82
pages/message/chat.vue

@ -1,7 +1,7 @@
<template>
<view>
<!-- <uni-notice-bar show-icon scrollable showClose text="请注意防骗" style="margin: 0;z-index:1000;position: absolute;"/> -->
<z-paging ref="paging" v-model="messageList" hide-empty-view auto-show-back-to-top use-chat-record-mode safe-area-inset-bottom bottom-bg-color="#f8f8f8" @query="scrollChat">
<z-paging ref="paging" :style="{backgroundImage:'url('+bgInfo.image+')'}" class="backsize" v-model="messageList" hide-empty-view auto-show-back-to-top use-chat-record-mode safe-area-inset-bottom bottom-bg-color="#f8f8f8" @query="scrollChat">
<template #top>
<cu-custom bgColor="bg-white" :isBack="true" class="cu-header">
<template #backText>
@ -10,7 +10,8 @@
</template>
<template #content>
<view class="im-flex im-justify-content-center im-align-items-center">
<statusPoint v-if="is_group==0 && contact.is_online==1 && globalConfig.chatInfo.online==1" type="success"></statusPoint><text class="text-overflow">{{contact.displayName}}</text>
<view style="width: 15px;"><statusPoint v-if="is_group==0 && contact.is_online==1 && globalConfig.chatInfo.online==1" type="success"></statusPoint></view>
<text class="text-overflow">{{contact.displayName}}</text>
<text v-if="is_group==1">({{groupInfo.groupUserCount ?? 0}})</text>
</view>
</template>
@ -19,18 +20,18 @@
</template>
</cu-custom>
</template>
<view class="cu-chat" :style="{paddingBottom:paddingB+'px'}" @click="closeInput"><!-- id="more-oprate" -->
<view style="height: 85vh;" v-if="messageList.length==0" @click="closeInput"></view>
<view class="cu-chat" :style="{paddingBottom:paddingB+'px'}" @click="closeInput" v-else><!-- id="more-oprate" -->
<!-- <uni-load-more :status="loading" v-if="page!==1"></uni-load-more> -->
<template v-for="(item,index) in messageList" :key="index" :id="'chatItem_'+index">
<view class="cu-info" style="transform: scaleY(-1);" v-if="item.type=='event'">
<view class="cu-info" style="transform: scaleY(-1);display: flex;" v-if="item.type=='event'">
<!-- #ifdef H5 -->
<text style="display: flex;align-items: center;" v-html="item.content"></text>
<!-- #endif -->
<!-- #ifdef APP -->
<text>{{stripHtmlTags(item.content)}}</text>
<!-- #endif -->
<text class="c-primary" v-if="item.is_undo==1 && (getTime() - item.sendTime) < globalConfig.chatInfo.redoTime*1000" @tap="reEdit(item.oldContent ?? '')">重新编辑</text>
<text class="c-primary" style="margin-left: 10px;" v-if="item.is_undo==1 && (getTime() - item.sendTime) < globalConfig.chatInfo.redoTime*1000" @tap="reEdit(item.oldContent ?? '')">重新编辑</text>
</view>
<template v-else>
<view class="cu-item" :class="[item.fromUser.id==user.user_id ? 'im-rows-reverse self im-justify-content-start' : '' ]" style="transform: scaleY(-1);">
@ -38,7 +39,7 @@
<view class="main im-wrap" :class="[item.fromUser.id==user.user_id ? 'im-rows-reverse' : '' ]" @touchstart="moreOption($event,item,index)" @touchmove="ListTouchMove" @touchend="endTimer" @tap="dblclick(item)">
<view class="message-head f-12 c-666">
<!-- <uni-tag class="mr-5" v-if="item.role<3 && item.fromUser.id!=user.user_id" :type="item.role==1 ? 'warning' : 'primary'" size="mini" :text="item.role==1 ? '群主' : '管理员'"></uni-tag> -->
<text v-if="item.fromUser.id!=user.user_id" :class="bgInfo.image ? 'c-white' : ''">{{item.fromUser.realname1?item.fromUser.realname1:item.fromUser.displayName}} &nbsp;&nbsp;</text>
<text v-if="item.fromUser.id!=user.user_id" :class="bgInfo.image ? 'c-white' : ''" class="text-overflow" style="width: 50px;display: inline-block;">{{item.fromUser.realname1?item.fromUser.realname1:item.fromUser.displayName}} &nbsp;&nbsp;</text>
<text class="f-11" :class="bgInfo.image ? 'c-white' : 'c-999'">{{sendTime(item.sendTime)}}</text>
</view>
<view class="im-flex im-rows-reverse self im-align-items-end" :id="'msg_id_'+item.msg_id">
@ -46,10 +47,10 @@
<view v-if="item.type=='text'">
<view class="content shadow bg-light-green" :class="[item.fromUser.id==user.user_id ? 'bg-light-green' : '',contact.id === -2&&item.fromUser.id!==user.user_id ? 'bg-light-grey' : '' ]">
<!-- <view style="overflow: hidden;display:inline;word-break: break-all;" v-if="contact.id==-2" v-html="item.content"></view> -->
<mp-html container-style="overflow: hidden;display:inline;white-space: pre-wrap;max-width:460rpx;" v-if="contact.id==-2" :content="item.content"/>
<mp-html container-style="overflow: hidden;display:inline;white-space: pre-wrap;max-width:460rpx;line-break: anywhere;" v-if="contact.id==-2" :content="item.content"/>
<view v-else>
<view style="overflow: hidden;display:inline;word-break: break-all;" v-if="contenthtml(item.content)" v-html="item.content"></view>
<mp-html v-else container-style="overflow: hidden;display:inline;white-space: pre-wrap" :content="emojiToHtml(item.content)"/>
<view style="overflow: hidden;display:inline;word-break: break-all;line-break: anywhere;" v-if="contenthtml(item.content)" v-html="item.content"></view>
<mp-html v-else container-style="overflow: hidden;display:inline;white-space: pre-wrap;line-break: anywhere;" :content="emojiToHtml(item.content)"/>
</view>
</view>
<view class="message-quote radius-6" v-if="item.extends && item.extends.content">
@ -140,7 +141,7 @@
<view class="mt-10 mr-5 f-20" v-if="item.fromUser.id==user.user_id">
<view class="cuIcon-icloading icon-spin c-999" v-if="item.status=='going'"></view>
<view class="cuIcon-infofill c-red" v-if="item.status=='failed'" @tap="reSend(item)"></view>
<view class="f-16" v-if="item.is_group==0 && item.status!='going'" :class="item.is_read ? 'text-green cuIcon-roundcheckfill' : 'c-999 cuIcon-roundcheck'"></view>
<view class="f-16" v-if="item.is_group==0 && item.status!='going' && item.status!='failed'" :class="item.is_read ? 'text-green cuIcon-roundcheckfill' : 'c-999 cuIcon-roundcheck'"></view>
</view>
</view>
</view>
@ -156,7 +157,7 @@
</template>
<template #bottom>
<view id="im-input" v-if="is_group!=2">
<view id="im-input" style="position: relative;z-index: 1000;" v-if="is_group!=2">
<imInput :isAnswering="isAnswering" :contactid="contact.id" @sendChat="sendChatID" @send="sendMessage" @setPad="setPad" :boxStatus="boxStatus" :contact="contact" ref="imInput"></imInput>
</view>
</template>
@ -206,7 +207,8 @@
<view class="action text-gray" @tap="modelName=''">取消</view>
<view class="action text-green" @tap="copyMsg()">复制</view>
</view>
<scroll-view scroll-y="true" :style="{height:scrollHeight+'rpx'}">
<!-- <scroll-view scroll-y="true" :style="{height:scrollHeight+'rpx'}"> -->
<scroll-view scroll-y="true" style="height:800rpx">
<view class="pd-20 text-container">
<mp-html :content="curMsg.content"></mp-html>
</view>
@ -225,7 +227,8 @@
<view class="action">提到我的人</view>
<view class="action text-green">已读</view>
</view>
<scroll-view scroll-y="true" :style="{height:scrollHeight+'rpx'}" @tap.stop=''>
<!-- <scroll-view scroll-y="true" :style="{height:scrollHeight+'rpx'}" @tap.stop=''> -->
<scroll-view scroll-y="true" style="height:800rpx" @tap.stop=''>
<view class="cu-chat" style="text-align: left;">
<view class="cu-item" v-for="(item,index) in atMsgList" :key="index" style="padding-bottom: 10rpx;">
<im-user :info="item.fromUser" :profile="isProfile" @longpress="at(item.fromUser)"></im-user>
@ -409,10 +412,11 @@
onLoad(options){
// ,
msgStore.msgList=[];
let bgInfo=uni.getStorageSync('chat-bg-info'+options.id);
let bgInfo=uni.getStorageSync('chat-bg-info'+options.id+this.user.user_id);
if(bgInfo){
this.bgInfo=bgInfo;
}
// console.log('123',this.bgInfo);
//
let data=msgStore.getContact(options.id);
if(!data){
@ -438,7 +442,9 @@
this.is_group = data.is_group;
this.network_log = uni.getStorageSync('network_log')
// console.log(this.network_log);
if(this.network_log == 'none'){
this.getchatList()
this.getImagePath()
if(this.is_group==1){
@ -696,9 +702,15 @@
return true;
},
onShow(){
const detailrefresh = uni.getStorageSync('detailrefresh')
if(detailrefresh==1){
this.getMessageList();
uni.removeStorageSync('detailrefresh')
}
// ws线
this.socketIo.send({type:'ping'});
const _this = this
this.network_log = uni.getStorageSync('network_log')
// console.log('1230',_this.network_log == 'none');
if(_this.network_log !== 'none'){
// _this.getchatList()
@ -707,7 +719,7 @@
// _this.obtainGroupInfo()
// }
// }else{
this.getMessageList();
// this.getMessageList();
if(this.is_group==1){
this.getGroupInfo();
}
@ -935,11 +947,13 @@
// if(this.moreData){
// this.loading='loading';
this.page = pageNo
if(this.network_log == 'none'){
_this.getchatList()
}else{
_this.getMessageList();
// _this.getchatList()
if(this.page>1){
if(this.network_log == 'none'){
_this.getchatList()
}else{
_this.getMessageList();
// _this.getchatList()
}
}
// }
// }
@ -1340,16 +1354,18 @@
message.toContactId=this.contact.id;
message.is_group=this.contact.is_group;
// console.log(message);
if(!isReSend&&message.fromUser.id!=="-2"&&message.type!=='emoji'){
if(!isReSend&&message.fromUser.id!=="-2"){
// &&message.type!=='emoji'
this.messageList.unshift(message);
}
// console.log(imgSrcs);
this.scrollToBottom();
let fileTypes = ["image", "file", "video",'voice'];
let simpleType=['text','location','contact','emoji'];
if(message.imgid==1){
if(message.imgid==1||isReSend==true&&message.type!=='text'&&message.type!=='location'&&message.type!=='contact'&&message.type!=='emoji'){
var self1=this;
this.$api.msgApi.uploadFileImage({image_url:message.content,message:JSON.stringify(message)}).then((res) => {
console.log(message);
this.$api.msgApi.uploadFileImage({image_url:message.content,message:JSON.stringify(message),type:message.type=='image'?'image':'file'}).then((res) => {
// console.log('123456',res);
this.updateMessage(res.data);
const list = []
@ -1416,10 +1432,11 @@
this.insertdata(list)
// #endif
this.updateMessage(res.data);
// console.log('123456',res.data);
// console.log('123456',res);
}else if(res.code==401){
//
this.messageList.pop();
// this.messageList.pop();
this.messageList.shift();
//
uni.showToast({
title: res.msg,
@ -1480,7 +1497,8 @@
// #endif
}else if(res.code==401){
//
this.messageList.pop();
// this.messageList.pop();
this.messageList.shift();
//
uni.showToast({
title: res.msg,
@ -1916,4 +1934,14 @@ page{
.transform180{
transform: rotateY(180deg);
}
.backsize{
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-size: cover; /* 确保图片覆盖整个容器 */
background-position: center; /* 图片居中显示 */
background-repeat: no-repeat; /* 不重复图片 */
}
</style>

31
pages/message/detail.vue

@ -43,9 +43,10 @@
<view class="content padding-tb-sm">
<view> 群聊名称 </view>
</view>
<view class="action">
<view class="text-grey">{{contact.displayName}} <text class="cuIcon-right"></text></view>
<view class="action" style="width: 500rpx;">
<view class="text-grey" style="white-space: pre-wrap;line-break: anywhere;">{{contact.displayName}}</view>
</view>
<view class="text-grey"> <text class="cuIcon-right"></text></view>
</view>
<view class="cu-item" @click="openQr" v-if="contact.setting.invite">
<view class="content padding-tb-sm">
@ -107,7 +108,7 @@
<switch class="switch" @change="setIsTop" :class="contact.is_top?'checked':''" :checked="contact.is_top?true:false"></switch>
</view> -->
</view>
<view class="cu-item" v-if="contact.user_id">
<view class="cu-item" v-if="contact.user_id||is_group==0">
<view class="content padding-tb-sm">
<view> 加入黑名单 </view>
</view>
@ -203,7 +204,7 @@
<view><image :src="bgInfo.image" style="width:200px" mode="widthFix"></image></view>
<button class="cu-btn bg-red mt-10" @tap="removeBg">移除背景图片</button>
</view>
<view class="cu-list menu mt-15 mb-15 bg-white">
<!-- <view class="cu-list menu mt-15 mb-15 bg-white">
<view class="cu-item">
<view class="content padding-tb-sm">
<view>背景虚化</view>
@ -212,7 +213,7 @@
<switch class="switch" @change="setFilter" :class="bgInfo.filter?'checked':''" :checked="bgInfo.filter == true ? true :false"></switch>
</view>
</view>
</view>
</view> -->
<uni-notice-bar text="修改后重新进入聊天才能生效" class="mb-15"/>
</view>
</view>
@ -388,6 +389,7 @@
}
},
onShow() {
uni.setStorageSync('detailrefresh',1);
const _this = this
if(this.network_log == 'none'){
_this.Getchatinformation()
@ -399,7 +401,7 @@
}
},
onLoad: function(options) {
let bgInfo=uni.getStorageSync('chat-bg-info'+options.id);
let bgInfo=uni.getStorageSync('chat-bg-info'+options.id+this.userInfo.user_id);
if(bgInfo){
this.bgInfo=bgInfo;
}
@ -552,7 +554,7 @@
},
setis_blacklist(e,id){
this.contactUser.is_blacklist=e.detail.value ? 1 : 0;
this.$api.msgApi.isBlacklist({friend_user_id:id}).then( res =>{
this.$api.msgApi.isBlacklist({friend_user_id:id||this.contact_id}).then( res =>{
if(res.code==400){
this.contactUser.is_blacklist = 0
}
@ -575,6 +577,13 @@
})
},
editGroupName(e){
if(e.trim() === ""){
uni.showToast({
title:'请输入正确的群聊名称',
icon:'none'
})
return
}
this.$api.msgApi.editGroupName({id:this.contact.id,displayName:e}).then( res =>{
if(res.code!==400){
this.contact.displayName=e;
@ -834,7 +843,7 @@
// this.contact_id
if(this.contact.role<3 || this.contact.setting.profile=='1' || friend){
uni.navigateTo({
url:"/pages/contacts/detail?id="+item.id
url:"/pages/contacts/detail?id="+(item.id||this.contact_id)
})
}else{
uni.showToast({
@ -846,7 +855,7 @@
},
setFilter(e){
this.bgInfo.filter=e.detail.value ? true : false;
uni.setStorageSync('chat-bg-info'+this.contact.id,this.bgInfo)
uni.setStorageSync('chat-bg-info'+this.contact.id+this.userInfo.user_id,this.bgInfo)
},
chooseImg(){
uni.chooseImage({
@ -860,7 +869,7 @@
tempFilePath:item.path,
success:(res)=>{
this.bgInfo.image=res.savedFilePath;
uni.setStorageSync('chat-bg-info'+this.contact.id,this.bgInfo)
uni.setStorageSync('chat-bg-info'+this.contact.id+this.userInfo.user_id,this.bgInfo)
uni.showToast({
title:'设置成功,重新进入聊天后生效',
icon:'none'
@ -873,7 +882,7 @@
},
removeBg(){
this.bgInfo.image='';
uni.setStorageSync('chat-bg-info'+this.contact.id,'')
uni.setStorageSync('chat-bg-info'+this.contact.id+this.userInfo.user_id,'')
},
onDeleterecord(){
const removeval = {group_id:this.contact.is_group==1?this.contact.id:'',form_user:this.userInfo.user_id,to_user:this.contact.id}

8
pages/message/group/groupUser.vue

@ -41,7 +41,7 @@
<view class="cu-item" v-if="curUser">
<view class="content im-flex im-justify-content-center im-align-items-center">
<view class="cu-avatar round sm" :style="'background-image:url('+(curUser.avatar)+');'"></view>
<view class="text-cut ml-5">{{curUser.realname}}</view>
<view class="text-cut ml-5 text-overflow">{{curUser.realname}}</view>
<view v-if="curUser.role==2" class="cu-tag round sm bg-orange">管理员</view>
</view>
</view>
@ -346,4 +346,10 @@
::v-deep uni-modal{
z-index: 1025;
}
.text-overflow{
width: 180px;
text-overflow: ellipsis;
overflow: hidden !important;
white-space: nowrap !important;
}
</style>

22
pages/message/record.vue

@ -33,14 +33,14 @@
<im-user :info="item.fromUser" :profile="isProfile" @longpress="at(item.fromUser)"></im-user>
<view class="main im-wrap">
<view class="f-12 c-666" style="width:100%;margin-bottom: 6rpx;">
<text>{{item.fromUser.realname}} &nbsp;&nbsp;</text>
<text class="text-overflow" style="width: 100px;display: inline-block;">{{item.fromUser.displayName}} &nbsp;&nbsp;</text>
<text class="f-11 c-999">{{sendTime(item.sendTime)}}</text>
</view>
<view class="im-flex im-rows-reverse self im-align-items-end">
<!-- 文字消息 -->
<view v-if="item.type=='text'">
<view class="content shadow">
<mp-html container-style="overflow: hidden;display:inline;white-space: pre-wrap" :content="emojiToHtml(item.content)"/>
<mp-html container-style="overflow: hidden;display:inline;white-space: pre-wrap;line-break: anywhere;" :content="emojiToHtml(item.content)"/>
</view>
<view class="message-quote radius-6" v-if="item.extends && item.extends.content">
{{item.extends.content}}
@ -82,7 +82,7 @@
</view>
</view>
<!-- 音视频消息 -->
<view v-else-if="item.type=='webrtc'" class="im-voice-msg im-flex im-rows im-nowrap im-align-items-center radius-20" :class="[item.fromUser.id==user.user_id ? 'im-rows-reverse' : '' , ]">
<view v-else-if="item.type=='webrtc'" class="im-voice-msg im-flex im-rows im-nowrap im-align-items-center radius-20" :class="[item.fromUser.id==user.user_id ? 'im-rows-reverse' : '']">
<text class="f-16" :class="[item.extends.type == 1 ? 'cuIcon-record' : 'cuIcon-dianhua',item.fromUser.id==user.user_id ? 'rotate180' : '']"></text>
<text class="im-voice-msg-text">{{item.content}}</text>
</view>
@ -155,6 +155,7 @@
import { useloginStore } from '@/store/login';
import { useMsgStore } from '@/store/message';
import { storeToRefs } from 'pinia';
import emoji from '@/utils/emoji.js';
// #ifdef APP-PLUS
import {getSavedImages1,getSavedImages2} from '@/utils/LocalFileSystemURL.js'
// #endif
@ -242,6 +243,21 @@
return winHeight+18
}
},
created() {
let emojiMap=[];
//
emoji.forEach(function (item) {
let child=item.children;
if(child.length>0){
child.forEach(function (val) {
let name=val.name;
let src=val.src;
emojiMap[name]=src;
})
}
});
this.emojiMap=emojiMap;
},
onLoad: function(options) {
this.network_log = uni.getStorageSync('network_log')
this.params.toContactId = options.id;

32
pages/mine/index.vue

@ -73,6 +73,15 @@
<text class="text-grey cuIcon-right"></text>
</view>
</view>
<view class="mine-list-item" @tap="wanttogo">
<view class="mine-list-icon" style="background: linear-gradient(135deg, rgb(255, 33, 81), rgb(255, 255, 28));">
<text class="cuIcon-qrcode text-white"></text>
</view>
<view class="mine-list-title">邀请好友</view>
<view class="action">
<text class="text-grey cuIcon-right"></text>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<view class="mine-list-item" @click="checkVersion()">
<view class="mine-list-icon" style="background: linear-gradient(135deg, rgb(247, 151, 30), rgb(255, 210, 0));">
@ -185,6 +194,29 @@
url:"/pages/mine/doc"
})
},
wanttogo(){
this.$api.msgApi.getMoveInviteLink({}).then(res => {
// console.log(res);
if(res.code==0){
uni.setClipboardData({
data: res.data,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'none'
});
},
fail: (err) => {
uni.showToast({
title: '复制失败',
icon: 'none'
});
console.error(err);
}
});
}
})
},
editInfo(){
uni.navigateTo({
url:"/pages/mine/profile"

5
pages/mine/profile.vue

@ -114,8 +114,9 @@
})
return false
}
console.log(this.userInfo.email);
let pattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if(this.userInfo.email!='' && !pattern.test(this.userInfo.email)){
if(this.userInfo.email!='' && !pattern.test(this.userInfo.email)&&this.userInfo.email!=null&&this.userInfo.email!=undefined){
uni.showToast({
title:'请输入正确的邮箱',
icon:'none'
@ -143,7 +144,7 @@
// 8
setTimeout(()=>{
this.saved=false;
},8000)
},2000)
},
setAvatar(){
uni.navigateTo({

2
static/css/main.css

@ -2244,7 +2244,7 @@ button.cuIcon.lg {
.cu-card.dynamic>.cu-item>.text-content {
padding: 0 30upx 0;
max-height: 6.4em;
/* max-height: 6.4em; */
overflow: hidden;
font-size: 30upx;
margin-bottom: 20upx;

3
uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue

@ -506,7 +506,8 @@
font-size: 14px;
color: #666;
margin-left: 5px;
line-height: 14px;
// line-height: 14px;
line-height: 20px;
}
.checkobx__list {

4
utils/utils.js

@ -888,6 +888,10 @@ const imageCoverStyle = (width,height) => {
newWidth= width;
newHeight = height;
}
if(typeof width=='string'||typeof height=='string'){
width = +width
height = +height
}
if(width>height){
newWidth= 200;
newHeight = 200/width*height;

Loading…
Cancel
Save