优化价格显示的先后顺序
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -101,7 +101,7 @@ export const useGoods = defineStore("goods", {
|
|||||||
},
|
},
|
||||||
// 清除会员信息
|
// 清除会员信息
|
||||||
async clearVipUserInfo() {
|
async clearVipUserInfo() {
|
||||||
console.log('清除会员信息');
|
// console.log('清除会员信息');
|
||||||
|
|
||||||
this.vipUserInfo = {};
|
this.vipUserInfo = {};
|
||||||
this.showVipPrice = 0;
|
this.showVipPrice = 0;
|
||||||
@@ -449,16 +449,16 @@ export const useGoods = defineStore("goods", {
|
|||||||
|
|
||||||
this.goodsList.forEach(val => {
|
this.goodsList.forEach(val => {
|
||||||
val.forEach((item, index) => {
|
val.forEach((item, index) => {
|
||||||
console.log('this.goodsList.index', index);
|
// console.log('this.goodsList.index', index);
|
||||||
console.log('this.goodsList.item', item);
|
// console.log('this.goodsList.item', item);
|
||||||
console.log('this.goodsList.limitDiscountRes', this.limitDiscountRes);
|
// console.log('this.goodsList.limitDiscountRes', this.limitDiscountRes);
|
||||||
console.log('this.goodsList.store.shopInfo', store.shopInfo);
|
// console.log('this.goodsList.store.shopInfo', store.shopInfo);
|
||||||
console.log('this.goodsList.this.vipUserInfo', this.vipUserInfo);
|
// console.log('this.goodsList.this.vipUserInfo', this.vipUserInfo);
|
||||||
// console.log('this.goodsList.this.vipUserInfo', JSON.stringify(this.vipUserInfo));
|
// console.log('this.goodsList.this.vipUserInfo', JSON.stringify(this.vipUserInfo));
|
||||||
console.log('this.goodsList.this.canUseLimitTimeDiscount', limitUtils.canUseLimitTimeDiscount(item,
|
// console.log('this.goodsList.this.canUseLimitTimeDiscount', limitUtils.canUseLimitTimeDiscount(item,
|
||||||
this.limitDiscountRes,
|
// this.limitDiscountRes,
|
||||||
store.shopInfo,
|
// store.shopInfo,
|
||||||
this.vipUserInfo, 'id'));
|
// this.vipUserInfo, 'id'));
|
||||||
|
|
||||||
|
|
||||||
item.showMore = false;
|
item.showMore = false;
|
||||||
@@ -648,7 +648,7 @@ export const useGoods = defineStore("goods", {
|
|||||||
completeGoodsInfo(item) {
|
completeGoodsInfo(item) {
|
||||||
const store = useUser()
|
const store = useUser()
|
||||||
|
|
||||||
console.log('补全商品信息===', item);
|
// console.log('补全商品信息===', item);
|
||||||
if (item.is_temporary) {
|
if (item.is_temporary) {
|
||||||
item.salePrice = item.discount_sale_amount
|
item.salePrice = item.discount_sale_amount
|
||||||
return item;
|
return item;
|
||||||
@@ -659,7 +659,7 @@ export const useGoods = defineStore("goods", {
|
|||||||
flag = true;
|
flag = true;
|
||||||
let sku = val.skuList.find((sku) => sku.id == item.sku_id || sku.id == item.skuId);
|
let sku = val.skuList.find((sku) => sku.id == item.sku_id || sku.id == item.skuId);
|
||||||
|
|
||||||
console.log('sku===', sku);
|
// console.log('sku===', sku);
|
||||||
|
|
||||||
|
|
||||||
let group_text = "";
|
let group_text = "";
|
||||||
@@ -708,7 +708,7 @@ export const useGoods = defineStore("goods", {
|
|||||||
},
|
},
|
||||||
// 补全历史订单列表商品信息
|
// 补全历史订单列表商品信息
|
||||||
comleteOrderInfo(item) {
|
comleteOrderInfo(item) {
|
||||||
console.log('补全订单列表商品信息');
|
// console.log('补全订单列表商品信息');
|
||||||
const store = useUser()
|
const store = useUser()
|
||||||
|
|
||||||
this.originGoodsList.map((val) => {
|
this.originGoodsList.map((val) => {
|
||||||
@@ -792,15 +792,15 @@ export const useGoods = defineStore("goods", {
|
|||||||
},
|
},
|
||||||
// 商品更新后,需要对购物车、订单进行更新
|
// 商品更新后,需要对购物车、订单进行更新
|
||||||
async updateGoodsList() {
|
async updateGoodsList() {
|
||||||
console.log('选择用户后更新所有===', this.vipUserInfo);
|
// console.log('选择用户后更新所有===', this.vipUserInfo);
|
||||||
const socket = useSocket();
|
const socket = useSocket();
|
||||||
const store = useUser()
|
const store = useUser()
|
||||||
|
|
||||||
await this.getCategoryList();
|
await this.getCategoryList();
|
||||||
await this.getGoodsList();
|
await this.getGoodsList();
|
||||||
|
|
||||||
console.log('选择用户后更新所有.cartList===', this.cartList);
|
// console.log('选择用户后更新所有.cartList===', this.cartList);
|
||||||
console.log('选择用户后更新所有.cartList===', this.orderList);
|
// console.log('选择用户后更新所有.cartList===', this.orderList);
|
||||||
|
|
||||||
if (this.cartList.length || this.orderList.length) {
|
if (this.cartList.length || this.orderList.length) {
|
||||||
let data = {
|
let data = {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="price" v-if="item.is_time_discount == 1">
|
<div class="price" v-if="item.is_time_discount == 1 && item.discount_sale_amount <= 0">
|
||||||
<span class="dis">
|
<span class="dis">
|
||||||
¥{{ formatDecimal(+item.salePrice, 2, true) }}
|
¥{{ formatDecimal(+item.salePrice, 2, true) }}
|
||||||
</span>
|
</span>
|
||||||
@@ -34,15 +34,12 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="price" v-else>
|
<div class="price" v-else>
|
||||||
<template v-if="+props.item.discount_sale_amount">
|
<template v-if="+item.discount_sale_amount > 0">
|
||||||
<span class="dis">
|
<span class="dis">
|
||||||
¥{{ formatDecimal(goodsStore.showVipPrice ? +props.item.memberPrice ||
|
¥{{ formatDecimal(+item.salePrice, 2, true) }}
|
||||||
+props.item.lowPrice
|
|
||||||
: +props.item.lowPrice,
|
|
||||||
2, true) }}
|
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
¥{{ formatDecimal(+props.item.discount_sale_amount, 2, true) }}
|
¥{{ formatDecimal(+item.discount_sale_amount, 2, true) }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<div class="flex" v-else>
|
<div class="flex" v-else>
|
||||||
@@ -78,7 +75,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="num">
|
<div class="num">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<div class="icon_item zen" v-if="item.is_time_discount">
|
<div class="icon_item zen" v-if="item.is_time_discount && item.discount_sale_amount <= 0">
|
||||||
<span class="t">限时折扣</span>
|
<span class="t">限时折扣</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon_item zen" v-if="props.item.is_gift">
|
<div class="icon_item zen" v-if="props.item.is_gift">
|
||||||
|
|||||||
@@ -19,20 +19,20 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template v-if="item.is_gift">
|
<template v-if="item.is_gift">
|
||||||
<span class="t_line">¥{{ formatDecimal(+item.lowPrice) }}</span>
|
<span class="t_line">¥{{ formatDecimal(+item.salePrice) }}</span>
|
||||||
¥0.00
|
¥0.00
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template v-if="+item.discount_sale_amount">
|
<template v-if="+item.discount_sale_amount > 0">
|
||||||
<span class="t_line">
|
<!-- <span class="t_line">
|
||||||
¥{{ formatDecimal(+item.lowPrice) }}
|
¥{{ formatDecimal(+item.salePrice) }}
|
||||||
</span>
|
</span> -->
|
||||||
<span>
|
<span>
|
||||||
¥{{ formatDecimal(+item.discount_sale_amount) }}
|
¥{{ formatDecimal(+item.discount_sale_amount) }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
¥{{ formatDecimal(+item.lowPrice) }}
|
¥{{ formatDecimal(+item.salePrice) }}
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -85,7 +85,8 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="gift_wrap" v-if="goodsStore.showVipPrice && item.memberPrice && !item.is_time_discount">
|
<div class="gift_wrap"
|
||||||
|
v-if="goodsStore.showVipPrice && item.memberPrice && !item.is_time_discount && item.discount_sale_amount <= 0">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<span>[会员价]</span>
|
<span>[会员价]</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -96,7 +97,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="gift_wrap" v-if="item.is_time_discount">
|
<div class="gift_wrap" v-if="item.is_time_discount && item.discount_sale_amount <= 0">
|
||||||
<template v-if="item.time_dicount_mode == 'vip-price'">
|
<template v-if="item.time_dicount_mode == 'vip-price'">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<span>[会员价]</span>
|
<span>[会员价]</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user