export default {
    methods: {
        goNext(info, props = '') {
            if (info.link && (!info.linkContent || info.linkContent === ' ')) {
                this.wait();
                return;
            }
            if (this.$store.state.reviewPay && info.linkContent === '/hopeMarket') {
                this.wait();
                return;
            }
            console.log(info.linkContent);
            if (info.link && info.linkType === 'collection') {
                this.$router.push('/' + this.$route.params.companyId + `/productDetail/${info.linkContent}${props}`);
            } else if (info.link && info.linkType === 'user') {
                this.$router.push('/' + this.$route.params.companyId + `/creatorDetail?id=${info.linkContent}${props}`);
            } else if (info.link && info.linkType === 'activity') {
                this.$router.push(
                    '/' + this.$route.params.companyId + `/activityDetail?id=${info.linkContent}${props}`
                );
            } else if (info.link && info.linkType === 'collections') {
                info.linkContent = encodeURIComponent(info.linkContent);
                // this.$router.push(`/productSearch?search=${info.linkContent}${props}`);
                this.$router.push(
                    '/' + this.$route.params.companyId + `/productSearchCorpse?search=${info.linkContent}${props}`
                );
            } else if (info.link && info.linkType === 'showroom') {
                info.linkContent = encodeURIComponent(info.linkContent);
                this.$router.push('/' + this.$route.params.companyId + `/hall?id=${info.linkContent}${props}`);
            } else if (info.link && info.linkType === 'hyperlink') {
                info.linkContent = info.linkContent.replace(location.origin + '/saas', '');
                if (info.linkContent.indexOf('http') !== -1) {
                    window.location.href = info.linkContent;
                } else {
                    this.$router.push(`${info.linkContent}${props}`);
                }
            }
        }
    }
};
