This commit is contained in:
陈浩 2025-05-05 17:45:22 +08:00
parent af7f967d39
commit ef29aebf9c
13 changed files with 569 additions and 570 deletions

View File

@ -234,6 +234,7 @@ function selectItem(item: any) {
(item: IContactInfoType) => (item as Friend)?.userID === (currentContactInfo.value as Friend)?.userID, (item: IContactInfoType) => (item as Friend)?.userID === (currentContactInfo.value as Friend)?.userID,
); );
} else if ((currentContactInfo.value as IGroupModel)?.groupID) { } else if ((currentContactInfo.value as IGroupModel)?.groupID) {
targetListItem = contactListMap.value?.groupList?.list?.find( targetListItem = contactListMap.value?.groupList?.list?.find(
(item: IContactInfoType) => (item as IGroupModel)?.groupID === (currentContactInfo.value as IGroupModel)?.groupID, (item: IContactInfoType) => (item as IGroupModel)?.groupID === (currentContactInfo.value as IGroupModel)?.groupID,
); );

View File

@ -1,4 +1,5 @@
<template> <template>
<!-- <div></div> -->
<SelectUser <SelectUser
:isRadio="selectOptions.isRadio" :isRadio="selectOptions.isRadio"
:isNeedSearch="selectOptions.isNeedSearch" :isNeedSearch="selectOptions.isNeedSearch"
@ -55,8 +56,9 @@ watchEffect(() => {
generateSearchServer(params.isNeedSearch); generateSearchServer(params.isNeedSearch);
} }
TUIFriendService.getFriendList().then((res: any) => { TUIFriendService.getFriendList().then((res: any) => {
friendList.value = res.data.map((item: any) => item.profile);
userList.value = friendList.value; // friendList.value = res.data.map((item: any) => item.profile);
userList.value = res.data;
}).catch((err: any) => { }).catch((err: any) => {
console.warn('getFriendList error:', err); console.warn('getFriendList error:', err);

View File

@ -57,8 +57,8 @@
generateSearchServer(params.isNeedSearch); generateSearchServer(params.isNeedSearch);
} }
TUIFriendService.getFriendList().then((res: any) => { TUIFriendService.getFriendList().then((res: any) => {
friendList.value = res.data.map((item: any) => item.profile); // friendList.value = res.data.map((item: any) => item.profile);
userList.value = friendList.value; userList.value =res.data;
}).catch((err: any) => { }).catch((err: any) => {
console.warn('getFriendList error:', err); console.warn('getFriendList error:', err);
}); });

View File

@ -368,6 +368,7 @@ TUIStore.watch(StoreName.GRP, {
} }
}, },
currentGroupMemberList: (memberList: IGroupMember[]) => { currentGroupMemberList: (memberList: IGroupMember[]) => {
console.log('memberList', memberList);
groupMemberList.value = memberList; groupMemberList.value = memberList;
member.value = { member.value = {
admin: [], admin: [],
@ -549,7 +550,8 @@ const toggleMask = async (type?: string) => {
const friendList = async () => { const friendList = async () => {
const imResponse = await TUIFriendService.getFriendList(); const imResponse = await TUIFriendService.getFriendList();
const friendList = imResponse.data.map((item: any) => item?.profile); // const friendList = imResponse.data.map((item: any) => item?.profile);
const friendList = imResponse.data
return friendList.filter( return friendList.filter(
(item: any) => (item: any) =>
!userInfo.value.list.some( !userInfo.value.list.some(

View File

@ -139,6 +139,7 @@ const selfValue = ref<IGroupSelfInfo>({});
watchEffect(() => { watchEffect(() => {
totalMember.value = props.total; totalMember.value = props.total;
isShowDeleteBtn.value = props.isShowDel; isShowDeleteBtn.value = props.isShowDel;
console.log('-------------', props.list);
memberList.value = props.list as Array<IGroupMember>; memberList.value = props.list as Array<IGroupMember>;
selfValue.value = props.self; selfValue.value = props.self;
}); });

View File

@ -50,7 +50,6 @@ const props = defineProps({
default: 0, default: 0,
}, },
}); });
const reset = () => { const reset = () => {
emits('complete', [],0); emits('complete', [],0);
}; };

View File

@ -79,7 +79,7 @@
" "
onerror="this.onerror=null;this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'" onerror="this.onerror=null;this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"
/> />
<span class="name">{{ item.nick || item.userID }}</span> <span class="name">{{ item.remark || item.userID }}</span>
<span v-if="item.isDisabled" <span v-if="item.isDisabled"
>{{ TUITranslateService.t("component.已在群中") }}</span >{{ TUITranslateService.t("component.已在群中") }}</span
> >
@ -251,6 +251,7 @@ watchEffect(() => {
// eslint-disable-next-line vue/no-mutating-props // eslint-disable-next-line vue/no-mutating-props
props.list.splice(index, 1); props.list.splice(index, 1);
} }
console.log("++++++++++", props.list);
transferList.value = props.list as ITransferListItem[]; transferList.value = props.list as ITransferListItem[];
} }
} else { } else {

View File

@ -4,7 +4,7 @@ const TUIContact = {
"群聊通知": "群聊通知", "群聊通知": "群聊通知",
"系统通知": "系统通知", "系统通知": "系统通知",
"我的群聊": "我的群聊", "我的群聊": "我的群聊",
"输入ID": "请输入用户/群聊 ID回车搜索", "输入ID": "请输入用户手机号回车搜索",
"群名称": "群名称", "群名称": "群名称",
"群ID": "群ID", "群ID": "群ID",
"加入群聊": "加入群聊", "加入群聊": "加入群聊",

View File

@ -18,6 +18,11 @@ const dev = {
}; };
// 生产环境 // 生产环境
const prod = { const prod = {
// common: "http://192.168.1.211:8890",
// buyer: "http://192.168.1.211:8888",
// vlog: "http://192.168.1.211:8099",
// web: "http://192.168.1.211:8099",
// seller: "http://192.168.1.211:8889",
// common: "http://192.168.1.211:8890", // common: "http://192.168.1.211:8890",
// buyer: "http://192.168.1.211:8888", // buyer: "http://192.168.1.211:8888",
common: "http://43.143.227.203:8890", common: "http://43.143.227.203:8890",

View File

@ -224,11 +224,11 @@ export default {
applyThird(params) applyThird(params)
.then((res) => { .then((res) => {
this.loading = false; this.loading = false;
// uni.showToast({ uni.showToast({
// title: "", title: "提交成功",
// icon: "none", icon: "none",
// duration: 1500, duration: 1500,
// }); });
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: "/pages/tabbar/user/my", url: "/pages/tabbar/user/my",

View File

@ -377,10 +377,10 @@ export default {
if ( if (
this.form.legalPhoto != "" && this.form.legalPhoto != "" &&
this.form.legalId != "" && this.form.legalId != "" &&
this.form.legalName != "" this.form.legalName != "" &&
this.form.linkName!= "" &&
this.form.linkPhone!= ""
) { ) {
console.log(params,'========');
applyFirst(params) applyFirst(params)
.then((res) => { .then((res) => {
if (res.data.success) { if (res.data.success) {

View File

@ -1,18 +1,11 @@
<template> <template>
<div <div style="height: 100%" @click="handleTouchStart">
style="height: 100%"
@click="handleTouchStart"
>
<div class="jolkp"> <div class="jolkp">
<div <div
class="fan" class="fan"
:style="{ marginRight: statue == 0 ? '47.5%' : '47.5%' }" :style="{ marginRight: statue == 0 ? '47.5%' : '47.5%' }"
> >
<div <div @click="hui(0)" :style="{ marginTop: '45px' }" v-if="statue != 0">
@click="hui(0)"
:style="{ marginTop: '45px' }"
v-if="statue != 0"
>
<u-icon name="arrow-left"></u-icon> <u-icon name="arrow-left"></u-icon>
</div> </div>
</div> </div>
@ -32,16 +25,9 @@
v-if="statue == 0 || 6" v-if="statue == 0 || 6"
:style="{ marginTop: '45px' }" :style="{ marginTop: '45px' }"
></div> ></div>
<view <view class="jolkp_l" :style="{ marginTop: '45px' }"></view>
class="jolkp_l"
:style="{ marginTop: '45px' }"
></view>
<!-- 弹出框 --> <!-- 弹出框 -->
<view <view v-if="isPopupVisible" class="popup" ref="popup">
v-if="isPopupVisible"
class="popup"
ref="popup"
>
<ul> <ul>
<li @click.stop="handleAddFriend">添加好友/群聊</li> <li @click.stop="handleAddFriend">添加好友/群聊</li>
<li @click.stop="handleMenu()">发起群聊</li> <li @click.stop="handleMenu()">发起群聊</li>
@ -50,40 +36,28 @@
</view> </view>
</div> </div>
<!-- 搜索添加 --> <!-- 搜索添加 -->
<TUIContactsea <TUIContactsea v-if="statue == 2" @switchConversation="hui" />
v-if="statue == 2"
@switchConversation="hui"
/>
<!-- 联系人 --> <!-- 联系人 -->
<TUIContact <TUIContact
v-else-if="statue == 1 && isPopupVisible==false" v-else-if="statue == 1 && isPopupVisible == false"
style="height: 100%" style="height: 100%"
/> />
<!-- 群选择的 --> <!-- 群选择的 -->
<SelectFriend <SelectFriend
v-else-if="statue == 3 " v-else-if="statue == 3"
@con="hui" @con="hui"
:style="{ marginTop: '20px', heigth: '80%' }" :style="{ marginTop: '20px', heigth: '80%' }"
/> />
<!-- 群类型 --> <!-- 群类型 -->
<CreateGroup <CreateGroup v-else-if="statue == 10" @con="confn" />
v-else-if="statue == 10 " <SelectFriendqlioa v-else-if="statue == 4" @concen="concen" />
@con="confn" <ContactInfo v-else-if="statue == 7" @concen="concen" />
/>
<SelectFriendqlioa
v-else-if="statue == 4 "
@concen="concen"
/>
<ContactInfo
v-else-if="statue == 7"
@concen="concen"
/>
<!-- 站内信数据 --> <!-- 站内信数据 -->
<!-- <div > --> <!-- <div > -->
<scroll-view <scroll-view
@scrolltolower="lowerBottom" @scrolltolower="lowerBottom"
scroll-y="true" scroll-y="true"
v-else-if="statue == 6 && isPopupVisible==false" v-else-if="statue == 6 && isPopupVisible == false"
class="znx" class="znx"
> >
<div <div
@ -110,17 +84,9 @@
<!-- </div> --> <!-- </div> -->
<!-- 会话 --> <!-- 会话 -->
<TUIConversation <TUIConversation style="height: 100%" v-else @state="state" />
style="height: 100%"
v-else
@state="state"
/>
<!-- 未登录显示 --> <!-- 未登录显示 -->
<view <view v-if="showNoLoginPage" class="no-login" @click="toLogin">
v-if="showNoLoginPage"
class="no-login"
@click="toLogin"
>
请登录 请登录
</view> </view>
</div> </div>
@ -128,25 +94,40 @@
<script> <script>
// //
import TUIConversation from '@/TUIKit/components/TUIConversation/index'; import TUIConversation from "@/TUIKit/components/TUIConversation/index";
import TUIContact from '@/TUIKit/components/TUIContact/index'; import TUIContact from "@/TUIKit/components/TUIContact/index";
import TUIContactsea from '@/TUIKit/components/TUIContact/indexsea'; import TUIContactsea from "@/TUIKit/components/TUIContact/indexsea";
import { TUILogin } from '@tencentcloud/tui-core'; import { TUILogin } from "@tencentcloud/tui-core";
import ContactSearch from '@/TUIKit/components/TUIContact/contact-search/index.vue'; import ContactSearch from "@/TUIKit/components/TUIContact/contact-search/index.vue";
import CreateGroup from '@/TUIKit/components/TUIGroup/create-group/index.vue'; import CreateGroup from "@/TUIKit/components/TUIGroup/create-group/index.vue";
// import { TUIChatKit } from '@/TUIKit'; // import { TUIChatKit } from '@/TUIKit';
import SelectFriend from '@/TUIKit/components/TUIContact/select-friend/index.vue'; import SelectFriend from "@/TUIKit/components/TUIContact/select-friend/index.vue";
import ContactInfo from '@/TUIKit/components/TUIContact/contact-info/index.vue'; import ContactInfo from "@/TUIKit/components/TUIContact/contact-info/index.vue";
import SelectFriendqlioa from '@/TUIKit/components/TUIGroup/index.vue'; import SelectFriendqlioa from "@/TUIKit/components/TUIGroup/index.vue";
import TUICore, { ExtensionInfo, TUIConstants } from '@tencentcloud/tui-core'; import TUICore, { ExtensionInfo, TUIConstants } from "@tencentcloud/tui-core";
import storage from '@/utils/storage.js'; import storage from "@/utils/storage.js";
// push // push
// import { TUIConversationService } from '@tencentcloud/chat-uikit-engine'; // import { TUIConversationService } from '@tencentcloud/chat-uikit-engine';
// import * as Push from '@/uni_modules/TencentCloud-Push'; // import * as Push from '@/uni_modules/TencentCloud-Push';
import { getUserimInfo, getMember, getMemberstate, getMemberdelete, geterweijki } from '@/api/members'; import {
import { TUITranslateService, TUIStore, StoreName, IGroupModel, TUIFriendService, Friend, FriendApplication, TUIUserService } from '@tencentcloud/chat-uikit-engine'; getUserimInfo,
getMember,
getMemberstate,
getMemberdelete,
geterweijki,
} from "@/api/members";
import {
TUITranslateService,
TUIStore,
StoreName,
IGroupModel,
TUIFriendService,
Friend,
FriendApplication,
TUIUserService,
} from "@tencentcloud/chat-uikit-engine";
// TUIChatKit.init(); // TUIChatKit.init();
// let vueVersion = 2; // let vueVersion = 2;
// vueVersion = 3; // vueVersion = 3;
@ -162,7 +143,7 @@ export default {
SelectFriendqlioa, SelectFriendqlioa,
// TUIChatKit, // TUIChatKit,
CreateGroup, CreateGroup,
ContactInfo ContactInfo,
}, },
data() { data() {
return { return {
@ -179,7 +160,7 @@ export default {
pageSize: 20, pageSize: 20,
pageNumber: 1, pageNumber: 1,
total: 0, total: 0,
loadMoreStatus: 'more' // loadMoreStatus: "more", //
}; };
}, },
onTabItemTap(e) { onTabItemTap(e) {
@ -191,7 +172,7 @@ export default {
this.removeTimer(); this.removeTimer();
// //
uni.navigateTo({ uni.navigateTo({
url: '/pages/passport/login' url: "/pages/passport/login",
}); });
this.showNoLoginPage = true; this.showNoLoginPage = true;
} else { } else {
@ -204,7 +185,7 @@ export default {
onUnload() {}, onUnload() {},
created() {}, created() {},
onHide() { onHide() {
console.log('IM页面隐藏'); console.log("IM页面隐藏");
this.removeTimer(); this.removeTimer();
}, },
onShow() { onShow() {
@ -224,8 +205,7 @@ export default {
this.setTime(); this.setTime();
// //
uni.$on('globalClick', (event) => { uni.$on("globalClick", (event) => {
// console.log(event, "====+++");
this.handleGlobalClick(event); this.handleGlobalClick(event);
}); });
@ -236,39 +216,46 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
// //
uni.$off('globalClick'); uni.$off("globalClick");
// //
this.removeTimer(); this.removeTimer();
}, },
methods: { methods: {
toLogin() { toLogin() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/passport/login' url: "/pages/passport/login",
}); });
}, },
state(item) { state(item) {
this.isPopupVisible = item; this.isPopupVisible = item;
}, },
handleTouchStart(event) { handleTouchStart(event) {
uni.$emit('globalClick', event); uni.$emit("globalClick", event);
}, },
handleGlobalClick(event) { handleGlobalClick(event) {
const query = uni.createSelectorQuery().in(this); const query = uni.createSelectorQuery().in(this);
query query
.select('.jolkp_l') .select(".jolkp_l")
// //
.boundingClientRect((rect) => { .boundingClientRect((rect) => {
if (rect) { if (rect) {
const clickX = event.clientX || event.touches[0].clientX; const clickX = event.clientX || event.touches[0].clientX;
const clickY = event.clientY || event.touches[0].clientY; const clickY = event.clientY || event.touches[0].clientY;
if (clickX >= rect.left && clickX <= rect.width + rect.left && clickY >= rect.top && clickY <= rect.top + rect.height * 2) { if (
clickX >= rect.left &&
clickX <= rect.width + rect.left &&
clickY >= rect.top &&
clickY <= rect.top + rect.height * 2
) {
// this.statue = 0; // // this.statue = 0; //
console.log('点击是在节点范围'); if (this.statue == 2) {
return;
} else {
this.isPopupVisible = !this.isPopupVisible; // this.isPopupVisible = !this.isPopupVisible; //
}
} else { } else {
// this.statue = 0; // // this.statue = 0; //
console.log('否');
this.isPopupVisible = false; // this.isPopupVisible = false; //
} }
} }
@ -303,7 +290,7 @@ export default {
const itemJson = encodeURIComponent(JSON.stringify(item)); const itemJson = encodeURIComponent(JSON.stringify(item));
// 使 uni.navigateTo // 使 uni.navigateTo
uni.navigateTo({ uni.navigateTo({
url: `/pages/tabbar/im/details/index?item=${itemJson}` url: `/pages/tabbar/im/details/index?item=${itemJson}`,
}); });
getMemberstate({ messageId: item.messageId }).then((res) => { getMemberstate({ messageId: item.messageId }).then((res) => {
this.getMembermethod(); this.getMembermethod();
@ -328,7 +315,7 @@ export default {
getMembermethod() { getMembermethod() {
const param = { const param = {
pageSize: this.pageSize, pageSize: this.pageSize,
pageNumber: this.pageNumber pageNumber: this.pageNumber,
}; };
getMember(param).then((res) => { getMember(param).then((res) => {
this.total = res.data.result.total; this.total = res.data.result.total;
@ -338,16 +325,22 @@ export default {
this.meList = this.meList.concat(res.data.result.records); this.meList = this.meList.concat(res.data.result.records);
} }
this.swipeStates = new Array(this.meList.length).fill(0); this.swipeStates = new Array(this.meList.length).fill(0);
this.tole = this.meList.filter((item) => item.status === 'UN_READY').length; this.tole = this.meList.filter(
(item) => item.status === "UN_READY"
).length;
}); });
}, },
handleMenu() { handleMenu() {
const fn = [...TUICore.getExtensionList(TUIConstants.TUISearch.EXTENSION.SEARCH_MORE.EXT_ID)]; const fn = [
...TUICore.getExtensionList(
TUIConstants.TUISearch.EXTENSION.SEARCH_MORE.EXT_ID
),
];
const item = fn[1]; const item = fn[1];
const { const {
listener = { listener = {
onClicked: () => {} onClicked: () => {},
} },
} = item; } = item;
listener?.onClicked?.(item); listener?.onClicked?.(item);
this.statue = 3; this.statue = 3;
@ -361,35 +354,35 @@ export default {
this.isPopupVisible = false; this.isPopupVisible = false;
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
console.log('扫码结果:---', res.result); console.log("扫码结果:---", res.result);
const params = { const params = {
userID: res.result //userID userID: res.result, //userID
}; };
console.log('params', params); console.log("params", params);
TUIStore.update(StoreName.CUSTOM, 'currentContactInfo', params); TUIStore.update(StoreName.CUSTOM, "currentContactInfo", params);
this.statue = 7; this.statue = 7;
} },
}); });
}, },
startLongPress(item, index) { startLongPress(item, index) {
this.longPressTimer = setTimeout(() => { this.longPressTimer = setTimeout(() => {
uni.showModal({ uni.showModal({
title: '确认删除', title: "确认删除",
content: '确定要删除这条消息吗?', content: "确定要删除这条消息吗?",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
getMemberdelete({ messageId: item.messageId }).then((res) => { getMemberdelete({ messageId: item.messageId }).then((res) => {
this.getMembermethod(); this.getMembermethod();
}); });
} }
} },
}); });
}, 2000); }, 2000);
}, },
endLongPress() { endLongPress() {
clearTimeout(this.longPressTimer); clearTimeout(this.longPressTimer);
} },
} },
}; };
</script> </script>
@ -436,7 +429,7 @@ page {
.jolkp_l { .jolkp_l {
width: 1.8rem; width: 1.8rem;
height: 1.8rem; height: 1.8rem;
background-image: url('@/static/im/Frame.png'); background-image: url("@/static/im/Frame.png");
/* 让背景图覆盖整个元素 */ /* 让背景图覆盖整个元素 */
background-size: cover; background-size: cover;
/* 背景图不重复 */ /* 背景图不重复 */
@ -448,7 +441,7 @@ page {
.jolkp_h { .jolkp_h {
width: 1.8rem; width: 1.8rem;
height: 1.8rem; height: 1.8rem;
background-image: url('@/static/im/user.png'); background-image: url("@/static/im/user.png");
/* 让背景图覆盖整个元素 */ /* 让背景图覆盖整个元素 */
background-size: cover; background-size: cover;
/* 背景图不重复 */ /* 背景图不重复 */
@ -459,7 +452,7 @@ page {
.jolkp_z { .jolkp_z {
width: 1.8rem; width: 1.8rem;
height: 1.8rem; height: 1.8rem;
background-image: url('@/static/im/znx.png'); background-image: url("@/static/im/znx.png");
/* 让背景图覆盖整个元素 */ /* 让背景图覆盖整个元素 */
background-size: cover; background-size: cover;
/* 背景图不重复 */ /* 背景图不重复 */
@ -503,7 +496,7 @@ page {
.fan { .fan {
width: 10%; width: 10%;
height: '100%'; height: "100%";
font-size: 18px; font-size: 18px;
display: flex; display: flex;
@ -513,7 +506,7 @@ page {
.fan { .fan {
margin-right: 56% !important; margin-right: 56% !important;
width: 10%; width: 10%;
height: '100%'; height: "100%";
font-size: 18px; font-size: 18px;
display: flex; display: flex;
margin-top: 80%; margin-top: 80%;
@ -539,7 +532,7 @@ page {
.three_div1 { .three_div1 {
height: 3rem; height: 3rem;
width: 40%; width: 40%;
background-image: url('@/static/im/kf.png'); background-image: url("@/static/im/kf.png");
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
display: flex; display: flex;
@ -550,7 +543,7 @@ page {
.three_div2 { .three_div2 {
width: 40%; width: 40%;
height: 3rem; height: 3rem;
background-image: url('@/static/im/hy.png'); background-image: url("@/static/im/hy.png");
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
width: 40%; width: 40%;
@ -558,7 +551,7 @@ page {
.three_div3 { .three_div3 {
height: 3rem; height: 3rem;
background-image: url('@/static/im/da.png'); background-image: url("@/static/im/da.png");
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
width: 40%; width: 40%;

View File

@ -3,9 +3,6 @@ import {
refreshTokenFn refreshTokenFn
} from "@/api/login.js"; } from "@/api/login.js";
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
import {
logout
} from '@/api/login';
import { import {
md5 md5
} from "@/utils/md5.js"; } from "@/utils/md5.js";
@ -208,7 +205,6 @@ http.interceptors.response.use(
(response.statusCode == 200 && !response.data.success) || (response.statusCode == 200 && !response.data.success) ||
response.statusCode == 400 response.statusCode == 400
) { ) {
if (response.data.message) {
if (response.data.code == 408) { if (response.data.code == 408) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
@ -232,7 +228,6 @@ http.interceptors.response.use(
duration: 1500, duration: 1500,
}); });
} }
}
} else if (response.data.code == 502) { } else if (response.data.code == 502) {
cleanStorage(); cleanStorage();
} }