Merge remote-tracking branch 'origin/develop' into develop

master^2
YunaiV 2024-11-20 09:18:57 +08:00
commit cb8431fbd4
2 changed files with 27 additions and 42 deletions

View File

@ -65,16 +65,15 @@
alignItems: 'center',
}); //
const queryParams = reactive({
pageNo: 1, //
pageSize: 20,
no: 1, //
limit: 20,
createTime: undefined,
});
const pagingRef = ref(null); //
const queryList = async (pageNo, pageSize) => {
const queryList = async (no, limit) => {
//
// pageNopageSize
queryParams.pageNo = pageNo;
queryParams.pageSize = pageSize;
queryParams.no = no;
queryParams.limit = limit;
await getMessageList();
};
//
@ -84,7 +83,7 @@
pagingRef.value.completeByNoMore([], true);
return;
}
if (queryParams.pageNo > 1 && refreshMessage.value) {
if (queryParams.no > 1 && refreshMessage.value) {
const newMessageList = [];
for (const message of data) {
if (messageList.value.some((val) => val.id === message.id)) {
@ -98,9 +97,10 @@
refreshMessage.value = false; //
return;
}
// createTime
queryParams.createTime = formatDate(data.at(-1).createTime);
if (data.slice(-1).length > 0) {
// createTime
queryParams.createTime = formatDate(data.slice(-1)[0].createTime);
}
pagingRef.value.completeByNoMore(data, false);
};
/** 刷新消息列表 */
@ -115,7 +115,7 @@
}
//
if (queryParams.pageNo > 1) {
if (queryParams.no > 1) {
showNewMessageTip.value = true;
} else {
onScrollToUpper();
@ -130,7 +130,7 @@
/** 监听滚动到底部事件(因为 scroll 翻转了顶就是底) */
const onScrollToUpper = () => {
//
if (queryParams.pageNo === 1) {
if (queryParams.no === 1) {
return;
}
showNewMessageTip.value = false;

View File

@ -68,10 +68,12 @@
</view>
</template>
<template v-if="message.contentType === KeFuMessageContentTypeEnum.PRODUCT">
<div class="ss-m-b-10">
<GoodsItem
:goodsData="getMessageContent(message)"
@tap="sheep.$router.go('/pages/goods/index', { id: getMessageContent(message).spuId })"
/>
</div>
</template>
<template v-if="message.contentType === KeFuMessageContentTypeEnum.ORDER">
<OrderItem
@ -84,7 +86,7 @@
v-if="message.senderType === UserTypeEnum.MEMBER"
class="chat-avatar ss-m-l-24"
:src="
sheep.$url.cdn(message.senderAvatar) ||
sheep.$url.cdn(userInfo.avatar) ||
sheep.$url.static('/static/img/shop/chat/default.png')
"
mode="aspectFill"
@ -122,7 +124,9 @@
default: () => [],
},
});
const getMessageContent = computed(() => (item) => jsonParse(item.content)); //
const userInfo = computed(() => sheep.$store('user').userInfo);
//======================= =======================
@ -145,7 +149,7 @@
let emojiFile = selEmojiFile(item);
newData = newData.replace(
item,
`<img class="chat-img" style="width: 24px;height: 24px;margin: 0 3px;" src="${sheep.$url.cdn(
`<img class="chat-img" style="width: 24px;height: 24px;margin: 0 3px;vertical-align: middle;" src="${sheep.$url.cdn(
'/static/img/chat/emoji/' + emojiFile,
)}"/>`,
);
@ -167,7 +171,7 @@
<style scoped lang="scss">
.message-item {
margin-bottom: 33rpx;
margin-bottom: 10rpx;
}
.date-message,
@ -231,18 +235,23 @@
.message-box {
max-width: 50%;
font-size: 16px;
line-height: 20px;
white-space: normal;
word-break: break-all;
word-wrap: break-word;
padding: 20rpx;
border-radius: 10rpx;
color: #fff;
background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
margin-top: 18px;
margin-bottom: 9px;
border-top-left-radius: 10px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
&.admin {
background: #fff;
color: #333;
margin-top: 18px;
margin-bottom: 9px;
border-radius: 0 10px 10px 10px;
}
:deep() {
@ -270,30 +279,6 @@
border-radius: 6rpx;
}
.template-wrap {
// width: 100%;
padding: 20rpx 24rpx;
background: #fff;
border-radius: 10rpx;
.title {
font-size: 26rpx;
font-weight: 500;
color: #333;
margin-bottom: 29rpx;
}
.item {
font-size: 24rpx;
color: var(--ui-BG-Main);
margin-bottom: 16rpx;
&:last-of-type {
margin-bottom: 0;
}
}
}
.error-img {
width: 400rpx;
height: 400rpx;