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

@@ -112,6 +112,7 @@ export default {
couponStatus: false,
choiceCoupon: {}, // 使用的平台优惠券
goodsClass: [],
orderType: '', // 订单类型 1 普通订单 2 购物车订单 3 拼团订单 4 秒杀订单
}
},
components: {
@@ -135,8 +136,9 @@ export default {
}
},
onLoad(option) {
this.orderInfo = this.$store.state.cartInfo;
console.log(this.orderInfo);
this.orderType = this.$store.state.orderType;
this.orderInfo = this.$store.state.orderInfo;
// console.log(this.orderInfo);
},
onShow() {
// 判断是不是从选择地址页面返回
@@ -170,12 +172,16 @@ export default {
})
}
}
this.$u.api.sendOrder({
let params = {
ifcart: 1,
cart_id: id,
address_id: this.addressInfo.address_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) {
this.$u.route({
url: '/pageC/cart/cashier',

View File

@@ -100,7 +100,8 @@ export default {
// ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
this.$u.api.settlementOrder({ ifcart: 1, cart_id: id }).then(res => {
if(res.errCode == 0) {
this.$store.commit('updateCart', res.data)
this.$store.commit('orderType', 2);
this.$store.commit('updateOrderInfo', res.data);
this.$u.route({
url: '/pageC/cart/ConfirmOrder'
})

View File

@@ -1,13 +1,13 @@
<template>
<view class="group">
<view>
<u-tabs-swiper ref="uTabs" :list="tabList" :current="current" @change="tabsChange" :is-scroll="false"
swiperWidth="750"></u-tabs-swiper>
<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>
</view>
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" >
<swiper-item class="swiper-item" v-for="(_, index) in tabList" :key="index">
<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>
</swiper-item>
</swiper>
@@ -18,21 +18,42 @@ import SpecialGoods from "../../components/shop/special-shop/index"
export default {
data() {
return {
tabList: [{name: '推荐'}, {name: '推荐'}, {name: '推荐'}],
current: 0,
tabList: [],
current: Number,
swiperCurrent: 0,
page: 0,
pinTuanList: [],
}
},
components: {
SpecialGoods
},
onShow() {
this.getPinTuanList();
onLoad() {
this.getGoodsClass();
},
watch: {
current(index) {
console.log(this.tabList);
this.getPinTuanList(this.tabList[index].gc_id);
}
},
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;
})
},
// tabs通知swiper切换