提交 438dd4c3 编写于 作者: guangjun.yang's avatar guangjun.yang

1、开发激活/购买流程(内部逻辑)

2、部分弹框UI及交互
3、对接部分修改的接口
上级 5c12572a
<template>
<section class="experience-dialog-wrapper">
<van-overlay :show="experienceDialog" class="v-overlay-q">
<van-overlay :show="showDialog" class="v-overlay-q">
<section class="loading-wrapper" >
<article class="content">
<img class="img-tips" src="../../images/question/note.png" alt="">
......@@ -12,7 +12,7 @@
<span class="primary" @click="buyCard">去购买</span>
</div>
</article>
<img class="bt-close" src="../../images/question/close.png" alt="">
<img class="bt-close" @click="close" src="../../images/question/dialog-close.png" alt="">
</section>
</van-overlay>
</section>
......@@ -20,7 +20,7 @@
<script>
export default {
props: {
experienceDialog: {
showDialog: {
type: Boolean,
default: true,
},
......@@ -44,6 +44,9 @@ export default {
},
buyCard() {
this.$emit('buyCard');
},
close() {
this.$emit('close');
}
},
}
......
......@@ -215,8 +215,8 @@ module.exports = {
e.target.src = 'https://file.yunqueyi.com/File/doctor_default.png';
},
// 通用token校验
commonCheckToken(noLoggedCallback) {
// 校验token,有效则调用回调函数,否则调起原生登陆页面
commonCheckToken(cb) {
let param = {
token: this.token,
setEntry: true
......@@ -225,28 +225,24 @@ module.exports = {
if (res.code !== "000000") {
this.goLogin();
} else {
noLoggedCallback && noLoggedCallback()
cb && cb()
}
});
},
// 通用token校验
commonNativeCheckToken(noLoggedCallback) {
// 校验token,有效则调用回调函数,否则使用调起原生登陆页面
checkTokenForNative(cb) {
let param = {
token: this.token,
setEntry: true
};
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
this.goLogin();
rocNative.gotoLogin();
} else {
noLoggedCallback && noLoggedCallback()
cb && cb()
}
});
},
// rocNative.gotoLogin();
}
}
......@@ -428,9 +428,9 @@ export default {
}
return getWebPageUrl(path);
},
// 绑定项目和订单的关系
// 绑定项目和订单的关系(idType=1)
createRelation(projectId, orderId) {
this.POST(`cme/projectCard/correlation/${projectId}/${orderId}`, {channel: 3}).then(res => {
this.POST(`cme/projectCard/correlation/1/${projectId}/${orderId}`, {channel: 3}).then(res => {
if (res.code == "000000") {
//
} else {
......
......@@ -394,7 +394,7 @@ export default {
let param = {
setEntry: true
};
this.GET(`cme/projectCard/queryNoUsedCard/3`, param).then(({ data }) => {
this.GET(`cme/projectCard/queryNoUsedCard/${this.project.goodsType}/${this.project.cardType}`, param).then(({ data }) => {
this.hasNoUsedCard = data.hasNoUsedCard;
if (data.hasNoUsedCard == 1) {
this.cmeCardModels = data.cmeCardModels[0] || {};
......@@ -407,8 +407,11 @@ export default {
changeCardAction(cardKey, isInTips) {
let _this = this;
let param = {
idType: 1,
cardKey: cardKey,
cardType: 3,
cardType: this.project.cardType || 3,
goodsType: this.project.goodsType || 3,
channel: 1,
portalProjectId: this.projectId,
setEntry: true
};
......@@ -553,12 +556,14 @@ export default {
getCardInfoByProvinceId(provinceId) {
let param = {
area: provinceId + "",
cardType: 3,
pageNum: 1,
pageSize: 1
cardType: this.project.cardType || 3,
cardTypeList: [ this.project.cardType || 3],
goodsType: this.project.goodsType,
// pageNum: 1,
// pageSize: 1
};
param.setEntry = true;
this.POST("trade/goods/cardList", param).then(res => {
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: "职称考精讲课程卡" };
......
......@@ -114,7 +114,7 @@ export default {
orderId: this.orderId,
setEntry: true
};
this.GET(`cme/projectCard/status/${this.projectId}/${this.orderId}`, param).then(({ data }) => {
this.GET(`cme/projectCard/status/1/${this.projectId}/${this.orderId}`, param).then(({ data }) => {
this.loading = false;
this.bindStatus = data;
// 绑定成功
......
......@@ -6,7 +6,7 @@
<no-content v-show="!questionList.length" :type="listType"></no-content>
</article>
<question-footer></question-footer>
<ExperienceDialog :experienceDialog="experienceDialog" @activeCard="activeCard" @buyCard="buyCard"></ExperienceDialog>
<ExperienceDialog :showDialog="experienceDialog" @activeCard="activeCard" @buyCard="buyCard" @close="experienceDialog = false"></ExperienceDialog>
<!-- 去激活 -->
<ChangeCard
......@@ -26,7 +26,7 @@
></CourseDialog>
<Loading v-show="showLoading" />
<div class="pt-60"></div>
<div class="pt-70"></div>
</section>
</template>
<script>
......@@ -56,6 +56,9 @@ export default {
data() {
return {
// token: "", // mixns里有
questionBankId: "",
cardType: 3,
goodsType: 3,
currentTitle: "试题集",
listType: 1, // 1: 正常做题; 2: 免费体验; 3: 错题集; 4: 收藏夹,
experienceDialog: true, // 体验弹框
......@@ -84,6 +87,9 @@ export default {
},
created() {
let _this = this;
this.questionBankId = this.$route.query.questionBankId || 1;
this.cardType = this.$route.query.cardType || 3;
this.goodsType = this.$route.query.goodsType || 3;
this.listType = this.$route.query.listType || 1;
this.currentTitle = this.$route.query.currentTitle || this.currentTitle;
this.init();
......@@ -93,7 +99,6 @@ export default {
_this.setUserInfo(param);
_this.getQuestionList();
// _this.checkToken();
// _this.getProjectInfoById();
};
if(__isWeb) {
_this.getQuestionList();
......@@ -145,10 +150,9 @@ export default {
return;
}
// 直接传入职称考项目ID(projectId)
let projectId = this.project.projectId;
// 直接传入题库ID(questionBankId)
let pageUrl = getWebPageUrl(
`/profexam/#/index?id=${projectId}&projectName=${this.project.projectName}&profexamProjectId=${projectId}`
`/profexam/#/question-detail?id=${this.questionBankId}&bankName=${this.bankName}&questionBankId=${this.questionBankId}`
);
let paramList = [
{
......@@ -167,7 +171,6 @@ export default {
{
key: "courseUrl",
value: encodeURIComponent(pageUrl),
// value: projectId,
type: 4,
seqNo: 1
}
......@@ -187,7 +190,7 @@ export default {
// 激活前
beforeChangeCardAction(cardKey, isInTips) {
this.commonCheckToken(() => {
this.checkTokenForNative(() => {
this.changeCardAction(cardKey, isInTips);
});
},
......@@ -211,10 +214,12 @@ export default {
changeCardAction(cardKey, isInTips) {
let _this = this;
let param = {
idType: 2,
cardKey: cardKey,
cardType: 3,
channel: 3,
portalProjectId: this.projectId,
cardType: this.cardType || 3,
goodsType: this.goodsType || 3,
channel: 1,
portalProjectId: this.questionBankId,
setEntry: true
};
_this.changeCardErrorMsg = "";
......@@ -231,8 +236,9 @@ export default {
}
} else {
_this.showChangeCard = false;
Toast("激活成功,开始学习");
_this.getProjectInfoById();
Toast("激活成功,开始练习");
// 重新获取题库内容(从头开始)
// _this.getProjectInfoById();
}
} else {
Toast(res.message);
......@@ -254,7 +260,7 @@ export default {
let param = {
setEntry: true
};
this.GET(`cme/projectCard/queryNoUsedCard/3`, param).then(({ data }) => {
this.GET(`cme/projectCard/queryNoUsedCard/${this.goodsType}/${this.cardType}`, param).then(({ data }) => {
this.hasNoUsedCard = data.hasNoUsedCard;
if (data.hasNoUsedCard == 1) {
this.cmeCardModels = data.cmeCardModels[0] || {};
......@@ -267,13 +273,16 @@ export default {
getCardInfoByProvinceId(provinceId) {
let param = {
area: provinceId + "",
cardType: 3,
pageNum: 1,
pageSize: 1
cardType: this.cardType || 3,
cardTypeList: [ this.cardType || 3],
goodsType: this.goodsType,
// pageNum: 1,
// pageSize: 1
};
param.setEntry = true;
this.POST("trade/goods/cardList", param).then(res => {
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}”,是否用此卡绑定并激活当前课程。学习卡激活码一旦使用,不可更改不可退回`
}
......@@ -286,8 +295,8 @@ export default {
<style lang="less" scoped>
.question-detail-wrapper {
padding-top: 68px;
.pt-60 {
padding-bottom: 60px;
.pt-70 {
padding-bottom: 70px;
}
}
</style>
\ No newline at end of file
......@@ -466,7 +466,7 @@ export default {
let param = {
setEntry: true
};
this.GET(`cme/projectCard/queryNoUsedCard/3`, param).then(({ data }) => {
this.GET(`cme/projectCard/queryNoUsedCard/${this.project.goodsType}/${this.project.cardType}`, param).then(({ data }) => {
this.hasNoUsedCard = data.hasNoUsedCard;
if (data.hasNoUsedCard == 1) {
this.cmeCardModels = data.cmeCardModels[0] || {};
......@@ -479,8 +479,10 @@ export default {
changeCardAction(cardKey, isInTips) {
let _this = this;
let param = {
idType: 1,
cardKey: cardKey,
cardType: 3,
cardType: this.project.cardType || 3,
goodsType: this.project.goodsType || 3,
channel: 3,
portalProjectId: this.projectId,
setEntry: true
......@@ -539,12 +541,14 @@ export default {
getCardInfoByProvinceId(provinceId) {
let param = {
area: provinceId + "",
cardType: 3,
pageNum: 1,
pageSize: 1
cardType: this.project.cardType || 3,
cardTypeList: [ this.project.cardType || 3],
goodsType: this.project.goodsType,
// pageNum: 1,
// pageSize: 1
};
param.setEntry = true;
this.POST("trade/goods/cardList", param).then(res => {
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: "职称考精讲课程卡" };
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册