global.js 872 B

1234567891011121314151617181920212223
  1. export default {
  2. data() {
  3. return {
  4. // 静态资源路径
  5. staticUrl: 'https://static.caimei365.com/app/mini-hehe/icon/'
  6. }
  7. },
  8. methods: {
  9. jumpAction(data) {
  10. const { jumpType, jumpLink, jumpProductId, jumpImage } = data
  11. if (jumpType === 1 && !jumpLink) return
  12. if (jumpType === 2 && !jumpProductId) return
  13. if (jumpType === 3 && !jumpImage) return
  14. // jumpType 跳转类型:1链接,2商品,3图片
  15. const jumpMap = {
  16. 1: `others/web-view?websit=${encodeURIComponent(jumpLink)}`,
  17. 2: `goods/goods-detail?productId=${jumpProductId}&jumpState=0`,
  18. 3: `others/image-view?imageUrl=${encodeURIComponent(jumpImage)}`
  19. }
  20. this.$router.navigateTo(jumpMap[jumpType])
  21. }
  22. }
  23. }