Commit b2596f3f by 李伟康

提交代码

1 parent 693e0884
......@@ -107,22 +107,29 @@
left: 0;
z-index: 2;
background: #E9E8EC;
border: 1px solid transparent;
box-sizing: border-box;
.line {
.line-box {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 13%;
background: linear-gradient(360deg, #292929 0%, #474747 100%);
}
}
}
.active {
.mask {
border-color: #FC5B32;
.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;
}
}
}
}
}
......
......@@ -33,6 +33,7 @@ module.exports = {
miniprogramName:'广汇',
logo:'gh',
envVersion: 'trial',
appid:'wxfe82b8d65d07808f'
},
// shopmall_id: "gh_e983752bf563", //嘀加
appid: 'wx56bed167ad463f70', //公众号appid
......
......@@ -15,9 +15,9 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout })
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 = {
install(vue, config) {
......
......@@ -9,10 +9,11 @@ export default {
methods: {
launchMiniprogram () {
const ISWXWORK = window.$ISWXWORK
const { appid } = window.$fetchConfig.miniprogramInfo
if (!ISWXWORK) return
let { path } = this
wxConfig.launchMiniprogram({
appid: 'wxe10067a63c1856ac',
appid,
path
}).then(res => {
console.log(res)
......
......@@ -13,7 +13,7 @@ export function Audio (url, callBack) {
}
this.stopVideo = function(){
if (typeof this.sourceNode == 'object') {
if (this.isPlayingBGM || off) {
if (this.isPlayingBGM) {
this.sourceNode.stop()
this.isPlayingBGM = false
}
......
......@@ -51,7 +51,7 @@
<div :class="['video-box flex', { onlyone: detail.activityVideos.length == 1 }, { onlytwo: detail.activityVideos.length == 2 }]">
<template v-for="(i, index) in detail.activityVideos">
<div
:class="['item text-center', { active: currentVideoIndex == index && detail.activityVideos.length > 1}]"
class="item text-center"
:key="index"
@click="playVideo(index)"
>
......@@ -61,12 +61,19 @@
:ref="`video-${index}`"
:controls="false"
preload
@loadedmetadata="loadedmetadata($event,index)"
></video>
<!-- </template> -->
<div class="mask">
<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="line"></div>
<div class="line-box flex">
<div class="line"></div>
<div
v-if="i.duration"
class="duration"
>{{i.duration}}</div>
</div>
</div>
</div>
</template>
......@@ -237,7 +244,7 @@ export default {
})
})
},
deactivated(){
deactivated () {
window.$AUDIO.stopVideo()
},
mounted () {
......@@ -321,6 +328,24 @@ export default {
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) {
if (data.distance) this.openLocation()
else wxConfig.getLocation().then(res => {
......@@ -362,21 +387,19 @@ export default {
},
playVideo (index) {
let _this = this,
{ ISMOBILE, audioFlag } = this
{ audioFlag } = this
this.currentVideoIndex = index
let video = this.$refs[`video-${index}`][0]
video.controls = false
video.addEventListener('webkitendfullscreen', () => {
if (audioFlag) this.audioAutoPlay()
video.pause()
video.removeEventListener('webkitendfullscreen')
// video.removeEventListener('webkitendfullscreen')
})
if (ISMOBILE) this.showLoading('准备中...')
if (audioFlag) this.audioAutoPlay(true)
setTimeout(() => {
video.play()
if (video.webkitRequestFullScreen) video.webkitRequestFullScreen()
_this.hideLoading()
}, 500)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!