Commit e15cf7a4 by 李伟康

直播

1 parent b28fb015
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script> <script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %> <% } %>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<!-- <link href="https://web.sdk.qcloud.com/player/tcplayer/release/v4.2.1/tcplayer.min.css" rel="stylesheet">
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.2.1/libs/hls.min.0.13.2m.js"></script>
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.0/tcplayer.v4.5.0.min.js"></script> -->
</body> </body>
</html> </html>
\ No newline at end of file \ No newline at end of file
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
} }
.order-move { .order-move {
animation: move-btn 1.5s infinite cubic-bezier(.36, .07, .19, .97) both; animation: move-btn 1.5s infinite cubic-bezier(.36, .07, .19, .97) both;
} }
...@@ -280,6 +281,7 @@ ...@@ -280,6 +281,7 @@
position: relative; position: relative;
margin-bottom: 14px; margin-bottom: 14px;
justify-content: space-between; justify-content: space-between;
span { span {
color: #FC5B32; color: #FC5B32;
font-size: 24px; font-size: 24px;
...@@ -383,4 +385,27 @@ ...@@ -383,4 +385,27 @@
padding-top: 30px; padding-top: 30px;
font-size: 12px; font-size: 12px;
} }
}
\ No newline at end of file \ No newline at end of file
}
.live-box {
position: fixed;
top: 10%;
right: 10%;
z-index: 7;
width: 150px;
height: 300px;
.mask {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 2;
}
#player-container-id {
width: 100%;
height: 100%;
}
}
<template> <template>
<div class="layout"> <div class="layout">
<div class="live-box " ref="b">
<div
class="mask"
@click="openFullscreen"
></div>
<video
id="player-container-id"
preload="auto"
playsinline
webkit-playsinline
>
</video>
</div>
<div <div
class="to-top" class="to-top"
v-show="scrollY > 300" v-show="scrollY > 300"
...@@ -268,7 +282,8 @@ export default { ...@@ -268,7 +282,8 @@ export default {
audioFlag: false, audioFlag: false,
carInfoKey: Date.now(), carInfoKey: Date.now(),
showOrderBtn: false, showOrderBtn: false,
userOff: null userOff: null,
player: null
} }
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
...@@ -298,6 +313,13 @@ export default { ...@@ -298,6 +313,13 @@ export default {
wxConfig.init(jsApiList).then(() => { wxConfig.init(jsApiList).then(() => {
wxConfig.ready(() => { wxConfig.ready(() => {
this.getActivityDetail() this.getActivityDetail()
this.player = TCPlayer("player-container-id", {
// fileID: "387702304976042167",
// appID: "1311227058",
controls: false,
autoplay: true
})
this.player.src('webrtc://play.glsx.com.cn/live/live')
}) })
}) })
window.addEventListener('scroll', _this.debounce(() => { window.addEventListener('scroll', _this.debounce(() => {
...@@ -480,6 +502,13 @@ export default { ...@@ -480,6 +502,13 @@ export default {
let { customerServerUrl } = this.detail let { customerServerUrl } = this.detail
if (!customerServerUrl) this.showKf = true if (!customerServerUrl) this.showKf = true
else window.location.href = customerServerUrl else window.location.href = customerServerUrl
},
openFullscreen () {
// this.player.requestFullscreen()
this.$refs.b.style.width = '100vw'
this.$refs.b.style.height = '100vh'
this.$refs.b.style.top = '0'
this.$refs.b.style.right = '0'
} }
} }
} }
......
...@@ -4,37 +4,29 @@ const defaultSettings = require('./src/config/conf.js') ...@@ -4,37 +4,29 @@ const defaultSettings = require('./src/config/conf.js')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
// page title // page title
const name = defaultSettings.title || 'vue mobile template' const name = defaultSettings.title || 'vue mobile template'
// 生产环境,测试和正式 // 生产环境,测试和正式
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
// externals // externals
// const externals = { // const externals = {
// vue: 'Vue', // vue: 'Vue',
// 'vue-router': 'VueRouter', // 'vue-router': 'VueRouter',
// vuex: 'Vuex', // vuex: 'Vuex',
// vant: 'vant', // vant: 'vant',
// axios: 'axios' // axios: 'axios'
// } // }
// CDN外链,会插入到index.html中 // CDN外链,会插入到index.html中
// const cdn = { const cdn = {
// // 开发环境 // 开发环境
// dev: {
// css: [], css: ['https://web.sdk.qcloud.com/player/tcplayer/release/v4.2.1/tcplayer.min.css'],
// js: [] js: [
// }, 'https://web.sdk.qcloud.com/player/tcplayer/release/v4.2.1/libs/hls.min.0.13.2m.js',
// // 生产环境 'https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.0/tcplayer.v4.5.0.min.js'
// build: { ]
// css: ['https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.css'],
// js: [ }
// 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
// 'https://cdn.jsdelivr.net/npm/vue-router@3.1.5/dist/vue-router.min.js',
// 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js',
// 'https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js',
// 'https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.min.js'
// ]
// }
// }
/** /**
* 雪碧图插件 * 雪碧图插件
...@@ -61,7 +53,7 @@ module.exports = { ...@@ -61,7 +53,7 @@ module.exports = {
disableHostCheck: true, disableHostCheck: true,
port: 9528, // 端口 port: 9528, // 端口
open: false, // 启动后打开浏览器 open: false, // 启动后打开浏览器
public:'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main/#/', public: 'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main/#/',
overlay: { overlay: {
// 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层 // 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层
warnings: false, warnings: false,
...@@ -126,11 +118,11 @@ module.exports = { ...@@ -126,11 +118,11 @@ module.exports = {
}) })
] ]
config.plugins = [...config.plugins, ...Plugins] config.plugins = [...config.plugins, ...Plugins]
// 为生产环境修改配置... // 为生产环境修改配置...
// if (IS_PROD) { // if (IS_PROD) {
// // externals // // externals
// config.externals = externals // config.externals = externals
// } // }
}, },
chainWebpack: config => { chainWebpack: config => {
...@@ -150,14 +142,10 @@ module.exports = { ...@@ -150,14 +142,10 @@ module.exports = {
/** /**
* 添加CDN参数到htmlWebpackPlugin配置中 * 添加CDN参数到htmlWebpackPlugin配置中
*/ */
// config.plugin('html').tap(args => { config.plugin('html').tap(args => {
// if (IS_PROD) { args[0].cdn = cdn
// args[0].cdn = cdn.build return args
// } else { })
// args[0].cdn = cdn.dev
// }
// return args
// })
/** /**
* 设置保留空格 * 设置保留空格
...@@ -171,16 +159,16 @@ module.exports = { ...@@ -171,16 +159,16 @@ module.exports = {
return options return options
}) })
.end() .end()
/** /**
* 打包分析 * 打包分析
*/ */
if (IS_PROD) { if (IS_PROD) {
config.plugin('webpack-report').use(BundleAnalyzerPlugin, [{ config.plugin('webpack-report').use(BundleAnalyzerPlugin, [{
analyzerMode: 'static' analyzerMode: 'static'
}]) }])
} }
config config
// https://webpack.js.org/configuration/devtool/#development // https://webpack.js.org/configuration/devtool/#development
.when(!IS_PROD, config => config.devtool('cheap-source-map')) .when(!IS_PROD, config => config.devtool('cheap-source-map'))
config.when(IS_PROD, config => { config.when(IS_PROD, config => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!