Commit 992944421d676bd004427b9081caf03b0c32f18b
1 parent
f3042649
菜单滚动事件
Showing
4 changed files
with
25 additions
and
17 deletions
src/components/horizList/horizList.vue
| @@ -39,6 +39,11 @@ | @@ -39,6 +39,11 @@ | ||
| 39 | <goods-item-3 v-if="com == '3'" @jump="jump" @primary="primary" | 39 | <goods-item-3 v-if="com == '3'" @jump="jump" @primary="primary" |
| 40 | :item="item"> | 40 | :item="item"> |
| 41 | </goods-item-3> | 41 | </goods-item-3> |
| 42 | + <!--菜单--> | ||
| 43 | + <swiper-Item v-if="com == '4'" @jump="jump" | ||
| 44 | + :item="item" | ||
| 45 | + > | ||
| 46 | + </swiper-Item> | ||
| 42 | </div> | 47 | </div> |
| 43 | </div> | 48 | </div> |
| 44 | </div> | 49 | </div> |
| @@ -52,7 +57,7 @@ | @@ -52,7 +57,7 @@ | ||
| 52 | import goodsItem1 from "@/components/goodsItem_1/goodsItem_1"; | 57 | import goodsItem1 from "@/components/goodsItem_1/goodsItem_1"; |
| 53 | import goodsItem2 from "@/components/goodsItem_2/goodsItem_2"; | 58 | import goodsItem2 from "@/components/goodsItem_2/goodsItem_2"; |
| 54 | import goodsItem3 from "@/components/goodsItem_3/goodsItem_3"; | 59 | import goodsItem3 from "@/components/goodsItem_3/goodsItem_3"; |
| 55 | - | 60 | + import swiperItem from "@/components/swiperItem/swiperItem"; |
| 56 | export default { | 61 | export default { |
| 57 | data: function () { | 62 | data: function () { |
| 58 | return { | 63 | return { |
| @@ -64,7 +69,8 @@ | @@ -64,7 +69,8 @@ | ||
| 64 | components: { | 69 | components: { |
| 65 | goodsItem1, | 70 | goodsItem1, |
| 66 | goodsItem2, | 71 | goodsItem2, |
| 67 | - goodsItem3 | 72 | + goodsItem3, |
| 73 | + swiperItem | ||
| 68 | }, | 74 | }, |
| 69 | methods: { | 75 | methods: { |
| 70 | 76 |
src/components/swiperItem/swiperItem.less
| @@ -3,11 +3,12 @@ | @@ -3,11 +3,12 @@ | ||
| 3 | .swiper-box { | 3 | .swiper-box { |
| 4 | position: relative; | 4 | position: relative; |
| 5 | width: 750px; | 5 | width: 750px; |
| 6 | - height: 380px; | 6 | + height: auto; |
| 7 | + margin-bottom: 50px; | ||
| 7 | overflow: hidden; | 8 | overflow: hidden; |
| 8 | .swipe { | 9 | .swipe { |
| 9 | margin: 0 auto; | 10 | margin: 0 auto; |
| 10 | - width: 670px; | 11 | + max-width: 670px; |
| 11 | height: 100%; | 12 | height: 100%; |
| 12 | .swipe-item { | 13 | .swipe-item { |
| 13 | width: 100%; | 14 | width: 100%; |
src/components/swiperItem/swiperItem.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div class="swiper-box" v-if="navs && navs.length"> | ||
| 3 | - <swipe class="swipe" @change="onChange"> | ||
| 4 | - <swipe-item class="swipe-item" v-for="(item, index) in navs" :key="index"> | 2 | + <div class="swiper-box" v-if="item && item.length"> |
| 3 | + <div class="swipe"> | ||
| 4 | + <div class="swipe-item"> | ||
| 5 | <div class="app_list_box"> | 5 | <div class="app_list_box"> |
| 6 | <div class="app_list"> | 6 | <div class="app_list"> |
| 7 | - <div v-for="(items, index) in item" :key="index" @click="$parent.toDetail(item)"> | 7 | + <div v-for="(items, index) in item" :key="index" @click="$parent.toDetail(items)"> |
| 8 | <img v-lazy="items.simg" /> | 8 | <img v-lazy="items.simg" /> |
| 9 | <div>{{items.title}}</div> | 9 | <div>{{items.title}}</div> |
| 10 | </div> | 10 | </div> |
| 11 | </div> | 11 | </div> |
| 12 | </div> | 12 | </div> |
| 13 | - </swipe-item> | ||
| 14 | - </swipe> | 13 | + </div> |
| 14 | + </div> | ||
| 15 | </div> | 15 | </div> |
| 16 | </template> | 16 | </template> |
| 17 | 17 | ||
| @@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
| 27 | showIndicators: false | 27 | showIndicators: false |
| 28 | } | 28 | } |
| 29 | }, | 29 | }, |
| 30 | - props: ["navs"], | 30 | + props: ["item"], |
| 31 | components: { | 31 | components: { |
| 32 | Swipe, | 32 | Swipe, |
| 33 | SwipeItem | 33 | SwipeItem |
src/pages/mall/mall.vue
| @@ -7,10 +7,10 @@ | @@ -7,10 +7,10 @@ | ||
| 7 | </swiper> | 7 | </swiper> |
| 8 | 8 | ||
| 9 | <!--导航--> | 9 | <!--导航--> |
| 10 | - <swiperItem v-if="navs" | ||
| 11 | - :navs="navs"> | ||
| 12 | - </swiperItem> | ||
| 13 | - | 10 | + <horiz-list class="components-box" v-if="navs && navs.length" @jump="jump" |
| 11 | + :lists="navs" | ||
| 12 | + com="4"> | ||
| 13 | + </horiz-list> | ||
| 14 | <!-- 遍历ads,输出列表数据 --> | 14 | <!-- 遍历ads,输出列表数据 --> |
| 15 | <div class="ads-box"> | 15 | <div class="ads-box"> |
| 16 | <div class="ads" v-for="(item, index) in ads" :key="index"> | 16 | <div class="ads" v-for="(item, index) in ads" :key="index"> |
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | import preferential from "@/components/preferential/preferential"; | 48 | import preferential from "@/components/preferential/preferential"; |
| 49 | import videoArea from "@/components/videoArea/videoArea"; | 49 | import videoArea from "@/components/videoArea/videoArea"; |
| 50 | import style7 from "@/components/style_7/style_7"; | 50 | import style7 from "@/components/style_7/style_7"; |
| 51 | - | 51 | + import horizList from "@/components/horizList/horizList"; |
| 52 | export default { | 52 | export default { |
| 53 | name: 'mall', | 53 | name: 'mall', |
| 54 | data() { | 54 | data() { |
| @@ -65,7 +65,8 @@ | @@ -65,7 +65,8 @@ | ||
| 65 | discountZone, | 65 | discountZone, |
| 66 | preferential, | 66 | preferential, |
| 67 | videoArea, | 67 | videoArea, |
| 68 | - style7 | 68 | + style7, |
| 69 | + horizList | ||
| 69 | }, | 70 | }, |
| 70 | created() { | 71 | created() { |
| 71 | 72 |