xbx #75

Merged
theluyuan merged 8 commits from xbx into master 2020-07-21 13:04:02 +00:00
18 changed files with 611 additions and 118 deletions
Showing only changes of commit 03d10b1749 - Show all commits

View File

@ -113,10 +113,12 @@ export default {
}); });
}, },
// 订单步骤1展示结算数据 // 订单步骤1展示结算数据
settlementOrder({ ifcart, cart_id }) { settlementOrder({ ifcart, cart_id, pintuan_id, pintuangroup_id }) {
return vm.$u.post('buy/buy_step1', { return vm.$u.post('buy/buy_step1', {
ifcart: ifcart, ifcart: ifcart,
cart_id: cart_id, cart_id: cart_id,
pintuan_id: pintuan_id,
pintuangroup_id: pintuangroup_id,
}); });
}, },
// 订单步骤2发起订单返回订单信息 // 订单步骤2发起订单返回订单信息
@ -126,6 +128,9 @@ export default {
cart_id: cart_id, cart_id: cart_id,
address_id: address_id, address_id: address_id,
buy_city_id: buy_city_id, buy_city_id: buy_city_id,
pintuan_id: pintuan_id,
pintuangroup_id: pintuangroup_id,
voucher_id: voucher_id, // 优惠券信息
}); });
}, },
// 订单步骤3发起支付第三方统一下单 // 订单步骤3发起支付第三方统一下单
@ -183,9 +188,9 @@ export default {
return vm.$u.post('Spike/recommendedSpike'); return vm.$u.post('Spike/recommendedSpike');
}, },
// 秒杀详情 // 秒杀详情
getSpikeInfo({ id }) { getSpikeInfo({ groupbuy_id }) {
return vm.$u.post('Spike/spikeInfo', { return vm.$u.post('Spike/spikeInfo', {
groupbuy_id: id groupbuy_id: groupbuy_id
}); });
}, },
// 秒杀列表 // 秒杀列表

View File

@ -4,9 +4,12 @@ Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
cartInfo: {}, // 购物车数据 orderType: '', // 订单类型 1 普通订单 2 购物车订单 3 拼团订单 4 秒杀订单
orderInfo: {}, // 订单数据 订单步骤1展示结算数据
orderAddress: {}, // 下单时选择的地址 orderAddress: {}, // 下单时选择的地址
goodsDetails: {}, // 商品详情 1普通 2拼团 3秒杀 4优惠券 goodsDetails: {}, // 商品详情 1普通 2拼团 3秒杀 4优惠券
goods_id: '', // 拼团商品 id
groupbuyInfo: {}, // 秒杀详情
}, },
getters: { getters: {
getOrderAddress(state) { getOrderAddress(state) {
@ -20,8 +23,11 @@ const store = new Vuex.Store({
} }
}, },
mutations: { mutations: {
updateCart(state, cart) { setOrderType(state, type) {
state.cartInfo = cart; state.orderType = type;
},
updateOrderInfo(state, info) {
state.orderInfo = info;
}, },
updateAddress(state, address) { updateAddress(state, address) {
state.orderAddress = address; state.orderAddress = address;
@ -29,6 +35,12 @@ const store = new Vuex.Store({
setGoodsDetails(state, goods) { setGoodsDetails(state, goods) {
state.goodsDetails = goods; state.goodsDetails = goods;
}, },
setGoodsId(state, id) {
state.goods_id = id;
},
setGroupbuyInfo(state, info) {
state.groupbuyInfo = info;
},
} }
}) })
export default store; export default store;

View File

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

View File

@ -1,5 +1,5 @@
<template> <template>
<view class="item"> <view class="item" @click="toDetailsPage">
<image class="head" :src="info.pintuan_image"></image> <image class="head" :src="info.pintuan_image"></image>
<text class="title u-line-1">{{ info.pintuan_goods_name }}</text> <text class="title u-line-1">{{ info.pintuan_goods_name }}</text>
<view class="price"> <view class="price">
@ -13,6 +13,25 @@ export default {
name:"item", name:"item",
props: { props: {
info: Object 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> </script>

View File

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

View File

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

View File

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

View File

@ -1,15 +1,27 @@
<template> <template>
<view class="special"> <view class="special">
<view v-if="type == 'spike'">
<image :src="item.groupbuy_image1"></image> <image :src="item.groupbuy_image1"></image>
<view class="right"> <view class="right">
<view class="name u-line-1">{{ item.goods_name }}</view> <view class="name u-line-1">{{ item.goods_name }}</view>
<view class="price" v-if="type == 'spike'"> <view class="price">
<view class="groupbuy-price">{{ item.groupbuy_price }}</view> <view class="groupbuy-price">{{ item.groupbuy_price }}</view>
<view class="goods-price">{{ item.goods_price }}</view> <view class="goods-price">{{ item.goods_price }}</view>
</view> </view>
<view class="buy"> <view class="buy">
<view class="num">剩余{{ item.inventory }}</view> <view class="num">剩余{{ item.inventory }}</view>
<view class="btn">立即购买</view> <view class="btn" @click="spikeGoods">立即购买</view>
</view>
</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> </view>
</view> </view>
@ -25,12 +37,52 @@ export default {
}, },
created() { created() {
console.log(this.item); 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.special { .special {
margin-bottom: 30rpx; > view {
margin: 0 auto 30rpx;
display: flex; display: flex;
width: 690rpx; width: 690rpx;
background: rgba(245,245,245,1); background: rgba(245,245,245,1);
@ -40,6 +92,7 @@ export default {
width: 210rpx; width: 210rpx;
height: 170rpx; height: 170rpx;
border-radius: 6rpx 0rpx 0rpx 6rpx; border-radius: 6rpx 0rpx 0rpx 6rpx;
background: rgba(245,245,245,1);
} }
.right { .right {
flex: 1; flex: 1;
@ -86,6 +139,22 @@ export default {
text-align: center; 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;
}
}
}
} }
} }
</style> </style>

View File

@ -2,17 +2,16 @@
<view> <view>
<view class="tloos"> <view class="tloos">
<view class="navs"> <view class="navs">
<image></image> <image src="/static/image/common/18.png"></image>
店铺 店铺
</view> </view>
<view class="navs" style="margin-right:30rpx"> <view class="navs" style="margin-right:30rpx">
<image></image> <image src="/static/image/common/19.png"></image>
客服 客服
</view> </view>
<view class="button" style="background:rgba(253,211,96,0.6);">试穿试送</view> <view class="button" style="background:rgba(253,211,96,0.6);">试穿试送</view>
<view class="button" style="background:rgba(253,211,96,1);" @click="buy(2)">加入购物车</view> <view class="button" style="background:rgba(253,211,96,1);" @click="buy(2)">加入购物车</view>
<view class="button" style="background:rgba(255,120,15,1);" @click="buy(1)">立即购买</view> <view class="button" style="background:rgba(255,120,15,1);" @click="buy(1)">立即购买</view>
</view> </view>
<u-popup v-model="show" mode="bottom"> <u-popup v-model="show" mode="bottom">
<scroll-view scroll-y="true" class="popup"> <scroll-view scroll-y="true" class="popup">

View File

@ -1,6 +1,19 @@
<template> <template>
<view class="sdetails"> <view class="sdetails">
<u-swiper :list="list" height="500" border-radius="0" mode="dot"></u-swiper> <u-swiper :list="list" height="500" border-radius="0" mode="dot"></u-swiper>
<view class="spike-view" v-if="type==3">
<view class="left">
<view class="price">
<view class="now-price">{{ groupbuyInfo.groupbuy_price }}</view>
<view class="origin-price">{{ groupbuyInfo.goods_price }}</view>
</view>
<view class="num">剩余数量{{ groupbuyInfo.inventory - groupbuyInfo.groupbuy_buy_quantity }}</view>
</view>
<view class="right">
<view class="title">秒杀倒计时</view>
<view class="time">{{ spikeTime }}</view>
</view>
</view>
<view class="info"> <view class="info">
<view class="title u-line-2"> <view class="title u-line-2">
<text>{{ goodsInfo.store_name }}</text>{{ goodsInfo.goods_name }} <text>{{ goodsInfo.store_name }}</text>{{ goodsInfo.goods_name }}
@ -19,15 +32,15 @@
<view class="group-user" v-if="groupUser.length"> <view class="group-user" v-if="groupUser.length">
<view class="top"> <view class="top">
<view class="title">{{ groupUser.length }}人正在拼团可直接参与</view> <view class="title">{{ groupUser.length }}人正在拼团可直接参与</view>
<view class="view-more"> <view class="view-more" @click="showGroupUser=true">
<text>查看全部</text> <text>查看全部</text>
<image src="/static/image/common/1.png"></image> <image src="/static/image/common/1.png"></image>
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="left"> <view class="left" @click="showGroupUser=true">
<view class="avatar"> <view class="avatar">
<image v-for="(user, i) in groupUser" :src="user[0].member_avatar" :key="i"></image> <image v-for="(user, i) in groupUser.slice(0, 3)" :src="user[0].member_avatar" :key="i"></image>
</view> </view>
<view class="all"> <view class="all">
<text>查看全部</text> <text>查看全部</text>
@ -35,12 +48,12 @@
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<view class="launch-user"> <view class="launch-user" @click="showGroupUser=true">
<image :src="groupUser[0][0].member_avatar"></image> <image :src="groupUser[0][0].member_avatar"></image>
<text class="u-line-1">{{ groupUser[0][0].member_nickname }}</text> <text class="u-line-1">{{ groupUser[0][0].member_nickname }}</text>
</view> </view>
<view class="involvement-user"> <view class="involvement-user">
<view class="item" v-for="(user, i) in groupUser.slice(1)" :key="i"> <view class="item" v-for="(user, i) in groupUser.slice(1, 5)" :key="i" @click="showGroupUser=true">
<image :src="user[0].member_avatar"></image> <image :src="user[0].member_avatar"></image>
<text class="u-line-1">{{ user[0].member_nickname }}</text> <text class="u-line-1">{{ user[0].member_nickname }}</text>
</view> </view>
@ -48,6 +61,33 @@
</view> </view>
</view> </view>
</view> </view>
<u-popup v-model="showGroupUser" mode="center">
<view class="launch-container">
<view class="title u-line-1">正在拼团</view>
<scroll-view class="launch-view">
<view class="launch-user">
<view class="item" v-for="(user, i) in groupUser" :src="user[0].member_avatar" :key="i" @click="involvemenGroup(user)">
<image class="avatar" :src="user[0].member_avatar"></image>
<view class="name u-line-1">{{ user[0].member_nickname }}</view>
</view>
</view>
</scroll-view>
<image class="close" src="/static/image/common/17.png" @click="showGroupUser=false"></image>
</view>
</u-popup>
<u-popup v-model="showInvolvementUser" mode="center">
<view class="involvement-container" v-if="involvemenGroupInfo.length">
<view class="title u-line-1">参与{{ involvemenGroupInfo[0].member_nickname }}的拼团</view>
<view class="involvement-view">
<view class="item" v-for="(user, i) in involvemenGroupInfo" :key="i">
<image class="avatar" :src="user.member_avatar"></image>
<view class="name u-line-1">{{ user.member_nickname }}</view>
</view>
</view>
<view class="involvement-btn" @click="withImmediate('involvement')">参与拼团</view>
<image class="close" src="/static/image/common/17.png" @click="showInvolvementUser=false"></image>
</view>
</u-popup>
<view class="xiangqing"> <view class="xiangqing">
<view class="heng"></view> <view class="heng"></view>
<view class="title">商品详情</view> <view class="title">商品详情</view>
@ -59,7 +99,23 @@
<!-- 拼团 tool --> <!-- 拼团 tool -->
<view class="group-tool" v-if="type==2"> <view class="group-tool" v-if="type==2">
<view class="launch" @click="withImmediate">发起拼团</view> <view class="launch" @click="withImmediate">发起拼团</view>
<view class="involvement">参与拼团</view> <view class="involvement" @click="showGroupUser=true">参与拼团</view>
</view>
<!-- 秒杀 -->
<view class="spike-tool" v-if="type==3">
<view class="left">
<view>
<image src="/static/image/common/18.png"></image>
<text>店铺</text>
</view>
<view>
<image src="/static/image/common/19.png"></image>
<text>客服</text>
</view>
</view>
<view class="btn" :class="{'cannot': groupbuyInfo.groupbuy_state == 32 || groupbuyInfo.inventory == groupbuyInfo.groupbuy_buy_quantity}">
{{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }}
</view>
</view> </view>
<!-- 普通商品 tool --> <!-- 普通商品 tool -->
<tloos @buy="buy" @xuanze="xuanze" :id="goodsInfo.goods_commonid" :info="info" v-if="type==1"></tloos> <tloos @buy="buy" @xuanze="xuanze" :id="goodsInfo.goods_commonid" :info="info" v-if="type==1"></tloos>
@ -78,26 +134,41 @@ export default {
info:{}, info:{},
glist:[], glist:[],
id:0, id:0,
type: '', // type: '', // 1 2 3 4
groupUser: [], // groupUser: [], //
avatarWidth: '', avatarWidth: '',
showGroupUser: false, //
showInvolvementUser: false, //
involvemenGroupInfo: [], //
groupbuyInfo: {}, //
spikeTime: '',
timer: '', //
} }
}, },
components:{ components:{
navs, navs,
tloos tloos
}, },
onLoad(option) { onLoad() {
this.id = option.id;
this.init(); this.init();
}, },
beforeDestroy() {
clearInterval(this.timer);
},
methods: { methods: {
init() { init() {
this.id = this.$store.state.goods_id;
this.type = this.$store.getters.getGoodsType; this.type = this.$store.getters.getGoodsType;
const info = this.$store.getters.getGoodsInfo; const info = this.$store.getters.getGoodsInfo;
console.log(info); if (this.type == 3) {
this.goodsInfo = info.goods; this.groupbuyInfo = this.$store.state.groupbuyInfo;
this.setSpikeTime();
}
// console.log(this.groupbuyInfo);
if(this.type == 2) {
this.groupUser = info.user; this.groupUser = info.user;
}
this.goodsInfo = info.goods;
// //
let list = []; let list = [];
info.goods_image[0].forEach(item => { info.goods_image[0].forEach(item => {
@ -109,6 +180,25 @@ export default {
this.list = list; this.list = list;
this.setTitle(); this.setTitle();
}, },
setSpikeTime() {
const time = this.groupbuyInfo.groupbuy_endtime;
// console.log(new Date(time*1000));
// console.log(new Date());
this.timer = setInterval(() => {
let spikeTime = time * 1000 - new Date();
//
const leave1 = spikeTime % (24*3600*1000) //
const hours = Math.floor(leave1/(3600*1000))
//
const leave2 = leave1 % (3600*1000) //
const minutes = Math.floor(leave2 / (60*1000))
//
const leave3 = leave2 % (60*1000) //
const seconds = Math.round(leave3 / 1000)
this.spikeTime = hours + ':' + minutes + ':' + seconds;
// console.log(this.spikeTime);
}, 1000)
},
buy(info){ buy(info){
if(info.type == 2){ if(info.type == 2){
this.$u.api.addCart({ this.$u.api.addCart({
@ -144,13 +234,50 @@ export default {
this.glist = res.data.spec_list; this.glist = res.data.spec_list;
}) })
}, },
withImmediate() { // pintuangroup_headid
this.$u.api.withImmediate({ withImmediate(type) {
let params = {
pintuan_id: this.id, pintuan_id: this.id,
}).then(res => { }
// console.log(this.involvemenGroupInfo);
if(type == 'involvement' && this.involvemenGroupInfo.length) {
Object.assign(params, { pintuangroup_headid: this.involvemenGroupInfo[0].user_id });
Object.assign(params, { pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id });
}
// console.log(params);
this.$u.api.withImmediate(params).then(res => {
this.showGroupUser = false;
this.showInvolvementUser = false;
if(res.errCode == 0) {
this.settlementOrder();
} else {
this.$u.toast(res.message);
}
}) })
}, },
settlementOrder() {
// ifcart 1: 0://
this.$u.api.settlementOrder({
ifcart: 0,
cart_id: [this.goodsInfo.goods_id + '|' + 1],
pintuan_id: this.involvemenGroupInfo[0].user_id,
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id
}).then(res => {
if(res.errCode == 0) {
this.$store.commit('orderType', 3);
this.$store.commit('updateOrderInfo', res.data)
this.$u.route({
url: '/pageC/cart/ConfirmOrder'
})
}
})
},
involvemenGroup(user) {
this.involvemenGroupInfo = user;
this.showGroupUser = false;
this.showInvolvementUser = true;
console.log(this.involvemenGroupInfo);
},
xuanze(id){ xuanze(id){
// console.log(id) // console.log(id)
this.getGoodsDetails(this.glist[id]) this.getGoodsDetails(this.glist[id])
@ -181,9 +308,69 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sdetails{ .sdetails {
padding-bottom: 98rpx; padding-bottom: 98rpx;
.info{ position: relative;
.spike-view {
position: absolute;
top: 396rpx;
left: 0;
width: 100%;
height: 104rpx;
background: rgba(255,120,15,1);
opacity: 0.96;
color:rgba(255,255,255,1);
display: flex;
align-items: center;
.left {
height: 104rpx;
flex: 1;
padding-left: 30rpx;
display: flex;
flex-direction: column;
justify-content: center;
.price {
margin-bottom: 22rpx;
display: flex;
align-items: center;
.now-price {
font-size: 32rpx;
font-weight: bold;
margin-right: 16rpx;
}
.origin-price {
font-size: 26rpx;
}
}
.num {
font-size: 22rpx;
font-weight: 500;
}
}
.right {
height: 104rpx;
width: 232rpx;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&::before {
position: absolute;
left: 0;
content: "";
width: 2rpx;
height: 104rpx;
background:rgba(255,255,255,1);
}
font-size: 26rpx;
font-weight: 500;
.title {
margin-bottom: 18rpx;
}
}
}
.info {
padding: 30rpx; padding: 30rpx;
.title{ .title{
flex-wrap: wrap; flex-wrap: wrap;
@ -211,7 +398,7 @@ export default {
} }
} }
} }
.hr{ .hr {
width: 100%; width: 100%;
height: 20rpx; height: 20rpx;
background-color: #ececec; background-color: #ececec;
@ -315,6 +502,133 @@ export default {
} }
} }
} }
.launch-container {
width: 558rpx;
height: 655rpx;
background: rgba(255,255,255,1);
border-radius: 20rpx;
position: relative;
overflow: hidden;
.title {
text-align: center;
padding: 40rpx 0;
font-size: 32rpx;
color: rgba(51,51,51,1);
position: relative;
&::after {
content: '';
position: absolute;
width: 558rpx;
height: 2rpx;
background: rgba(234,234,234,1);
bottom: 0;
left: 0;
}
}
.launch-view {
height: 500rpx;
box-sizing: border-box;
padding: 30rpx 50rpx;
.launch-user {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: flex-start;
justify-content: flex-start;
.item {
width: 96rpx;
height: 96rpx;
text-align: center;
margin-bottom: 30rpx;
.avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-bottom: 15rpx;
}
.name {
font-size: 22rpx;
color: rgba(153,153,153,1);
}
&:not(:nth-child(3n)) {
margin-right: 80rpx;
}
}
}
}
.close {
position: absolute;
width: 47rpx;
height: 47rpx;
top: 10rpx;
right: 20rpx;
border-radius: 50%;
}
}
.involvement-container {
width: 558rpx;
height: 486rpx;
background: rgba(255,255,255,1);
border-radius: 20rpx;
position: relative;
overflow: hidden;
.title {
text-align: center;
padding: 40rpx 0;
font-size: 32rpx;
color: rgba(51,51,51,1);
position: relative;
&::after {
content: '';
position: absolute;
width: 558rpx;
height: 2rpx;
background: rgba(234,234,234,1);
bottom: 0;
left: 0;
}
}
.involvement-view {
display: flex;
justify-content: center;
margin: 40rpx 0 70rpx;
.item {
width: 100rpx;
text-align: center;
margin-right: 10rpx;
.avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-bottom: 15rpx;
}
.name {
font-size: 22rpx;
color: rgba(153,153,153,1);
}
}
}
.involvement-btn {
width: 400rpx;
height: 88rpx;
background: rgba(255,120,15,1);
border-radius: 44rpx;
font-size: 30rpx;
color:rgba(255,255,255,1);
text-align: center;
line-height: 88rpx;
margin: 0 auto;
}
.close {
position: absolute;
width: 47rpx;
height: 47rpx;
top: 10rpx;
right: 20rpx;
border-radius: 50%;
}
}
.xiangqing{ .xiangqing{
display: flex; display: flex;
height: 85rpx; height: 85rpx;
@ -359,5 +673,45 @@ export default {
text-align: center; text-align: center;
} }
} }
.spike-tool {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 98rpx;
display: flex;
z-index: 99;
.left {
width: 190rpx;
display: flex;
align-items: center;
justify-content: space-around;
> view {
text-align: center;
> image {
width: 35rpx;
height: 35rpx;
margin-bottom: 15rpx;
}
> text {
display: block;
font-size: 24rpx;
color: rgba(102,102,102,1);
}
}
}
.btn {
flex: 1;
height: 98rpx;
line-height: 98rpx;
text-align: center;
font-size: 32rpx;
color: rgba(255,255,255,1);
background: rgba(255,120,15,1);
}
.cannot {
background: rgba(221,221,221,1);
}
}
} }
</style> </style>

View File

@ -112,6 +112,7 @@ export default {
couponStatus: false, couponStatus: false,
choiceCoupon: {}, // 使 choiceCoupon: {}, // 使
goodsClass: [], goodsClass: [],
orderType: '', // 1 2 3 4
} }
}, },
components: { components: {
@ -135,8 +136,9 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
this.orderInfo = this.$store.state.cartInfo; this.orderType = this.$store.state.orderType;
console.log(this.orderInfo); this.orderInfo = this.$store.state.orderInfo;
// console.log(this.orderInfo);
}, },
onShow() { onShow() {
// //
@ -170,12 +172,16 @@ export default {
}) })
} }
} }
this.$u.api.sendOrder({ let params = {
ifcart: 1, ifcart: 1,
cart_id: id, cart_id: id,
address_id: this.addressInfo.address_id, address_id: this.addressInfo.address_id,
buy_city_id: this.addressInfo.city_id, buy_city_id: this.addressInfo.city_id,
}).then(res => { }
// if(this.orderType == 3) {
// Object.assign(params, { pintuan_id: })
// }
this.$u.api.sendOrder(params).then(res => {
if(res.errCode == 0) { if(res.errCode == 0) {
this.$u.route({ this.$u.route({
url: '/pageC/cart/cashier', url: '/pageC/cart/cashier',

View File

@ -100,7 +100,8 @@ export default {
// ifcart 1: 0:// // ifcart 1: 0://
this.$u.api.settlementOrder({ ifcart: 1, cart_id: id }).then(res => { this.$u.api.settlementOrder({ ifcart: 1, cart_id: id }).then(res => {
if(res.errCode == 0) { if(res.errCode == 0) {
this.$store.commit('updateCart', res.data) this.$store.commit('orderType', 2);
this.$store.commit('updateOrderInfo', res.data);
this.$u.route({ this.$u.route({
url: '/pageC/cart/ConfirmOrder' url: '/pageC/cart/ConfirmOrder'
}) })

View File

@ -1,13 +1,13 @@
<template> <template>
<view class="group"> <view class="group">
<view> <view>
<u-tabs-swiper ref="uTabs" :list="tabList" :current="current" @change="tabsChange" :is-scroll="false" <u-tabs-swiper ref="uTabs" :list="tabList" name="gc_name" :current="current" @change="tabsChange" :is-scroll="true" active-color="#FF780F" swiperWidth="750" height="88" :show-bar="false"></u-tabs-swiper>
swiperWidth="750"></u-tabs-swiper>
</view> </view>
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" > <swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" >
<swiper-item class="swiper-item" v-for="(_, index) in tabList" :key="index"> <swiper-item class="swiper-item" v-for="(_, index) in tabList" :key="index">
<scroll-view scroll-y style="height: 800rpx;width: 100%;" @scrolltolower="onreachBottom"> <scroll-view scroll-y style="height: 800rpx;width: 100%;" @scrolltolower="onreachBottom">
{{ index }} <SpecialGoods v-for="(item, index) in pinTuanList" :key="index" :item="item" type='group'></SpecialGoods>
<u-empty text="暂无商品" mode="list" color="#000" v-if="!pinTuanList.length"></u-empty>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -18,21 +18,42 @@ import SpecialGoods from "../../components/shop/special-shop/index"
export default { export default {
data() { data() {
return { return {
tabList: [{name: '推荐'}, {name: '推荐'}, {name: '推荐'}], tabList: [],
current: 0, current: Number,
swiperCurrent: 0, swiperCurrent: 0,
page: 0,
pinTuanList: [],
} }
}, },
components: { components: {
SpecialGoods SpecialGoods
}, },
onShow() { onLoad() {
this.getPinTuanList(); this.getGoodsClass();
},
watch: {
current(index) {
console.log(this.tabList);
this.getPinTuanList(this.tabList[index].gc_id);
}
}, },
methods: { methods: {
getPinTuanList() { //
this.$u.api.getPinTuanList().then(res => { async getGoodsClass() {
return await this.$u.api.getGoodsClass().then(res => {
if(res.errCode == 0) {
this.tabList = res.data;
this.current = 0;
}
})
},
//
getPinTuanList(id) {
this.$u.api.getPinTuanList({
page: this.page,
gc_id: id,
}).then(res => {
this.pinTuanList = res.data;
}) })
}, },
// tabsswiper // tabsswiper

View File

@ -1,8 +1,8 @@
<template> <template>
<view class="member"> <view class="member">
<!-- <view> --> <view>
<u-tabs-swiper ref="tabs" :list="list" :is-scroll="false" active-color="#FF780F" :current="current" font-size="32" :show-bar="false" @change="tabsChange" height="88" ></u-tabs-swiper> <u-tabs-swiper ref="tabs" :list="list" :is-scroll="false" active-color="#FF780F" :current="current" font-size="32" :show-bar="false" @change="tabsChange" height="88" ></u-tabs-swiper>
<!-- </view> --> </view>
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{ height: swiperHeight }"> <swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{ height: swiperHeight }">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<view class="integral"> <view class="integral">
@ -65,7 +65,7 @@ export default {
}], }],
richHeight: '', richHeight: '',
swiperHeight: '', swiperHeight: '',
current: 0, current: Number,
swiperCurrent: 0, swiperCurrent: 0,
pointslogList: [], pointslogList: [],
memberInfo: {}, memberInfo: {},
@ -76,17 +76,19 @@ export default {
CouponView CouponView
}, },
onLoad(option) { onLoad(option) {
this.setViewHeight();
if(option.current) this.current = option.current; if(option.current) this.current = option.current;
else this.current = 0;
}, },
watch: { watch: {
current(value) { current(value) {
this.swiperCurrent = value; this.swiperCurrent = value;
} if(value == 2) {
},
onShow() {
this.getMemberPointsStat();
this.getPointslogList(); this.getPointslogList();
this.setViewHeight(); } else if(value == 0) {
this.getMemberPointsStat();
}
}
}, },
methods: { methods: {
tabsChange(index) { tabsChange(index) {

View File

@ -37,11 +37,13 @@
<!-- 秒杀 --> <!-- 秒杀 -->
<recommend v-if="JSON.stringify(recommendedSpike) != '{}'" :recommendData="recommendedSpike" type="spike"></recommend> <recommend v-if="JSON.stringify(recommendedSpike) != '{}'" :recommendData="recommendedSpike" type="spike"></recommend>
<view v-if="JSON.stringify(recommendedSpike) != '{}'" class="hr" style="margin-top:40rpx"></view> <view v-if="JSON.stringify(recommendedSpike) != '{}'" class="hr" style="margin-top:40rpx"></view>
<!-- 秒杀列表 -->
<seckill v-if="spikeList.length" :list="spikeList" :time="seckillTime"></seckill> <seckill v-if="spikeList.length" :list="spikeList" :time="seckillTime"></seckill>
<view v-if="spikeList.length" class="hr" style="margin-top:40rpx"></view> <view v-if="spikeList.length" class="hr" style="margin-top:40rpx"></view>
<!-- 拼团 --> <!-- 拼团推荐 -->
<pintuan v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush"></pintuan> <pintuan v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush"></pintuan>
<view class="hr" style="margin-top:40rpx" v-if="JSON.stringify(pinTuanPush) != '{}'"></view> <view class="hr" style="margin-top:40rpx" v-if="JSON.stringify(pinTuanPush) != '{}'"></view>
<!-- 拼团列表 -->
<group :groupList="pinTuanList" :classifyList="couponGroupList"></group> <group :groupList="pinTuanList" :classifyList="couponGroupList"></group>
<image class="lingquan"></image> <image class="lingquan"></image>
<youhq></youhq> <youhq></youhq>

BIN
static/image/common/17.png Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/image/common/18.png Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/image/common/19.png Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB