Zlpt_Portal_h5/src/pages/message/index.vue

111 lines
3.0 KiB
Vue
Raw Normal View History

2024-12-13 15:30:11 +08:00
<template>
<!-- 消息 -->
2024-12-23 10:10:56 +08:00
<view class="h5-container message">
<view
style="
padding: 15px;
display: flex;
align-items: center;
justify-content: space-between;
"
>
<view>
<text style="color: #000"> 消息 </text>
<text> (3) </text>
</view>
<view>
<van-icon name="guide-o" />
<text> 清除未读 </text>
</view>
</view>
<scroll-view scroll-y>
<van-cell-group inset style="flex: 1">
<view
class="message-items"
v-for="item in 20"
:key="item"
@click="onJumpToMessagePages"
>
<van-image
round
fit="cover"
width="48px"
height="48px"
src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
/>
<view style="flex: 1">
<view class="message-list">
<text style="font-weight: bold"> 老张租赁 </text>
<text> 912 </text>
</view>
<view class="message-list message-info">
<text> 公司洽谈··· </text>
<text class="message-count"> 2 </text>
</view>
</view>
</view>
</van-cell-group>
</scroll-view>
</view>
2024-12-13 15:30:11 +08:00
</template>
<script setup>
import { ref } from 'vue'
2024-12-23 10:10:56 +08:00
import { useMemberStore } from '@/stores/index.js'
import { onLoad } from '@dcloudio/uni-app'
const memberStore = useMemberStore()
const userName = ref('')
const userAccount = ref('')
onLoad(() => {
userName.value = memberStore.userInfo.nickName
userAccount.value = memberStore.userInfo.userName
})
const onJumpToMessagePages = () => {
uni.navigateTo({ url: '/pages/message-pages/index' })
}
2024-12-13 15:30:11 +08:00
</script>
2024-12-23 10:10:56 +08:00
<style lang="scss" scoped>
.message {
padding: 10px 0;
color: #333;
box-sizing: border-box;
background: linear-gradient(to bottom, #c0e9ce, #e4f2f2, #f9f9f9);
}
:deep(.van-cell-group--inset) {
padding: 15px;
}
.message-items {
padding: 4px 0;
display: flex;
align-items: center;
border-bottom: 1px solid #ccc;
.message-list {
width: 100%;
padding: 4px 0 4px 10px;
display: flex;
align-items: center;
justify-content: space-between;
.message-count {
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
border-radius: 10px;
background-color: #df534d;
color: #fff;
}
}
.message-info {
font-size: 14px;
color: #ccc;
}
2024-12-13 15:30:11 +08:00
}
</style>