<!--正面的框 -->
<image src="https://www.chaochaotool.top:444/CQC/cow/01rice.png" mode="aspectFit" class="image-front" animation="{{animation[1]}}" bindtap='rotateFn' data-id="1"></image>
<!--背面的框 -->
<image src="https://www.chaochaotool.top:444/CQC/cow/11rice.png" mode="aspectFit" class="image-back" animation="{{animation_back[1]}}"></image>
</view>
<!-- 2 -->
<view class="main1">
<image src="https://www.chaochaotool.top:444/CQC/cow/02happy.png" mode="aspectFit" class="image-front" animation="{{animation[2]}}" bindtap='rotateFn' data-id="2"></image>
<!--背面的框 -->
<image src="https://www.chaochaotool.top:444/CQC/cow/12happy.png" mode="aspectFit" class="image-back" animation="{{animation_back[2]}}" ></image>
rotateFn(e) {
var id = parseInt(e.currentTarget.dataset.id)
this.setData({
id:id
})
console.log("反转ID:"+id)
var Temp="animationMain["+id+"]"
console.log("hope数组为"+Temp)
var backTemp="animationback["+id+"]"
console.log("hope数组为"+backTemp)
this.animation_main = wx.createAnimation({
duration:400,
timingFunction:'linear'
})
this.animation_back= wx.createAnimation({
duration:400,
timingFunction:'linear',
})
// 点击正面
this.animation[id].rotateY(180).step()
this.animation_back[id].rotateY(0).step()
this.setData({
//animationMain1: this.animation_main.export(),
//animationBack1: this.animation_back.export(),
// animationMain2: this.animation_main.export(),
//animationBack2: this.animation_back.export(),
// animationMain:[id]=this.animation[id].export(),
//animation_back:[id]=this.animation_back[id].export(),
[Temp]: this.animation_back.export(),
[backTemp]:this.animation_back.export(),
})
console.log("id值修改为:"+this.data.id)
//}
},
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。