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

项目组件列表项

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