Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b2596f3f
authored
Aug 01, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交代码
1 parent
693e0884
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
16 deletions
src/assets/css/crowdfunding.scss
src/config/env.development.js
src/config/index.js
src/mixins/miniprogramMixin.js
src/utils/audio.js
src/views/crowdfunding/index.vue
src/assets/css/crowdfunding.scss
View file @
b2596f3
...
@@ -107,22 +107,29 @@
...
@@ -107,22 +107,29 @@
left
:
0
;
left
:
0
;
z-index
:
2
;
z-index
:
2
;
background
:
#E9E8EC
;
background
:
#E9E8EC
;
border
:
1px
solid
transparent
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
.line
{
.line
-box
{
position
:
absolute
;
position
:
absolute
;
left
:
0
;
left
:
0
;
bottom
:
0
;
bottom
:
0
;
width
:
100%
;
width
:
100%
;
height
:
13%
;
height
:
13%
;
background
:
linear-gradient
(
360deg
,
#292929
0%
,
#474747
100%
);
background
:
linear-gradient
(
360deg
,
#292929
0%
,
#474747
100%
);
.line
{
width
:
90px
;
height
:
2px
;
background
:
#fff
;
border-radius
:
1px
;
margin-left
:
6px
;
}
}
.duration
{
font-size
:
8px
;
color
:
#FFFFFF
;
margin-left
:
auto
;
margin-right
:
6px
;
}
}
}
}
.active
{
.mask
{
border-color
:
#FC5B32
;
}
}
}
}
}
}
...
...
src/config/env.development.js
View file @
b2596f3
...
@@ -33,6 +33,7 @@ module.exports = {
...
@@ -33,6 +33,7 @@ module.exports = {
miniprogramName
:
'广汇'
,
miniprogramName
:
'广汇'
,
logo
:
'gh'
,
logo
:
'gh'
,
envVersion
:
'trial'
,
envVersion
:
'trial'
,
appid
:
'wxfe82b8d65d07808f'
},
},
// shopmall_id: "gh_e983752bf563", //嘀加
// shopmall_id: "gh_e983752bf563", //嘀加
appid
:
'wx56bed167ad463f70'
,
//公众号appid
appid
:
'wx56bed167ad463f70'
,
//公众号appid
...
...
src/config/index.js
View file @
b2596f3
...
@@ -15,9 +15,9 @@ export const fetchConfig = function(isEnv = true) {
...
@@ -15,9 +15,9 @@ export const fetchConfig = function(isEnv = true) {
Object
.
assign
(
request
,
{
timeout
})
Object
.
assign
(
request
,
{
timeout
})
return
Promise
.
resolve
(
config
)
return
Promise
.
resolve
(
config
)
}
}
return
window
.
fetch
(
'https://oss-config.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config'
,
{}).
then
(
res
=>
res
.
json
())
//生产
//
return window.fetch('https://oss-config.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config', {}).then(res => res.json()) //生产
//
return window.fetch('https://oss-config.dev.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config', {}).then(res => res.json()) //测试
return
window
.
fetch
(
'https://oss-config.dev.glsx.com.cn/mock/618cb9331072f92988f05a23/wx/config'
,
{}).
then
(
res
=>
res
.
json
())
//测试
}
}
export
const
cfg
=
{
export
const
cfg
=
{
install
(
vue
,
config
)
{
install
(
vue
,
config
)
{
...
...
src/mixins/miniprogramMixin.js
View file @
b2596f3
...
@@ -9,10 +9,11 @@ export default {
...
@@ -9,10 +9,11 @@ export default {
methods
:
{
methods
:
{
launchMiniprogram
()
{
launchMiniprogram
()
{
const
ISWXWORK
=
window
.
$ISWXWORK
const
ISWXWORK
=
window
.
$ISWXWORK
const
{
appid
}
=
window
.
$fetchConfig
.
miniprogramInfo
if
(
!
ISWXWORK
)
return
if
(
!
ISWXWORK
)
return
let
{
path
}
=
this
let
{
path
}
=
this
wxConfig
.
launchMiniprogram
({
wxConfig
.
launchMiniprogram
({
appid
:
'wxe10067a63c1856ac'
,
appid
,
path
path
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
...
...
src/utils/audio.js
View file @
b2596f3
...
@@ -13,7 +13,7 @@ export function Audio (url, callBack) {
...
@@ -13,7 +13,7 @@ export function Audio (url, callBack) {
}
}
this
.
stopVideo
=
function
(){
this
.
stopVideo
=
function
(){
if
(
typeof
this
.
sourceNode
==
'object'
)
{
if
(
typeof
this
.
sourceNode
==
'object'
)
{
if
(
this
.
isPlayingBGM
||
off
)
{
if
(
this
.
isPlayingBGM
)
{
this
.
sourceNode
.
stop
()
this
.
sourceNode
.
stop
()
this
.
isPlayingBGM
=
false
this
.
isPlayingBGM
=
false
}
}
...
...
src/views/crowdfunding/index.vue
View file @
b2596f3
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<div
:class=
"['video-box flex',
{ onlyone: detail.activityVideos.length == 1 }, { onlytwo: detail.activityVideos.length == 2 }]">
<div
:class=
"['video-box flex',
{ onlyone: detail.activityVideos.length == 1 }, { onlytwo: detail.activityVideos.length == 2 }]">
<template
v-for=
"(i, index) in detail.activityVideos"
>
<template
v-for=
"(i, index) in detail.activityVideos"
>
<div
<div
:class=
"['item text-center',
{ active: currentVideoIndex == index
&&
detail.activityVideos.length > 1}]
"
class=
"item text-center
"
:key=
"index"
:key=
"index"
@
click=
"playVideo(index)"
@
click=
"playVideo(index)"
>
>
...
@@ -61,12 +61,19 @@
...
@@ -61,12 +61,19 @@
:ref=
"`video-$
{index}`"
:ref=
"`video-$
{index}`"
:controls="false"
:controls="false"
preload
preload
@loadedmetadata="loadedmetadata($event,index)"
>
</video>
>
</video>
<!--
</
template
>
-->
<!--
</
template
>
-->
<div
class=
"mask"
>
<div
class=
"mask"
>
<img
src=
"https://img02.glsx.com.cn/weapp/resource/h5/images/video-poster.png"
/>
<img
src=
"https://img02.glsx.com.cn/weapp/resource/h5/images/video-poster.png"
/>
<div
:class=
"['sprite-icon xy-center',detail.activityVideos.length == 1 ?'icon-big-play':'icon-play']"
></div>
<div
:class=
"['sprite-icon xy-center',detail.activityVideos.length == 1 ?'icon-big-play':'icon-play']"
></div>
<div
class=
"line-box flex"
>
<div
class=
"line"
></div>
<div
class=
"line"
></div>
<div
v-if=
"i.duration"
class=
"duration"
>
{{i.duration}}
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
...
@@ -237,7 +244,7 @@ export default {
...
@@ -237,7 +244,7 @@ export default {
}
)
}
)
}
)
}
)
}
,
}
,
deactivated
()
{
deactivated
()
{
window
.
$AUDIO
.
stopVideo
()
window
.
$AUDIO
.
stopVideo
()
}
,
}
,
mounted
()
{
mounted
()
{
...
@@ -321,6 +328,24 @@ export default {
...
@@ -321,6 +328,24 @@ export default {
else
wxConfig
.
onMenuShareAppMessage
(
this
.
shareInfo
)
else
wxConfig
.
onMenuShareAppMessage
(
this
.
shareInfo
)
}
)
}
)
}
,
}
,
loadedmetadata
({
srcElement
}
,
index
)
{
const
addZero
=
i
=>
i
<
10
?
`0${i
}
`
:
`${i
}
`
function
date_format
(
num
)
{
//计算剩余的天数
let
days
=
addZero
(
parseInt
(
num
/
60
/
60
/
24
,
10
))
//计算剩余的小时
let
hours
=
addZero
(
parseInt
(
num
/
60
/
60
%
24
,
10
))
//计算剩余的分钟
let
minutes
=
addZero
(
parseInt
(
num
/
60
%
60
,
10
))
//计算剩余的秒数
let
second
=
addZero
(
parseInt
(
num
%
60
,
10
))
if
(
days
==
0
)
{
return
`${hours
}
:${minutes
}
:${second
}
`
}
return
`${days
}
天${hours
}
:${minutes
}
:${second
}
`
}
this
.
detail
.
activityVideos
[
index
].
duration
=
date_format
(
srcElement
.
duration
)
}
,
authLocation
(
data
)
{
authLocation
(
data
)
{
if
(
data
.
distance
)
this
.
openLocation
()
if
(
data
.
distance
)
this
.
openLocation
()
else
wxConfig
.
getLocation
().
then
(
res
=>
{
else
wxConfig
.
getLocation
().
then
(
res
=>
{
...
@@ -362,21 +387,19 @@ export default {
...
@@ -362,21 +387,19 @@ export default {
}
,
}
,
playVideo
(
index
)
{
playVideo
(
index
)
{
let
_this
=
this
,
let
_this
=
this
,
{
ISMOBILE
,
audioFlag
}
=
this
{
audioFlag
}
=
this
this
.
currentVideoIndex
=
index
this
.
currentVideoIndex
=
index
let
video
=
this
.
$refs
[
`video-${index
}
`
][
0
]
let
video
=
this
.
$refs
[
`video-${index
}
`
][
0
]
video
.
controls
=
false
video
.
controls
=
false
video
.
addEventListener
(
'webkitendfullscreen'
,
()
=>
{
video
.
addEventListener
(
'webkitendfullscreen'
,
()
=>
{
if
(
audioFlag
)
this
.
audioAutoPlay
()
if
(
audioFlag
)
this
.
audioAutoPlay
()
video
.
pause
()
video
.
pause
()
video
.
removeEventListener
(
'webkitendfullscreen'
)
//
video.removeEventListener('webkitendfullscreen')
}
)
}
)
if
(
ISMOBILE
)
this
.
showLoading
(
'准备中...'
)
if
(
audioFlag
)
this
.
audioAutoPlay
(
true
)
if
(
audioFlag
)
this
.
audioAutoPlay
(
true
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
video
.
play
()
video
.
play
()
if
(
video
.
webkitRequestFullScreen
)
video
.
webkitRequestFullScreen
()
if
(
video
.
webkitRequestFullScreen
)
video
.
webkitRequestFullScreen
()
_this
.
hideLoading
()
}
,
500
)
}
,
500
)
}
,
}
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment