修复已知问题
This commit is contained in:
@@ -471,6 +471,8 @@
|
|||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(contactInfo, '===')
|
||||||
resetContactInfoUIData()
|
resetContactInfoUIData()
|
||||||
// deep clone
|
// deep clone
|
||||||
contactInfoData.value = deepCopy(contactInfo) || {}
|
contactInfoData.value = deepCopy(contactInfo) || {}
|
||||||
@@ -484,6 +486,7 @@
|
|||||||
contactInfoData.value
|
contactInfoData.value
|
||||||
)
|
)
|
||||||
isBothFriend.value = await isFriend(contactInfoData.value)
|
isBothFriend.value = await isFriend(contactInfoData.value)
|
||||||
|
|
||||||
generateMoreInfo()
|
generateMoreInfo()
|
||||||
generateButton()
|
generateButton()
|
||||||
if (contactInfo.infoKeyList) {
|
if (contactInfo.infoKeyList) {
|
||||||
|
|||||||
@@ -233,7 +233,7 @@
|
|||||||
'TUIGroup.群ID'
|
'TUIGroup.群ID'
|
||||||
)}(${TUITranslateService.t('TUIGroup.选填')})`,
|
)}(${TUITranslateService.t('TUIGroup.选填')})`,
|
||||||
key: 'groupID',
|
key: 'groupID',
|
||||||
placeholder: TUITranslateService.t('TUIGroup.请输入群ID')
|
placeholder: '搜索加入群使用'
|
||||||
}
|
}
|
||||||
return groupInfo.profile.type === TUIChatEngine.TYPES.GRP_COMMUNITY
|
return groupInfo.profile.type === TUIChatEngine.TYPES.GRP_COMMUNITY
|
||||||
? [groupNameInput]
|
? [groupNameInput]
|
||||||
@@ -352,7 +352,7 @@
|
|||||||
break
|
break
|
||||||
case 'groupID':
|
case 'groupID':
|
||||||
groupInfo.groupConfig.title = '设置群ID'
|
groupInfo.groupConfig.title = '设置群ID'
|
||||||
groupInfo.groupConfig.placeholder = '请输入群ID'
|
groupInfo.groupConfig.placeholder = '搜索加入群使用'
|
||||||
groupInfo.groupConfig.type = 'input'
|
groupInfo.groupConfig.type = 'input'
|
||||||
break
|
break
|
||||||
case 'type':
|
case 'type':
|
||||||
|
|||||||
@@ -69,14 +69,14 @@
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<!-- <dl v-if="isShowAddMember" class="user-info-list-item">
|
<!-- <dl v-if="isShowAddMember" class="user-info-list-item">
|
||||||
<dt class="avatar" @click="toggleMask('add')">+</dt>
|
<dt class="avatar" @click="toggleMask('add')">+</dt>
|
||||||
</dl>
|
</dl>
|
||||||
<dl
|
<dl
|
||||||
v-if="currentSelfRole === 'Owner'"
|
v-if="currentSelfRole === 'Owner'"
|
||||||
class="user-info-list-item"
|
class="user-info-list-item"
|
||||||
>
|
>
|
||||||
<dt class="avatar" @click="toggleMask('remove')">-</dt>
|
<dt class="avatar" @click="toggleMask('remove')">-</dt>
|
||||||
</dl> -->
|
</dl> -->
|
||||||
</ol>
|
</ol>
|
||||||
<div
|
<div
|
||||||
v-if="groupMemberList.length > showUserNum"
|
v-if="groupMemberList.length > showUserNum"
|
||||||
@@ -749,8 +749,9 @@
|
|||||||
switch (transferType.value) {
|
switch (transferType.value) {
|
||||||
case 'add':
|
case 'add':
|
||||||
try {
|
try {
|
||||||
imMemberResponse =
|
imMemberResponse = await TUIGroupService.getGroupMemberProfile(
|
||||||
await TUIGroupService.getGroupMemberProfile(options)
|
options
|
||||||
|
)
|
||||||
transferList.value = transferList.value.filter(
|
transferList.value = transferList.value.filter(
|
||||||
(item: any) => item.userID !== imResponse.data[0]?.userID
|
(item: any) => item.userID !== imResponse.data[0]?.userID
|
||||||
)
|
)
|
||||||
@@ -776,8 +777,9 @@
|
|||||||
break
|
break
|
||||||
case 'remove':
|
case 'remove':
|
||||||
try {
|
try {
|
||||||
imResponse =
|
imResponse = await TUIGroupService.getGroupMemberProfile(
|
||||||
await TUIGroupService.getGroupMemberProfile(options)
|
options
|
||||||
|
)
|
||||||
if (imResponse.data.memberList.length === 0) {
|
if (imResponse.data.memberList.length === 0) {
|
||||||
const message = TUITranslateService.t(
|
const message = TUITranslateService.t(
|
||||||
'TUIGroup.该用户不在群组内'
|
'TUIGroup.该用户不在群组内'
|
||||||
@@ -848,7 +850,11 @@
|
|||||||
groupID: currentGroupID.value,
|
groupID: currentGroupID.value,
|
||||||
userIDList
|
userIDList
|
||||||
}
|
}
|
||||||
await TUIGroupService.addGroupMember(options)
|
try {
|
||||||
|
await TUIGroupService.addGroupMember(options)
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const changeOwner = async (userID: any) => {
|
const changeOwner = async (userID: any) => {
|
||||||
|
|||||||
@@ -287,7 +287,7 @@
|
|||||||
|
|
||||||
.admin-mute-all {
|
.admin-mute-all {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
padding: 20px 0;
|
padding: 20rpx ;
|
||||||
border-bottom: 1px solid #e8e8e9;
|
border-bottom: 1px solid #e8e8e9;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
// background: #ebf0f6;
|
// background: #ebf0f6;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
min-height: 44px;
|
min-height: 86rpx;
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
border-bottom: 2rpx solid #0000000a;
|
border-bottom: 2rpx solid #0000000a;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@@ -437,7 +437,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/adduser/index",
|
"path": "pages/adduser/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "添加好友",
|
"navigationBarTitleText": "添加地址",
|
||||||
"navigationBarBackgroundColor": "#ffffff"
|
"navigationBarBackgroundColor": "#ffffff"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -157,7 +157,9 @@
|
|||||||
|
|
||||||
<!-- 底部按钮 -->
|
<!-- 底部按钮 -->
|
||||||
<bottom-view>
|
<bottom-view>
|
||||||
<cb-button @click="submitForm">确认添加</cb-button>
|
<cb-button @click="submitForm">
|
||||||
|
{{ props.type == 'edit' ? '修改' : '添加' }}
|
||||||
|
</cb-button>
|
||||||
</bottom-view>
|
</bottom-view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import TUIChatEngine, {
|
import TUIChatEngine, {
|
||||||
TUIConversationService,
|
TUIConversationService,
|
||||||
TUIFriendService,
|
TUIFriendService,
|
||||||
|
TUIGroupService,
|
||||||
TUIUserService
|
TUIUserService
|
||||||
} from '@tencentcloud/chat-uikit-engine-lite'
|
} from '@tencentcloud/chat-uikit-engine-lite'
|
||||||
import { useUI } from '../../utils/use-ui'
|
import { useUI } from '../../utils/use-ui'
|
||||||
@@ -11,6 +12,7 @@
|
|||||||
import { TUIGlobal } from '@tencentcloud/universal-api'
|
import { TUIGlobal } from '@tencentcloud/universal-api'
|
||||||
import PopupBox from '../my-index/components/popup-box.vue'
|
import PopupBox from '../my-index/components/popup-box.vue'
|
||||||
import SwitchBar from '../../TUIKit/components/common/SwitchBar/index.vue'
|
import SwitchBar from '../../TUIKit/components/common/SwitchBar/index.vue'
|
||||||
|
import { TUIConstants, TUICore } from '@tencentcloud/tui-core-lite'
|
||||||
|
|
||||||
const { showLoading, hideLoading, showToast, showDialog } = useUI()
|
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 () => {
|
const getFriendInfo = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@@ -73,37 +122,68 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const submit = async () => {
|
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()
|
showLoading()
|
||||||
try {
|
if (friendInfo.value?.cbType === 'group') {
|
||||||
await TUIFriendService.addFriend({
|
TUIGroupService.joinGroup({
|
||||||
to: userId.value,
|
groupID: friendInfo.value.groupID,
|
||||||
source,
|
applyMessage: verificationInfo.value
|
||||||
remark: remark.value || '',
|
|
||||||
wording: verificationInfo.value,
|
|
||||||
type: TUIChatEngine.TYPES.SNS_ADD_TYPE_BOTH
|
|
||||||
})
|
})
|
||||||
hideLoading()
|
.then(imResponse => {
|
||||||
await showToast('好友请求已发送', 'success')
|
switch (imResponse?.data?.status) {
|
||||||
navigateBack()
|
case TUIChatEngine.TYPES.JOIN_STATUS_WAIT_APPROVAL: // Wait for administrator approval
|
||||||
} catch (error) {
|
hideLoading()
|
||||||
if (error.code === 30515) {
|
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()
|
hideLoading()
|
||||||
const show = await showDialog(
|
await showToast('好友请求已发送', 'success')
|
||||||
'提示',
|
navigateBack()
|
||||||
'该用户在黑名单中,不允许加好友'
|
} catch (error) {
|
||||||
)
|
if (error.code === 30515) {
|
||||||
if (show) {
|
hideLoading()
|
||||||
navigateBack()
|
const show = await showDialog(
|
||||||
|
'提示',
|
||||||
|
'该用户在黑名单中,不允许加好友'
|
||||||
|
)
|
||||||
|
if (show) {
|
||||||
|
navigateBack()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,38 +246,56 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除好友 */
|
/** 删除好友/删除群 */
|
||||||
const onDeleteFriend = async () => {
|
const onDeleteFriend = async () => {
|
||||||
const show = await showDialog('提示', '确定要删除好友吗?')
|
const isMode = friendInfo.value?.cbType === 'group'
|
||||||
|
const show = await showDialog(
|
||||||
|
'提示',
|
||||||
|
`确定要${isMode ? '解除群聊' : '删除好友'}吗?`
|
||||||
|
)
|
||||||
if (!show) {
|
if (!show) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
showLoading()
|
showLoading()
|
||||||
TUIFriendService.deleteFriend({
|
if (isMode) {
|
||||||
userIDList: [friendInfo.value.userID],
|
TUIGroupService.dismissGroup(friendInfo.value?.groupID)
|
||||||
type: TUIChatEngine.TYPES.SNS_DELETE_TYPE_BOTH
|
.then(async () => {
|
||||||
})
|
await showToast('解除群聊成功', 'success')
|
||||||
.then(async res => {
|
|
||||||
hideLoading()
|
|
||||||
const { successUserIDList } = res.data
|
|
||||||
if (successUserIDList[0].userID === friendInfo.value.userID) {
|
|
||||||
await showToast('删除好友成功', 'success')
|
|
||||||
reLaunch('/TUIKit/components/TUIContact/index')
|
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')
|
await showToast('删除好友失败', 'error')
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
.catch(async () => {
|
|
||||||
hideLoading()
|
|
||||||
await showToast('删除好友失败', 'error')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 发送消息 */
|
/** 发送消息 */
|
||||||
const onSendMessage = () => {
|
const onSendMessage = () => {
|
||||||
TUIConversationService.switchConversation(
|
const data =
|
||||||
`C2C${friendInfo.value.userID}`
|
friendInfo.value?.cbType === 'group'
|
||||||
).then(() => {
|
? `GROUP${friendInfo.value?.groupID}`
|
||||||
|
: `C2C${friendInfo.value.userID}`
|
||||||
|
TUIConversationService.switchConversation(data).then(() => {
|
||||||
TUIGlobal?.navigateTo({
|
TUIGlobal?.navigateTo({
|
||||||
url: `/TUIKit/components/TUIChat/index`
|
url: `/TUIKit/components/TUIChat/index`
|
||||||
})
|
})
|
||||||
@@ -206,12 +304,19 @@
|
|||||||
|
|
||||||
onLoad(e => {
|
onLoad(e => {
|
||||||
userId.value = e?.id || ''
|
userId.value = e?.id || ''
|
||||||
/** type: 不传为添加 1 为详情页 */
|
/** type: 不传为添加 1 为详情页 9 为群信息 */
|
||||||
isDetail.value = e?.type == 1 || false
|
if (e?.type == 9) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: isDetail.value ? '好友信息' : '发送好友申请'
|
title: '群聊信息'
|
||||||
})
|
})
|
||||||
getFriendInfo()
|
getGroupInfo()
|
||||||
|
} else {
|
||||||
|
isDetail.value = e?.type == 1 || false
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: isDetail.value ? '好友信息' : '发送好友申请'
|
||||||
|
})
|
||||||
|
getFriendInfo()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -229,10 +334,13 @@
|
|||||||
<uni-icons v-else type="contact-filled" size="80"></uni-icons>
|
<uni-icons v-else type="contact-filled" size="80"></uni-icons>
|
||||||
<view class="right-box">
|
<view class="right-box">
|
||||||
<text>{{ friendInfo.nick || '未知名称' }}</text>
|
<text>{{ friendInfo.nick || '未知名称' }}</text>
|
||||||
<text>手机号: {{ friendInfo.userID }}</text>
|
<text v-if="!friendInfo?.cbType == 'group'">
|
||||||
<text>
|
手机号: {{ friendInfo.userID }}
|
||||||
|
</text>
|
||||||
|
<text v-if="!friendInfo?.cbType == 'group'">
|
||||||
个性签名: {{ friendInfo.selfSignature || '暂无个性签名' }}
|
个性签名: {{ friendInfo.selfSignature || '暂无个性签名' }}
|
||||||
</text>
|
</text>
|
||||||
|
<text v-else>ID: {{ friendInfo.groupID }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -248,7 +356,10 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 备注 -->
|
<!-- 备注 -->
|
||||||
<view v-if="!isDetail" class="remark">
|
<view
|
||||||
|
v-if="!friendInfo?.cbType == 'group' && !isDetail"
|
||||||
|
class="remark"
|
||||||
|
>
|
||||||
<text>备注名</text>
|
<text>备注名</text>
|
||||||
<input
|
<input
|
||||||
v-model="remark"
|
v-model="remark"
|
||||||
@@ -264,7 +375,11 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 修改好友信息======================== -->
|
<!-- 修改好友信息======================== -->
|
||||||
<view v-if="isDetail" class="remark" @click="showRemark = true">
|
<view
|
||||||
|
v-if="!friendInfo?.cbType == 'group' && isDetail"
|
||||||
|
class="remark"
|
||||||
|
@click="showRemark = true"
|
||||||
|
>
|
||||||
<text>备注名</text>
|
<text>备注名</text>
|
||||||
<view style="display: flex; align-items: center">
|
<view style="display: flex; align-items: center">
|
||||||
<text
|
<text
|
||||||
@@ -275,15 +390,30 @@
|
|||||||
<uni-icons type="right" color="#999999" size="36rpx"></uni-icons>
|
<uni-icons type="right" color="#999999" size="36rpx"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isDetail" class="remark">
|
<view
|
||||||
|
v-if="!friendInfo?.cbType == 'group' && isDetail"
|
||||||
|
class="remark"
|
||||||
|
>
|
||||||
<text>加入黑名单</text>
|
<text>加入黑名单</text>
|
||||||
<SwitchBar :value="isBlack" @click="switchChange" />
|
<SwitchBar :value="isBlack" @click="switchChange" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="isDetail" class="send-btn" @tap="onDeleteFriend">
|
<view
|
||||||
|
v-if="!friendInfo?.cbType == 'group' && isDetail"
|
||||||
|
class="send-btn"
|
||||||
|
@tap="onDeleteFriend"
|
||||||
|
>
|
||||||
<text style="color: #eb1c26">删除好友</text>
|
<text style="color: #eb1c26">删除好友</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view
|
||||||
|
v-if="friendInfo?.selfInfo?.role == 'Owner' && isDetail"
|
||||||
|
class="send-btn"
|
||||||
|
@tap="onDeleteFriend"
|
||||||
|
>
|
||||||
|
<text style="color: #eb1c26">解除群聊</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<bottom-view v-if="isDetail">
|
<bottom-view v-if="isDetail">
|
||||||
<cb-button @click="onSendMessage">发送信息</cb-button>
|
<cb-button @click="onSendMessage">发送信息</cb-button>
|
||||||
</bottom-view>
|
</bottom-view>
|
||||||
@@ -344,9 +474,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.title {
|
.title {
|
||||||
font-family:
|
font-family: PingFang SC, PingFang SC;
|
||||||
PingFang SC,
|
|
||||||
PingFang SC;
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
|
|||||||
@@ -1,27 +1,56 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import TUICore, { TUIConstants } from '@tencentcloud/tui-core-lite'
|
import TUICore, { TUIConstants } from '@tencentcloud/tui-core-lite'
|
||||||
import { useUI } from '@/utils/use-ui'
|
import { useUI } from '@/utils/use-ui'
|
||||||
import { navigateTo } from '@/utils/router'
|
import { navigateTo } from '@/utils/router'
|
||||||
import TUIChatEngine, {
|
import TUIChatEngine, {
|
||||||
TUIFriendService
|
TUIFriendService,
|
||||||
|
TUIGroupService
|
||||||
} from '@tencentcloud/chat-uikit-engine-lite'
|
} from '@tencentcloud/chat-uikit-engine-lite'
|
||||||
|
|
||||||
const { showLoading, hideLoading } = useUI()
|
const { showLoading, hideLoading } = useUI()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const searchValue = ref('')
|
const searchValue = ref('')
|
||||||
const searchList = ref([])
|
const searchList = ref([])
|
||||||
const isSearc = ref(false)
|
// const isSearc = ref(false)
|
||||||
// 是否是好友
|
// 是否是好友
|
||||||
const isFriend = ref(false)
|
const isFriend = ref(false)
|
||||||
|
|
||||||
|
/** 群列表 */
|
||||||
|
const searchGroup = ref([])
|
||||||
|
|
||||||
|
const isSearc = computed(() => {
|
||||||
|
return searchList.value.length === 0 && searchGroup.value.length === 0
|
||||||
|
})
|
||||||
const onCancel = () => {
|
const onCancel = () => {
|
||||||
isFriend.value = false
|
isFriend.value = false
|
||||||
isSearc.value = false
|
searchGroup.value = []
|
||||||
searchList.value = []
|
searchList.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = () => {
|
/** 群查询 */
|
||||||
|
const getGroup = () => {
|
||||||
|
showLoading()
|
||||||
|
loading.value = true
|
||||||
|
TUICore.callService({
|
||||||
|
serviceName: TUIConstants.TUISearch.SERVICE.NAME,
|
||||||
|
method: TUIConstants.TUISearch.SERVICE.METHOD.SEARCH_GROUP,
|
||||||
|
params: {
|
||||||
|
groupID: searchValue.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
searchGroup.value = [res.data.group]
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
searchGroup.value = []
|
||||||
|
console.log(err, '==')
|
||||||
|
loading.value = false
|
||||||
|
hideLoading()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const search = async () => {
|
||||||
if (!searchValue.value) {
|
if (!searchValue.value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -63,17 +92,29 @@
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
hideLoading()
|
hideLoading()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
getGroup()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onAdd = item => {
|
const onAdd = item => {
|
||||||
navigateTo('/pages/adduser/details', { id: item.userID })
|
navigateTo('/pages/adduser/details', { id: item.userID })
|
||||||
}
|
}
|
||||||
|
|
||||||
const onDetails = item => {
|
const onDetails = (item, state) => {
|
||||||
if (isFriend.value) {
|
if (state == 1) {
|
||||||
navigateTo('/pages/adduser/details', { id: item.userID, type: '1' })
|
navigateTo('/pages/adduser/details', {
|
||||||
|
id: item.groupID,
|
||||||
|
type: '9'
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
onAdd(item)
|
if (isFriend.value) {
|
||||||
|
navigateTo('/pages/adduser/details', {
|
||||||
|
id: item.userID,
|
||||||
|
type: '1'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
onAdd(item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -86,13 +127,14 @@
|
|||||||
radius="100"
|
radius="100"
|
||||||
bgColor="#f4f4f4"
|
bgColor="#f4f4f4"
|
||||||
textColor="#333333"
|
textColor="#333333"
|
||||||
placeholder="请输入用户手机号"
|
placeholder="请输入用户手机号/群ID进行搜索"
|
||||||
@confirm="search"
|
@confirm="search"
|
||||||
@cancel="onCancel"
|
@cancel="onCancel"
|
||||||
></uni-search-bar>
|
></uni-search-bar>
|
||||||
<cb-empty v-if="isSearc" name="未搜索到此账号"></cb-empty>
|
<cb-empty v-if="!loading && isSearc" name="未搜索到"></cb-empty>
|
||||||
<!-- 好友列表 -->
|
|
||||||
<view v-if="!loading" class="user-list">
|
<view v-if="!loading" class="user-list">
|
||||||
|
<!-- 好友列表 -->
|
||||||
<view
|
<view
|
||||||
v-for="item in searchList"
|
v-for="item in searchList"
|
||||||
:key="item.userID"
|
:key="item.userID"
|
||||||
@@ -117,6 +159,32 @@
|
|||||||
<button v-else @click.stop="onAdd(item)">添加</button>
|
<button v-else @click.stop="onAdd(item)">添加</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 群列表 -->
|
||||||
|
<view
|
||||||
|
v-for="item in searchGroup"
|
||||||
|
:key="item.groupID"
|
||||||
|
class="card"
|
||||||
|
@click="onDetails(item, 1)"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
v-if="item?.avatar"
|
||||||
|
:src="item?.avatar"
|
||||||
|
mode="aspectFill"
|
||||||
|
class="avatar"
|
||||||
|
></image>
|
||||||
|
<view v-else class="avatar">
|
||||||
|
<uni-icons type="contact-filled" size="130rpx"></uni-icons>
|
||||||
|
</view>
|
||||||
|
<view class="right-box">
|
||||||
|
<view class="name-box">
|
||||||
|
<text>{{ item.name || '未知名称' }}</text>
|
||||||
|
<text>{{ item.groupID }}</text>
|
||||||
|
</view>
|
||||||
|
<text class="tag-but">群聊</text>
|
||||||
|
<!-- <text v-if="isFriend" class="tag">已添加</text>
|
||||||
|
<button v-else @click.stop="onAdd(item)">添加</button> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -147,6 +215,12 @@
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
.tag-but {
|
||||||
|
padding: 4rpx 20rpx;
|
||||||
|
background: #00d9c5;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
.name-box {
|
.name-box {
|
||||||
height: 96rpx;
|
height: 96rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -41,6 +41,10 @@
|
|||||||
state: false,
|
state: false,
|
||||||
loading: true
|
loading: true
|
||||||
})
|
})
|
||||||
|
/** 地址选项弹出窗 */
|
||||||
|
const isPopup = ref(null)
|
||||||
|
/** 地址列表 */
|
||||||
|
const ressDataList = ref([])
|
||||||
const tixian = ref(null)
|
const tixian = ref(null)
|
||||||
const originalPrice = ref(0)
|
const originalPrice = ref(0)
|
||||||
|
|
||||||
@@ -55,11 +59,26 @@
|
|||||||
topRessData.id = data?.id || ''
|
topRessData.id = data?.id || ''
|
||||||
topRessData.phone = data?.phone || ''
|
topRessData.phone = data?.phone || ''
|
||||||
topRessData.loading = false
|
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 = () => {
|
const onRess = () => {
|
||||||
navigateTo('/pages/address/index')
|
if (topRessData.name) {
|
||||||
|
isPopup.value.open()
|
||||||
|
} else {
|
||||||
|
navigateTo('/pages/address/index')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getData = async productId => {
|
const getData = async productId => {
|
||||||
@@ -119,9 +138,6 @@
|
|||||||
quantity: formData.num,
|
quantity: formData.num,
|
||||||
skuId: formData.spec
|
skuId: formData.spec
|
||||||
}
|
}
|
||||||
console.log(data, '===data===')
|
|
||||||
return
|
|
||||||
|
|
||||||
tixian.value.close()
|
tixian.value.close()
|
||||||
const res = await addOrder(data)
|
const res = await addOrder(data)
|
||||||
await refreshUserInfo()
|
await refreshUserInfo()
|
||||||
@@ -245,6 +261,49 @@
|
|||||||
<bottom-view>
|
<bottom-view>
|
||||||
<cb-button @click="onConfirm">确认支付</cb-button>
|
<cb-button @click="onConfirm">确认支付</cb-button>
|
||||||
</bottom-view>
|
</bottom-view>
|
||||||
|
|
||||||
|
<!-- 地址选项弹出窗 -->
|
||||||
|
<uni-popup
|
||||||
|
ref="isPopup"
|
||||||
|
type="bottom"
|
||||||
|
borderRadius="16rpx 16rpx 0 0"
|
||||||
|
backgroundColor="#ffffff"
|
||||||
|
>
|
||||||
|
<view class="popup-box">
|
||||||
|
<view class="top-name">
|
||||||
|
<text class="title">地址选项</text>
|
||||||
|
<uni-icons
|
||||||
|
type="closeempty"
|
||||||
|
size="44rpx"
|
||||||
|
@click="isPopup.close()"
|
||||||
|
></uni-icons>
|
||||||
|
</view>
|
||||||
|
<!-- 选项卡片 -->
|
||||||
|
<view class="card-list">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in ressDataList"
|
||||||
|
:key="index"
|
||||||
|
class="card-box"
|
||||||
|
@click="onAddress(item)"
|
||||||
|
>
|
||||||
|
<view class="name-box">
|
||||||
|
<text v-if="item.defaultAddress == 1" class="mode">
|
||||||
|
默认
|
||||||
|
</text>
|
||||||
|
<text class="name">{{ item.houseNum }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="right-box">
|
||||||
|
<text class="p">{{ item.name }}</text>
|
||||||
|
<uni-icons type="right" size="36rpx"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 底部添加按钮 -->
|
||||||
|
<view class="btn" @click="navigateTo('/pages/address/index')">
|
||||||
|
添加新地址
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,7 +12,14 @@
|
|||||||
icon: 'wallet',
|
icon: 'wallet',
|
||||||
url: '/pages/my-index/wallet/index'
|
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: '群创建直播', icon: 'videocam', url: '' },
|
||||||
{
|
{
|
||||||
name: '直播记录',
|
name: '直播记录',
|
||||||
@@ -174,9 +181,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.name {
|
.name {
|
||||||
font-family:
|
font-family: PingFang SC, PingFang SC;
|
||||||
PingFang SC,
|
|
||||||
PingFang SC;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
@@ -224,9 +229,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
text {
|
text {
|
||||||
font-family:
|
font-family: PingFang SC, PingFang SC;
|
||||||
PingFang SC,
|
|
||||||
PingFang SC;
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
@@ -247,9 +250,7 @@
|
|||||||
height: 64rpx;
|
height: 64rpx;
|
||||||
line-height: 64rpx;
|
line-height: 64rpx;
|
||||||
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
border-radius: 100rpx 100rpx 100rpx 100rpx;
|
||||||
font-family:
|
font-family: PingFang SC, PingFang SC;
|
||||||
PingFang SC,
|
|
||||||
PingFang SC;
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
@@ -284,9 +285,7 @@
|
|||||||
}
|
}
|
||||||
.text-box {
|
.text-box {
|
||||||
margin-left: 16rpx;
|
margin-left: 16rpx;
|
||||||
font-family:
|
font-family: PingFang SC, PingFang SC;
|
||||||
PingFang SC,
|
|
||||||
PingFang SC;
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<!-- 顶部卡片 -->
|
<!-- 顶部卡片 -->
|
||||||
<view class="top-card">
|
<view class="top-card">
|
||||||
<view class="num-box">
|
<view class="num-box">
|
||||||
<text>我的团队(人)</text>
|
<text>我的拼团(人)</text>
|
||||||
<text>{{ userInfo.teamCount }}</text>
|
<text>{{ userInfo.teamCount }}</text>
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image
|
||||||
|
|||||||
@@ -48,14 +48,7 @@
|
|||||||
title: '收货地址',
|
title: '收货地址',
|
||||||
key: '7',
|
key: '7',
|
||||||
url: '/pages/address/index'
|
url: '/pages/address/index'
|
||||||
},
|
|
||||||
// #ifdef H5
|
|
||||||
{
|
|
||||||
title: '邀请好友',
|
|
||||||
key: '6',
|
|
||||||
url: '/pages/my-index/wallet/invite'
|
|
||||||
}
|
}
|
||||||
// #endif
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
|||||||
BIN
static/images/my-index/user-code.png
Normal file
BIN
static/images/my-index/user-code.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user