Feat:店铺资讯评论

This commit is contained in:
LinCyJang
2025-06-23 00:03:04 +08:00
parent fd7793b3fb
commit 2e6b2d6c62
5 changed files with 316 additions and 10 deletions
+53 -8
View File
@@ -1,8 +1,18 @@
<template>
<view class="common-roomLogs">
<view class="v12-align-center v12-pa-3" @click="toMessage">
<view class="call-message"></view>
<view class="v12-ml-2" style="width: 100%">
<view class="v12-font-bold v12-font-32">互动消息</view>
<view class="v12-secondary-dark-text v12-font-28 v12-mt-3 v12-justify-between">
<text>{{ unreadNum > 0 ? `收到${unreadNum}条回复` : '暂无通知'}}</text>
<view v-if="unreadNum > 0" class="bage-num v12-font-24 v12-primary v12-white-text v12-radius-100">{{ unreadNum > 99 ? '99+' : unreadNum }}</view>
</view>
</view>
</view>
<u-divider></u-divider>
<view v-if="list.length > 0">
<view
>
<u-swipe-action
class="v12-mt-3"
@@ -39,7 +49,7 @@
</view>
</view>
<view class="v4-nodata" v-if="list.length===0">
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
<!-- <image src="@/static/images/img_nodata.png" mode="scaleToFill"/> -->
<view class="text">暂无数据</view>
</view>
</view>
@@ -47,7 +57,7 @@
<script>
import { mapGetters } from 'vuex'
import { getUnreadMessageCount, markMessagesAsRead } from '@/api/rooms'
export default {
name: 'RoomLogs',
data() {
@@ -55,15 +65,34 @@ export default {
webUrl:this.$VUE_APP_RESOURCES_URL,
uid: null,
list: [],
options1: [{text: '删除', style: {color: '#fff', backgroundColor: '#C52733'} }]
options1: [{text: '删除', style: {color: '#fff', backgroundColor: '#C52733'} }],
unreadNum: 0
}
},
computed: mapGetters(['userInfo']),
onShow() {
this.uid = this.userInfo.uid
this.fetchList()
this.getUnreadMessageCount()
},
methods: {
/**
* 去消息
*/
toMessage() {
markMessagesAsRead().then(res => {
uni.navigateTo({url: '/pkg_common/views/message'})
})
},
/**
* 获取互动消息
* @param {*} item
*/
getUnreadMessageCount(item) {
getUnreadMessageCount().then(res => {
this.unreadNum = res.data
})
},
goRoom(item) {
uni.navigateTo({url: `/pkg_common/views/room?id=${item.store_id}&name=${item.store_name}`})
},
@@ -108,6 +137,15 @@ export default {
}
</script>
<style>
.call-message{
width: 120rpx;
height: 120rpx;
background: #C52733;
border-radius: 20rpx;
}
.common-roomLogs{
background: #fff;
}
.common-roomLogs .u-swipe-action-item{
margin-bottom: 20rpx;
}
@@ -148,17 +186,17 @@ export default {
min-height: 100vh;
box-sizing: border-box;
padding: 32rpx;
background: #F5F5F5;
background: #fff;
.item {
border-radius: 8rpx;
background: #FFFFFF;
.cover {
width: 80rpx;
height: 80rpx;
width: 120rpx;
height: 120rpx;
margin-right: 18rpx;
border-radius: 16rpx;
border-radius: 20rpx;
}
.name {
@@ -187,4 +225,11 @@ export default {
}
}
}
.bage-num {
min-width: 40rpx;
height: 40rpx;
text-align: center;
box-sizing: border-box;
padding: 4rpx;
}
</style>