12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <template>
- <view style="background-color: #fff;">
- <u-navbar :title="newsDetail.title"></u-navbar>
- <view class="main">
-
-
- <view class="news-content" v-html="newsDetail.value">
-
- </view>
- </view>
- </view>
- </template>
- <script>
- import * as newsApi from '@/apis/news.js'
-
- export default {
- data() {
- return {
- id: '',
- newsDetail: '',
- }
- },
- onLoad(op) {
- this.id =op.code;
-
- this.getNewsInfoDetail();
- },
- methods: {
- getNewsInfoDetail() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- newsApi.findConfigureByKey({
- key:this.id
- }).then((res) => {
- uni.hideLoading()
- this.newsDetail = res.data;
- 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>
|