mpvue之中出现的一个问题
发布于 5 年前 作者 jingxia 13991 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
  • 预期表现
  • 复现路径
  • 提供一个最简复现 Demo

data:

这个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 回复

应改为 var deg = _this.deg;

回到顶部