提交 6babded7 编写于 作者: guangjun.yang's avatar guangjun.yang

每周更新课程

背景色等
上级 95fdcf43
...@@ -31,10 +31,11 @@ ...@@ -31,10 +31,11 @@
<span <span
v-if="!item.id" v-if="!item.id"
class="text-action text-action-no" class="text-action text-action-no"
@click="toastToBuy('每周更新课程')"
> >
更新中 更新中
</span> </span>
<img v-else-if="!hasBindCard && item.trySeeFlag == 1 && !item.trySeeTime" @click="toastToBuy" class="key" v-show="!hasBindCard" src="../../images/cme/phrase2/key.png" alt=""> <img class="key" v-else-if="!hasBindCard && item.trySeeFlag == 1 && !item.trySeeTime" @click="toastToBuy('升级最新版本可试看课程')" src="../../images/cme/phrase2/key.png" alt="">
<span <span
v-else-if="!hasBindCard && item.trySeeFlag == 1" v-else-if="!hasBindCard && item.trySeeFlag == 1"
@click="gotoExamOrCourse(item, portalModule.contentList, index, true)" @click="gotoExamOrCourse(item, portalModule.contentList, index, true)"
...@@ -338,8 +339,8 @@ export default { ...@@ -338,8 +339,8 @@ export default {
}, },
// 弹框提示 // 弹框提示
toastToBuy() { toastToBuy(toastMsg) {
Toast('购买后可学习课程'); Toast(toastMsg);
} }
} }
}; };
...@@ -614,6 +615,7 @@ export default { ...@@ -614,6 +615,7 @@ export default {
.key { .key {
width: px2rem(15px); width: px2rem(15px);
height: px2rem(15px); height: px2rem(15px);
margin-right: px2rem(20px);
} }
} }
span { span {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<li <li
v-for="(model, mIndex) in titleTestModelList" v-for="(model, mIndex) in titleTestModelList"
:key="mIndex" :key="mIndex"
:class="{active: crrentModelIndex == mIndex}" :class="{active: currentModelIndex == mIndex}"
@click="selectModel(model, mIndex)" @click="selectModel(model, mIndex)"
> >
<span>{{model.title}}</span> <span>{{model.title}}</span>
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
<li class="list" v-for="(item, index) in listData" :key="index"> <li class="list" v-for="(item, index) in listData" :key="index">
<span class="title">{{item.name}}</span> <span class="title">{{item.name}}</span>
<ul class="item"> <ul class="item">
<li :id="'subject_' + sIndex" <li
:id="'subject_' + sIndex"
:class="{'no-active' : subject.openFlag == 0, 'has-bind' : subject.bindCardStatus == 1}" :class="{'no-active' : subject.openFlag == 0, 'has-bind' : subject.bindCardStatus == 1}"
v-for="(subject, sIndex) in item.secondSubjectModelList" v-for="(subject, sIndex) in item.secondSubjectModelList"
:key="sIndex" :key="sIndex"
...@@ -38,7 +39,10 @@ ...@@ -38,7 +39,10 @@
<span>{{subject.name}}</span> <span>{{subject.name}}</span>
<span>({{subject.code}})</span> <span>({{subject.code}})</span>
<span v-show="subject.bindCardStatus == 1" class="buy">己购</span> <span v-show="subject.bindCardStatus == 1" class="buy">己购</span>
<span v-show="subject.openFlag == 0" class="time">{{formatTime(subject.predictTime, '{y}年{m}月')}}上线</span> <span
v-show="subject.openFlag == 0"
class="time"
>{{formatTime(subject.predictTime, '{y}年{m}月')}}上线</span>
</li> </li>
</ul> </ul>
</li> </li>
...@@ -65,13 +69,13 @@ import CardBanner from "@/components/cme/card-banner"; ...@@ -65,13 +69,13 @@ import CardBanner from "@/components/cme/card-banner";
import Loading from "@/components/common/common-loading"; import Loading from "@/components/common/common-loading";
import CommonTitle from "@/components/common/common-title"; import CommonTitle from "@/components/common/common-title";
import { mapGetters, mapActions } from "vuex"; import { mapGetters, mapActions } from "vuex";
import { getWebPageUrl, parseTime } from '@/utils/index' import { getWebPageUrl, parseTime } from "@/utils/index";
export default { export default {
data() { data() {
return { return {
existBind: 0, existBind: 0,
crrentModelIndex: 0, currentModelIndex: 0,
titleTestModelList: [], titleTestModelList: [],
showLoading: false, showLoading: false,
isWeb: window.__isWeb, isWeb: window.__isWeb,
...@@ -120,7 +124,7 @@ export default { ...@@ -120,7 +124,7 @@ export default {
} }
], ],
isInfresh: false, isInfresh: false,
hasLogin: false, hasLogin: false
}; };
}, },
computed: { computed: {
...@@ -135,7 +139,7 @@ export default { ...@@ -135,7 +139,7 @@ export default {
}, },
created() { created() {
var _this = this; var _this = this;
_this.crrentModelIndex = 0; _this.currentModelIndex = 0;
window.__getUserInfo = function(param) { window.__getUserInfo = function(param) {
_this.setUserInfo(param); _this.setUserInfo(param);
_this.token = param.userToken; _this.token = param.userToken;
...@@ -150,7 +154,8 @@ export default { ...@@ -150,7 +154,8 @@ export default {
} }
window.__refresh = function() { window.__refresh = function() {
_this.isInfresh = true; _this.isInfresh = true;
_this.crrentModelIndex = 0; _this.currentModelIndex = 0;
console.log(_this.currentModelIndex);
_this.getUserInfo(); _this.getUserInfo();
}; };
...@@ -163,8 +168,8 @@ export default { ...@@ -163,8 +168,8 @@ export default {
}, },
mounted() { mounted() {
var _this = this;
this.listData = []; this.listData = [];
this.currentModelIndex = 0;
}, },
methods: { methods: {
...@@ -172,14 +177,14 @@ export default { ...@@ -172,14 +177,14 @@ export default {
// 选择职称 // 选择职称
selectModel(model, index) { selectModel(model, index) {
this.crrentModelIndex = index; this.currentModelIndex = index;
this.listData = this.listData =
this.titleTestModelList[index].firstSubjectModelList || []; this.titleTestModelList[index].firstSubjectModelList || [];
}, },
// 跳转到项目页面 // 跳转到项目页面
coopDetails(item) { coopDetails(item) {
if(item.openFlag == 0) return; if (item.openFlag == 0) return;
// this.$sendBuriedData({ // this.$sendBuriedData({
// component_tag: `880#8803#${item.id}#${item.name}` //'210#210002#0#'+item.projectName // component_tag: `880#8803#${item.id}#${item.name}` //'210#210002#0#'+item.projectName
// }); // });
...@@ -206,9 +211,7 @@ export default { ...@@ -206,9 +211,7 @@ export default {
let paramList = [ let paramList = [
{ {
key: "pageUrl", key: "pageUrl",
value: getWebPageUrl( value: getWebPageUrl(`profexam/#/coop?id=${item.projectId}`),
`profexam/#/coop?id=${item.projectId}`
),
type: 4, type: 4,
seqNo: 1 seqNo: 1
} }
...@@ -217,7 +220,6 @@ export default { ...@@ -217,7 +220,6 @@ export default {
modeCode: "M300", modeCode: "M300",
jsonString: paramList jsonString: paramList
}); });
}, },
//获取版本号 //获取版本号
...@@ -240,7 +242,7 @@ export default { ...@@ -240,7 +242,7 @@ export default {
if (res.code == "000000") { if (res.code == "000000") {
this.existBind = res.data.existBind || 0; this.existBind = res.data.existBind || 0;
this.titleTestModelList = res.data.titleTestModelList; this.titleTestModelList = res.data.titleTestModelList;
if(this.existBind) { if (this.existBind) {
this.resetPosition(this.titleTestModelList); this.resetPosition(this.titleTestModelList);
} }
this.listData = res.data.titleTestModelList[0].firstSubjectModelList; this.listData = res.data.titleTestModelList[0].firstSubjectModelList;
...@@ -252,14 +254,17 @@ export default { ...@@ -252,14 +254,17 @@ export default {
// 查找对应的职称与专业 // 查找对应的职称与专业
resetPosition(list) { resetPosition(list) {
if(!list.length) return; if (!list.length) return;
let parentIndex = 0, subIndex = 0, firstSub = [], secondSub = []; let parentIndex = 0,
for(let i = 0; i < list.length; i ++) { subIndex = 0,
firstSub = [],
secondSub = [];
for (let i = 0; i < list.length; i++) {
firstSub = list[i].firstSubjectModelList; firstSub = list[i].firstSubjectModelList;
for(let j = 0; j < firstSub.length; j ++) { for (let j = 0; j < firstSub.length; j++) {
secondSub = firstSub[j].secondSubjectModelList; secondSub = firstSub[j].secondSubjectModelList;
for(let k = 0; k < secondSub.length; k ++) { for (let k = 0; k < secondSub.length; k++) {
if(secondSub[k].bindCardStatus) { if (secondSub[k].bindCardStatus) {
parentIndex = i; parentIndex = i;
subIndex = k; subIndex = k;
break; break;
...@@ -267,20 +272,21 @@ export default { ...@@ -267,20 +272,21 @@ export default {
} }
} }
} }
this.crrentModelIndex = parentIndex; this.currentModelIndex = parentIndex;
this.resetProjectPosition(subIndex); this.resetProjectPosition(subIndex);
}, },
// 将定位到的元素,滚动到最上面 // 将定位到的元素,滚动到最上面
resetProjectPosition(subIndex) { resetProjectPosition(subIndex) {
this.$nextTick( () => { this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {
// let scrollTop = this.$refs['subject_' + subIndex].offsetTop; // let scrollTop = this.$refs['subject_' + subIndex].offsetTop;
let scrollTop = document.getElementById('subject_' + subIndex).offsetTop; let scrollTop = document.getElementById("subject_" + subIndex)
.offsetTop;
console.log(scrollTop); console.log(scrollTop);
window.scrollTo(0, scrollTop); window.scrollTo(0, scrollTop);
}, 100); }, 100);
}) });
}, },
// 监听滚动事件 // 监听滚动事件
...@@ -300,7 +306,7 @@ export default { ...@@ -300,7 +306,7 @@ export default {
// 格式化时间 // 格式化时间
formatTime(time, cFormat) { formatTime(time, cFormat) {
return parseTime(time, cFormat) return parseTime(time, cFormat);
}, },
// token是否失效校验 // token是否失效校验
...@@ -314,7 +320,7 @@ export default { ...@@ -314,7 +320,7 @@ export default {
if (res.code !== "000000") { if (res.code !== "000000") {
//未登录 跳转登录页 //未登录 跳转登录页
console.log("跳登录", _this.isInfresh); console.log("跳登录", _this.isInfresh);
if(_this.isInfresh) { if (_this.isInfresh) {
rocNative.goBack(); rocNative.goBack();
} else { } else {
rocNative.gotoLogin(); rocNative.gotoLogin();
...@@ -324,7 +330,7 @@ export default { ...@@ -324,7 +330,7 @@ export default {
_this.hasLogin = true; _this.hasLogin = true;
} }
}); });
}, }
} }
}; };
</script> </script>
...@@ -403,6 +409,7 @@ export default { ...@@ -403,6 +409,7 @@ export default {
} }
&.has-bind { &.has-bind {
color: #449284; color: #449284;
background: rgba(68, 146, 132, 1);
.buy { .buy {
position: absolute; position: absolute;
top: 0; top: 0;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册