首頁組件

This commit is contained in:
魏啾
2024-04-15 16:15:09 +08:00
parent 289b808bf6
commit 091552233c
36 changed files with 3452 additions and 295 deletions

View File

@@ -1,15 +1,27 @@
<template>
<view class="onecontent flex-between">
<view class="onecontentleft">
现有<text>0元无门槛</text>抵价券 正在出售
现有{{bannervo.coupons}}人以免单
</view>
<view class="onecontentright flex-start">
<view class="onecontentrightimage flex-start">
<u-swiper class="onecontentrightswiper" circular style="width: 100%;" nextMargin="50" :list="list1"
height='28'></u-swiper>
<view class="onecontentrightimage">
<view class="onecontentrightimageabsolute">
<u-swiper circular previousMargin='30' nextMargin="30" :list="bannervo.counponsInfo" keyName="logo"
radius="14" height='28' bgColor='none' imgMode='aspectFit'></u-swiper>
</view>
<!-- <view class="onecontentrightimageabsolutetow">
<u-swiper circular previousMargin="30" nextMargin="30" :list="bannervo.logo" keyName="coverImg"
radius="14" height='28' bgColor='none' imgMode='aspectFit'></u-swiper>
</view> -->
</view>
<view class="onecontentrighttext">
text1
<swiper class="swiper" circular :autoplay="true" :vertical='true' :interval="2000">
<swiper-item class="swiperitem" v-for="(item,index) in bannervo.counponsInfo" :key="index">
{{item.name}}已省{{item.money}}元钱
</swiper-item>
</swiper>
</view>
</view>
<!-- 小内切圆 -->
@@ -21,15 +33,30 @@
export default {
data() {
return {
list1: [
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
],
text1:'开箱即用',
isScroll: false,
minCount: 0,
fontColor: 'black'
};
},
props: {
bannervo: {
type: Object,
default () {
return {
coupons: '',
logo: []
}
}
},
title: {
type: String,
default: '每日特价'
},
img: {
type: String,
default: ''
},
},
};
</script>
@@ -53,19 +80,63 @@
}
}
.onecontentright {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #333333;
.onecontentrightimage {
width: 90rpx;
position: relative;
overflow: hidden;
height: 28rpx;
.onecontentrightswiper {
border: 50%;
width: 28rpx;
.onecontentrightimageabsolute {
width: 100%;
left: 0;
top: 0;
position: absolute;
z-index: 9;
}
.onecontentrightimageabsolutetow {
width: 100%;
left: 14rpx;
top: 0;
position: absolute;
z-index: 10;
}
// .onecontentrightswiper {
// border: 50%;
// width: 28rpx;
// height: 28rpx;
// background: red;
// }
}
.onecontentrighttext {
width: 232rpx;
.swiper {
height: 28rpx;
// width: 232rpx;
.swiperitem {
width: 100rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #333333;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<view class="therecontent flex-between">
<view class="therecontent_box_item">
<view class="therecontent_box_imge flex-between">
<view class="therecontent_box_imge flex-between" @click="jrtoday(0)">
<view class="therecontent_box_imge_text">
{{todayList.name}}
</view>
@@ -14,17 +14,17 @@
</view>
<view class="therecontent_box_itembox">
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in todayList.todayList"
:key="item">
:key="index">
<image :src="item.image" mode="aspectFill"></image>
<view class="therecontent_box_itembox_itemview">
<view class="therecontent_box_itembox_itemview flex-colum-start">
<view class="therecontent_box_itembox_itemviewone">
{{item.productName}}
<text style="margin-left: 0;">{{item.productName}}</text>
</view>
<view class="therecontent_box_itembox_itemviewtow flex-start">
<view class="therecontent_box_itembox_itemviewtow flex-around">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/xia.png" mode="widthFix">
</image>
<view>
8
{{item.discount || '1'}}
</view>
</view>
<view class="therecontent_box_itembox_itemviewthere flex-start">
@@ -37,7 +37,7 @@
</view>
<view class="therecontent_box_item">
<view class="therecontent_box_imge flex-between"
style="background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/towcontent_box2.png) no-repeat;">
style="background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/towcontent_box2.png) no-repeat; background-size: cover;" @click="jrtoday(1)">
<view class="therecontent_box_imge_text">
{{salesList.name}}
</view>
@@ -49,21 +49,18 @@
</view>
</view>
<view class="therecontent_box_itembox">
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in salesList.hotList" :key="item">
<image :src="item.image" mode="aspectFill"></image>
<view class="therecontent_box_itembox_itemview">
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in salesList.hotList"
:key="index">
<image :src="item.image" mode="aspectFill"></image>
<view class="therecontent_box_itembox_itemview flex-colum-start">
<view class="therecontent_box_itembox_itemviewone flex-start">
<view class="therecontent_box_itembox_itemviewoneafter">
TOP.{{index + 1}}
</view>
<text>{{item.productName}}</text>
</view>
<view class="therecontent_box_itembox_itemviewtow flex-start">
<image :src="item.image">
</image>
<view>
8
</view>
<view class="therecontent_box_itembox_itemviewtowdiscount flex-around">
已抢{{item.realSalesNumber}}
</view>
<view class="therecontent_box_itembox_itemviewthere flex-start">
<text>{{item.salePrice}}</text>
@@ -85,13 +82,17 @@
salesList: {
type: Object,
default () {
return {}
return {
salesList:[]
}
}
},
todayList: {
type: Object,
default () {
return {}
return {
todayList:[]
}
}
},
title: {
@@ -99,13 +100,21 @@
default: '每日特价'
}
},
methods:{
jrtoday(e){
if(e == 0){
uni.pro.navigateTo('index/jtoday')
}else{
uni.pro.navigateTo('index/hotlist')
}
}
}
};
</script>
<style scoped lang="scss">
.therecontent {
padding: 0 28rpx;
background: #F9F9F9;
.therecontent_box_item {
width: 336rpx;
@@ -117,6 +126,7 @@
.therecontent_box_itembox_item {
margin-top: 20rpx;
flex-wrap: nowrap;
image {
width: 114rpx;
@@ -133,19 +143,21 @@
font-weight: 400;
font-size: 24rpx;
color: #333333;
text{
text {
margin-left: 4rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.therecontent_box_itembox_itemviewoneafter{
.therecontent_box_itembox_itemviewoneafter {
width: 48rpx;
height: 24rpx;
line-height: 24rpx;
text-align: center;
background: linear-gradient( 116deg, #FF9D2B 0%, #FF4805 100%);
background: linear-gradient(116deg, #FF9D2B 0%, #FF4805 100%);
border-radius: 4rpx 4rpx 4rpx 4rpx;
font-family: Roboto, Roboto;
font-weight: 500;
@@ -153,11 +165,11 @@
color: #FFFFFF;
}
}
.therecontent_box_itembox_itemviewtow {
margin-top: 8rpx;
width: 60rpx;
padding: 4rpx 10rpx;
// padding: 4rpx 10rpx;
background: #FFFFFF;
border-radius: 4rpx;
border: 2rpx solid #FF7127;
@@ -168,6 +180,7 @@
}
view {
padding-right: 2rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 16rpx;
@@ -175,12 +188,21 @@
}
}
.therecontent_box_itembox_itemviewtowdiscount {
margin-top: 10rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 16rpx;
color: #FF7127;
}
.therecontent_box_itembox_itemviewthere {
margin-top: 4rpx;
align-items: flex-end;
text:nth-child(1) {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-weight: Bold;
font-size: 24rpx;
color: #FF7127;
}