From c139fcf5017bbfea6cd05da8dd8126f670249597 Mon Sep 17 00:00:00 2001 From: cbb <1055026847@qq.com> Date: Tue, 13 Jan 2026 17:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AD=BE=E5=88=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 3 +- .../components/TUIChat/message-list/index.vue | 1 - .../TUIGroup/manage-group/index.vue | 2 +- api/my-index.js | 1 + api/tui-kit.js | 4 +- components/cb-search/cb-search.vue | 4 +- pages/anchor/index.nvue | 129 ++++++++++-------- pages/audience/index.nvue | 7 +- pages/discover/dynamic/dynamic.vue | 76 ++++++++--- pages/discover/punch.vue | 11 +- pages/discover/styles/dynamic.scss | 10 ++ pages/index/index.vue | 2 +- pages/mall/list.vue | 125 +++++++++++------ pages/my-index/my-index.vue | 10 +- stores/user.js | 27 ++-- utils/request.js | 72 +++++++--- 16 files changed, 313 insertions(+), 171 deletions(-) diff --git a/App.vue b/App.vue index 7e1c0dc..e82c18c 100644 --- a/App.vue +++ b/App.vue @@ -17,7 +17,8 @@ const silentLogin = async () => { if (token.value) { loginTencentIM() - reLaunch('/TUIKit/components/TUIConversation/index') + // reLaunch('/TUIKit/components/TUIConversation/index') + return } diff --git a/TUIKit/components/TUIChat/message-list/index.vue b/TUIKit/components/TUIChat/message-list/index.vue index c5fb653..7ebe245 100644 --- a/TUIKit/components/TUIChat/message-list/index.vue +++ b/TUIKit/components/TUIChat/message-list/index.vue @@ -627,7 +627,6 @@ item.modifyMessage({ cloudCustomData: JSON.stringify(newMessage) }) - return receiveRedEnvelope({ redPacketId: data.id }) diff --git a/TUIKit/components/TUIGroup/manage-group/index.vue b/TUIKit/components/TUIGroup/manage-group/index.vue index 5eddff0..0dc3c6b 100644 --- a/TUIKit/components/TUIGroup/manage-group/index.vue +++ b/TUIKit/components/TUIGroup/manage-group/index.vue @@ -889,7 +889,7 @@ reason: '' } console.log(options, '===') - return + await TUIGroupService.deleteGroupMember(options) } diff --git a/api/my-index.js b/api/my-index.js index bcf8916..fb3bd08 100644 --- a/api/my-index.js +++ b/api/my-index.js @@ -212,6 +212,7 @@ export const getUserMomentsList = data => { return http({ url: '/api/service/userMoments/list', method: 'get', + loading: false, data }) } diff --git a/api/tui-kit.js b/api/tui-kit.js index fb46d1f..a6bc70c 100644 --- a/api/tui-kit.js +++ b/api/tui-kit.js @@ -99,9 +99,9 @@ export const imDataStartLive = (roomId) => { } /** 结束直播 */ -export const imDataEndLive = (roomId) => { +export const imDataEndLive = (roomId, viewers) => { return http({ - url: `/api/service/imLiveRoom/${roomId}`, + url: `/api/service/imLiveRoom/${roomId}/${viewers}`, method: 'delete' }) } diff --git a/components/cb-search/cb-search.vue b/components/cb-search/cb-search.vue index e5783b3..9ef9eea 100644 --- a/components/cb-search/cb-search.vue +++ b/components/cb-search/cb-search.vue @@ -12,6 +12,8 @@ type: String, default: '' }) + + const emit = defineEmits(['search']) diff --git a/pages/anchor/index.nvue b/pages/anchor/index.nvue index 9dccb52..8095c66 100644 --- a/pages/anchor/index.nvue +++ b/pages/anchor/index.nvue @@ -550,14 +550,16 @@ clearAudioEffectSet() clearBeautyPanelSet() uni.$summaryData = summaryData.value - console.warn(` 退出直播 imDataEndLive`); - - endLive({ - success: () => { - console.warn(` 退出直播 imDataEndLive`); - uni.redirectTo({ url: '/pages/liveend/index' }); - }, - }); + console.warn(` 退出直播===直播间人数`, audienceCount.value); + imDataEndLive(roomDataId.value, audienceCount.value).then(() => { + uni.redirectTo({ url: '/pages/liveend/index' }); + }) + // endLive({ + // success: () => { + // console.warn(` 退出直播 imDataEndLive`); + // uni.redirectTo({ url: '/pages/liveend/index' }); + // }, + // }); } } @@ -569,60 +571,67 @@ isShowLiveMoreActionsPanel.value = true; }; + const roomDataId = ref('') const startLive = async () => { - // try { - // console.log('点击开始直播') - // const data = { - // coverUrl: coverURL.value, - // roomName: liveTitle.value, - // groupId: groupId.value - // } - // const roomData = await imAddLive(data) - // const res = await imDataStartLive(roomData.data.roomId) - // console.log(res) - // const params = { - // cursor: "", // 首次拉起传空(不能是null),然后根据回调数据的cursor确认是否拉完 - // count: 20, // 分页拉取的个数 - // }; - // fetchLiveList(params); - // openLocalCamera({ isFront: isFrontCamera.value }); - // openLocalMicrophone(); - // setLocalVideoMuteImage(); - // isStartLive.value = true; - // } catch (err) { - // console.log(err, '====22') - // } - - createLive({ - liveInfo: { - liveID: uni?.$liveID, - liveName: liveTitle.value, - coverURL: coverURL.value, - isSeatEnabled: true, - seatMode: 'APPLY', - maxSeatCount: 0, - isPublicVisible: liveMode.value === '公开', - keepOwnerOnSeat: true, - seatLayoutTemplateID: templateLayout.value, - }, - success: () => { - const params = { - cursor: "", // 首次拉起传空(不能是null),然后根据回调数据的cursor确认是否拉完 - count: 20, // 分页拉取的个数 - }; - fetchLiveList(params); + try { + console.log('点击开始直播') + const data = { + coverUrl: coverURL.value, + roomName: liveTitle.value, + groupId: groupId.value + } + const roomData = await imAddLive(data) + const roomId = roomData.data.roomId + uni.$liveID = roomId + liveID.value = roomId + const res = await imDataStartLive(roomId) + console.log(roomData, '========11111') + console.log(res, '========22222') + roomDataId.value = roomId + const params = { + cursor: "", // 首次拉起传空(不能是null),然后根据回调数据的cursor确认是否拉完 + count: 20, // 分页拉取的个数 + }; + joinLive({ liveID: roomId }) + fetchLiveList(params); + openLocalCamera({ isFront: isFrontCamera.value }); + openLocalMicrophone(); + setLocalVideoMuteImage(); + isStartLive.value = true; + } catch (err) { + console.log(err, '====22') + } - openLocalCamera({ isFront: isFrontCamera.value }); - openLocalMicrophone(); - setLocalVideoMuteImage(); - }, - fail: (errCode, errMsg) => { - uni.showToast({ - title: '创建直播间失败', - }); - }, - }); - isStartLive.value = true; + // createLive({ + // liveInfo: { + // liveID: uni?.$liveID, + // liveName: liveTitle.value, + // coverURL: coverURL.value, + // isSeatEnabled: true, + // seatMode: 'APPLY', + // maxSeatCount: 0, + // isPublicVisible: liveMode.value === '公开', + // keepOwnerOnSeat: true, + // seatLayoutTemplateID: templateLayout.value, + // }, + // success: () => { + // const params = { + // cursor: "", // 首次拉起传空(不能是null),然后根据回调数据的cursor确认是否拉完 + // count: 20, // 分页拉取的个数 + // }; + // fetchLiveList(params); + + // openLocalCamera({ isFront: isFrontCamera.value }); + // openLocalMicrophone(); + // setLocalVideoMuteImage(); + // }, + // fail: (errCode, errMsg) => { + // uni.showToast({ + // title: '创建直播间失败', + // }); + // }, + // }); + // isStartLive.value = true; }; const ShowAnchorViewClickPanel = (userInfo) => { diff --git a/pages/audience/index.nvue b/pages/audience/index.nvue index 0189417..85652aa 100644 --- a/pages/audience/index.nvue +++ b/pages/audience/index.nvue @@ -427,16 +427,17 @@ disconnect({ liveID: uni?.$liveID, }) - exitSheetItems.value = ['退出直播间'] + exitSheetItems.value = ['退2出直播间'] exitSheetTitle.value = '' uni.$localGuestStatus = 'IDLE' return } if ((uni.$localGuestStatus === 'CONNECTED' && index === 1) || (uni.$localGuestStatus !== 'CONNECTED' && index === 0)) { + + + // imDataEndLive(liveID.value, 0) leaveLive({ success: () => { - // imDataEndLive(liveID.value) - uni.$liveID = '' uni.redirectTo({ url: `/pages/discover/livelist/index`, diff --git a/pages/discover/dynamic/dynamic.vue b/pages/discover/dynamic/dynamic.vue index f33b665..4a0766b 100644 --- a/pages/discover/dynamic/dynamic.vue +++ b/pages/discover/dynamic/dynamic.vue @@ -25,6 +25,7 @@ text-transform: none;` const MAX_SCROLL = 446 const paging = ref(null) + const listLoading = ref(true) const cbNavBar = ref({}) const dataList = ref([]) const topIcon = reactive({ @@ -54,24 +55,36 @@ text-transform: none;` try { const res = await getUserMomentsList({ pageNum, - pageSize + pageSize, + targetUserId: userInfo.value.userId }) - paging.value.complete(res.rows) + const list = res.rows.map(item => { + return { + ...item, + commentList: item.comments + } + }) + paging.value.complete(list) + listLoading.value = false } catch (error) { paging.value.complete(false) } } const onLike = async item => { - await likeUserMoments(item.id) - // item.likeCount += 1 + const res = await likeUserMoments(item.id) + if (res.data) { + item.likeCount += 1 + } else { + item.likeCount -= 1 + } } /** 点击查看大图 */ - const onImage = current => { + const onImage = (urls, current = 0) => { uni.previewImage({ - urls: [current], // 图片路径数组(本地或网络) - current: current // 当前显示的图片(可选,默认为第一张) + urls, // 图片路径数组(本地或网络) + current // 当前显示的图片(可选,默认为第一张) }) closeComment() } @@ -87,9 +100,11 @@ text-transform: none;` console.log('发布评论') const data = { content: contentData.value, - id: item.id + id: item.id, + momentId: item.id } const res = await addUserMomentsComment(data) + item.commentList.push(res.data) closeComment() } @@ -117,6 +132,7 @@ text-transform: none;` safe-area-inset-bottom use-safe-area-placeholder :show-loading-more-no-more-view="false" + :auto="false" @query="getData" @scroll="onScroll" > @@ -146,39 +162,51 @@ text-transform: none;` - {{ userInfo.userName }} + {{ userInfo?.userName }} - + - 名字 + {{ item.userName }} {{ item.content }} - + @@ -223,10 +251,14 @@ text-transform: none;` - - - Admin: - 确实的很好,值得推荐的很好 + + + {{ c.userName }}: + {{ c.content }} diff --git a/pages/discover/punch.vue b/pages/discover/punch.vue index d0fed43..78ee01f 100644 --- a/pages/discover/punch.vue +++ b/pages/discover/punch.vue @@ -29,9 +29,14 @@ /** 连续天数 */ const continuousDays = ref(0) + /** 给数子补零 */ + const padZero = num => { + return num < 10 ? `0${num}` : num + } + const getData = async msg => { const res = await getSignList({ - signMonth: `${currentYear.value}-${currentMonth.value}` + signMonth: `${currentYear.value}-${padZero(currentMonth.value)}` }) dateList.value = generateCalendar( @@ -199,7 +204,9 @@ - {{ currentYear }}年{{ currentMonth }}月 + + {{ currentYear }}年{{ padZero(currentMonth) }}月 + { // 3秒后跳转 indexGo.value = setTimeout(() => { - reLaunch('/pages/news-list/news-list') + reLaunch('/TUIKit/components/TUIConversation/index') }, 3000) }) diff --git a/pages/mall/list.vue b/pages/mall/list.vue index 4d2a5d9..123bff4 100644 --- a/pages/mall/list.vue +++ b/pages/mall/list.vue @@ -4,11 +4,14 @@ import { getCategory, getProductList } from '@/api/mall' import { navigateTo } from '@/utils/router' + const paging = ref(null) /** 顶部分类选项 */ const topNavOptions = ref([]) const formData = reactive({ name: '', - type: '0' + type: '', + pageNum: 1, + pageSize: 15 }) /** 商品列表 */ const cardList = ref([]) @@ -18,14 +21,24 @@ topNavOptions.value = res.data } - const getListData = async () => { - const res = await getProductList() - cardList.value = res.rows - console.log(res.rows) + const getListData = async (pageNum, pageSize) => { + try { + const res = await getProductList({ + pageNum, + pageSize, + categoryId: formData.type, + productName: formData.name + }) + paging.value.complete(res.rows) + } catch (error) { + paging.value.complete(false) + } } const onTop = value => { formData.type = value + formData.name = '' + getListData(1, formData.pageSize) } const onGo = item => { @@ -34,53 +47,77 @@ onLoad(async () => { await categoryList() - await getListData() + // await getListData(1, formData.pageSize) })