【优化】调整拼团单个商品配对多个规则的情况下,价格显示异常的情况。

This commit is contained in:
jianweie code
2024-02-01 12:54:20 +08:00
parent 6f6916ee91
commit f58d2a0257
2 changed files with 70 additions and 30 deletions

View File

@@ -5,7 +5,7 @@
<view class="coreshop-navbar-left-slot" slot="left">
<u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
<u-icon name="home" size="22" @click="goHome"></u-icon>
<u-icon name="home" size="22" @click="goHome"></u-icon>
</view>
<view slot="right">
</view>
@@ -87,7 +87,7 @@
<text class="font-color-orange">{{ goodsInfo.buyPinTuanCount || '0' }}</text>
</view>
<view class="coreshop-font-12">
<u-icon name="share-fill" size="18" label="分享" :labelSize="12" labelPos="right" @click="goShare"></u-icon>
<u-icon name="share-fill" size="18" label="分享" :labelSize="12" labelPos="right" @click="goShare"></u-icon>
</view>
<view class="coreshop-font-12">
<u-icon name="star-fill" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-if="isfav"></u-icon>
@@ -181,7 +181,7 @@
</view>
<view class="img-lower-box" :class="item[1].isOverdue?'coreshop-lower-box':''" v-if="item[1].isOverdue">已结束</view>
<view class="coreshop-cell-item-hd">
<u-avatar-group :urls="item[1].teams" keyName="userAvatar" size="35" gap="0.2" random-bg-color="true"></u-avatar-group>
<u-avatar-group :urls="item[1].teams" keyName="userAvatar" size="35" gap="0.2" random-bg-color="true"></u-avatar-group>
</view>
<view class="coreshop-cell-item-ft">
<u-button type="success" size="mini" @click="selectTap(2, item[1].teamId)" v-if="!item[1].isOverdue">去拼单</u-button>
@@ -279,7 +279,7 @@
<view class="coreshop-flex coreshop-align-center coreshop-justify-center coreshop-margin-bottom-10">
<view class="">
剩余时间
<u-count-down :time="teamInfo.lastTime * 1000" :autoStart="true" :millisecond="true" format="DD天HH时mm分ss秒"></u-count-down>
<u-count-down :time="teamInfo.lastTime * 1000" :autoStart="true" :millisecond="true" format="DD天HH时mm分ss秒"></u-count-down>
</view>
</view>
<view class="ig-top-m coreshop-flex coreshop-align-center coreshop-justify-center coreshop-margin-bottom-10">
@@ -505,8 +505,10 @@
</view>
</u-popup>
<vk-data-goods-sku-popup v-model="skuKey" border-radius="20" :amount-type="0" :localdata="goodsSkuInfo" mode="3" @open="openSkuPopup" @close="closeSkuPopup" @buy-now="buyNow"></vk-data-goods-sku-popup>
<vk-data-goods-sku-popup v-model="skuSingleKey" border-radius="20" :amount-type="0" :localdata="discountsGoodsSkuInfo" mode="3" @open="openSkuSinglePopup" @close="closeSkuSinglePopup" @buy-now="buyNow"></vk-data-goods-sku-popup>
<vk-data-goods-sku-popup v-model="skuSingleKey" border-radius="20" :amount-type="0" :localdata="goodsSkuInfo" mode="3" @open="openSkuSinglePopup" @close="closeSkuSinglePopup" @buy-now="buyNowForSingle" buy-now-text="单独购买"></vk-data-goods-sku-popup>
<vk-data-goods-sku-popup v-model="skuKey" border-radius="20" :amount-type="0" :localdata="discountsGoodsSkuInfo" mode="3" @open="openSkuPopup" @close="closeSkuPopup" @buy-now="buyNow" buy-now-text="发起拼团"></vk-data-goods-sku-popup>
<!-- 右边浮动球 -->
<coreshop-fab horizontal="right" vertical="bottom" direction="vertical"></coreshop-fab>
@@ -681,19 +683,7 @@
onChange(e) {
this.timeData = e
},
// 打开sku弹出
openSkuPopup() {
this.skuKey = true;
},
closeSkuPopup() {
this.skuKey = false;
},
openSkuSinglePopup() {
this.skuSingleKey = true;
},
closeSkuSinglePopup() {
this.skuSingleKey = false;
},
// 立即购买
buyNow(selectShop) {
var that = this;
@@ -731,6 +721,37 @@
}
that.closeSkuPopup();
},
// 立即购买
buyNowForSingle(selectShop) {
var that = this;
uni.showLoading({
title: '加载中'
});
if (!this.hasLogin) {
uni.hideLoading();
this.$store.commit('showLoginTip', true);
return false;
}
if (selectShop.buy_num > 0) {
let data = {
productId: selectShop._id,
nums: selectShop.buy_num,
type: 2,
cartType: this.$globalConstVars.paymentType.common
}
this.$u.api.addCart(data).then(res => {
if (res.status) {
let cartIds = res.data;
that.$u.route('/pages/placeOrder/index/index?cartIds=' + JSON.stringify(cartIds));
uni.hideLoading();
} else {
this.$u.toast(res.msg);
uni.hideLoading();
}
});
}
that.closeSkuPopup();
},
getServiceDescription() {
let _this = this;
this.$u.api.getServiceDescription().then(res => {
@@ -844,6 +865,9 @@
if (userToken) {
_this.goodsBrowsing();
}
}
}
});
@@ -1025,12 +1049,29 @@
} else {
this.price = this.product.price;
}
if (type == 1) {
this.openSkuPopup();
} else if (type == 2) {
if (type === 1) {
this.openSkuSinglePopup();
} else if (type === 2) {
this.openSkuPopup();
}
},
// 打开sku弹出
openSkuPopup() {
this.skuKey = true;
this.skuSingleKey = false;
},
closeSkuPopup() {
this.skuKey = false;
this.skuSingleKey = false;
},
openSkuSinglePopup() {
this.skuSingleKey = true;
this.skuKey = false;
},
closeSkuSinglePopup() {
this.skuSingleKey = false;
this.skuKey = false;
},
showModal() {
this.bottomModal = true;
},