提交 14440e7b 编写于 作者: guangjun.yang's avatar guangjun.yang

激活并去练习

上级 5b913971
此差异已折叠。
...@@ -27,15 +27,6 @@ ...@@ -27,15 +27,6 @@
@confirm="beforeChangeCardAction" @confirm="beforeChangeCardAction"
></ChangeCard> ></ChangeCard>
<!-- 主动提示:激活并去学习 -->
<CourseDialog
:subContent="subContent"
confirmBtnText="激活并去练习"
needSubContent
:isShowDialog="showBindCardTips"
@handlerAction="handlerAction"
></CourseDialog>
<Loading v-show="showLoading" /> <Loading v-show="showLoading" />
<div class="pt-70" :class="{'pt-110': showFreeTips}"></div> <div class="pt-70" :class="{'pt-110': showFreeTips}"></div>
</section> </section>
...@@ -79,7 +70,6 @@ export default { ...@@ -79,7 +70,6 @@ export default {
experienceDialog: false, // 体验结束弹框 experienceDialog: false, // 体验结束弹框
showChangeCard: false, //是否展示激活弹框, showChangeCard: false, //是否展示激活弹框,
changeCardErrorMsg: "", changeCardErrorMsg: "",
showBindCardTips: false,
cmeCardModels: { cmeCardModels: {
cardNo: "", cardNo: "",
cardKey: "", cardKey: "",
...@@ -118,7 +108,7 @@ export default { ...@@ -118,7 +108,7 @@ export default {
]), ]),
needFixed() { needFixed() {
return ( return (
this.experienceDialog || this.showChangeCard || this.showBindCardTips this.experienceDialog || this.showChangeCard
); );
}, },
showFreeTips() { showFreeTips() {
...@@ -159,12 +149,6 @@ export default { ...@@ -159,12 +149,6 @@ export default {
_this.getUserInfo(); _this.getUserInfo();
}; };
window.__getPositionData = function(param) {
console.log(param);
// _this.showLoading = false;
param.setEntry = true;
_this.getProvinceIdByPosition(param);
};
}, },
methods: { methods: {
...mapActions(["setUserInfo", "handlerQuestionList"]), ...mapActions(["setUserInfo", "handlerQuestionList"]),
...@@ -181,7 +165,6 @@ export default { ...@@ -181,7 +165,6 @@ export default {
commitKind: this.commitKind // 答题来源 1:错题集 2:收藏 3:题库 commitKind: this.commitKind // 答题来源 1:错题集 2:收藏 3:题库
}); });
this.getPractiseTitles(true); this.getPractiseTitles(true);
// this.preJumper();
}, },
// 开始翻页 // 开始翻页
...@@ -314,27 +297,12 @@ export default { ...@@ -314,27 +297,12 @@ export default {
}, },
// 激活前 // 激活前
beforeChangeCardAction(cardKey, isInTips) { beforeChangeCardAction(cardKey) {
this.checkTokenForNative(() => { this.checkTokenForNative(() => {
this.changeCardAction(cardKey, isInTips); this.changeCardAction(cardKey);
}); });
}, },
// 处理提示信息框
handlerAction(type) {
if (type == 1) {
// this.$sendBuriedData({
// component_tag: `882#88219`
// });
this.showBindCardTips = false;
} else {
// this.$sendBuriedData({
// component_tag: `882#88218`
// });
this.beforeChangeCardAction(this.cmeCardModels.cardKey, true);
}
},
// 分页获取题目(前、后翻页) // 分页获取题目(前、后翻页)
getPractiseTitles(isFirst) { getPractiseTitles(isFirst) {
if(isFirst) { if(isFirst) {
...@@ -388,7 +356,7 @@ export default { ...@@ -388,7 +356,7 @@ export default {
}, },
// 激活Action 返回值:0绑定失败,1绑定成功 // 激活Action 返回值:0绑定失败,1绑定成功
changeCardAction(cardKey, isInTips) { changeCardAction(cardKey) {
let _this = this; let _this = this;
let param = { let param = {
idType: 2, idType: 2,
...@@ -402,91 +370,24 @@ export default { ...@@ -402,91 +370,24 @@ export default {
_this.changeCardErrorMsg = ""; _this.changeCardErrorMsg = "";
this.POST("cme/projectCard/bind", param) this.POST("cme/projectCard/bind", param)
.then(res => { .then(res => {
isInTips && (_this.showBindCardTips = false);
console.log("in res", res, isInTips);
if (res.code == "000000") { if (res.code == "000000") {
if (!res.data) { if (!res.data) {
if (isInTips) { _this.changeCardErrorMsg = "请输入正确的激活码";
Toast(res.message);
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
} else { } else {
_this.showChangeCard = false; _this.showChangeCard = false;
Toast("激活成功,开始练习"); Toast("激活成功,开始练习");
// 重新获取题库内容(从头开始) // 重新获取题库内容(从头开始)
// _this.getProjectInfoById(); _this.init();
} }
} else { } else {
Toast(res.message); Toast(res.message);
} }
}) })
.catch(e => { .catch(e => {
console.log("in catch", isInTips); _this.changeCardErrorMsg = "请输入正确的激活码";
if (isInTips) {
Toast("无效的激活码");
_this.showBindCardTips = false;
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
}); });
}, },
// 根据位置信息获取省ID
getProvinceIdByPosition(param) {
param.setEntry = true;
this.POST("aggregate/cme/convertLocationToProvinceId", param).then(
res => {
if (res.code == "000000") {
this.getCardInfoByProvinceId(res.data);
}
}
);
},
// 跳转前判断是否有机构,否则使用定位信息
preJumper() {
// TODO 测试代码
if (window.__isWeb) {
this.getCardInfoByProvinceId(310);
} else {
if (this.organizationId != 0 && this.provinceId != 0) {
this.getCardInfoByProvinceId(this.provinceId);
} else {
this.getPositionData();
}
}
},
// 根据省ID,获取学习卡信息
getCardInfoByProvinceId(provinceId) {
let param = {
area: provinceId + "",
cardType: this.cardType || 3,
cardTypeList: [this.cardType || 3],
goodsType: this.goodsType
};
param.setEntry = true;
this.POST("trade/goods/cardList_v2", param).then(res => {
if (res.code == "000000") {
this.showLoading = false;
this.cardInfo = (res.data && res.data[0]) || {
id: 0,
name: "题库卡"
};
this.subContent = `您已购买${this.cardInfo.goodsName}”,是否用此卡绑定并激活当前题库。题库卡激活码一旦使用,不可更改不可退回`;
}
});
},
// 获取地理位置信息
getPositionData() {
console.log("getPositionData");
rocNative.getPositionData({
__funcName: "__getPositionData"
});
},
// 滚动到最上面 // 滚动到最上面
scrollTop() { scrollTop() {
console.log("in scrollTop"); console.log("in scrollTop");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册