运维中心-错误大都是undefined is not a function...
发布于 5 年前 作者 haofang 1242 次浏览 来自 问答

昨天小程序的运维中心刚上线,今天迫不及待的来看看线上版本有哪些错误,打开“运维中心” - “错误查询”,都是和下面类似的错误。

请问是程序写法的问题么?谢谢

undefined is not a function (evaluating ‘wx.showLoading’);App catch error in mShowLoading function

undefined is not a function (evaluating ‘wx.hideLoading()’);App catch error in mHideLoading function

undefined is not a function (evaluating ‘wx.addPhoneContact’);at api showModal success callback function

undefined is not a function (evaluating ‘wx.showLoading’);App catch error in mShowLoading function

源程序:

  mShowLoading: function (text) {

    var that = this

    if(text == ‘’){

      text = “正在加载数据”

    }

    if (!this.showLoading){

      wx.showLoading({

        title: text,

        mask: true,

        success:function(res){

          that.showLoading = true

        }

      })

    }

  },

  mHideLoading: function () {

    wx.hideLoading();

    this.showLoading = false

  },

2 回复

好,我试一下,非常感谢

wx.showLoading(OBJECT)

基础库 1.1.0 开始支持,低版本需做兼容处理

showLoading hideLoading addPhoneContact 都是新版本基础库才有的 API,看代码并没有做兼容处理,可以这样判断下

if (wx.showLoading)

回到顶部