|
|
@@ -46,7 +46,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: {
|
|
|
@@ -96,9 +97,21 @@ export default {
|
|
|
str += day + '天 ';
|
|
|
}
|
|
|
this.startTime = str + dayjs.duration(x.diff(y)).format('HH:mm:ss');
|
|
|
- setTimeout(() => {
|
|
|
- this.getTime(startTime);
|
|
|
- }, 1000);
|
|
|
+
|
|
|
+ if (this.timer) {
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ this.timer = null;
|
|
|
+ }
|
|
|
+ if (!dayjs().isBefore(dayjs(startTime))) {
|
|
|
+ if (this.getProduct) {
|
|
|
+ this.getProduct();
|
|
|
+ }
|
|
|
+ this.startTime = '';
|
|
|
+ } else {
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ this.getTime(startTime);
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
},
|
|
|
getShort(str = '') {
|
|
|
if (str) {
|