Files
app-govern/pages/message/steady.vue

106 lines
2.9 KiB
Vue
Raw Normal View History

2023-09-18 14:19:09 +08:00
<template>
2023-09-21 15:15:17 +08:00
<Cn-page :loading="loading">
<view class="content" slot="body">
2023-09-22 13:39:19 +08:00
<uni-list :border="false">
<uni-list-item
isDot
show-badge
badgeType="error"
:badge-text="item.status == 1 ? '' : '未读'"
:title="item.showName"
:note="item.startTime"
@click="jump(item)"
clickable
v-for="(item, index) in store.data"
/>
</uni-list>
2023-09-21 15:15:17 +08:00
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more>
</view>
</Cn-page>
2023-09-18 14:19:09 +08:00
</template>
2023-09-22 13:39:19 +08:00
2023-09-18 14:19:09 +08:00
<script>
2023-09-18 19:23:27 +08:00
import list from '@/common/js/list'
2023-10-09 16:12:27 +08:00
import { updateStatus } from '@/common/api/message'
2023-09-18 15:55:34 +08:00
2023-09-18 14:19:09 +08:00
export default {
2023-09-18 15:55:34 +08:00
mixins: [list],
data() {
2023-09-18 14:19:09 +08:00
return {
2023-09-18 15:55:34 +08:00
loading: true,
2023-09-18 14:19:09 +08:00
}
},
2023-09-18 15:55:34 +08:00
onShow() {
this.init()
2023-09-18 14:19:09 +08:00
},
2023-10-09 16:12:27 +08:00
onNavigationBarButtonTap(e) {
uni.showModal({
title: '提示',
content: '确定要全部标记为已读吗?',
success: (res) => {
if (res.confirm) {
updateStatus({
type: 1,
eventIds:[]
}).then(() => {
this.store.reload()
})
}
},
})
},
2023-09-18 14:19:09 +08:00
methods: {
2023-09-18 19:23:27 +08:00
async init() {
let dictData = await this.$util.getDictData('app_event')
2023-09-18 15:55:34 +08:00
console.log(dictData)
2023-09-28 16:30:07 +08:00
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
2023-09-18 15:55:34 +08:00
this.store.params.type = 1
this.store.firstCallBack = (res) => {
2023-09-22 13:39:19 +08:00
// this.store.data.forEach((item) => {
// item.title = dictData.find((item2) => item2.code === item.tag)?.name
// })
// console.log(this.store.data)
2023-09-18 15:55:34 +08:00
this.loading = false
}
this.store.reload()
},
jump(item) {
2023-09-18 19:23:27 +08:00
let str = JSON.stringify(item).replace(/%/g, '百分比')
2023-09-22 13:39:19 +08:00
uni.navigateTo({ url: '/pages/message/steadyDetail?detail=' + encodeURIComponent(str) })
2023-09-18 15:55:34 +08:00
},
2023-09-18 19:23:27 +08:00
},
2023-09-18 14:19:09 +08:00
}
</script>
<style lang="scss">
.content {
2023-09-22 13:39:19 +08:00
// padding-top: 20rpx;
}
.term-list-bottom {
.term-list-bottom-item {
font-size: 28rpx;
margin-bottom: 10rpx;
display: flex;
justify-content: space-between;
// view:first-of-type{
// color: #111;
// }
}
.term-list-bottom-item:last-of-type {
margin-bottom: 0;
}
2023-09-18 14:19:09 +08:00
}
/deep/ .uni-list-item {
background-color: $uni-theme-white !important;
}
2023-09-22 13:39:19 +08:00
/deep/ .uni-card__header-extra-text {
2023-09-18 14:19:09 +08:00
color: #dd524d !important;
2023-09-22 13:39:19 +08:00
font-size: 20rpx;
2023-09-18 14:19:09 +08:00
}
</style>