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'])
@@ -27,7 +29,7 @@
:placeholder="props.placeholder"
class="search-box"
/>
-
+
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 }}
-
+
v.imageUrl),
+ index
+ )
+ "
>
@@ -223,10 +251,14 @@ text-transform: none;`
-
- {{ 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)
})
-
-
-
-
-
- {{ item.categoryName }}
-
-
-
-
-
-
-
-
- {{ item.productName }}
-
-
- ¥
- {{ item.minPrice }}
+
+
+
+
+
+
+ 全部
+
+
+ {{ item.categoryName }}
-
-
- 拼单数量:{{ item.salesCount }}件
+
+
+
+
+
+
+ {{ item.productName }}
+
+
+ ¥
+ {{ item.minPrice }}
+
+
+
+
+
+ 拼单数量:{{ item.salesCount }}件
+
+
-
+