|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="message-bg" v-if="list.length">
|
|
|
- <div class="message-main clickable" :style="{ height: setHeight + 'vw' }">
|
|
|
+ <div class="message-main clickable">
|
|
|
<div class="message-unread" v-if="msgData.unread > 0">
|
|
|
{{ setUnRead }}条未读
|
|
|
</div>
|
|
@@ -18,7 +18,7 @@
|
|
|
>
|
|
|
<div
|
|
|
class="message-item"
|
|
|
- style="height: 26px"
|
|
|
+ style="height: 24px"
|
|
|
v-for="(item, index) in list"
|
|
|
:key="index"
|
|
|
:class="{ visited: item.visited }"
|
|
@@ -31,9 +31,9 @@
|
|
|
<span class="time">{{ item.time }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="icon-box" @click="goMore">
|
|
|
- <AppIcon name="youbian" />
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="icon-box" @click="goMore">
|
|
|
+ <AppIcon name="youbian" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -84,9 +84,9 @@ export default {
|
|
|
setHeight() {
|
|
|
const height = !this.msgData.unread
|
|
|
if (height) {
|
|
|
- return 76 / 3.75
|
|
|
+ return 70 / 3.75
|
|
|
} else {
|
|
|
- return 82 / 3.75
|
|
|
+ return 76 / 3.75
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -113,15 +113,16 @@ export default {
|
|
|
return decimalValue ? decimalValue[0] : ''
|
|
|
},
|
|
|
startScrolling() {
|
|
|
+ const offsetY = 24
|
|
|
let listItem
|
|
|
if (this.$refs.listItem) {
|
|
|
listItem = this.$refs.listItem[1] // 列表项高度
|
|
|
} else {
|
|
|
listItem = {
|
|
|
- offsetHeight: 26
|
|
|
+ offsetHeight: offsetY
|
|
|
}
|
|
|
}
|
|
|
- const listItemHeight = (listItem?.offsetHeight || 26) * 2
|
|
|
+ const listItemHeight = (listItem?.offsetHeight || offsetY) * 2
|
|
|
this.groupHeight = (this.list.length / 2) * listItemHeight
|
|
|
this.scrollInterval = setInterval(() => {
|
|
|
this.offsetHeight += listItemHeight // 每次滚动的距离,根据需求调整
|
|
@@ -238,13 +239,14 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
.message-bg {
|
|
|
background-color: #f5f6f7;
|
|
|
- padding: 8px 12px;
|
|
|
+ padding: 12px 8px;
|
|
|
}
|
|
|
.message-main {
|
|
|
position: relative;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
+ padding: 15px 0 9px;
|
|
|
height: 100%;
|
|
|
background-color: #fff;
|
|
|
border-radius: 12px;
|
|
@@ -253,12 +255,12 @@ export default {
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
- padding: 0 6px;
|
|
|
+ padding: 0 10px;
|
|
|
width: fit-content;
|
|
|
line-height: 15px;
|
|
|
background: #fb483d;
|
|
|
color: #fff;
|
|
|
- border-radius: 40px 40px 40px 0;
|
|
|
+ border-radius: 40px 0 40px 0;
|
|
|
font-size: 11px;
|
|
|
}
|
|
|
}
|
|
@@ -318,14 +320,16 @@ export default {
|
|
|
color: #9b9ca3;
|
|
|
}
|
|
|
}
|
|
|
- .icon-box {
|
|
|
- margin-top: 10px;
|
|
|
- flex-shrink: 0;
|
|
|
- padding: 8px 0 8px 8px;
|
|
|
- }
|
|
|
.icon-youbian {
|
|
|
font-size: 16px;
|
|
|
color: #c0c4cc;
|
|
|
}
|
|
|
}
|
|
|
+.icon-box {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ right: 12px;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ z-index: 2;
|
|
|
+}
|
|
|
</style>
|