34 lines
612 B
JavaScript
34 lines
612 B
JavaScript
Component({
|
|
externalClasses: ['wr-class'],
|
|
|
|
options: { multipleSlots: true },
|
|
|
|
properties: {
|
|
soldout: {
|
|
// 商品是否下架
|
|
type: Boolean,
|
|
value: false,
|
|
},
|
|
isStock: {
|
|
type: Boolean,
|
|
value: true,
|
|
}, // 是否有库存
|
|
isSlotButton: {
|
|
type: Boolean,
|
|
value: false,
|
|
}, // 是否开启按钮插槽
|
|
buttonType: {
|
|
type: Number,
|
|
value: 0,
|
|
},
|
|
},
|
|
|
|
methods: {
|
|
toBuyNow(e) {
|
|
const { isStock, soldout } = this.properties;
|
|
if (soldout || !isStock) return;
|
|
this.triggerEvent('toBuyNow', e);
|
|
},
|
|
},
|
|
});
|