mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 02:47:29 +08:00
feat(buyer): 更新电子卡券(E_COUPON)相关逻辑与展示
- 优化购物车与支付页面,确保电子卡券只能通过立即购买结算 - 增强商品详情页,添加限时折扣与第N件优惠展示 - 更新促销逻辑,支持拼团与积分购买选项 - 规范化商品类型与库存提示,提升用户体验
This commit is contained in:
@@ -65,7 +65,7 @@ export function addCartGoods (params) {
|
||||
/**
|
||||
* 创建交易
|
||||
* @param client 客户端:H5/移动端 PC/PC端,WECHAT_MP/小程序端,APP/移动应用端
|
||||
* @param way 购物车购买:CART/立即购买:BUY_NOW / 积分购买:POINT
|
||||
* @param way 购物车:CART / 立即购买:BUY_NOW / 积分:POINTS / 拼团:PINTUAN / 砍价:KANJIA
|
||||
* @param remark 备注 非必填
|
||||
*/
|
||||
export function createTrade (data) {
|
||||
@@ -81,7 +81,7 @@ export function createTrade (data) {
|
||||
/**
|
||||
* 选择优惠券
|
||||
* @param memberCouponId 优惠券id
|
||||
* @param way 购物车购买:CART/立即购买:BUY_NOW/ 积分购买:POINT
|
||||
* @param way 购物车:CART / 立即购买:BUY_NOW / 积分:POINTS
|
||||
* @param used 使用true 弃用 false
|
||||
*/
|
||||
export function selectCoupon (params) {
|
||||
@@ -95,7 +95,7 @@ export function selectCoupon (params) {
|
||||
|
||||
/**
|
||||
* 选择礼品卡
|
||||
* @param way 购物车购买:CART/立即购买:BUY_NOW/拼团购买:PINTUAN / 积分购买:POINT
|
||||
* @param way 购物车:CART / 立即购买:BUY_NOW / 拼团:PINTUAN / 积分:POINTS / 砍价:KANJIA
|
||||
* @param credentialId 礼品卡凭证 id;used=false 且不传则清空全部
|
||||
* @param used 使用 true / 弃用 false
|
||||
*/
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
<!-- 限时秒杀 -->
|
||||
<Promotion
|
||||
v-if="!isECouponGoods && promotionMap['SECKILL']"
|
||||
v-if="promotionMap['SECKILL']"
|
||||
:time="promotionMap['SECKILL'].endTime"
|
||||
></Promotion>
|
||||
<!-- 商品详细 价格、优惠券、促销 -->
|
||||
@@ -80,7 +80,7 @@
|
||||
<!-- 秒杀价格 -->
|
||||
<div
|
||||
class="item-price-row"
|
||||
v-if="skuDetail.promotionPrice && !isECouponGoods && promotionMap['SECKILL']"
|
||||
v-if="skuDetail.promotionPrice && promotionMap['SECKILL']"
|
||||
>
|
||||
<p>
|
||||
<span class="item-price-title" v-if="promotionMap['SECKILL']"
|
||||
@@ -126,7 +126,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 优惠券展示 -->
|
||||
<div class="item-price-coupon-row" v-if="!isECouponGoods && promotionMap['COUPON'].length">
|
||||
<div class="item-price-coupon-row" v-if="promotionMap['COUPON'].length">
|
||||
<div class="Ellipsis">
|
||||
<span class="item-price-title">优 惠 券</span>
|
||||
<span>
|
||||
@@ -165,8 +165,38 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 限时折扣 -->
|
||||
<div class="item-price-row" v-if="promotionMap['DISCOUNT']">
|
||||
<p>
|
||||
<span class="item-price-title">促 销</span>
|
||||
<span class="item-promotion">限时折扣</span>
|
||||
<span class="item-desc-pintuan" v-if="promotionMap['DISCOUNT'].discount">
|
||||
享 {{ promotionMap["DISCOUNT"].discount }} 折
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<!-- 第N件优惠 -->
|
||||
<div class="item-price-row" v-if="promotionMap['NTH']">
|
||||
<p>
|
||||
<span class="item-price-title">促 销</span>
|
||||
<span class="item-promotion">第N件</span>
|
||||
<span class="item-desc-pintuan">
|
||||
第 {{ promotionMap["NTH"].nthNum || promotionMap["NTH"].num }} 件优惠
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<!-- 拼团 -->
|
||||
<div class="item-price-row" v-if="promotionMap['PINTUAN']">
|
||||
<p>
|
||||
<span class="item-price-title">拼 团</span>
|
||||
<span class="item-promotion">拼团价</span>
|
||||
<span class="item-desc-pintuan" v-if="promotionMap['PINTUAN'].price">
|
||||
{{ $filters.unitPrice(promotionMap["PINTUAN"].price, "¥") }}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<!-- 满减展示 -->
|
||||
<div class="item-price-row" v-if="!isECouponGoods && promotionMap['FULL_DISCOUNT']">
|
||||
<div class="item-price-row" v-if="promotionMap['FULL_DISCOUNT']">
|
||||
<p>
|
||||
<span class="item-price-title"
|
||||
>促 销</span>
|
||||
@@ -294,6 +324,14 @@
|
||||
@click="addShoppingCartBtn"
|
||||
>加入购物车</el-button
|
||||
>
|
||||
<el-button
|
||||
class="goods-action-btn"
|
||||
v-if="promotionMap['PINTUAN']"
|
||||
:loading="loadingPintuan"
|
||||
:disabled="isOutOfStock"
|
||||
@click="pintuanBuy"
|
||||
>拼团购买</el-button
|
||||
>
|
||||
<el-button
|
||||
class="goods-action-btn"
|
||||
:loading="loading1"
|
||||
@@ -334,6 +372,11 @@ import {
|
||||
isECoupon,
|
||||
getECouponStock,
|
||||
getECouponMaxBuyNum,
|
||||
createEmptyPromotionMap,
|
||||
resolveECouponCartType,
|
||||
E_COUPON_CART_BUY_NOW,
|
||||
E_COUPON_CART_PINTUAN,
|
||||
E_COUPON_CART_POINTS,
|
||||
} from "@/constants/goodsType";
|
||||
|
||||
export default {
|
||||
@@ -377,15 +420,11 @@ export default {
|
||||
specList: [],
|
||||
}, // sku详情
|
||||
goodsSpecList: this.detail.specs, // 商品spec
|
||||
promotionMap: {
|
||||
// 活动状态
|
||||
SECKILL: null,
|
||||
FULL_DISCOUNT: null,
|
||||
COUPON: [],
|
||||
}, // 促销活动
|
||||
promotionMap: createEmptyPromotionMap(),
|
||||
formatList: [], // 选择商品品类的数组
|
||||
loading: false, // 立即购买loading
|
||||
loading1: false, // 加入购物车loading
|
||||
loadingPintuan: false,
|
||||
isCollected: false, // 是否收藏
|
||||
};
|
||||
},
|
||||
@@ -412,7 +451,7 @@ export default {
|
||||
})
|
||||
: [];
|
||||
},
|
||||
/** 卡密商品:禁加购/禁促销,仅立即购买,库存用 poolStock(FR-B-01 / P-06) */
|
||||
/** 卡密商品:禁加购,仅立即购买;库存读 quantity(M-02 起支持促销) */
|
||||
isECouponGoods() {
|
||||
return isECoupon(this.skuDetail.goodsType);
|
||||
},
|
||||
@@ -539,21 +578,32 @@ export default {
|
||||
});
|
||||
},
|
||||
buyNow() {
|
||||
// 立即购买
|
||||
this.startCheckout(E_COUPON_CART_BUY_NOW, "loading1");
|
||||
},
|
||||
pintuanBuy() {
|
||||
this.startCheckout(E_COUPON_CART_PINTUAN, "loadingPintuan");
|
||||
},
|
||||
pointPay() {
|
||||
this.startCheckout(E_COUPON_CART_POINTS, "loading");
|
||||
},
|
||||
startCheckout(action, loadingKey) {
|
||||
const params = {
|
||||
num: this.count,
|
||||
skuId: this.skuDetail.id,
|
||||
cartType: "BUY_NOW",
|
||||
};
|
||||
// 虚拟商品:cartType=VIRTUAL(核销码流程)
|
||||
if (this.skuDetail.goodsType === "VIRTUAL_GOODS") {
|
||||
params.cartType = "VIRTUAL";
|
||||
} else if (this.isECouponGoods) {
|
||||
params.cartType = resolveECouponCartType({
|
||||
routeWay: this.$route.query.way,
|
||||
action,
|
||||
});
|
||||
}
|
||||
// E_COUPON 卡密商品:cartType 须保持 BUY_NOW,勿用 VIRTUAL(FR-B-01 / EC-24)
|
||||
this.loading1 = true;
|
||||
this[loadingKey] = true;
|
||||
addCartGoods(params)
|
||||
.then((res) => {
|
||||
this.loading1 = false;
|
||||
this[loadingKey] = false;
|
||||
if (res.success) {
|
||||
this.$router.push({
|
||||
path: "/pay",
|
||||
@@ -564,7 +614,7 @@ export default {
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading1 = false;
|
||||
this[loadingKey] = false;
|
||||
});
|
||||
},
|
||||
async collect() {
|
||||
@@ -642,16 +692,20 @@ export default {
|
||||
});
|
||||
},
|
||||
promotion() {
|
||||
this.promotionMap = {SECKILL: null, FULL_DISCOUNT: null, COUPON: []};
|
||||
// 格式化促销活动,返回当前促销的对象
|
||||
if (!this.detail.promotionMap) return false;
|
||||
let keysArr = Object.keys(this.detail.promotionMap);
|
||||
this.promotionMap = createEmptyPromotionMap();
|
||||
if (!this.detail || !this.detail.promotionMap) return false;
|
||||
const keysArr = Object.keys(this.detail.promotionMap);
|
||||
if (keysArr.length === 0) return false;
|
||||
|
||||
for (let i = 0; i < keysArr.length; i++) {
|
||||
let key = keysArr[i].split("-")[0];
|
||||
const key = keysArr[i].split("-")[0];
|
||||
if (key === "COUPON") {
|
||||
this.promotionMap[key].push(this.detail.promotionMap[keysArr[i]]);
|
||||
if (!Array.isArray(this.promotionMap.COUPON)) {
|
||||
this.promotionMap.COUPON = [];
|
||||
}
|
||||
this.promotionMap.COUPON.push(this.detail.promotionMap[keysArr[i]]);
|
||||
} else if (Object.prototype.hasOwnProperty.call(this.promotionMap, key)) {
|
||||
this.promotionMap[key] = this.detail.promotionMap[keysArr[i]];
|
||||
} else {
|
||||
this.promotionMap[key] = this.detail.promotionMap[keysArr[i]];
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* 卡密商品(E_COUPON / 电子卡券)— 买家端公共常量与工具
|
||||
*
|
||||
* 与 VIRTUAL_GOODS(核销型虚拟)区分:E_COUPON 仅立即购买(BUY_NOW),
|
||||
* 支付后自动发卡,订单终态 COMPLETED;可售库存优先读 poolStock。
|
||||
* 需求:lilishop/docs/requirements/card-key-goods-v4.md
|
||||
* 与 VIRTUAL_GOODS(核销型虚拟)区分:E_COUPON 常规促销走 BUY_NOW,
|
||||
* 特殊活动走 PINTUAN / POINTS / KANJIA;禁止 CART / VIRTUAL。
|
||||
* 需求:lilishop/docs/requirements/card-key-goods-v4.md · M-02
|
||||
*
|
||||
* @author Mike
|
||||
* @date 2026-07-31
|
||||
@@ -11,9 +11,15 @@
|
||||
export const E_COUPON_GOODS_TYPE = "E_COUPON";
|
||||
export const E_COUPON_ORDER_TYPE = "E_COUPON";
|
||||
|
||||
/** 单次购买数量上限(O-09 待拍板默认值:min(poolStock, 999)) */
|
||||
/** 单次购买数量上限(O-09 默认:min(quantity, 999)) */
|
||||
export const E_COUPON_MAX_BUY_NUM = 999;
|
||||
|
||||
/** 常规立即购买(秒杀/满减/券/限时/第N件等) */
|
||||
export const E_COUPON_CART_BUY_NOW = "BUY_NOW";
|
||||
export const E_COUPON_CART_PINTUAN = "PINTUAN";
|
||||
export const E_COUPON_CART_POINTS = "POINTS";
|
||||
export const E_COUPON_CART_KANJIA = "KANJIA";
|
||||
|
||||
export function isECoupon(goodsType) {
|
||||
return goodsType === E_COUPON_GOODS_TYPE;
|
||||
}
|
||||
@@ -22,13 +28,9 @@ export function isECouponOrder(orderType) {
|
||||
return orderType === E_COUPON_ORDER_TYPE;
|
||||
}
|
||||
|
||||
/** 可售库存:优先 poolStock */
|
||||
/** 可售库存:E_COUPON 读 SKU quantity(由卡池 syncSkuStock 同步) */
|
||||
export function getECouponStock(sku) {
|
||||
if (!sku) return 0;
|
||||
const pool = sku.poolStock;
|
||||
if (pool !== undefined && pool !== null) {
|
||||
return Number(pool) || 0;
|
||||
}
|
||||
return Number(sku.quantity) || 0;
|
||||
}
|
||||
|
||||
@@ -37,3 +39,167 @@ export function getECouponMaxBuyNum(sku) {
|
||||
if (stock <= 0) return 1;
|
||||
return Math.min(stock, E_COUPON_MAX_BUY_NUM);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析 E_COUPON 结算 cartType / way
|
||||
* @param {object} opts
|
||||
* @param {string} [opts.routeWay] 路由 query.way
|
||||
* @param {'BUY_NOW'|'PINTUAN'|'POINTS'|'KANJIA'} [opts.action] 用户点击的购买入口
|
||||
*/
|
||||
export function resolveECouponCartType({ routeWay, action } = {}) {
|
||||
if (action === E_COUPON_CART_PINTUAN) return E_COUPON_CART_PINTUAN;
|
||||
if (action === E_COUPON_CART_POINTS) return E_COUPON_CART_POINTS;
|
||||
if (action === E_COUPON_CART_KANJIA) return E_COUPON_CART_KANJIA;
|
||||
if (action === E_COUPON_CART_BUY_NOW) return E_COUPON_CART_BUY_NOW;
|
||||
const way = routeWay ? String(routeWay).toUpperCase() : "";
|
||||
if (way === "KANJIA") return E_COUPON_CART_KANJIA;
|
||||
if (way === "PINTUAN") return E_COUPON_CART_PINTUAN;
|
||||
if (way === "POINT" || way === "POINTS") return E_COUPON_CART_POINTS;
|
||||
return E_COUPON_CART_BUY_NOW;
|
||||
}
|
||||
|
||||
/** 详情页 promotionMap 初始结构(切换 SKU 时完整重置) */
|
||||
export function createEmptyPromotionMap() {
|
||||
return {
|
||||
SECKILL: null,
|
||||
FULL_DISCOUNT: null,
|
||||
COUPON: [],
|
||||
DISCOUNT: null,
|
||||
NTH: null,
|
||||
PINTUAN: null,
|
||||
KANJIA: null,
|
||||
};
|
||||
}
|
||||
|
||||
/** 卡密履约状态(与后端 CardKeyFulfillStatusEnum 一致) */
|
||||
export const CARD_KEY_FULFILL_STATUS = {
|
||||
PENDING: "PENDING",
|
||||
DELIVERED: "DELIVERED",
|
||||
FAILED: "FAILED",
|
||||
NOT_APPLICABLE: "NOT_APPLICABLE",
|
||||
};
|
||||
|
||||
export const CARD_KEY_FULFILL_STATUS_TEXT = {
|
||||
PENDING: "待发放",
|
||||
DELIVERED: "已发放",
|
||||
FAILED: "发放失败",
|
||||
NOT_APPLICABLE: "不适用",
|
||||
};
|
||||
|
||||
export function cardKeyFulfillAlertType(status) {
|
||||
const map = {
|
||||
PENDING: "info",
|
||||
DELIVERED: "success",
|
||||
FAILED: "warning",
|
||||
};
|
||||
return map[status] || "info";
|
||||
}
|
||||
|
||||
export function formatCardKeyFulfillStatus(status) {
|
||||
return CARD_KEY_FULFILL_STATUS_TEXT[status] || status || "—";
|
||||
}
|
||||
|
||||
export function resolveCardKeyFulfillMessage(line) {
|
||||
if (line && line.message) return line.message;
|
||||
return formatCardKeyFulfillStatus(line?.status);
|
||||
}
|
||||
|
||||
export function isCardKeyFulfillApplicable(item) {
|
||||
if (!item) return false;
|
||||
const status = item.cardKeyFulfillStatus;
|
||||
if (status) return status !== CARD_KEY_FULFILL_STATUS.NOT_APPLICABLE;
|
||||
if (item.cardKeyDelivered != null || (item.cardKeys && item.cardKeys.length)) return true;
|
||||
return item.goodsType === E_COUPON_GOODS_TYPE;
|
||||
}
|
||||
|
||||
function normalizeCardKeyFulfillLine(source) {
|
||||
const status =
|
||||
source.cardKeyFulfillStatus ||
|
||||
(source.cardKeyDelivered
|
||||
? CARD_KEY_FULFILL_STATUS.DELIVERED
|
||||
: CARD_KEY_FULFILL_STATUS.PENDING);
|
||||
const cardKeys =
|
||||
status === CARD_KEY_FULFILL_STATUS.DELIVERED && source.cardKeyDelivered
|
||||
? source.cardKeys || []
|
||||
: [];
|
||||
return {
|
||||
key: source.sn || source.orderSn || source.id || source.skuId,
|
||||
goodsName: source.goodsName,
|
||||
status,
|
||||
message: source.cardKeyFulfillMessage,
|
||||
cardKeys,
|
||||
isGift: !!source.isGift,
|
||||
};
|
||||
}
|
||||
|
||||
/** 汇总 E_COUPON 主单行 + 满赠子单摘要的履约行 */
|
||||
export function collectCardKeyFulfillLines(orderItems = [], giftSummaries = []) {
|
||||
const lines = [];
|
||||
(orderItems || []).forEach((item) => {
|
||||
if (!isCardKeyFulfillApplicable(item)) return;
|
||||
lines.push(normalizeCardKeyFulfillLine(item));
|
||||
});
|
||||
(giftSummaries || []).forEach((gift) => {
|
||||
lines.push(normalizeCardKeyFulfillLine({ ...gift, isGift: true }));
|
||||
});
|
||||
return lines;
|
||||
}
|
||||
|
||||
export function orderHasCardKeySection({ orderItems, giftSummaries, isECouponOrder } = {}) {
|
||||
if (isECouponOrder) return true;
|
||||
if (Array.isArray(giftSummaries) && giftSummaries.length > 0) return true;
|
||||
if (collectCardKeyFulfillLines(orderItems, []).length > 0) return true;
|
||||
return (orderItems || []).some(
|
||||
(item) =>
|
||||
item.goodsType === E_COUPON_GOODS_TYPE ||
|
||||
(Array.isArray(item.cardKeys) && item.cardKeys.length > 0)
|
||||
);
|
||||
}
|
||||
|
||||
export function flattenCardKeyFulfillLines(lines, withGoodsName = false) {
|
||||
const rows = [];
|
||||
(lines || []).forEach((line) => {
|
||||
if (line.status !== CARD_KEY_FULFILL_STATUS.DELIVERED) return;
|
||||
(line.cardKeys || []).forEach((ck) => {
|
||||
rows.push(withGoodsName ? { ...ck, goodsName: line.goodsName } : { ...ck });
|
||||
});
|
||||
});
|
||||
return rows;
|
||||
}
|
||||
|
||||
/** 订单是否含已交付或可展示的卡密行(含满赠 E_COUPON 子单行) */
|
||||
export function orderHasCardKeyContent(orderItems, giftSummaries) {
|
||||
const lines = collectCardKeyFulfillLines(orderItems, giftSummaries);
|
||||
return flattenCardKeyFulfillLines(lines).length > 0;
|
||||
}
|
||||
|
||||
/** 扁平化订单项卡密(仅 cardKeyDelivered 且含 cardKeys;兼容旧逻辑) */
|
||||
export function flattenOrderCardKeys(orderItems, withGoodsName = false, giftSummaries) {
|
||||
const lines = collectCardKeyFulfillLines(orderItems, giftSummaries);
|
||||
if (lines.some((line) => line.status)) {
|
||||
return flattenCardKeyFulfillLines(lines, withGoodsName);
|
||||
}
|
||||
const rows = [];
|
||||
(orderItems || []).forEach((item) => {
|
||||
if (!item.cardKeyDelivered || !item.cardKeys || !item.cardKeys.length) return;
|
||||
item.cardKeys.forEach((ck) => {
|
||||
rows.push(withGoodsName ? { ...ck, goodsName: item.goodsName } : { ...ck });
|
||||
});
|
||||
});
|
||||
return rows;
|
||||
}
|
||||
|
||||
/** createTrade 后是否无需进入收银台(积分单 / 0 元 / 服务端已标记) */
|
||||
export function shouldSkipPaymentPage(tradeResult, way) {
|
||||
if (!tradeResult) return false;
|
||||
if (way === E_COUPON_CART_POINTS) return true;
|
||||
if (tradeResult.needPay === false || tradeResult.paid === true) return true;
|
||||
const price =
|
||||
tradeResult.price != null
|
||||
? Number(tradeResult.price)
|
||||
: tradeResult.flowPrice != null
|
||||
? Number(tradeResult.flowPrice)
|
||||
: null;
|
||||
if (price != null && !Number.isNaN(price) && price <= 0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -132,35 +132,59 @@
|
||||
</template>
|
||||
<div v-else style="color: #999; margin-left: 5px">未开发票</div>
|
||||
</div>
|
||||
<!-- 电子卡券:卡密信息(PC 内嵌) -->
|
||||
<div class="order-card ecoupon-card-keys" v-if="isECouponOrder">
|
||||
<!-- 卡密信息(E_COUPON 主单或满赠子单,以 cardKeyFulfillStatus 为准) -->
|
||||
<div class="order-card ecoupon-card-keys" v-if="hasCardKeySection">
|
||||
<h3>卡密信息</h3>
|
||||
<el-alert
|
||||
v-if="!ecouponCardKeyDelivered"
|
||||
type="info"
|
||||
show-icon
|
||||
:closable="false"
|
||||
title="卡密尚未发放,请稍后刷新或联系商家"
|
||||
/>
|
||||
<template v-else-if="ecouponCardKeyRows.length">
|
||||
<div class="ecoupon-card-keys-mobile">
|
||||
<el-button type="primary" @click="cardKeyDialogVisible = true">查看卡密</el-button>
|
||||
<div
|
||||
v-for="line in cardKeyFulfillLines"
|
||||
:key="line.key"
|
||||
class="ecoupon-fulfill-block"
|
||||
>
|
||||
<div v-if="cardKeyFulfillLines.length > 1" class="ecoupon-fulfill-title">
|
||||
{{ line.goodsName || (line.isGift ? "满赠电子卡券" : "电子卡券") }}
|
||||
</div>
|
||||
<div class="ecoupon-card-keys-pc">
|
||||
<el-table border :data="ecouponCardKeyRows" style="width: 100%">
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="cardNo" label="卡号" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="cardSecret" label="卡密" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="allocatedTime" label="发卡时间" width="170" />
|
||||
<el-table-column label="操作" width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row" link type="primary" @click="copyCardKey(row)">复制</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button class="mt_10" size="small" @click="copyAllCardKeys">复制全部卡密</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<el-alert
|
||||
v-if="line.status !== 'DELIVERED'"
|
||||
:type="cardKeyFulfillAlertType(line.status)"
|
||||
show-icon
|
||||
:closable="false"
|
||||
:title="resolveCardKeyFulfillMessage(line)"
|
||||
class="mb_10"
|
||||
/>
|
||||
<template v-else-if="line.cardKeys.length">
|
||||
<div class="ecoupon-card-keys-mobile">
|
||||
<el-button type="primary" @click="cardKeyDialogVisible = true">查看卡密</el-button>
|
||||
</div>
|
||||
<div class="ecoupon-card-keys-pc">
|
||||
<el-table border :data="lineCardKeyRows(line)" style="width: 100%">
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column
|
||||
v-if="cardKeyFulfillLines.length > 1"
|
||||
prop="goodsName"
|
||||
label="商品"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column prop="cardNo" label="卡号" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="cardSecret" label="卡密" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="allocatedTime" label="发卡时间" width="170" />
|
||||
<el-table-column label="操作" width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row" link type="primary" @click="copyCardKey(row)">复制</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<el-button
|
||||
v-if="ecouponCardKeyRows.length"
|
||||
class="mt_10 ecoupon-card-keys-pc"
|
||||
size="small"
|
||||
@click="copyAllCardKeys"
|
||||
>
|
||||
复制全部卡密
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 订单商品 -->
|
||||
@@ -378,7 +402,14 @@ import {
|
||||
getPackage
|
||||
} from "@/api/order.js";
|
||||
import { afterSaleReason, receiptDetail } from "@/api/member";
|
||||
import { isECouponOrder as checkECouponOrder } from "@/constants/goodsType";
|
||||
import {
|
||||
isECouponOrder as checkECouponOrder,
|
||||
collectCardKeyFulfillLines,
|
||||
orderHasCardKeySection,
|
||||
flattenOrderCardKeys,
|
||||
cardKeyFulfillAlertType,
|
||||
resolveCardKeyFulfillMessage,
|
||||
} from "@/constants/goodsType";
|
||||
|
||||
/**
|
||||
* 订单详情:E_COUPON 展示 orderItems[].cardKeys,屏蔽售后/物流(FR-B-03 / FR-B-04)。
|
||||
@@ -415,20 +446,37 @@ export default {
|
||||
isNonPhysicalOrder() {
|
||||
return this.isVirtualOrder || this.isECouponOrder;
|
||||
},
|
||||
ecouponCardKeyDelivered() {
|
||||
return (this.order.orderItems || []).some((item) => item.cardKeyDelivered);
|
||||
/** 是否展示卡密区块(含满赠 E_COUPON 子单 giftECouponOrders) */
|
||||
hasCardKeySection() {
|
||||
return orderHasCardKeySection({
|
||||
orderItems: this.order.orderItems,
|
||||
giftSummaries: this.order.giftECouponOrders,
|
||||
isECouponOrder: this.isECouponOrder,
|
||||
});
|
||||
},
|
||||
cardKeyFulfillLines() {
|
||||
return collectCardKeyFulfillLines(
|
||||
this.order.orderItems,
|
||||
this.order.giftECouponOrders
|
||||
);
|
||||
},
|
||||
ecouponCardKeyRows() {
|
||||
const rows = [];
|
||||
(this.order.orderItems || []).forEach((item) => {
|
||||
(item.cardKeys || []).forEach((ck) => {
|
||||
rows.push({ ...ck });
|
||||
});
|
||||
});
|
||||
return rows;
|
||||
return flattenOrderCardKeys(
|
||||
this.order.orderItems,
|
||||
false,
|
||||
this.order.giftECouponOrders
|
||||
);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
cardKeyFulfillAlertType,
|
||||
resolveCardKeyFulfillMessage,
|
||||
lineCardKeyRows(line) {
|
||||
return (line.cardKeys || []).map((ck) => ({
|
||||
...ck,
|
||||
goodsName: line.goodsName,
|
||||
}));
|
||||
},
|
||||
copyCardKey(row) {
|
||||
const text = `卡号:${row.cardNo || ""}\n卡密:${row.cardSecret || ""}`;
|
||||
this.copyText(text);
|
||||
@@ -767,6 +815,18 @@ table {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ecoupon-fulfill-block + .ecoupon-fulfill-block {
|
||||
margin-top: 16px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px dashed #eee;
|
||||
}
|
||||
|
||||
.ecoupon-fulfill-title {
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.ecoupon-card-keys-pc {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -151,8 +151,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 发票信息 -->
|
||||
<div class="invoice">
|
||||
<!-- 发票信息(E_COUPON 虚拟型结算不开发票) -->
|
||||
<div class="invoice" v-if="!isECouponCheckout">
|
||||
<div class="card-head mt_20 mb_20">
|
||||
<span class="relative">发票信息<span class="inv-tips">
|
||||
<el-icon><Warning /></el-icon>开企业抬头发票须填写纳税人识别号,以免影响报销
|
||||
@@ -167,8 +167,8 @@
|
||||
<span @click="editInvoice">编辑</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 优惠券(E_COUPON 不参与促销 M-01) -->
|
||||
<div class="invoice" v-if="!isECouponCheckout">
|
||||
<!-- 优惠券 -->
|
||||
<div class="invoice">
|
||||
<div class="card-head mt_20 mb_20">
|
||||
<span class="relative">优惠券</span>
|
||||
</div>
|
||||
@@ -204,7 +204,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 礼品卡 -->
|
||||
<div class="invoice pay-gcc-module" v-if="!isECouponCheckout">
|
||||
<div class="invoice pay-gcc-module">
|
||||
<div class="pay-gcc-head">
|
||||
<div class="pay-gcc-title">
|
||||
使用礼品卡
|
||||
@@ -284,13 +284,13 @@
|
||||
<!-- 底部支付栏 -->
|
||||
<div class="order-footer">
|
||||
<div class="pay ml_20" @click="pay">提交订单</div>
|
||||
<div class="pay-address" v-if="addressList.length && selectedDeliverMethod === 'LOGISTICS'">
|
||||
<div class="pay-address" v-if="!isVirtualLikeCheckout && addressList.length && selectedDeliverMethod === 'LOGISTICS'">
|
||||
配送至:{{ $filters.unitAddress(selectedAddress.consigneeAddressPath) }}
|
||||
{{ selectedAddress.detail }} 收货人:{{
|
||||
selectedAddress.name
|
||||
}} {{ selectedAddress.mobile }}
|
||||
</div>
|
||||
<div class="pay-address" v-if="addressList.length && selectedDeliverMethod === 'SELF_PICK_UP'">
|
||||
<div class="pay-address" v-if="!isVirtualLikeCheckout && addressList.length && selectedDeliverMethod === 'SELF_PICK_UP'">
|
||||
自提地点:{{selectedStoreAddress.address}} 联系方式:{{ selectedStoreAddress.mobile }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -329,7 +329,7 @@ import {
|
||||
} from "@/api/cart";
|
||||
import { getStoreAddress } from "@/api/shopentry.js"
|
||||
import { canUseCouponList } from "@/api/member.js";
|
||||
import { isECoupon } from "@/constants/goodsType";
|
||||
import { isECoupon, shouldSkipPaymentPage } from "@/constants/goodsType";
|
||||
|
||||
export default {
|
||||
name: "Pay",
|
||||
@@ -379,7 +379,7 @@ export default {
|
||||
);
|
||||
return Number.isFinite(n) ? n : 0;
|
||||
},
|
||||
/** 电子卡券结算:免地址、隐藏优惠券/礼品卡/发票(M-01 / O-11) */
|
||||
/** 电子卡券结算:免地址、隐藏发票;优惠券/礼品卡/促销明细可用(M-02) */
|
||||
isECouponCheckout() {
|
||||
return isECoupon(this.goodsType);
|
||||
},
|
||||
@@ -855,15 +855,15 @@ export default {
|
||||
.then((res) => {
|
||||
Spin.hide();
|
||||
if (res.success) {
|
||||
if (params.way === "POINTS") {
|
||||
// 积分支付不需要跳转支付页面
|
||||
const way = params.way;
|
||||
if (shouldSkipPaymentPage(res.result, way)) {
|
||||
this.$router.push("/payDone");
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: "/payment",
|
||||
query: { orderType: "TRADE", sn: res.result.sn },
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$router.push({
|
||||
path: "/payment",
|
||||
query: { orderType: "TRADE", sn: res.result.sn },
|
||||
});
|
||||
} else if (res.message) {
|
||||
Message.warning(res.message);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import {tradeDetail, pay} from '@/api/pay.js';
|
||||
import { tradeDetail, pay } from '@/api/pay.js';
|
||||
import { Message, Modal } from "@/utils/message";
|
||||
|
||||
export default {
|
||||
@@ -78,6 +78,10 @@ export default {
|
||||
this.isStart = true
|
||||
this.support = this.payDetail.support
|
||||
this.walletValue = this.payDetail.walletValue
|
||||
const price = Number(this.payDetail.price);
|
||||
if (!Number.isNaN(price) && price <= 0) {
|
||||
this.$router.replace('/payDone');
|
||||
}
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.$router.push({name: 'MyOrder'});
|
||||
|
||||
@@ -2,18 +2,14 @@
|
||||
<div style="background:#fff;">
|
||||
<BaseHeader></BaseHeader>
|
||||
<Search style="border-bottom:2px solid red;"></Search>
|
||||
<!-- <drawer></drawer> -->
|
||||
<div class="base-width cate-container">
|
||||
<el-breadcrumb>
|
||||
<el-breadcrumb-item to="/">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{{goodsMsg.pointsGoodsCategoryName}}</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{{ goodsMsg.pointsGoodsCategoryName }}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<!-- 商品信息展示 -->
|
||||
<div class="item-detail-show">
|
||||
<!-- 详情左侧展示数据、图片,收藏、举报 -->
|
||||
<div class="item-detail-left">
|
||||
<!-- 大图、放大镜 -->
|
||||
<div class="item-detail-big-img">
|
||||
<el-image
|
||||
v-if="goodsSku.thumbnail"
|
||||
@@ -29,22 +25,22 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右侧商品信息、活动信息、操作展示 -->
|
||||
<div class="item-detail-right">
|
||||
<div class="item-detail-title">
|
||||
<p>{{ goodsSku.goodsName }}</p>
|
||||
<div class="item-detail-title-row">
|
||||
<p>{{ goodsSku.goodsName }}</p>
|
||||
<el-tag v-if="isECouponSku" class="goods-type-tag" size="small">电子卡券</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sell-point">
|
||||
{{goodsSku.sellingPoint}}
|
||||
{{ goodsSku.sellingPoint }}
|
||||
</div>
|
||||
<!-- 商品详细 -->
|
||||
<div class="item-detail-price-row">
|
||||
<div class="item-price-left">
|
||||
<!-- 商品原价 -->
|
||||
<div class="item-price-row">
|
||||
<p>
|
||||
<span class="item-price-title">积 分</span>
|
||||
<span class="item-price">{{goodsMsg.points}}</span>
|
||||
<span class="item-price">{{ goodsMsg.points }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,25 +51,37 @@
|
||||
<p>数量</p>
|
||||
</div>
|
||||
<div class="item-select-row">
|
||||
<el-input-number :min="1" :disabled="goodsSku.quantity === 0" v-model="count"></el-input-number>
|
||||
<span class="inventory"> 库存{{goodsSku.quantity}}</span>
|
||||
<el-input-number
|
||||
:min="1"
|
||||
:max="quantityMax"
|
||||
:disabled="isOutOfStock"
|
||||
v-model="count"
|
||||
/>
|
||||
<span class="inventory"> 库存{{ displayStock }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-select" v-if="goodsSku.goodsType !== 'VIRTUAL_GOODS' && goodsSku.weight !== 0">
|
||||
<div
|
||||
class="item-select"
|
||||
v-if="!isECouponSku && goodsSku.goodsType !== 'VIRTUAL_GOODS' && goodsSku.weight !== 0"
|
||||
>
|
||||
<div class="item-select-title">
|
||||
<p>重量</p>
|
||||
</div>
|
||||
<div class="item-select-row">
|
||||
<span class="inventory"> {{goodsSku.weight}}kg</span>
|
||||
<span class="inventory"> {{ goodsSku.weight }}kg</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="add-buy-car">
|
||||
<el-button type="danger" :loading="loading" :disabled="goodsSku.quantity === 0" @click="pointBuy">积分购买</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
:loading="loading"
|
||||
:disabled="isOutOfStock"
|
||||
@click="pointBuy"
|
||||
>积分购买</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 商品详情 -->
|
||||
<div class="base-width item-intro" ref="itemIntroGoods">
|
||||
<div>商品介绍</div>
|
||||
<div v-html="goodsSku.intro" class="mt_10 ml_10" v-if="goodsSku.intro"></div>
|
||||
@@ -86,101 +94,140 @@
|
||||
|
||||
<script>
|
||||
import { Message } from "@/utils/message";
|
||||
import Search from '@/components/Search';
|
||||
import { addCartGoods } from '@/api/cart.js';
|
||||
import { pointGoodsDetail } from '@/api/promotion';
|
||||
import Search from "@/components/Search";
|
||||
import { addCartGoods } from "@/api/cart.js";
|
||||
import { pointGoodsDetail } from "@/api/promotion";
|
||||
import {
|
||||
isECoupon,
|
||||
getECouponStock,
|
||||
getECouponMaxBuyNum,
|
||||
E_COUPON_CART_POINTS,
|
||||
} from "@/constants/goodsType";
|
||||
|
||||
export default {
|
||||
name: 'PointGoodsDetail',
|
||||
beforeRouteEnter (to, from, next) {
|
||||
name: "PointGoodsDetail",
|
||||
components: { Search },
|
||||
beforeRouteEnter(to, from, next) {
|
||||
window.scrollTo(0, 0);
|
||||
next();
|
||||
},
|
||||
created () {
|
||||
created() {
|
||||
this.getGoodsDetail();
|
||||
},
|
||||
mounted () {
|
||||
window.addEventListener('scroll', this.handleScroll)
|
||||
mounted() {
|
||||
window.addEventListener("scroll", this.handleScroll);
|
||||
},
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
goodsMsg: {}, // 商品信息
|
||||
goodsSku: {}, // 商品sku
|
||||
isLoading: false, // 加载状态
|
||||
categoryBar: [], // 分类
|
||||
onceFlag: true, // 只调用一次
|
||||
count: 1, // 购买商品数量
|
||||
loading: false // 提交加载状态
|
||||
goodsMsg: {},
|
||||
goodsSku: {},
|
||||
isLoading: false,
|
||||
onceFlag: true,
|
||||
count: 1,
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 获取积分商品详情
|
||||
getGoodsDetail () {
|
||||
this.isLoading = true;
|
||||
pointGoodsDetail(this.$route.query.id).then((res) => {
|
||||
this.isLoading = false;
|
||||
if (res.success) {
|
||||
this.goodsMsg = res.result;
|
||||
this.goodsSku = res.result.goodsSku
|
||||
} else {
|
||||
Message.error(res.message)
|
||||
this.$router.push('/')
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$router.push('/')
|
||||
});
|
||||
computed: {
|
||||
isECouponSku() {
|
||||
return isECoupon(this.goodsSku.goodsType);
|
||||
},
|
||||
pointBuy () {
|
||||
displayStock() {
|
||||
if (this.isECouponSku) {
|
||||
return getECouponStock(this.goodsSku);
|
||||
}
|
||||
return Number(this.goodsSku.quantity) || 0;
|
||||
},
|
||||
quantityMax() {
|
||||
if (this.isECouponSku) {
|
||||
return getECouponMaxBuyNum(this.goodsSku);
|
||||
}
|
||||
const qty = Number(this.goodsSku.quantity) || 0;
|
||||
return qty > 0 ? qty : 1;
|
||||
},
|
||||
isOutOfStock() {
|
||||
return this.displayStock <= 0;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getGoodsDetail() {
|
||||
this.isLoading = true;
|
||||
pointGoodsDetail(this.$route.query.id)
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
if (res.success) {
|
||||
this.goodsMsg = res.result;
|
||||
this.goodsSku = res.result.goodsSku || {};
|
||||
this.syncCountWithQuantity();
|
||||
} else {
|
||||
Message.error(res.message);
|
||||
this.$router.push("/");
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.$router.push("/");
|
||||
});
|
||||
},
|
||||
syncCountWithQuantity() {
|
||||
const max = this.quantityMax;
|
||||
if (max <= 0) {
|
||||
this.count = 1;
|
||||
return;
|
||||
}
|
||||
if (this.count > max) this.count = max;
|
||||
if (this.count < 1) this.count = 1;
|
||||
},
|
||||
pointBuy() {
|
||||
const params = {
|
||||
num: this.count,
|
||||
skuId: this.goodsMsg.skuId,
|
||||
cartType: 'POINTS'
|
||||
cartType: E_COUPON_CART_POINTS,
|
||||
};
|
||||
this.loading = true;
|
||||
addCartGoods(params).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.$router.push({path: '/pay', query: {way: params.cartType}});
|
||||
} else {
|
||||
Message.warning(res.message);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
addCartGoods(params)
|
||||
.then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.$router.push({ path: "/pay", query: { way: params.cartType } });
|
||||
} else {
|
||||
Message.warning(res.message);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleScroll () { // 监听页面滚动
|
||||
handleScroll() {
|
||||
if (this.onceFlag) {
|
||||
this.$nextTick(() => {
|
||||
this.changeHeight()
|
||||
this.changeHeight();
|
||||
});
|
||||
this.onceFlag = false
|
||||
this.onceFlag = false;
|
||||
}
|
||||
},
|
||||
changeHeight () { // 设置商品详情高度
|
||||
let goodsDetailCon = document.querySelector('.item-intro')
|
||||
changeHeight() {
|
||||
const goodsDetailCon = document.querySelector(".item-intro");
|
||||
if (!goodsDetailCon || !this.$refs.itemIntroGoods) return;
|
||||
let heightCss = window.getComputedStyle(goodsDetailCon).height;
|
||||
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89;
|
||||
this.$refs.itemIntroGoods.style.height = heightCss + 'px';
|
||||
}
|
||||
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2), 10) + 89;
|
||||
this.$refs.itemIntroGoods.style.height = heightCss + "px";
|
||||
},
|
||||
},
|
||||
components: {
|
||||
Search,
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.base-width{
|
||||
.base-width {
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
}
|
||||
.cate-container{
|
||||
.cate-container {
|
||||
background-color: #eee;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding-left: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
// 商品图片,价格等
|
||||
.item-detail-show {
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
@@ -192,7 +239,6 @@ export default {
|
||||
width: 350px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.item-detail-big-img {
|
||||
width: 350px;
|
||||
height: 350px;
|
||||
@@ -202,12 +248,10 @@ export default {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.item-detail-img-row {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.item-detail-img-small {
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
@@ -219,20 +263,27 @@ export default {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
/*商品选购详情*/
|
||||
.item-detail-right {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.item-detail-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
.item-detail-title p {
|
||||
@include content_color($light_content_color);
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
padding: 8px 0;
|
||||
margin: 0;
|
||||
}
|
||||
.goods-type-tag {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.item-detail-express {
|
||||
font-size: 14px;
|
||||
padding: 2px 3px;
|
||||
@@ -240,15 +291,6 @@ export default {
|
||||
background-color: $theme_color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/*商品标签*/
|
||||
.item-detail-tag {
|
||||
padding: 8px 0;
|
||||
font-size: 12px;
|
||||
color: $theme_color;
|
||||
}
|
||||
|
||||
/*价格详情等*/
|
||||
.item-detail-price-row {
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
@@ -256,42 +298,31 @@ export default {
|
||||
justify-content: space-between;
|
||||
background: url("../../assets/images/goodsDetail/price-bg.png");
|
||||
}
|
||||
|
||||
.item-price-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.item-price-title {
|
||||
color: #999999;
|
||||
font-size: 14px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.item-price-row {
|
||||
margin: 5px 0px;
|
||||
}
|
||||
|
||||
.item-price {
|
||||
color: $theme_color;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.item-price-old {
|
||||
color: gray;
|
||||
text-decoration: line-through;
|
||||
font-size: 14px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.add-buy-car-box {
|
||||
width: 100%;
|
||||
margin-top: 15px;
|
||||
border-top: 1px dotted $border_color;
|
||||
}
|
||||
|
||||
.add-buy-car {
|
||||
margin-top: 15px;
|
||||
>*{
|
||||
> * {
|
||||
margin: 0 4px;
|
||||
}
|
||||
}
|
||||
@@ -300,57 +331,23 @@ export default {
|
||||
flex-direction: row;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.item-select-title {
|
||||
@include content_color($light_content_color);
|
||||
font-size: 14px;
|
||||
margin-right: 15px;
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.item-select-column {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.item-select-row {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.item-select-box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 5px;
|
||||
margin-right: 8px;
|
||||
@include background_color($light_background_color);
|
||||
border: 0.5px solid $border_color;
|
||||
cursor: pointer;
|
||||
@include content_color($light_content_color);
|
||||
}
|
||||
|
||||
.item-select-box:hover {
|
||||
border: 0.5px solid $theme_color;
|
||||
}
|
||||
|
||||
.item-select-box-active {
|
||||
border: 0.5px solid $theme_color;
|
||||
}
|
||||
|
||||
.item-select-intro p {
|
||||
margin: 0px;
|
||||
padding: 5px;
|
||||
}
|
||||
.sell-point {
|
||||
font-size: 12px;
|
||||
color: red;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
// 商品详情
|
||||
.item-intro {
|
||||
margin-top: 10px;
|
||||
>div:nth-child(1) {
|
||||
> div:nth-child(1) {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
background-color: #eee;
|
||||
|
||||
Reference in New Issue
Block a user