JS方法在IOS上不执行,在安卓上正常

getGameInfoApp:function(){
  getAppSignInfo()
  window.callbackFromApp = (methodName, result, extInfo) => {
    if (methodName == 'getAppSignInfo') {
      let data = JSON.parse(result)
  this.$http.jsonp(config.ajaxUrl + 'game/info/app/check', {
    params: {
      'Api-Key': data['Api-Key'],
      'Api-Nonce': data['Api-Nonce'],
      'Api-Time': data['Api-Time'],
      'Api-Loginname': data['Api-Loginname'],
      gameInfoId:this.$route.query.id
    }
  }).then((response) => {
    if (response.body.ok === 1) {
      const data = response.body

      this.gameInfo.id = data.gameInfo.id
      this.gameInfo.name = data.gameInfo.name
      this.gameInfo.images = data.gameInfo.images
      this.gameInfo.simpleDesc = data.gameInfo.simpleDesc
      if (window.javaBridge) {
        this.gameInfo.gameUrl = data.gameInfo.sURL
        this.gameInfo.gameName = data.gameInfo.name
      } else {
        this.gameInfo.gameUrl = data.gameInfo.iosUrl
      }
      this.gameInfo.indexIcon = data.gameInfo.indexIcon
      this.gameInfo.detail = data.gameInfo.detail
      this.gameInfo.headIcon = data.gameInfo.headIcon
      this.gameInfo.detailData = data.gameInfo.detailData
      this.gameInfo.createTime = data.gameInfo.createTime
      this.gameInfo.average = data.gameInfo.average
      this.size = data.size
      this.isColl = data.isColl
      this.upFlag = data.upFlag
      this.ups = data.gameInfo.ups
      if (data.size > 1000) {
        this.gameInfo.evaluate = (data.size / 1000) + 'k'
      } else {
        this.gameInfo.evaluate = data.size
      }
    }
  })
}

}
},

在安卓上获取到数据并显示正常。但是在IOS上不执行这个方法,偶尔能执行,但是获取到了数据,页面无法显示。

阅读 4.4k
1 个回答

先不说里面用了一大堆找不到源码的方法,首先求求你把分号加上好么?强迫症看着有点难受,而且不加分号看上去很潇洒,但你压缩的时候有可能会出错的,而且文件大小也不差你这点分号,性能也不差这点分号。

至于在IOS上为什么不运行,如果你不能调试手机,就只能靠在页面上输出值来打断点了,或者alert打断点,得自己去排查,最好一段一段进行排查,找到原因然后进行改正就行。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题