group order

This commit is contained in:
2020-07-20 17:17:41 +08:00
parent 50085a341f
commit a6e1241238
11 changed files with 494 additions and 55 deletions

View File

@@ -5,16 +5,15 @@
<text>查看更多></text>
</view>
<view class="label">
<text>sda</text>
<text>asda</text>
<text>dsad</text>
<text>asdas</text>
</view>
<view class="list">
<sitem></sitem>
<sitem></sitem>
<sitem></sitem>
<u-tabs-swiper ref="group" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="88" ></u-tabs-swiper>
</view>
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 130px">
<swiper-item class="swiper-item" v-for="(_, i) in classifyList" :key="i">
<!-- 最多显示3个 -->
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length"></u-empty>
</swiper-item>
</swiper>
</view>
</template>
<script>
@@ -23,12 +22,27 @@ export default {
name:"group",
components:{
sitem
},
},
props: {
groupList: Array,
classifyList: Array,
},
data(){
return {
current: 0,
swiperCurrent: 0,
}
}
},
methods: {
tabsChange(index) {
this.swiperCurrent = index;
},
animationfinish(e) {
let current = e.detail.current;
this.swiperCurrent = current;
this.current = current;
},
}
}
</script>
<style lang="scss" scoped>

View File

@@ -1,17 +1,19 @@
<template>
<view class="item">
<image class="head"></image>
<text class="title">商品名</text>
<image class="head" :src="info.pintuan_image"></image>
<text class="title u-line-1">{{ info.pintuan_goods_name }}</text>
<view class="price">
<text>99</text>
<text>立即购买</text>
<text>{{ info.pintuan_goods_price }}</text>
<text>立即购买</text>
</view>
</view>
</template>
<script>
export default {
name:"item"
name:"item",
props: {
info: Object
}
}
</script>
<style lang="scss" scoped>
@@ -24,6 +26,8 @@ export default {
}
.title{
display: inline-block;
width: 100%;
font-size: 26rpx;
color: #333;
margin-top: 16rpx;

View File

@@ -0,0 +1,155 @@
<template>
<view class="recommend">
<view class="top">
<text>今日拼团推荐</text>
<text @click="toDetailsPage">点击查看更多></text>
</view>
<view class="connect">
<view class="user">
<view class="avatar">
<image :src="info.member_avatar[0]"></image>
<image :src="info.member_avatar[1]"></image>
</view>
<view class="num">{{ info.pintuan_limit_number }}人团</view>
</view>
<view class="info">
<text class="u-line-1">{{ info.groupbuy_name }}</text>
<text class="u-line-2">{{ info.goods_name }}</text>
<view>
<text>{{ info.groupbuy_price }}</text>
<text>{{ info.goods_price }}</text>
</view>
</view>
<image class="img" :src="info.groupbuy_image1"></image>
</view>
</view>
</template>
<script>
export default {
name:"recommend",
data() {
return {
info: {}
}
},
props: ['recommendData', 'type'],
created() {
this.info = this.recommendData;
console.log(this.recommendData);
},
methods: {
toDetailsPage() {
this.$u.api.getPinTuanDetails({
pintuan_id: this.recommendData.pintuan_id
}).then(res => {
if(res.errCode == 0) {
const goods = {
goods: res.data.data,
type: 2,
}
this.$store.commit('setGoodsDetails', goods);
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.recommendData.pintuan_id
}
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.recommend{
.top{
height: 90rpx;
display: flex;
align-items: center;
justify-content: space-between;
>text:first-child{
font-size: 30rpx;
color: #333;
}
>text:last-child{
font-size: 18rpx;
color: #999;
}
}
.connect{
display: flex;
align-items: center;
.user {
margin-right: 16px;
.avatar {
width: 96rpx;
height: 64rpx;
margin-bottom: 16rpx;
position: relative;
> image {
position: absolute;
width: 64rpx;
height: 64rpx;
border-radius: 50%;
&:first-child {
left: 0;
top: 0;
z-index: 8;
background-color: aqua;
}
&:last-child {
left: 32rpx;
top: 0;
z-index: 9;
background-color: antiquewhite;
}
}
}
.num {
text-align: center;
font-size: 28rpx;
font-weight: 500;
color: rgba(253,211,96,1);
}
}
.info{
width: 340rpx;
display: flex;
flex-direction: column;
>text:nth-child(1){
font-size: 28rpx;
color: #333;
}
>text:nth-child(2){
margin-top: 17rpx;
line-height: 36rpx;
font-size: 24rpx;
color: #666;
}
>view{
margin-top: 24rpx;
display: flex;
align-items: flex-end;
>text:first-child{
font-size: 27rpx;
color: #FF3131;
}
>text:last-child{
font-size: 24rpx;
color: #999;
margin-left: 33rpx;
text-decoration: line-through;
}
}
}
.img{
width: 213rpx;
height: 160rpx;
flex-shrink: 0;
margin-left: 13rpx;
background-color: antiquewhite;
}
}
}
</style>