You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-app/pages/index/components/Banner.vue

106 lines
2.1 KiB

3 years ago
<!--
* @Author: ch
* @Date: 2022-03-23 10:31:12
* @LastEditors: ch
3 years ago
* @LastEditTime: 2022-05-21 17:29:42
3 years ago
* @Description: file content
-->
<template>
<view class="banner">
3 years ago
<u-swiper bgColor="none" @click="goDetail" radius="18rpx" keyName="url" :list="data" height="240rpx" circular indicator indicatorMode="dot"></u-swiper>
3 years ago
<view class="desc">
<view class="desc--item">
<image class="desc--icon" src='@/static/index/bz.png'></image>
<text class="desc--txt">马士兵严选</text>
</view>
<view class="desc--item">
<image class="desc--icon" src='@/static/index/bz.png'></image>
<text class="desc--txt">100%正品</text>
</view>
<view class="desc--item">
<image class="desc--icon" src='@/static/index/bz.png'></image>
<text class="desc--txt">365天质保</text>
</view>
<view class="desc--item">
<image class="desc--icon" src='@/static/index/bz.png'></image>
<text class="desc--txt">售后无忧</text>
</view>
</view>
</view>
</template>
<script>
export default {
data(){
return {
}
},
props:{
data : {
type : Array,
default : []
3 years ago
}
3 years ago
},
methods:{
goDetail(idx){
3 years ago
let item = this.data[idx];
if(item.link){
// ifdef H5
window.location.href = item.link;
// #endif
// #ifdef APP-PLUS
3 years ago
plus.runtime.openURL(item.link);
// #endif
3 years ago
}else{
this.$Router.push(`/goodsDetail?id=${this.data[idx].id}`)
}
3 years ago
}
3 years ago
}
}
</script>
<style lang="scss" scoped>
.banner{
height: 368rpx;
3 years ago
position: relative;
padding: 40rpx 30rpx 0;
3 years ago
overflow: hidden;
3 years ago
&::before{
display: block;
content: '';
position: absolute;
left: -5vw;
3 years ago
top:-2rpx;
3 years ago
height: 231rpx;
width: 110vw;
3 years ago
background: #F3574D;
3 years ago
border-bottom-left-radius: 100%;
border-bottom-right-radius: 100%;
}
3 years ago
.swiper{
background-color: none !important;
}
3 years ago
}
.desc{
display: flex;
justify-content: space-between;
3 years ago
margin-top: 14rpx;
padding-right: 10rpx;
3 years ago
&--item{
display: flex;
3 years ago
align-items: center;
3 years ago
}
&--icon{
3 years ago
width: 42rpx;
height: 44rpx;
3 years ago
position: relative;
}
&--txt{
font-size: 22rpx;
color: $color-grey5;
3 years ago
margin-top: 4rpx;
3 years ago
}
}
</style>