diff --git a/TUIKit/components/TUIContact/contact-info/index.vue b/TUIKit/components/TUIContact/contact-info/index.vue index bd583eb..b9acf37 100644 --- a/TUIKit/components/TUIContact/contact-info/index.vue +++ b/TUIKit/components/TUIContact/contact-info/index.vue @@ -471,6 +471,8 @@ ) { return } + + console.log(contactInfo, '===') resetContactInfoUIData() // deep clone contactInfoData.value = deepCopy(contactInfo) || {} @@ -484,6 +486,7 @@ contactInfoData.value ) isBothFriend.value = await isFriend(contactInfoData.value) + generateMoreInfo() generateButton() if (contactInfo.infoKeyList) { diff --git a/TUIKit/components/TUIGroup/create-group/index.vue b/TUIKit/components/TUIGroup/create-group/index.vue index c88ada4..dec3a83 100644 --- a/TUIKit/components/TUIGroup/create-group/index.vue +++ b/TUIKit/components/TUIGroup/create-group/index.vue @@ -233,7 +233,7 @@ 'TUIGroup.群ID' )}(${TUITranslateService.t('TUIGroup.选填')})`, key: 'groupID', - placeholder: TUITranslateService.t('TUIGroup.请输入群ID') + placeholder: '搜索加入群使用' } return groupInfo.profile.type === TUIChatEngine.TYPES.GRP_COMMUNITY ? [groupNameInput] @@ -352,7 +352,7 @@ break case 'groupID': groupInfo.groupConfig.title = '设置群ID' - groupInfo.groupConfig.placeholder = '请输入群ID' + groupInfo.groupConfig.placeholder = '搜索加入群使用' groupInfo.groupConfig.type = 'input' break case 'type': diff --git a/TUIKit/components/TUIGroup/manage-group/index.vue b/TUIKit/components/TUIGroup/manage-group/index.vue index 3c1ad49..d7da7c9 100644 --- a/TUIKit/components/TUIGroup/manage-group/index.vue +++ b/TUIKit/components/TUIGroup/manage-group/index.vue @@ -69,14 +69,14 @@ +
+
+ +
+
-
+
-->
item.userID !== imResponse.data[0]?.userID ) @@ -776,8 +777,9 @@ break case 'remove': try { - imResponse = - await TUIGroupService.getGroupMemberProfile(options) + imResponse = await TUIGroupService.getGroupMemberProfile( + options + ) if (imResponse.data.memberList.length === 0) { const message = TUITranslateService.t( 'TUIGroup.该用户不在群组内' @@ -848,7 +850,11 @@ groupID: currentGroupID.value, userIDList } - await TUIGroupService.addGroupMember(options) + try { + await TUIGroupService.addGroupMember(options) + } catch (error) { + console.log(error) + } } const changeOwner = async (userID: any) => { diff --git a/TUIKit/components/TUIGroup/manage-group/manage-admin.vue b/TUIKit/components/TUIGroup/manage-group/manage-admin.vue index dc3880a..6cc832b 100644 --- a/TUIKit/components/TUIGroup/manage-group/manage-admin.vue +++ b/TUIKit/components/TUIGroup/manage-group/manage-admin.vue @@ -287,7 +287,7 @@ .admin-mute-all { margin: 0 10px; - padding: 20px 0; + padding: 20rpx ; border-bottom: 1px solid #e8e8e9; display: flex; flex-direction: row; diff --git a/TUIKit/components/common/Navigation/index.vue b/TUIKit/components/common/Navigation/index.vue index aaf0901..b21e0fc 100644 --- a/TUIKit/components/common/Navigation/index.vue +++ b/TUIKit/components/common/Navigation/index.vue @@ -54,7 +54,7 @@ align-items: center; // background: #ebf0f6; background: #fff; - min-height: 44px; + min-height: 86rpx; padding: 0 12px; border-bottom: 2rpx solid #0000000a; box-sizing: border-box; diff --git a/pages.json b/pages.json index 3ef512c..fc78a8b 100644 --- a/pages.json +++ b/pages.json @@ -437,7 +437,7 @@ { "path": "pages/adduser/index", "style": { - "navigationBarTitleText": "添加好友", + "navigationBarTitleText": "添加地址", "navigationBarBackgroundColor": "#ffffff" } }, diff --git a/pages/address/add.vue b/pages/address/add.vue index 55a6c51..485ab09 100644 --- a/pages/address/add.vue +++ b/pages/address/add.vue @@ -157,7 +157,9 @@ - 确认添加 + + {{ props.type == 'edit' ? '修改' : '添加' }} + diff --git a/pages/adduser/details.vue b/pages/adduser/details.vue index 536588d..a5b4ea7 100644 --- a/pages/adduser/details.vue +++ b/pages/adduser/details.vue @@ -4,6 +4,7 @@ import TUIChatEngine, { TUIConversationService, TUIFriendService, + TUIGroupService, TUIUserService } from '@tencentcloud/chat-uikit-engine-lite' import { useUI } from '../../utils/use-ui' @@ -11,6 +12,7 @@ import { TUIGlobal } from '@tencentcloud/universal-api' import PopupBox from '../my-index/components/popup-box.vue' import SwitchBar from '../../TUIKit/components/common/SwitchBar/index.vue' + import { TUIConstants, TUICore } from '@tencentcloud/tui-core-lite' const { showLoading, hideLoading, showToast, showDialog } = useUI() @@ -38,6 +40,53 @@ }) } + /** + * 显示对应群信息 + * @param res 群信息 + * @param state 0 只能加入群 1 显示对应状态按钮 + */ + const getGroupData = (res, state) => { + console.log(res, '==') + friendInfo.value = { + ...res, + avatar: res.avatar, + nick: res.name, + cbType: 'group' + } + isDetail.value = !!res.selfInfo.role + loading.value = false + hideLoading() + } + + /** 获取群信息 */ + const getGroupInfo = () => { + loading.value = true + showLoading() + TUICore.callService({ + serviceName: TUIConstants.TUISearch.SERVICE.NAME, + method: TUIConstants.TUISearch.SERVICE.METHOD.SEARCH_GROUP, + params: { + groupID: userId.value + } + }) + .then(res => { + TUIGroupService.getGroupProfile({ + groupID: res.data.group.groupID + }) + .then(c => { + getGroupData(c.data.group, 1) + }) + .catch(crr => { + getGroupData(res.data.group, 0) + }) + }) + .catch(err => { + console.log(err, '==') + loading.value = false + hideLoading() + }) + } + /** 获取好友信息 */ const getFriendInfo = async () => { loading.value = true @@ -73,37 +122,68 @@ } const submit = async () => { - // 在这里可以添加提交验证信息的逻辑 - let source = 'AddSource_Type_Web' // 来源渠道 - // #ifdef H5 - source = 'AddSource_Type_H5' - // #endif - - // 判断是否为 App(5+ App) - // #ifdef APP-PLUS - source = 'AddSource_Type_App' - // #endif showLoading() - try { - await TUIFriendService.addFriend({ - to: userId.value, - source, - remark: remark.value || '', - wording: verificationInfo.value, - type: TUIChatEngine.TYPES.SNS_ADD_TYPE_BOTH + if (friendInfo.value?.cbType === 'group') { + TUIGroupService.joinGroup({ + groupID: friendInfo.value.groupID, + applyMessage: verificationInfo.value }) - hideLoading() - await showToast('好友请求已发送', 'success') - navigateBack() - } catch (error) { - if (error.code === 30515) { + .then(imResponse => { + switch (imResponse?.data?.status) { + case TUIChatEngine.TYPES.JOIN_STATUS_WAIT_APPROVAL: // Wait for administrator approval + hideLoading() + showToast('等待管理员同意', 'success') + break + case TUIChatEngine.TYPES.JOIN_STATUS_SUCCESS: // Join group successfully + hideLoading() + showToast('加群成功', 'success') + break + case TUIChatEngine.TYPES.JOIN_STATUS_ALREADY_IN_GROUP: // Already in the group + hideLoading() + showToast('您已是群成员', 'success') + break + default: + break + } + }) + .catch(error => { + console.warn('join group failed:', error) + hideLoading() + showToast('申请入群失败', 'error') + }) + } else { + // 在这里可以添加提交验证信息的逻辑 + let source = 'AddSource_Type_Web' // 来源渠道 + // #ifdef H5 + source = 'AddSource_Type_H5' + // #endif + + // 判断是否为 App(5+ App) + // #ifdef APP-PLUS + source = 'AddSource_Type_App' + // #endif + + try { + await TUIFriendService.addFriend({ + to: userId.value, + source, + remark: remark.value || '', + wording: verificationInfo.value, + type: TUIChatEngine.TYPES.SNS_ADD_TYPE_BOTH + }) hideLoading() - const show = await showDialog( - '提示', - '该用户在黑名单中,不允许加好友' - ) - if (show) { - navigateBack() + await showToast('好友请求已发送', 'success') + navigateBack() + } catch (error) { + if (error.code === 30515) { + hideLoading() + const show = await showDialog( + '提示', + '该用户在黑名单中,不允许加好友' + ) + if (show) { + navigateBack() + } } } } @@ -166,38 +246,56 @@ }) } - /** 删除好友 */ + /** 删除好友/删除群 */ const onDeleteFriend = async () => { - const show = await showDialog('提示', '确定要删除好友吗?') + const isMode = friendInfo.value?.cbType === 'group' + const show = await showDialog( + '提示', + `确定要${isMode ? '解除群聊' : '删除好友'}吗?` + ) if (!show) { return } showLoading() - TUIFriendService.deleteFriend({ - userIDList: [friendInfo.value.userID], - type: TUIChatEngine.TYPES.SNS_DELETE_TYPE_BOTH - }) - .then(async res => { - hideLoading() - const { successUserIDList } = res.data - if (successUserIDList[0].userID === friendInfo.value.userID) { - await showToast('删除好友成功', 'success') + if (isMode) { + TUIGroupService.dismissGroup(friendInfo.value?.groupID) + .then(async () => { + await showToast('解除群聊成功', 'success') reLaunch('/TUIKit/components/TUIContact/index') - } else { + }) + .catch(async () => { + hideLoading() + await showToast('解除群聊失败', 'error') + }) + } else { + TUIFriendService.deleteFriend({ + userIDList: [friendInfo.value.userID], + type: TUIChatEngine.TYPES.SNS_DELETE_TYPE_BOTH + }) + .then(async res => { + hideLoading() + const { successUserIDList } = res.data + if (successUserIDList[0].userID === friendInfo.value.userID) { + await showToast('删除好友成功', 'success') + reLaunch('/TUIKit/components/TUIContact/index') + } else { + await showToast('删除好友失败', 'error') + } + }) + .catch(async () => { + hideLoading() await showToast('删除好友失败', 'error') - } - }) - .catch(async () => { - hideLoading() - await showToast('删除好友失败', 'error') - }) + }) + } } /** 发送消息 */ const onSendMessage = () => { - TUIConversationService.switchConversation( - `C2C${friendInfo.value.userID}` - ).then(() => { + const data = + friendInfo.value?.cbType === 'group' + ? `GROUP${friendInfo.value?.groupID}` + : `C2C${friendInfo.value.userID}` + TUIConversationService.switchConversation(data).then(() => { TUIGlobal?.navigateTo({ url: `/TUIKit/components/TUIChat/index` }) @@ -206,12 +304,19 @@ onLoad(e => { userId.value = e?.id || '' - /** type: 不传为添加 1 为详情页 */ - isDetail.value = e?.type == 1 || false - uni.setNavigationBarTitle({ - title: isDetail.value ? '好友信息' : '发送好友申请' - }) - getFriendInfo() + /** type: 不传为添加 1 为详情页 9 为群信息 */ + if (e?.type == 9) { + uni.setNavigationBarTitle({ + title: '群聊信息' + }) + getGroupInfo() + } else { + isDetail.value = e?.type == 1 || false + uni.setNavigationBarTitle({ + title: isDetail.value ? '好友信息' : '发送好友申请' + }) + getFriendInfo() + } }) @@ -229,10 +334,13 @@ {{ friendInfo.nick || '未知名称' }} - 手机号: {{ friendInfo.userID }} - + + 手机号: {{ friendInfo.userID }} + + 个性签名: {{ friendInfo.selfSignature || '暂无个性签名' }} + ID: {{ friendInfo.groupID }} @@ -248,7 +356,10 @@ - + 备注名 - + 备注名 - + 加入黑名单 - + 删除好友 + + 解除群聊 + + 发送信息 @@ -344,9 +474,7 @@ display: flex; flex-direction: column; .title { - font-family: - PingFang SC, - PingFang SC; + font-family: PingFang SC, PingFang SC; font-weight: 500; font-size: 28rpx; color: #333333; diff --git a/pages/adduser/index.vue b/pages/adduser/index.vue index 8793d05..5fd451a 100644 --- a/pages/adduser/index.vue +++ b/pages/adduser/index.vue @@ -1,27 +1,56 @@ @@ -86,13 +127,14 @@ radius="100" bgColor="#f4f4f4" textColor="#333333" - placeholder="请输入用户手机号" + placeholder="请输入用户手机号/群ID进行搜索" @confirm="search" @cancel="onCancel" > - - + + + 添加 + + + + + + + + + {{ item.name || '未知名称' }} + {{ item.groupID }} + + 群聊 + + + @@ -147,6 +215,12 @@ font-size: 32rpx; color: #999999; } + .tag-but { + padding: 4rpx 20rpx; + background: #00d9c5; + color: #fff; + border-radius: 30rpx; + } .name-box { height: 96rpx; display: flex; diff --git a/pages/mall/confirm-order.vue b/pages/mall/confirm-order.vue index e4baa17..8654431 100644 --- a/pages/mall/confirm-order.vue +++ b/pages/mall/confirm-order.vue @@ -41,6 +41,10 @@ state: false, loading: true }) + /** 地址选项弹出窗 */ + const isPopup = ref(null) + /** 地址列表 */ + const ressDataList = ref([]) const tixian = ref(null) const originalPrice = ref(0) @@ -55,11 +59,26 @@ topRessData.id = data?.id || '' topRessData.phone = data?.phone || '' topRessData.loading = false + ressDataList.value = res.rows } - /** 用户地址跳转 */ + /** 选中地址 */ + const onAddress = data => { + topRessData.state = !data?.id + topRessData.name = data?.name || '' + topRessData.houseNum = data?.houseNum || '' + topRessData.id = data?.id || '' + topRessData.phone = data?.phone || '' + isPopup.value.close() + } + + /** 点击顶部地址选项 */ const onRess = () => { - navigateTo('/pages/address/index') + if (topRessData.name) { + isPopup.value.open() + } else { + navigateTo('/pages/address/index') + } } const getData = async productId => { @@ -119,9 +138,6 @@ quantity: formData.num, skuId: formData.spec } - console.log(data, '===data===') - return - tixian.value.close() const res = await addOrder(data) await refreshUserInfo() @@ -245,6 +261,49 @@ 确认支付 + + + + + + 地址选项 + + + + + + + + 默认 + + {{ item.houseNum }} + + + {{ item.name }} + + + + + + + 添加新地址 + + + diff --git a/pages/mall/styles/confirm-order.scss b/pages/mall/styles/confirm-order.scss index 04f7049..5cfe7b4 100644 --- a/pages/mall/styles/confirm-order.scss +++ b/pages/mall/styles/confirm-order.scss @@ -163,3 +163,78 @@ } } } + +// 地址弹出窗选项 +.popup-box { + padding: 32rpx 24rpx; + .top-name { + display: flex; + justify-content: space-between; + margin-bottom: 20rpx; + .title { + font-size: 32rpx; + color: #333333; + font-weight: 500; + } + } + + .card-list { + max-height: 46vh; + overflow-y: auto; + .card-box { + border-bottom: 2rpx solid #d9d9d9; + padding: 20rpx 0; + display: flex; + justify-content: space-between; + .name-box { + display: flex; + align-items: center; + width: 80%; + .mode { + font-size: 28rpx; + height: 50rpx; + line-height: 50rpx; + padding: 0 16rpx; + border-radius: 10rpx; + color: #fff; + background: #44943a; + margin-right: 10rpx; + } + .name { + width: 50%; + font-size: 32rpx; + color: #333333; + font-weight: 500; + // 超过宽度显示省略号 + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; + vertical-align: middle; + } + } + + .right-box { + display: flex; + align-items: center; + .p { + font-size: 28rpx; + color: #666666; + font-weight: 400; + margin-right: 10rpx; + } + } + } + } + + .btn { + margin-top: 20rpx; + background: #ffffff; + color: #44943a; + height: 80rpx; + line-height: 80rpx; + text-align: center; + border-radius: 40rpx; + border: 2rpx solid #44943a; + } +} diff --git a/pages/my-index/my-index.vue b/pages/my-index/my-index.vue index d118f0d..7672702 100644 --- a/pages/my-index/my-index.vue +++ b/pages/my-index/my-index.vue @@ -12,7 +12,14 @@ icon: 'wallet', url: '/pages/my-index/wallet/index' }, - { name: '我的团队', icon: 'team', url: '/pages/my-index/my-team' }, + // #ifdef H5 + { + name: '邀请好友', + icon: 'user-code', + url: '/pages/my-index/wallet/invite' + }, + // #endif + { name: '我的拼团', icon: 'team', url: '/pages/my-index/my-team' }, // { name: '群创建直播', icon: 'videocam', url: '' }, { name: '直播记录', @@ -174,9 +181,7 @@ display: flex; flex-direction: column; .name { - font-family: - PingFang SC, - PingFang SC; + font-family: PingFang SC, PingFang SC; font-weight: bold; font-size: 32rpx; color: #333333; @@ -224,9 +229,7 @@ display: flex; flex-direction: column; text { - font-family: - PingFang SC, - PingFang SC; + font-family: PingFang SC, PingFang SC; font-weight: 500; font-size: 28rpx; color: #ffffff; @@ -247,9 +250,7 @@ height: 64rpx; line-height: 64rpx; border-radius: 100rpx 100rpx 100rpx 100rpx; - font-family: - PingFang SC, - PingFang SC; + font-family: PingFang SC, PingFang SC; font-weight: 500; font-size: 28rpx; color: #ffffff; @@ -284,9 +285,7 @@ } .text-box { margin-left: 16rpx; - font-family: - PingFang SC, - PingFang SC; + font-family: PingFang SC, PingFang SC; font-weight: 500; font-size: 32rpx; color: #333333; diff --git a/pages/my-index/my-team.vue b/pages/my-index/my-team.vue index 945feb4..e2fb953 100644 --- a/pages/my-index/my-team.vue +++ b/pages/my-index/my-team.vue @@ -9,7 +9,7 @@ - 我的团队(人) + 我的拼团(人) {{ userInfo.teamCount }} { diff --git a/static/images/my-index/user-code.png b/static/images/my-index/user-code.png new file mode 100644 index 0000000..e98ad82 Binary files /dev/null and b/static/images/my-index/user-code.png differ