Commit b3303c5c by 侯体倬

展示优化

parent db0347dc
......@@ -31,6 +31,8 @@ const componentOptions = {
currentSecKillInfo: {}, // 当前秒杀信息
priceTextStyle: 'flex-start',
cutPrice: "", // 砍价价格
minPrice: 0,
minGoodsSuggestedRetailPrice: 0,
},
// 数据监听器
observers: {
......@@ -43,6 +45,12 @@ const componentOptions = {
this.getSecKillInfo(val);
}
}
if (this.data.datas.componentData['columnNum'] == 3) {
this.setData({
minPrice: this.keepSelfNum(val.minPrice || 0),
minGoodsSuggestedRetailPrice: this.keepSelfNum(val.minGoodsSuggestedRetailPrice || 0)
})
}
}
},
// 组件方法
......@@ -277,6 +285,16 @@ const componentOptions = {
"items.coverImage":"https://cdn.mayi888.com/product/85pdScJ5ch.jpg?x-oss-process=image/resize,m_pad,limit_0,w_400,h_400",
})
},
keepSelfNum(num) {
let r;
num = Number(num);
try {
r = num.toString().split(".")[1].length;
} catch (e) {
r = 0;
}
return num.toFixed(r);
}
},
// 组件生命周期
lifetimes: {
......
......@@ -169,7 +169,7 @@
</block>
<!-- 秒杀展示 -->
<block wx:elif="{{items && items.secondKillActivityInfoGoodsList}}">
<view class="flex" style="margin: 12rpx 0 6rpx;align-items: center;width: 100%;">
<view class="flex" style="margin: 12rpx 0 6rpx;align-items: center;width: 100%;flex-wrap: wrap;">
<view style="color:{{datas.componentData['priceColor']}};font-size:{{datas.componentData['priceFontSize']}}em;">
¥{{ currentSecKillInfo.spikePrice }}
</view>
......@@ -184,8 +184,8 @@
style="color:{{datas.componentData['priceColor']}};font-size:{{datas.componentData['priceFontSize']}}em;"
wx:elif="{{datas.componentData['priceShow']}}"
>
<text>¥{{items!=null ? items['minPrice']:0}}</text>
<text style="font-size:24rpx;color:#999;text-decoration:line-through;" wx:if="{{items!=null&&datas.componentData['priceMarking']&&items['minGoodsSuggestedRetailPrice']&&(items['minPrice']-0<items['minGoodsSuggestedRetailPrice']-0)&&datas.componentData['columnNum']<3}}">¥{{items['minGoodsSuggestedRetailPrice']}}</text>
<text>¥{{items!=null ? minPrice : 0}}</text>
<text style="font-size:24rpx;color:#999;text-decoration:line-through;" wx:if="{{items!=null&&datas.componentData['priceMarking']&&items['minGoodsSuggestedRetailPrice']&&(items['minPrice']-0<items['minGoodsSuggestedRetailPrice']-0)&&datas.componentData['columnNum']<4}}">¥{{minGoodsSuggestedRetailPrice}}</text>
</view>
<view class="vipPrice2 flex" wx:if="{{datas.componentData.vipPrice}}">
<view class="left" wx:if="{{items.showVipPrice==true}}">
......@@ -217,7 +217,7 @@
>
已售罄
</view>
<view wx:if="{{(items&&items.totalQty-0>0||items&&items.oversoldFlag==1)&& datas.componentData['paynow']}}" catchtap="onclickBuynow">
<view wx:if="{{(items&&items.totalQty-0>0||items&&items.oversoldFlag==1)&& datas.componentData['paynow']}}" catchtap="onclickBuynow" style="margin-left: auto;">
<text wx:if="{{datas.componentData.btnType<6}}" style="color:{{datas.componentData.btnColor}}" class="buy-now-icon iconfont-common {{datas.componentData.btnIcon}}"></text>
<view
wx:else
......
......@@ -310,7 +310,7 @@ align-items: flex-start;
}
.buy-now {
color: #ffffff;
position: absolute;
position: relative;
right: 0;
bottom: 0;
border-radius: 30rpx;
......@@ -327,7 +327,7 @@ align-items: flex-start;
-o-border-radius: 30rpx;
}
.buy-now-icon {
position: absolute;
position: relative;
right: 0;
bottom: 2px;
font-size: 36rpx;
......@@ -426,6 +426,9 @@ margin-right: 8rpx;
}
.bottom {
position: relative;
display: flex;
align-items: baseline;
flex-wrap: wrap;
}
.price {
font-weight: 600;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment