diff --git a/jiuyi2/App.vue b/jiuyi2/App.vue index 00251bb7..7b35e690 100644 --- a/jiuyi2/App.vue +++ b/jiuyi2/App.vue @@ -1,59 +1,96 @@ \ No newline at end of file diff --git a/jiuyi2/api/index.js b/jiuyi2/api/index.js index da6d88eb..40b76bae 100644 --- a/jiuyi2/api/index.js +++ b/jiuyi2/api/index.js @@ -85,6 +85,17 @@ const api = { method: 'GET', }) }, + + /** + * 获取未读消息数量 + * @param {Object} param + */ + getNoReadNum() { + return util.request({ + url: '/shopify/region/all', + method: 'GET', + }) + }, } export default api \ No newline at end of file diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js index f652f32b..c6bbe709 100644 --- a/jiuyi2/common/js/config.js +++ b/jiuyi2/common/js/config.js @@ -6,8 +6,8 @@ const config = { // host: 'h5api', // #endif // #ifndef H5 - host: 'http://91f.xyz:8080', - // host: 'https://b433d23.r24.cpolar.top/', + // host: 'http://91f.xyz:8080', + host: 'https://b433d23.r24.cpolar.top/', // host: 'http://hvw2rn.natappfree.cc', // #endif // 支付方式配置 diff --git a/jiuyi2/components/footerMenu/footerMenu.vue b/jiuyi2/components/footerMenu/footerMenu.vue index 72271944..f52ce3cb 100644 --- a/jiuyi2/components/footerMenu/footerMenu.vue +++ b/jiuyi2/components/footerMenu/footerMenu.vue @@ -1,220 +1,244 @@ \ No newline at end of file diff --git a/jiuyi2/components/news/msgList.vue b/jiuyi2/components/news/msgList.vue index ab9a87cf..debed427 100644 --- a/jiuyi2/components/news/msgList.vue +++ b/jiuyi2/components/news/msgList.vue @@ -54,17 +54,32 @@ const systemRightOption = [{ backgroundColor: '#00ADEE' }, },] +// 传入参数 +const props = defineProps({ + // 类型 + type: { + type: Number, + default: 0, + }, +}) // 用户列表 const list = reactive([]) onMounted(() => { - getList() + if (props.type == 0) { + getList() + } else if(props.type == 1) { + // 视频消息 + } else if (props.type == 2) { + // 商城消息 + } + addListener() }) onUnmounted(() => { - removeListener() + // removeListener() }) // 开启监听消息 @@ -81,7 +96,7 @@ function removeListener() { uni.$chat.on(TencentCloudChat.EVENT.CONVERSATION_LIST_UPDATED); } -// 获取朋友列表 +// 获取消息列表 function getList() { api.news.getMessageList({ query: { @@ -97,6 +112,17 @@ function getList() { showCancel: false, }) }) + + // // 验证sdk是否准备完毕 + // let isReady = uni.$chat.isReady(); + // if (!isReady) { + // setTimeout(function () { + // getList(); + // }, 1000); + // return + // } + + // uni.$chat.getMessageList({}) } /** @@ -144,7 +170,7 @@ function getGroupNoReadNum(groupId) { if (!isReady) { setTimeout(function () { getGroupNoReadNum(groupId); - }, 200); + }, 800); return } @@ -187,7 +213,8 @@ function handleChat(item) { param.msgId = `${item.groupId}` param.num = `${item.groupChatDTO.memberCount}` } - // + + setRead(item) util.toChat(param) } @@ -209,7 +236,7 @@ function delMsg(item) { if (!isReady) { setTimeout(function () { delMsg(item); - }, 200); + }, 800); return } @@ -227,7 +254,7 @@ function setRead(item) { if (!isReady) { setTimeout(function () { setRead(item); - }, 200); + }, 800); return } @@ -297,7 +324,7 @@ function setRead(item) { - +