历史记录暂时提交
parent
2d33b67618
commit
ff06714223
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue