fixing bug 8.11

This commit is contained in:
2020-08-11 18:24:56 +08:00
parent 9a0dc4c6d1
commit 523dadd55d
4 changed files with 40 additions and 12 deletions

View File

@@ -27,10 +27,10 @@
<text>{{ goodsInfo.pintuan_price || '0.00' }}</text>
<s>{{ goodsInfo.goods_price || '0.00' }}</s>
</view>
<view class="collect" @click="switchCollect(goodsInfo.goods_collect)">
<u-icon name="star" color="#474747" size="28" v-if="!goodsInfo.goods_collect"></u-icon>
<view class="collect" @click="switchCollect(goodsInfo.is_collect)">
<u-icon name="star" color="#474747" size="28" v-if="goodsInfo.is_collect == 0"></u-icon>
<u-icon name="star-fill" color="#FF7807" size="28" v-else></u-icon>
<text>{{ !goodsInfo.goods_collect ? '收藏' : '已收藏' }}</text>
<text>{{ !goodsInfo.is_collect == 1 ? '收藏' : '已收藏' }}</text>
</view>
</view>
</view>
@@ -139,7 +139,6 @@
</view>
<view style="height:100rpx"></view>
</view>
<u-toast ref="uToast" />
</scroll-view>
</u-popup>
<!-- 普通商品 tool -->
@@ -180,7 +179,7 @@
<view class="btn" v-else @click="spikeGoods">立即秒杀</view>
</view>
<!-- <tloos @buy="buy" @xuanze="xuanze" :id="id" :info="goodsInfo" :type="type"></tloos> -->
<u-toast ref="uToast" />
<u-toast ref="uToast" :z-index='200000' />
</view>
</template>
<script>
@@ -467,6 +466,19 @@ export default {
}
})
},
// 验证能否拼团
async pintuanVerify({ pintuan_id, pintuangroup_headid }) {
const res = await this.$u.api.pintuanVerify({
pintuan_id: pintuan_id,
pintuangroup_headid: pintuangroup_headid,
})
if(res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
});
}
return res.errCode;
},
/*
* @description 下单 订单步骤1展示结算数据
* @params {Number} type involvement 拼团或者 默认开团
@@ -495,13 +507,21 @@ export default {
}
}
if(!this.debounce) return;
this.debounce = false;
let params = {
ifcart: ifcart,
cart_id: [this.goodsInfo.goods_id + '|' + num],
}
if(this.type == 2) {
if(type == 'involvement') {
// 验证能否拼团
let status = this.pintuanVerify({
pintuan_id: this.pintuan_id,
pintuangroup_headid: this.involvemenGroupInfo[0].user_id
}).then(status => {
if(status != 0) return true;
})
// console.log(status);
if(status) return false;
this.$store.commit('setGroupHeadId', this.involvemenGroupInfo[0].user_id);
Object.assign(params, {
pintuan_id: this.pintuan_id,
@@ -513,6 +533,7 @@ export default {
})
}
}
this.debounce = false;
this.$u.api.settlementOrder(params).then(res => {
if(res.errCode == 0) {
// console.log('type' + this.type);
@@ -608,7 +629,7 @@ export default {
})
},
switchCollect(status) {
if(status) {
if(status == 1) {
this.removeFavorite();
} else {
this.addFavoriteGoods();