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

Merge branch 'dev-purchase-0901' into 'release'

微信内、外购买学习卡功能: code reviewer:张平

微信内、外购买学习卡功能: code reviewer:张平

See merge request !3
<template>
<div
:class="{ 'button-dis': isDisabled, 'button-plain': isPlain }"
class="button-container"
@click="submit"
>
{{ buttonText }}
</div>
</template>
<script>
export default {
name: 'ButtonComponent',
props: {
isPlain: {
type: Boolean,
default: false
},
isDisabled: {
type: Boolean,
default: false
},
buttonText: {
type: String,
default: "继续学习"
},
},
methods: {
submit() {
if (this.isDisabled) {
return;
}
this.$emit('handlerClick'); //点击按钮的操作,触发父组件相应的方法
}
}
};
</script>
<style scoped lang="less">
.button-container {
/*按钮本身样式没有设置margin,可根据具体页面的ui在父页面中进行设置*/
// width: 325px;
width: 90%;
height: 44px;
background: #449284;
border-radius: 22px;
color: #fff;
font-size: 16px;
font-weight: 700;
line-height: 44px;
text-align: center;
margin: 16px auto;
}
.button-dis {
opacity: 0.5;
}
.button-plain {
color: #449284;
background: #fff;
border: 1px solid rgba(68,146,132, 0.4);
}
</style>
<template>
<!-- 项目组件列表项 -->
<section>
<div
class="cell-detail"
v-for="(component , index) in projectComponent"
:key="index">
<van-collapse v-model="activeNames" @change="changeCollapse">
<van-collapse-item
v-for="(portalModule, index) in component.portalModuleDTOS"
:key="index"
:title="(parseInt(index) + 1) + '.' + portalModule.moduleName | shortName(19)"
:name="portalModule.expandKey"
:value="portalModule.value"
:disabled="portalModule.disabled"
@click.native="chooseItem(portalModule)"
>
<!-- @click.native="chooseItem(item)" -->
<article @click.stop="deleteFlow()" class="cell-container">
<span class="" v-for="(item, index) in portalModule.contentList" :key="index">
<div v-if="index > 0 && portalModule.contentList[index].templetId!= portalModule.contentList[index-1].templetId" class="bottom-line"></div>
<div class="cell-container-item" >
<div class="name">
<div class="name-img">
<img v-if="item.type == 1 && item.useFlag == 1" class="img-icon" src="../../images/exam.png">
<img v-if="item.type == 1 && item.useFlag == 2" class="img-icon" src="../../images/exam-dark.png">
<img v-if="item.type == 2 && item.useFlag == 1" class="img-icon" src="../../images/learn.png">
<img v-if="item.type == 2 && item.useFlag == 2" class="img-icon" src="../../images/learn-dark.png">
</div>
<p class="name-title" :class="{'name-title-no': item.useFlag == 2}">{{item.name | shortName(30)}}</p>
</div>
<span
v-if="!logged"
@click="gotoExamOrCourse(item)"
class="text-action text-action-no"
>
<!-- :class="{'text-action-no': item.useFlag == 2}" -->
{{getActionText(item.status, item.type)}}
</span>
<span
v-else-if="!hasBindCard && item.type == 2 && cmeType == 2"
@click="gotoExamOrCourse(item)"
class="text-action"
style="background: #f28662;border: none;color: #fff;"
>
<!-- :class="{'text-action-no': item.useFlag == 2}" -->
去试看
</span>
<span
v-else
@click="gotoExamOrCourse(item)"
class="text-action"
:class="{'text-action-no': item.useFlag == 2}"
>
{{getActionText(item.status, item.type)}}
</span>
<!-- <img @click="toastToBuy" class="key" v-show="!hasBindCard" src="../../images/cme/phrase2/key.png" alt=""> -->
<div class="foot-line"
v-if="index+1 < portalModule.contentList.length && portalModule.contentList[index].templetId == portalModule.contentList[index+1].templetId">
</div>
</div>
<span v-if="item.certificateFlag == 2">
<img class="cert-img" :class="{'space2': item.height == 2 }" src="../../images/has-cert-new.png">
</span>
</span>
</article>
</van-collapse-item>
</van-collapse>
</div>
<van-dialog
v-model="dialogState"
title="标题"
>
</van-dialog>
</section>
</template>
<script>
import MergeTitle from "@/components/business/merge-title";
import NoMoreContent from "@/components/business/no-more-content";
import CertShow from "@/components/business/cert-show";
import { Collapse, CollapseItem, Dialog, Toast } from 'vant';
import { mapGetters } from "vuex";
import { getAppVersion, getWebPageUrl } from "@/utils";
import vueFilters from '@/utils/filter';
const actionMap = {
11: "去考试",
12: "再考一次",
13: "已通过",
14: "已完成",
15: "已通过",
16: "未通过",
21: "去学习",
22: "继续学习",
23: "去复习"
};
const sendBuriedDataMap = {
// 11: "8824",
// 12: "211013",
21: "8821",
22: "8822",
23: "8823"
}
export default {
name: "cell-list-item",
data() {
return {
appVersion: "200",
hocImg: require("../../images/has-owner-cert.png"),
activeNames: [1],
dialogState: false,
projectId: 1
};
},
props: {
hasBindCard: {
type: Boolean,
default: false
},
projectComponent: {
type: Array,
default: () => []
},
actionList: {
type: Array,
default: () => []
},
detailNum: {
type: Number | String,
default: 0
},
courseRequire: {
type: Number | String,
default: 0,
},
limitTimes: {
type: Number | String,
default: 0,
},
cmeType: {
type: Number | String,
default: 0,
},
logged: {
type: Boolean,
default: false
}
},
computed: {
...mapGetters(["userInfo"])
},
components: {
MergeTitle,
CertShow,
NoMoreContent,
Dialog,
},
watch:{
actionList: {
immediate: true,
handler (val) {
this.activeNames = val;
}
}
},
mounted() {
},
created() {
this.projectId = this.$route.query.id;
},
methods: {
// 跳转到考试或课程 type 1: 考试; 2: 课程
// 如果是考试,将根据appVersion判断是新考试还是老考试,如果是301或之前的,都是老考试
gotoExamOrCourse(item) {
this.$parent.$refs.tcPlayerRef && this.$parent.$refs.tcPlayerRef.pause();
if(!this.logged) {
Toast('登陆后可学习课程');
return;
}
// 埋点:去学习、继续学习、复习、去考试、重考
// let actionCode = sendBuriedDataMap[item.status];
// if(actionCode) {
// this.$sendBuriedData({
// component_tag: `882#${actionCode}#${this.projectId}`
// });
// }
if (item.useFlag == 2) {
if(item.type == 1) {
Toast('尚未完成所有课程学习');
} else if(item.type == 2){
Toast('尚未完成相关考试');
}
return;
};
if (item.type == 1) {
this.gotoExam(item.id);
} else if (item.type == 2) {
this.gotoCourse(item.id);
}
},
// 跳转到课程
gotoCourse: function(courseId) {
let token = localStorage.getItem('token');
let jumpUrl = getWebPageUrl(`profexam/#/course-detail?courseId=${courseId}&projectId=${this.projectId}&token=${token}`);
window.location.href = jumpUrl;
},
// 跳转到考试
gotoExam: function(examId) {
Toast('请前往云鹊医APP参加考试');
},
getActionText(status, type) {
let actionText = actionMap[status];
if(!actionText) {
actionText = type == 1 ? '去考试' : '去学习';
}
if(!this.hasBindCard && type == 2) {
actionText = '去试看'
}
return actionText;
},
changeCollapse(activeNames) {
console.log('activeNames',activeNames);
let param = {
expandKeys: activeNames,
setEntry: true,
token: this.userInfo.userToken,
}
this.POST("portal/portalApp/updateExpandStatus?projectId="+this.projectId, param).then(res => {
});
},
deleteFlow() {
},
chooseItem(item) {
let _this = this;
if(item.disabled === true) {
console.log('item',item);
Toast('尚未开始,敬请期待');
}
},
// 弹框提示
toastToBuy() {
Toast('购买后可学习课程');
}
}
};
</script>
<style lang="less">
.van-dialog {
transform: translate(-50%,-50%);
width: 300px;
border-radius: 3px;
.van-dialog__header {
padding-top: 30px;
font-size: 18px;
color: #333333;
}
.van-dialog__content {
.van-dialog__message--has-title {
padding-top: 14px;
text-align: left;
color: #676869;
font-weight:400;
}
}
.van-dialog__footer {
.van-button {
.van-button__text {
color: #449284;
font-size: 17px;
}
}
}
}
.van-toast {
// background: #000000;
div {
font-size:12px;
color: #FFFFFF;
}
}
.van-toast--text {
padding: 7px 8px;
}
.no-more-bottom {
position: relative;
width: 100%;
height: 40px;
}
.cell-detail {
.van-hairline--top::after , .van-hairline--top-bottom::after {
border-width: 0px;
}
.van-collapse-item {
.van-cell {
margin: 9px auto 0 auto;
// width: 345px;
width: 100%;
min-height: 48px;
border-radius: 6px;
}
.van-collapse-item__title {
background: #F8F9FA;
.van-cell__title {
max-width: 200px;
vertical-align: middle;
line-height: 30px;
flex: auto;
span {
color: #373839;
font-weight:500;
font-size: 15px;
height: 15px;
line-height: 15px;
}
}
.van-cell__value {
// max-width: 80px;
line-height: 30px;
span {
color: #979899;
font-weight:500;
font-size: 14px;
line-height: 14px;
}
}
.van-icon {
margin-top: 3px;
color: #999999;
}
}
.van-collapse-item__title--expanded {
background: #E3EFED;
.van-cell__title {
span {
color: #449284;
font-weight:500;
font-size: 15px;
line-height: 15px;
}
}
.van-cell__value {
span {
color: #449284;
font-weight:500;
font-size: 14px;
line-height: 14px;
}
}
.van-icon {
color: #449284;
}
}
.van-collapse-item__title--disabled {
.van-cell__right-icon {
display: none;
}
.van-cell__title , .van-cell__value{
span {
color: #979899;
}
}
}
.van-collapse-item__content {
padding: 0;
}
}
.line-component {
position: relative;
margin-top: 20px;
margin-left: 0;
width: 373px;
height: 6px;
background: #F8F9FA;
}
}
.cell-container {
display: flex;
flex-direction: column;
margin: 20px 0px -28px 0px;
&-item {
position: relative;
display: flex;
flex-direction: row;
margin-bottom: 39px;
line-height: 51px;
font-size: 15px;
justify-content: space-between;
align-items: center;
.name {
display: flex;
align-items: center;
flex: 1;
width: 100px;
.name-img {
position: relative;
z-index: 9;
margin-right: 6px;
width: 20px;
height: 20px;
float: left;
.img-icon {
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
}
}
&-logo {
position: relative;
z-index: 9;
margin-right: 6px;
width: 20px;
height: 20px;
text-align: center;
background:rgba(68,146,132,1);
font-size: 12px;
font-weight: 700;
color: #FFFFFF;
border-radius: 50%;
float: left;
line-height: 22px;
// display:table;
// overflow:hidden;
// span {
// color: #FFFFFF;
// font-size: 12px;
// font-weight: 700;
// display: table-cell;
// text-align: center;
// vertical-align: middle;
// line-height: 20px;
// }
// &::before {
// position: absolute;
// top: -6px;
// left: 8px;
// display: inline-block;
// height: 6px;
// width: 4px;
// background: #FFFFFF;
// content: "";
// }
// &::after {
// position: absolute;
// top: 20px;
// left: 8px;
// display: inline-block;
// height: 6px;
// width: 4px;
// background: #FFFFFF;
// content: "";
// }
}
&-learn {
background:rgba(246, 131, 103, 1);
}
&-logo-no {
background:rgba(231, 232, 233, 1);
}
&-title {
flex: 1;
// font-family: "PingFangSC-Medium", "PingFangSC", "Microsoft Yahei";
// width: 231px;
font-size: 15px;
font-weight: 700;
line-height: 22px;
color: #333333;
// float: left;
}
&-title-no {
color: #979899;
}
// &::before {
// position: relative;
// top: 3px;
// display: inline-block;
// width: 4px;
// content: "";
// margin-right: 5px;
// height: 16px;
// background: #449284;
// border-radius: 3px;
// }
// span {
// img {
// margin-top: 4px;
// position: relative;
// top: 2px;
// width: 70px;
// height: 20px;
// }
// }
}
.text-action {
width: 68px;
height: 25px;
line-height: 25px;
text-align: center;
font-size: 12px;
font-weight: 700;
border-radius: 15px;
border: 1px solid rgba(68, 146, 132, 0.6);
color: rgba(68, 146, 132, 1);
img {
position: relative;
left: 2px;
top: 3px;
width: 8px;
height: 12px;
}
&-no {
border: 1px solid #c7c8c9;
color: #c7c8c9;
}
}
.key {
width: 15px;
height: 15px;
}
}
span {
.cert-img {
margin-left: 26px;
position: relative;
top: -34px;
width: 70px;
height: 20px;
}
.space2 {
top: -34px;
}
}
.connect-line {
position: absolute;
// top: 32px;
top: 3px;
left: 8.5px;
height: 42px;
width: 3px;
background: #F8F9FA;
// border: 0.5px dashed rgba(240, 241, 244, 1);
}
.line-complete {
background: #E3EFED;
}
.len4 {
// height: 100px;
height: 106px;
}
.len3 {
// height: 82px;
height: 88px;
}
.len2 {
// height: 82px;
height: 88px;
}
.len1 {
// height: 62px;
height: 68px;
}
.bottom-line {
position: relative;
margin: -19px 0 20px 0;
bottom: 0px;
width: 100%;
height: 6px;
background: #F8F9FA;
border-radius: 2px;
// border-bottom: 0.5px solid #F0F1F2;
}
.foot-line {
position: absolute;
width: 311px;
margin-left: 34.5px;
height: 1px;
background: #E7E8E9;
// border-bottom: 0.5px solid #E7E8E9;
transform: scaleY(0.5);
bottom: -20px;
}
}
.bg-13 {
background: #abcec7;
}
</style>
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<van-collapse-item <van-collapse-item
v-for="(portalModule, index) in component.portalModuleDTOS" v-for="(portalModule, index) in component.portalModuleDTOS"
:key="index" :key="index"
:title="(parseInt(index) + 1) + '.' + portalModule.moduleName | shortName(19)" :title="portalModule.moduleName | shortName(19)"
:name="portalModule.expandKey" :name="portalModule.expandKey"
:value="portalModule.value" :value="portalModule.value"
@click.native="chooseItem(portalModule)" @click.native="chooseItem(portalModule)"
...@@ -137,7 +137,11 @@ export default { ...@@ -137,7 +137,11 @@ export default {
projectId: { projectId: {
type: Number | String, type: Number | String,
default: 0 default: 0
} },
goodsId: {
type: Number | String,
default: 0
},
}, },
components: { components: {
MergeTitle, MergeTitle,
...@@ -164,15 +168,28 @@ export default { ...@@ -164,15 +168,28 @@ export default {
if(type == 'sk') { if(type == 'sk') {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `882#88216#${item.id}#${item.name}` component_tag: `882#88216#${item.id}#${item.name}`
}); });
} }
// 在浏览器中
if(!isWeiXin()) { if(!isWeiXin()) {
if(item.type == 1) { // 没有绑定则提示去购买/激活
Toast('请前往云鹊医APP参加考试'); if(!this.hasBindCard) {
} else if(item.type == 2){ if(item.type == 1) {
Toast('请前往云鹊医APP学习课程'); Toast('激活/购买后可参加考试');
} } else if(item.type == 2){
return; Toast('激活/购买后可学习完整课程');
}
return;
// 已经绑定则前往云鹊医APP
} else {
if(item.type == 1) {
Toast('请前往云鹊医APP参加考试');
} else if(item.type == 2){
Toast('请前往云鹊医APP学习课程');
}
return;
}
} }
if(!this.logged) { if(!this.logged) {
...@@ -237,7 +254,7 @@ export default { ...@@ -237,7 +254,7 @@ export default {
Toast('请前往云鹊医APP学习课程'); Toast('请前往云鹊医APP学习课程');
return; return;
} }
let jumpUrl = getWebPageUrl(`profexam/#/course-detail?courseId=${item.id}&projectId=${this.projectId}&token=${this.token}`); let jumpUrl = getWebPageUrl(`profexam/#/course-detail?courseId=${item.id}&projectId=${this.projectId}&goodsId=${this.goodsId}`);
window.location.href = jumpUrl; window.location.href = jumpUrl;
}, },
...@@ -282,7 +299,7 @@ export default { ...@@ -282,7 +299,7 @@ export default {
if(item) { if(item) {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `882#88215#${item.id}#${item.name}` component_tag: `882#88215#${item.id}#${item.name}`
}); });
} }
Toast(toastMsg); Toast(toastMsg);
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<van-collapse-item <van-collapse-item
v-for="(portalModule, index) in component.portalModuleDTOS" v-for="(portalModule, index) in component.portalModuleDTOS"
:key="index" :key="index"
:title="(parseInt(index) + 1) + '.' + portalModule.moduleName | shortName(19)" :title="portalModule.moduleName | shortName(19)"
:name="portalModule.expandKey" :name="portalModule.expandKey"
:value="portalModule.value" :value="portalModule.value"
@click.native="chooseItem(portalModule)" @click.native="chooseItem(portalModule)"
...@@ -281,6 +281,12 @@ export default { ...@@ -281,6 +281,12 @@ export default {
type: 4, type: 4,
seqNo: 1 seqNo: 1
}, },
{
key: "projectId",
value: this.projectId,
type: 4,
seqNo: 1
},
]; ];
if(trySee) { if(trySee) {
......
...@@ -77,6 +77,10 @@ export default { ...@@ -77,6 +77,10 @@ export default {
courseRequire: { courseRequire: {
type: Number, type: Number,
default: 0, default: 0,
},
projectId: {
type: Number | String,
default: 0,
} }
}, },
computed: { computed: {
...@@ -143,7 +147,14 @@ export default { ...@@ -143,7 +147,14 @@ export default {
type: 4, type: 4,
seqNo: 1 seqNo: 1
}, },
{
key: "projectId",
value: this.projectId,
type: 4,
seqNo: 1
},
]; ];
console.log('gotoCourse', paramList);
rocNative.dispatchEventByModuleCode({ rocNative.dispatchEventByModuleCode({
modeCode: "M200", modeCode: "M200",
jsonString: paramList jsonString: paramList
......
<template>
<section class="bind-cart-wrapper">
<article class="left">
<div class="top">
<span class="discount">{{(cardInfo.preferentialPrice || cardInfo.costPrice) | formatMoney}}</span>
<span v-show="cardInfo.preferentialPrice" class="price">
<del>原价¥{{cardInfo.costPrice | formatMoney}}</del>
</span>
</div>
<div class="bottom">
<img src="../../images/cme/phrase2/info.png" />
<span>激活或购买后可学习课程</span>
</div>
</article>
<article class="right">
<span class="left" @click="changeClick">去激活</span>
<span @click="gotoBuy" class="right">去购买</span>
</article>
</section>
</template>
<script>
export default {
props: {
cardInfo: {
type: Object,
default: () => {}
}
},
data() {
return {};
},
methods: {
changeClick(){
this.$emit("changeClick")
},
gotoBuy() {
this.$emit("gotoBuy");
}
}
};
</script>
<style lang="less" scoped>
.bind-cart-wrapper {
position: fixed;
left: 0;
bottom: 0;
z-index: 100;
width: 100%;
display: flex;
flex-direction: row;
height: 60px;
line-height: 1;
justify-content: space-between;
padding: 10px 15px;
font-size: 14px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px -2px 10px 0px rgba(0, 0, 0, 0.1);
.left {
display: flex;
flex-direction: column;
height: 40px;
line-height: 1;
font-size: 12px;
// align-items: ;
.top {
margin-top: 3px;
height: 24px;
.discount {
color: #fb5b52;
font-size: 18px;
font-weight: 700;
margin-right: 4px;
}
.price {
color: #979899;
}
}
.bottom {
display: flex;
flex-direction: row;
img {
width: 12px;
height: 12px;
margin-left: 1px;
margin-right: 4px;
}
color: #979899;
}
}
.right {
display: flex;
flex-direction: row;
span {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 80px;
font-size: 14px;
font-weight: 400;
text-align: center;
color: #7f7f7f;
border: 1px solid #d2b573;
&.left {
border-radius: 20px 0px 0px 20px;
border-right-style: none;
// color: #ff7a4b;
}
&.right {
// background: linear-gradient(
// 137deg,
// rgba(255, 166, 95, 1) 0%,
// rgba(255, 122, 75, 1) 100%
// );
border-radius: 0px 20px 20px 0px;
// color: #fff;
}
}
}
}
</style>
\ No newline at end of file
...@@ -87,7 +87,10 @@ export default { ...@@ -87,7 +87,10 @@ export default {
margin-left: 1px; margin-left: 1px;
margin-right: 4px; margin-right: 4px;
} }
color: #979899; & > span {
font-size: 12px;
color: #979899;
}
} }
} }
.right { .right {
......
...@@ -31,9 +31,15 @@ export default { ...@@ -31,9 +31,15 @@ export default {
}, },
methods: { methods: {
changeClick(){ changeClick(){
this.$sendBuriedData({
component_tag: `882#88224`
});
this.$emit("changeClick") this.$emit("changeClick")
}, },
gotoBuy() { gotoBuy() {
this.$sendBuriedData({
component_tag: `882#88223`
});
this.$emit("gotoBuy"); this.$emit("gotoBuy");
} }
} }
...@@ -84,7 +90,10 @@ export default { ...@@ -84,7 +90,10 @@ export default {
margin-left: 1px; margin-left: 1px;
margin-right: 4px; margin-right: 4px;
} }
color: #979899; & > span {
font-size: 12px;
color: #979899;
}
} }
} }
.right { .right {
......
...@@ -88,7 +88,8 @@ export default { ...@@ -88,7 +88,8 @@ export default {
}, },
confirm() { confirm() {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `882#88207` // component_tag: `882#88207`
component_tag: `882#88225`
}); });
if(!this.activationCode) { if(!this.activationCode) {
this.errorMsg = '请输入激活码'; this.errorMsg = '请输入激活码';
......
<template>
<div class="teacter-intro-container">
<div class="basic-title">讲师介绍</div>
<div class="leader-info" v-for="(item,index) in doctorList" :key="index">
<img :src="item.appImageUrl"/>
<div class="leader-text">
<div class="leader-con">
<span>{{item.name}}</span>
<span class="leader-title">{{item.title}}</span>
</div>
<div class="address">{{item.hospital}}</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
doctorList: {
type: Array,
default: () => []
}
},
data() {
return {
}
},
created() {
},
mounted() {
},
methods: {
}
}
</script>
<style lang="less" scoped>
.teacter-intro-container {
margin: 30px 15px 0px;
.basic-title {
font-size: 18px;
line-height: 18px;
color: #373839;
font-weight: 700;
}
.leader-info {
display: flex;
flex-direction: row;
margin-top: 16px;
padding-bottom: 16px;
img {
display: inline-block;
width: 44px;
height: 44px;
border-radius: 50%;
}
.leader-text {
flex: 1;
width: 100px;
margin-left: 16px;
margin-top: 6px;
.leader-con {
line-height: 14px;
display: flex;
flex-direction: row;
white-space: nowrap;
span {
font-size: 16px;
color: #676869;
}
span:first-child {
font-size: 16px;
color: #373839;
font-weight: 700;
line-height: 1.1;
}
.leader-title {
width: 220px;
overflow : hidden;
text-overflow: ellipsis;
white-space:nowrap;
line-height: 16px;
margin-left: 10px;
}
}
.address {
margin-top: 5px;
font-size: 13px;
color: #979899;
width: 240px;
overflow : hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
}
}
}
</style>
<template> <template>
<div class="teacter-intro-container"> <div class="teacter-intro-container">
<div class="basic-title">讲师介绍</div> <div class="basic-title">讲师介绍</div>
<div class="leader-info" v-for="(item,index) in doctorList" :key="index"> <div class="leader-info" v-for="(item,index) in current" :key="index">
<img :src="item.appImageUrl"/> <img :src="item.appImageUrl" />
<div class="leader-text"> <div class="leader-text">
<div class="leader-con"> <div class="leader-con">
<span>{{item.name}}</span> <span>{{item.name}}</span>
<span class="leader-title">{{item.title}}</span> <span class="leader-title">{{item.title}}</span>
</div>
<div class="address">{{item.hospital}}</div>
</div>
</div> </div>
<div class="address">{{item.hospital}}</div>
</div>
</div> </div>
<div v-show="doctorList.length > 1" class="toggle-btn" @click="toggle">
<span class="btn">{{ isUp ? '展开更多' : '向上收起'}}</span>
<img v-if="isUp" src="../../images/cme/arrow-grey-down.png" />
<img v-if="!isUp" src="../../images/cme/arrow-grey-up.png" />
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
doctorList: { doctorList: {
type: Array, type: Array,
default: () => [] default: () => []
}
},
data() {
return {
}
},
created() {
},
mounted() {
},
methods: {
} }
} },
data() {
return {
isUp: true,
one: [],
all: [],
current: []
};
},
created() {},
mounted() {
this.one = this.doctorList.slice(0, 1);
this.current = this.one;
this.all = this.doctorList.slice(0);
},
methods: {
toggle() {
this.isUp = !this.isUp;
if (this.isUp) {
this.current = this.one;
this.$sendBuriedData({
component_tag: `882#88222`
});
} else {
this.$sendBuriedData({
component_tag: `882#88221`
});
this.current = this.all;
}
}
}
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.teacter-intro-container { .teacter-intro-container {
margin: 30px 15px 0px; margin: 30px 15px 0px;
.basic-title { .basic-title {
font-size: 18px; font-size: 18px;
line-height: 18px; line-height: 18px;
color: #373839; color: #373839;
font-weight: 700; font-weight: 700;
}
.leader-info {
display: flex;
flex-direction: row;
margin-top: 16px;
padding-bottom: 16px;
img {
display: inline-block;
width: 44px;
height: 44px;
border-radius: 50%;
} }
.leader-info { .leader-text {
flex: 1;
width: 100px;
margin-left: 16px;
margin-top: 6px;
.leader-con {
line-height: 14px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
margin-top: 16px; white-space: nowrap;
padding-bottom: 16px; span {
img { font-size: 16px;
display: inline-block; color: #676869;
width: 44px; }
height: 44px; span:first-child {
border-radius: 50%; font-size: 16px;
color: #373839;
font-weight: 700;
line-height: 1.1;
} }
.leader-text { .leader-title {
flex: 1; width: 220px;
width: 100px; overflow: hidden;
margin-left: 16px; text-overflow: ellipsis;
margin-top: 6px; white-space: nowrap;
.leader-con { line-height: 16px;
line-height: 14px; margin-left: 10px;
display: flex;
flex-direction: row;
white-space: nowrap;
span {
font-size: 16px;
color: #676869;
}
span:first-child {
font-size: 16px;
color: #373839;
font-weight: 700;
line-height: 1.1;
}
.leader-title {
width: 220px;
overflow : hidden;
text-overflow: ellipsis;
white-space:nowrap;
line-height: 16px;
margin-left: 10px;
}
}
.address {
margin-top: 5px;
font-size: 13px;
color: #979899;
width: 240px;
overflow : hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
} }
}
.address {
margin-top: 5px;
font-size: 13px;
color: #979899;
width: 240px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.toggle-btn {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-bottom: 20px;
& > span {
font-size: 14px;
color: #979899;
font-weight: 400;
}
& > img {
width: 15px;
height: 15px;
} }
}
} }
</style> </style>
\ No newline at end of file
<template>
<div class="common-dialog-wrraper" v-if="isShowDialog">
<div class="dialog-mask"></div>
<div class="dialog-container">
<div class="dialog-content">{{content}}</div>
<div v-show="needSubContent" class="dialog-sub-content" v-html="subContent"></div>
<div class="dialog-footer v-hairline-top">
<span :class="{'single-btn': isSingle}" @click="handlerAction(1)">{{cancleBtnText}}</span>
<span v-show="!isSingle" class="confirm-btn v-hairline-left" @click="handlerAction(2)">{{confirmBtnText}}</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: "common-dialog",
data() {
return {
};
},
props: {
content: {
type: String,
default: ''
},
needSubContent: {
type: Boolean,
default: false
},
subContent: {
type: String,
default: ''
},
cancleBtnText: {
type: String,
default: '取消'
},
confirmBtnText: {
type: String,
default: '确定'
},
isShowDialog: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: false
},
},
methods: {
handlerAction(type) {
this.$emit("handlerAction", type);
}
}
};
</script>
<style lang="less" scoped>
.common-dialog-wrraper {
position: fixed;
top: 0;
left: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: 2019;
.dialog-mask {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 2020;
}
.dialog-container {
z-index: 2021;
position: absolute;
top: 50%;
left: 50%;
overflow: hidden;
width: 300px;
font-size: 18px;
-webkit-transition: 0.3s;
transition: 0.3s;
border-radius: 4px;
background-color: #fff;
-webkit-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
.dialog-content {
// margin: 30px 22px;
margin: 30px;
text-align: center;
font-size: 18px;
font-weight: 400;
color: #373839;
}
.dialog-sub-content {
margin: 5px 30px 20px;
// margin: -16px 22px 30px;
text-align: left;
font-size: 14px;
line-height: 24px;
font-weight: 400;
color: #676869;
}
.dialog-footer {
height: 50px;
display: flex;
align-items: center;
&.v-hairline-top::after {
border-top-width: 1px;
}
span {
display: inline-block;
// width: 50%;
flex: 1;
height: 50px;
line-height: 50px;
font-size: 17px;
text-align: center;
color: #979899;
&.v-hairline-left::after {
border-left-width: 1px;
}
&.confirm-btn {
color: #449284;
}
&.single-btn {
color: #449284;
}
}
}
}
[class*="v-hairline"] {
position: relative;
&::after {
content: " ";
position: absolute;
pointer-events: none;
box-sizing: border-box;
top: -50%;
left: -50%;
right: -50%;
bottom: -50%;
-webkit-transform: scale(0.5);
transform: scale(0.5);
border: 0 solid #f0f1f2;
}
}
&.shikan {
.dialog-sub-content {
text-align: center;
font-size: 16px;
}
}
}
</style>
...@@ -27,6 +27,14 @@ export default { ...@@ -27,6 +27,14 @@ export default {
visible: { visible: {
type: Boolean, type: Boolean,
default: true, default: true,
},
hidePpt: {
type: Number,
default: 0,
},
showFlag: {
type: Number,
default: 0,
} }
}, },
data() { data() {
...@@ -88,7 +96,7 @@ export default { ...@@ -88,7 +96,7 @@ export default {
canvas.style['-webkit-filter'] = 'blur(3px)'; canvas.style['-webkit-filter'] = 'blur(3px)';
canvas.style.filter = 'blur(3px)'; canvas.style.filter = 'blur(3px)';
} }
let ctx = canvas.getContext("2d"); let ctx = canvas.getContext("2d");
let renderTask = pdfPage.render({ let renderTask = pdfPage.render({
canvasContext: ctx, canvasContext: ctx,
...@@ -110,7 +118,7 @@ export default { ...@@ -110,7 +118,7 @@ export default {
this.$store.dispatch('goLogin'); this.$store.dispatch('goLogin');
return; return;
} }
this.$toast('前往APP购买查看') this.$toast((this.hidePpt && this.showFlag === 0) ? '请前往App查看' : '购买/激活后可查看课件')
} }
box.appendChild(cover); box.appendChild(cover);
} }
......
...@@ -23,10 +23,8 @@ export default { ...@@ -23,10 +23,8 @@ export default {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `882#${this.tag}` component_tag: `882#${this.tag}`
}); });
setTimeout(() => { window.location.href =
window.location.href = "https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
"https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
}, 100);
}, },
}, },
created() { created() {
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<slot></slot> <slot></slot>
<!-- 试看提示 --> <!-- 试看提示 -->
<div class="proved-box" v-show="logged && showProved"> <div class="proved-box" v-show="logged && showProved">
可试看{{ dealTime(proved) }},观看完整版请<span @click="download">云鹊医App</span> 可试看{{ dealTime(proved) }},观看完整版请 <span @click="download">购买课程</span>
</div> </div>
<!-- 重新播放,只有试看有 --> <!-- 重新播放,只有试看有 -->
<div class="replay-box" v-show="showReplay" @click="onReplay">重新播放</div> <div class="replay-box" v-show="showReplay" @click="onReplay">重新播放</div>
......
...@@ -13,6 +13,7 @@ import BuriedPoint, { sendBuriedData } from 'web-buried-point'; ...@@ -13,6 +13,7 @@ import BuriedPoint, { sendBuriedData } from 'web-buried-point';
import Vant from 'vant'; import Vant from 'vant';
import 'vant/lib/index.css'; import 'vant/lib/index.css';
import clipboard from 'clipboard'; import clipboard from 'clipboard';
import { querystring } from '@/utils';
//注册到vue原型上 //注册到vue原型上
Vue.prototype.clipboard = clipboard; Vue.prototype.clipboard = clipboard;
...@@ -68,10 +69,28 @@ function fliterRoute(query, path) { ...@@ -68,10 +69,28 @@ function fliterRoute(query, path) {
delete query.projectId; delete query.projectId;
has = true; has = true;
} }
// 商品详情页去掉code
if (path === '/goods-detail' && query.code) {
store.dispatch('getWxUserInfo', query.code);
delete query.code;
let goodsDetailParams = sessionStorage.getItem('goodsDetailParams');
goodsDetailParams = goodsDetailParams ? JSON.parse(goodsDetailParams) : {};
Object.assign(query, goodsDetailParams);
has = true;
}
return [query, has]; return [query, has];
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 商品页授权登录路由处理
if (to.path === '/goods-detail') {
let searchQuery = querystring(location.search);
if (searchQuery.code) {
let newUrl = location.origin + location.pathname + '#/goods-detail?code=' + searchQuery.code;
location.replace(newUrl);
return;
}
}
let query = { ...to.query }; let query = { ...to.query };
// 登录token保存并替换路径 // 登录token保存并替换路径
let [newQuery, has] = fliterRoute(query, to.path); let [newQuery, has] = fliterRoute(query, to.path);
......
import App from '../App'
const index = r => require.ensure([], () => r(require('../views/index')), 'index')
const complist = r => require.ensure([], () => r(require('../views/component-details')), 'complist')
const parent = r => require.ensure([], () => r(require('../views/parent-page')), 'parent')
const merge = r => require.ensure([], () => r(require('../views/merge-detail')), 'merge')
const test = r => require.ensure([], () => r(require('../views/test-components')), 'test-components')
export default [{
path: '/',
component: App,
children: [
{
path: '',
redirect: '/index'
},
{
path: '/index',
component: index
},
{
path: '/home',
component: index
},
{
path: '/comp2',
component: complist
},
{
path: '/parent',
component: parent
},
{
path: '/coop',
component: merge
},
{
path: '/test',
component: test
},
]
}]
...@@ -6,6 +6,8 @@ const shareMerge = r => require.ensure([], () => r(require('../views/share-merge ...@@ -6,6 +6,8 @@ const shareMerge = r => require.ensure([], () => r(require('../views/share-merge
const test = r => require.ensure([], () => r(require('../views/test-components')), 'test-components') const test = r => require.ensure([], () => r(require('../views/test-components')), 'test-components')
const courseDetail = r => require.ensure([], () => r(require('../views/course-detail')), 'course-detail') const courseDetail = r => require.ensure([], () => r(require('../views/course-detail')), 'course-detail')
const notFound = r => require.ensure([], () => r(require('../views/not-found')), 'not-found') const notFound = r => require.ensure([], () => r(require('../views/not-found')), 'not-found')
const goodsDetail = r => require.ensure([], () => r(require('../views/goods-detail')), 'goods-detail')
const purchaseRezult = r => require.ensure([], () => r(require('../views/purchase-rezult')), 'purchase-rezult')
export default [{ export default [{
path: '/', path: '/',
...@@ -43,5 +45,13 @@ export default [{ ...@@ -43,5 +45,13 @@ export default [{
path: '/not-found', path: '/not-found',
component: notFound component: notFound
}, },
{
path: '/goods-detail',
component: goodsDetail
},
{
path: '/prezult',
component: purchaseRezult
},
] ]
}] }]
...@@ -2,12 +2,17 @@ import { Toast } from 'vant'; ...@@ -2,12 +2,17 @@ import { Toast } from 'vant';
import fetch from '@/utils/fetch'; import fetch from '@/utils/fetch';
import { getBaseUrl } from '@/utils/index' import { getBaseUrl } from '@/utils/index'
import { setCookie, delCookie } from '@/utils/index'; import { setCookie, delCookie } from '@/utils/index';
import { envConfig } from '@/utils/env-config' import { envConfig } from '@/utils/env-config';
let wxInfo = sessionStorage.getItem('wxInfo');
wxInfo = wxInfo ? JSON.parse(wxInfo) : {};
const user = { const user = {
state: { state: {
token: localStorage.getItem('token') || '', token: localStorage.getItem('token') || '',
info: {}, // 用户信息 info: {}, // 用户信息
wxInfo, // 微信信息,openid等
wxCode: '', // 微信code
}, },
mutations: { mutations: {
SET_TOKEN: (state, payload) => { SET_TOKEN: (state, payload) => {
...@@ -16,6 +21,12 @@ const user = { ...@@ -16,6 +21,12 @@ const user = {
SET_USER_INFO_2: (state, payload) => { SET_USER_INFO_2: (state, payload) => {
state.info = payload; state.info = payload;
}, },
SET_WX_INFO: (state, payload) => {
state.wxInfo = payload;
},
SET_WX_CODE: (state, payload) => {
state.wxCode = payload;
},
}, },
actions: { actions: {
// 外部登陆返回设置token // 外部登陆返回设置token
...@@ -69,6 +80,21 @@ const user = { ...@@ -69,6 +80,21 @@ const user = {
window.location.href = envConfig[process.env.BUILD_ENV]['webPageUrl'] + "/pica_login?target_url=" + encodeURIComponent(location.href); window.location.href = envConfig[process.env.BUILD_ENV]['webPageUrl'] + "/pica_login?target_url=" + encodeURIComponent(location.href);
}, },
getWxUserInfo({ state, commit }, code) {
commit('SET_WX_CODE', code);
const type = 15;
// let url = getBaseUrl(`wechats/users/info/${type}/${code}`);
let url = `https://sc.yunqueyi.com/wechats/users/info/${type}/${code}`; // 测试支付,暂时使用线上
fetch({
url,
method: 'get',
headers: { token: state.token }
}).then(res => {
sessionStorage.setItem('wxInfo', JSON.stringify(res.data));
commit('SET_WX_INFO', res.data)
});
},
// 登出 // 登出
logout({ state, commit }) { logout({ state, commit }) {
commit('SET_TOKEN', ''); commit('SET_TOKEN', '');
......
...@@ -96,6 +96,11 @@ html,body{ ...@@ -96,6 +96,11 @@ html,body{
zoom:1; zoom:1;
} }
.deep-img-w100 img{
display: block;
width: 100%;
}
.back_img{ .back_img{
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
......
...@@ -180,3 +180,7 @@ ...@@ -180,3 +180,7 @@
color: #449284; color: #449284;
} }
} }
.van-loading__spinner {
width: 40px !important;
height: 40px !important;
}
...@@ -8,19 +8,21 @@ export const envConfig = { ...@@ -8,19 +8,21 @@ export const envConfig = {
// baseUrl: 'http://10.177.15.180:10202/', // baseUrl: 'http://10.177.15.180:10202/',
// baseUrl: 'http://192.168.140.14:10201/', // baseUrl: 'http://192.168.140.14:10201/',
// apiUrl: 'https://dev-api.yunqueyi.com/', apiUrl: 'https://dev-api.yunqueyi.com/',
// webPageUrl: 'https://dev-phome.yunqueyi.com/', baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'https://dev-sc.yunqueyi.com/', webPageUrl: 'https://dev-phome.yunqueyi.com/',
// hactiveUrl: 'https://dev-hactive.yunqueyi.com',
// fileUrl: 'https://dev-www.yunqueyi.com',
// appId: 'wxf4e66242d31c81c2', // 用于微信授权登录
baseUrl: 'https://test1-sc.yunqueyi.com/',
apiUrl: 'https://test1-api.yunqueyi.com/',
webPageUrl: 'https://test1-phome.yunqueyi.com/',
hactiveUrl: 'https://dev-hactive.yunqueyi.com', hactiveUrl: 'https://dev-hactive.yunqueyi.com',
fileUrl: 'https://test1-www.yunqueyi.com', fileUrl: 'https://dev-www.yunqueyi.com',
appId: 'wxcaad75b7fff5659c', // 用于微信授权登录 appId: 'wx08b383d002c73f26', // 用于微信授权登录
// appId: 'wxf4e66242d31c81c2', // 用于微信授权登录
// baseUrl: 'https://test1-sc.yunqueyi.com/',
// apiUrl: 'https://test1-api.yunqueyi.com/',
// webPageUrl: 'https://test1-phome.yunqueyi.com/',
// hactiveUrl: 'https://dev-hactive.yunqueyi.com',
// fileUrl: 'https://test1-www.yunqueyi.com',
// appId: 'wxcaad75b7fff5659c', // 用于微信授权登录
// baseUrl: 'https://uat-sc.yunqueyi.com/', // baseUrl: 'https://uat-sc.yunqueyi.com/',
// apiUrl: 'https://uat-api.yunqueyi.com/', // apiUrl: 'https://uat-api.yunqueyi.com/',
...@@ -47,7 +49,7 @@ export const envConfig = { ...@@ -47,7 +49,7 @@ export const envConfig = {
webPageUrl: 'https://dev-phome.yunqueyi.com/', webPageUrl: 'https://dev-phome.yunqueyi.com/',
hactiveUrl: 'https://dev-hactive.yunqueyi.com', hactiveUrl: 'https://dev-hactive.yunqueyi.com',
fileUrl: 'https://dev-www.yunqueyi.com', fileUrl: 'https://dev-www.yunqueyi.com',
appId: 'wxf4e66242d31c81c2', // 用于微信授权登录 appId: 'wx2c577552a2d28550', // 用于微信授权登录
}, },
test: { test: {
baseUrl: 'https://test1-sc.yunqueyi.com/', baseUrl: 'https://test1-sc.yunqueyi.com/',
...@@ -55,7 +57,8 @@ export const envConfig = { ...@@ -55,7 +57,8 @@ export const envConfig = {
webPageUrl: 'https://test1-phome.yunqueyi.com/', webPageUrl: 'https://test1-phome.yunqueyi.com/',
hactiveUrl: 'https://test1-hactive.yunqueyi.com', hactiveUrl: 'https://test1-hactive.yunqueyi.com',
fileUrl: 'https://test1-www.yunqueyi.com', fileUrl: 'https://test1-www.yunqueyi.com',
appId: 'wxcaad75b7fff5659c', // 用于微信授权登录 // appId: 'wxcaad75b7fff5659c', // 用于微信授权登录
appId: 'wx2c577552a2d28550', // 用于微信授权登录
}, },
uat: { uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/', baseUrl: 'https://uat-sc.yunqueyi.com/',
...@@ -63,7 +66,8 @@ export const envConfig = { ...@@ -63,7 +66,8 @@ export const envConfig = {
webPageUrl: 'https://uat-phome.yunqueyi.com/', webPageUrl: 'https://uat-phome.yunqueyi.com/',
hactiveUrl: 'https://uat-hactive.yunqueyi.com', hactiveUrl: 'https://uat-hactive.yunqueyi.com',
fileUrl: 'https://uat-www.yunqueyi.com', fileUrl: 'https://uat-www.yunqueyi.com',
appId: 'wx342ef0e5afee54a7', // 用于微信授权登录 // appId: 'wx342ef0e5afee54a7', // 用于微信授权登录
appId: 'wx2c577552a2d28550', // 用于微信授权登录
}, },
pro: { pro: {
baseUrl: 'https://sc.yunqueyi.com/', baseUrl: 'https://sc.yunqueyi.com/',
......
...@@ -205,6 +205,16 @@ export function isWeiXin() { ...@@ -205,6 +205,16 @@ export function isWeiXin() {
} }
} }
//弹出微信授权
export const wxOauth = () => {
let url = location.href, redirectUrl;
let appId = getAPPID();
url = url.split('?')[0];
redirectUrl = encodeURIComponent(url);
console.log('wxOauth redirectUrl => ', redirectUrl);
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUrl}&response_type=code&scope=snsapi_userinfo&#wechat_redirect`;
}
export const setCookie = (name, value, time) => { export const setCookie = (name, value, time) => {
var expires = 30 * 24 * 60 * 60 * 1000; //一天 var expires = 30 * 24 * 60 * 60 * 1000; //一天
var date = new Date(+new Date() + expires); var date = new Date(+new Date() + expires);
...@@ -237,4 +247,31 @@ export const getCookie = key => { ...@@ -237,4 +247,31 @@ export const getCookie = key => {
} }
} }
return ''; return '';
}; };
\ No newline at end of file
export function debounce(fn, wait = 50) {
let timer;
return function() {
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
fn.apply(this, arguments);
timer = null;
}, wait)
}
}
function decode(input) {
return decodeURIComponent(input.replace(/\+/g, ' '));
}
export function querystring(query) {
var parser = /([^=?&]+)=?([^&]*)/g
, result = {}
, part;
for (;
part = parser.exec(query);
result[decode(part[1])] = decode(part[2])
);
return result;
}
...@@ -212,7 +212,23 @@ module.exports = { ...@@ -212,7 +212,23 @@ module.exports = {
return null return null
}, },
onAvatarError(e) { onAvatarError(e) {
e.target.src = 'https://file.yunqueyi.com/File/doctor_default.png'; e.target.src = 'https://file.yunqueyi.com/File/doctor_default.png';
}, },
// 通用token校验
commonCheckToken(noLoggedCallback) {
let param = {
token: this.token,
setEntry: true
};
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
this.goLogin();
} else {
noLoggedCallback && noLoggedCallback()
}
});
}
} }
} }
...@@ -8,7 +8,8 @@ export const wxConfig = (link) => { ...@@ -8,7 +8,8 @@ export const wxConfig = (link) => {
// const params = { resetURI: true, url: encodeURIComponent(location.href) }; // const params = { resetURI: true, url: encodeURIComponent(location.href) };
// 上线前是需要把域名改为线上的sc // 上线前是需要把域名改为线上的sc
let baseUrl = getBaseUrl(""); let baseUrl = getBaseUrl("");
request({ url: `https://sc.yunqueyi.com/wechats/signs?url=${encodeURIComponent(link)}` }).then(res => { let type = '&type=15'; // 本来没有,暂时改成线上
request({ url: `https://sc.yunqueyi.com/wechats/signs?url=${encodeURIComponent(link)}${type}` }).then(res => {
// request({ url: `${baseUrl}/wechats/signs?url=${encodeURIComponent(link)}` }).then(res => { // request({ url: `${baseUrl}/wechats/signs?url=${encodeURIComponent(link)}` }).then(res => {
let configs = res.data.signMap; let configs = res.data.signMap;
wx.config({ wx.config({
...@@ -122,6 +123,12 @@ export const wechatShare = (option = {}, successCB = () => {}, hideMenu) => { ...@@ -122,6 +123,12 @@ export const wechatShare = (option = {}, successCB = () => {}, hideMenu) => {
} }
}; };
export function chooseWXPay(params) {
wx.ready(() => {
wx.chooseWXPay(params);
})
}
Vue.prototype.wechatShare = wechatShare; Vue.prototype.wechatShare = wechatShare;
Vue.prototype.wxDisabledShare = wxDisabledShare; Vue.prototype.wxDisabledShare = wxDisabledShare;
......
...@@ -2,10 +2,15 @@ ...@@ -2,10 +2,15 @@
<div class="course-detail"> <div class="course-detail">
<!-- 视频 --> <!-- 视频 -->
<div class="video-box"> <div class="video-box">
<pica-video ref="picaVideo" :coverType="coverType" :download="download" @onVideoEnd="onVideoEnd" @onReplay="onReplay"> <pica-video ref="picaVideo" :coverType="coverType" :download="btnClick1" @onVideoEnd="onVideoEnd" @onReplay="onReplay">
<!-- 试看结束 --> <!-- 试看结束 -->
<div class="cover" v-if="logged && coverType === 1"> <div class="cover" v-if="logged && coverType === 1">
<course-covers coverTips="试看结束<br />请来云鹊医App学习完整课程" :isSingle="true" rightBtnText="APP购买更优惠" @btnClick="btnClick" /> <course-covers
coverTips="试看结束<br />请来云鹊医App学习完整课程"
:isSingle="true"
rightBtnText="立即购买"
@btnClick="btnClick1"
/>
</div> </div>
<!-- 付费课程,下载App --> <!-- 付费课程,下载App -->
<div class="cover" v-if="logged && coverType === 2"> <div class="cover" v-if="logged && coverType === 2">
...@@ -62,7 +67,7 @@ ...@@ -62,7 +67,7 @@
</div> </div>
<brief-intro v-show="curtTabIdx === 0" :doctor-list="doctors" :intro="course.intro" :harvest="harvest" /> <brief-intro v-show="curtTabIdx === 0" :doctor-list="doctors" :intro="course.intro" :harvest="harvest" />
<course-catalog v-show="curtTabIdx === 1" :list="chapters" :curtId="curtLectureId" :onToggle="onToggle" :onSelect="selectLecture" :download="download" /> <course-catalog v-show="curtTabIdx === 1" :list="chapters" :curtId="curtLectureId" :onToggle="onToggle" :onSelect="selectLecture" :download="download" />
<course-ware v-show="curtTabIdx === 2" :url="pdfUrl" :visible="pdfVisible" /> <course-ware v-show="curtTabIdx === 2" :url="pdfUrl" :visible="pdfVisible" :hidePpt="course.hidePpt" :showFlag="course.showFlag" />
<course-comment v-show="curtTabIdx === 3" :list="qsList" :download="download" /> <course-comment v-show="curtTabIdx === 3" :list="qsList" :download="download" />
</div> </div>
</div> </div>
...@@ -150,6 +155,7 @@ export default { ...@@ -150,6 +155,7 @@ export default {
this.$store.dispatch('getUserInfo'); this.$store.dispatch('getUserInfo');
} }
this.projectId = sessionStorage.getItem('projectId'); this.projectId = sessionStorage.getItem('projectId');
this.goodsId = this.$route.query.goodsId;
if (!this.projectId) { if (!this.projectId) {
this.$router.replace('/not-found'); this.$router.replace('/not-found');
return; return;
...@@ -299,6 +305,9 @@ export default { ...@@ -299,6 +305,9 @@ export default {
// //
} }
}, },
btnClick1() {
this.$router.push({ path: '/goods-detail', query: { goodsId: this.goodsId, projectId: this.projectId } })
},
// 折叠、展开目录 // 折叠、展开目录
onToggle(index) { onToggle(index) {
const item = this.chapters[index]; const item = this.chapters[index];
......
<template>
<div class="goods-details-wrapper">
<!-- 轮播 -->
<div class="swiper-box">
<van-swipe :show-indicators="false" @change="onSwiperChange">
<van-swipe-item
v-for="(item, index) in swiperList"
:key="index">
<img class="img" :src="item.goodsImgUrl" alt="" />
</van-swipe-item>
</van-swipe>
<div class="indicator">
{{ swiperCurtIndex + 1 }}/{{ swiperList.length }}
</div>
</div>
<!-- 商品信息 -->
<div class="info-box border-line">
<p class="title">{{ goods.goodsName }}</p>
<div class="price">
<div class="money">
<span class="yuan">{{ goods.salePrice.yuan }}</span><span class="fen">.{{ goods.salePrice.fen }}</span><span v-if="goods.hasDiscount" class="del">原价: ¥{{ goods.costPriceText }}</span>
</div>
<div class="bought">{{ goods.saledNum }}购买</div>
</div>
</div>
<!-- 购买数量、支付方式 -->
<div class="buy-box border-line">
<div class="flex">
<div class="name">购买数量</div>
<div class="buy-num">
<div class="reduce" @click="onReduce"></div>
<div class="num">{{ goodsNum }}</div>
<div class="plus" @click="onPlus"></div>
</div>
</div>
<div class="flex buy-way">
<div class="name">
支付方式
<span>目前只支持微信支付</span>
</div>
<div class="way">微信支付</div>
</div>
</div>
<!-- tab切换 -->
<div class="tab-box">
<div
class="tab-item"
:class="{'tab-active': curtTabIdx === index}"
v-for="(tab, index) in tabs"
:key="index"
@click="tabToggle(index)">
{{ tab.name }}
</div>
<div class="tab-line" :style="{left: `${tabLeft}px`}"></div>
</div>
<!-- 详情 -->
<div class="detail-box deep-img-w100" v-html="tabs[curtTabIdx] && tabs[curtTabIdx]['detail']"></div>
<!-- 底部购买 -->
<div class="btn-box">
<div class="money">
<p>合计:<span class="yuan">{{ totalPrice.yuan }}</span><span class="fen">.{{ totalPrice.fen }}</span><span v-if="goods.hasDiscount" class="del">原价: ¥{{ totalPrice.costPriceText }}</span></p>
<p v-if="totalPrice.savePrice" class="coupon">已使用优惠券,为您再优惠{{ totalPrice.savePrice }}</p>
</div>
<div
class="btn"
:class="[goods.isSale === 2 ? 'cannot-buy' : 'can-but']"
@click="createOrder">
{{ goods.isSale === 2 ? '商品已下架' : '确认支付' }}
</div>
</div>
<Loading v-show="showLoading" />
<CourseDialog
content="微信授权"
subContent='<p style="font-size: 16px; font-weight: bold; text-align: center;">云鹊医申请以下权限:</p><p style="font-size: 14px; color: #999; text-align: center; padding-bottom: 10px;">获得你的公开信息(头像,昵称等)</p>'
cancleBtnText="取消"
confirmBtnText="允许"
needSubContent
:isShowDialog="isShowDialog"
@handlerAction="handlerAction"
></CourseDialog>
</div>
</template>
<script>
import { Swipe, SwipeItem } from 'vant';
import Loading from "@/components/common/common-loading";
import CourseDialog from "@/components/course/course-dialog";
import { wxConfig, chooseWXPay } from '@/utils/wxShare';
import { getAPPID, getWebPageUrl, isWeiXin, wxOauth, debounce } from '@/utils';
import { mapGetters } from "vuex";
const isWechat = isWeiXin();
wxConfig(location.href);
export default {
components: {
Swipe,
SwipeItem,
Loading,
CourseDialog,
},
data() {
return {
goods: {
salePrice: {},
}, // 商品信息
totalPrice: {}, // 底部价格
swiperList: [], // 轮播图
swiperCurtIndex: 0, // 轮播当前下标
goodsNum: 1, // 数量
tabs: [],
curtTabIdx: 0,
tabW: 0, // tab的宽度
showLoading: false,
isShowDialog: false,
}
},
computed: {
...mapGetters(["logged"]),
// logged() {
// return this.$store.getters.logged;
// },
wxInfo() {
return this.$store.state.user.wxInfo;
},
wxCode() {
return this.$store.state.user.wxCode;
},
tabLeft() {
const num = this.curtTabIdx + 0.25 + 15 / 115;
return this.tabW * num;
},
},
mounted() {
this.projectId = this.$route.query.projectId;
this.goodsId = this.$route.query.goodsId || 74;
this.getGoodsInfo();
this.getTabW();
const { token, info } = this.$store.state.user;
if (token && !info.id) {
this.$store.dispatch('getUserInfo');
}
// // 微信内先去授权
// if (isWechat && !this.wxInfo.openid) {
// if (location.search.indexOf('code') >= 0 || this.wxCode) {
// // 避免code中转页再次授权
// return;
// }
// wxOauth();
// return;
// }
// 数量加减
this.curtGoodsNum = this.goodsNum;
this.countTotalPrice = debounce(this.getTotalPrice, 300);
// 记录参数,授权登录返回时重新赋值,在main.js
sessionStorage.setItem('goodsDetailParams', JSON.stringify(this.$route.query))
},
methods: {
// tab切换
tabToggle(index) {
this.curtTabIdx = index;
this.$sendBuriedData({
component_tag: `888#8880${index + 4}`
});
},
getGoodsInfo() {
this.GET(`trade/goods/goodInfo/${this.goodsId}`, {}).then(res => {
if (res.code == "000000") {
const goods = res.data;
const tabs = [];
let price = goods.couponPrice || goods.preferentialPrice || goods.costPrice;
goods.salePrice = this.formatPrice(price);
goods.costPriceText = (goods.costPrice / 100).toFixed(2);
goods.hasDiscount = !!(goods.couponPrice || goods.preferentialPrice);
let savePrice = 0;
if (goods.couponPrice) {
if (goods.preferentialPrice) {
savePrice = ((goods.preferentialPrice - goods.couponPrice) / 100).toFixed(2)
} else {
savePrice = ((goods.costPrice - goods.couponPrice) / 100).toFixed(2)
}
}
// if (goods.couponDTO) {
// goods.couponAmountText = (goods.couponDTO.discountAmount / 100).toFixed(2);
// }
if (goods.goodsDescWhere) {
tabs.push({ name: '使用范围', detail: goods.goodsDescWhere })
}
if (goods.goodsDescHow) {
tabs.push({ name: '如何使用', detail: goods.goodsDescHow })
}
if (goods.goodsDescQaq) {
tabs.push({ name: '常见问题', detail: goods.goodsDescQaq })
}
this.totalPrice = {
...goods.salePrice,
preferentialPrice: goods.preferentialPrice,
costPrice: goods.costPrice,
costPriceText: goods.costPriceText,
savePrice,
}
this.goods = goods;
this.swiperList = res.data && res.data.imgList || [];
this.tabs = tabs;
this.getTabW();
} else {
this.$toast(res.message);
}
})
},
// 多件商品的价格
getTotalPrice() {
const num = this.curtGoodsNum;
this.GET(`trade/goods/getPrice/${this.goodsId}/${num}`, {}).then(res => {
if (res.code == "000000") {
const { couponPrice, preferentialPrice, costPrice, savePrice } = res.data;
let price = couponPrice || preferentialPrice || costPrice;
this.totalPrice = {
...this.formatPrice(price),
preferentialPrice,
costPrice: costPrice,
costPriceText: (costPrice / 100).toFixed(2),
savePrice: savePrice ? (savePrice / 100).toFixed(2) : 0,
}
this.goodsNum = num;
} else if (res.code === "200006") {
this.$store.dispatch('logout')
}
})
},
// 价格转成元、分
formatPrice(price) {
let yuan = (price / 100).toFixed(0);
let fen = price % 100;
fen = fen < 10 ? `0${fen}` : fen;
return {
yuan,
fen
}
},
// 获取切换标签宽度
getTabW() {
if (this.tabs.length === 0) {
return;
}
this.$nextTick(() => {
const { width } = this.$el.querySelector('.tab-item').getBoundingClientRect();
this.tabW = width;
})
},
// 轮播切换
onSwiperChange(index) {
this.swiperCurtIndex = index;
},
// 数量增
onPlus() {
this.$sendBuriedData({
component_tag: `888#88801`
});
if (!this.logged) {
this.goLogin();
return;
}
let num = this.curtGoodsNum;
if (this.goods.limitPurchase && this.goods.limitPurchaseNum && num >= this.goods.limitPurchaseNum) {
this.$toast('已达最大限购数量')
return;
}
if (this.goods.goodsStocks && num >= this.goods.goodsStocks) {
this.$toast('库存不足')
return;
}
this.curtGoodsNum = num + 1;
this.countTotalPrice();
},
// 数量减
onReduce() {
this.$sendBuriedData({
component_tag: `888#88802`
});
if (!this.logged) {
this.goLogin();
return;
}
let num = this.curtGoodsNum;
if (num <= 1) {
this.$toast('最少购买一张哦')
return;
}
this.curtGoodsNum = num - 1;
this.countTotalPrice();
},
goLogin() {
this.$store.dispatch('goLogin');
},
handlerAction(type) {
if (type === 2) {
wxOauth();
}
this.isShowDialog = false;
},
// 创建订单
createOrder() {
this.$sendBuriedData({
component_tag: `888#88803`
});
if (!this.logged) {
this.goLogin();
return;
}
// 微信内先去授权
if (isWechat && !this.wxInfo.openid) {
this.isShowDialog = true;
return;
}
// 避免多次支付
if (this.showLoading) {
return;
}
const { id, couponDTO, isSale } = this.goods;
const { preferentialPrice, costPrice } = this.totalPrice;
if (!id || isSale !== 1) {
return;
}
const orderData = {
couponId: couponDTO ? couponDTO.couponId : 0,
goodsId: id,
goodsQuantity: this.goodsNum,
orderSource: 3,
preferentialPrice: this.goods.preferentialPrice,
price: this.goods.costPrice,
}
console.log('orderData...', orderData);
this.showLoading = true;
this.POST('trade/center/order/createV2', orderData).then(res => {
if (res.code == "000000") {
const orderId = res.data.orderId;
if (isWechat) {
this.goWxPayInner(orderId);
} else {
this.goWxPayOut(orderId);
}
if (this.projectId) {
this.createRelation(this.projectId, orderId);
}
} else {
this.$toast(res.message);
this.showLoading = false;
if (res.code === "200006") {
this.$store.dispatch('logout')
}
}
}).catch(() => {
this.showLoading = false;
});
},
// 微信内支付
goWxPayInner(orderId) {
const data = {
openId: this.wxInfo.openid,
orderId,
payChannel: 1,
tradeType: 4,
userId: this.$store.state.user.info.id
}
this.POST('trade/center/jsapi_prepay', data).then(res => {
if (res.code == "000000" && res.data) {
// console.log('______prepay_____', res.data);
const that = this;
const payData = {
...res.data,
appid: res.data.appId,
timestamp: res.data.timeStamp,
success: function() {
let query = { orderId };
if (that.projectId) {
query.projectId = that.projectId
}
that.$router.push({ path: '/prezult', query });
},
fail: function() {
that.$toast('支付失败,请重试~');
},
cancel: function() {
// that.$toast('支付取消~');
},
complete: function() {},
};
chooseWXPay(payData);
} else {
this.$toast(res.message);
}
this.showLoading = false;
}).catch(() => {
this.showLoading = false;
})
},
// 站外微信支付
goWxPayOut(orderId) {
const data = {
// openId: getAPPID(),
orderId,
payChannel: 1,
tradeType: 4,
}
this.POST('trade/center/mweb_prepay', data).then(res => {
if (res.code == "000000") {
if (res.data) {
let redirectUrl = this.getRedirectUrl(orderId);
let jumpLink = res.data + '&redirect_url=' + encodeURIComponent(redirectUrl);
window.location.href = jumpLink;
}
} else {
this.$toast(res.message || '暂时不能支付');
}
this.showLoading = false;
}).catch(() => {
this.showLoading = false;
})
},
getRedirectUrl(orderId) {
let path = `profexam/#/prezult?orderId=${orderId}`;
if (this.projectId) {
path += `&projectId=${this.projectId}`
}
return getWebPageUrl(path);
},
// 绑定项目和订单的关系
createRelation(projectId, orderId) {
this.POST(`cme/projectCard/correlation/${projectId}/${orderId}`, {channel: 3}).then(res => {
if (res.code == "000000") {
//
} else {
this.$toast(res.message);
}
})
}
},
}
</script>
<style lang="less" scoped>
.goods-details-wrapper {
.swiper-box{
position: relative;
.indicator{
position: absolute;
right: 10px;
bottom: 10px;
width: 40px;
height: 22px;
line-height: 22px;
color: #fff;
font-size: 12px;
text-align: center;
padding: 0 8px;
border-radius: 11px;
background: rgba(0, 0, 0, 0.2);
}
.img{
display: block;
width: 100%;
}
}
.border-line{
padding: 20px 15px;
border-bottom: 6px solid #F8F9FA;
}
.info-box{
.title{
font-size: 18px;
font-weight: bold;
padding-bottom: 12px;
}
.price{
display: flex;
align-items: baseline;
font-size: 12px;
}
.money{
flex: 1;
width: 100px;
}
.yuan{
color: #FB5B52;
font-size: 18px;
font-weight: bold;
}
.fen{
color: #FB5B52;
font-weight: bold;
}
.del{
color: #979899;
text-decoration: line-through;
margin-left: 6px;
}
.bought{
color: #979899;
}
}
.buy-box{
font-size: 14px;
.flex{
display: flex;
align-items: center;
}
.name{
flex: 1;
width: 100px;
font-weight: bold;
}
.buy-num{
display: flex;
}
.reduce{
position: relative;
width: 22px;
height: 22px;
background: url('~@/images/reduce.png') no-repeat center center;
background-size: 20px auto;
}
.num{
width: 30px;
height: 22px;
line-height: 22px;
text-align: center;
}
.plus{
position: relative;
width: 22px;
height: 22px;
background: url('~@/images/plus.png') no-repeat center center;
background-size: 20px auto;
}
.buy-way{
margin-top: 25px;
span{
color: #979899;
font-size: 12px;
margin-left: 6px;
}
}
.way{
line-height: 18px;
padding-left: 28px;
background: url('~@/images/wxpay.png') no-repeat left center;
background-size: 18px auto;
}
}
.tab-box{
display: flex;
position: relative;
height: 50px;
padding: 0 15px;
background-color: #fff;
&::after{
position: absolute;
content: "";
left: 0;
bottom: 0;
width: 200%;
height: 0;
border-bottom: 1px solid #F0F1F2;
transform: scale(0.5);
transform-origin: left center;
}
}
.tab-item{
color: #979899;
font-size: 15px;
width: 115px;
height: 50px;
line-height: 50px;
}
.tab-active{
color: #373839;
font-weight: bold;
}
.tab-line{
position: absolute;
left: 30px;
bottom: 3px;
width: 10px;
height: 3px;
background-color: #449284;
border-radius: 1.5px;
transform: translate3d(-5px, 0, 0);
transition: left 0.3s;
}
.detail-box{
font-size: 14px;
text-align: justify;
padding: 15px 15px 75px;
}
.btn-box{
display: flex;
align-items: center;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 60px;
padding: 10px 15px;
box-shadow: 0 -4px 4px rgba(240, 240, 240, 0.5);
background-color: #fff;
.money{
flex: 1;
width: 100px;
font-size: 14px;
}
.yuan{
color: #FB5B52;
font-size: 18px;
font-weight: bold;
}
.fen{
font-size: 12px;
color: #FB5B52;
font-weight: bold;
}
.del{
color: #979899;
font-size: 12px;
text-decoration: line-through;
margin-left: 6px;
}
.coupon{
color: #979899;
font-size: 12px;
}
.btn{
width: 125px;
height: 40px;
line-height: 40px;
text-align: center;
color: #fff;
font-size: 16px;
font-weight: bold;
border-radius: 20px;
}
.can-but{
background-image: linear-gradient(90deg, #FFA65F, #FF7A4B);
}
.cannot-buy{
background-color: #C7C8C9;
}
}
}
</style>
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
:courseRequire="courseRequire" :courseRequire="courseRequire"
:hasBindCard="hasBindCard" :hasBindCard="hasBindCard"
:limitTimes="limitTimes" :limitTimes="limitTimes"
:projectId="projectId"
/> />
</div> </div>
</div> </div>
...@@ -145,6 +146,14 @@ ...@@ -145,6 +146,14 @@
:isShowDialog="isShowIOSDownloadDialog" :isShowDialog="isShowIOSDownloadDialog"
@handlerAction="goBack" @handlerAction="goBack"
/> />
<CourseDialog
:subContent="subContent"
confirmBtnText="激活并去学习"
needSubContent
:isShowDialog="showBindCardTips"
@handlerAction="handlerAction"
></CourseDialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -162,6 +171,7 @@ import ItemIntro from "@/components/cme/item-intro"; ...@@ -162,6 +171,7 @@ import ItemIntro from "@/components/cme/item-intro";
import ItemLeader from "@/components/cme/item-leader"; import ItemLeader from "@/components/cme/item-leader";
import TeacterIntro from "@/components/cme/teacter-intro"; import TeacterIntro from "@/components/cme/teacter-intro";
import CommonDialog from "@/components/cme/common-dialog"; import CommonDialog from "@/components/cme/common-dialog";
import CourseDialog from "@/components/course/course-dialog";
import ExjumperButton from "@/components/cme/exjumper-button"; import ExjumperButton from "@/components/cme/exjumper-button";
import NoMoreContent from "@/components/business/no-more-content"; import NoMoreContent from "@/components/business/no-more-content";
import CommonAdertImg from "@/components/common/common-advert-img"; import CommonAdertImg from "@/components/common/common-advert-img";
...@@ -269,6 +279,14 @@ export default { ...@@ -269,6 +279,14 @@ export default {
isShowSkDialog: false, isShowSkDialog: false,
isShowIOSDownloadDialog: false, isShowIOSDownloadDialog: false,
shareUrl: location.href, shareUrl: location.href,
showBindCardTips: false,
cmeCardModels: {
cardNo: "",
cardKey: "",
cardType: 3,
orderId: 0
},
subContent: ``,
}; };
}, },
components: { components: {
...@@ -284,6 +302,7 @@ export default { ...@@ -284,6 +302,7 @@ export default {
ItemLeader, ItemLeader,
TeacterIntro, TeacterIntro,
CommonDialog, CommonDialog,
CourseDialog,
ExjumperButton, ExjumperButton,
CommonAdertImg, CommonAdertImg,
NoMoreContent, NoMoreContent,
...@@ -355,8 +374,37 @@ export default { ...@@ -355,8 +374,37 @@ export default {
this.showChangeCard = false; this.showChangeCard = false;
}, },
// 处理提示信息框
handlerAction(type) {
if(type == 1) {
this.$sendBuriedData({
component_tag: `882#88219`
});
this.showBindCardTips = false;
} else {
this.$sendBuriedData({
component_tag: `882#88218`
});
this.changeCardAction(this.cmeCardModels.cardKey, true)
}
},
// 查询是否买过类似的卡,但还没有绑定
hasNoUsedCard() {
let param = {
setEntry: true
};
this.GET(`cme/projectCard/queryNoUsedCard/3`, param).then(({ data }) => {
this.hasNoUsedCard = data.hasNoUsedCard;
if (data.hasNoUsedCard == 1) {
this.cmeCardModels = data.cmeCardModels[0] || {};
this.showBindCardTips = true;
}
});
},
// 激活 返回值:0绑定失败,1绑定成功 // 激活 返回值:0绑定失败,1绑定成功
changeCardAction(cardKey) { changeCardAction(cardKey, isInTips) {
let _this = this; let _this = this;
let param = { let param = {
cardKey: cardKey, cardKey: cardKey,
...@@ -366,9 +414,14 @@ export default { ...@@ -366,9 +414,14 @@ export default {
}; };
_this.changeCardErrorMsg = ""; _this.changeCardErrorMsg = "";
this.POST("cme/projectCard/bind", param).then(res => { this.POST("cme/projectCard/bind", param).then(res => {
isInTips && (_this.showBindCardTips = false);
if (res.code == "000000") { if (res.code == "000000") {
if(res.data == 0) { if(res.data == 0) {
_this.changeCardErrorMsg = "请输入正确的激活码"; if(isInTips) {
Toast(res.message);
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
} else { } else {
_this.$refs.tcPlayerRef && _this.$refs.tcPlayerRef.pause(); _this.$refs.tcPlayerRef && _this.$refs.tcPlayerRef.pause();
_this.showChangeCard = false; _this.showChangeCard = false;
...@@ -376,9 +429,16 @@ export default { ...@@ -376,9 +429,16 @@ export default {
_this.getProjectInfoById(); _this.getProjectInfoById();
} }
} else { } else {
Toast(res.message);
} }
}).catch( e => { }).catch( e => {
_this.changeCardErrorMsg = "请输入正确的激活码"; console.log('in catch', isInTips);
if(isInTips) {
Toast("无效的激活码");
_this.showBindCardTips = false;
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
}); });
}, },
...@@ -501,7 +561,8 @@ export default { ...@@ -501,7 +561,8 @@ 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.showLoading = false; this.showLoading = false;
this.cardInfo = (res.data && res.data[0]) || { id: 0 }; this.cardInfo = (res.data && res.data[0]) || { id: 0, name: "职称考精讲课程卡" };
this.subContent = `您已购买“${this.cardInfo.goodsName}”,是否用此卡绑定并激活当前课程。学习卡激活码一旦使用,不可更改不可退回`
} }
}); });
}, },
...@@ -528,8 +589,7 @@ export default { ...@@ -528,8 +589,7 @@ export default {
return; return;
} }
// let pageUrl = this.project.examBtnUrl; // 直接传入职称考项目ID(projectId)
// 直接传入项目ID(projectId)
let projectId = this.project.projectId; let projectId = this.project.projectId;
let pageUrl = getWebPageUrl( let pageUrl = getWebPageUrl(
`/profexam/#/index?id=${projectId}&projectName=${this.project.projectName}&profexamProjectId=${projectId}` `/profexam/#/index?id=${projectId}&projectName=${this.project.projectName}&profexamProjectId=${projectId}`
...@@ -761,6 +821,9 @@ export default { ...@@ -761,6 +821,9 @@ export default {
if(_this.hasBindCard) { if(_this.hasBindCard) {
_this.videoOptions.trySeeTime = 300000; _this.videoOptions.trySeeTime = 300000;
_this.videoOptions.autoplay = false; _this.videoOptions.autoplay = false;
// 如果没有绑定卡,则查询是否有未绑定的卡
} else {
_this.hasNoUsedCard();
} }
let mp4Url = _this.videoOptions.mp4; let mp4Url = _this.videoOptions.mp4;
// 判断是否是mp4 // 判断是否是mp4
...@@ -1025,10 +1088,6 @@ export default { ...@@ -1025,10 +1088,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",
...@@ -1054,12 +1113,12 @@ export default { ...@@ -1054,12 +1113,12 @@ export default {
type: 4, type: 4,
seqNo: 1 seqNo: 1
}, },
// { {
// key: "limitTimes", key: "projectId",
// value: limitTimes, value: this.projectId,
// type: 4, type: 4,
// seqNo: 1 seqNo: 1
// }, },
]; ];
console.log('gotoCourse', paramList); console.log('gotoCourse', paramList);
rocNative.dispatchEventByModuleCode({ rocNative.dispatchEventByModuleCode({
......
<template> <template>
<div class="not-found"> <div class="not-found">
<img class="img" src="~@/images/no-content.png" alt="" /> <img class="img" src="~@/images/no-content.png" alt />
<p class="tip">此课程已下架,无法查看</p> <p class="tip">{{tips}}</p>
<p class="tip-2">更多内容,请前往云鹊医APP学习</p>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return {}; return {
tips: "此课程已下架,无法查看",
fromPage: "2"
};
}, },
mounted() { mounted() {
this.fromPage = this.$route.query.fromPage || '1'; // 1: 来处项目详情页; 2: 来处课程详情页
if(this.fromPage == 2) {
this.tips = "此项目已下架, 无法查看";
}
}, },
methods: { methods: {}
}
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.not-found { .not-found {
.img{ display: flex;
display: block; flex-direction: column;
align-items: center;
padding-top: 100px;
.img {
width: 120px; width: 120px;
margin: 100px auto 0;
} }
.tip{ .tip {
font-size: 15px; font-size: 18px;
font-weight: 700;
color: #373839;
text-align: center;
padding: 0 15px;
}
.tip-2 {
margin-top: 12px;
font-size: 14px;
font-weight: 400;
color: #676869;
text-align: center; text-align: center;
padding: 0 15px;
} }
} }
</style> </style>
......
<template>
<div class="purchase-wrapper">
<img v-show="isCorrect" class="status-img" src="../images/puchase/correct.png" />
<img v-show="!isCorrect" class="status-img" src="../images/puchase/warning.png" />
<div class="msg-content-wrapper">
<p class="msg-content" v-html="msgContent"></p>
<!-- 直接从商品过来的 -->
<p v-if="!projectId" class="msg-content-2">订单详情页打开/下载云鹊医APP查看</p>
</div>
<Button v-show="projectId" @handlerClick="gotoProject"></Button>
<Button :isPlain="!!projectId" buttonText="去云鹊医APP" @handlerClick="download"></Button>
<CourseDialog
subContent='请在微信内完成支付,如果您已支付成功,请点击“已完成支付”按钮'
confirmBtnText="已完成支付"
needSubContent
:isShowDialog="isShowDialog"
@handlerAction="handlerAction"
></CourseDialog>
<van-overlay :show="loading" @click="show = false" class="v-overlay">
<div class="loading-wrapper" >
<van-loading type="spinner" />
<p class="text">{{projectId ? '课程解锁中' : '正在交易中'}} {{loadingTimes}}s</p>
</div>
</van-overlay>
</div>
</template>
<script>
import { getWebPageUrl, getCookie } from "@/utils/index";
import CourseDialog from "@/components/course/course-dialog";
import Button from "@/components/business/button"
let intervalId = null;
export default {
components: {
Button,
CourseDialog
},
data() {
return {
projectId: 1,
orderId: '1595497912391728990',
htmlTitle: "支付结果",
isCorrect: true,
// msgContent: "此项目已被其他学习卡绑定,您可以去绑定新的项目,或去云鹊医APP查看订单详情",
msgContent: "购买成功",
loading: true,
loadingTimes: 3,
// 返回值data:0:订单进行中 1:支付并绑定成功 2:订单反馈延时,请稍后再试 3:支付失败,请重新购买 4:订单已被取消,请重新购买
bindStatus: 0,
showGoApp: true,
hasShowed: false,
isShowDialog: false,
returnUrl: "",
}
},
created() {
let { projectId, orderId } = this.$route.query;
this.projectId = projectId || 0;
this.orderId = orderId || 0;
this.returnUrl = localStorage.getItem('returnUrl');
console.log('projectId', 'orderId', this.projectId, this.orderId, this.returnUrl);
// 直接从商品过来的
// if(!this.projectId) {
// this.msgContent = "购买成功";
// }
// 等待
intervalId = setInterval( () => {
if(this.loadingTimes <= 0) {
intervalId && clearInterval(intervalId);
// 从项目购买过来的
if(this.projectId) {
this.getBindCardStatus();
// 直接从商品过来的
} else {
this.getStatusByOrderId();
}
} else {
this.loadingTimes -= 1;
}
}, 1000)
},
mounted() {
document.title = this.htmlTitle;
},
methods: {
// 弹框:手动点击“已完成支付”
handlerAction(type) {
this.isShowDialog = false;
if(type == 1) {
// if(this.projectId) {
// this.gotoProject();
// } else {
// this.download();
// }
} else {
if(this.projectId) {
this.getBindCardStatus();
} else {
this.getStatusByOrderId();
}
}
},
// 查询一次绑卡状态
getBindCardStatus() {
let _this = this;
let param = {
projectId: this.projectId,
orderId: this.orderId,
setEntry: true
};
this.GET(`cme/projectCard/status/${this.projectId}/${this.orderId}`, param).then(({ data }) => {
this.loading = false;
this.bindStatus = data;
// 绑定成功
if( data == 1 ) {
this.msgContent = "购买成功";
this.isCorrect = true;
} else {
if(!this.hasShowed) {
this.hasShowed = true;
this.isShowDialog = true;
}
this.msgContent = "解锁延时,您可返回项目继续学习";
this.isCorrect = false;
}
}).catch( e => {
console.log("getBindCardStatus", "调用失败...");
});
},
// 直接根据订单ID获取订单状态
getStatusByOrderId() {
let _this = this;
let param = {
orderId: this.orderId,
};
this.GET(`trade/center/order/query`, param).then(({ data }) => {
this.loading = false;
this.msgContent = "购买失败";
this.isCorrect = false;
// 订单状态: 订单状态:1待支付, 2支付中, 3支付失败, 4订单超时, 5支付成功, 6交易完成, 7交易关闭
if( data.orderDto.status == 6 ) {
this.msgContent = "购买成功";
this.isCorrect = true;
} else {
if(!this.hasShowed) {
this.hasShowed = true;
this.isShowDialog = true;
}
}
}).catch( e => {
console.log("getStatusByOrderId", "调用失败...");
});
},
// 返回到项目详情页面
gotoProject() {
this.$sendBuriedData({
component_tag: `889#88901`
});
this.returnUrl && location.replace(this.returnUrl);
},
// 下载
download() {
this.$sendBuriedData({
component_tag: `889#88902`
});
window.location.href = "https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
}
},
}
</script>
<style lang="less" scoped>
.purchase-wrapper {
padding-top: 60px;
// display: flex;
// flex-direction: column;
text-align: center;
.status-img {
width: 60px;
height: 60px;
}
.msg-content-wrapper {
margin-bottom: 30px;
.msg-content {
margin: 0 20px 10px;
color: #48494A;
font-size: 16px;
font-weight: 700;
line-height: 1.5;
}
.msg-content-2 {
color: #676869;
font-size: 14px;
}
}
.v-overlay {
background-color: #fff;
padding-top: 200px;
.loading-wrapper {
text-align: center;
.text {
margin-top: 12px;
color: #A1A2A3;
font-size: 14px;
}
}
}
}
</style>
\ No newline at end of file
<template> <template>
<!-- 组件详情页面:模块列表及其下面的元件列表 --> <!-- 组件详情页面:模块列表及其下面的元件列表 -->
<div class="page-container-merge" > <div class="page-container-merge">
<CommonNavbar <!-- <CommonNavbar
id="header" id="header"
:bgColor="bgColor" :bgColor="bgColor"
v-show="isShowNavbar" v-show="isShowNavbar"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
:burialPoint="pointStyle" :burialPoint="pointStyle"
borderStyle="0px solid #fff" borderStyle="0px solid #fff"
:backMethod="from" :backMethod="from"
></CommonNavbar> ></CommonNavbar>-->
<div class="page-content list-container"> <div class="page-content list-container">
<!-- banner图片 --> <!-- banner图片 -->
<div v-if="bannerType == 1" class="page-content-img-container"> <div v-if="bannerType == 1" class="page-content-img-container">
...@@ -24,25 +24,46 @@ ...@@ -24,25 +24,46 @@
</div> </div>
<!-- banner视频 --> <!-- banner视频 -->
<div class="video-box" v-if="bannerType == 2"> <div class="video-box" v-if="bannerType == 2">
<pica-video ref="picaVideo" :coverType="coverType" :download="download" @onVideoEnd="onVideoEnd" @onReplay="onReplay"> <pica-video
ref="picaVideo"
:coverType="coverType"
:download="download"
@onVideoEnd="onVideoEnd"
@onReplay="onReplay"
>
<!-- 试看结束 --> <!-- 试看结束 -->
<div class="cover" v-if="logged && coverType === 1"> <div class="cover" v-if="logged && coverType === 1">
<course-covers coverTips="试看结束<br />请来云鹊医App学习完整课程" :isSingle="true" rightBtnText="APP购买更优惠" @btnClick="btnClick1" /> <course-covers
coverTips="试看结束<br />请来云鹊医App学习完整课程"
:isSingle="true"
rightBtnText="立即购买"
@btnClick="btnClick1"
/>
</div> </div>
<!-- 播放结束,下载App --> <!-- 播放结束,下载App -->
<div class="cover" v-if="logged && coverType === 2"> <div class="cover" v-if="logged && coverType === 2">
<course-covers coverTips="播放结束<br />更多其他课程,请前往鹊医App学习" :isSingle="true" rightBtnText="去云鹊医App" @btnClick="btnClick2" /> <course-covers
coverTips="播放结束<br />更多其他课程,请前往鹊医App学习"
:isSingle="true"
rightBtnText="去云鹊医App"
@btnClick="btnClick2"
/>
</div> </div>
<!-- 未登录 --> <!-- 未登录 -->
<div class="cover" v-if="!logged"> <div class="cover" v-if="!logged">
<course-covers coverTips="登录后马上学习课程" :isSingle="true" rightBtnText="去登录" @btnClick="beforeGoLogin" /> <course-covers
coverTips="登录后马上学习课程"
:isSingle="true"
rightBtnText="去登录"
@btnClick="beforeGoLogin"
/>
</div> </div>
</pica-video> </pica-video>
</div> </div>
<!-- <div class="sk-btn-cover-new" @click="continueStudy()" v-if="bannerType == 2 && hasBindCard"> <!-- <div class="sk-btn-cover-new" @click="continueStudy()" v-if="bannerType == 2 && hasBindCard">
<span :class="{'android': isAndroid}">继续学习</span> <span :class="{'android': isAndroid}">继续学习</span>
</div> --> </div>-->
<!-- 项目标题 --> <!-- 项目标题 -->
<CommonDescription <CommonDescription
:projectName="project.projectName" :projectName="project.projectName"
...@@ -101,6 +122,7 @@ ...@@ -101,6 +122,7 @@
:limitTimes="limitTimes" :limitTimes="limitTimes"
:logged="logged" :logged="logged"
:projectId="projectId" :projectId="projectId"
:goodsId="cardInfo.id"
/> />
</div> </div>
</div> </div>
...@@ -113,73 +135,36 @@ ...@@ -113,73 +135,36 @@
<div v-if="!hasBindCard" style="padding-top: 60px"></div> <div v-if="!hasBindCard" style="padding-top: 60px"></div>
<!-- <div v-if="!hasBindCard && !isWeb" style="padding-top: 30px"></div> --> <!-- <div v-if="!hasBindCard && !isWeb" style="padding-top: 30px"></div> -->
<!-- <BindCardButton <BindCardButton
v-if="!hasBindCard && !isWeb" v-if="!hasBindCard"
:cardInfo="cardInfo" :cardInfo="cardInfo"
@changeClick="changeClick" @changeClick="changeClick"
@gotoBuy="confirm" @gotoBuy="confirm"
></BindCardButton>--> ></BindCardButton>
<BindCardButtonShare <!-- <BindCardButtonShare
v-if="!hasBindCard" v-if="!hasBindCard"
:cardInfo="cardInfo" :cardInfo="cardInfo"
@changeClick="changeClick" @changeClick="changeClick"
@gotoBuy="confirm" @gotoBuy="confirm"
></BindCardButtonShare> ></BindCardButtonShare>-->
<!--去激活--> <!--去激活-->
<ChangeCard <ChangeCard
:changeErrorMsg="changeCardErrorMsg" :changeErrorMsg="changeCardErrorMsg"
:isShow="showChangeCard" :isShow="showChangeCard"
@cancle="cancleChangeCard" @cancle="cancleChangeCard"
@confirm="changeCardAction" @confirm="beforeChangeCardAction"
></ChangeCard> ></ChangeCard>
<Loading v-show="showLoading" /> <Loading v-show="showLoading" />
<div>
<span
ref="copyLinkBtn"
data-clipboard-action="copy"
class="cobyOrderSn"
:data-clipboard-text="this.project.cardKey"
@click="copyLink"
></span>
</div>
<!-- 未登录提示 --> <CourseDialog
<div class="course-tips" v-if="!logged"> :subContent="subContent"
<CourseCovers isSingle coverTips="登录后马上学习课程" rightBtnText="去登录" @btnClick="btnClick"></CourseCovers> confirmBtnText="激活并去学习"
</div> needSubContent
:isShowDialog="showBindCardTips"
<!-- 试看结束 --> @handlerAction="handlerAction"
<!-- <div class="course-tips" v-if="isShowSkDialog"> ></CourseDialog>
<CourseCovers
isSingle
coverTips="试看结束<br>学习完整版课程,请来云鹊医App购买"
rightBtnText="APP购买更优惠"
@btnClick="download(1)"
></CourseCovers>
</div> -->
<!-- 播放结束 -->
<!-- <div class="course-tips" v-if="isShowEndDialog">
<CourseCovers
isSingle
coverTips="播放结束<br>更多其他课程,请前往云鹊医APP学习"
rightBtnText="APP购买更优惠"
@btnClick="download(1)"
></CourseCovers>
</div> -->
<!-- 本课程为付费课程 -->
<!-- <div class="course-tips" v-if="isShowFFDialog">
<CourseCovers
isSingle
coverTips="本课程为付费课程<br>学习完整版课程,请来云鹊医App购买"
rightBtnText="APP购买更优惠"
@btnClick="download(1)"
></CourseCovers>
</div> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -195,21 +180,26 @@ import LearnKnow from "@/components/cme/learn-know"; ...@@ -195,21 +180,26 @@ import LearnKnow from "@/components/cme/learn-know";
import ItemIntro from "@/components/cme/item-intro"; import ItemIntro from "@/components/cme/item-intro";
import ItemLeader from "@/components/cme/item-leader"; import ItemLeader from "@/components/cme/item-leader";
import TeacterIntro from "@/components/cme/teacter-intro"; import TeacterIntro from "@/components/cme/teacter-intro";
import CommonDialog from "@/components/cme/common-dialog"; import CourseDialog from "@/components/course/course-dialog";
import ExjumperButton from "@/components/cme/exjumper-button"; import ExjumperButton from "@/components/cme/exjumper-button";
import NoMoreContent from "@/components/business/no-more-content"; import NoMoreContent from "@/components/business/no-more-content";
// import CommonAdertImg from "@/components/common/common-advert-img"; // import CommonAdertImg from "@/components/common/common-advert-img";
import { getWebPageUrl, gotoPage, getAppVersion } from "@/utils/index"; import {
getWebPageUrl,
gotoPage,
getAppVersion,
getCookie
} 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 BindCardButtonShare from "@/components/cme/bind-card-button-share"; import BindCardButton from "@/components/cme/bind-card-button";
// import BindCardButtonShare from "@/components/cme/bind-card-button-share";
import ChangeCard from "@/components/cme/change-card"; import ChangeCard from "@/components/cme/change-card";
import CourseCovers from "@/components/course/course-covers"; import CourseCovers from "@/components/course/course-covers";
import DownloadButton from "@/components/course/download-button"; import DownloadButton from "@/components/course/download-button";
import PicaVideo from '@/components/course/pica-video'; import PicaVideo from "@/components/course/pica-video";
import { getCookie } from '@/utils/index';
let cataOffsetTop = 0; let cataOffsetTop = 0;
let intorOffsetTop = 0; let intorOffsetTop = 0;
...@@ -304,13 +294,19 @@ export default { ...@@ -304,13 +294,19 @@ export default {
isInfresh: false, isInfresh: false,
needShowUpdate: false, needShowUpdate: false,
skCourseId: 0, skCourseId: 0,
isShowSkDialog: false,
isShowEndDialog: false,
isShowFFDialog: false,
needShort: false, needShort: false,
showDownloadButton: false, showDownloadButton: false,
uuid: '', uuid: "",
token: '' token: "",
shareUrl: "",
showBindCardTips: false,
cmeCardModels: {
cardNo: "",
cardKey: "",
cardType: 3,
orderId: 0
},
subContent: ``,
}; };
}, },
components: { components: {
...@@ -324,11 +320,12 @@ export default { ...@@ -324,11 +320,12 @@ export default {
ItemIntro, ItemIntro,
ItemLeader, ItemLeader,
TeacterIntro, TeacterIntro,
CommonDialog, CourseDialog,
ExjumperButton, ExjumperButton,
// CommonAdertImg, // CommonAdertImg,
NoMoreContent, NoMoreContent,
BindCardButtonShare, BindCardButton,
// BindCardButtonShare,
ChangeCard, ChangeCard,
CourseCovers, CourseCovers,
DownloadButton, DownloadButton,
...@@ -343,28 +340,29 @@ export default { ...@@ -343,28 +340,29 @@ export default {
let _this = this; let _this = this;
this.from = this.$route.query.from || this.from || "native"; this.from = this.$route.query.from || this.from || "native";
let href = location.href; let href = location.href;
let uuidIndex = href.indexOf('uuid') || 0; let uuidIndex = href.indexOf("uuid") || 0;
if(uuidIndex > 0) { if (uuidIndex > 0) {
this.uuid = href.substr(uuidIndex + 5, 32); this.uuid = href.substr(uuidIndex + 5, 32);
} else { } else {
this.uuid = '07F9625472D6444EBAE4BF7D2EF83BC4' this.uuid = "07F9625472D6444EBAE4BF7D2EF83BC4";
} }
if(href.indexOf('singlemessage') >= 0 || href.indexOf('wx_code') >= 0) { this.shareUrl = location.href;
let shareUrl = getWebPageUrl(`profexam/#/sharecoop?uuid=${this.uuid}`); if (href.indexOf("singlemessage") >= 0 || href.indexOf("wx_code") >= 0) {
location.replace(shareUrl); this.shareUrl = getWebPageUrl(`profexam/#/sharecoop?uuid=${this.uuid}`);
location.replace(this.shareUrl);
} }
localStorage.setItem('returnUrl', this.shareUrl);
const { token, info } = this.$store.state.user; const { token, info } = this.$store.state.user;
this.token = getCookie('token') || token; this.token = getCookie("token") || token;
// 如果有token,但没有用户信息,则获取用户信息 // 如果有token,但没有用户信息,则获取用户信息
if (this.token && !info.id) { if (this.token && !info.id) {
this.$store.dispatch('setToken', this.token); this.$store.dispatch("setToken", this.token);
// this.$store.dispatch('getUserInfo'); // this.$store.dispatch('getUserInfo');
} }
this.queryByUuid(this.uuid); this.queryByUuid(this.uuid);
// 调用广告位接口 // 调用广告位接口
this.getAdvertInfoList(); // this.getAdvertInfoList();
}, },
mounted() { mounted() {
window.addEventListener("scroll", this.scrollFun); window.addEventListener("scroll", this.scrollFun);
...@@ -390,9 +388,9 @@ export default { ...@@ -390,9 +388,9 @@ export default {
this.GET(`portal/shareParam/queryByUuid`, param).then(res => { this.GET(`portal/shareParam/queryByUuid`, param).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.shareParam = JSON.parse(res.data || "{}"); this.shareParam = JSON.parse(res.data || "{}");
this.projectId = this.shareParam.projectId || 0; // 797 this.projectId = this.shareParam.projectId || 812; // 797 812
this.getProjectInfoById(); this.getProjectInfoById();
console.log('queryByUuid', res); console.log("queryByUuid", res);
} }
}); });
}, },
...@@ -400,17 +398,18 @@ export default { ...@@ -400,17 +398,18 @@ export default {
onVideoEnd(opt) { onVideoEnd(opt) {
if (opt.type === 1) { if (opt.type === 1) {
this.coverType = 2; this.coverType = 2;
} else if (opt.type === 2) { // 试看结束 } else if (opt.type === 2) {
// 试看结束
this.coverType = 1; this.coverType = 1;
} }
}, },
onReplay() { onReplay() {
this.coverType = 0; this.coverType = 0;
}, },
btnClick1() { btnClick1() {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `882#88210` component_tag: `882#88220`
}); });
this.download(); this.download();
}, },
...@@ -427,64 +426,96 @@ export default { ...@@ -427,64 +426,96 @@ export default {
}, },
download(type) { download(type) {
this.confirm();
// setTimeout(() => {
// window.location.href =
// "https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
// }, 100);
},
// 关闭激活弹框
cancleChangeCard() {
this.showChangeCard = false;
},
// 处理提示信息框
handlerAction(type) {
if(type == 1) { if(type == 1) {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `882#88210` component_tag: `882#88219`
}); });
this.showBindCardTips = false;
} else {
this.$sendBuriedData({
component_tag: `882#88218`
});
this.beforeChangeCardAction(this.cmeCardModels.cardKey, true)
} }
setTimeout(() => {
window.location.href =
"https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
}, 100);
}, },
// 关闭激活弹框 // 激活前
cancleChangeCard() { beforeChangeCardAction(cardKey, isInTips) {
this.showChangeCard = false; this.commonCheckToken(() => {
this.changeCardAction(cardKey, isInTips);
});
}, },
// 激活 返回值:0绑定失败,1绑定成功 // 查询是否买过类似的卡,但还没有绑定
changeCardAction(cardKey) { hasNoUsedCard() {
let param = {
setEntry: true
};
this.GET(`cme/projectCard/queryNoUsedCard/3`, param).then(({ data }) => {
this.hasNoUsedCard = data.hasNoUsedCard;
if (data.hasNoUsedCard == 1) {
this.cmeCardModels = data.cmeCardModels[0] || {};
this.showBindCardTips = true;
}
});
},
// 激活Action 返回值:0绑定失败,1绑定成功
changeCardAction(cardKey, isInTips) {
let _this = this; let _this = this;
let param = { let param = {
cardKey: cardKey, cardKey: cardKey,
cardType: 3, cardType: 3,
channel: 3,
portalProjectId: this.projectId, portalProjectId: this.projectId,
setEntry: true setEntry: true
}; };
_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 == 0) { if (!res.data) {
_this.changeCardErrorMsg = "请输入正确的激活码"; if(isInTips) {
Toast(res.message);
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
} else { } else {
_this.showChangeCard = false; _this.showChangeCard = false;
Toast("激活成功,开始学习"); Toast("激活成功,开始学习");
_this.getProjectInfoById(); _this.getProjectInfoById();
} }
} else { } else {
Toast(res.message);
} }
}) })
.catch(e => { .catch(e => {
_this.changeCardErrorMsg = "请输入正确的激活码"; console.log('in catch', isInTips);
if(isInTips) {
Toast("无效的激活码");
_this.showBindCardTips = false;
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
}); });
}, },
// 复制卡密
copyLink() {
let _this = this;
let clipboard = new this.clipboard(".cobyOrderSn");
clipboard.on("success", function() {
e.clearSelection();
Toast("已成功复制激活码");
});
clipboard.on("error", function() {
e.clearSelection();
Toast("复制激活码失败");
});
},
// 查询教培项目广告位配置信息 // 查询教培项目广告位配置信息
getAdvertInfoList() { getAdvertInfoList() {
let param = { let param = {
...@@ -515,7 +546,8 @@ export default { ...@@ -515,7 +546,8 @@ 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.showLoading = false; this.showLoading = false;
this.cardInfo = (res.data && res.data[0]) || { id: 0 }; this.cardInfo = (res.data && res.data[0]) || { id: 0, name: "职称考精讲课程卡" };
this.subContent = `您已购买“${this.cardInfo.goodsName}”,是否用此卡绑定并激活当前课程。学习卡激活码一旦使用,不可更改不可退回`
} }
}); });
}, },
...@@ -524,8 +556,14 @@ export default { ...@@ -524,8 +556,14 @@ export default {
// this.$sendBuriedData({ // this.$sendBuriedData({
// component_tag: `882#88203` // component_tag: `882#88203`
// }); // });
window.location.href = this.commonCheckToken(() => {
"https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque"; let jumpUrl = getWebPageUrl(
`profexam/#/goods-detail?goodsId=${this.cardInfo.id}&projectId=${
this.projectId
}`
);
window.location.href = jumpUrl;
});
}, },
// 首次进入考试时记录(点击‘我知道了’时调用) // 首次进入考试时记录(点击‘我知道了’时调用)
...@@ -545,13 +583,10 @@ export default { ...@@ -545,13 +583,10 @@ export default {
}, },
//去激活 //去激活
changeClick(msg) { changeClick() {
console.log("in changeClick"); this.commonCheckToken(() => {
this.showChangeCard = true; this.showChangeCard = true;
});
// this.$sendBuriedData({
// component_tag: `882#88202`
// });
}, },
scrollFun() { scrollFun() {
...@@ -655,8 +690,7 @@ export default { ...@@ -655,8 +690,7 @@ export default {
if (videoUrl) { if (videoUrl) {
_this.limitTimes = this.shareParam.limitTimes || 0; _this.limitTimes = this.shareParam.limitTimes || 0;
_this.videoOptions.mp4 = videoUrl; _this.videoOptions.mp4 = videoUrl;
_this.videoOptions.trySeeTime = _this.videoOptions.trySeeTime = this.shareParam.limitTimes || 0;
this.shareParam.limitTimes || 0;
} else { } else {
_this.limitTimes = res.data.trySeeTime; _this.limitTimes = res.data.trySeeTime;
_this.videoOptions.mp4 = res.data.attachmentUrl; _this.videoOptions.mp4 = res.data.attachmentUrl;
...@@ -666,19 +700,22 @@ export default { ...@@ -666,19 +700,22 @@ export default {
if (_this.hasBindCard) { if (_this.hasBindCard) {
_this.videoOptions.trySeeTime = 0; _this.videoOptions.trySeeTime = 0;
_this.videoOptions.autoplay = false; _this.videoOptions.autoplay = false;
// 如果没有绑定卡,则查询是否有未绑定的卡
} else {
_this.logged && _this.hasNoUsedCard();
} }
let mp4Url = _this.videoOptions.mp4; let mp4Url = _this.videoOptions.mp4;
// 判断是否是mp4 // 判断是否是mp4
if (mp4Url.lastIndexOf(".mp4") > 0) { if (mp4Url.lastIndexOf(".mp4") > 0) {
_this.bannerType = 2; _this.bannerType = 2;
this.$nextTick( () => { this.$nextTick(() => {
console.log('_this.$refs.picaVideo', _this.$refs.picaVideo); console.log("_this.$refs.picaVideo", _this.$refs.picaVideo);
_this.$refs.picaVideo.switchUrl({ _this.$refs.picaVideo.switchUrl({
url: mp4Url, url: mp4Url,
proved: _this.videoOptions.trySeeTime, proved: _this.videoOptions.trySeeTime,
enable: true, enable: true
}); });
}) });
// // TODO test // // TODO test
// _this.videoOptions.mp4 += 2; // _this.videoOptions.mp4 += 2;
} else { } else {
...@@ -764,7 +801,9 @@ export default { ...@@ -764,7 +801,9 @@ export default {
// 二次分享 // 二次分享
// let shareUrl = encodeURIComponent(location.href); // let shareUrl = encodeURIComponent(location.href);
// let shareUrl = location.href; // let shareUrl = location.href;
let shareUrl = getWebPageUrl(`profexam/#/sharecoop?uuid=${this.uuid}`); let shareUrl = getWebPageUrl(
`profexam/#/sharecoop?uuid=${this.uuid}`
);
this.wechatShare( this.wechatShare(
{ {
link: shareUrl, link: shareUrl,
...@@ -777,6 +816,9 @@ export default { ...@@ -777,6 +816,9 @@ export default {
console.log("share success..."); console.log("share success...");
} }
); );
} else {
_this.showLoading = false;
_this.$router.replace("/not-found?fromPage=2");
} }
}); });
}, },
...@@ -861,7 +903,7 @@ export default { ...@@ -861,7 +903,7 @@ export default {
} else if (len <= 30 && certificate != 2) { } else if (len <= 30 && certificate != 2) {
return 1; return 1;
} }
}, }
} }
}; };
</script> </script>
...@@ -897,7 +939,7 @@ export default { ...@@ -897,7 +939,7 @@ export default {
height: 30px; height: 30px;
} }
} }
.video-box{ .video-box {
position: relative; position: relative;
height: 210px; height: 210px;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="test-container"> <div class="test-container">
<!-- <CommonButton btnText="去学习"></CommonButton> --> <!-- <CommonButton btnText="去学习"></CommonButton> -->
<!-- <CommonDialog content="该项目仅对河北省石家庄市的用户开放" :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog> --> <!-- <CommonDialog content="该项目仅对河北省石家庄市的用户开放" :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog> -->
<!-- <CommonDialog content="您暂未认证身份,完成认证身份后可申请学分" confirmBtnText="去认证" :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog> --> <CommonDialog content="您暂未认证身份,完成认证身份后可申请学分" confirmBtnText="去认证" :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog>
<!-- <CommonDialog content="您暂未加入机构,加入机构后且认证身份后可申请学分" confirmBtnText="加入机构" :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog> --> <!-- <CommonDialog content="您暂未加入机构,加入机构后且认证身份后可申请学分" confirmBtnText="加入机构" :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog> -->
<!-- <CommonDialog content="您的所属机构不在可申请范围(河北省石家庄市)内" cancleBtnText="我知道了" isSingle :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog> --> <!-- <CommonDialog content="您的所属机构不在可申请范围(河北省石家庄市)内" cancleBtnText="我知道了" isSingle :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog> -->
<!-- <CommonDialog content="提交成功" subContent="您可在“个人中心-证书与学分”中查看审核结果" cancleBtnText="我知道了" isSingle needSubContent :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog> --> <!-- <CommonDialog content="提交成功" subContent="您可在“个人中心-证书与学分”中查看审核结果" cancleBtnText="我知道了" isSingle needSubContent :isShowDialog="isShowDialog" @handlerAction="handlerDialogAction"></CommonDialog> -->
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
}, },
components: { components: {
// CommonButton, // CommonButton,
// CommonDialog, CommonDialog,
// CommonBottomInfo, // CommonBottomInfo,
// CommonErrorTips, // CommonErrorTips,
CourseButton, CourseButton,
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册