diff --git a/src/components/user-merit/index.vue b/src/components/user-merit/index.vue index d83ee3a..147b48a 100644 --- a/src/components/user-merit/index.vue +++ b/src/components/user-merit/index.vue @@ -5,14 +5,13 @@
{{ data.merit_name || data.nickname || data.user_info.nickname }} -

{{ data.goods_name }}

已参与

- {{ data.paid_at }} + {{ format(data.paid_at) }}
@@ -26,6 +25,11 @@ export default { avatar: "/touxiang.png", }; }, + methods: { + format(time) { + return time ? time.slice(0, 10) : ""; + }, + }, }; @@ -45,27 +49,16 @@ export default { .name { display: flex; align-items: flex-end; - margin-bottom: 0.27rem; - span:first-child { - font-size: 0.4rem; - color: #222; - vertical-align: top; - display: inline-block; - margin-right: 0.4rem; - line-height: 1.3; - } - span:last-child { - font-size: 0.32rem; - color: #666; - vertical-align: text-bottom; - display: inline-block; - } + margin-bottom: 0.2rem; + font-size: 0.4rem; } p.goods_name { - font-size: 0.32rem; - max-width: 4rem; + font-size: 0.34rem; + max-width: 8rem; + line-height: 1.2; + overflow-x: hidden; + color: #666; white-space: nowrap; - overflow: hidden; text-overflow: ellipsis; } } @@ -82,7 +75,7 @@ export default { font-weight: bold; } .date { - font-size: 0.3rem; + font-size: 0.34rem; color: #888; } } diff --git a/src/pages/goods-detail/index.vue b/src/pages/goods-detail/index.vue index 59f4a9b..89f46e9 100644 --- a/src/pages/goods-detail/index.vue +++ b/src/pages/goods-detail/index.vue @@ -41,6 +41,7 @@ +
@@ -151,6 +152,9 @@ export default { } return (parseInt(this.priceUnit * 100, 10) * this.quantity) / 100; }, + safeInsetBottomHeight() { + return this.$store.state.safeInsetBottomHeight; + }, }, mounted() { this.getGoodsDetail("common"); @@ -159,6 +163,15 @@ export default { this.observer.disconnect(); }, methods: { + checkPlaceholderHeight() { + const el = document.querySelector(".safe-inset-placeholder"); + const rect = el.getBoundingClientRect(); + if (rect.height > 0) { + el.parentNode.removeChild(el); + } else { + el.style.height = "1rem"; + } + }, initObserver() { this.observer = new ObserverInteraction(); @@ -242,6 +255,7 @@ export default { this.$nextTick(() => { this.paddingBottom = this.$refs.fixedBottom.getOffsetHeight() - 50; this.initObserver(); + this.checkPlaceholderHeight(); }); this.wechatReady({ ...this.data.shareConfig, @@ -272,6 +286,10 @@ export default {