123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- 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,
- })
- },
- },
- })
|