107 lines
3.0 KiB
Vue
107 lines
3.0 KiB
Vue
<template>
|
|
<Cn-page :loading="loading">
|
|
<view class="content" slot="body">
|
|
<uni-card
|
|
:title="item.showName"
|
|
:extra="item.status == '1' ? '' : '未读'"
|
|
:sub-title="item.startTime"
|
|
@click="jump(item)"
|
|
v-for="(item, index) in store.data"
|
|
:key="index"
|
|
>
|
|
<view class="term-list-bottom">
|
|
<view class="term-list-bottom-item" v-for="(item2, textIndex) in item.dataSet" :key="textIndex">
|
|
{{ item2.showName + ':' + (item2.value == 3.1415926 ? '-' : item2.value) + (item2.unit || '') }}
|
|
</view>
|
|
</view>
|
|
</uni-card>
|
|
<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>
|
|
</template>
|
|
|
|
<script>
|
|
import list from '@/common/js/list'
|
|
import { updateStatus } from '@/common/api/message'
|
|
|
|
export default {
|
|
mixins: [list],
|
|
data() {
|
|
return {
|
|
loading: true,
|
|
}
|
|
},
|
|
onShow() {
|
|
this.init()
|
|
},
|
|
onNavigationBarButtonTap(e) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
content: '确定要全部标记为已读吗?',
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
updateStatus({
|
|
type: 0,
|
|
eventIds:[]
|
|
}).then(() => {
|
|
this.store.reload()
|
|
})
|
|
}
|
|
},
|
|
})
|
|
},
|
|
methods: {
|
|
async init() {
|
|
let dictData = await this.$util.getDictData('app_event')
|
|
console.log(dictData)
|
|
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
|
|
this.store.params.type = 0
|
|
this.store.firstCallBack = (res) => {
|
|
// this.store.data.forEach((item) => {
|
|
// item.title = dictData.find((item2) => item2.code === item.tag)?.name
|
|
// })
|
|
// console.log(this.store.data)
|
|
this.loading = false
|
|
}
|
|
this.store.reload()
|
|
},
|
|
jump(item) {
|
|
let str = JSON.stringify(item).replace(/%/g, '百分比')
|
|
uni.navigateTo({ url: '/pages/message/transientDetail?detail=' + encodeURIComponent(str) })
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.content {
|
|
// 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;
|
|
}
|
|
}
|
|
|
|
/deep/ .uni-list-item {
|
|
background-color: $uni-theme-white !important;
|
|
}
|
|
|
|
/deep/ .uni-card__header-extra-text {
|
|
color: #dd524d !important;
|
|
font-size: 20rpx;
|
|
}
|
|
</style>
|