For the problem that the parameters of the jump page carry special symbols or are too long to be intercepted

Use encodeURIComponent and decodeURIComponent, which are currently used in applet projects

wx.navigateTo({
          // 跳转到webview页面
          url: `/pages/mine/carbon/carbonCodeDetail?url=${encodeURIComponent(url)}`,
      });
 onLoad: function (options) {
    // console.log(options,'跳转')
    // console.log(decodeURIComponent(options.url));
    let newUrl=decodeURIComponent(options.url)
    // console.log(newUrl)
    this.setData({
      url: newUrl, // 从跳转页面中传过来的url在options中可以拿到
    });
  },

Guess you like

Origin blog.csdn.net/qq_40004867/article/details/129836771