wx.createAnimation动画角度不旋转
发布于 4 年前 作者 rlong 7557 次浏览 来自 官方Issues

安卓端没问题,但是ios端 请求后台实时坐标数据后设置rotate时没有效果刚开始转了一下后就还原图片不旋转了,下面是具体代码

self.data.setInter = setInterval(function() {

wx.request({

url: app.globalData.baseUrl

data: {

car_id: self.data.id,

api_token: wx.getStorageSync(“token”)

},

method: ‘GET’, // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT

header: {

‘content-type’: ‘application/json’

}, // 设置请求的 header

success: function(res) {

if (res.statusCode == 200) {

self.data.carPosition.push(res.data);

console.log(res.data);

}

var postionData = self.data.carPosition.shift();

var pos_x = (postionData[0] - 82) * 0.417 / 750 * wx.getSystemInfoSync().windowWidth;

var pos_y = (postionData[1] - 2630) * 0.455 / 750 * wx.getSystemInfoSync().windowWidth;

if (postionData[2] > 250 && postionData[2] < 271) {

self.animation.translate(pos_x, pos_y).step()

self.animation.rotate(450).step()

self.setData({

animation: self.animation.export(),

})

} else {

self.animation.translate(pos_x, pos_y).step()

self.animation.rotate(90).step()

self.setData({

animation: self.animation.export(),

})

}

}, 300)

1 回复

你好,先将ios的微信版本更新至最新的7.0.7看下问题是否还存在,若还有问题,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

回到顶部