844aa73a
杨鑫
'最新'
|
1
2
3
4
|
<template>
<view class="pages">
<view class="contents">
<view class="box" v-for="(item,index) in tableList" @click="getDetail(item.id)">
|
2d926347
wesley88
1
|
5
6
7
8
9
10
11
12
13
14
|
<view style="width:70%">
<view class="title">
{{item.title}}
</view>
<view class="desc">
<!-- <u-parse :html="item.announcementContent"></u-parse> -->
{{item.content}}
</view>
</view>
|
844aa73a
杨鑫
'最新'
|
15
16
17
|
<view class="time">
{{formatDateTime(item.createdAt)}}
</view>
|
2d926347
wesley88
1
|
18
|
|
844aa73a
杨鑫
'最新'
|
19
20
21
22
23
24
25
26
27
|
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
|
2d926347
wesley88
1
|
28
29
30
31
32
|
tableList: [],
pageindex: {
receiverMerchant: '小程序商家',
pageNumber: 1,
pageSize: 10,
|
844aa73a
杨鑫
'最新'
|
33
34
35
|
},
}
},
|
2d926347
wesley88
1
|
36
37
38
|
onLoad(option) {
// this.tableList = JSON.parse(option.item)
|
844aa73a
杨鑫
'最新'
|
39
40
41
42
43
|
},
mounted() {
this.getALL()
},
methods: {
|
2d926347
wesley88
1
|
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
formatDateTime(dateTimeString) {
// 将输入的日期时间字符串转换为Date对象
const inputDate = new Date(dateTimeString);
const now = new Date();
// 获取年、月、日来进行比较
const inputYear = inputDate.getFullYear();
const inputMonth = inputDate.getMonth();
const inputDay = inputDate.getDate();
const currentYear = now.getFullYear();
const currentMonth = now.getMonth();
const currentDay = now.getDate();
// 检查输入的日期是否为今天
const isToday = (inputYear === currentYear) && (inputMonth === currentMonth) && (inputDay === currentDay);
// 格式化时间为HH:mm
const hours = inputDate.getHours().toString().padStart(2, '0');
const minutes = inputDate.getMinutes().toString().padStart(2, '0');
const timeString = `${hours}:${minutes}`;
// 如果是今天,则在时间前面加上'今天'
return isToday ? `今天${timeString}` : timeString;
},
getALL() {
this.$http.sendRequest('/cereMessageNotification/queryByPage', 'POST', this.pageindex, 1).then(res => {
this.tableList = res.data.data.content
})
|
844aa73a
杨鑫
'最新'
|
73
|
},
|
2d926347
wesley88
1
|
74
|
getDetail(id) {
|
844aa73a
杨鑫
'最新'
|
75
|
uni.navigateTo({
|
2d926347
wesley88
1
|
76
|
url: `/pages/procedureList/procedureDetail?ids=${id}`
|
844aa73a
杨鑫
'最新'
|
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
})
},
}
}
</script>
<style lang="scss" scoped>
.pages {
width: 100vw;
height: 100%;
position: relative;
overflow-y: auto;
background-color: #f6f6f6;
.contents {
width: 100%;
|
2d926347
wesley88
1
|
93
|
|
844aa73a
杨鑫
'最新'
|
94
95
96
97
98
99
100
|
background-color: #fff;
margin-top: 20rpx;
.box {
width: 94%;
margin: 0 auto;
padding: 28rpx 0;
|
2d926347
wesley88
1
|
101
|
display: flex;
|
844aa73a
杨鑫
'最新'
|
102
103
|
justify-content: space-between;
align-items: center;
|
2d926347
wesley88
1
|
104
105
|
.title {
|
844aa73a
杨鑫
'最新'
|
106
107
108
|
font-size: 30rpx;
font-weight: bold;
}
|
2d926347
wesley88
1
|
109
110
|
.time {
|
844aa73a
杨鑫
'最新'
|
111
112
113
114
|
margin: 20rpx 0;
color: #888D9C;
font-size: 24rpx;
}
|
2d926347
wesley88
1
|
115
116
|
.desc {
|
844aa73a
杨鑫
'最新'
|
117
118
119
|
color: #888D9C;
font-size: 24rpx;
text-align: justify;
|
2d926347
wesley88
1
|
120
|
margin-top: 10px;
|
60cd6339
杨鑫
'最新'
|
121
122
123
124
125
|
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
text-overflow: ellipsis;
|
844aa73a
杨鑫
'最新'
|
126
127
128
129
130
|
}
}
}
}
</style>
|