product-item-status.js
842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import router from '../router/router';
Component({
properties: {
product: {
type: Object
},
tabIdx: String
},
data: {
animation: null,
},
ready: function() {
let animation = wx.createAnimation({
duration: 400,
timingFunction: 'ease',
});
//放大缩小循环动画
var next = true;
setInterval(function () {
if (next) {
animation.scale(1.05).step()
next = !next;
} else {
animation.scale(1).step()
next = !next;
}
this.setData({
animation: animation.export()
})
}.bind(this), 400)
},
methods: {
onClick() {
router.go('detail', {
tabIdx: +this.data.tabIdx + 1,
fromPageParam: +this.data.tabIdx + 1,
actPrizeId: this.properties.product.id
});
}
}
});