1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <template>
- <view style="background-color: #fff;">
- <u-navbar title="详情"></u-navbar>
- <view class="main">
-
- <view style="font-size: 32rpx;margin: 18rpx 0;font-weight: bold; ">{{newsDetail.title}}</view>
- <view style="display: flex;justify-content: space-between; border-bottom: 1px solid #e6e3e3;color: #888;padding: 8rpx 0;" >
- <view>阅读量:{{newsDetail.readNum}}</view>
- <view style="margin-left: 40rpx;">{{newsDetail.createTime}}</view>
- </view >
- <view class="news-content" v-html="newsDetail.content">
-
- </view>
- </view>
- </view>
- </template>
- <script>
- import * as newsApi from '@/apis/pagejs/message.js'
-
- export default {
- data() {
- return {
- id: '',
- newsDetail: {
-
- },
- }
- },
- onLoad(op) {
- this.id =op.id;
-
- this.getNewsInfoDetail();
- },
-
- methods: {
- getNewsInfoDetail() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- newsApi.newsDetails({
- id:this.id
- }).then((res) => {
- uni.hideLoading()
- this.newsDetail = res.data.newsInfo;
- this.$nextTick(()=>{
- var list =document.getElementsByClassName("news-content")[0].getElementsByTagName("img");
- for(var i=0;i<list.length;i++){
- list[i].style='width: 100%;height: 100%;'
- }
- })
- }).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>
|