今天在用 wx.navigateTo 跳转页面时遇到一个问题,传参url后面带有参数时,跳转的页面在options.url里接收不到,例如:let url = "https://cn.axxxxxx.com/promotion/accaemployer.html?utm_content=WechatBrand&utm_source=WechatBrand" wx.navigateTo({ url: '/pages/index/webview?url='+url, })在webview.js页面的options.url拿到的却是 https://cn.axxxxxx.com/promotion/accaemployer.html ,后面的参数都没有了,解决办法就是用 encodeURIComponent 和 decodeURIComponentwx.navigateTo({ url: '/pages/index/webview?url='+encodeURIComponent(url), })webview.js页面:let url = decod
铅笔Naruto
前端攻城狮