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
96a17893
Commit
96a17893
authored
Oct 19, 2016
by
xiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改移动端支付问题
parent
c53daee6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
9 deletions
+38
-9
HomeController.php
src/frontend/controllers/HomeController.php
+2
-0
video-play.vue
src/frontend/web/js/home/components/video-play.vue
+25
-9
utils.js
src/frontend/web/js/libs/utils.js
+11
-0
No files found.
src/frontend/controllers/HomeController.php
View file @
96a17893
...
...
@@ -146,6 +146,8 @@ class HomeController extends \yii\web\Controller
$coursewareInfo
[
'price'
]
=
$course
->
price
;
$coursewareInfo
[
'classId'
]
=
$course
->
class_id
;
$coursewareInfo
[
'className'
]
=
Classes
::
findOne
([
'id'
=>
$course
->
class_id
])
->
name
;
$coursewareInfo
[
'isMobile'
]
=
Yii
::
$app
->
deviceDetect
->
isMobile
();
return
$this
->
render
(
'video'
,
[
'coursewareInfo'
=>
$coursewareInfo
]);
...
...
src/frontend/web/js/home/components/video-play.vue
View file @
96a17893
...
...
@@ -11,7 +11,7 @@
<div
class=
"video-main"
>
<video
id=
"my-video-play"
class=
"video-js vjs-default-skin vjs-big-play-centered"
controls
preload=
"auto"
>
controls
preload=
"auto"
>
<source
:src=
"coursewareInfo.videoUrl"
type=
"video/mp4"
/>
</video>
</div>
...
...
@@ -35,9 +35,21 @@
<template v-else>
<button v-if="
coursewareInfo
.
isShop
" class="
btn
btn
-
danger
m
-
l
-
20
hidden
-
xs
" data-toggle="
modal
">已购买
</button>
<button v-else class="
btn
btn
-
danger
m
-
l
-
20
" data-toggle="
modal
"
data-target="
#
pay
">购买 ¥{{coursewareInfo.price
}}
</button>
<template>
<button v-if="
isMobile
===
false
and
isWeixin
===
false
" class="
btn
btn
-
danger
m
-
l
-
20
"
data-toggle="
modal
"
data-target="
#
pay
">购买 ¥{{coursewareInfo.price
}}
</button>
<button v-if="
isMobile
===
true
and
isWeixin
===
false
"
@click="
alipay
(
coursewareInfo
.
course_id
)
" class="
btn
btn
-
danger
m
-
l
-
20
"
>购买 ¥{{coursewareInfo.price
}}
</button>
<button v-if="
isWeixin
===
true
" @click="
alipay
(
coursewareInfo
.
course_id
)
"
class="
btn
btn
-
danger
m
-
l
-
20
"
>购买 ¥{{coursewareInfo.price
}}
</button>
</template>
</template>
...
...
@@ -105,18 +117,20 @@
videojs.options.flash.swf = __CDN_URL__ + 'assets/videojs/video-js.swf';
window.VIDEOJS_NO_BASE_THEME = true;
//
import Utils from '../../libs/utils';
export default{
data(){
return {
showQrcode: false,
weixinCheckHandler: false,
reload:false
reload: false,
isMobile: false,
isWeixin: false
}
}
,
watch: {
reload(){
window.location.reload();
window.location.reload();
}
,
showQrcode(){
if (this.showQrcode === true) {
...
...
@@ -223,12 +237,14 @@
}
,
components: {
}
,
ready(){
this.isMobile = this.coursewareInfo.isMobile;
this.isWeixin = Utils.isWeixin();
videojs("
my
-
video
-
play
", {
"
controls
": true,
"
autoplay
": false,
"
language
": "
zh
-
CN
",
"
width
":640,
"
height
":264,
"
width
":
640,
"
height
":
264,
poster: this.coursewareInfo.previewUrl
}
).ready(function () {
var myPlayer = this;
...
...
src/frontend/web/js/libs/utils.js
0 → 100644
View file @
96a17893
/**
* Created by xiabin on 2016/10/19.
*/
var
Utils
=
{
isWeixin
:
function
()
{
var
ua
=
navigator
.
userAgent
.
toLowerCase
();
return
ua
.
indexOf
(
'micromessenger'
)
!=
-
1
;
}
};
module
.
exports
=
Utils
;
\ No newline at end of file
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