item.js
564 Bytes
let router = global.router;
Component({
properties: {
item: {
type: Object,
value: {},
observer: '_itemChange'
}
},
data: {
showMarketPrice: false
},
methods: {
goDetail: function () {
router.go('productDetail', {productSkn: this.properties.item.skn});
},
_itemChange: function (item) {
this.setData({
showMarketPrice: +item.marketPrice > 0 && +item.marketPrice > +item.salesPrice
});
}
}
});