index.js 1.18 KB
import event from '../../utils/event';

// const router = global.router;
Component({
    properties: {
        floorData: {
            type: Object,
            observer: '_dataChange'
        },
        floorIdx: {
            type: Number
        }
    },
    data: {},
    attached() {
    },
    methods: {
        checkDetail({currentTarget}) {
            const {productSkn, activityId} = currentTarget.dataset;

            const {
                template_id,
                template_name,
            } = this.data.floorData;

            let reportParams = {
                F_ID: template_id || '0',
                F_NAME: template_name || '',
                F_URL: this.data.url || '',
                F_INDEX: (this.data.floorIdx || 0) + 1 ,
                I_INDEX: (this.data.itemIdx || 0) + 1
            };

            event.emit('anchor-click', reportParams);
            
            if (productSkn && activityId) {
              wx.navigateTo({
                url: `../groupPurchase/groupPurchaseDetail?productSkn=${productSkn}&activityId=${activityId}`
              });
                // router.go('purchaseDetail', {activityId, productSkn});
            }
        }
    }
});