oneNewsDetails.vue
2.7 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<template>
<view class="oneNewsDetails">
<!-- 中志要闻 详情 -->
<view class="header-wrap"></view>
<view class="news-wrap area">
<view class="news-item area flex">
<view>
<view class="news-day flex">
<view class="spot"></view>
<view class="news-day-time">
{{datas.create_time}}
</view>
</view>
<view class="news-text text-retain">
{{datas.title}}
</view>
</view>
</view>
<view class="detail-text" v-html="datas.content">
<!-- {{detail}} -->
</view>
</view>
</view>
</template>
<script>
import Vue from 'vue'
import {
mapState,
mapMutations
} from 'vuex'
var that
export default {
data() {
return {
options:'',
datas:''
}
},
onLoad(e) {
that=this
that.options=e||{}
console.log(e)
// uni.setNavigationBarTitle({
// title: 'hweohwrh'
// })
that.getdata()
},
methods: {
getdata() {
var datas = {
id:that.options.id
}
var jkurl = '/student/news_detail'
that.$service.P_post(jkurl, datas).then(res => {
that.btnkg = 0
console.log(res)
if (res.code == 1) {
that.htmlReset = 0
var datas = res.data
console.log(typeof datas)
if (typeof datas == 'string') {
datas = JSON.parse(datas)
}
console.log(res)
that.datas=datas
} else {
if (res.msg) {
uni.showToast({
icon: 'none',
title: res.msg
})
} else {
uni.showToast({
icon: 'none',
title: '获取数据失败'
})
}
}
}).catch(e => {
that.htmlReset = 1
that.btnkg = 0
// that.$refs.htmlLoading.htmlReset_fuc(1)
console.log(e)
uni.showToast({
icon: 'none',
title: '获取数据失败,请检查您的网络连接'
})
})
},
}
}
</script>
<style lang="scss" scoped>
.oneNewsDetails {
position: relative;
}
.news-wrap {
height: auto;
border-radius: 20rpx;
background: #FFFFFF;
position: absolute;
top: 28rpx;
left: 50%;
transform: translate(-50%, 0);
}
.news-item {
height: 196rpx;
margin-bottom: 20rpx;
border-bottom: 1px solid #EEEEEE;
align-items: center;
padding: 0 34rpx;
.news-day {
height: 28rpx;
line-height: 28rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #A9B1C0;
margin-bottom: 20rpx;
align-items: center;
.news-day-time {
margin-left: 12rpx;
}
}
.news-text {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #545D71;
}
}
.detail-text {
height: auto;
line-height: 50rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: #9699A9;
padding: 30rpx 32rpx 24rpx 32rpx;
}
</style>