好友列表

This commit is contained in:
刘英东 2025-01-05 23:03:28 +08:00
parent 151d93a6d1
commit 8c141f0d9a
2 changed files with 43 additions and 13 deletions

View File

@ -127,6 +127,13 @@ export const news = {
method: 'POST', method: 'POST',
query: param query: param
}) })
},
//获取好友列表
getFriendList() {
return util.request({
url: `/user/chat/relation/myFriends`,
method: 'GET'
})
} }
} }

View File

@ -28,7 +28,11 @@
// //
import footerMneu from '@/components/footerMenu/footerMenu' import footerMneu from '@/components/footerMenu/footerMenu'
import videoApi from '@/api/video.js'; import videoApi from '@/api/video.js';
// vuex //
import util from '@/common/js/util.js'
// api
import newsApi from '@/api/news.js'
// vuex
const store = useStore() const store = useStore()
// //
const menuList = reactive([{ const menuList = reactive([{
@ -72,16 +76,35 @@
handleMenuIndex(2) handleMenuIndex(2)
}) })
/** /**
* 切换下标 * 切换下标
* @param {Number} index * @param {Number} index
*/ */
function handleMenuIndex(index) { function handleMenuIndex(index) {
if (menuIndex.value === index) return if (menuIndex.value === index) return
menuIndex.value = index menuIndex.value = index
if (!menuList[index].load) menuList[index].load = true if (!menuList[index].load) menuList[index].load = true
} //
if (index === 0) {
getFriends();
}
}
const viewData = ref([])
//
function getFriends() {
newsApi.getFriendList().then(response => {
if (response.success) {
viewData.value = response.data;
// book
console.log('好友列表:', viewData.value);
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
// //
function showActionSheet() { function showActionSheet() {
uni.showActionSheet({ uni.showActionSheet({