1
|
import router from '../router/router';
|
1
|
import router from '../router/router';
|
2
|
|
2
|
|
|
|
3
|
+let timer;
|
|
|
4
|
+
|
3
|
Component({
|
5
|
Component({
|
4
|
properties: {
|
6
|
properties: {
|
5
|
product: {
|
7
|
product: {
|
|
@@ -17,7 +19,7 @@ Component({ |
|
@@ -17,7 +19,7 @@ Component({ |
17
|
});
|
19
|
});
|
18
|
//放大缩小循环动画
|
20
|
//放大缩小循环动画
|
19
|
var next = true;
|
21
|
var next = true;
|
20
|
- setInterval(function () {
|
22
|
+ timer = setInterval(function () {
|
21
|
if (next) {
|
23
|
if (next) {
|
22
|
animation.scale(1.05).step()
|
24
|
animation.scale(1.05).step()
|
23
|
next = !next;
|
25
|
next = !next;
|
|
@@ -30,6 +32,10 @@ Component({ |
|
@@ -30,6 +32,10 @@ Component({ |
30
|
})
|
32
|
})
|
31
|
}.bind(this), 400)
|
33
|
}.bind(this), 400)
|
32
|
},
|
34
|
},
|
|
|
35
|
+ detached: function() {
|
|
|
36
|
+ clearInterval(timer);
|
|
|
37
|
+ },
|
|
|
38
|
+
|
33
|
methods: {
|
39
|
methods: {
|
34
|
onClick() {
|
40
|
onClick() {
|
35
|
router.go('detail', {
|
41
|
router.go('detail', {
|