Authored by zhangwenxue

商品列表: 组件添加价格自定义属性值key

... ... @@ -4,7 +4,7 @@
:key="index" :class="(index) % 2 === 0 && 'magrin-right'">
<div class="item-top">
<div class="item-price">
<span class="price-flag">{{product.available_now_price && '¥'}}</span><span>{{product.available_now_price || ' '}}</span>
<span class="price-flag">{{product[priceKey] && '¥'}}</span><span>{{product[priceKey] || ' '}}</span>
</div>
<div class="item-sales">{{product.sales && product.sales + '人付款'}}</div>
</div>
... ... @@ -22,6 +22,10 @@ export default {
props: {
list: Array,
yasParams: Object,
priceKey: {
type: String,
default: 'available_now_price',
},
},
data: function() {
return {
... ...
... ... @@ -6,7 +6,7 @@
:options="scrollOption"
@pulling-down="onPullingDown">
<div class="list-wrapper" v-if="brandProductList != null">
<product-list :list="brandProductList" />
<product-list :list="brandProductList" priceKey="price"/>
</div>
</scroll-view>
</layout-app>
... ...
... ... @@ -48,7 +48,7 @@
<img class="ref-img" v-lazy="prdDetailImage" />
<div class="recommend" v-if="recommend"><h2>相关推荐</h2>
<product-list :list="recommend" />
<product-list :list="recommend" priceKey="price"/>
</div>
</cube-scroll>
</div>
... ...