1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <template>
- <view style="background-color: #fff;">
- <u-navbar title="文章详情"></u-navbar>
- <view class="main">
- <view class="new-title">
- {{newsDetail.title}}
- </view>
- <view class="time">
- <view class="time-left">
- {{newsDetail.createTime}}
- </view>
- <view class="time-tight">
- <text class="iconfont"></text><text class="num">{{newsDetail.readNum}}</text>
- </view>
- </view>
- <view class="news-content">
- {{newsDetail.content}}
- </view>
- </view>
- </view>
- </template>
- <script>
- import * as newsApi from '@/apis/news.js'
-
- export default {
- data() {
- return {
- id: '',
- newsDetail: '',
- }
- },
- onLoad(op) {
- this.id =op.id;
-
- this.getNewsInfoDetail();
- },
- methods: {
- getNewsInfoDetail() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- newsApi.newsInfoDetail(this.id).then((res) => {
- uni.hideLoading()
- this.newsDetail = res.data;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .main{
-
- margin: 0px 16px ;
- padding-bottom: 34px;
- .new-title{
- color: #101010;
- font-size: 18px;
- height: 48px;
- margin: 16px 0 35px;
- }
- .time{
- display: flex;
- justify-content: space-between;
- color: #888888;
- .num{
- margin-left: 4px;
- }
-
- }
- .news-content{
- margin-top: 13px;
- font-size: 14px;
- line-height: 28px;
- color: #101010;
- }
- }
- </style>
|