123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- Component({
-
- properties: {
- },
-
- data: {
- arr: ['钻石', '四季', '踏雪寻梅', '鹅鹅鹅', 'aaa'],
- flag: false,
- animationData: {},
- },
-
- methods: {
- onTap (e) {
- let flage = e.target.dataset.flag;
- if(flage){
- this.util(flage, '270rpx');
- this.setData({'flag': false})
- } else {
- this.util(flage, '400rpx');
- this.setData({'flag': true})
- }
- },
-
- util (flag, height) {
-
- var animation = wx.createAnimation({
- duration: 200,
- timingFunction: "linear",
- delay: 0
- });
-
- this.animation = animation;
- animation.height(height).step();
- this.setData({
- animationData: animation.export()
- })
- }
- }
- })
|