增加联机帮助视频

This commit is contained in:
zhl 2019-03-27 11:56:08 +08:00
parent ce128c74ba
commit f5ab28441b
10 changed files with 163 additions and 5 deletions

View File

@ -29,7 +29,7 @@
"list": []
},
"miniprogram": {
"current": 0,
"current": -1,
"list": [
{
"id": 0,

View File

@ -34,7 +34,8 @@ export default class extends wepy.app {
'pages/gameInfo',
'pages/login',
'pages/search',
'pages/jumppage'
'pages/jumppage',
'pages/video',
],
window: {
backgroundTextStyle: 'light',

View File

@ -1,4 +1,4 @@
const env = 'product'; //product, test
const env = 'test'; //product, test
export default {
env: env,
// apiBase: env === 'test'? 'http://192.168.100.226' : 'https://ghost.kingsome.cn',

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,57 @@
<style lang="less">
.video-view {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 103;
}
.video-view .video-main {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.video-view .video-main video {
position: absolute;
width: 100%;
height: 100%;
}
</style>
<template>
<view class="video-view {{ config.hide ? 'hidden' : ''}}">
<view class="video-main">
<video
id="video_player"
src=""
controls
autoplay
@play = "videoPlay"
@ended = "videoEnd"
@fullscreenchange = "fullscreenchange"
></video>
</view>
</view>
</template>
<script>
import wepy from 'wepy'
export default class VideoPlayer extends wepy.component {
props = {
config: {
hide: false,
videoUrl: '',
},
}
methods = {
videoPlay: function() {
// wepy.createVideoContext('video_player').requestFullScreen()
},
videoEnd: function() {
this.$emit('videoEnd')
}
};
}
</script>

View File

@ -27,6 +27,11 @@ export default class cfgMixin extends wepy.mixin {
}
return result;
}
/*获取成就达成人数要求的配置*/
$getHelpVideoLink() {
let cfgObj = wepy.getStorageSync('cfg');
return cfgObj.help_video;
}
$getExtCfg(name) {
let cfgObj = wepy.getStorageSync('cfg');
let price = cfgObj.ext_json_cfg;

View File

@ -16,4 +16,15 @@ export default class navMixin extends wepy.mixin {
url: '/pages/login'
})
}
/**
* 视频播放页面
* @param {string} link 视频地址
* @param {string} title 页面标题可为空
* */
$toVideo(link, title) {
wepy.navigateTo({
url: '/pages/video?link=' + encodeURIComponent(link) + '&title=' + encodeURIComponent(title)
})
}
}

View File

@ -32,6 +32,10 @@
<view class="game-info-label">语言</view>
<view class="game-info-value">{{record.language}}</view>
</view>
<view class="online-tip {{ (record.category === 'fc' && helpVideo)? '' : 'hidden' }}" @tap="onlineHelp">
<image src="{{tipImage}}"></image>
<view class="tip-text">查看联机帮助</view>
</view>
</view>
<view class="game-introduce-view">
<view class="part-title"><i class="icon-bookmark"></i> 游戏简介</view>
@ -69,15 +73,17 @@
import base from '../mixins/base';
import tips from '../mixins/tips';
import cfg from '../mixins/cfg';
import nav from '../mixins/nav';
import zanToptips from '../components/zan-toptips'
import images from '../common/images';
export default class GameInfoPage extends wepy.page {
mixins = [base, tips, cfg];
mixins = [base, tips, cfg, nav];
components = {
imageSwiper: imageSwiper,
gameBottomBar: gameBottomBar,
zActionSheet: zActionSheet,
zanToptips: zanToptips
zanToptips: zanToptips,
};
data = {
id: '',
@ -107,6 +113,8 @@
payVer: 'develop'
},
vip: false,
tipImage: images.link_img,
helpVideo: ''
};
methods = {
imageTap: function(index) {
@ -153,11 +161,15 @@
},
buyProductTap() {
this.$parent.log('buy_product_btn', {gid: this.record.gid});
},
onlineHelp() {
this.$toVideo(this.helpVideo, '联机帮助');
}
};
onLoad(params) {
this.$parent.log('gameInfo', params);
this.helpVideo = this.$getHelpVideoLink();
this.zActionSheetCfg.payVer = g.env === 'product' ? 'release' : 'develop';
this.vip = this.$parent.isVip();
this.id = decodeURIComponent(params.id);

52
src/pages/video.wpy Normal file
View File

@ -0,0 +1,52 @@
<style lang="less">
</style>
<template>
<view class="container">
</view>
<videoPlayer :config.sync="videoCfg" @videoEnd.user="videoEnd"></videoPlayer>
</template>
<script>
import wepy from 'wepy'
import videoPlayer from '../components/video-player';
import base from '../mixins/base';
import tips from '../mixins/tips';
import cfg from '../mixins/cfg';
export default class Video extends wepy.page {
config = {
navigationBarTitleText: ''
}
mixins = [base, tips, cfg];
components = {
videoPlayer: videoPlayer
}
data = {
videoCfg: {
hide: false,
videoUrl: '',
}
}
methods = {
videoEnd: function() {
wepy.navigateBack({
delta: 1
})
}
}
onLoad(params) {
this.videoCfg.videoUrl = decodeURIComponent(params.link);
const title = decodeURIComponent(params.title)
if (title) {
wepy.setNavigationBarTitle({
title: title
})
}
this.$apply();
}
}
</script>

View File

@ -42,7 +42,26 @@
padding-bottom:10rpx;
width: 100%;
line-height:45rpx;
position: relative;
}
.more-game-info .online-tip {
position: absolute;
right: 20rpx;
bottom: 10rpx;
width: 200rpx;
height: 188rpx;
text-align:center;
}
.more-game-info .online-tip image {
width: 150rpx;
height: 138rpx;
}
.more-game-info .online-tip .tip-text {
font-size: 13px;
text-align:center;
color: #ff0400;
}
.game-introduce {
padding: 5rpx 20rpx;
font-size: 26rpx;