diff --git a/App.vue b/App.vue index b6310ac..4fa257a 100644 --- a/App.vue +++ b/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); }); diff --git a/api/message.js b/api/message.js index 71381ef..0adc35e 100644 --- a/api/message.js +++ b/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; diff --git a/components/cu-custom.vue b/components/cu-custom.vue index 5f8a3fd..95614b6 100644 --- a/components/cu-custom.vue +++ b/components/cu-custom.vue @@ -26,7 +26,7 @@ data() { return { StatusBar: this.StatusBar, - CustomBar: this.CustomBar + CustomBar: this.CustomBar?this.CustomBar:45 }; }, name: 'custom', diff --git a/components/message/im-input.vue b/components/message/im-input.vue index 4bd59d0..14f3311 100644 --- a/components/message/im-input.vue +++ b/components/message/im-input.vue @@ -4,9 +4,9 @@ @ - + - - + - + @@ -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); + // }, } } diff --git a/components/message/user-select.vue b/components/message/user-select.vue index ebc6f25..873c70b 100644 --- a/components/message/user-select.vue +++ b/components/message/user-select.vue @@ -7,7 +7,8 @@ - + + @@ -17,11 +18,22 @@ - + + + + + + + - + + + + + + @@ -48,7 +60,8 @@ type:{type:Number, default:0},//1创建群聊,2邀请群成员,3:转发,4:提及某人,5:选择联系人 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 { diff --git a/pages/compass/Informationdetails.vue b/pages/compass/Informationdetails.vue index c9c6600..253b845 100644 --- a/pages/compass/Informationdetails.vue +++ b/pages/compass/Informationdetails.vue @@ -17,7 +17,7 @@ {{item.option_user.nickname}} - + @@ -25,7 +25,7 @@ {{item.create_time}} - + diff --git a/pages/compass/friendscircledetails.vue b/pages/compass/friendscircledetails.vue index 0d42296..e64e3f2 100644 --- a/pages/compass/friendscircledetails.vue +++ b/pages/compass/friendscircledetails.vue @@ -3,13 +3,13 @@ - + - + - + {{list.user.nickname}} {{list.create_time}} @@ -17,10 +17,10 @@ - + - - + + @@ -32,7 +32,7 @@ - + @@ -43,10 +43,14 @@ - - {{list.likes?list.likes.length:0}} - {{list.comment?list.comment.length:0}} - 删除 + + {{list.privacy == 2?'部分可见':list.privacy == 3?'私密':list.privacy == 4?'不给谁看':''}} + + + {{list.likes?list.likes.length:0}} + {{list.comment?list.comment.length:0}} + 删除 + @@ -61,7 +65,7 @@ - + @@ -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('用户点击取消'); diff --git a/pages/compass/moments.vue b/pages/compass/moments.vue index d3175ab..caf69f1 100644 --- a/pages/compass/moments.vue +++ b/pages/compass/moments.vue @@ -43,8 +43,8 @@ - - + + @@ -69,12 +69,16 @@ - - - - {{item.likes.length}} - {{item.comment.length}} - 删除 + + {{item.privacy_describe == '公开'?'':item.privacy_describe}} + + + + + {{item.likes.length}} + {{item.comment.length}} + 删除 + @@ -92,7 +96,7 @@ - + @@ -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, '
') }) + 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' }) diff --git a/pages/compass/personalcircleoffriends.vue b/pages/compass/personalcircleoffriends.vue index afc5571..ddb6f88 100644 --- a/pages/compass/personalcircleoffriends.vue +++ b/pages/compass/personalcircleoffriends.vue @@ -41,13 +41,13 @@ - + {{ formatTime(item.create_time) }} - + @@ -59,7 +59,7 @@ - + @@ -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; /* 最大高度限制 */ +} \ No newline at end of file diff --git a/pages/compass/sendtoMoments.vue b/pages/compass/sendtoMoments.vue index a1f6cab..379c163 100644 --- a/pages/compass/sendtoMoments.vue +++ b/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 } }) diff --git a/pages/contacts/detail.vue b/pages/contacts/detail.vue index b4ad7e5..3774ff6 100644 --- a/pages/contacts/detail.vue +++ b/pages/contacts/detail.vue @@ -10,7 +10,7 @@ - + {{detail.friend?.nickname?detail.friend.nickname:detail.realname}} {{detail.account}} @@ -21,7 +21,7 @@ 备注 - + {{detail.friend.nickname || '未设置'}} @@ -31,7 +31,7 @@ 昵称 - + {{detail.realname}} @@ -40,7 +40,7 @@ 邮箱 - + {{detail.email ?? ''}} @@ -49,7 +49,7 @@ 性别 - + {{ sex(detail.sex)}} @@ -58,7 +58,7 @@ IP - + {{ detail.last_login_ip || "未知"}} ({{detail.location || "未知"}}) 未知 @@ -68,7 +68,7 @@ 朋友圈 - + @@ -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() diff --git a/pages/contacts/friend.vue b/pages/contacts/friend.vue index 8fa5465..34a5762 100644 --- a/pages/contacts/friend.vue +++ b/pages/contacts/friend.vue @@ -14,7 +14,7 @@ - + {{x.create_user_info.realname}} 申请添加您为好友 @@ -48,7 +48,22 @@ - + + + + X + + + 提示 + 你确定同意该好友的请求吗 + + + + 拒绝 + 接受 + + + @@ -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(); + // } + // }) + // } + // }) } } } - \ No newline at end of file diff --git a/pages/contacts/group.vue b/pages/contacts/group.vue index 4019e6b..a635016 100644 --- a/pages/contacts/group.vue +++ b/pages/contacts/group.vue @@ -16,7 +16,7 @@ - + {{items.displayName}} diff --git a/pages/contacts/index.vue b/pages/contacts/index.vue index 116dc90..6e3f87d 100644 --- a/pages/contacts/index.vue +++ b/pages/contacts/index.vue @@ -51,7 +51,7 @@ - + {{items.displayName}} diff --git a/pages/contacts/search.vue b/pages/contacts/search.vue index bf060ee..cae0f48 100644 --- a/pages/contacts/search.vue +++ b/pages/contacts/search.vue @@ -25,8 +25,8 @@ {{items.realname}} - 发消息 - 查看 + 发消息 + 查看 diff --git a/pages/index/search.vue b/pages/index/search.vue index b59a514..cdfcd9f 100644 --- a/pages/index/search.vue +++ b/pages/index/search.vue @@ -15,12 +15,19 @@ 联系人 - + + + + + + {{items.displayName}} + @@ -108,5 +115,9 @@ \ No newline at end of file diff --git a/pages/index/userSelection.vue b/pages/index/userSelection.vue index 6b1afd8..aa1302b 100644 --- a/pages/index/userSelection.vue +++ b/pages/index/userSelection.vue @@ -7,7 +7,7 @@ {{type==3 ? '转发' : '完成'}} - + @@ -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) diff --git a/pages/login/register.vue b/pages/login/register.vue index 636be40..090578f 100644 --- a/pages/login/register.vue +++ b/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(()=>{ diff --git a/pages/message/chat.vue b/pages/message/chat.vue index 8f0851a..02e19c9 100644 --- a/pages/message/chat.vue +++ b/pages/message/chat.vue @@ -1,7 +1,7 @@ - - + +