index.vue
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
73
74
75
76
<template>
<div class='container'>
<p class="title">{{title}}</p>
<div class="info">
<p>{{content}}</p>
</div>
<p class="inscribe">{{createDate}}</p>
<p class="inscribe">{{name}}</p>
</div>
</template>
<script>
export default {
data() {
return {
news: null,
title: '',
content: '',
createDate: '',
name: ''
}
},
methods: {
getNewsById() {
wx.request({
url: this.rootUrl + '/message/getSysNewsById',
data: { sessionID: wx.getStorageSync('sessionID'),
id: this.$root.$mp.query.id},
success: res => {
console.log(res.data)
this.news = res.data
this.createDate = this.service.correctTime(res.data.createDate,'full')
this.title = res.data.title
this.content = res.data.content
this.name = res.data.name
}
})
}
},
onShow() {
this.getNewsById()
}
}
</script>
<style lang="stylus" scoped>
.container
position absolute
Height_Width(100%)
background-color #fff
padding 30rpx
box-sizing border-box
.title
margin-bottom 30rpx
font-size 34rpx
color #000
font-weight bold
line-height 60rpx
overflow hidden
text-overflow ellipsis
display -webkit-box
-webkit-line-clamp 2
-webkit-box-orient vertical
.info
margin 30rpx 0
color #333
font-size 30rpx
line-height 60rpx
.info p
text-indent 60rpx
.inscribe
color #666
font-size 30rpx
text-align right
line-height 60rpx
</style>