| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 | 
							- <template>
 
- 	<view class="content">
 
-         <pcNav></pcNav>
 
-         <view style="height: 72px;"></view>
 
- 		<view class="top">
 
- 			<view class="topline" @click="goIndex">首页</view>
 
- 			<view class="topjt">></view>
 
- 			<view class="topline" @click="goList()">{{topName}}</view>
 
- 			<view class="topjt" v-if="twoName">></view>
 
- 			<view class="topline" :class="{'c999':twoName}">{{twoName}}</view>
 
- 		</view>
 
- 		<view class="htmlBox">
 
- 			<view class="htmlTitle">{{detailData.name}}</view>
 
- 			<view class="time">{{detailData.publishTime}}</view>
 
- 			<view class="html" v-html="detailData.contents"></view>
 
- 		</view>
 
- 		<view class="itemArr" v-if="itemArr.length>0">
 
- 		  <view class="itemArrLine" v-for="(item,index) in itemArr">
 
- 			  <view class="itemArrLeft" >
 
- 				  <image src="../../static/pcimg/icon_fujian@2x.png" mode="" class="fileIcon"></image>
 
- 				  <view class="fileName" @click="gofile(item.fileUrl)">{{item.fileName}}</view>
 
- 			  </view>
 
- 			<!-- <view class="dload">
 
- 				  <a class="dloadbtn" :href="item.fileUrl" target='_blank' >下载</a>
 
- 			  </view> -->
 
- 		  </view>
 
- 		</view>
 
- 		<view class="lbel">
 
- 			<view class="topName">{{topName}}</view>
 
- 		</view>
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import pcNav from '../../components/pcNav/pcNav.vue'
 
- 	export default {
 
-         components: {
 
-         	pcNav,
 
-         },
 
- 		data() {
 
- 			return {
 
- 				id: '',
 
- 				detailData: {},
 
- 				couContent: '',
 
- 				itemArr: [],
 
- 				topName:'',
 
- 				twoName:'',
 
- 				comment:'',
 
- 				parentCode:'',
 
- 			}
 
- 		},
 
- 		onLoad(opt) {
 
- 			console.log('opt', opt);
 
- 			this.id = opt.id
 
-             this.topName=opt.topName;
 
- 			this.twoName=opt.twoName;
 
- 			this.comment=opt.comment;
 
- 			this.parentCode=opt.parentCode
 
- 			this.getDetailData()
 
- 			// uni.setNavigationBarTitle({
 
- 			// 	title: this.topName
 
- 			// })
 
- 		},
 
- 		methods: {
 
- 			gofile(url){
 
- 				window.location.href=url
 
- 			},
 
- 			goList(){
 
- 				uni.navigateTo({
 
- 					url:'list?code='+this.parentCode+'&topName='+this.topName+'&comment='+this.comment
 
- 				})
 
- 			},
 
-              goIndex(){
 
- 					uni.navigateTo({
 
- 						url:'index'
 
- 					}) 
 
- 			 },
 
- 			getDetailData() {
 
- 				uni.showLoading({
 
- 					title: '加载中'
 
- 				})
 
- 				let url = '/trainingOpenApi/articleDetail',
 
- 					params = {
 
- 						id: this.id,
 
- 					}
 
- 				this.$http(url, params, 'GET').then(res => {
 
- 					uni.hideLoading();
 
- 					var data = res.data
 
- 					// 处理 undefined和null转为空白字符串
 
- 					for (const key in data) {
 
- 						data[key] = this.$praseStrEmpty(data[key])
 
- 					}
 
- 					this.detailData = data;
 
- 					console.log()
 
- 					if (this.detailData.contents) {
 
- 						var replaceStr = "application/x-shockwave-flash"
 
- 					    this.detailData.contents=this.detailData.contents.replace(new RegExp(replaceStr,'gm'),'video/webm')//(/''/g,"video/webm")
 
- 					    this.detailData.contents=this.detailData.contents.replace(/<embed([\s\w"-=\/\.:;]+)/ig, '<embed style="width: 100%;height:500px;" $1');
 
- 					}
 
- 					 if (this.detailData.contents) {
 
- 						this.detailData.contents = this.detailData.contents.replace(
 
- 								/<p([\s\w"=\/\.:;]+)((?:(style="[^"]+")))/ig, '<p')
 
- 							.replace(/<p>/ig, '<p style="font-size: 15px; line-height: 25px;">')
 
- 							.replace(/<img([\s\w"-=\/\.:;]+)((?:(height="[^"]+")))/ig, '<img$1')
 
- 							.replace(/<img([\s\w"-=\/\.:;]+)((?:(width="[^"]+")))/ig, '<img$1')
 
- 							.replace(/<img([\s\w"-=\/\.:;]+)((?:(style="[^"]+")))/ig, '<img$1')
 
- 							.replace(/<img([\s\w"-=\/\.:;]+)((?:(alt="[^"]+")))/ig, '<img$1')
 
- 							.replace(/<img([\s\w"-=\/\.:;]+)/ig, '<img style="width: 100%;" $1');
 
- 					}
 
- 					this.itemArr = this.detailData.fileList 
 
-                     console.log(this.itemArr)
 
- 				})
 
- 			},
 
- 			
 
- 			// }
 
- 		}
 
- 	}
 
- </script>
 
- <style scoped>
 
- 	.top{
 
- 		width: 1200px;
 
- 		margin: 0 auto;
 
- 		display: flex;
 
- 		padding: 30px 0;
 
- 		font-size: 14px;
 
- 	}
 
- 	.htmlBox{
 
- 		width: 720px;
 
- 		margin: 0 auto;
 
- 	}
 
- 	.topline{
 
- 		padding-right: 10px;
 
- 		cursor: pointer;
 
- 		color: #3C3C3C;
 
- 	}
 
- 	.topjt{
 
- 		color: #AAAAAA;
 
- 		padding-right: 10px;
 
- 	}
 
- 	.htmlTitle{
 
- 		font-size: 24px;
 
- 		font-weight: 500;
 
- 		color: #3C3C3C;
 
- 		line-height: 33px;
 
- 	}
 
- 	.time{
 
- 		font-size: 14px;
 
- 		padding-top: 16px;
 
- 		color: #999999;
 
- 		line-height: 20px;
 
- 		border-bottom: 1px solid #EEEEEE;
 
- 		padding-bottom: 19px;
 
- 	}
 
- 	.html{
 
- 		padding-top: 18px;
 
- 	}
 
- 	.fileIcon{
 
- 		width: 14px;
 
- 		height: 14px;
 
- 		margin-top: 4px;
 
- 		margin-right: 4px;
 
- 	}
 
- 	.itemArrLeft{
 
- 		display: flex;
 
- 	}
 
- 	.itemArrLine{
 
- 		display: flex;
 
- 		justify-content: space-between;
 
- 		padding: 16px 0;
 
- 		border-bottom: 1px solid #EEEEEE;
 
- 		color: #333333;
 
- 		line-height: 22px;
 
- 		font-size: 16px;
 
- 		width: 720px;
 
- 	}
 
- 	.itemArr{
 
- 		width: 720px;
 
- 		margin: 0 auto;
 
- 		margin-top: 30px;
 
- 		border-radius: 6px;
 
- 		border: 1px solid #EEEEEE;
 
- 		padding: 0 16px;
 
- 		
 
- 	}
 
- 	.dloadbtn{
 
- 		display: block;
 
- 		width: 68px;
 
- 		height: 28px;
 
- 		background: #3F90F7;
 
- 		border-radius: 6px;
 
- 		color: #FFFFFF;
 
- 		text-align: center;
 
- 		line-height:28px ;
 
- 		font-size: 14px;
 
- 		text-decoration:none;
 
- 	}
 
- 	.lbel{
 
- 		width: 720px;
 
- 		margin: 0 auto;
 
- 		margin-top: 30px;
 
- 		padding-bottom: 30px;
 
- 	}
 
- 	.topName{
 
- 		width: 84px;
 
- 		height: 24px;
 
- 		background: rgba(63, 144, 247, 0.1);
 
- 		border-radius: 14px;
 
- 		font-size: 12px;
 
- 		color: #3F90F7;
 
- 		line-height: 24px;
 
- 		text-align: center;
 
- 	}
 
- 	.fileName{
 
- 		text-decoration:underline;
 
- 		color: #3F90F7;
 
- 	}
 
- 	.c999{
 
- 		color: #999999;
 
- 	}
 
- </style>
 
 
  |