微信开发者工具和真机执行不一致
发布于 6 年前 作者 echen 7231 次浏览 来自 问答

问题:同一段代码,同一段数据,微信开发者工具与真机执行的结果完全相反。

执行代码:

Http.login(params).then((response)=>{
          if (response.statusCode === 200) {
            wx.showToast({
              title: '删除啦~',
              icon: 'success',
              success: function () {
                 
              },
              complete: function () {
                for (let item of _carts) {
                  item.edit = false
                  console.log(item.storeCode, _shop)
                  console.log(item.storeCode==_shop)
                  console.log(item.storeCode === _shop)
                  if (item.storeCode == _shop) {
                    console.log(item.product.splice(_index, 1))
                    _this.setData({
                      carts: _carts,
                      totalPrice: setTotalPrice(_carts).totalPrice
                    })
                  if (item.product.length == 0) {
                    wx.redirectTo({
                      url: '/pages/shoppingCart/shoppingCart',
                    })
                  }
                  }
                }
              
            })
          }
        });

微信开发者工具:

真机:

回到顶部