mpvue之中出现的一个问题

发布于 7 年前作者 jingxia14135 次浏览最后编辑 7 年前来自 ask
  • 当前 Bug 的表现(可附上截图)

  • 预期表现

  • 复现路径

  • 提供一个最简复现 Demo

WXOPEN Club 内容图片

data:

WXOPEN Club 内容图片

这个deg是我所需要的!!!

var _this = this
      var deg = _this.data.deg
      var GTshow = _this.data.GTshow
      if (!GTshow) {
        var My = setInterval(() => {
          if (_this.data.deg > -90) {
            _this.setData({
              deg: _this.data.deg - 10
            })
          } else {
            if (_this.data.bottom01 < 150) {
              _this.setData({
                bottom01: _this.data.bottom01 + 5,
                bottom02: _this.data.bottom02 + 10,
                opacity: _this.data.opacity + 0.05
              })
            } else if (_this.data.opacity < 1) {
              _this.setData({
                opacity: _this.data.opacity + 0.05
              })
            } else {
              clearInterval(My)
              _this.setData({
                GTshow: true
              })
            }
          }
        }, 10)
      } else {
        var Me = setInterval(() => {
          if (_this.data.deg < 0) {
            _this.setData({
              deg: _this.data.deg + 10
            })
          } else {
            if (_this.data.bottom01 > 100) {
              _this.setData({
                bottom01: _this.data.bottom01 - 5,
                bottom02: _this.data.bottom02 - 10,
                opacity: _this.data.opacity - 0.05
              })
            } else if (_this.data.opacity > 0) {
              _this.setData({
                opacity: _this.data.opacity - 0.05
              })
            } else {
              clearInterval(Me)
              _this.setData({
                GTshow: false
              })
            }
          }
        }, 10)
      }
    }
1 回复
na74
na741 楼5 年前

应改为 var deg = _this.deg;