<template>
  <div class="middle_width1200 shopmall_home">
    <div class="logo_wrap clearfix">
      <div class="title_guoxin fl header_steps_logo">
        <router-link to="/shop/shopHome">
          <!-- <img src="@assets/img/shopmall/logo.png" class="logo"> -->
          <img :src="WebConfig.imgMajor" class="logo">
          <h2>网上商城</h2>
        </router-link>
      </div>
      <div class="fr cart_steps">
        <el-steps :active="stepsActive" align-center>
          <el-step title="1" description=".我的购物车" />
          <el-step title="2" description=".填写核对订单信息" />
          <el-step title="3" description=".成功提交订单" />
        </el-steps>
      </div>
    </div>
  </div>
</template>

<script>
import { getToken } from '@/assets/js/utils/auth'
import { simpleSearch } from '@/api/shoppingmall/products'
/* vuex*/
import { mapGetters } from 'vuex'
export default {
  name: 'Search',
  props: {
    stepsActive: {
      type: Number,
      default: 2
    }
  },
  data() {
    return {
      isLogin: false, // 是否登录
      // 搜索
      searchForm: {
        keywords: '',
        pageNo: 0,
        pageSize: 10
      }
    }
  },
  computed: {
    /* WebConfig 项目配置数据*/
    ...mapGetters(['WebConfig'])
  },
  created() {
    // 校验是否登录
    this.isLogin = !!getToken()
    if (getToken()) {
      this.isLogin = true
    }
  },
  methods: {
    // 搜索商品
    searchGood() {
      simpleSearch(this.searchForm)
        .then(response => {
          response.data.content
        })
        .catch(() => {})
      this.$router.push({
        path: '/goodsClassList'
      })
    }
  }
}
</script>

<style scoped lang="less">
@import "./index";
  .logo {
    width: 172px;
  }
</style>
