global.js 710 B

1234567891011121314151617181920
  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. // jumpType 跳转类型:1链接,2商品,3图片
  12. const jumpMap = {
  13. 1: `others/web-view?websit=${encodeURIComponent(jumpLink)}`,
  14. 2: `goods/goods-detail?productId=${jumpProductId}&jumpState=0`,
  15. 3: `others/image-view?imageUrl=${encodeURIComponent(jumpImage)}`
  16. }
  17. this.$router.navigateTo(jumpMap[jumpType])
  18. }
  19. }
  20. }