Component({ externalClasses: ['wr-sold-out', 'wr-class'], options: { multipleSlots: true }, properties: { noDraw: { // 商品是否下架 type: Boolean, value: true, }, addingCart: { // 商品是否下架 type: Boolean, value: false, }, soldout: { // 商品是否下架 type: Boolean, value: false, }, jumpArray: { type: Array, value: [], }, isStock: { type: Boolean, value: true, }, // 是否有库存 isSlotButton: { type: Boolean, value: false, }, // 是否开启按钮插槽 shopCartNum: { type: Number, // 购物车气泡数量 }, buttonType: { type: Number, value: 0, }, minDiscountPrice: { type: String, value: '', }, minSalePrice: { type: String, value: '', }, }, data: { fillPrice: false, }, methods: { toAddCart() { const { isStock, addingCart } = this.properties if (!isStock) return if (addingCart) return this.triggerEvent('toAddCart') }, toJum3D(e: WechatMiniprogram.BaseEvent) { const { noDraw } = this.properties if (noDraw) return console.log('triggerJUM') this.triggerEvent('toJum3D', e) }, toNav(e: WechatMiniprogram.CustomEvent<{}, { index: number; url: String }>) { const { url, index } = e.currentTarget.dataset return this.triggerEvent('toNav', { e, index, url, }) }, }, })