feat: 修复个人中午物流未显示bug

merge-requests/65/head
xiaoguang 3 years ago
parent 12203846d6
commit 946f85a8b3

@ -17,7 +17,7 @@
<div
v-if="cartCount > 0"
class="wrap-right-cart__tip flex flex-middle flex-center"
:class="{ 'wrap-right-cart__tip--more': cartCount > 10 }"
:class="{ 'wrap-right-cart__tip--more': cartCount > 9 }"
>
{{ cartCount }}
</div>

@ -52,7 +52,11 @@
>
<img src="~/assets/img/layout/icon-message.png" />
<span class="hover-text">消息</span>
<div v-if="messageCount > 0" class="wrap-content-message__tip">
<div
v-if="messageCount > 0"
class="wrap-content-message__tip flex flex-center flex-middle"
:class="{ 'wrap-content-message__tip--more': messageCount > 9 }"
>
{{ messageCount }}
</div>
</div>
@ -244,16 +248,18 @@ export default {
}
}
.wrap-content-message__tip {
min-width: 14px;
width: 14px;
height: 14px;
padding: 0 3px;
line-height: 14px;
font-size: 10px;
color: #ffffff;
text-align: center;
background: #ff512b;
border-radius: 50%;
margin-left: 4px;
&--more {
width: unset;
padding: 0 3px;
border-radius: 7px;
}
}
.header-wrap-content--line {
width: 1px;

@ -32,7 +32,13 @@
/>
<div class="header-wrap-icons__shop" @click="$router.push('/cart')">
<img src="~/assets/img/layout/icon-shop-sticky.png" />
<span v-if="cartCount > 0" class="">{{ cartCount }}</span>
<div
v-if="cartCount > 0"
:class="{ 'wrap-icons-shop__tip--more': cartCount > 10 }"
class="wrap-icons-shop__tip flex flex-middle flex-center"
>
{{ cartCount }}
</div>
</div>
<div
v-if="token"
@ -123,12 +129,14 @@ export default {
return {
searchContent: "",
tabPath: "/",
cartCount: 0, //
cartProductList: [], //
};
},
computed: {
...mapState(["userInfo", "token", "seckillTabVisible"]),
...mapState(["userInfo", "token", "seckillTabVisible", "cartProducts"]),
cartCount() {
return this.cartProducts.length;
},
tabList() {
const defaultList = [
{ label: "首页", value: "/" },
@ -215,19 +223,21 @@ export default {
.header-wrap-icons__shop {
position: relative;
margin-left: 14px;
span {
.wrap-icons-shop__tip {
position: absolute;
right: -6px;
left: 18px;
top: -4px;
display: block;
height: 14px;
padding: 0 2px;
line-height: 14px;
text-align: center;
width: 14px;
background: #ff512b;
font-size: 10px;
color: #ffffff;
border-radius: 50%;
&--more {
width: unset;
padding: 0 3px;
border-radius: 7px;
}
}
}
.header-wrap-icons__login {

@ -99,13 +99,13 @@ export default {
if (records && records.length > 0) {
const formatRecords = records.map((item) => {
const goods = item.products || [{ productImageUrl: "" }];
const logisticsList = item.logistics.logisticsDataList || [
{ context: "暂无物流信息" },
];
const logisticsList = item.logistics.logisticsDataList || [];
return {
...item,
cover: goods[0].productImageUrl, //
logisticsContext: logisticsList[0].context, //
logisticsContext:
(logisticsList.length > 0 && logisticsList[0].context) ||
"暂无物流信息", //
};
});
this.list = this.list.concat(formatRecords);

Loading…
Cancel
Save