82 lines
1.6 KiB
Vue
82 lines
1.6 KiB
Vue
<template>
|
||
<view style="padding: 12rpx 16rpx;">
|
||
<view class="xwD_title">
|
||
{{detailList.title}}
|
||
</view>
|
||
<view style="display: flex;">
|
||
<text class="xwD_time">
|
||
{{detailList.pub_time}}
|
||
</text>
|
||
<text class="xwD_time xwD_place">
|
||
{{detailList.pub_name}}
|
||
</text>
|
||
</view>
|
||
<view class="xwD_content">
|
||
<u-parse :content="detailList.content" @preview="preview" @navigate="navigate"></u-parse>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
data() {
|
||
return {
|
||
id: '',
|
||
detailList: []
|
||
// title: '2022近50款食品饮料新品,创新的方向都在这里',
|
||
// time: '2022-12-03 09:59',
|
||
// place: '第一食品资讯官方账号',
|
||
// news: '<h1>一级标题</h1><br/><h2>二级标题</h2>'
|
||
}
|
||
},
|
||
onLoad(option) {
|
||
console.log('新闻详情id', option.id);
|
||
this.id = option.id
|
||
this.getNewsDetail()
|
||
},
|
||
methods: {
|
||
//获取行业新闻详情
|
||
getNewsDetail() {
|
||
this.$apiServe.getNewsDetail(this.id).then(res => {
|
||
console.log('新闻详情页', res.data.data)
|
||
|
||
this.detailList = res.data.data
|
||
}).finally(_ => {})
|
||
},
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
page {
|
||
background-color: #fff;
|
||
}
|
||
|
||
.xwD_title {
|
||
font-size: 38rpx;
|
||
font-family: PingFangSC-Medium, PingFang SC;
|
||
font-weight: bold;
|
||
color: #3E3E3E;
|
||
line-height: 53rpx;
|
||
letter-spacing: 1rpx;
|
||
}
|
||
|
||
.xwD_time {
|
||
font-size: 24rpx;
|
||
font-family: PingFangSC-Regular, PingFang SC;
|
||
font-weight: 400;
|
||
color: #969696;
|
||
line-height: 33rpx;
|
||
margin-top: 6rpx;
|
||
}
|
||
|
||
.xwD_place {
|
||
padding-left: 20rpx;
|
||
}
|
||
|
||
.xwD_content {
|
||
margin-top: 38rpx;
|
||
// border: none;
|
||
}
|
||
</style>
|