You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
43 lines
1.1 KiB
Component({
|
|
properties: {
|
|
id: { type: String, value: '' },
|
|
name: { type: String, value: '' },
|
|
imageUrl: { type: String, value: '' },
|
|
price: { type: [String, Number], value: '' },
|
|
priceUnit: { type: String, value: '/件' },
|
|
region: { type: String, value: '' },
|
|
specification: { type: String, value: '' },
|
|
spec: { type: String, value: '' },
|
|
specs: { type: String, value: '' },
|
|
displaySpecification: { type: String, value: '' },
|
|
displayYolk: { type: String, value: '' },
|
|
sourceType: { type: String, value: '' },
|
|
totalStock: { type: [String, Number], value: '' },
|
|
supplyStatus: { type: String, value: '' },
|
|
status: { type: String, value: '' },
|
|
reservedCount: { type: [String, Number], value: 0 }
|
|
},
|
|
|
|
data: {
|
|
isSoldOut: false
|
|
},
|
|
|
|
observers: {
|
|
'status': function(status) {
|
|
this.setData({
|
|
isSoldOut: status === 'sold_out'
|
|
});
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
onTap: function() {
|
|
const goodsId = this.properties.id;
|
|
if (goodsId) {
|
|
wx.navigateTo({
|
|
url: `/pages/goods-detail/goods-detail?id=${goodsId}`
|
|
});
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|