提交 4933925b 编写于 作者: guangjun.yang's avatar guangjun.yang

项目组件列表项

上级 ac30df09
此差异已折叠。
......@@ -29,6 +29,21 @@
<p class="name-title" :class="{'name-title-no': item.useFlag == 2}">{{item.name | shortName(30)}}</p>
</div>
<span
v-if="!item.id"
class="text-action text-action-no"
>
更新中
</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="">
<span
v-else-if="!hasBindCard && item.trySeeFlag == 1"
@click="gotoExamOrCourse(item, portalModule.contentList, index, true)"
class="text-action"
>
去试看
</span>
<span
v-else
@click="gotoExamOrCourse(item, portalModule.contentList, index)"
class="text-action"
:class="{'text-action-no': item.useFlag == 2}"
......@@ -132,7 +147,7 @@ export default {
methods: {
// 跳转到考试或课程 type 1: 考试; 2: 课程
// 如果是考试,将根据appVersion判断是新考试还是老考试,如果是301或之前的,都是老考试
gotoExamOrCourse(item, contentList, index) {
gotoExamOrCourse(item, contentList, index, trySee) {
// 埋点:去学习、继续学习、复习、去考试、重考
// let actionCode = sendBuriedDataMap[item.status];
// if(actionCode) {
......@@ -150,7 +165,7 @@ export default {
this.gotoExam(item.id);
}
} else if (item.type == 2) {
this.gotoCourse(item, contentList, index);
this.gotoCourse(item, contentList, index, trySee);
}
},
......@@ -184,27 +199,27 @@ export default {
// 如果还有课程没有学完,则直接退出
if(hasNoLearningCourse) return extendsParam;
let urlType = currentExam.urlType;
let jumpUrl = currentExam.url;
let jumpContent = '';
let examType = 0;
// (已经与后台约定只判断链接)如果有链接,则要加入相应参数
if(jumpUrl) {
examType = urlType;
jumpContent = jumpUrl;
} else {
examType = -1;
jumpContent = currentExam.id;
}
extendsParam.push({key: "examType", value: examType, type: 4, seqNo: 1});
extendsParam.push({key: "jumpContent", value: jumpContent, type: 4, seqNo: 1});
// let urlType = currentExam.urlType;
// let jumpUrl = currentExam.url;
// let jumpContent = '';
// let examType = 0;
// // (已经与后台约定只判断链接)如果有链接,则要加入相应参数
// if(jumpUrl) {
// examType = urlType;
// jumpContent = jumpUrl;
// } else {
// examType = -1;
// jumpContent = currentExam.id;
// }
extendsParam.push({key: "examType", value: -1, type: 4, seqNo: 1});
extendsParam.push({key: "jumpContent", value: currentExam.id, type: 4, seqNo: 1});
return extendsParam;
},
// 跳转到课程
// TODO 查看课程是否是最后一节课, 如果是,则要查找到相应的考试,并传递给原生端
gotoCourse: function(item, contentList, index) {
gotoCourse: function(item, contentList, index, trySee) {
let extendsParam = this.beforeGotoCourse(item, contentList, index);
let appVersion = getAppVersion(this.userInfo.appVersion);
// 弹框提示下载新版本可以试看
......@@ -221,10 +236,6 @@ export default {
return;
}
let paramList = []
let limitTimes = this.limitTimes - 0;
if(this.hasBindCard) {
limitTimes = -1;
}
paramList = [
{
key: "className",
......@@ -250,13 +261,20 @@ export default {
type: 4,
seqNo: 1
},
{
];
if(trySee) {
let limitTimes = this.limitTimes - 0;
if(this.hasBindCard) {
limitTimes = -1;
}
paramList.push({
key: "limitTimes",
value: limitTimes,
type: 4,
seqNo: 1
},
];
});
}
console.log(paramList);
rocNative.dispatchEventByModuleCode({
modeCode: "M200",
......@@ -287,6 +305,8 @@ export default {
jsonString: paramList
});
},
// 获取按钮文案
getActionText(status, type) {
let actionText = actionMap[status];
if(!actionText) {
......@@ -294,13 +314,8 @@ export default {
}
return actionText;
},
// showDialog(introduce) {
// Dialog.alert({
// title: '说明',
// message: introduce,
// confirmButtonText: '我知道了',
// })
// },
// 折叠与展开模块
changeCollapse(activeNames) {
console.log('activeNames',activeNames);
let param = {
......
......@@ -10,7 +10,7 @@
borderStyle="1px solid #fff"
></CommonNavbar>
<section class="page-content">
<section v-show="isShow" class="cb-wrapper padding-top-111">
<section v-show="!existBind" class="cb-wrapper padding-top-111">
<CardBanner :userMobile="userMobile"></CardBanner>
</section>
<section class="body">
......@@ -38,7 +38,7 @@
<span>{{subject.name}}</span>
<span>({{subject.code}})</span>
<span v-show="subject.bindCardStatus == 1" class="buy">己购</span>
<span v-show="subject.openFlag == 0" class="time">{{subject.predictTime}}</span>
<span v-show="subject.openFlag == 0" class="time">{{formatTime(subject.predictTime, '{y}年{m}月')}}上线</span>
</li>
</ul>
</li>
......@@ -65,10 +65,12 @@ import CardBanner from "@/components/cme/card-banner";
import Loading from "@/components/common/common-loading";
import CommonTitle from "@/components/common/common-title";
import { mapGetters, mapActions } from "vuex";
import { parseTime } from '@/utils/index'
export default {
data() {
return {
existBind: 0,
crrentModelIndex: 0,
titleTestModelList: [],
showLoading: false,
......@@ -116,7 +118,8 @@ export default {
{ name: "全科中医", code: 201, bindStatus: 0 }
]
}
]
],
isInfresh: false,
};
},
computed: {
......@@ -143,6 +146,7 @@ export default {
_this.getListData();
}
window.__refresh = function() {
_this.isInfresh = true;
_this.getUserInfo();
};
......@@ -171,6 +175,7 @@ export default {
// 跳转到项目页面
coopDetails(item) {
if(item.openFlag == 0) return;
// this.$sendBuriedData({
// component_tag: `880#8803#${item.id}#${item.name}` //'210#210002#0#'+item.projectName
// });
......@@ -180,7 +185,7 @@ export default {
this.$router.push({
path: "/coop",
query: {
id: item.id
id: item.projectId
}
});
return;
......@@ -216,6 +221,16 @@ export default {
//获取版本号
getUserInfo() {
// 如果刷新了页面,并且没有手机号码,则直接返回到上一级
if(this.isInfresh && !this.userMobile) {
rocNative.goBack();
return;
}
// 如果是直接进入了页面,则调用原生登陆
if(!this.userMobile) {
rocNative.gotoLogin();
return;
}
rocNative.getUserInfo({
__funcName: "__getUserInfo"
});
......@@ -232,6 +247,7 @@ export default {
this.GET(`portal/titleTestApp/list`, param).then(res => {
this.showLoading = false;
if (res.code == "000000") {
this.existBind = res.data.existBind || 0;
this.titleTestModelList = res.data.titleTestModelList;
this.listData = res.data.titleTestModelList[0].firstSubjectModelList;
} else {
......@@ -253,6 +269,10 @@ export default {
// 滚动到顶部
scrollTop() {
window.scrollTo(0, 0);
},
formatTime(time, cFormat) {
return parseTime(time, cFormat)
}
}
};
......
......@@ -270,7 +270,7 @@ export default {
_this.token = param.userToken;
_this.setUserInfo(param);
_this.checkToken();
_this.getProjectParticularsV2();
_this.getProjectInfoById();
};
_this.getUserInfo();
// if (__isWeb && process.env.BUILD_ENV == "development") {
......@@ -279,7 +279,7 @@ export default {
// }
if (__isWeb) {
_this.getProjectParticularsV2();
_this.getProjectInfoById();
}
window.__refresh = function() {
_this.isInfresh = true;
......@@ -327,7 +327,7 @@ export default {
} else {
_this.showChangeCard = false;
Toast("激活成功,开始学习");
_this.getProjectParticularsV2();
_this.getProjectInfoById();
}
} else {
}
......@@ -341,9 +341,11 @@ export default {
let _this = this;
let clipboard = new this.clipboard(".cobyOrderSn");
clipboard.on("success", function() {
e.clearSelection();
Toast("已成功复制激活码");
});
clipboard.on("error", function() {
e.clearSelection();
Toast("复制激活码失败");
});
},
......@@ -676,7 +678,7 @@ export default {
},
// 获取项目详情
getProjectParticularsV2() {
getProjectInfoById() {
let _this = this;
let param = {
token: _this.userInfo.userToken || this.token,
......@@ -739,7 +741,7 @@ export default {
.offsetTop;
intorOffsetTop = document.getElementById("intro-content").offsetTop;
console.log(
"getProjectParticularsV2",
"getProjectInfoById",
cataOffsetTop,
intorOffsetTop
);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册