收藏
回答

小程序通过web-view跳转H5A页面,然后跳转H5B页面,H5B页面如何正常跳转到小程序页面?

<template>

  <div class="container">

    <van-loading size="24px" vertical>加载中...</van-loading>

  </div>

</template>

<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>

<script>

import { mapState } from "vuex";

import keyboard from "@/components/common/keyboard.vue";

import commonHead from "@/components/common/head.vue";

//房抵贷下拉框数据源

import { Checkbox } from "vant";

import AntiShake from "@/assets/js/common/prevent";

import { telJudge, SpecialCharactersRules, checkPrice } from "@/assets/js/static/rule";

import step from "@/components/todoTask/stepChild";

import steps from "@/components/todoTask/stepPartent";

import wx from "weixin-js-sdk"

export default {

  name: "motorcar",

  components: {

    "v-head": commonHead,

    "v-keyboard": keyboard,

    step,

    steps,

  },

  data() {

    return {

      

    }

  },

  watch: {},

  computed: {

    ...mapState("appInfo", ["shouldRefresh", "showLoading"]),

  },

  mounted() {

alert(this.$route.query.sign)

this.jumpToMiniProgram()

  },


  methods: {

  jumpToMiniProgram(){

  setTimeout(() => {

    wx.miniProgram.navigateBack();

  }, 500);

  }

  },

};

</script>


<style lang="less" scoped>

.container {

  width: 100%;

  height: 100%;

  background: #fff;

}

</style>


回答关注问题邀请回答
收藏

2 个回答

  • showms
    showms
    02-03

    你指的是h5B页面打开小程序原生页面?

    试试 wx.miniProgram.navigateTo

    02-03
    有用 1
    回复 1
    • 路在远方。
      路在远方。
      02-03
      是H5B页面打开小程序原生页面,在H5B页面中只要调用wx.miniProgram方法就报错,判断了一下不是小程序web-view环境
      02-03
      回复
  • 智能回答 智能回答 本次回答由AI生成
    02-03
    有用
    回复 2
    • 路在远方。
      路在远方。
      02-03
      在H5页面中调用wx.miniProgram.navigateBack()提示报错
      02-03
      回复
    • 路在远方。
      路在远方。
      02-03回复路在远方。
      Uncaught TypeError: Cannot read properties of undefined (reading 'navigateBack')
      02-03
      回复
登录 后发表内容