|
@@ -93,6 +93,7 @@
|
|
<script>
|
|
<script>
|
|
import { Toast } from "vant";
|
|
import { Toast } from "vant";
|
|
import { mapState } from "vuex";
|
|
import { mapState } from "vuex";
|
|
|
|
+import { getTodayStr } from "@/utils/date";
|
|
export default {
|
|
export default {
|
|
name: "page-learn-recommend",
|
|
name: "page-learn-recommend",
|
|
components: {},
|
|
components: {},
|
|
@@ -121,7 +122,6 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.getNewsfeed();
|
|
|
|
this.getCarousels();
|
|
this.getCarousels();
|
|
},
|
|
},
|
|
mounted() {},
|
|
mounted() {},
|
|
@@ -171,12 +171,7 @@ export default {
|
|
},
|
|
},
|
|
// 判断是否今日必学
|
|
// 判断是否今日必学
|
|
formatNeedStudyTodayFun(datas) {
|
|
formatNeedStudyTodayFun(datas) {
|
|
- let date = new Date();
|
|
|
|
- let year = date.getFullYear();
|
|
|
|
- let month = date.getMonth() + 1;
|
|
|
|
- month = month >= 10 ? "" + month : "0" + month;
|
|
|
|
- let day = date.getDate();
|
|
|
|
- let todayStr = year + month + day;
|
|
|
|
|
|
+ let todayStr = getTodayStr();
|
|
datas.forEach(item => {
|
|
datas.forEach(item => {
|
|
item.tags.forEach(itemChild => {
|
|
item.tags.forEach(itemChild => {
|
|
if (itemChild === todayStr) {
|
|
if (itemChild === todayStr) {
|