<template>
	<view class="projectList">
		<headers class="fixedheader" :themeType="true" :showBack="true">
			<view class="headerName">
				查看明细
			</view>
		</headers>
		<view class="details">
			<view class="details-item">
				<span>材料名称</span>
				<span>{{result.name}}</span>
			</view>
			<view class="details-item">
				<span>型号</span>
				<span>{{result.model}}</span>
			</view>
			<view class="details-item">
				<span>规格</span>
				<span>{{result.specifications}}</span>
			</view>
			<view class="details-item">
				<span>单位</span>
				<span>{{result.unit}}</span>
			</view>
			<view class="details-item">
				<span>数量</span>
				<span>{{result.num}}</span>
			</view>
			<view class="details-item" style="height: 100px;">
				<span>备注</span>
				<span class="details-remark">{{result.remark}}</span>
			</view>
		</view>
	</view>
</template>

<script>
	import headers from '../../../components/headers/headers.vue'

	export default {
		data() {
			return {
				id: '',
				result:{}
			}
		},
		onShow() {
			this.getDetails()
		},
		onLoad(vai) {
			this.id = vai.itemS
		},
		onReachBottom() {

		},
		onPullDownRefresh() {

		},
		methods: {
			getDetails() {
				let data = {
					id: this.id
				}
				let _this = this
				this.sendRequest({
					url: 'xmgl/xzMaterialDetail/queryById',
					method: 'post',
					data: data,
					success: res => {
						console.log(res);
						this.result = res.result
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.projectList {
		min-height: 100%;
		background: #f4f5fd;

		.details {
			margin: 10px;
			background-color: #fff;
			height: 380px;
			border-radius: 4px;

			.details-item {
				height: 50px;
				border-bottom: 1px solid #e4e6ef;
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0 15px;
				.details-remark{
					width: 150px;
					height: 70px;
					border: 1px solid #e4e6ef;
					overflow: auto;
					 word-wrap: break-word; /* 允许在单词内换行 */  
					    overflow-wrap: break-word; /* 另一个允许换行的属性，用于更好的浏览器兼容性 */  
					    white-space: normal; /* 确保文本正常换行，而不是保持在一行 */  
				}
			}
		}
	}
</style>