收藏
回答

wx.switchTap跳转后,小程序突然就自己关闭了,怎么回事

框架类型 问题类型 操作系统 工具版本
小程序 Bug Windows v1.02.1811290

只要在那个流程里面,用了switchTap。小程序就会崩溃,我再其他页面用就不会

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

2 个回答

  • 猫薄荷
    猫薄荷
    2018-12-28
      api.addStationToProcess({
          method: 'post',
          data: {
              startIndex: parseFloat(startIndex),
              endIndex: parseFloat(endIndex),
              startTime: list[startIndex].leaveTime,
              endTime: list[endIndex].arriveTime,
              coseTime: coseTime,
              stationCount: stationCount,
              processId: processId,
              startStation: list[startIndex].stationName,
              endStation: list[endIndex].stationName,
          },
          success: (res) => {
              console.log(res);
              wx.showToast({
                  title: '添加成功'
              })
              if(res.data.status == 0) {
                  if(travelType == '1') {
                      // wx.navigateTo({
                      //  url: '/pages/index/travelAdd/travelAdd'
                      // })
    wx.switchTab({
      url: '/pages/index/index/index'
    })


    2018-12-28
    有用
    回复 1
    • 猫薄荷
      猫薄荷
      2018-12-28

      请各位帮我看一下呢


      2018-12-28
      回复
  • 2018-12-28

    开局一句话,后面全靠猜,没有截图,没有代码,怎么帮你

    2018-12-28
    有用
    回复 1
    • 猫薄荷
      猫薄荷
      2018-12-28
        api.addStationToProcess({
            method: 'post',
            data: {
                startIndex: parseFloat(startIndex),
                endIndex: parseFloat(endIndex),
                startTime: list[startIndex].leaveTime,
                endTime: list[endIndex].arriveTime,
                coseTime: coseTime,
                stationCount: stationCount,
                processId: processId,
                startStation: list[startIndex].stationName,
                endStation: list[endIndex].stationName,
            },
            success: (res) => {
                console.log(res);
                wx.showToast({
                    title: '添加成功'
                })
                if(res.data.status == 0) {
                    if(travelType == '1') {
                        // wx.navigateTo({
                        //  url: '/pages/index/travelAdd/travelAdd'
                        // })
      wx.switchTab({
        url: '/pages/index/index/index'
      })


      2018-12-28
      回复
登录 后发表内容