Merge branch 'feature/task1.0.0_xg' into 'feature/task1.0.0'

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

See merge request yanxuan-frontend/shop-pc!65
merge-requests/66/head
肖广 3 years ago
commit e3519ba9ba

@ -17,7 +17,7 @@
<div <div
v-if="cartCount > 0" v-if="cartCount > 0"
class="wrap-right-cart__tip flex flex-middle flex-center" 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 }} {{ cartCount }}
</div> </div>

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

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

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

Loading…
Cancel
Save