<template>
	<view class="carrHeader">
        <view class="carrHeaderBox">
            <view class="carrHeader-left">
                <view class="carrHeader-left-icon" @click="goBack">
					<u-icon name="arrow-left" size="38" color="#000"></u-icon>
                </view>
            </view>
            <view class="carrHeader-right row items-center col">
                <view>
                    <input class="uni-input col" 
                    placeholder="请输入关键词" 
                    v-model="msg.keyword" 
                    @input="search"/>
                    <u-icon v-if="msg.keyword" class="carrHeader-Rclose" name="close" size="38" color="#ACACAC"
                    @click="close"></u-icon>
                </view>
                <text @click="search">搜索</text>
            </view>
        </view>
    </view>
</template>
<script>
export default {
    props:['params'],   
    data() {
        return {
            msg: {
                GoodsName: '',
                OrderTypeStr: '',
                keyword: '',
            }
        }
    },
    watch:{
        params:{
            handler(newVal,oldVal){
                this.msg.keyword = newVal.keyword
                this.msg.OrderTypeStr = newVal.OrderTypeStr
            },
            deep:true,
        }	
    },
    mounted() {
        
    },
    methods:{
        close() {
            this.msg.keyword = ''	
            this.msg.OrderTypeStr = '' 
            this.search()
        },
        search() {
            this.$emit('change', this.msg)
        },
        goBack(){
			uni.navigateBack({delta:-1})
        }
    }
}
</script>
<style lang="scss" scoped>
@import url("@/asset/css/flex.css");
.AggregateTitle{
    padding: 20rpx 30rpx 30rpx 30rpx;
    font-size: 32rpx;
    font-weight: bold;
    text-align: left;
}
.AggregateTypeBox{
    flex-wrap: wrap;
}
.AggregateType{
    width: 33.33%;
    padding: 0 30rpx;
    margin-bottom: 20rpx;
}
.AggregateType text{
    display: block;
    padding: 10rpx 0;
    background: #f5f5f5;
    border-radius: 30rpx;
    text-align: center;
}
.AggregateType.active text{
    background: #171717;
    color: #fff;
}
.carrHeader-title{
    position: relative;
    left: 60rpx;
    right: 0;
    text-align: left;
    font-size: 32rpx;
}
.carrHeader-left{
    position: absolute;
    left: 32rpx;
    bottom: 23rpx;
    z-index: 3;
}
.carrHeaderBox{
    width: 100%;
    height: 88rpx;
    padding: 0 32rpx;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}
.carrHeader{
    padding-top: 85rpx;
}
.carrHeader-right{
    width: 1px;
    flex: 1;
    display: flex;
    padding-left: 60rpx;
    padding-right: 170rpx;
}
.carrHeader-right view{
    width: 1px;
    flex: 1;
    border-radius: 30rpx;
    padding: 10rpx 30rpx;
    background: #F4F4F4;
    margin-right: 20rpx;
    position: relative;
}
.carrHeader-Rclose{
    position: absolute;
    right: 20rpx;
    top: 11rpx;
    z-index: 3;
}
.uni-input{
    
}
</style>