收藏
回答

微信开发者工具和真机执行不一致

问题模块
开发者工具

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


执行代码:


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',
                    })
                  }
                  }
                }
              
            })
          }
        });


微信开发者工具:



真机:


最后一次编辑于  2017-11-02
回答关注问题邀请回答
收藏