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

Merge branch 'dev-coursedetail-0817' of...

Merge branch 'dev-coursedetail-0817' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-professional-exam into dev-coursedetail-0817
...@@ -297,6 +297,7 @@ export default { ...@@ -297,6 +297,7 @@ 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";
this.projectId = this.$route.query.id || 1; this.projectId = this.$route.query.id || 1;
this.generateShareUrl();
console.log('#######location', location); console.log('#######location', location);
window.__getUserInfo64Comp = function(param) { window.__getUserInfo64Comp = function(param) {
...@@ -347,6 +348,24 @@ export default { ...@@ -347,6 +348,24 @@ export default {
methods: { methods: {
...mapActions(["setUserInfo"]), ...mapActions(["setUserInfo"]),
// 生成分享的url
generateShareUrl() {
let _this = this;
let param = {
channel: 1, // 分享渠道 1:APP
info: `${_this.projectId}`,
type: 3 // 业务类型 1:教培项目 2:继教项目 3:职称考项目
};
_this.POST("portal/shareParam/save", param).then(res => {
if (res.code == "000000") {
let url = getWebPageUrl(`profexam/#/sharecoop?uuid=${res.data}`);
_this.shareUrl = url;
}
}).catch( e => {
console.error(e);;
});
},
cancleChangeCard() { cancleChangeCard() {
this.showChangeCard = false; this.showChangeCard = false;
}, },
......
...@@ -23,13 +23,6 @@ ...@@ -23,13 +23,6 @@
<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" />
</div> </div>
<!-- banner视频 --> <!-- banner视频 -->
<!-- <CommonTcPlayer
ref="tcPlayerRef"
v-if="bannerType == 2"
style="flex"
:options="videoOptions"
@sk-tip="isShowSkDialog=true"
></CommonTcPlayer> -->
<div class="video-box" v-if="bannerType == 2"> <div class="video-box" v-if="bannerType == 2">
<pica-video ref="picaVideo" @onVideoEnd="onVideoEnd" @onReplay="onReplay"> <pica-video ref="picaVideo" @onVideoEnd="onVideoEnd" @onReplay="onReplay">
<!-- 试看结束 --> <!-- 试看结束 -->
...@@ -227,7 +220,6 @@ export default { ...@@ -227,7 +220,6 @@ export default {
data() { data() {
return { return {
coverType: 0, coverType: 0,
// token: "9B62E5874DA94979A54DB3E9DFC1443F",
downloadTips: "打开云鹊医APP", downloadTips: "打开云鹊医APP",
isWeb: window.__isWeb, isWeb: window.__isWeb,
isAndroid: __isAndroid, isAndroid: __isAndroid,
...@@ -318,6 +310,7 @@ export default { ...@@ -318,6 +310,7 @@ export default {
isShowFFDialog: false, isShowFFDialog: false,
needShort: false, needShort: false,
showDownloadButton: false, showDownloadButton: false,
uuid: '',
}; };
}, },
components: { components: {
...@@ -350,18 +343,24 @@ export default { ...@@ -350,18 +343,24 @@ export default {
created() { created() {
let _this = this; let _this = this;
this.from = this.$route.query.from || this.from || "native"; this.from = this.$route.query.from || this.from || "native";
this.projectId = this.$route.query.id || 1; let href = location.href;
console.log("#######location", location); let uuidIndex = href.indexOf('uuid') || 0;
if(uuidIndex > 0) {
this.uuid = href.substr(uuidIndex + 5, 32);
} else {
this.uuid = '07F9625472D6444EBAE4BF7D2EF83BC4'
}
if(href.indexOf('singlemessage') >= 0) {
let shareUrl = getWebPageUrl(`profexam/#/sharecoop?uuid=${this.uuid}`);
location.replace(shareUrl);
}
// TODO TOKEN问题,登陆问题
// TODO 要先解码URL
// _this.checkToken();
// _this.setUserInfo(param);
const { token, info } = this.$store.state.user; const { token, info } = this.$store.state.user;
// 如果有token,但没有用户信息,则获取用户信息
if (token && !info.id) { if (token && !info.id) {
this.$store.dispatch('getUserInfo'); this.$store.dispatch('getUserInfo');
} }
_this.getProjectInfoById(); this.queryByUuid(this.uuid);
// 调用广告位接口 // 调用广告位接口
this.getAdvertInfoList(); this.getAdvertInfoList();
...@@ -370,12 +369,24 @@ export default { ...@@ -370,12 +369,24 @@ export default {
window.addEventListener("scroll", this.scrollFun); window.addEventListener("scroll", this.scrollFun);
}, },
beforeDestroyed() { beforeDestroyed() {
this.$refs.tcPlayerRef && this.$refs.tcPlayerRef.pause();
window.removeEventListener("scroll", this.scrollFun); window.removeEventListener("scroll", this.scrollFun);
}, },
methods: { methods: {
...mapActions(["setUserInfo", "goLogin"]), ...mapActions(["setUserInfo", "goLogin"]),
// 解析uuid
queryByUuid(uuid) {
let param = {
uuid: uuid
};
this.GET(`portal/shareParam/queryByUuid`, param).then(res => {
if (res.code == "000000") {
this.projectId = res.data;
this.getProjectInfoById();
console.log('queryByUuid', res);
}
});
},
// 视频播放结束 // 视频播放结束
onVideoEnd(opt) { onVideoEnd(opt) {
if (opt.type === 1) { if (opt.type === 1) {
...@@ -479,8 +490,6 @@ export default { ...@@ -479,8 +490,6 @@ export default {
}); });
}, },
// 跳转到原生的购买页面
// TODO 没有购买逻辑了
confirm() { confirm() {
// this.$sendBuriedData({ // this.$sendBuriedData({
// component_tag: `882#88203` // component_tag: `882#88203`
...@@ -658,11 +667,14 @@ export default { ...@@ -658,11 +667,14 @@ export default {
// 判断是否是mp4 // 判断是否是mp4
if (mp4Url.lastIndexOf(".mp4") > 0) { if (mp4Url.lastIndexOf(".mp4") > 0) {
_this.bannerType = 2; _this.bannerType = 2;
_this.$refs.picaVideo.switchUrl({ this.$nextTick( () => {
url: mp4Url, console.log('_this.$refs.picaVideo', _this.$refs.picaVideo);
proved: _this.videoOptions.trySeeTime, _this.$refs.picaVideo.switchUrl({
enable: true, url: mp4Url,
}); proved: _this.videoOptions.trySeeTime,
enable: true,
});
})
// // TODO test // // TODO test
// _this.videoOptions.mp4 += 2; // _this.videoOptions.mp4 += 2;
} else { } else {
...@@ -747,7 +759,8 @@ export default { ...@@ -747,7 +759,8 @@ 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}`);
this.wechatShare( this.wechatShare(
{ {
link: shareUrl, link: shareUrl,
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册