mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-09-21 20:32:03 +08:00
feat(buyer): 更新电子卡券(E_COUPON)相关逻辑与展示
- 优化购物车与支付页面,确保电子卡券只能通过立即购买结算 - 增强商品详情页,添加限时折扣与第N件优惠展示 - 更新促销逻辑,支持拼团与积分购买选项 - 规范化商品类型与库存提示,提升用户体验
This commit is contained in:
@@ -248,6 +248,7 @@ import Promotion from "@/components/goodsDetail/Promotion";
|
||||
import Search from "@/components/Search";
|
||||
import * as APICart from "@/api/cart";
|
||||
import * as APIMember from "@/api/member";
|
||||
import { isECoupon } from "@/constants/goodsType";
|
||||
export default {
|
||||
name: "Cart",
|
||||
beforeRouteEnter(to, from, next) {
|
||||
@@ -407,11 +408,20 @@ export default {
|
||||
},
|
||||
// 跳转支付页面
|
||||
pay() {
|
||||
if (this.checkedNum) {
|
||||
this.$router.push({ path: "/pay", query: { way: "CART" } });
|
||||
} else {
|
||||
if (!this.checkedNum) {
|
||||
Message.warning("请至少选择一件商品");
|
||||
return;
|
||||
}
|
||||
const hasECoupon = this.cartList.some((shop) =>
|
||||
(shop.skuList || []).some(
|
||||
(goods) => goods.checked && isECoupon(goods.goodsSku && goods.goodsSku.goodsType)
|
||||
)
|
||||
);
|
||||
if (hasECoupon) {
|
||||
Message.warning("电子卡券请使用立即购买,不可通过购物车结算");
|
||||
return;
|
||||
}
|
||||
this.$router.push({ path: "/pay", query: { way: "CART" } });
|
||||
},
|
||||
// 展示优惠券
|
||||
showCoupon(storeId, index) {
|
||||
|
||||
Reference in New Issue
Block a user