Merge branch 'master' into xbx

This commit is contained in:
2020-07-21 21:03:56 +08:00
18 changed files with 611 additions and 118 deletions

View File

@@ -2,10 +2,10 @@
<view class="group">
<view class="top">
<text>全部拼团</text>
<text>查看更多></text>
<text @click="viewMore">查看更多></text>
</view>
<view class="label">
<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>
<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">
@@ -42,6 +42,11 @@ export default {
this.swiperCurrent = current;
this.current = current;
},
viewMore() {
this.$u.route({
url: 'pageC/groupBuy/index',
})
}
}
}
</script>

View File

@@ -1,5 +1,5 @@
<template>
<view class="item">
<view class="item" @click="toDetailsPage">
<image class="head" :src="info.pintuan_image"></image>
<text class="title u-line-1">{{ info.pintuan_goods_name }}</text>
<view class="price">
@@ -13,6 +13,25 @@ export default {
name:"item",
props: {
info: Object
},
methods: {
toDetailsPage() {
this.$u.api.getPinTuanDetails({
pintuan_id: this.info.pintuan_id,
}).then(res => {
if(res.errCode == 0) {
const goods = {
goods: res.data.data,
type: 2,
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.info.pintuan_id);
this.$u.route({
url: 'pageB/sdetails/index',
})
}
})
}
}
}
</script>

View File

@@ -12,7 +12,7 @@
</view>
<view class="num">{{ info.pintuan_limit_number }}人团</view>
</view>
<view class="info">
<view class="info" @click="toDetailsPage">
<text class="u-line-1">{{ info.groupbuy_name }}</text>
<text class="u-line-2">{{ info.goods_name }}</text>
<view>
@@ -48,11 +48,9 @@ export default {
type: 2,
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.recommendData.pintuan_id);
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.recommendData.pintuan_id
}
})
}
})

View File

@@ -39,7 +39,7 @@ export default {
this.$u.route({
url: '/pageC/spike/index',
})
}
},
}
}
</script>

View File

@@ -32,7 +32,7 @@ export default {
width: 210rpx;
height: 131rpx;
border-radius: 6rpx;
background-color: antiquewhite;
}
.title{
font-size: 26rpx;

View File

@@ -1,15 +1,27 @@
<template>
<view class="special">
<image :src="item.groupbuy_image1"></image>
<view class="right">
<view class="name u-line-1">{{ item.goods_name }}</view>
<view class="price" v-if="type == 'spike'">
<view class="groupbuy-price">{{ item.groupbuy_price }}</view>
<view class="goods-price">{{ item.goods_price }}</view>
<view v-if="type == 'spike'">
<image :src="item.groupbuy_image1"></image>
<view class="right">
<view class="name u-line-1">{{ item.goods_name }}</view>
<view class="price">
<view class="groupbuy-price">{{ item.groupbuy_price }}</view>
<view class="goods-price">{{ item.goods_price }}</view>
</view>
<view class="buy">
<view class="num">剩余{{ item.inventory }}</view>
<view class="btn" @click="spikeGoods">立即购买</view>
</view>
</view>
<view class="buy">
<view class="num">剩余{{ item.inventory }}</view>
<view class="btn">立即购买</view>
</view>
<view v-if="type == 'group'">
<image :src="item.pintuan_image"></image>
<view class="right">
<view class="name u-line-1">{{ item.pintuan_goods_name }}</view>
<view class="price group">
<view class="groupbuy-price">{{ item.pintuan_goods_price }}</view>
<view class="btn" @click="toDetailsPage">立即拼团</view>
</view>
</view>
</view>
</view>
@@ -25,65 +37,122 @@ export default {
},
created() {
console.log(this.item);
console.log(this.type);
},
methods: {
spikeGoods() {
console.log(this.item.groupbuy_id);
this.$u.api.getSpikeInfo({
groupbuy_id: this.item.groupbuy_id
}).then(res => {
if(res.errCode == 0) {
const goods = {
goods: res.data.goodsInfo,
type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
this.$store.commit('setGoodsId', this.item.groupbuy_id);
this.$u.route({
url: 'pageB/sdetails/index',
})
}
})
},
toDetailsPage() {
this.$u.api.getPinTuanDetails({
pintuan_id: this.item.pintuan_id
}).then(res => {
if(res.errCode == 0) {
const goods = {
goods: res.data.data,
type: 2,
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.item.pintuan_id);
this.$u.route({
url: 'pageB/sdetails/index',
})
}
})
}
}
};
</script>
<style lang="scss" scoped>
.special {
margin-bottom: 30rpx;
display: flex;
width: 690rpx;
background: rgba(245,245,245,1);
border-radius: 6rpx;
> image {
flex-shrink: 0;
width: 210rpx;
height: 170rpx;
border-radius: 6rpx 0rpx 0rpx 6rpx;
}
.right {
flex: 1;
> view {
margin: 0 auto 30rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 20rpx;
.name {
width: 400rpx;
font-size: 26rpx;
color: rgba(51,51,51,1);
margin-bottom: 20rpx;
width: 690rpx;
background: rgba(245,245,245,1);
border-radius: 6rpx;
> image {
flex-shrink: 0;
width: 210rpx;
height: 170rpx;
border-radius: 6rpx 0rpx 0rpx 6rpx;
background: rgba(245,245,245,1);
}
.price {
display: flex;
.groupbuy-price {
font-size: 26rpx;
color: rgba(255,49,49,1);
margin-right: 12rpx;
}
.goods-price {
font-size: 24rpx;
text-decoration: line-through;
color: rgba(153,153,153,1);
}
}
.buy {
.right {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
.num {
font-size: 22rpx;
color: rgba(102,102,102,1);
padding: 20rpx;
.name {
width: 400rpx;
font-size: 26rpx;
color: rgba(51,51,51,1);
margin-bottom: 20rpx;
}
.btn {
width: 140rpx;
height: 50rpx;
background: rgba(255,120,15,1);
border-radius: 25rpx;
font-size: 22rpx;
font-weight: 500;
color: rgba(255,255,255,1);
line-height: 50rpx;
text-align: center;
.price {
display: flex;
.groupbuy-price {
font-size: 26rpx;
color: rgba(255,49,49,1);
margin-right: 12rpx;
}
.goods-price {
font-size: 24rpx;
text-decoration: line-through;
color: rgba(153,153,153,1);
}
}
.buy {
display: flex;
justify-content: space-between;
align-items: center;
.num {
font-size: 22rpx;
color: rgba(102,102,102,1);
}
.btn {
width: 140rpx;
height: 50rpx;
background: rgba(255,120,15,1);
border-radius: 25rpx;
font-size: 22rpx;
font-weight: 500;
color: rgba(255,255,255,1);
line-height: 50rpx;
text-align: center;
}
}
.group {
align-items: center;
justify-content: space-between;
.btn {
width: 140rpx;
height: 50rpx;
background: rgba(255,120,15,1);
border-radius: 25rpx;
font-size: 22rpx;
font-weight: 500;
color: rgba(255,255,255,1);
line-height: 50rpx;
text-align: center;
}
}
}
}