|
|
@@ -56,11 +56,6 @@
|
|
|
|
|
|
<script>
|
|
|
import product from '../../mixins/product';
|
|
|
-import dayjs from 'dayjs';
|
|
|
-var isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
|
|
|
-dayjs.extend(isSameOrBefore);
|
|
|
-var duration = require('dayjs/plugin/duration');
|
|
|
-dayjs.extend(duration);
|
|
|
export default {
|
|
|
mixins: [product],
|
|
|
props: {
|
|
|
@@ -74,8 +69,8 @@ export default {
|
|
|
computed: {
|
|
|
time() {
|
|
|
if (this.info.startTime) {
|
|
|
- if (dayjs().isSameOrBefore(this.info.startTime)) {
|
|
|
- return dayjs(this.info.startTime).format('MM月DD日');
|
|
|
+ if (this.dayjs().isSameOrBefore(this.info.startTime, 'YYYY-MM-DD HH:mm:ss')) {
|
|
|
+ return this.dayjs(this.info.startTime).format('MM月DD日');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -84,9 +79,9 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
if (this.info.startTime) {
|
|
|
- var x = dayjs(this.info.startTime);
|
|
|
- var y = dayjs();
|
|
|
- let d = dayjs.duration(x.diff(y));
|
|
|
+ var x = this.dayjs(this.info.startTime, 'YYYY-MM-DD HH:mm:ss');
|
|
|
+ var y = this.dayjs();
|
|
|
+ let d = this.dayjs.duration(x.diff(y));
|
|
|
let day = parseInt(d.asDays());
|
|
|
if (day <= 0) {
|
|
|
this.getTime(this.info.startTime);
|