290144e9
易尊强
第一次
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<template>
<view class="page" style="width: 100%;height: 100%;">
<!-- 文章内容 -->
<view class="article-data">
<view class="article-top">{{detailData.title}}</view>
<view class="article-title">
<view class="article-title-left">
{{ detailData.creatorTime}}
</view>
<view class="article-title-right"><image src="../../static/kan.png"></image>{{detailData.viewCount ? detailData.viewCount : 0}}人</view>
</view>
<view class="article-content">
<text>{{detailData.subTitle}}</text>
</view>
|
9b1c150c
“wangming”
1
|
15
16
17
|
<view class="article-content">
<view ref="htmlContainer" class="" v-html="detailData.bodyContent" style="overflow: scroll;width: 100%;"></view>
</view>
|
290144e9
易尊强
第一次
|
18
19
20
|
<view class="article-img" v-show="detailData.imgUrl" v-for="(it,index) in detailData.imgUrl" :key="index">
<image :src="baseUrl + it.url" mode="widthFix"></image>
</view>
|
9b1c150c
“wangming”
1
|
21
22
23
24
25
26
27
28
29
30
|
<view class="doc_box" v-if="isDoc">
<view class="" v-for="(it,index) in doc" :key="index">
<a :href="baseUrl + it.url">{{it.name}}</a>
</view>
</view>
<view class="doc_box" v-if="isPdf">
<view class="" v-for="(it,index) in pdf" :key="index">
<a :href="baseUrl + it.url">{{it.name}}</a>
</view>
</view>
|
290144e9
易尊强
第一次
|
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
|
</view>
<!-- <view class="feed-list">
<view class="feed-list-box">
<view class="feed-list-box-left">
<view><image src="../../static/img/logo.png"></image></view>
<view>
<view class="feed-list-box-name">{{detailData.comanyName}}</view>
<view class="feed-list-box-add"><image src="../../static/kefu1.png"></image>成都市锦江区带永明路666号</view>
</view>
</view>
<view><view class="feed-list-box-btn">查看</view></view>
</view>
<view class="feed-list-content" @click="ArticleDetails">
<view class="feed-list-content-title">{{detailData.subTitle}}</view>
<view class="feed-list-content-flex">
<view>{{ detailData.creatorTime}}</view>
<view><image src="../../static/kan.png"></image><text style="color:#888D9C;">{{detailData.viewCount ? detailData.viewCount : 0}}人</text></view>
</view>
</view>
<view class="feed-list-content">
<view class="feed-list-content-title">急寻!!诚挚求购优质60吨火星苹果!</view>
<view class="feed-list-content-flex">
<view>2022-02-22 22:56</view>
<view><image src="../../static/kan.png"></image><text style="color:#888D9C;">{{detailData.viewCount ? detailData.viewCount : 0}}人</text></view>
</view>
</view>
<view class="feed-list-content">
<view class="feed-list-content-title">急寻!!诚挚求购优质60吨火星苹果!</view>
<view class="feed-list-content-flex">
<view>2022-02-22 22:56</view>
<view><image src="../../static/kan.png"></image><text style="color:#888D9C;">36人</text></view>
</view>
</view>
</view> -->
</view>
</template>
<script>
import utils from '../../service/utils';
import BASE_URL from '../../common/config.js'
export default {
data() {
return {
isComment: false,
isGoods: false,
// 需求详情数据
detailData:[],
// 存放页面跳转传递的数据
data:[],
|
9b1c150c
“wangming”
1
|
82
83
84
85
86
87
88
|
baseUrl: "https://www.dygxq-es.cn",
// doc文件
doc:[],
// pdf文件
pdf:[],
isDoc:false,
isPdf:false
|
290144e9
易尊强
第一次
|
89
90
91
92
93
94
95
96
97
|
};
},
onLoad(options){
let that = this
// 获取页面跳转传递来的数据
this.data = JSON.parse(options.data)
console.log(that.data)
that.getPolicyDetail()
},
|
9b1c150c
“wangming”
1
|
98
99
100
101
102
103
104
105
106
107
108
|
mounted() {
// this.$nextTick(() => {
// console.log('图片大小修改')
// // const images = this.$refs.htmlContainer.querySelectorAll('img');
// let images = this.$refs.htmlContainer.querySelectorAll('img')
// images.forEach(img => {
// img.style.width = '100%'; // 修改图片宽度为200px
// img.style.height = 'auto'; // 高度自动缩放以保持图片比例
// });
// });
},
|
290144e9
易尊强
第一次
|
109
110
111
112
|
methods:{
// 获取需求详情数据
getPolicyDetail(){
let that = this
|
bd028579
易尊强
2/28
|
113
|
let currentId = that.data
|
290144e9
易尊强
第一次
|
114
115
116
117
118
119
|
console.log(currentId)
that.API.getPolicyDetail(currentId).then(res =>{
console.log(res)
let createTime = utils.formatTime(res.data.createTime)
res.data.creatorTime = createTime
that.detailData = res.data
|
9b1c150c
“wangming”
1
|
120
121
122
123
|
that.doc = that.detailData.fileAtt
that.isDoc = that.doc.length > 0
that.pdf = that.detailData.fileInfo
that.isPdf = that.pdf.length > 0
|
290144e9
易尊强
第一次
|
124
|
console.log(that.detailData)
|
9b1c150c
“wangming”
1
|
125
126
|
let detailContent = res.data.bodyContent.replace(/<img/g,"<img style='max-width:100%;height:auto;'")
that.detailData.bodyContent = detailContent
|
290144e9
易尊强
第一次
|
127
128
129
130
131
132
133
134
|
})
}
}
}
</script>
<style scoped lang="scss">
@import 'ArticleDetails.scss';
|
9b1c150c
“wangming”
1
|
135
136
137
138
139
140
141
142
143
|
::v-deep ima{
width: 100%;
}
.article-content{
img{
width: 100%;
}
}
|
290144e9
易尊强
第一次
|
144
|
</style>
|