<template>
  <view class="index">
    <view class="logo-black logo" />

    <swiper-box type="index" height="560rpx" @click="handleClick" />

    <view class="btn-box  main-left cross-center">
      <u-button
        text="产品"
        color="#000"
        shape="square"
        :plain="true"
        :custom-style="{borderRadius: 0}"
        @click="$u.route({url: '/pages/product/index'})"
      />
      <u-button
        v-if="userInfo.account.type === $const.ACCOUNT_DESIGN || userInfo.account.type === $const.ACCOUNT_VIP"
        text="案例"
        color="#000"
        shape="square"
        :plain="true"
        :custom-style="{marginLeft:'50rpx', borderRadius: 0}"
        @click="$u.route({url: '/pages/case/index'})"
      />
    </view>
  </view>
</template>

<script>
import { mapState } from 'vuex'
import SwiperBox from '../SwiperBox'
export default {
  name: 'IndexLogged',
  components: { SwiperBox },
  data() {
    return {
    }
  },
  computed: {
    ...mapState({
      userInfo: seate => seate.user.info
    })
  },
  methods: {
    handleClick(data) {
      const ids = data.product_id.join(',')
      this.$u.route({ url: `/pages/product/list?ids=${ids}` })
    }
  }
}
</script>

<style lang="scss" scoped>
.index {
  .logo{
    margin: 80rpx auto 60rpx;
  }
  .btn-box{
    margin-top: 100rpx;
    padding: 0 50rpx;
  }
}
</style>
