页面显示优化
This commit is contained in:
@@ -32,6 +32,12 @@ Component({
|
||||
value: '¥',
|
||||
},
|
||||
|
||||
// 是否展示"购买"引导按钮(仅商品列表等售卖场景开启)
|
||||
showBuy: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
|
||||
thresholds: {
|
||||
type: Array,
|
||||
value: [],
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
<view class="goods-card__down">
|
||||
<price wx:if="{{ goods.price }}" wr-class="spec-for-price" symbol-class="spec-for-symbol" symbol="{{currency}}" price="{{goods.price}}" />
|
||||
<price wx:if="{{ goods.originPrice && isValidityLinePrice }}" wr-class="goods-card__origin-price" symbol="{{currency}}" price="{{goods.originPrice}}" type="delthrough" />
|
||||
<view wx:if="{{showBuy}}" class="goods-card__buy" hover-class="goods-card__buy--hover" hover-stay-time="60" catchtap="clickHandle" data-goods="{{ goods }}">
|
||||
<t-icon name="cart" size="28rpx" color="#ffffff" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -112,6 +112,28 @@
|
||||
line-height: 44rpx;
|
||||
}
|
||||
|
||||
/* "购买"引导按钮:圆形加号图标,沉底右对齐 */
|
||||
.goods-card__buy {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
align-self: flex-end;
|
||||
margin-left: auto;
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
flex-shrink: 0;
|
||||
color: var(--text-inverse);
|
||||
background: var(--brand-gradient);
|
||||
border-radius: var(--radius-round);
|
||||
box-shadow: 0 4rpx 12rpx rgba(255, 95, 21, 0.28);
|
||||
transition: transform 0.16s ease, box-shadow 0.16s ease;
|
||||
}
|
||||
|
||||
.goods-card__buy--hover {
|
||||
transform: scale(0.9);
|
||||
box-shadow: 0 2rpx 6rpx rgba(255, 95, 21, 0.2);
|
||||
}
|
||||
|
||||
.goods-card__origin-price {
|
||||
order: 2;
|
||||
margin: 0 0 0 12rpx;
|
||||
|
||||
@@ -17,6 +17,11 @@ Component({
|
||||
type: Array,
|
||||
value: [],
|
||||
},
|
||||
// 是否展示卡片上的"购买"引导按钮
|
||||
showBuy: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
|
||||
data: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<view class="goods-list-wrap wr-class" id="{{independentID}}">
|
||||
<block wx:for="{{goodsList}}" wx:for-item="item" wx:key="index">
|
||||
<goods-card id="{{independentID}}-gd-{{index}}" data="{{item}}" currency="{{item.currency || '¥'}}" thresholds="{{thresholds}}" class="goods-card-inside" data-index="{{index}}" bind:click="onClickGoods" />
|
||||
<goods-card id="{{independentID}}-gd-{{index}}" data="{{item}}" currency="{{item.currency || '¥'}}" thresholds="{{thresholds}}" show-buy="{{showBuy}}" class="goods-card-inside" data-index="{{index}}" bind:click="onClickGoods" />
|
||||
</block>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user