<template>
	<!-- 搜索界面 -->
	<view class="">
		<u-navbar :is-back="true" :borderBottom="false" :background="{ backgroundColor: '#F5F5F5' }" title="">
			<view class="slot-wrap">
				<view class="search-wrap">
					<u-search
						@search="searchEng"
						bg-color="#fff"
						border-color="#d5aa7a"
						placeholder="请输入名称"
						:show-action="false"
						v-model="value"
					></u-search>
				</view>
			</view>
		</u-navbar>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
import home from '../mixin/index.js';
export default {
	mixins: [home],
	data() {
		return {
			value: '',
			size: 10,
			total: 0,
			state: 1,
		};
	},
	onLoad(option) {
		this.state = option.state;
	},
	methods: {
		searchEng(item) {
			let data = item || this.value;
			try {
				uni.setStorageSync('styleSearch', data);
				uni.navigateBack({
					delta: 1
				});
			} catch (e) {
				// error
			}
		},
	}
};
</script>
<style lang="scss" scoped>
.slot-wrap {
	display: flex;
	align-items: center;
	flex: 1;
}
.search-wrap {
	margin: 0 20rpx;
	flex: 1;
}
.ver_middle {
	vertical-align: middle;
}
</style>
