提交 d0919bec 编写于 作者: guofeng.chen's avatar guofeng.chen

Merge branch 'dev-purchase-0901' of...

Merge branch 'dev-purchase-0901' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-professional-exam into dev-purchase-0901
<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>
<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 class="teacter-intro-container">
<div class="basic-title">讲师介绍</div>
<div class="leader-info" v-for="(item,index) in current" :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 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>
<script>
export default {
props: {
doctorList: {
type: Array,
default: () => []
}
},
data() {
return {
}
},
created() {
},
mounted() {
},
methods: {
props: {
doctorList: {
type: Array,
default: () => []
}
}
},
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;
} else {
this.current = this.all;
}
}
}
};
</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;
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-info {
.leader-text {
flex: 1;
width: 100px;
margin-left: 16px;
margin-top: 6px;
.leader-con {
line-height: 14px;
display: flex;
flex-direction: row;
margin-top: 16px;
padding-bottom: 16px;
img {
display: inline-block;
width: 44px;
height: 44px;
border-radius: 50%;
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-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;
}
.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;
}
}
}
.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
......@@ -7,6 +7,7 @@ const test = r => require.ensure([], () => r(require('../views/test-components')
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 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 [{
path: '/',
......@@ -48,5 +49,9 @@ export default [{
path: '/goods-detail',
component: goodsDetail
},
{
path: '/prezult',
component: purchaseRezult
},
]
}]
......@@ -212,7 +212,23 @@ module.exports = {
return null
},
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()
}
});
}
}
}
......@@ -528,8 +528,7 @@ export default {
return;
}
// let pageUrl = this.project.examBtnUrl;
// 直接传入项目ID(projectId)
// 直接传入职称考项目ID(projectId)
let projectId = this.project.projectId;
let pageUrl = getWebPageUrl(
`/profexam/#/index?id=${projectId}&projectName=${this.project.projectName}&profexamProjectId=${projectId}`
......
<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 @handlerClick="gotoProject"></Button>
<Button v-show="showGoApp && projectId" :isPlain="!!projectId" buttonText="去云鹊医APP" @handlerClick="download"></Button>
<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 Button from "@/components/business/button"
import { win32 } from 'path'
let intervalId = null;
export default {
components: {
Button
},
data() {
return {
projectId: 1,
orderId: '1595497912391728990',
htmlTitle: "支付结果",
isCorrect: true,
msgContent: "此项目已被其他学习卡绑定,您可以去绑定新的项目,或去云鹊医APP查看订单详情",
loading: true,
loadingTimes: 3,
// 返回值data:0:订单进行中 1:支付并绑定成功 2:订单反馈延时,请稍后再试 3:支付失败,请重新购买 4:订单已被取消,请重新购买
bindStatus: 0,
showGoApp: false,
}
},
created() {
let { projectId, orderId, returnUrl } = this.$route.query;
this.projectId = projectId || 0;
this.orderId = orderId || 0;
this.returnUrl = returnUrl;
// 直接从商品过来的
// if(!this.projectId) {
// this.msgContent = "购买成功";
// }
// 等待
intervalId = setInterval( () => {
if(this.loadingTimes <= 0) {
intervalId && clearInterval(intervalId);
this.loading = false;
// 从项目购买过来的
if(this.projectId) {
this.getBindCardStatus();
// 直接从商品过来的
} else {
this.getStatusByOrderId();
}
} else {
this.loadingTimes -= 1;
}
}, 1000)
},
mounted() {
document.title = this.htmlTitle;
},
methods: {
// 查询一次绑卡状态
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.bindStatus = data;
// 绑定成功
if( data == 1 ) {
} else {
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.msgContent = "购买失败";
this.isCorrect = false;
// 订单状态: 订单状态:1待支付, 2支付中, 3支付失败, 4订单超时, 5支付成功, 6交易完成, 7交易关闭
if( data.orderDto.status == 6 ) {
this.msgContent = "购买成功";
this.isCorrect = true;
} else {
}
}).catch( e => {
console.log("getStatusByOrderId", "调用失败...");
});
},
// 返回到项目详情页面
gotoProject() {
// let shareUrl = getWebPageUrl(`profexam/#/sharecoop?uuid=${getCookie('uuid')}`);
this.returnUrl && location.replace(this.returnUrl);
},
// 下载
download() {
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: 12px;
}
}
}
}
</style>
\ No newline at end of file
......@@ -132,7 +132,7 @@
:changeErrorMsg="changeCardErrorMsg"
:isShow="showChangeCard"
@cancle="cancleChangeCard"
@confirm="changeCardAction"
@confirm="beforeChangeCardAction"
></ChangeCard>
<Loading v-show="showLoading" />
<div>
......@@ -200,7 +200,7 @@ import ExjumperButton from "@/components/cme/exjumper-button";
import NoMoreContent from "@/components/business/no-more-content";
// 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 vueFilters from "@/utils/filter";
import { Toast } from "vant";
......@@ -210,7 +210,6 @@ import ChangeCard from "@/components/cme/change-card";
import CourseCovers from "@/components/course/course-covers";
import DownloadButton from "@/components/course/download-button";
import PicaVideo from '@/components/course/pica-video';
import { getCookie } from '@/utils/index';
let cataOffsetTop = 0;
let intorOffsetTop = 0;
......@@ -311,7 +310,8 @@ export default {
needShort: false,
showDownloadButton: false,
uuid: '',
token: ''
token: '',
shareUrl: '',
};
},
components: {
......@@ -351,9 +351,10 @@ export default {
} else {
this.uuid = '07F9625472D6444EBAE4BF7D2EF83BC4'
}
this.shareUrl = location.href;
if(href.indexOf('singlemessage') >= 0 || href.indexOf('wx_code') >= 0) {
let shareUrl = getWebPageUrl(`profexam/#/sharecoop?uuid=${this.uuid}`);
location.replace(shareUrl);
this.shareUrl = getWebPageUrl(`profexam/#/sharecoop?uuid=${this.uuid}`);
location.replace(this.shareUrl);
}
const { token, info } = this.$store.state.user;
......@@ -392,7 +393,7 @@ export default {
this.GET(`portal/shareParam/queryByUuid`, param).then(res => {
if (res.code == "000000") {
this.shareParam = JSON.parse(res.data || "{}");
this.projectId = this.shareParam.projectId || 797; // 797
this.projectId = this.shareParam.projectId || 812; // 797 812
this.getProjectInfoById();
console.log('queryByUuid', res);
}
......@@ -445,12 +446,20 @@ export default {
this.showChangeCard = false;
},
// 激活 返回值:0绑定失败,1绑定成功
// 激活前
beforeChangeCardAction(cardKey) {
this.commonCheckToken( () => {
this.changeCardAction(cardKey);
})
},
// 激活Action 返回值:0绑定失败,1绑定成功
changeCardAction(cardKey) {
let _this = this;
let param = {
cardKey: cardKey,
cardType: 3,
channel: 3,
portalProjectId: this.projectId,
setEntry: true
};
......@@ -526,9 +535,10 @@ export default {
// this.$sendBuriedData({
// component_tag: `882#88203`
// });
let jumpUrl = getWebPageUrl(`profexam/#/goods-detail?goodsId=${this.goodsId}&token=${this.token}`);
window.location.href = jumpUrl;
// "https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
this.commonCheckToken( () => {
let jumpUrl = getWebPageUrl(`profexam/#/goods-detail?goodsId=${this.cardInfo.id}&projectId=${this.projectId}&returnUrl=${encodeURIComponent(this.shareUrl)}`);
window.location.href = jumpUrl;
})
},
// 首次进入考试时记录(点击‘我知道了’时调用)
......@@ -547,14 +557,12 @@ export default {
);
},
//去激活
changeClick(msg) {
console.log("in changeClick");
this.showChangeCard = true;
// this.$sendBuriedData({
// component_tag: `882#88202`
// });
//去激活
changeClick() {
this.commonCheckToken( () => {
this.showChangeCard = true;
})
},
scrollFun() {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册