|
|
@@ -48,7 +48,8 @@ export default {
|
|
|
本期推荐: 'soldOut;sale,desc;sort,desc',
|
|
|
最HOT收藏品: 'soldOut;likes,desc;sort,desc;createdAt,desc',
|
|
|
更多藏品: 'soldOut;source,asc;sale,desc;likes,desc'
|
|
|
- }
|
|
|
+ },
|
|
|
+ timer: null
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -99,14 +100,17 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.startTime = str + dayjs.duration(x.diff(y)).format('HH:mm:ss');
|
|
|
-
|
|
|
+ if (this.timer) {
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ this.timer = null;
|
|
|
+ }
|
|
|
if (!dayjs().isBefore(dayjs(startTime))) {
|
|
|
if (this.getProduct) {
|
|
|
this.getProduct();
|
|
|
}
|
|
|
this.startTime = '';
|
|
|
} else {
|
|
|
- setTimeout(() => {
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
this.getTime(startTime);
|
|
|
}, 1000);
|
|
|
}
|