promotionCell.js
548 Bytes
Component({
properties: {
amount: {
type: Number,
value: 0
},
promotions: {
type: Array,
value: []
},
selectedCode: {
type: Number,
value: 0,
observer: '_selectObserver'
},
info: {
type: Object,
value: {}
}
},
data: {
selectNum: 0
},
methods: {
_selectObserver: function(val) {
let promotionsNum = val ? 1 : 0
this.setData({selectNum: promotionsNum})
},
select: function(){
this.triggerEvent('select',{})
}
}
});