历史记录暂时提交

feasure-livedata
lld 2026-03-26 14:02:55 +08:00
parent 2d33b67618
commit ff06714223
1 changed files with 49 additions and 28 deletions

View File

@ -46,37 +46,38 @@
</view>
</view>
<!-- 消息列表 -->
<view class="message-list">
<view
<uni-swipe-action ref="swipeAction" class="message-list">
<uni-swipe-action-item
v-for="(item, index) in messageList"
:right-options="options"
:key="index"
class="message-item"
@click="handleItemClick(item)"
@click="deleteItem($event, index)"
>
<view class="item-icon-wrap">
<view class="item-icon" :style="{ backgroundColor: item.iconBg }">
<image mode="aspectFit" :style="{width: item.width,
<view class="message-item" @click="handleItemClick(item)">
<view class="item-icon-wrap">
<view class="item-icon" :style="{ backgroundColor: item.iconBg }">
<image mode="aspectFit" :style="{width: item.width,
height: '70rpx' }" :src="item.imgUrl" />
</view>
<view v-if="item.badge" class="item-badge"></view>
</view>
<view v-if="item.badge" class="item-badge"></view>
</view>
<view class="item-content">
<view class="item-title">{{ item.title }}</view>
<view class="item-desc">{{ item.desc }}</view>
</view>
<!-- 右侧时间+角标列 -->
<view class="item-right">
<view class="item-time">
<uni-dateformat :date="item.time" :format="isTodayDate(item.time)?'hh:mm':'yyyy-MM-dd hh:mm:ss'"
:threshold="[60000, 3600000]"></uni-dateformat>
<view class="item-content">
<view class="item-title">{{ item.title }}</view>
<view class="item-desc">{{ item.desc }}</view>
</view>
<view v-if="item.numBadge" class="num-badge">
<uni-badge :text="item.numBadge" type="error" size="mini" />
<!-- 右侧时间+角标列 -->
<view class="item-right">
<view class="item-time">
<uni-dateformat :date="item.time" :format="isTodayDate(item.time)?'hh:mm':'yyyy-MM-dd hh:mm:ss'"
:threshold="[60000, 3600000]"></uni-dateformat>
</view>
<view v-if="item.numBadge">
<uni-badge :text="item.numBadge" type="error" size="mini" />
</view>
</view>
</view>
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<!-- 底部提示 -->
<uni-divider-text margin="10rpx 0"
@ -141,38 +142,59 @@ export default {
numBadge: 25, //
width: '100rpx'
}
]
],
options: [{
text: '置顶',
style: {
backgroundColor: '#FFA726'
}
},
{
text: '删除',
style: {
backgroundColor: '#E83A30'
}
}
],
}
},
methods: {
isTodayDate,
navBack() {
this.$modal.showToast('模块建设中~')
console.log('返回上一页')
},
clearUnread() {
this.$modal.showToast('模块建设中~')
console.log('清除未读')
},
openSetting() {
this.$modal.showToast('模块建设中~')
console.log('打开通知设置')
},
goToOpen() {
this.$modal.showToast('模块建设中~')
console.log('去开启系统通知')
},
goToClose() {
this.$modal.showToast('模块建设中~')
console.log('关闭系统通知')
},
goToSubscribe() {
this.$modal.showToast('模块建设中~')
console.log('进入消息订阅')
},
goToAI() {
this.$modal.showToast('模块建设中~')
console.log('进入AI识别')
},
handleItemClick(item) {
this.$modal.showToast('敬请期待~')
console.log('点击消息:', item.title)
},
switchTab(tab) {
console.log('切换到:', tab)
// uni.switchTab
deleteItem(event, index) {
this.$modal.showToast('敬请期待~')
console.log('删除消息:', event, index)
}
}
}
@ -362,7 +384,6 @@ export default {
.item-time {
font-size: 26rpx;
color: #999;
margin-bottom: 8rpx;
}
}
}