Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
dfb37eb4
Commit
dfb37eb4
authored
Oct 27, 2016
by
xiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改支付后的弹窗问题
parent
46d46201
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
38 deletions
+78
-38
HomeController.php
src/frontend/controllers/HomeController.php
+4
-2
video-play.vue
src/frontend/web/js/home/components/video-play.vue
+21
-2
video.vue
src/frontend/web/js/home/components/video.vue
+53
-34
No files found.
src/frontend/controllers/HomeController.php
View file @
dfb37eb4
...
@@ -143,6 +143,7 @@ class HomeController extends \yii\web\Controller
...
@@ -143,6 +143,7 @@ class HomeController extends \yii\web\Controller
$coursewareInfo
[
'isSupport'
]
=
(
Support
::
findByUserIdAndCoursewareId
(
$userId
,
$coursewareInfo
[
'id'
])
===
NULL
?
FALSE
:
TRUE
);
$coursewareInfo
[
'isSupport'
]
=
(
Support
::
findByUserIdAndCoursewareId
(
$userId
,
$coursewareInfo
[
'id'
])
===
NULL
?
FALSE
:
TRUE
);
$coursewareInfo
[
'isFavorite'
]
=
(
Favorite
::
findByUserIdAndCoursewareId
(
$userId
,
$coursewareInfo
[
'id'
])
===
NULL
?
FALSE
:
TRUE
);
$coursewareInfo
[
'isFavorite'
]
=
(
Favorite
::
findByUserIdAndCoursewareId
(
$userId
,
$coursewareInfo
[
'id'
])
===
NULL
?
FALSE
:
TRUE
);
$coursewareInfo
[
'isShop'
]
=
FALSE
;
$coursewareInfo
[
'isShop'
]
=
FALSE
;
//已登录
if
(
!
Yii
::
$app
->
user
->
isGuest
)
{
if
(
!
Yii
::
$app
->
user
->
isGuest
)
{
$coursewareInfo
[
'userAvatar'
]
=
User
::
getAvatarUrl
(
Yii
::
$app
->
user
->
identity
->
avatar
);
$coursewareInfo
[
'userAvatar'
]
=
User
::
getAvatarUrl
(
Yii
::
$app
->
user
->
identity
->
avatar
);
$order
=
Orders
::
findByUserIdAndCourseId
(
$userId
,
$courseId
);
$order
=
Orders
::
findByUserIdAndCourseId
(
$userId
,
$courseId
);
...
@@ -150,15 +151,16 @@ class HomeController extends \yii\web\Controller
...
@@ -150,15 +151,16 @@ class HomeController extends \yii\web\Controller
}
}
if
(
$coursewareInfo
[
'isShop'
])
{
if
(
$coursewareInfo
[
'isShop'
])
{
$coursewareInfo
[
'videoUrl'
]
=
Yii
::
$app
->
qiniu
->
getUrl
(
'video'
,
$coursewareInfo
[
'src_stand'
]);
$coursewareInfo
[
'videoUrl'
]
=
Yii
::
$app
->
qiniu
->
getUrl
(
'video'
,
$coursewareInfo
[
'src_stand'
]);
}
else
if
(
$course
->
free_time
>
0
)
{
}
else
if
(
$course
->
free_time
>
0
)
{
$coursewareInfo
[
'videoUrl'
]
=
Yii
::
$app
->
qiniu
->
getUrl
(
'video'
,
$coursewareInfo
[
'src_free'
]);
$coursewareInfo
[
'videoUrl'
]
=
Yii
::
$app
->
qiniu
->
getUrl
(
'video'
,
$coursewareInfo
[
'src_free'
]);
}
else
{
}
else
{
$coursewareInfo
[
'videoUrl'
]
=
NULL
;
$coursewareInfo
[
'videoUrl'
]
=
NULL
;
}
}
unset
(
$coursewareInfo
[
'src_stand'
]);
unset
(
$coursewareInfo
[
'src_stand'
]);
unset
(
$coursewareInfo
[
'src_free'
]);
unset
(
$coursewareInfo
[
'src_free'
]);
$coursewareInfo
[
'price'
]
=
$course
->
price
;
$coursewareInfo
[
'price'
]
=
$course
->
price
;
$coursewareInfo
[
'classId'
]
=
$course
->
class_id
;
$coursewareInfo
[
'classId'
]
=
$course
->
class_id
;
$coursewareInfo
[
'free_time'
]
=
$course
->
free_time
;
$coursewareInfo
[
'className'
]
=
Classes
::
findOne
([
'id'
=>
$course
->
class_id
])
->
name
;
$coursewareInfo
[
'className'
]
=
Classes
::
findOne
([
'id'
=>
$course
->
class_id
])
->
name
;
$coursewareInfo
[
'isMobile'
]
=
Yii
::
$app
->
deviceDetect
->
isMobile
();
$coursewareInfo
[
'isMobile'
]
=
Yii
::
$app
->
deviceDetect
->
isMobile
();
//处理讲师头像
//处理讲师头像
...
...
src/frontend/web/js/home/components/video-play.vue
View file @
dfb37eb4
...
@@ -13,8 +13,7 @@
...
@@ -13,8 +13,7 @@
<a
href=
"javascript:;"
class=
"qzone post-icons bds_qzone"
data-cmd=
"qzone"
title=
"分享到QQ空间"
></a>
<a
href=
"javascript:;"
class=
"qzone post-icons bds_qzone"
data-cmd=
"qzone"
title=
"分享到QQ空间"
></a>
</div>
</div>
</div>
</div>
<myvideo
v-if=
"!coursewareInfo.isPreview"
:preview-url=
"coursewareInfo.previewUrl"
<myvideo
v-on:pay-click=
"payClick"
v-if=
"!coursewareInfo.isPreview"
:video-info=
"videoInfo"
></myvideo>
:video-url=
"coursewareInfo.videoUrl"
></myvideo>
<div
v-else
class=
"video-main"
>
<div
v-else
class=
"video-main"
>
<div
class=
"video-empty"
<div
class=
"video-empty"
style=
"height:500px; width: 100%; background-color: #444; color: #fff; text-align: center;"
>
style=
"height:500px; width: 100%; background-color: #444; color: #fff; text-align: center;"
>
...
@@ -140,6 +139,17 @@
...
@@ -140,6 +139,17 @@
videoShow: false
videoShow: false
}
}
}
,
}
,
computed:{
videoInfo(){
return {
videoUrl: this.coursewareInfo.videoUrl,
previewUrl: this.coursewareInfo.previewUrl,
freeTime:this.coursewareInfo.free_time,
price:this.coursewareInfo.price,
isShop:this.coursewareInfo.isShop
}
}
}
,
watch: {
watch: {
reload(){
reload(){
window.location.reload();
window.location.reload();
...
@@ -178,6 +188,15 @@
...
@@ -178,6 +188,15 @@
}
}
}
,
}
,
methods: {
methods: {
payClick(){
if(this.isMobile == false && this.isWeixin == false){
$('#web-pay').trigger('click');
}
else if(this.isMobile == true && this.isWeixin == false){
this.mobileAliPay(this.coursewareInfo.course_id);
}
else if(this.isWeixin === true){
this.weixinJsPay(this.coursewareInfo.course_id);
}
}
,
alipay(courseId){
alipay(courseId){
var url = __BASE_URL__ + 'home/pay?courseId=' + courseId;
var url = __BASE_URL__ + 'home/pay?courseId=' + courseId;
...
...
src/frontend/web/js/home/components/video.vue
View file @
dfb37eb4
<
template
>
<
template
>
<div
style=
"width:100%;height:100%"
class=
"video-main"
>
<div
style=
"width:100%;height:100%"
class=
"video-main"
>
<video
id=
"my-video-play"
class=
"video-js vjs-default-skin vjs-big-play-centered"
<video
v-if=
"videoInfo.freeTime > 0"
id=
"my-video-play"
class=
"video-js vjs-default-skin vjs-big-play-centered"
controls
preload=
"auto"
>
controls
preload=
"auto"
>
<source
:src=
"videoUrl"
/>
<source
:src=
"video
Info.video
Url"
/>
</video>
</video>
<!-- 付费视频的样式
<!-- 付费视频的样式 -->
<img
src=
"http://deimg.c.pp.cc/preview/f0/97/a3/f8s68SyefrZj3841.jpg"
width=
"100%"
height=
"auto"
>
<template
v-if=
"showTips"
>
<img
v-if=
"videoInfo.freeTime == 0"
:src=
"videoInfo.previewUrl"
width=
"100%"
height=
"auto"
>
<div
class=
"play-mask-box"
>
<div
class=
"look-video"
>
<p
v-if=
"videoInfo.freeTime >0"
>
本课程可试看
{{
videoInfo
.
freeTime
}}
分钟
</p>
<div
class=
"play-mask-box"
>
<p
v-else
>
本课程为付费课程,
{{
videoInfo
.
price
}}
<a
@
click=
"pay"
href=
"javascript:;"
>
立即购买
</a></p>
<div
class=
"look-video"
>
</div>
<p>
本课程为付费课程,价格¥108.00
<a
href=
"#"
>
立即购买
</a></p>
<
!
–
<p>
本课程可试看2分钟
</p>
–>
</div>
</div>
</
div
>
</
template
>
-->
</div>
</div>
</template>
</template>
...
@@ -26,38 +28,55 @@
...
@@ -26,38 +28,55 @@
window
.
VIDEOJS_NO_BASE_THEME
=
true
;
window
.
VIDEOJS_NO_BASE_THEME
=
true
;
export
default
{
export
default
{
data
(){
data
(){
return
{}
return
{
showTips
:
false
}
},
},
props
:
{
props
:
{
videoUrl
:
String
,
videoInfo
:
Object
,
previewUrl
:
String
},
methods
:
{
pay
(){
this
.
$dispatch
(
'pay-click'
);
}
},
},
ready
(){
ready
(){
var
self
=
this
;
if
(
this
.
videoInfo
.
isShop
)
{
var
rate
=
9
/
16
;
this
.
showTips
=
false
;
var
w
=
$
(
'.video-main'
).
width
();
}
else
{
var
h
=
w
*
rate
;
this
.
showTips
=
true
;
videojs
(
"my-video-play"
,
{
}
"techOrder"
:
[
'html5'
,
'flash'
],
//不显示视频则不绑定
"controls"
:
true
,
if
(
this
.
videoInfo
.
freeTime
>
0
)
{
"autoplay"
:
false
,
var
self
=
this
;
"language"
:
"zh-CN"
,
var
rate
=
9
/
16
;
"width"
:
w
,
var
w
=
$
(
'.video-main'
).
width
();
"height"
:
h
,
var
h
=
w
*
rate
;
"poster"
:
self
.
previewUrl
var
myPlayer
=
videojs
(
"my-video-play"
,
{
}).
ready
(
function
()
{
"techOrder"
:
[
'html5'
,
'flash'
],
$
(
'#my-video-play'
).
css
(
'width'
,
'100%'
);
"controls"
:
true
,
var
wVideo
=
$
(
'#my-video-play'
).
width
();
"autoplay"
:
false
,
var
hVideo
=
wVideo
*
rate
;
"language"
:
"zh-CN"
,
$
(
'#my-video-play'
).
css
(
'height'
,
hVideo
);
"width"
:
w
,
window
.
onresize
=
function
()
{
"height"
:
h
,
"poster"
:
this
.
videoInfo
.
previewUrl
,
}).
ready
(
function
()
{
$
(
'#my-video-play'
).
css
(
'width'
,
'100%'
);
var
wVideo
=
$
(
'#my-video-play'
).
width
();
var
wVideo
=
$
(
'#my-video-play'
).
width
();
var
hVideo
=
wVideo
*
rate
;
var
hVideo
=
wVideo
*
rate
;
$
(
'#my-video-play'
).
css
(
'height'
,
hVideo
);
$
(
'#my-video-play'
).
css
(
'height'
,
hVideo
);
};
window
.
onresize
=
function
()
{
});
var
wVideo
=
$
(
'#my-video-play'
).
width
();
var
hVideo
=
wVideo
*
rate
;
$
(
'#my-video-play'
).
css
(
'height'
,
hVideo
);
};
});
myPlayer
.
bigPlayButton
.
on
(
'click'
,
function
()
{
self
.
showTips
=
false
;
});
}
}
}
}
}
</
script
>
</
script
>
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