export default {
    data() {
        return {
            // 静态资源路径
            staticUrl: 'https://static.caimei365.com/app/mini-hehe/icon/'
        }
    },
    methods: {
        jumpAction(data) {
            const { jumpType, jumpLink, jumpProductId, jumpImage } = data
            if (jumpType === 1 && !jumpLink) return
            if (jumpType === 2 && !jumpProductId) return
            if (jumpType === 3 && !jumpImage) return
            // jumpType 跳转类型：1链接，2商品，3图片
            const jumpMap = {
                1: `others/web-view?websit=${encodeURIComponent(jumpLink)}`,
                2: `goods/goods-detail?productId=${jumpProductId}&jumpState=0`,
                3: `others/image-view?imageUrl=${encodeURIComponent(jumpImage)}`
            }
            this.$router.navigateTo(jumpMap[jumpType])
        }
    }
}
