微信小程序使用switchTab跳转后页面不刷新的问题

wx.switchTab({
        url: '../mycar/mycar',
        success: function (res) {
          wx.request({
            url: api.saveCarInfo,
            method: 'post', //请求方式
            header: {
              'Content-Type': 'application/x-www-form-urlencoded',
            },
            data: {
              carNo: carNum,
              // nickName: that.data.nickname,
              cid: wx.getStorageSync('companyid'),
            },
            success: (res) => {
             
            },
          })


        //下面这段是重点!!!!!!!
          var page = getCurrentPages().pop();
          if (page == undefined || page == null) return;
          page.onLoad();

        },
      })·            

 

posted @ 2021-11-17 14:13  xxshen  阅读(256)  评论(0)    收藏  举报