|
@@ -11,86 +11,119 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="home-search">
|
|
<div class="home-search">
|
|
|
<ul>
|
|
<ul>
|
|
|
- <li class="active"><a href="#">型号</a></li>
|
|
|
|
|
- <li><a href="#">品牌</a></li>
|
|
|
|
|
- <li><a href="#">商家</a></li>
|
|
|
|
|
|
|
+ <li :class="activeType=='model'?'active':''" @click="activeType='model'"><span>型号</span></li>
|
|
|
|
|
+ <li :class="activeType=='brand'?'active':''" @click="activeType='brand'"><span>品牌</span></li>
|
|
|
|
|
+ <li :class="activeType=='shops'?'active':''" @click="activeType='shops'"><span>商家</span></li>
|
|
|
</ul>
|
|
</ul>
|
|
|
<div class="home-input">
|
|
<div class="home-input">
|
|
|
- <input type="text" placeholder="请输入您要查找的型号或品牌">
|
|
|
|
|
- <a href="#"><i class="fa fa-camera-retro"></i></a>
|
|
|
|
|
|
|
+ <input type="text" placeholder="请输入您要查找的型号或品牌" v-model="keyword"
|
|
|
|
|
+ @focus.stop.prevent="onFocus()"/>
|
|
|
|
|
+ <span @click="onSearch()"><i class="fa fa-camera-retro"></i></span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="home-main">
|
|
<div class="home-main">
|
|
|
<nuxt-link to="/mobile/brand" class="home-main-content">
|
|
<nuxt-link to="/mobile/brand" class="home-main-content">
|
|
|
<div>
|
|
<div>
|
|
|
- <img src="/images/qrcode/uas.png" alt="1">
|
|
|
|
|
|
|
+ <img src="/imgs/home/brand@2x.png" alt="1">
|
|
|
</div>
|
|
</div>
|
|
|
<h2>4036万</h2>
|
|
<h2>4036万</h2>
|
|
|
<p>品牌</p>
|
|
<p>品牌</p>
|
|
|
</nuxt-link>
|
|
</nuxt-link>
|
|
|
<nuxt-link to="/mobile/brand" class="home-main-content">
|
|
<nuxt-link to="/mobile/brand" class="home-main-content">
|
|
|
<div>
|
|
<div>
|
|
|
- <img src="/images/qrcode/uas.png" alt="1">
|
|
|
|
|
|
|
+ <img src="/imgs/home/modelbrand@2x.png" alt="1">
|
|
|
</div>
|
|
</div>
|
|
|
<h2>3250万</h2>
|
|
<h2>3250万</h2>
|
|
|
<p>型号</p>
|
|
<p>型号</p>
|
|
|
</nuxt-link>
|
|
</nuxt-link>
|
|
|
<nuxt-link to="/brand" class="home-main-content">
|
|
<nuxt-link to="/brand" class="home-main-content">
|
|
|
<div>
|
|
<div>
|
|
|
- <img src="/images/qrcode/uas.png" alt="1">
|
|
|
|
|
|
|
+ <img src="/imgs/home/bookbrand@2x.png" alt="1">
|
|
|
</div>
|
|
</div>
|
|
|
<h2>926万</h2>
|
|
<h2>926万</h2>
|
|
|
<p>规格书</p>
|
|
<p>规格书</p>
|
|
|
</nuxt-link>
|
|
</nuxt-link>
|
|
|
<nuxt-link to="/mobile/shop" class="home-main-content">
|
|
<nuxt-link to="/mobile/shop" class="home-main-content">
|
|
|
<div>
|
|
<div>
|
|
|
- <img src="/images/qrcode/uas.png" alt="1">
|
|
|
|
|
|
|
+ <img src="/imgs/home/shopbrand@2x.png" alt="1">
|
|
|
</div>
|
|
</div>
|
|
|
<p>店铺列表</p>
|
|
<p>店铺列表</p>
|
|
|
</nuxt-link>
|
|
</nuxt-link>
|
|
|
<nuxt-link to="/mobile/user" class="home-main-content">
|
|
<nuxt-link to="/mobile/user" class="home-main-content">
|
|
|
<div>
|
|
<div>
|
|
|
- <img src="/images/qrcode/uas.png" alt="1">
|
|
|
|
|
|
|
+ <img src="/imgs/home/storebrand@2x.png" alt="1">
|
|
|
</div>
|
|
</div>
|
|
|
<p>我的收藏</p>
|
|
<p>我的收藏</p>
|
|
|
</nuxt-link>
|
|
</nuxt-link>
|
|
|
<nuxt-link to="/brand" class="home-main-content">
|
|
<nuxt-link to="/brand" class="home-main-content">
|
|
|
<div>
|
|
<div>
|
|
|
- <img src="/images/qrcode/uas.png" alt="1">
|
|
|
|
|
|
|
+ <img src="/imgs/home/phonebrand@2x.png" alt="1">
|
|
|
</div>
|
|
</div>
|
|
|
<p>联系我们</p>
|
|
<p>联系我们</p>
|
|
|
</nuxt-link>
|
|
</nuxt-link>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="home-search-list">
|
|
|
|
|
- <div class="search-list-top">
|
|
|
|
|
- <h5>历史搜索:<i class="fa fa-camera-retro"></i></h5>
|
|
|
|
|
- <div class="search-list-item">
|
|
|
|
|
- <a href="#">smk212121288</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
|
|
+ <div class="home-search-list" v-if="associate && keyword">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="search-list-top">
|
|
|
|
|
+ <h5>历史搜索:<i class="fa fa-camera-retro"></i></h5>
|
|
|
|
|
+ <div class="search-list-item">
|
|
|
|
|
+ <a href="#">smk212121288</a>
|
|
|
|
|
+ <a href="#">CPU</a>
|
|
|
|
|
+ <a href="#">CPU</a>
|
|
|
|
|
+ <a href="#">CPU</a>
|
|
|
|
|
+ <a href="#">CPU</a>
|
|
|
|
|
+ <a href="#">CPU</a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="search-list-bottom">
|
|
|
|
|
+ <h5><i class="fa fa-camera-retro"></i>热搜器件</h5>
|
|
|
|
|
+ <span v-for="item in hotwords">
|
|
|
|
|
+ <nuxt-link to="item.url" >{{item.name}}</nuxt-link>
|
|
|
|
|
+ </span>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- <div class="search-list-bottom">
|
|
|
|
|
- <h5><i class="fa fa-camera-retro"></i>热搜器件</h5>
|
|
|
|
|
- <a href="#">smk212121288</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
- <a href="#">CPU</a>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-
|
|
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: 'home',
|
|
|
|
|
+ data () {
|
|
|
|
|
+ return {
|
|
|
|
|
+ keyword: '',
|
|
|
|
|
+ activeType: 'model',
|
|
|
|
|
+ associate: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ props: {
|
|
|
|
|
+ hotwords: {
|
|
|
|
|
+ type: Array,
|
|
|
|
|
+ default () {
|
|
|
|
|
+ return [
|
|
|
|
|
+ {name: 'SCT2080KEC', url: '/product/component/1100400300009990'},
|
|
|
|
|
+ {name: '电池组', url: '/product/kind/346'},
|
|
|
|
|
+ {name: 'Vishay', url: '/product/brand/30327265e42a871be050007f01003d96'},
|
|
|
|
|
+ {name: 'Panasonic', url: '/product/brand/30327265e47d871be050007f01003d96'}
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ onFocus () {
|
|
|
|
|
+ this.associate = true
|
|
|
|
|
+ },
|
|
|
|
|
+ onSearch () {
|
|
|
|
|
+ if (this.keyword) {
|
|
|
|
|
+ this.$router.push({path: '/mobile/search?w=' + encodeURIComponent(this.keyword)})
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created () {
|
|
|
|
|
+ this.$store.dispatch('resetSearchKeywords')
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -120,37 +153,39 @@
|
|
|
li{
|
|
li{
|
|
|
flex:1;
|
|
flex:1;
|
|
|
text-align:center;
|
|
text-align:center;
|
|
|
- a{
|
|
|
|
|
|
|
+ span{
|
|
|
display:inline-block;
|
|
display:inline-block;
|
|
|
width:.72rem;
|
|
width:.72rem;
|
|
|
line-height:.32rem;
|
|
line-height:.32rem;
|
|
|
|
|
+ height:.32rem;
|
|
|
background: #fff;
|
|
background: #fff;
|
|
|
color:#000;
|
|
color:#000;
|
|
|
border-radius: .05rem .05rem 0 0 ;
|
|
border-radius: .05rem .05rem 0 0 ;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- li.active{
|
|
|
|
|
- a{
|
|
|
|
|
- background: #3c7cf5;
|
|
|
|
|
- color:#fff;
|
|
|
|
|
- cursor:pointer;
|
|
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ li.active{
|
|
|
|
|
+ span{
|
|
|
|
|
+ background: #3c7cf5;
|
|
|
|
|
+ color:#fff;
|
|
|
|
|
+ cursor:pointer;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
input{
|
|
input{
|
|
|
width:6rem;
|
|
width:6rem;
|
|
|
- padding: 0 1.2rem 0 .2rem;
|
|
|
|
|
|
|
+ padding: 0 1.2rem 0 .16rem;
|
|
|
margin-right:-1rem;
|
|
margin-right:-1rem;
|
|
|
- font-size:.23rem;
|
|
|
|
|
|
|
+ font-size:.24rem;
|
|
|
line-height: .61rem;
|
|
line-height: .61rem;
|
|
|
border:.02rem solid #3c7cf5;
|
|
border:.02rem solid #3c7cf5;
|
|
|
border-radius:.05rem;
|
|
border-radius:.05rem;
|
|
|
}
|
|
}
|
|
|
- a{
|
|
|
|
|
|
|
+ span{
|
|
|
display:inline-block;
|
|
display:inline-block;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
width:1rem;
|
|
width:1rem;
|
|
|
- line-height: .61rem;
|
|
|
|
|
|
|
+ height:.63rem;
|
|
|
|
|
+ line-height: .63rem;
|
|
|
font-size:.23rem;
|
|
font-size:.23rem;
|
|
|
border-left:none;
|
|
border-left:none;
|
|
|
border-radius: 0 .05rem .05rem 0;
|
|
border-radius: 0 .05rem .05rem 0;
|
|
@@ -220,14 +255,20 @@
|
|
|
margin:0;
|
|
margin:0;
|
|
|
margin-top:.1rem;
|
|
margin-top:.1rem;
|
|
|
}
|
|
}
|
|
|
-.home-search-list{
|
|
|
|
|
- /*display:none;*/
|
|
|
|
|
|
|
+
|
|
|
|
|
+/* 搜索记录 */
|
|
|
|
|
+.home-search-list {
|
|
|
|
|
+ position:absolute;
|
|
|
|
|
+ top:4.5rem;
|
|
|
|
|
+ width:100%;
|
|
|
|
|
+ min-height: 4rem;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+}
|
|
|
|
|
+.home-search-list div{
|
|
|
width:6.55rem;
|
|
width:6.55rem;
|
|
|
margin:0 auto;
|
|
margin:0 auto;
|
|
|
margin-top:.1rem;
|
|
margin-top:.1rem;
|
|
|
- .search-list-top{
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ padding-bottom:.2rem;
|
|
|
.search-list-top{
|
|
.search-list-top{
|
|
|
h5{
|
|
h5{
|
|
|
font-size:.3rem;
|
|
font-size:.3rem;
|