<template>
	<view class="container">
		<u-swiper mode="aspectFit" :list="thougtlist" width="100%" height="600rpx"></u-swiper>
		<view class="vile_title">种子简介</view>
		<view class="introduction_module">
			<view class="infmodu_title">种子名称</view>
			<view class="infmodu_content">{{ vilegedetail.seed_name }}</view>
		</view>
		<view class="introduction_module">
			<view class="infmodu_title">预估产量</view> 
			<view class="infmodu_content">{{ vilegedetail.seed_yield }}kg/m²</view>
		</view>
		<view class="introduction_module">
			<view class="infmodu_title">播种季节</view>
			<view class="infmodu_content">{{ vilegedetail.seedtime }}</view>
		</view>
		<view class="introduction_module">
			<view class="infmodu_title">生长周期</view>
			<view class="infmodu_content">{{ vilegedetail.growth_cycle }}天</view>
		</view>
		<view class="introduction_module">
			<view class="infmodu_title">播种面积</view>
			<view class="infmodu_content">{{ vilegedetail.min_plant_area }}m²</view>
		</view>
		<view class="introduction_module">
			<view class="infmodu_title">采摘周期</view>
			<view class="infmodu_content">{{ vilegedetail.pick_cycle }}天</view>
		</view>
		<view class="introduction_module">
			<view class="infmodu_title">种子介绍</view>
			<view class="infmodu_content">
				<u-parse style="line-height: 41rpx;" :content="vilegedetail.seed_desc" :lazy-load="true" :show-with-animation="true">
				</u-parse>
			</view>
		</view>
	</view>
</template>
<script>
import Seedapi from '@/api/seed/index.js';
export default {
	components: {},
	data() {
		return {
			primary:this.$theme.primary,
			settingFile:getApp().globalData.siteinfo,
			vilegedetail: {},
			// 种子照片合集
			thougtlist: []
		};
	},
	onLoad(options) {
		// 根据id获取种子详情
		this.vilegedetailbyid(options.seedid);
	},
	onShow: function() {},
	methods: {
		// 根据id获取种子详情
		vilegedetailbyid(seedid) {
			var that = this;
			Seedapi.getvidebyid({ id: seedid }).then(res => {
				if (res.status == 1) {
					// 获取种子详情
					that.vilegedetail = res.data;
					that.thougtlist=that.vilegedetail.seed_lunbo_pic;
					/* 处理富文本*/
					that.vilegedetail.seed_desc = res.data.seed_desc.replace(/\<img src="/gi,
						`<img style='width:100%;display:block' src="${this.settingFile.root_rich_img}`);
				} else {
					that.$api.msg(res.msg);
				}
			});
		}
	},
	// #ifndef MP-WEIXIN
	// 标题栏input搜索框点击
	onNavigationBarSearchInputClicked: async function(e) {},
	//点击导航栏 buttons 时触发
	onNavigationBarButtonTap(e) {}
	// #endif
};
</script>
<style lang="scss">
.vile_title {
	color: #000000;
	font-size: 32rpx;
	margin: 45rpx 0 25rpx 0;
	text-align: center;
}
.introduction_module {
	display: flex;
	justify-content: flex-start;
	margin: 30rpx 30rpx 30rpx 1em;
	align-items: center;
}
.infmodu_title {
	font-size: 30rpx;
	color: #999;
	letter-spacing: 3.5rpx;
}
.infmodu_content {
	font-size: 28rpx;
	color: #000;
	margin-left: 1em;
	letter-spacing: 1.5rpx;
}
</style>
