|
@@ -28,6 +28,7 @@ import Header from "@/components/header/index";
|
|
|
import FooterTab from "./components/footerTab";
|
|
|
import coreContent from "./components/coreContent.vue";
|
|
|
import { Loading } from "element-ui";
|
|
|
+import { mapGetters } from "vuex";
|
|
|
export default {
|
|
|
name: "CourseDetail",
|
|
|
components: {
|
|
@@ -51,6 +52,9 @@ export default {
|
|
|
goodsPhotographConfig: {} //拍照设置
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["userInfo"])
|
|
|
+ },
|
|
|
created() {
|
|
|
Loading.service().close();
|
|
|
},
|
|
@@ -59,6 +63,7 @@ export default {
|
|
|
...this.$route.query,
|
|
|
...this.$route.params
|
|
|
};
|
|
|
+ this.saveLoaclCheckClass()
|
|
|
this.getInit();
|
|
|
},
|
|
|
methods: {
|
|
@@ -66,6 +71,22 @@ export default {
|
|
|
await this.getGoodsData(); //获取商品详情
|
|
|
await this.courseBusiness(); //获取培训项目详情
|
|
|
},
|
|
|
+ // 进行学习后,保存标识,用于检查是否二建15天提示弹窗弹出
|
|
|
+ saveLoaclCheckClass() {
|
|
|
+ let ary = JSON.parse(localStorage.getItem("loaclCheckClass")) || []
|
|
|
+ let userFindIndex = ary.findIndex(i => i.userId == this.userInfo.userId)
|
|
|
+ if (userFindIndex !== -1) {
|
|
|
+ if (!ary[userFindIndex].orderGoodsIds.includes(this.routerData.orderGoodsId)) {
|
|
|
+ ary[userFindIndex].orderGoodsIds.push(this.routerData.orderGoodsId)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ary.push({
|
|
|
+ userId: this.userInfo.userId,
|
|
|
+ orderGoodsIds: [this.routerData.orderGoodsId]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ localStorage.setItem("loaclCheckClass", JSON.stringify(ary))
|
|
|
+ },
|
|
|
//获取培训项目详情
|
|
|
courseBusiness() {
|
|
|
return new Promise(resolve => {
|