|
@@ -1,62 +1,50 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view class="msg_list_content">
|
|
|
|
|
- <!-- <uni-collapse>
|
|
|
|
|
- <uni-collapse-item title-border="show" :border="true" :show-animation="anime" :open="unReadNum > 0 || false">
|
|
|
|
|
- <template v-slot:title>
|
|
|
|
|
- <uni-section :title="title" type="line" titleFontSize="1.3rem">
|
|
|
|
|
- <template v-slot:right>
|
|
|
|
|
- <uni-badge :text="unReadNum" v-if="unReadNum!==undefined&&unReadNum>0"></uni-badge>
|
|
|
|
|
- <button @click.stop="clickReadButton" class="read_button" v-if="unReadNum!==undefined" :disabled="unReadNum===0?true:false">一键阅读</button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </uni-section>
|
|
|
|
|
- </template> -->
|
|
|
|
|
- <View style="height: 69.5vh;">
|
|
|
|
|
- <z-paging :fixed="false" @query="queryData" :value="list" :default-page-size="pSize"
|
|
|
|
|
- :default-page-no="pageNo" ref="paging">
|
|
|
|
|
- <template #top>
|
|
|
|
|
- <view v-if="props.segments" class="segmented_control_container">
|
|
|
|
|
- <uni-segmented-control :current="current" :values="segmentKeys" @clickItem="onClickItem"
|
|
|
|
|
- styleType="text" activeColor="#409eff"></uni-segmented-control>
|
|
|
|
|
- </view>
|
|
|
|
|
- </template>
|
|
|
|
|
- <view @click="handleToDetail(message)" v-for="(message, index) in list" :key="index"
|
|
|
|
|
- :class="message.isread == 'Y' || message.if_read ? ' ' : 'message_container_unread'"
|
|
|
|
|
- class="message_container">
|
|
|
|
|
- <uni-card :is-full="true" padding="5px 10px">
|
|
|
|
|
- <template v-slot:title>
|
|
|
|
|
- <uni-row>
|
|
|
|
|
- <view class="message_top_container">
|
|
|
|
|
- <text class="message_user">
|
|
|
|
|
- {{ message.name }}
|
|
|
|
|
- </text>
|
|
|
|
|
|
|
+ <view class="msg_list_container">
|
|
|
|
|
+ <View style="height: 63.5vh;">
|
|
|
|
|
+ <z-paging :fixed="false" @query="queryData" :value="list" :default-page-size="pSize"
|
|
|
|
|
+ :default-page-no="pageNo" ref="paging">
|
|
|
|
|
+ <template #top>
|
|
|
|
|
+ <view v-if="props.segments" class="segmented_control_container">
|
|
|
|
|
+ <uni-segmented-control :current="current" :values="segmentKeys" @clickItem="onClickItem"
|
|
|
|
|
+ styleType="text" activeColor="#409eff"></uni-segmented-control>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <view @click="handleToDetail(message)" v-for="(message, index) in list" :key="index"
|
|
|
|
|
+ :class="message.isread == 'Y' || message.if_read ? ' ' : 'message_container_unread'"
|
|
|
|
|
+ class="message_container">
|
|
|
|
|
+ <uni-card :is-full="true" padding="5px 10px">
|
|
|
|
|
+ <template v-slot:title>
|
|
|
|
|
+ <uni-row>
|
|
|
|
|
+ <view class="message_top_container">
|
|
|
|
|
+ <text class="message_user">
|
|
|
|
|
+ {{ message.name }}
|
|
|
|
|
+ </text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </uni-row>
|
|
|
|
|
+ <uni-row>
|
|
|
|
|
+ <view class="message_mid_container">
|
|
|
|
|
+ <uni-col :xs="18" :sm="20">
|
|
|
|
|
+ <view class="message_title uni-ellipsis">
|
|
|
|
|
+ {{ message.title }}
|
|
|
</view>
|
|
</view>
|
|
|
- </uni-row>
|
|
|
|
|
- <uni-row>
|
|
|
|
|
- <view class="message_mid_container">
|
|
|
|
|
- <uni-col :xs="18" :sm="20">
|
|
|
|
|
- <view class="message_title hidden_over">
|
|
|
|
|
- {{ message.title }}
|
|
|
|
|
- </view>
|
|
|
|
|
- </uni-col>
|
|
|
|
|
- <uni-col :xs="6" :sm="4">
|
|
|
|
|
- <view class="message_time">
|
|
|
|
|
- {{ formatDate(message.sendtime) }}
|
|
|
|
|
- </view>
|
|
|
|
|
- </uni-col>
|
|
|
|
|
|
|
+ </uni-col>
|
|
|
|
|
+ <uni-col :xs="6" :sm="4">
|
|
|
|
|
+ <view class="message_time">
|
|
|
|
|
+ {{ formatDate(message.sendtime) }}
|
|
|
</view>
|
|
</view>
|
|
|
- </uni-row>
|
|
|
|
|
- </template>
|
|
|
|
|
- <view v-if="message.content" class="message_bottom_container">
|
|
|
|
|
- <text class="message_content hidden_over">
|
|
|
|
|
- {{ message.content }}
|
|
|
|
|
- </text>
|
|
|
|
|
|
|
+ </uni-col>
|
|
|
</view>
|
|
</view>
|
|
|
- </uni-card>
|
|
|
|
|
|
|
+ </uni-row>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <view v-if="message.content" class="message_bottom_container">
|
|
|
|
|
+ <text class="message_content uni-ellipsis">
|
|
|
|
|
+ {{ message.content }}
|
|
|
|
|
+ </text>
|
|
|
</view>
|
|
</view>
|
|
|
- </z-paging>
|
|
|
|
|
- </View>
|
|
|
|
|
- <!-- </uni-collapse-item>
|
|
|
|
|
- </uni-collapse> -->
|
|
|
|
|
|
|
+ </uni-card>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </z-paging>
|
|
|
|
|
+ </View>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -70,7 +58,7 @@ const props = defineProps({
|
|
|
segments: { type: Array, default: undefined }, // 分段器数据
|
|
segments: { type: Array, default: undefined }, // 分段器数据
|
|
|
pSize: { type: Number, default: 10 }, // 分页大小
|
|
pSize: { type: Number, default: 10 }, // 分页大小
|
|
|
pageNo: { type: Number, default: 1 }, // 默认页
|
|
pageNo: { type: Number, default: 1 }, // 默认页
|
|
|
- defaultCurrent: {type: Number, default: 0}, // 默认选中项
|
|
|
|
|
|
|
+ defaultCurrent: { type: Number, default: 0 }, // 默认选中项
|
|
|
// unReadNum: { type: Number, default: undefined }, // 未读消息数
|
|
// unReadNum: { type: Number, default: undefined }, // 未读消息数
|
|
|
})
|
|
})
|
|
|
const emits = defineEmits([
|
|
const emits = defineEmits([
|
|
@@ -93,7 +81,7 @@ onMounted(() => {
|
|
|
// emits('readMsg')
|
|
// emits('readMsg')
|
|
|
// }
|
|
// }
|
|
|
const paging = ref(null)
|
|
const paging = ref(null)
|
|
|
-const totalPage=ref(0)
|
|
|
|
|
|
|
+const totalPage = ref(0)
|
|
|
// 数据列表
|
|
// 数据列表
|
|
|
const list = ref([])
|
|
const list = ref([])
|
|
|
// 加载完成 更新数据
|
|
// 加载完成 更新数据
|
|
@@ -104,12 +92,12 @@ function complete(dataList, total, pageNo) {
|
|
|
}
|
|
}
|
|
|
// 第一页直接加载数据
|
|
// 第一页直接加载数据
|
|
|
if (pageNo === 1) {
|
|
if (pageNo === 1) {
|
|
|
- list.value=dataList
|
|
|
|
|
|
|
+ list.value = dataList
|
|
|
paging.value.complete(dataList)
|
|
paging.value.complete(dataList)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
// 防止重复获取最后一次信息
|
|
// 防止重复获取最后一次信息
|
|
|
- if (props.pSize*pageNo < total) {
|
|
|
|
|
|
|
+ if (props.pSize * pageNo < total) {
|
|
|
paging.value.complete(dataList)
|
|
paging.value.complete(dataList)
|
|
|
} else {
|
|
} else {
|
|
|
paging.value.complete([])
|
|
paging.value.complete([])
|
|
@@ -161,7 +149,7 @@ function scrollQuery(pageNo, pSize) {
|
|
|
type: '',
|
|
type: '',
|
|
|
segmentValue: segmentValues.value[current.value]
|
|
segmentValue: segmentValues.value[current.value]
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
emits('scrollToBottom', params, complete)
|
|
emits('scrollToBottom', params, complete)
|
|
|
}
|
|
}
|
|
|
// 跳转详情
|
|
// 跳转详情
|
|
@@ -199,30 +187,7 @@ defineExpose({
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
-.hidden_over {
|
|
|
|
|
- white-space: nowrap; // 不换行
|
|
|
|
|
- overflow: hidden; // 超出内容隐藏
|
|
|
|
|
- text-overflow: ellipsis; // 超出部分显示省略号
|
|
|
|
|
- display: inline-block;
|
|
|
|
|
- max-width: 100%;
|
|
|
|
|
-}
|
|
|
|
|
-.msg_list_content {
|
|
|
|
|
- .read_button {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- top: 12px;
|
|
|
|
|
- right: 38px;
|
|
|
|
|
- height: 28px;
|
|
|
|
|
- line-height: 28px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- background-color: #007aff;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- }
|
|
|
|
|
- .read_button[disabled] {
|
|
|
|
|
- background-color: #f5f5f5;
|
|
|
|
|
- color: #666;
|
|
|
|
|
- opacity: 0.5;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+.msg_list_container {
|
|
|
.message_container {
|
|
.message_container {
|
|
|
border-left: #7b7b7b .4rem solid;
|
|
border-left: #7b7b7b .4rem solid;
|
|
|
|
|
|
|
@@ -236,7 +201,6 @@ defineExpose({
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.message_mid_container {
|
|
.message_mid_container {
|
|
|
- // padding-top: 10px;
|
|
|
|
|
padding-left: 10px;
|
|
padding-left: 10px;
|
|
|
height: 1.8rem;
|
|
height: 1.8rem;
|
|
|
|
|
|
|
@@ -248,13 +212,14 @@ defineExpose({
|
|
|
.message_time {
|
|
.message_time {
|
|
|
color: #888;
|
|
color: #888;
|
|
|
text-align: right;
|
|
text-align: right;
|
|
|
- font-size: 0.8rem;
|
|
|
|
|
- line-height: 1.8rem;
|
|
|
|
|
|
|
+ font-size: 0.8rem; line-height: 1.8rem;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.message_bottom_container {
|
|
.message_bottom_container {
|
|
|
.message_content {
|
|
.message_content {
|
|
|
|
|
+ max-width: 100%;
|
|
|
|
|
+ display: inline-block;
|
|
|
font-size: 1rem;
|
|
font-size: 1rem;
|
|
|
color: #666;
|
|
color: #666;
|
|
|
}
|
|
}
|