Commit eb30f599 by sunchao

课程分享链接修改

parent 243bf075
......@@ -16,7 +16,7 @@
<script src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- 移动端调试 -->
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>
<!-- <script>eruda.init();</script> -->
</head>
<body>
<div id="app">
......
......@@ -288,10 +288,10 @@
},
// 打开微信分享啊
reinvite() {
//app分享
// #ifdef APP-PLUS
const shareCode = nanoid() + this.userId
const jumptime = Date.parse(new Date()) / 1000
//app分享
// #ifdef APP-PLUS
let dataWXform = {
href: "https://" + window.location.host + "/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode + '&shareUserId=' +
......@@ -307,7 +307,7 @@
//#ifdef H5
this.shareTipsFlag = true;
this.getshareData()
this.getshareData2(shareCode,jumptime)
// #endif
},
shareToggle() {
......@@ -612,6 +612,30 @@
}
})
},
getshareData2(shareCode,jumptime) {
let data = {
title: this.courseInfo.fileTitle,
desc: '加入我们开启学习之旅',
link:"https://" + window.location.host + "/cffp/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode + '&shareUserId=' +
this.userId + '&jumpUrl=' + jumptime + "&", //分享链接
imgUrl: this.courseInfo.displayImage, //图片
}
//安卓机型获取当前页面路径
let url = window.location.href.split('#')[0];
//ios机型获取当前页面路径
let ua = navigator.userAgent.toLowerCase();
let isWeixin = ua.indexOf('micromessenger') !== -1;
if (isWeixin) {
let isiOS = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent); //ios终端
if (isiOS && window.sessionStorage.getItem('firstEntryUrl')) {
url = window.sessionStorage.getItem('firstEntryUrl').split('#')[0];
}
}
// let url = window.location.href.split('#')[0]
hshare(data, url)
},
// H5 自定义分享
getshareData() {
let data = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment