oneNewsDetails.vue 2.7 KB
<template>
	<view class="oneNewsDetails">
		<!-- 中志要闻 详情 -->
		<view class="header-wrap"></view>
		<view class="news-wrap area">
			<view class="news-item area flex">
				<view>
					<view class="news-day flex">
						<view class="spot"></view>
						<view class="news-day-time">
							{{datas.create_time}}
						</view>
					</view>
					<view class="news-text text-retain">
						{{datas.title}}
					</view>
				</view>
			</view>
			<view class="detail-text" v-html="datas.content">
				<!-- {{detail}} -->
			</view>
		</view>
	</view>
</template>

<script>
	
	import Vue from 'vue'
	import {
		mapState,
		mapMutations
	} from 'vuex'
	var that
	export default {
		data() {
			return {
				
				options:'',
				datas:''
			}
		},
		onLoad(e) {
			that=this
			that.options=e||{}
			console.log(e)
			// uni.setNavigationBarTitle({
			// 	title: 'hweohwrh'
			// })
			that.getdata()
		},
		methods: {
			getdata() {
			
				var datas = {
					id:that.options.id
				}
				var jkurl = '/student/news_detail'
			
				that.$service.P_post(jkurl, datas).then(res => {
					that.btnkg = 0
					console.log(res)
					if (res.code == 1) {
						that.htmlReset = 0
						var datas = res.data
						console.log(typeof datas)
			
						if (typeof datas == 'string') {
							datas = JSON.parse(datas)
						}
						console.log(res)
						
						that.datas=datas
					} else {
			
						if (res.msg) {
							uni.showToast({
								icon: 'none',
								title: res.msg
							})
						} else {
							uni.showToast({
								icon: 'none',
								title: '获取数据失败'
							})
						}
					}
				}).catch(e => {
					that.htmlReset = 1
					that.btnkg = 0
					// that.$refs.htmlLoading.htmlReset_fuc(1)
					console.log(e)
					uni.showToast({
						icon: 'none',
						title: '获取数据失败,请检查您的网络连接'
					})
				})
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.oneNewsDetails {
		position: relative;
	}

	.news-wrap {
		height: auto;
		border-radius: 20rpx;
		background: #FFFFFF;
		position: absolute;
		top: 28rpx;
		left: 50%;
		transform: translate(-50%, 0);
	}

	.news-item {
		height: 196rpx;
		margin-bottom: 20rpx;
		border-bottom: 1px solid #EEEEEE;
		align-items: center;
		padding: 0 34rpx;

		.news-day {
			height: 28rpx;
			line-height: 28rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #A9B1C0;
			margin-bottom: 20rpx;
			align-items: center;

			.news-day-time {
				margin-left: 12rpx;
			}
		}

		.news-text {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #545D71;
		}
	}

	.detail-text {
		height: auto;
		line-height: 50rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #9699A9;
		padding: 30rpx 32rpx 24rpx 32rpx;
	}
</style>