提交 3b99e2c7 编写于 作者: 张平's avatar 张平

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

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

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

See merge request !17
<template> <template>
<!-- 项目组件列表项 --> <!-- 项目组件列表项 -->
<section> <section>
<div <div
class="cell-detail" class="cell-detail"
v-for="(component , index) in projectComponent" v-for="(component , index) in projectComponent"
:key="index"> :key="index">
<van-collapse v-model="activeNames" @change="changeCollapse"> <van-collapse v-model="activeNames" @change="changeCollapse">
<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"
:disabled="portalModule.disabled" :disabled="portalModule.disabled"
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
> >
<!-- :class="{'text-action-no': item.useFlag == 2}" --> <!-- :class="{'text-action-no': item.useFlag == 2}" -->
去试看 去试看
</span> </span>
<span <span
v-else v-else
@click="gotoExamOrCourse(item)" @click="gotoExamOrCourse(item)"
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
{{getActionText(item.status, item.type)}} {{getActionText(item.status, item.type)}}
</span> </span>
<!-- <img @click="toastToBuy" class="key" v-show="!hasBindCard" src="../../images/cme/phrase2/key.png" alt=""> --> <!-- <img @click="toastToBuy" class="key" v-show="!hasBindCard" src="../../images/cme/phrase2/key.png" alt=""> -->
<div class="foot-line" <div class="foot-line"
v-if="index+1 < portalModule.contentList.length && portalModule.contentList[index].templetId == portalModule.contentList[index+1].templetId"> v-if="index+1 < portalModule.contentList.length && portalModule.contentList[index].templetId == portalModule.contentList[index+1].templetId">
</div> </div>
</div> </div>
...@@ -142,7 +142,11 @@ export default { ...@@ -142,7 +142,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,
...@@ -170,16 +174,30 @@ export default { ...@@ -170,16 +174,30 @@ export default {
if(type == 'sk') { if(type == 'sk') {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `883#88316#${item.id}#${item.name}` component_tag: `883#88316#${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) {
if(item.type == 1) { if(item.type == 1) {
Toast('请前往云鹊医APP参加考试'); Toast('请前往云鹊医APP参加考试');
...@@ -234,10 +252,10 @@ export default { ...@@ -234,10 +252,10 @@ export default {
Toast('请前往云鹊医APP学习课程'); Toast('请前往云鹊医APP学习课程');
return; return;
} }
let jumpUrl = getWebPageUrl(`profexam/#/course-detail?courseId=${courseId}&projectId=${this.projectId}&token=${this.token}`); let jumpUrl = getWebPageUrl(`profexam/#/course-detail?courseId=${courseId}&projectId=${this.projectId}&goodsId=${this.goodsId}`);
window.location.href = jumpUrl; window.location.href = jumpUrl;
}, },
// 跳转到考试 // 跳转到考试
gotoExam: function(examId) { gotoExam: function(examId) {
Toast('请前往云鹊医APP参加考试'); Toast('请前往云鹊医APP参加考试');
...@@ -335,7 +353,7 @@ export default { ...@@ -335,7 +353,7 @@ export default {
} }
.van-collapse-item { .van-collapse-item {
.van-cell { .van-cell {
margin: 9px auto 0 auto; margin: 9px auto 0 auto;
// width: 345px; // width: 345px;
width: 100%; width: 100%;
min-height: 48px; min-height: 48px;
...@@ -629,4 +647,4 @@ export default { ...@@ -629,4 +647,4 @@ export default {
.bg-13 { .bg-13 {
background: #abcec7; background: #abcec7;
} }
</style> </style>
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,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"
:disabled="portalModule.disabled" :disabled="portalModule.disabled"
......
...@@ -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 {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<section class="bind-cart-wrapper"> <section class="bind-cart-wrapper">
<article class="left"> <article class="left">
<div class="top"> <div class="top">
<span class="discount">{{(cardInfo.preferentialPrice || cardInfo.costPrice) | formatMoney}}</span> <span class="discount">{{(cardInfo.couponPrice || cardInfo.preferentialPrice || cardInfo.costPrice) | formatMoney}}</span>
<span v-show="cardInfo.preferentialPrice" class="price"> <span v-show="cardInfo.couponPrice || cardInfo.preferentialPrice" class="price">
<del>原价¥{{cardInfo.costPrice | formatMoney}}</del> <del>原价¥{{cardInfo.costPrice | formatMoney}}</del>
</span> </span>
</div> </div>
...@@ -31,9 +31,15 @@ export default { ...@@ -31,9 +31,15 @@ export default {
}, },
methods: { methods: {
changeClick(){ changeClick(){
this.$sendBuriedData({
component_tag: `883#88324`
});
this.$emit("changeClick") this.$emit("changeClick")
}, },
gotoBuy() { gotoBuy() {
this.$sendBuriedData({
component_tag: `883#88323`
});
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 {
...@@ -97,25 +106,24 @@ export default { ...@@ -97,25 +106,24 @@ export default {
justify-content: center; justify-content: center;
width: 80px; width: 80px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 700;
text-align: center; text-align: center;
color: #7f7f7f;
border: 1px solid #d2b573;
&.left { &.left {
border-radius: 20px 0px 0px 20px; border-radius: 20px 0px 0px 20px;
border: 1px solid rgba(255, 122, 75, 1);
border-right-style: none; border-right-style: none;
// color: #ff7a4b; color: #ff7a4b;
} }
&.right { &.right {
// background: linear-gradient( background: linear-gradient(
// 137deg, 137deg,
// rgba(255, 166, 95, 1) 0%, rgba(255, 166, 95, 1) 0%,
// rgba(255, 122, 75, 1) 100% rgba(255, 122, 75, 1) 100%
// ); );
border-radius: 0px 20px 20px 0px; border-radius: 0px 20px 20px 0px;
// color: #fff; color: #fff;
} }
} }
} }
} }
</style> </style>
\ No newline at end of file
...@@ -86,6 +86,9 @@ export default { ...@@ -86,6 +86,9 @@ export default {
this.$emit("cancle"); this.$emit("cancle");
}, },
confirm() { confirm() {
this.$sendBuriedData({
component_tag: `883#88325`
});
if(!this.activationCode) { if(!this.activationCode) {
this.errorMsg = '请输入激活码'; this.errorMsg = '请输入激活码';
return; return;
......
...@@ -44,8 +44,14 @@ export default { ...@@ -44,8 +44,14 @@ export default {
toggle() { toggle() {
this.isUp = !this.isUp; this.isUp = !this.isUp;
if (this.isUp) { if (this.isUp) {
this.$sendBuriedData({
component_tag: `883#88322`
});
this.current = this.one; this.current = this.one;
} else { } else {
this.$sendBuriedData({
component_tag: `883#88321`
});
this.current = this.all; this.current = this.all;
} }
} }
......
<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>
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
<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">云鹊医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>
......
...@@ -11,6 +11,8 @@ const creditedit = r => require.ensure([], () => r(require('../views/credit-edit ...@@ -11,6 +11,8 @@ const creditedit = r => require.ensure([], () => r(require('../views/credit-edit
const creditdetail = r => require.ensure([], () => r(require('../views/credit-detail')), 'credit-detail') const creditdetail = r => require.ensure([], () => r(require('../views/credit-detail')), 'credit-detail')
const excgtips = r => require.ensure([], () => r(require('../views/exchange-tips')), 'exchange-tips') const excgtips = r => require.ensure([], () => r(require('../views/exchange-tips')), 'exchange-tips')
const icreditdetail = r => require.ensure([], () => r(require('../views/I-credit-detail')), 'I-credit-detail') const icreditdetail = r => require.ensure([], () => r(require('../views/I-credit-detail')), 'I-credit-detail')
const notFound = r => require.ensure([], () => r(require('../views/not-found')), 'not-found')
const goodsDetail = r => require.ensure([], () => r(require('../views/goods-detail')), 'goods-detail')
export default [{ export default [{
path: '/', path: '/',
...@@ -68,7 +70,13 @@ export default [{ ...@@ -68,7 +70,13 @@ export default [{
path: '/icredit-detail', path: '/icredit-detail',
component: icreditdetail component: icreditdetail
}, },
{
path: '/not-found',
component: notFound
},
{
path: '/goods-detail',
component: goodsDetail
},
] ]
}] }]
...@@ -14,7 +14,7 @@ const user = { ...@@ -14,7 +14,7 @@ const user = {
SET_TOKEN: (state, payload) => { SET_TOKEN: (state, payload) => {
state.token = payload; state.token = payload;
}, },
SET_USER_INFO: (state, payload) => { SET_USER_INFO_2: (state, payload) => {
state.info = payload; state.info = payload;
}, },
}, },
...@@ -55,7 +55,7 @@ const user = { ...@@ -55,7 +55,7 @@ const user = {
// avatarUrl = img2.src; // avatarUrl = img2.src;
// } // }
picapDoctor.avatar = avatarUrl || 'https://file.yunqueyi.com/File/doctor_default.png'; picapDoctor.avatar = avatarUrl || 'https://file.yunqueyi.com/File/doctor_default.png';
commit('SET_USER_INFO', { ...picapDoctor, isExist, certifyDoc }); commit('SET_USER_INFO_2', { ...picapDoctor, isExist, certifyDoc });
} }
} else { } else {
errCallBack() errCallBack()
...@@ -73,7 +73,7 @@ const user = { ...@@ -73,7 +73,7 @@ const user = {
// 登出 // 登出
logout({ state, commit }) { logout({ state, commit }) {
commit('SET_TOKEN', ''); commit('SET_TOKEN', '');
commit('SET_USER_INFO', {}); commit('SET_USER_INFO_2', {});
localStorage.removeItem('token'); localStorage.removeItem('token');
delCookie('token') delCookie('token')
}, },
......
...@@ -13,15 +13,15 @@ const service = axios.create({ ...@@ -13,15 +13,15 @@ const service = axios.create({
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
if (config.data && config.data.setEntry) { if (config.data && config.data.setEntry) {
config.headers['sysCode'] = config.data.sysCode || 10 config.headers['sysCode'] = config.data.sysCode || 10
if(config.data.token){ if (config.data.token) {
config.headers['token'] = config.data.token || 'CAF8336E76514F07BF195EFCEBE60775' config.headers['token'] = config.data.token || 'CAF8336E76514F07BF195EFCEBE60775'
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境 if (process.env.BUILD_ENV == "development") { // 本地开发环境
config.headers['token'] = config.data.token || '14587B3BBD77434EAFE8755FB1856008'; config.headers['token'] = config.data.token || '14587B3BBD77434EAFE8755FB1856008';
} }
delete config.data.setEntry; delete config.data.setEntry;
delete config.data.token; delete config.data.token;
} }
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' }) config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
} }
return config return config
...@@ -37,7 +37,7 @@ service.interceptors.response.use( ...@@ -37,7 +37,7 @@ service.interceptors.response.use(
/* /*
baseUrl时,返回000000为成功 baseUrl时,返回000000为成功
apiUrl时,返回200为成功 apiUrl时,返回200为成功
*/ */
if (res.code !== '000000' && response.respCode === 200) { if (res.code !== '000000' && response.respCode === 200) {
return Promise.reject('error') return Promise.reject('error')
} else { } else {
......
...@@ -207,5 +207,19 @@ module.exports = { ...@@ -207,5 +207,19 @@ module.exports = {
return null return null
}, },
// 通用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()
}
});
}
} }
} }
<template>
<div class="goods-details-wrapper">
商品详情页面
</div>
</template>
<script>
export default {
}
</script>
<style lang="less" scoped>
.goods-details-wrapper {
font-size: 14px;
}
</style>
\ No newline at end of file
...@@ -178,6 +178,14 @@ ...@@ -178,6 +178,14 @@
:isShowDialog="isShowIOSDownloadDialog" :isShowDialog="isShowIOSDownloadDialog"
@handlerAction="goBack" @handlerAction="goBack"
/> />
<CourseDialog
:subContent="subContent"
confirmBtnText="激活并去学习"
needSubContent
:isShowDialog="showBindCardTips"
@handlerAction="handlerActionTips"
></CourseDialog>
</div> </div>
</template> </template>
...@@ -199,6 +207,7 @@ import ItemIntro from "@/components/cme/item-intro"; ...@@ -199,6 +207,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 ExjumperDialog from "@/components/cme/exjumper-dialog"; import ExjumperDialog from "@/components/cme/exjumper-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";
...@@ -324,6 +333,14 @@ export default { ...@@ -324,6 +333,14 @@ export default {
isShowSkDialog: false, isShowSkDialog: false,
isShowIOSDownloadDialog: false, isShowIOSDownloadDialog: false,
shareUrl: location.href, shareUrl: location.href,
showBindCardTips: false,
cmeCardModels: {
cardNo: "",
cardKey: "",
cardType: 2,
orderId: 0
},
subContent: ``,
}; };
}, },
components: { components: {
...@@ -340,6 +357,7 @@ export default { ...@@ -340,6 +357,7 @@ export default {
ItemLeader, ItemLeader,
TeacterIntro, TeacterIntro,
CommonDialog, CommonDialog,
CourseDialog,
ExjumperButton, ExjumperButton,
ExjumperDialog, ExjumperDialog,
// CardPopup, // CardPopup,
...@@ -426,8 +444,37 @@ export default { ...@@ -426,8 +444,37 @@ export default {
this.showChangeCard = false; this.showChangeCard = false;
}, },
// 查询是否买过类似的卡,但还没有绑定
hasNoUsedCard() {
let param = {
setEntry: true
};
this.GET(`cme/projectCard/queryNoUsedCard/2`, param).then(({ data }) => {
this.hasNoUsedCard = data.hasNoUsedCard;
if (data.hasNoUsedCard == 1) {
this.cmeCardModels = data.cmeCardModels[0] || {};
this.showBindCardTips = true;
}
});
},
// 处理提示信息框
handlerActionTips(type) {
if(type == 1) {
this.$sendBuriedData({
component_tag: `883#88319`
});
this.showBindCardTips = false;
} else {
this.$sendBuriedData({
component_tag: `883#88318`
});
this.changeCardAction(this.cmeCardModels.cardKey, true);
}
},
// 激活 返回值:0绑定失败,1绑定成功 // 激活 返回值:0绑定失败,1绑定成功
changeCardAction(cardKey) { changeCardAction(cardKey, isInTips) {
let _this = this; let _this = this;
let param = { let param = {
cardKey: cardKey, cardKey: cardKey,
...@@ -437,9 +484,14 @@ export default { ...@@ -437,9 +484,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) {
_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;
...@@ -449,7 +501,12 @@ export default { ...@@ -449,7 +501,12 @@ export default {
} else { } else {
} }
}).catch( e => { }).catch( e => {
_this.changeCardErrorMsg = "请输入正确的激活码"; if(isInTips) {
Toast("无效的激活码");
_this.showBindCardTips = false;
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
}); });
}, },
...@@ -618,7 +675,8 @@ export default { ...@@ -618,7 +675,8 @@ export default {
if (res.code == "000000") { if (res.code == "000000") {
this.showLoading = false; this.showLoading = false;
// this.isShowPopup = true; // this.isShowPopup = true;
this.cardInfo = (res.data && res.data[0]) || { id: 0 }; this.cardInfo = (res.data && res.data[0]) || { id: 0, name: "职称考精讲课程卡" };
this.subContent = `您已购买“${this.cardInfo.goodsName}”,是否用此卡绑定并激活当前课程。学习卡激活码一旦使用,不可更改不可退回`
} }
}); });
}, },
...@@ -943,7 +1001,9 @@ export default { ...@@ -943,7 +1001,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
if(mp4Url.lastIndexOf('.mp4') > 0) { if(mp4Url.lastIndexOf('.mp4') > 0) {
......
<template>
<div class="not-found">
<img class="img" src="~@/images/no-content.png" alt />
<p class="tip">{{tips}}</p>
<p class="tip-2">更多内容,请前往云鹊医APP学习</p>
</div>
</template>
<script>
export default {
data() {
return {
tips: "此课程已下架,无法查看",
fromPage: "2"
};
},
mounted() {
this.fromPage = this.$route.query.fromPage || '2'; // 1: 来处项目详情页; 2: 来处课程详情页
if(this.fromPage == 2) {
this.tips = "此项目已下架, 无法查看";
}
},
methods: {}
};
</script>
<style lang="less" scoped>
.not-found {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 100px;
.img {
width: 120px;
}
.tip {
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;
padding: 0 15px;
}
}
</style>
<template> <template>
<!-- 组件详情页面:模块列表及其下面的元件列表 --> <!-- 组件详情页面:模块列表及其下面的元件列表 -->
<div class="page-container-merge" :style="{'position': isShowEJDialog ? 'fixed' : 'static'}"> <div class="page-container-merge" :style="{'position': isShowEJDialog ? 'fixed' : 'static'}">
<CommonNavbar <!-- <CommonNavbar
id="header" id="header"
:bgColor="bgColor" :bgColor="bgColor"
v-show="isShowNavbar" v-show="isShowNavbar"
...@@ -14,10 +14,15 @@ ...@@ -14,10 +14,15 @@
: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 @click="gotoCourse()" v-if="bannerType == 1" class="page-content-img-container" style="position:relative;"> <div
@click="gotoCourse()"
v-if="bannerType == 1"
class="page-content-img-container"
style="position:relative;"
>
<img class="banner-img" :src="attachmentUrl" /> <img class="banner-img" :src="attachmentUrl" />
<img v-show="project.status == 5" class="banner-img-5" src="../images/status-keep-on.png" /> <img v-show="project.status == 5" class="banner-img-5" src="../images/status-keep-on.png" />
<img v-show="project.status == 10" class="banner-img-10" src="../images/status-end-cme.png" /> <img v-show="project.status == 10" class="banner-img-10" src="../images/status-end-cme.png" />
...@@ -25,18 +30,39 @@ ...@@ -25,18 +30,39 @@
<!-- 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="APP购买更优惠"
@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>
...@@ -71,8 +97,8 @@ ...@@ -71,8 +97,8 @@
> >
<span :class="{'focus': tabFlag}" @click="jumpIntro">简介</span> <span :class="{'focus': tabFlag}" @click="jumpIntro">简介</span>
<span :class="{'focus': !tabFlag}" @click="jumpCatalogue">目录</span> <span :class="{'focus': !tabFlag}" @click="jumpCatalogue">目录</span>
<div class="download-abs" @click="download(2)"> <div class="download-abs" @click="gotoDownload">
<img src="../images/cme/course/pica-icon.png" alt=""> <img src="../images/cme/course/pica-icon.png" alt />
<span :class="{'short': needShort}">{{downloadTips}}</span> <span :class="{'short': needShort}">{{downloadTips}}</span>
</div> </div>
</div> </div>
...@@ -115,6 +141,7 @@ ...@@ -115,6 +141,7 @@
:cmeType="project.cmeType" :cmeType="project.cmeType"
:logged="logged" :logged="logged"
:projectId="projectId" :projectId="projectId"
:goodsId="cardInfo.id"
/> />
</div> </div>
</div> </div>
...@@ -151,31 +178,32 @@ ...@@ -151,31 +178,32 @@
></ExjumperButton> ></ExjumperButton>
<!-- <div v-if="project.cmeType == 2 && !isWeb" style="padding-top: 30px"></div> --> <!-- <div v-if="project.cmeType == 2 && !isWeb" style="padding-top: 30px"></div> -->
<div style="padding-top: 20px"></div> <div style="padding-top: 20px"></div>
<!-- <BindCardButton <BindCardButton
v-if="project.cmeType == 2 && !hasBindCard && !isWeb" v-if="project.cmeType == 2 && !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> <div>
<span ref="copyLinkBtn" <span
ref="copyLinkBtn"
data-clipboard-action="copy" data-clipboard-action="copy"
class="cobyOrderSn" class="cobyOrderSn"
:data-clipboard-text="this.project.cardKey" :data-clipboard-text="this.project.cardKey"
...@@ -183,31 +211,14 @@ ...@@ -183,31 +211,14 @@
></span> ></span>
</div> </div>
<!-- 未登录提示 --> <CourseDialog
<div class="course-tips" v-if="!logged"> :subContent="subContent"
<CourseCovers isSingle coverTips="登录后马上学习课程" rightBtnText="去登录" @btnClick="btnClick"></CourseCovers> confirmBtnText="激活并去学习"
</div> needSubContent
:isShowDialog="showBindCardTips"
<!-- 试看结束 --> @handlerAction="handlerActionTips"
<div class="course-tips" v-if="isShowSkDialog"> ></CourseDialog>
<CourseCovers isSingle coverTips="试看结束<br>学习完整版课程,请来云鹊医App购买" rightBtnText="APP购买更优惠" @btnClick="download(1)"></CourseCovers> </div>
</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 class="download-abs" @click="download">
<img src="../images/cme/course/pica-icon.png" alt="">
<span :class="{'short': needShort}">{{downloadTips}}</span>
</div> -->
</div>
</template> </template>
<script> <script>
import CommonNavbar from "@/components/common/common-navbar"; import CommonNavbar from "@/components/common/common-navbar";
...@@ -224,6 +235,7 @@ import ItemIntro from "@/components/cme/item-intro"; ...@@ -224,6 +235,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 ExjumperDialog from "@/components/cme/exjumper-dialog"; import ExjumperDialog from "@/components/cme/exjumper-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";
...@@ -234,11 +246,12 @@ import { mapGetters, mapActions } from "vuex"; ...@@ -234,11 +246,12 @@ 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"; // import CardPopup from "@/components/cme/card-popup";
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 PicaVideo from '@/components/course/pica-video'; import PicaVideo from "@/components/course/pica-video";
import { getCookie } from '@/utils/index'; import { getCookie } from "@/utils/index";
let cataOffsetTop = 0; let cataOffsetTop = 0;
let intorOffsetTop = 0; let intorOffsetTop = 0;
...@@ -291,7 +304,7 @@ export default { ...@@ -291,7 +304,7 @@ export default {
firstIntoExam: false, // true弹框,是否首次进入考试,用于首次跳转弹框提示,只跟项目和人员有关 firstIntoExam: false, // true弹框,是否首次进入考试,用于首次跳转弹框提示,只跟项目和人员有关
jumpToContents: false, // 是否跳转到目录 jumpToContents: false, // 是否跳转到目录
cardStatus: 0, cardStatus: 0,
cardKey: '', cardKey: ""
// cmeType=2时不显示进度, // cmeType=2时不显示进度,
// projectNo为空时不显示项目编号, // projectNo为空时不显示项目编号,
// projectLeader为空时不显示项目负责人, // projectLeader为空时不显示项目负责人,
...@@ -315,7 +328,7 @@ export default { ...@@ -315,7 +328,7 @@ export default {
width: "415", //视频的显示宽度,请尽量使用视频分辨率宽度 width: "415", //视频的显示宽度,请尽量使用视频分辨率宽度
height: "210", //视频的显示高度,请尽量使用视频分辨率高度 height: "210", //视频的显示高度,请尽量使用视频分辨率高度
trySeeTime: "", trySeeTime: "",
x5_fullscreen: false, x5_fullscreen: false
}, },
// attachmentUrl: require("../images/banner-default.png"), // attachmentUrl: require("../images/banner-default.png"),
attachmentUrl: require("../images/video-cover.png"), attachmentUrl: require("../images/video-cover.png"),
...@@ -346,9 +359,18 @@ export default { ...@@ -346,9 +359,18 @@ export default {
isShowEndDialog: false, isShowEndDialog: false,
isShowFFDialog: false, isShowFFDialog: false,
needShort: false, needShort: false,
uuid: '', uuid: "",
token: '', token: "",
shareUrl: "",
shareParam: {}, shareParam: {},
showBindCardTips: false,
cmeCardModels: {
cardNo: "",
cardKey: "",
cardType: 2,
orderId: 0
},
subContent: ``
}; };
}, },
components: { components: {
...@@ -364,12 +386,14 @@ export default { ...@@ -364,12 +386,14 @@ export default {
ItemLeader, ItemLeader,
TeacterIntro, TeacterIntro,
CommonDialog, CommonDialog,
CourseDialog,
ExjumperButton, ExjumperButton,
ExjumperDialog, ExjumperDialog,
// CardPopup, // CardPopup,
// CommonAdertImg, // CommonAdertImg,
NoMoreContent, NoMoreContent,
BindCardButtonShare, BindCardButton,
// BindCardButtonShare,
ChangeCard, ChangeCard,
CourseCovers, CourseCovers,
PicaVideo PicaVideo
...@@ -383,30 +407,33 @@ export default { ...@@ -383,30 +407,33 @@ 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) {
let shareUrl = getWebPageUrl(`cme/#/sharecoop?uuid=${this.uuid}`);
location.replace(shareUrl);
} }
this.shareUrl = location.href;
if (href.indexOf("singlemessage") >= 0 || href.indexOf("wx_code") >= 0) {
this.shareUrl = getWebPageUrl(`cme/#/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);
}, },
beforeDestroyed() { beforeDestroyed() {
window.removeEventListener("scroll", this.scrollFun); window.removeEventListener("scroll", this.scrollFun);
...@@ -429,9 +456,9 @@ export default { ...@@ -429,9 +456,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; // 178 this.projectId = this.shareParam.projectId || 178; // 178
this.getProjectParticularsV2(); this.getProjectParticularsV2();
console.log('queryByUuid', res); console.log("queryByUuid", res);
} }
}); });
}, },
...@@ -440,7 +467,8 @@ export default { ...@@ -440,7 +467,8 @@ 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;
} }
}, },
...@@ -450,7 +478,8 @@ export default { ...@@ -450,7 +478,8 @@ export default {
btnClick1() { btnClick1() {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `883#88310` // component_tag: `883#88310`
component_tag: `883#88320`
}); });
this.download(); this.download();
}, },
...@@ -466,50 +495,102 @@ export default { ...@@ -466,50 +495,102 @@ export default {
this.download(); this.download();
}, },
download(type) { download() {
if(type == 1) { this.confirm();
// setTimeout(() => {
// window.location.href =
// "https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
// }, 100);
},
gotoDownload() {
this.$sendBuriedData({
component_tag: `883#88312`
});
window.location.href =
"https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
},
cancleChangeCard() {
this.showChangeCard = false;
},
// 处理提示信息框
handlerActionTips(type) {
if (type == 1) {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `883#88310` component_tag: `883#88319`
}); });
} else if(type == 2) { this.showBindCardTips = false;
} else {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `883#88312` component_tag: `883#88318`
}); });
this.beforeChangeCardAction(this.cmeCardModels.cardKey, true);
} }
setTimeout(() => {
window.location.href =
"https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
}, 100);
}, },
cancleChangeCard() { //
this.showChangeCard = false; beforeChangeCardAction(cardKey, isInTips) {
this.commonCheckToken(() => {
this.changeCardAction(cardKey, isInTips);
});
},
// 查询是否买过类似的卡,但还没有绑定
hasNoUsedCard() {
let param = {
setEntry: true
};
this.GET(`cme/projectCard/queryNoUsedCard/2`, 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,
cardType: 2, cardType: 2,
channel: 3,
portalProjectId: this.projectId, portalProjectId: this.projectId,
setEntry: true setEntry: true
}; };
_this.changeCardErrorMsg = ""; _this.changeCardErrorMsg = "";
this.POST("cme/projectCard/bind", param).then(res => { this.POST("cme/projectCard/bind", param)
if (res.code == "000000") { .then(res => {
if(res.data == 0) { isInTips && (_this.showBindCardTips = false);
_this.changeCardErrorMsg = "请输入正确的激活码"; console.log("in res", res, isInTips);
if (res.code == "000000") {
if (!res.data) {
if (isInTips) {
Toast(res.message);
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
} else {
_this.showChangeCard = false;
Toast("激活成功,开始学习");
_this.getProjectParticularsV2();
}
} else { } else {
_this.showChangeCard = false; Toast(res.message);
Toast("激活成功,开始学习");
_this.getProjectParticularsV2();
} }
} else { })
} .catch(e => {
}).catch( e => { if (isInTips) {
_this.changeCardErrorMsg = "请输入正确的激活码"; Toast("无效的激活码");
}); _this.showBindCardTips = false;
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
});
}, },
// 复制卡密 // 复制卡密
...@@ -578,7 +659,7 @@ export default { ...@@ -578,7 +659,7 @@ export default {
// 跳转前判断是否有机构,否则使用定位信息 // 跳转前判断是否有机构,否则使用定位信息
preJumper() { preJumper() {
this.getCardInfoByProvinceId(this.provinceId || ""); this.getCardInfoByProvinceId(this.provinceId || "");
}, },
// 根据省ID,获取学习卡信息 // 根据省ID,获取学习卡信息
...@@ -592,19 +673,25 @@ export default { ...@@ -592,19 +673,25 @@ 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}”,是否用此卡绑定并激活当前课程。学习卡激活码一旦使用,不可更改不可退回`;
} }
}); });
}, },
// 跳转到原生的购买页面
// TODO 没有购买逻辑了,直接跳转到下载页面
confirm() { confirm() {
// 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;
});
}, },
// 首次进入考试时记录(点击‘我知道了’时调用) // 首次进入考试时记录(点击‘我知道了’时调用)
...@@ -623,26 +710,6 @@ export default { ...@@ -623,26 +710,6 @@ export default {
); );
}, },
// token是否失效校验
checkToken() {
let _this = this;
let param = {
token: _this.token,
setEntry: true
};
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
//未登录 跳转登录页
rocNative.gotoLogin();
} else {
// if (!_this.premissionFlag) {
// _this.premissionFlag = true;
// _this.permission(); // 提示是否有机构和在申请范围内
// }
}
});
},
//(判断是否加入机构,是否为认证用户,是否在申请范围内) //(判断是否加入机构,是否为认证用户,是否在申请范围内)
permission() { permission() {
let _this = this; let _this = this;
...@@ -700,9 +767,10 @@ export default { ...@@ -700,9 +767,10 @@ export default {
}, },
//去激活 //去激活
changeClick(msg) { changeClick() {
console.log("in changeClick"); this.commonCheckToken(() => {
this.showChangeCard = true; this.showChangeCard = true;
});
}, },
// 弹框按钮事件 // 弹框按钮事件
...@@ -712,7 +780,7 @@ export default { ...@@ -712,7 +780,7 @@ export default {
scrollFun() { scrollFun() {
//如果是第一次的弹框,则直接退出 //如果是第一次的弹框,则直接退出
if(this.isShowEJDialog) return; if (this.isShowEJDialog) return;
let scrollTop = let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop; document.body.scrollTop || document.documentElement.scrollTop;
let h = intorOffsetTop - 135; let h = intorOffsetTop - 135;
...@@ -799,7 +867,7 @@ export default { ...@@ -799,7 +867,7 @@ export default {
}; };
// let videoUrl = this.$route.query.videoUrl || ''; // let videoUrl = this.$route.query.videoUrl || '';
let videoUrl = this.shareParam.videoUrl; let videoUrl = this.shareParam.videoUrl;
if(videoUrl) { if (videoUrl) {
param.trySeeFlag = 0; param.trySeeFlag = 0;
} else { } else {
param.trySeeFlag = 1; param.trySeeFlag = 1;
...@@ -809,10 +877,10 @@ export default { ...@@ -809,10 +877,10 @@ export default {
if (res.code == "000000") { if (res.code == "000000") {
// 首先使用配置中的参数中的获取视频地址及视频时间 // 首先使用配置中的参数中的获取视频地址及视频时间
setTimeout(() => { setTimeout(() => {
this.downloadTips = ''; this.downloadTips = "";
this.needShort = true; this.needShort = true;
}, 5000); }, 5000);
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.shareParam.limitTimes || 0; _this.videoOptions.trySeeTime = this.shareParam.limitTimes || 0;
...@@ -822,23 +890,25 @@ export default { ...@@ -822,23 +890,25 @@ export default {
_this.videoOptions.trySeeTime = res.data.trySeeTime || 0; _this.videoOptions.trySeeTime = res.data.trySeeTime || 0;
} }
_this.hasBindCard = res.data.cardStatus == 0 ? false : true; _this.hasBindCard = res.data.cardStatus == 0 ? false : true;
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
}); });
}) });
} else { } else {
if (res.data.attachmentType == 2) { if (res.data.attachmentType == 2) {
_this.videoOptions.mp4 = res.data.attachmentUrl; _this.videoOptions.mp4 = res.data.attachmentUrl;
...@@ -848,8 +918,13 @@ export default { ...@@ -848,8 +918,13 @@ export default {
_this.bannerType = res.data.attachmentType; _this.bannerType = res.data.attachmentType;
} }
console.log('location', location); console.log("location", location);
console.log('_this.videoOptions.mp4, trySeeTime, autoplay', _this.videoOptions.mp4, _this.videoOptions.trySeeTime, _this.videoOptions.autoplay); console.log(
"_this.videoOptions.mp4, trySeeTime, autoplay",
_this.videoOptions.mp4,
_this.videoOptions.trySeeTime,
_this.videoOptions.autoplay
);
// 如果绑定了卡,则提示学习下一节 // 如果绑定了卡,则提示学习下一节
_this.project = res.data; _this.project = res.data;
...@@ -930,7 +1005,10 @@ export default { ...@@ -930,7 +1005,10 @@ export default {
() => { () => {
console.log("share success..."); console.log("share success...");
} }
); );
} else {
_this.showLoading = false;
_this.$router.replace("/not-found?fromPage=2");
} }
}); });
}, },
...@@ -1016,7 +1094,6 @@ export default { ...@@ -1016,7 +1094,6 @@ export default {
} }
}, },
// 跳转到考试 // 跳转到考试
gotoExamNew: function() { gotoExamNew: function() {
Toast("请前往APP进行考试"); Toast("请前往APP进行考试");
...@@ -1024,8 +1101,8 @@ export default { ...@@ -1024,8 +1101,8 @@ export default {
// 跳转到课程(H5) // 跳转到课程(H5)
gotoCourseNew: function() { gotoCourseNew: function() {
window.location.href = "" window.location.href = "";
}, }
} }
}; };
</script> </script>
...@@ -1061,7 +1138,7 @@ export default { ...@@ -1061,7 +1138,7 @@ export default {
height: 30px; height: 30px;
} }
} }
.video-box{ .video-box {
position: relative; position: relative;
height: 210px; height: 210px;
} }
...@@ -1103,10 +1180,11 @@ export default { ...@@ -1103,10 +1180,11 @@ export default {
font-weight: 700; font-weight: 700;
border-radius: 20px; border-radius: 20px;
color: #fff; color: #fff;
background: #449284; background: #449284;
&.android { &.android {
padding-top: 2px; padding-top: 2px;
} } }
}
// opacity: ; // opacity: ;
} }
} }
...@@ -1180,7 +1258,7 @@ export default { ...@@ -1180,7 +1258,7 @@ export default {
position: absolute; position: absolute;
z-index: 100; z-index: 100;
top: 0; top: 0;
left: 0; left: 0;
} }
.download-abs { .download-abs {
display: flex; display: flex;
...@@ -1204,9 +1282,9 @@ export default { ...@@ -1204,9 +1282,9 @@ export default {
padding: 0 8px 0 23px; padding: 0 8px 0 23px;
font-size: 12px; font-size: 12px;
font-weight: 700; font-weight: 700;
color: #5BA99B; color: #5ba99b;
background: #fff; background: #fff;
box-shadow:0px 2px 10px 0px rgba(0,0,0,0.1); box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.1);
width: 120px; width: 120px;
&.short { &.short {
width: 10px; width: 10px;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册