Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
fc98f0c7
Commit
fc98f0c7
authored
Jan 17, 2023
by
sunchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课程列表分享统计接口
parent
eb30f599
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
6 deletions
+31
-6
main.js
+4
-2
pages/courseDetail/courseDetail.vue
+27
-0
util/fiveshare.ts
+0
-4
No files found.
main.js
View file @
fc98f0c7
...
@@ -19,4 +19,6 @@ export function createApp() {
...
@@ -19,4 +19,6 @@ export function createApp() {
}
}
// #endif
// #endif
window
.
sessionStorage
.
setItem
(
'firstEntryUrl'
,
window
.
location
.
href
.
split
(
'#'
)[
0
])
//#ifdef H5
\ No newline at end of file
window
.
sessionStorage
.
setItem
(
'firstEntryUrl'
,
window
.
location
.
href
.
split
(
'#'
)[
0
])
// #endif
\ No newline at end of file
pages/courseDetail/courseDetail.vue
View file @
fc98f0c7
...
@@ -308,6 +308,7 @@
...
@@ -308,6 +308,7 @@
//#ifdef H5
//#ifdef H5
this
.
shareTipsFlag
=
true
;
this
.
shareTipsFlag
=
true
;
this
.
getshareData2
(
shareCode
,
jumptime
)
this
.
getshareData2
(
shareCode
,
jumptime
)
// #endif
// #endif
},
},
shareToggle
()
{
shareToggle
()
{
...
@@ -635,6 +636,7 @@
...
@@ -635,6 +636,7 @@
}
}
// let url = window.location.href.split('#')[0]
// let url = window.location.href.split('#')[0]
hshare
(
data
,
url
)
hshare
(
data
,
url
)
this
.
submitsuessc
(
shareCode
,
jumptime
)
},
},
// H5 自定义分享
// H5 自定义分享
getshareData
()
{
getshareData
()
{
...
@@ -685,6 +687,31 @@
...
@@ -685,6 +687,31 @@
})
})
},
},
submitsuessc
(
shareCode
,
jumptime
){
let
platform
=
uni
.
getSystemInfoSync
().
platform
let
UserShareRequestVO
=
{
systemType
:
platform
==
'ios'
?
'1'
:
'0'
,
userId
:
uni
.
getStorageSync
(
'cffp_userId'
),
businessType
:
'1'
,
// 分享类型
businessId
:
this
.
fileId
,
// 课程Id
shareUrl
:
"https://"
+
window
.
location
.
host
+
"/cffp/pages/courseDetail/courseDetail?fileId="
+
this
.
fileId
+
'&coursesharing=1'
+
'&serialsNo='
+
nanoid
()
+
'&shareCode='
+
shareCode
+
'&shareUserId='
+
this
.
userId
+
'&jumpUrl='
+
jumptime
+
"&"
,
// 分享链接
shareType
:
'2'
,
// 分享类型(1:图片分享; 2:链接分享)
shareToWhere
:
3
,
//分享到哪儿(1好友 2朋友圈)
shareCode
:
shareCode
}
api
.
userShare
(
UserShareRequestVO
).
then
(
res
=>
{
console
.
log
(
res
,
1251
)
// console.log('分享成功了吗')
if
(
res
[
'success'
])
{
// uni.showToast({
// title: '分享成功',
// duration: 2000
// });
}
})
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
this
.
fileId
=
option
.
fileId
;
this
.
fileId
=
option
.
fileId
;
...
...
util/fiveshare.ts
View file @
fc98f0c7
...
@@ -35,13 +35,9 @@ export function initJssdkShare(callback, url) {
...
@@ -35,13 +35,9 @@ export function initJssdkShare(callback, url) {
}
}
// data是穿的参数 url是当前页面的链接
// data是穿的参数 url是当前页面的链接
export
function
hshare
(
data
,
url
){
export
function
hshare
(
data
,
url
){
console
.
log
(
data
)
// initJssdkShare(data, url)
// initJssdkShare(data, url)
initJssdkShare
(
function
(){
initJssdkShare
(
function
(){
console
.
log
(
1
)
jWeixin
.
ready
(
function
(){
jWeixin
.
ready
(
function
(){
console
.
log
(
2
)
var
sharedata
=
{
var
sharedata
=
{
title
:
data
.
title
,
//标题
title
:
data
.
title
,
//标题
desc
:
data
.
desc
,
//描述
desc
:
data
.
desc
,
//描述
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment