The uniapp WeChat applet jumps to the applet and obtains the path of any page of the target applet

For example, the target applet page we want to jump to is: Shandong Electronic Health Pass Card-Help Page

1. Log in to the background of the applet, and select as follows

2. Search Shandong Electronic Health Pass Card

3. Open the Shandong Electronic Health Pass Card-help page

4. Copy pages/help/question.html, and you will get the target page here. You don’t need to bring .html when you actually use it, just take pages/help/question

If the target page has parameters, such as pages/help/question.html?name=123456, you don’t need to bring .html in actual use, just use pages/help/question?name=123456

5. Search for Shandong Electronic Health Pass Card in the WeChat applet---more information, copy the AppId, and put it in pages.json

It is best to configure it in the manifest.json source code file,

6. Jump to Shandong Electronic Health Pass Card-help page

<template>
  <view>
     <button class="btn-long" @click="doMini()">跳转到小程序</button>
  </view>
</template>

<script>
export default {
    methods: {
      doMini(){
       uni.navigateToMiniProgram({
         appId: 'wx************',
         path:'pages/help/question',
         extraData: {},
         envVersion: 'release',
         success: res => {
           console.log("打开成功", res);
         },
         fail: err => {
           console.log(err);
         }
       })
     },
  },
}
</script>

7. It does not work in the WeChat simulator, it needs to be previewed on the real machine, the effect is as follows

 

Guess you like

Origin blog.csdn.net/LzzMandy/article/details/122068263