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
4613f5fe
Commit
4613f5fe
authored
Aug 25, 2023
by
zeyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化视频统计
parent
89f44337
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
37 deletions
+37
-37
myPackageA/videoProject/login.vue
+3
-3
myPackageA/videoProject/videoDetail.vue
+31
-31
myPackageA/videoProject/wxLogin.vue
+3
-3
No files found.
myPackageA/videoProject/login.vue
View file @
4613f5fe
...
@@ -129,7 +129,7 @@
...
@@ -129,7 +129,7 @@
api
.
loginVerification
({
"loginType"
:
3
,
"mobile"
:
mobile
.
value
,
"code"
:
code
.
value
,
"password"
:
null
,
"loginSystem"
:
"1"
}).
then
((
res
)
=>
{
api
.
loginVerification
({
"loginType"
:
3
,
"mobile"
:
mobile
.
value
,
"code"
:
code
.
value
,
"password"
:
null
,
"loginSystem"
:
"1"
}).
then
((
res
)
=>
{
if
(
res
[
'success'
])
{
if
(
res
[
'success'
])
{
uni
.
setStorageSync
(
'
cffp
_userId'
,
String
(
res
[
'data'
][
'userId'
]));
uni
.
setStorageSync
(
'
video
_userId'
,
String
(
res
[
'data'
][
'userId'
]));
uni
.
setStorageSync
(
'uni-token'
,
res
[
'data'
][
'token'
]);
uni
.
setStorageSync
(
'uni-token'
,
res
[
'data'
][
'token'
]);
uni
.
setStorageSync
(
'isLogin'
,
'1'
);
uni
.
setStorageSync
(
'isLogin'
,
'1'
);
uni
.
setStorageSync
(
'loginType'
,
'codelogin'
);
uni
.
setStorageSync
(
'loginType'
,
'codelogin'
);
...
@@ -162,14 +162,14 @@
...
@@ -162,14 +162,14 @@
})
})
}
}
const
next
=
()
=>
{
const
next
=
()
=>
{
uni
.
navigate
To
({
uni
.
redirect
To
({
url
:
'/myPackageA/videoProject/videoDetail?videoId='
+
videoId
.
value
url
:
'/myPackageA/videoProject/videoDetail?videoId='
+
videoId
.
value
})
})
};
};
onLoad
(
option
=>
{
onLoad
(
option
=>
{
videoId
.
value
=
option
.
videoId
??
null
;
videoId
.
value
=
option
.
videoId
??
null
;
if
(
uni
.
getStorageSync
(
'
cffp
_userId'
))
{
if
(
uni
.
getStorageSync
(
'
video
_userId'
))
{
next
();
next
();
}
}
})
})
...
...
myPackageA/videoProject/videoDetail.vue
View file @
4613f5fe
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<view
class=
"content"
>
<view
class=
"content"
>
<view
class=
"video"
>
<view
class=
"video"
>
<video
id=
"myVideo"
:src=
"courseInfo.filePathOss"
:poster=
"courseInfo.fileFirstImage"
object-fit=
"contain"
<video
id=
"myVideo"
:src=
"courseInfo.filePathOss"
:poster=
"courseInfo.fileFirstImage"
object-fit=
"contain"
:title=
"courseInfo.fileTitle"
style=
"width: 100vw;height:
500
rpx;"
:initial-time=
"viewTime"
:title=
"courseInfo.fileTitle"
style=
"width: 100vw;height:
312.5
rpx;"
:initial-time=
"viewTime"
@
timeupdate=
"timeupdate"
@
play=
"playVideo"
@
pause=
"pause"
></video>
@
timeupdate=
"timeupdate"
@
play=
"playVideo"
@
pause=
"pause"
></video>
</view>
</view>
<scroll-view
id=
"scrollView"
scroll-y=
"true"
:style=
"
{height:scrollViewHeight+'px'}"
<scroll-view
id=
"scrollView"
scroll-y=
"true"
:style=
"
{height:scrollViewHeight+'px'}"
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
相关视频
相关视频
</view>
</view>
</view>
</view>
<view
class=
"relatedVideoList"
>
<view
class=
"relatedVideoList"
v-if=
"relatedCourseList.length>0"
>
<view
class=
"relatedVideoItem"
v-for=
"item in relatedCourseList"
@
click=
"play(item)"
>
<view
class=
"relatedVideoItem"
v-for=
"item in relatedCourseList"
@
click=
"play(item)"
>
<view
style=
"width: 46.5vw;"
>
<view
style=
"width: 46.5vw;"
>
<image
style=
"height: 46.5vw;border-radius: 16rpx;"
:src=
"item.displayImage"
<image
style=
"height: 46.5vw;border-radius: 16rpx;"
:src=
"item.displayImage"
...
@@ -55,6 +55,10 @@
...
@@ -55,6 +55,10 @@
</view>
</view>
</view>
</view>
</view>
</view>
<view
v-else
style=
"text-align: center;font-weight: 600;font-size: 42rpx;margin-top:50rpx;color: #8c8c8c;"
>
暂无相关视频
</view>
<!--
<uni-load-more
iconType=
"circle"
:status=
"moreStatus"
></uni-load-more>
-->
<!--
<uni-load-more
iconType=
"circle"
:status=
"moreStatus"
></uni-load-more>
-->
</view>
</view>
</scroll-view>
</scroll-view>
...
@@ -64,7 +68,7 @@
...
@@ -64,7 +68,7 @@
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
onMounted
}
from
"vue"
;
import
{
ref
}
from
"vue"
;
import
api
from
"@/api/api"
;
import
api
from
"@/api/api"
;
import
{
cffpURL
}
from
"@/environments/environment"
;
import
{
cffpURL
}
from
"@/environments/environment"
;
import
common
from
'../../common/common'
;
import
common
from
'../../common/common'
;
...
@@ -126,8 +130,9 @@
...
@@ -126,8 +130,9 @@
// 相关列表点击播放
// 相关列表点击播放
const
play
=
async
item
=>
{
const
play
=
async
item
=>
{
videoContext
.
value
.
pause
();
if
(
videoId
.
value
!=
item
.
fileId
)
{
if
(
videoId
.
value
!=
item
.
fileId
)
{
videoContext
.
value
.
pause
();
// 当点击的课程和当前播放的课程不一致时,执行此方法
// 当点击的课程和当前播放的课程不一致时,执行此方法
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'加载中'
title
:
'加载中'
...
@@ -140,6 +145,11 @@
...
@@ -140,6 +145,11 @@
if
(
isPauseFlag
)
{
if
(
isPauseFlag
)
{
pause
();
pause
();
}
}
}
else
{
uni
.
showToast
({
title
:
'当前播放已是此视频'
,
icon
:
'none'
})
}
}
}
}
...
@@ -309,34 +319,37 @@
...
@@ -309,34 +319,37 @@
})
})
}
}
onLoad
(
option
=>
{
onLoad
(
option
=>
{
console
.
log
(
2
);
//视频Id
//视频Id
if
(
option
.
videoId
)
{
if
(
option
.
videoId
&&
option
.
videoId
!=
'null'
)
{
uni
.
setStorageSync
(
'cffp_videoId'
,
option
.
videoId
);
uni
.
setStorageSync
(
'cffp_videoId'
,
option
.
videoId
);
videoId
.
value
=
option
.
videoId
;
videoId
.
value
=
option
.
videoId
;
}
else
{
}
else
{
videoId
.
value
=
uni
.
getStorageSync
(
'cffp_videoId'
);
videoId
.
value
=
uni
.
getStorageSync
(
'cffp_videoId'
);
}
}
//用户Id
//用户Id
userId
.
value
=
uni
.
getStorageSync
(
'cffp_userId'
);
userId
.
value
=
uni
.
getStorageSync
(
'video_userId'
);
if
(
!
userId
.
value
)
{
})
onReady
(()
=>
{
videoContext
.
value
=
uni
.
createVideoContext
(
'myVideo'
);
//窗口高度
windowHeight
.
value
=
uni
.
getSystemInfoSync
().
windowHeight
;
//元素距离顶部距离
uni
.
createSelectorQuery
().
select
(
'#scrollView'
).
boundingClientRect
(
data
=>
{
scrollViewHeight
.
value
=
windowHeight
.
value
-
data
[
'top'
];
}).
exec
();
if
(
!
userId
.
value
||
!
videoId
.
value
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'登录过期,请重新登录'
title
:
'登录过期,请重新登录'
,
icon
:
'none'
});
});
uni
.
reLaunch
({
uni
.
reLaunch
({
url
:
'/myPackageA/videoProject/login?videoId='
+
videoId
.
value
url
:
'/myPackageA/videoProject/login?videoId='
+
videoId
.
value
});
});
return
;
return
;
}
else
{
accessLogSave
();
loadCourseDetail
();
}
}
accessLogSave
();
loadCourseDetail
();
})
onReady
(()
=>
{
})
})
onUnload
(()
=>
{
onUnload
(()
=>
{
if
(
viewTime
.
value
!=
0
)
{
if
(
viewTime
.
value
!=
0
)
{
...
@@ -347,19 +360,6 @@
...
@@ -347,19 +360,6 @@
}
}
}
}
})
})
onMounted
(()
=>
{
userId
.
value
=
uni
.
getStorageSync
(
'cffp_userId'
);
if
(
userId
.
value
)
{
videoContext
.
value
=
uni
.
createVideoContext
(
'myVideo'
);
//窗口高度
windowHeight
.
value
=
uni
.
getSystemInfoSync
().
windowHeight
;
//元素距离顶部距离
uni
.
createSelectorQuery
().
select
(
'#scrollView'
).
boundingClientRect
(
data
=>
{
scrollViewHeight
.
value
=
windowHeight
.
value
-
data
[
'top'
];
}).
exec
();
}
})
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
...
myPackageA/videoProject/wxLogin.vue
View file @
4613f5fe
...
@@ -14,11 +14,11 @@
...
@@ -14,11 +14,11 @@
}
}
api
.
wxLogin
(
param
).
then
((
res
)
=>
{
api
.
wxLogin
(
param
).
then
((
res
)
=>
{
if
(
res
[
'success'
])
{
if
(
res
[
'success'
])
{
uni
.
setStorageSync
(
'
cffp
_userId'
,
String
(
res
[
'data'
][
'userId'
]));
uni
.
setStorageSync
(
'
video
_userId'
,
String
(
res
[
'data'
][
'userId'
]));
uni
.
setStorageSync
(
'uni-token'
,
res
[
'data'
][
'token'
]);
uni
.
setStorageSync
(
'uni-token'
,
res
[
'data'
][
'token'
]);
uni
.
setStorageSync
(
'isLogin'
,
'1'
);
uni
.
setStorageSync
(
'isLogin'
,
'1'
);
uni
.
setStorageSync
(
'loginType'
,
'codelogin'
);
uni
.
setStorageSync
(
'loginType'
,
'codelogin'
);
uni
.
navigate
To
({
uni
.
redirect
To
({
url
:
'/myPackageA/videoProject/videoDetail?videoId='
+
option
.
fileId
url
:
'/myPackageA/videoProject/videoDetail?videoId='
+
option
.
fileId
})
})
}
else
{
}
else
{
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
duration
:
2000
,
duration
:
2000
,
icon
:
'none'
icon
:
'none'
})
})
uni
.
navigate
To
({
uni
.
redirect
To
({
url
:
'/myPackageA/videoProject/login?videoId='
+
option
.
fileId
url
:
'/myPackageA/videoProject/login?videoId='
+
option
.
fileId
})
})
}
}
...
...
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