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

判断用户是否购买过I类学习卡

上级 e6d612d2
此差异已折叠。
...@@ -19,29 +19,11 @@ ...@@ -19,29 +19,11 @@
<div class="coop-item-right"> <div class="coop-item-right">
<span class="coop-item-right-title">{{item.name}}</span> <span class="coop-item-right-title">{{item.name}}</span>
<span class="coop-item-right-other">{{item.level}} | {{item.credit}} | {{item.scope}}</span> <span class="coop-item-right-other">{{item.level}} | {{item.credit}} | {{item.scope}}</span>
<!-- <span v-if="item.pType == 1"
class="coop-item-right-other"
>起止日期 {{item.oldTime}}</span>-->
<!-- <span v-else
class="coop-item-right-other"
>起止日期 {{item.projectBegintimeLong | formatTime}}-{{item.projectEndtimeLong | formatTime}}</span>-->
<span class="coop-item-right-other">{{item.startDate | formatTime('{y}.{m}.{d}')}}{{item.endDate | formatTime('{y}.{m}.{d}')}}</span> <span class="coop-item-right-other">{{item.startDate | formatTime('{y}.{m}.{d}')}}{{item.endDate | formatTime('{y}.{m}.{d}')}}</span>
</div> </div>
</div> </div>
<NoMoreContent v-show="paramData.length > 9"></NoMoreContent> <NoMoreContent v-show="paramData.length > 9"></NoMoreContent>
<NoContent v-show="!paramData.length && isShow" :tabNum="tabTo"></NoContent> <NoContent v-show="!paramData.length && isShow" :tabNum="tabTo"></NoContent>
<!--<UpdateDialog :showGoUpdate="showGoUpdate" @goUpdateHandler="goUpdateHandler"></UpdateDialog>-->
<!-- <van-popup
v-model="showGoUpdate"
position="bottom"
:style="{ height: '4.427rem' }"
>
<div class="update-dialog-content">
<p class="title">该项目仅对河北石家庄市的用户开放</p>
<p class="update-btn v-hairline-top confirm-btn" @click="goUpdateHandler">确定</p>
<p class="update-btn v-hairline-top" @click="showGoUpdate = false">取消</p>
</div>
</van-popup>-->
</section> </section>
</template> </template>
...@@ -83,12 +65,18 @@ export default { ...@@ -83,12 +65,18 @@ export default {
userMobile: { userMobile: {
type: String, type: String,
default: "" default: ""
} },
provinceId: {
type: String | Number,
default: 0
},
organizationId: {
type: String | Number,
default: 0
},
}, },
computed: { computed: {
...mapGetters(["userInfo"]) ...mapGetters(["userInfo"])
// cBgColor() {
// }
}, },
components: { components: {
NoMoreContent, NoMoreContent,
...@@ -138,7 +126,9 @@ export default { ...@@ -138,7 +126,9 @@ export default {
query: { query: {
id: item.id, id: item.id,
coopType: this.coopType, coopType: this.coopType,
courseRequire: item.courseRequire courseRequire: item.courseRequire,
projectId: this.provinceId,
organizationId: this.organizationId
} }
}); });
return; return;
...@@ -148,7 +138,7 @@ export default { ...@@ -148,7 +138,7 @@ export default {
let paramList = [ let paramList = [
{ {
key: "pageUrl", key: "pageUrl",
value: getWebPageUrl(`cme/#/coop?id=${item.id}&courseRequire=${item.courseRequire}`), value: getWebPageUrl(`cme/#/coop?id=${item.id}&courseRequire=${item.courseRequire}&projectId=${this.projectId}&organizationId=${this.organizationId}`),
type: 4, type: 4,
seqNo: 1 seqNo: 1
} }
...@@ -164,100 +154,9 @@ export default { ...@@ -164,100 +154,9 @@ export default {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `210#210002#${item.id}#${item.name}` //'210#210002#0#'+item.projectName component_tag: `210#210002#${item.id}#${item.name}` //'210#210002#0#'+item.projectName
}); });
// if (item.courseRequire == 1) { //对课程完成度有控制,需判断版本号
// let appVersion = getAppVersion(this.userInfo.appVersion);
// // alert('版本'+appVersion)
// let flag = appVersion < 315;
// if (flag === true) {
// // 小于315版本,添加去更新弹层
// this.showGoUpdate = true;
// }else {
// // 跳转到老项目
// if(this.tabTo != 3) {
// this.setProjectTabIndex(this.tabTo)
// }
// if (item.pType == 1) {
// this.goToPage(item);
// // 跳转到新项目
// } else {
// this.showModule(item, this.coopType, this.tabTo, item.courseRequire)
// }
// }
// } else {
// // 跳转到老项目
// if(this.tabTo != 3) {
// this.setProjectTabIndex(this.tabTo)
// }
// if (item.pType == 1) {
// this.goToPage(item);
// // 跳转到新项目
// } else {
// this.showModule(item, this.coopType, this.tabTo, item.courseRequire)
// // this.$router.push({
// // path: "/coop",
// // query: {
// // id: item.id,
// // coopType: this.coopType
// // }
// // });
// }
// }
}, },
// 跳转到新项目
// showModule(item, coopType, tabTo, courseRequire) {
// if (window.__isWeb) {
// if(item.parent === false) {
// this.$router.push({
// path: "/coop",
// query: {
// id: item.id,
// coopType: coopType,
// tabTo: tabTo,
// courseRequire: courseRequire,
// }
// });
// } else {
// this.$router.push({
// path: "/parent",
// query: {
// entryId: item.entryId,
// }
// });
// }
// return;
// }
// let pageUrl = "";
// let paramList = [];
// if(item.parent === false) {
// pageUrl = getWebPageUrl('cme/#/coop');
// paramList = [
// {
// key: "pageUrl",
// value: pageUrl + `?id=${item.id}&coopType=${coopType}&tabTo=${tabTo}&courseRequire=${courseRequire}`,
// type: 4,
// seqNo: 1
// }
// ]
// } else {
// pageUrl = getWebPageUrl('cme/#/parent');
// paramList = [
// {
// key: "pageUrl",
// value: pageUrl + `?entryId=${item.entryId}`,
// type: 4,
// seqNo: 1
// }
// ]
// }
// rocNative.dispatchEventByModuleCode({
// modeCode: "M300",
// jsonString: paramList
// });
// },
goToPage(item) { goToPage(item) {
let _this = this; let _this = this;
// 如果是湖北考试项目,则做相应权限判断 湖北的projectId=3 // 如果是湖北考试项目,则做相应权限判断 湖北的projectId=3
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div class="info"> <div class="info">
<span class="name">{{cardInfo.goodsName}}</span> <span class="name">{{cardInfo.goodsName}}</span>
<p> <p>
<span class="price">{{cardInfo.preferentialPrice}}</span><span class="discount"><del> 原价¥{{cardInfo.costPrice}}</del></span> <span class="price">{{cardInfo.preferentialPrice}}</span><span v-show="cardInfo.costPrice" class="discount"><del> 原价¥{{cardInfo.costPrice}}</del></span>
</p> </p>
</div> </div>
</section> </section>
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
<script> <script>
import CommonNavbar from "@/components/common/common-navbar"; import CommonNavbar from "@/components/common/common-navbar";
import CardPopup from "@/components/cme/card-popup"; import CardPopup from "@/components/cme/card-popup";
import { mapGetters } from 'vuex';
export default { export default {
data() { data() {
return { return {
...@@ -42,20 +41,18 @@ export default { ...@@ -42,20 +41,18 @@ export default {
CommonNavbar, CommonNavbar,
CardPopup CardPopup
}, },
computed: {
...mapGetters(['jumpURLForI', 'organizationInfo'])
},
created() { created() {
// TEST
let _this = this; let _this = this;
window.__getPositionData = function(param) { window.__getPositionData = function(param) {
console.log(param); console.log(param);
param.setEntry = true;
_this.getProvinceIdByPosition(param); _this.getProvinceIdByPosition(param);
} }
this.oneLevelUrl = decodeURIComponent(this.$route.query && this.$route.query.oneLevelUrl || ''); this.oneLevelUrl = decodeURIComponent(this.$route.query && this.$route.query.oneLevelUrl || '');
this.provinceId = this.$route.query && this.$route.query.provinceId || 0; this.provinceId = this.$route.query && this.$route.query.provinceId || 0;
this.organizationId = this.$route.query && this.$route.query.organizationId || 0; this.organizationId = this.$route.query && this.$route.query.organizationId || 0;
console.log(this.oneLevelUrl, this.provinceId, this.organizationId);
// this.getProvinceIdByPosition();
}, },
methods: { methods: {
// 判断用户是否购买过I类学习卡 // 判断用户是否购买过I类学习卡
...@@ -76,12 +73,10 @@ export default { ...@@ -76,12 +73,10 @@ export default {
}); });
}, },
// 跳转前判断是否有机构,否则使用定位信息
preJumper() { preJumper() {
// 如果有机构,则直接获取学习卡信息
console.log('in jumper this.organizationInfo', this.organizationInfo, '');
if(this.organizationId != 0 && this.provinceId != 0) { if(this.organizationId != 0 && this.provinceId != 0) {
this.getCardInfoByProvinceId(this.provinceId); this.getCardInfoByProvinceId(this.provinceId);
// 否则获取地理位置信息
} else { } else {
this.getPositionData(); this.getPositionData();
} }
...@@ -106,7 +101,6 @@ export default { ...@@ -106,7 +101,6 @@ export default {
this.POST("trade/goods/cardList", param).then(res => { this.POST("trade/goods/cardList", param).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.showGoUpdate = true; this.showGoUpdate = true;
console.log('getCardInfoByProvinceId', res);
this.cardInfo = res.data && res.data[0] || {} ; this.cardInfo = res.data && res.data[0] || {} ;
} }
}); });
...@@ -114,9 +108,9 @@ export default { ...@@ -114,9 +108,9 @@ export default {
// 根据位置信息获取省ID // 根据位置信息获取省ID
getProvinceIdByPosition(param) { getProvinceIdByPosition(param) {
this.GET("aggregate/cme/convertLocationToProvinceId", param).then(res => { param.setEntry = true;
this.POST("aggregate/cme/convertLocationToProvinceId", param).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
console.log('getProvinceIdByPosition', res);
this.getCardInfoByProvinceId(res.data); this.getCardInfoByProvinceId(res.data);
} }
}); });
...@@ -124,7 +118,6 @@ export default { ...@@ -124,7 +118,6 @@ export default {
// 跳转到原生的购买页面 // 跳转到原生的购买页面
confirm(goodId) { confirm(goodId) {
console.log(goodId);
let paramList = [ let paramList = [
{ {
key: "className", key: "className",
...@@ -147,9 +140,7 @@ export default { ...@@ -147,9 +140,7 @@ export default {
// 跳转I类学习详情页面(中华医学会项目列表页面) // 跳转I类学习详情页面(中华医学会项目列表页面)
jumpToCardList() { jumpToCardList() {
console.log(this.oneLevelUrl);
if (window.__isWeb) { if (window.__isWeb) {
console.log('in jumpToCardList');
return; return;
} else { } else {
let pageUrl = this.oneLevelUrl; let pageUrl = this.oneLevelUrl;
...@@ -159,6 +150,13 @@ export default { ...@@ -159,6 +150,13 @@ export default {
value: pageUrl, value: pageUrl,
type: 4, type: 4,
seqNo: 1 seqNo: 1
},
// 此字段不配置,则用原来的逻辑
{
key: "needCache",
value: '1', // 0不缓存,其它值都做缓存
type: 4,
seqNo: 1
} }
] ]
rocNative.dispatchEventByModuleCode({ rocNative.dispatchEventByModuleCode({
......
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
:tabTo="1" :tabTo="1"
:isShow="isShow" :isShow="isShow"
:userMobile="userMobile" :userMobile="userMobile"
:provinceId="provinceId"
:organizationId="organizationId"
></CoopListItem> ></CoopListItem>
</section> </section>
<section v-if="tabIndex === 2"> <section v-if="tabIndex === 2">
...@@ -49,6 +51,8 @@ ...@@ -49,6 +51,8 @@
:tabTo="2" :tabTo="2"
:isShow="isShow" :isShow="isShow"
:userMobile="userMobile" :userMobile="userMobile"
:provinceId="provinceId"
:organizationId="organizationId"
></CoopListItem> ></CoopListItem>
</section> </section>
</article> </article>
...@@ -100,6 +104,8 @@ export default { ...@@ -100,6 +104,8 @@ export default {
needShowBackup: false, needShowBackup: false,
showGoUpdate: false, showGoUpdate: false,
oneLevelUrl: '', oneLevelUrl: '',
provinceId: 0,
organizationId: 0,
}; };
}, },
computed: { computed: {
......
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
:btnText="project.currentProgress > 1 ? '参加考试' : '学完全部课程,可参加考试'" :btnText="project.currentProgress > 1 ? '参加考试' : '学完全部课程,可参加考试'"
:type="project.currentProgress > 1 ? 'primary' : 'disabled'"></ExjumperButton> :type="project.currentProgress > 1 ? 'primary' : 'disabled'"></ExjumperButton>
<div v-if="project.cmeType == 2" style="padding-top: 30px"></div> <div v-if="project.cmeType == 2" style="padding-top: 30px"></div>
<CardPopup :cardInfo="cardInfo" :isShow="showGoUpdate" @cancle="jumpToCardList()" @confirm="confirm"></CardPopup>
</div> </div>
</template> </template>
<script> <script>
...@@ -144,6 +145,7 @@ import { getWebPageUrl, gotoPage } from "@/utils/index"; ...@@ -144,6 +145,7 @@ import { getWebPageUrl, gotoPage } from "@/utils/index";
import { mapGetters, mapActions } from "vuex"; import { mapGetters, mapActions } from "vuex";
import vueFilters from "@/utils/filter"; import vueFilters from "@/utils/filter";
import { Toast } from 'vant'; import { Toast } from 'vant';
import CardPopup from "@/components/cme/card-popup";
let cataOffsetTop = 0; let cataOffsetTop = 0;
let intorOffsetTop = 0; let intorOffsetTop = 0;
...@@ -231,8 +233,14 @@ export default { ...@@ -231,8 +233,14 @@ export default {
courseRequire: 0, courseRequire: 0,
clientType: 0, clientType: 0,
// currentProgress>1时考试按钮显示并可用 // currentProgress>1时考试按钮显示并可用
btnType: 'primary', // primary: 可跳转时(currentProgress = 1); disabled: 不可跳转时 btnType: 'primary', // primary: 可跳转时(currentProgress = 1); disabled: 不可跳转时
btnText: '学完全部课程,可参加考试' // 参加考试(currentProgress = 1); 或者学完全部课程,可参加考试 btnText: '学完全部课程,可参加考试', // 参加考试(currentProgress = 1); 或者学完全部课程,可参加考试
provinceId: '',
organizationId: '',
showGoUpdate: false,
cardInfo: {
},
}; };
}, },
components: { components: {
...@@ -250,7 +258,8 @@ export default { ...@@ -250,7 +258,8 @@ export default {
TeacterIntro, TeacterIntro,
CommonDialog, CommonDialog,
ExjumperButton, ExjumperButton,
ExjumperDialog ExjumperDialog,
CardPopup
}, },
computed: { computed: {
...@@ -262,6 +271,8 @@ export default { ...@@ -262,6 +271,8 @@ export default {
this.from = this.$route.query.from || this.from || "native"; this.from = this.$route.query.from || this.from || "native";
this.projectId = this.$route.query.id || 1; this.projectId = this.$route.query.id || 1;
this.courseRequire = this.$route.query.courseRequire; this.courseRequire = this.$route.query.courseRequire;
this.provinceId = this.$route.query && this.$route.query.provinceId || 0;
this.organizationId = this.$route.query && this.$route.query.organizationId || 0;
window.__getUserInfo64Comp = function(param) { window.__getUserInfo64Comp = function(param) {
// appVersion 安卓 3.2.2 iOS // appVersion 安卓 3.2.2 iOS
...@@ -288,7 +299,11 @@ export default { ...@@ -288,7 +299,11 @@ export default {
// action: "打开页面", // action: "打开页面",
component_tag: `211#0#${this.projectId}#0` component_tag: `211#0#${this.projectId}#0`
}); });
window.__getPositionData = function(param) {
console.log(param);
param.setEntry = true;
_this.getProvinceIdByPosition(param);
}
}, },
mounted() { mounted() {
window.addEventListener("scroll", this.scrollFun); window.addEventListener("scroll", this.scrollFun);
...@@ -306,17 +321,130 @@ export default { ...@@ -306,17 +321,130 @@ export default {
if(this.project.firstIntoExam) { if(this.project.firstIntoExam) {
this.isShowEJDialog = true; this.isShowEJDialog = true;
} else { } else {
this.jumpToExamAction(); this.isBuy(2);
// this.jumpToExamAction();
} }
}, },
// 第一次跳转弹框,点击时调用相应接口 // 第一次跳转弹框,点击时调用相应接口
handlerEJAction() { handlerEJAction() {
this.isShowEJDialog = false; this.isShowEJDialog = false;
this.jumpToExamAction(); this.isBuy(2);
// this.jumpToExamAction();
this.firstIntoExamAction(); this.firstIntoExamAction();
}, },
// 判断用户是否购买过I类学习卡
isBuy(cardType) {
let param = {
cardType: cardType,
setEntry: true,
}
this.GET("trade/storage/card/isBuy", param).then(res => {
if (res.code == "000000") {
// 如果购买过,则直接跳转到中华医学会页面
if(res.data) {
this.jumpToCardList();
} else {
this.preJumper();
}
}
});
},
// 跳转II类学习详情页面(中华医学会项目详情页面)
jumpToCardList() {
if (window.__isWeb) {
return;
} else {
let pageUrl = this.project.examBtnUrl;
let paramList = [
{
key: "pageUrl",
value: pageUrl,
type: 4,
seqNo: 1
},
// 此字段不配置,则用原来的逻辑
{
key: "needCache",
value: '1', // 0不缓存,其它值都做缓存
type: 4,
seqNo: 1
}
]
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
});
}
},
// 跳转前判断是否有机构,否则使用定位信息
preJumper() {
if(this.organizationId != 0 && this.provinceId != 0) {
this.getCardInfoByProvinceId(this.provinceId);
} else {
this.getPositionData();
}
},
// 根据位置信息获取省ID
getProvinceIdByPosition(param) {
param.setEntry = true;
this.POST("aggregate/cme/convertLocationToProvinceId", param).then(res => {
if (res.code == "000000") {
this.getCardInfoByProvinceId(res.data);
}
});
},
// 根据省ID,获取学习卡信息
getCardInfoByProvinceId(provinceId) {
let param = {
"area": provinceId + '',
"cardType": 1,
"pageNum": 1,
"pageSize": 1
}
this.POST("trade/goods/cardList", param).then(res => {
if (res.code == "000000") {
this.showGoUpdate = true;
this.cardInfo = res.data && res.data[0] || {} ;
}
});
},
// 获取地理位置信息
getPositionData() {
console.log('getPositionData');
rocNative.getPositionData({
__funcName: "__getPositionData"
});
},
// 跳转到原生的购买页面
confirm(goodId) {
let paramList = [
{
key: "className",
value: "com.picahealth.yunque.activitys.studycard.StudyCardDetailActivity###PicaDo.LearningCardVC",
type: 4,
seqNo: 1
},
{
key: "goodId",
value: goodId,
type: 4,
seqNo: 1
},
];
rocNative.dispatchEventByModuleCode({
modeCode: "M200",
jsonString: paramList
});
},
// 跳转到第三方考试页面 // 跳转到第三方考试页面
jumpToExamAction() { jumpToExamAction() {
// 判断版本号,如果小于3.4.0,则只做提示 // 判断版本号,如果小于3.4.0,则只做提示
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册