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

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

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

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

See merge request !17
......@@ -9,7 +9,7 @@
<van-collapse-item
v-for="(portalModule, index) in component.portalModuleDTOS"
:key="index"
:title="(parseInt(index) + 1) + '.' + portalModule.moduleName | shortName(19)"
:title="portalModule.moduleName | shortName(19)"
:name="portalModule.expandKey"
:value="portalModule.value"
:disabled="portalModule.disabled"
......@@ -142,6 +142,10 @@ export default {
projectId: {
type: Number | String,
default: 0
},
goodsId: {
type: Number | String,
default: 0,
}
},
components: {
......@@ -172,7 +176,19 @@ export default {
component_tag: `883#88316#${item.id}#${item.name}`
});
}
// 在浏览器中
if(!isWeiXin()) {
// 没有绑定则提示去购买/激活
if(!this.hasBindCard) {
if(item.type == 1) {
Toast('激活/购买后可参加考试');
} else if(item.type == 2){
Toast('激活/购买后可学习完整课程');
}
return;
// 已经绑定则前往云鹊医APP
} else {
if(item.type == 1) {
Toast('请前往云鹊医APP参加考试');
} else if(item.type == 2){
......@@ -180,6 +196,8 @@ export default {
}
return;
}
}
if(!this.logged) {
if(item.type == 1) {
Toast('请前往云鹊医APP参加考试');
......@@ -234,7 +252,7 @@ export default {
Toast('请前往云鹊医APP学习课程');
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;
},
......
......@@ -11,7 +11,7 @@
<van-collapse-item
v-for="(portalModule, index) in component.portalModuleDTOS"
:key="index"
:title="(parseInt(index) + 1) + '.' + portalModule.moduleName | shortName(19)"
:title="portalModule.moduleName | shortName(19)"
:name="portalModule.expandKey"
:value="portalModule.value"
:disabled="portalModule.disabled"
......
......@@ -87,9 +87,12 @@ export default {
margin-left: 1px;
margin-right: 4px;
}
& > span {
font-size: 12px;
color: #979899;
}
}
}
.right {
display: flex;
flex-direction: row;
......
......@@ -2,8 +2,8 @@
<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">
<span class="discount">{{(cardInfo.couponPrice || cardInfo.preferentialPrice || cardInfo.costPrice) | formatMoney}}</span>
<span v-show="cardInfo.couponPrice || cardInfo.preferentialPrice" class="price">
<del>原价¥{{cardInfo.costPrice | formatMoney}}</del>
</span>
</div>
......@@ -31,9 +31,15 @@ export default {
},
methods: {
changeClick(){
this.$sendBuriedData({
component_tag: `883#88324`
});
this.$emit("changeClick")
},
gotoBuy() {
this.$sendBuriedData({
component_tag: `883#88323`
});
this.$emit("gotoBuy");
}
}
......@@ -84,9 +90,12 @@ export default {
margin-left: 1px;
margin-right: 4px;
}
& > span {
font-size: 12px;
color: #979899;
}
}
}
.right {
display: flex;
flex-direction: row;
......@@ -97,23 +106,22 @@ export default {
justify-content: center;
width: 80px;
font-size: 14px;
font-weight: 400;
font-weight: 700;
text-align: center;
color: #7f7f7f;
border: 1px solid #d2b573;
&.left {
border-radius: 20px 0px 0px 20px;
border: 1px solid rgba(255, 122, 75, 1);
border-right-style: none;
// color: #ff7a4b;
color: #ff7a4b;
}
&.right {
// background: linear-gradient(
// 137deg,
// rgba(255, 166, 95, 1) 0%,
// rgba(255, 122, 75, 1) 100%
// );
background: linear-gradient(
137deg,
rgba(255, 166, 95, 1) 0%,
rgba(255, 122, 75, 1) 100%
);
border-radius: 0px 20px 20px 0px;
// color: #fff;
color: #fff;
}
}
}
......
......@@ -86,6 +86,9 @@ export default {
this.$emit("cancle");
},
confirm() {
this.$sendBuriedData({
component_tag: `883#88325`
});
if(!this.activationCode) {
this.errorMsg = '请输入激活码';
return;
......
......@@ -44,8 +44,14 @@ export default {
toggle() {
this.isUp = !this.isUp;
if (this.isUp) {
this.$sendBuriedData({
component_tag: `883#88322`
});
this.current = this.one;
} else {
this.$sendBuriedData({
component_tag: `883#88321`
});
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 @@
<slot></slot>
<!-- 试看提示 -->
<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 class="replay-box" v-show="showReplay" @click="onReplay">重新播放</div>
......
......@@ -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 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 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 [{
path: '/',
......@@ -68,7 +70,13 @@ export default [{
path: '/icredit-detail',
component: icreditdetail
},
{
path: '/not-found',
component: notFound
},
{
path: '/goods-detail',
component: goodsDetail
},
]
}]
......@@ -14,7 +14,7 @@ const user = {
SET_TOKEN: (state, payload) => {
state.token = payload;
},
SET_USER_INFO: (state, payload) => {
SET_USER_INFO_2: (state, payload) => {
state.info = payload;
},
},
......@@ -55,7 +55,7 @@ const user = {
// avatarUrl = img2.src;
// }
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 {
errCallBack()
......@@ -73,7 +73,7 @@ const user = {
// 登出
logout({ state, commit }) {
commit('SET_TOKEN', '');
commit('SET_USER_INFO', {});
commit('SET_USER_INFO_2', {});
localStorage.removeItem('token');
delCookie('token')
},
......
......@@ -13,9 +13,9 @@ const service = axios.create({
service.interceptors.request.use(config => {
if (config.data && config.data.setEntry) {
config.headers['sysCode'] = config.data.sysCode || 10
if(config.data.token){
if (config.data.token) {
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';
}
delete config.data.setEntry;
......
......@@ -207,5 +207,19 @@ module.exports = {
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
......@@ -179,6 +179,14 @@
@handlerAction="goBack"
/>
<CourseDialog
:subContent="subContent"
confirmBtnText="激活并去学习"
needSubContent
:isShowDialog="showBindCardTips"
@handlerAction="handlerActionTips"
></CourseDialog>
</div>
</template>
<script>
......@@ -199,6 +207,7 @@ import ItemIntro from "@/components/cme/item-intro";
import ItemLeader from "@/components/cme/item-leader";
import TeacterIntro from "@/components/cme/teacter-intro";
import CommonDialog from "@/components/cme/common-dialog";
import CourseDialog from "@/components/course/course-dialog";
import ExjumperDialog from "@/components/cme/exjumper-dialog";
import ExjumperButton from "@/components/cme/exjumper-button";
import NoMoreContent from "@/components/business/no-more-content";
......@@ -324,6 +333,14 @@ export default {
isShowSkDialog: false,
isShowIOSDownloadDialog: false,
shareUrl: location.href,
showBindCardTips: false,
cmeCardModels: {
cardNo: "",
cardKey: "",
cardType: 2,
orderId: 0
},
subContent: ``,
};
},
components: {
......@@ -340,6 +357,7 @@ export default {
ItemLeader,
TeacterIntro,
CommonDialog,
CourseDialog,
ExjumperButton,
ExjumperDialog,
// CardPopup,
......@@ -426,8 +444,37 @@ export default {
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绑定成功
changeCardAction(cardKey) {
changeCardAction(cardKey, isInTips) {
let _this = this;
let param = {
cardKey: cardKey,
......@@ -437,9 +484,14 @@ export default {
};
_this.changeCardErrorMsg = "";
this.POST("cme/projectCard/bind", param).then(res => {
isInTips && (_this.showBindCardTips = false);
if (res.code == "000000") {
if(res.data == 0) {
if(!res.data) {
if(isInTips) {
Toast(res.message);
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
} else {
_this.$refs.tcPlayerRef && _this.$refs.tcPlayerRef.pause();
_this.showChangeCard = false;
......@@ -449,7 +501,12 @@ export default {
} else {
}
}).catch( e => {
if(isInTips) {
Toast("无效的激活码");
_this.showBindCardTips = false;
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
});
},
......@@ -618,7 +675,8 @@ export default {
if (res.code == "000000") {
this.showLoading = false;
// 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,6 +1001,8 @@ export default {
if(this.hasBindCard) {
_this.videoOptions.trySeeTime = 300000;
_this.videoOptions.autoplay = false;
} else {
_this.hasNoUsedCard();
}
let mp4Url = _this.videoOptions.mp4;
// 判断是否是mp4
......
<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>
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册