<template>
	<view class="">
		<u-navbar :is-back="true" :background="{ backgroundColor: '#F5F5F5' }" title="我的面料"></u-navbar>
		<view class="content background_fff u-p-30">
			<!-- 正文内容 -->
			<u-sticky offset-top="15">
				<u-search class="" bg-color="#fff" border-color="#ececec" placeholder="请输入面料名称" :show-action="false" v-model="search"></u-search>
			</u-sticky>
			<view>
				<view class="u-m-t-30" v-for="item in fiabricList"><fabricTitle :item="item"></fabricTitle></view>
			</view>
		</view>
	</view>
</template>

<script>
import fabricTitle from '@/components/hs-material-thumbnail/hs-material-thumbnail.vue';
export default {
	components: { fabricTitle },
	data() {
		return {
			search: '',
			fiabricList: []
		};
	},
	onLoad() {
		this.materialList();
	},
	methods: {
		// 我的面料
		materialList() {
			this.$http('orderTicket.materialList', {
				size: 4,
				materialCode: '',
				materialName: this.search
			}).then(res => {
				let { code, data } = res;
				if (code == 200) {
					this.fiabricList.concat(data);
					// this.fiabricList = [1, 2];
				}
			});
		}
	}
};
</script>

<style scoped lang="scss">
.background_fff {
	background: #fff;
}
</style>