| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- <template>
- <div class="user-content">
- <div class="user-name">
- <img src="/images/component/default.png"/>
- <p>{{loadUserInfo.userName}}</p>
- <span @click="onclick()">{{listName}}<i class="iconfont icon-arrow-down"></i></span>
- <ul class="supdown" v-if="down">
- <li @click="onDown('-1')">店铺关注</li>
- <li @click="onDown('0')">器件收藏</li>
- <li @click="onDown('1')">全部收藏</li>
- </ul>
- </div>
- <div class="shop-list" v-if="isShop">
- <h3>{{}}</h3>
- <div class="list-item">
- <div class="item-img">
- <i></i>
- <img src="/images/component/default.png" alt="">
- </div>
- <div class="list-item-phone">
- <p>电话:<span>0755-1234567</span></p>
- <p>传真:<span>0755-1234567</span></p>
- <p>商家介绍: <nuxt-link to="/">点击查看</nuxt-link></p>
- <i class="iconfont icon-shoucang"></i>
- </div>
- </div>
- </div>
- <div class="detail-brand" v-for="(item, index) in collectSave.content" v-if="isDevice">
- <nuxt-link :to="'/mobile/brand/componentDetail/'+ item.componentinfo.uuid">
- <div class="brand-item">
- <p>型号:<span>{{item.componentinfo.code}}</span></p>
- <p>品牌:<span>{{item.componentinfo.brand.nameCn}}</span></p>
- <p>产品描述:<span>{{item.componentinfo.kind.nameCn}}</span></p>
- <i class="iconfont icon-shoucang"></i>
- </div>
- </nuxt-link>
- </div>
- </div>
- </template>
- <script>
- export default {
- layout: 'main',
- data () {
- return {
- userName: '',
- down: false,
- count: '',
- page: '',
- type: '',
- listName: '全部收藏',
- isShop: true,
- isDevice: true
- }
- },
- fetch ({ store }) {
- return Promise.all([
- store.dispatch('product/saveStores', { count: 25, page: 1, type: 'component' }),
- store.dispatch('loadUserInfo'),
- store.dispatch('shop/StoreFocusList', { count: 5, page: 1 })
- ])
- },
- methods: {
- onclick () {
- this.down = !this.down
- },
- onDown (type) {
- if (type === '-1') {
- this.listName = '店铺关注'
- this.isShop = true
- this.isDevice = false
- this.down = false
- }
- if (type === '0') {
- this.listName = '器件收藏'
- this.isDevice = true
- this.isShop = false
- this.down = false
- }
- if (type === '1') {
- this.listName = '全部收藏'
- this.isDevice = true
- this.isShop = true
- this.down = false
- }
- }
- },
- computed: {
- collectSave () {
- return this.$store.state.product.common.collectList.data
- },
- loadUserInfo () {
- return this.$store.state.option.user.data
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .user-content{
- margin-bottom: .98rem;
- margin-top: .88rem;
- min-height: 10rem;
- background: #e2e4e6;
- .user-name{
- padding:.14rem .38rem .09rem .34rem;
- background:#fff;
- display:flex;
- align-items: center;
- width:100%;
- position:relative;
- .supdown{
- position:absolute;
- top:1rem;
- right:.3rem;
- z-index:1000;
- width:1.7rem;
- background:#616264;
- border-radius:.1rem;
- padding-left:.18rem;
- li{
- font-size: .28rem;
- color:#ffffff;
- height: .32rem;
- line-height: .32rem;
- margin: .2rem 0;
- }
- }
- img{
- display: inline-block;
- width:1.25rem;
- height:1.25rem;
- border:.04rem solid #c5dbfc;
- border-radius: .05rem;
- }
- p{
- font-size:.32rem;
- margin:0;
- margin-left:.25rem;
- flex:1;
- }
- span{
- font-size:.28rem;
- color:#53a0f7;
- }
- }
- .shop-list {
- background:#fff;
- margin-top:.12rem;
- padding-bottom:.28rem;
- h3{
- font-size:.32rem;
- line-height: .8rem;
- margin:0;
- margin-left:.27rem;
- margin-bottom:.14rem;
- }
- .list-item{
- width:6.77rem;
- margin-left:.39rem;
- justify-content: space-around;
- display:inline-flex;
- .item-img{
- width:2.42rem;
- i{
- display:block;
- position:absolute;
- width:.65rem;
- height:.33rem;
- background: url(/imgs/shop/daili@2x.png)no-repeat;
- background-size: .65rem .33rem;
- }
- img{
- border:.02rem solid #418bf6;
- width:2.4rem;
- height:1.69rem;
- }
- }
- .list-item-phone{
- width:3.95rem;
- padding-top:.18rem;
- position:relative;
- p{
- font-size:.28rem;
- line-height: .45rem;
- margin:0;
- }
- i{
- display:block;
- position:absolute;
- top:.1rem;
- right:.1rem;
- font-size:.4rem;
- color:#ff7800;
- }
- }
- }
- }
- .detail-brand{
- background: #f8fcff;
- width:100%;
- min-height:1.5rem;
- padding-top:.2rem;
- .brand-item{
- width:7rem;
- margin:0 auto;
- border-radius:.1rem;
- background: #fff;
- padding:.2rem;
- position:relative;
- &:active{
- background: #e1e1e1;
- }
- p{
- font-size:.28rem;
- line-height:.4rem;
- color:#333;
- margin:0;
- span{}
- }
- i{
- display:block;
- position:absolute;
- top:.2rem;
- right:.1rem;
- font-size:.4rem;
- color:#ff7800;
- }
- }
- div.active{
- background: #d4d;
- }
- }
- }
- </style>
|