first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

View File

@@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -0,0 +1,19 @@
# zhbaohe
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

View File

@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,33 @@
{
"name": "zhbaohe",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"amfe-flexible": "^2.2.1",
"axios": "^0.19.2",
"core-js": "^3.6.4",
"vant": "^2.8.0",
"videojs-contrib-hls": "^5.15.0",
"vue": "^2.6.11",
"vue-router": "^3.1.6",
"vue-video-player": "^5.0.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.3.0",
"@vue/cli-plugin-router": "~4.3.0",
"@vue/cli-service": "~4.3.0",
"amfe-flexible": "^2.2.1",
"postcss-pxtorem": "^5.1.1",
"pug": "^2.0.4",
"pug-html-loader": "^1.1.5",
"pug-plain-loader": "^1.0.0",
"style-resources-loader": "^1.3.3",
"stylus": "^0.54.7",
"stylus-loader": "^3.0.2",
"vue-template-compiler": "^2.6.11"
}
}

View File

@@ -0,0 +1,17 @@
module.exports = {
plugins: {
'autoprefixer': {
overrideBrowserslist: [
'Android 4.1',
'iOS 7.1',
'Chrome > 31',
'ff > 31',
'ie >= 8'
]
},
'postcss-pxtorem': {
rootValue: 37.5,
propList: ['*']
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@@ -0,0 +1,31 @@
<template lang="pug">
#app
router-view
</template>
<script>
export default {};
</script>
<style lang="stylus">
@import "./assets/stylus/index.styl"
.content {
margin-top 1.173rem
}
.video-js {
width: 100%;
height: 5.627rem;
}
.video-js .vjs-big-play-button {
height: 1.5rem !important;
width: 1.5rem !important;
border-radius: 100% !important;
line-height: 1.5rem !important;
position: absolute !important;
left: 50% !important;
top: 50% !important;
margin-left calc(-1.5rem /2)
margin-top calc(-1.5rem /2)
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1 @@
RedColor = red;

View File

@@ -0,0 +1,3 @@
@import "colors.styl"
@import "mixins.styl"
@import "normalize.styl"

View File

@@ -0,0 +1,16 @@
flex(space = space-around, direction = row)
display flex
justify-content space
flex-direction direction
align-items center
fixed(position = top)
position fixed !important
left 0
width 100%
z-index 999
if position == top
top 0
else if position == bottom
bottom 0

View File

@@ -0,0 +1,428 @@
/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Change the default font family in all browsers (opinionated).
* 2. Prevent adjustments of font size after orientation changes in IE and iOS.
*/
.van-tabs__wrap
fixed()
h1,h1,h2,h3,h4,h5,h6,p,ul,li {
margin: 0;
padding: 0;
list-style: none;
}
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove the margin in all browsers (opinionated).
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Add the correct display in IE 9-.
* 1. Add the correct display in Edge, IE, and Firefox.
* 2. Add the correct display in IE.
*/
article,
aside,
details, /* 1 */
figcaption,
figure,
footer,
header,
main, /* 2 */
menu,
nav,
section,
summary { /* 1 */
display: block;
}
/**
* Add the correct display in IE 9-.
*/
audio,
canvas,
progress,
video {
display: inline-block;
}
/**
* Add the correct display in iOS 4-7.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Add the correct display in IE 10-.
* 1. Add the correct display in IE.
*/
template, /* 1 */
[hidden] {
display: none;
}
/* Links
========================================================================== */
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
a {
background-color: transparent; /* 1 */
-webkit-text-decoration-skip: objects; /* 2 */
}
/**
* Remove the outline on focused links when they are also active or hovered
* in all browsers (opinionated).
*/
a:active,
a:hover {
outline-width: 0;
}
/* Text-level semantics
========================================================================== */
/**
* 1. Remove the bottom border in Firefox 39-.
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
*/
b,
strong {
font-weight: inherit;
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* Add the correct font style in Android 4.3-.
*/
dfn {
font-style: italic;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Add the correct background and color in IE 9-.
*/
mark {
background-color: #ff0;
color: #000;
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10-.
*/
img {
border-style: none;
}
/**
* Hide the overflow in IE.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct margin in IE 8.
*/
figure {
margin: 1em 40px;
}
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/* Forms
========================================================================== */
/**
* 1. Change font properties to `inherit` in all browsers (opinionated).
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
select,
textarea {
font: inherit; /* 1 */
margin: 0; /* 2 */
}
/**
* Restore the font weight unset by the previous rule.
*/
optgroup {
font-weight: bold;
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
* controls in Android 4.
* 2. Correct the inability to style clickable types in iOS and Safari.
*/
button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
-webkit-appearance: button; /* 2 */
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Change the border, margin, and padding in all browsers (opinionated).
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Remove the default vertical scrollbar in IE.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10-.
* 2. Remove the padding in IE 10-.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding and cancel buttons in Chrome and Safari on OS X.
*/
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Correct the text style of placeholders in Chrome, Edge, and Safari.
*/
::-webkit-input-placeholder {
color: inherit;
opacity: 0.54;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}

View File

@@ -0,0 +1,2 @@
@import "../index.styl"

View File

@@ -0,0 +1,56 @@
.live
padding-top 0.4rem
.live_item
width: 9.36rem;
margin: 0 auto;
margin-bottom: 0.52rem;
.item_content
position relative
height: 5.2rem;
img
position absolute
width: 100%;
height: 100%
z-index -1
.view
padding: 0.12rem 0.267rem;
box-sizing: border-box;
height: 0.533rem;
background-color: #000;
border-radius: 0.267rem;
opacity: 0.7;
font-size: 0.293rem;
line-height: 0.313rem;
color: #fff;
position absolute
left 50%
top 50%
margin-left calc(-4.093rem / 2)
.status
width: 1.52rem;
height: 0.48rem;
border-radius: 0.053rem;
color #fff
font-size: 0.32rem;
position absolute
right: 0.187rem;
top: 0.187rem;
text-align: center;
.green
background-color: #28c372;
.orrgan
background-color: #ff7412;
.fs
background-color: #f8647e;
.nums
font-size: 0.293rem;
color: #ffffff;
position absolute
right: 0.173rem;
bottom: 0.16rem;
.text
margin-top 0.28rem
font-size: 0.4rem;
line-height: 0.6rem;
color: #333333;

View File

@@ -0,0 +1,35 @@
.radio
.radio_info
text-align: center;
padding-top: 1.347rem;
margin-bottom 0.733rem
h2
font-size: 0.48rem;
font-weight: normal;
font-stretch: normal;
letter-spacing: 0rem;
color: #000000;
margin-bottom 0.84rem;
.back
width: 7.467rem;
height: 7.467rem;
.gif
width 7.467rem;
height: 1.2rem;
margin-top 0.667rem
.radio_action
width: 7.467rem;
display flex
align-items center
justify-content space-between
margin: 0 auto;
.refresh
.list
width: 0.52rem;
height: 0.52rem;
.start
width: 1.6rem;
height: 1.6rem;

View File

@@ -0,0 +1,11 @@
.tv
.item
flex(space-between)
height 1.6rem
padding 0 0.813rem
span
font-size 0.427rem
color #333333
img
width 0.36rem
height 0.4rem

View File

@@ -0,0 +1,36 @@
<template lang="pug">
.OpenComment 打开APP查看全部评论
</template>
<script>
export default {
data() {
return {}
},
created() {
},
methods: {
async getTvList() {
}
}
}
</script>
<style scoped lang="stylus">
.OpenComment
width: 9.36rem;
height: 1.173rem;
border-radius: 0.107rem;
border: solid 0.027rem #d0302c;
line-height 1.173rem;
text-align center
font-size: 0.373rem;
color: #d0302c;
position fixed
bottom 0.533rem
left 50%
margin-left calc(-9.36rem / 2)
background: #fff;
</style>

View File

@@ -0,0 +1,117 @@
<template lang="pug">
.Recommend
.title 相关推荐
.theme-1(v-if="theme == 1")
.theme_1_f(:style="{ width: totalWidth + 'rem' }")
.item(v-for="(item,index) in recommendList" :key="index")
.item_top
img(:src="item.cover")
.item_bottom {{item.title }}
.theme-2(v-else-if="theme == 2")
.theme_1_f
.item(v-for="(item,index) in recommendList" :key="index")
.left
p {{item.title }}
img.right_mg(:src="item.cover")
.error(v-else) 没有该布局参考使用文档传入合理参数
</template>
<script>
export default {
props: {
theme: {
type: Number,
default: 1
},
recommendList: {
type: Array,
default: []
}
},
data() {
return {
totalWidth: this.recommendList.length * 3.653 + 0.32 + (0.13 * (this.recommendList.length ))
}
},
created() {
},
filters: {
sub(val) {
return val.substring(0,10);
}
},
methods: {
async getTvList() {
}
}
}
</script>
<style scoped lang="stylus">
.Recommend
.title
height: 1.333rem;
background-color: #ffffff;
line-height 1.333rem;
font-size: 0.427rem;
color: #333333;
padding-left 0.32rem
box-sizing border-box
border-top: 1px solid #e5e5e5;
.theme-1
width: 100%;
overflow-x: scroll;
padding-left: 0.32rem;
box-sizing: border-box;
.theme_1_f,
.theme_2_f
display flex
.item
margin-right: 0.13rem;
.item_top
width: 3.653rem;
height: 2.08rem;
position relative
img
width: 100%;
height 100%;
.time
font-family: PingFangSC-Medium;
font-size: 0.293rem;
line-height: 0.512rem;
color: #ffffff;
position absolute
right: 0.187rem;
bottom 0.173rem;
z-index: 3;
.item_bottom
width: 3.333rem;
font-family: PingFangSC-Medium;
font-size: 0.343rem;
color: #333333;
.theme-2
.item
display: flex;
padding-bottom 0.627rem
border-bottom 1px solid #e5e5e5;
margin-bottom 0.631rem
padding-left: 0.307rem;
.left
p
font-family: PingFangSC-Medium;
font-size: 0.427rem;
color: #333333;
.time
margin-top 0.533rem
font-size: 0.32rem;
color: #999999;
.right_mg
width: 3.013rem;
height: 2.267rem;
border-radius: 0.053rem;
margin-left: 0.413rem;
/*.theme-2*/
</style>

View File

@@ -0,0 +1,111 @@
<template lang="pug">
.comment
.comment_title 全部评论
.comment_list(v-if="commentList.length != 0")
.comment_item(v-for="(item,index) in commentList" :key="index")
img(class="item_logo" :src="item.image")
.item_right
.right_top
.left
h2 {{item.nick_name}}
.time {{item.create_time}}
.right
img(src="/img/icon/give_thumbs-up.png")
span {{item.praise_count}}
.right_bottom {{item.content}}
.nodata(v-else)
img(src="/img/hm_bg_img_no.png")
p 快来发表你的评论吧
</template>
<script>
export default {
props: {
commentList: {
type: Array,
default: []
}
},
data() {
return {
}
},
created() {
},
methods: {
async getTvList() {
}
}
}
</script>
<style scoped lang="stylus">
.comment
width: 100%;
margin-bottom: 80px;
.comment_title
height: 1.347rem;
line-height 1.347rem;
font-family: PingFangSC-Bold;
font-size: 0.427rem;
color: #333333;
padding-left 0.32rem
margin-bottom 0.373rem
.nodata
text-align center
img
width: 5.56rem;
height: 4.653rem;
margin-bottom 0.68rem
p
font-family: PingFang-SC-Medium;
font-size: 0.373rem;
line-height: 0.448rem;
color: #999999;
.comment_list
.comment_item
display flex
box-sizing border-box
padding 0 0.32rem 0 0.307rem
margin-bottom 0.933rem
.item_logo
width: 0.933rem;
height: 0.947rem;
border-radius 100%
margin-right 0.267rem
.item_right
width: 100%;
.right_top
display flex
justify-content space-between
.left
h2
font-family: PingFang-SC-Bold;
font-size: 0.373rem;
color: #333333
margin-bottom 0.133rem
.time
font-family: PingFang-SC-Medium;
font-size: 0.267rem;
color: #999999;
.right
display: flex;
align-items: center;
img
width: 0.347rem;
height: 0.36rem;
margin-right 0.133rem
span
font-family: PingFang-SC-Medium;
font-size: 0.32rem;
color: #999999;
.right_bottom
margin-top 0.393rem
font-size: 0.373rem;
line-height: 0.56rem;
letter-spacing: 0.008rem;
color: #333333;
</style>

View File

@@ -0,0 +1,61 @@
<template lang="pug">
.header
.logo
img(class="logo_icon" src="/img/icon/gw_img_logo.png")
img(class="logo_text" src="/img/icon/logo_text_icon.png")
.open 打开
</template>
<script>
export default {
data() {
return {
}
},
created() {
},
methods: {
async getTvList() {
}
}
}
</script>
<style scoped lang="stylus">
.header
width: 100%;
height: 1.333rem;
background-color: #000000;
opacity: 0.7;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 0.533rem 0 0.32rem;
box-sizing: border-box;
position fixed
left 0
top 0
.logo
display: flex;
align-items: center;
.logo_icon
width: 0.867rem;
height: 0.867rem;
.logo_text
margin-left 0.253rem
width: 1.76rem;
height: 0.613rem;
.open
width: 2rem;
height: 0.693rem;
background-color: #d0302c;
font-family: PingFangSC-Medium;
line-height: 0.693rem;
font-size 16px
text-align center
border-radius 0.2rem
color: #ffffff;
</style>

View File

@@ -0,0 +1,51 @@
<template lang="pug">
.play
video-player(v-if=" Object.keys(videoUrl).length != 0 ").video-player-box.video-player.vjs-custom-skin(:style="{display: `${isHidden ? 'none' : 'block'}`}" ref='videoPlayer', :options='playerOptions', :playsinline='true')
</template>
<script>
export default {
props: {
videoUrl: {
type: Object,
default: {}
},
isHidden: { // true 隐藏播放, false 显示播放
type: Boolean,
default: false
}
},
data() {
return {
playerOptions:{
// videojs options
muted: false,
language: 'en',
playbackRates: [0.7, 1.0, 1.5, 2.0],
sources: []
}
}
},
created() {
},
watch: {
videoUrl: function (val) {
console.log("检测到传入播放地址")
this.playerOptions.sources.push(val)
console.log("播放配置参数:", this.playerOptions)
}
},
methods: {
play () {
this.$refs.videoPlayer.player.play()
},
pause() {
this.$refs.videoPlayer.player.pause()
}
}
}
</script>
<style scoped lang="stylus">
</style>

View File

@@ -0,0 +1,18 @@
export default {
apiUrl: {
devUrl: 'http://115.159.153.142:9020/h5',
// devUrl: 'https://zbhapi.ahtv.cn/h5/',
// prodUrl: 'https://zbhapi.ahtv.cn/h5/',
list: {
channelList: '/channelList',
login: '/login',
radio: '/radio',
liveList: '/liveList',
liveDetail: '/liveDetail',
liveComment: '/liveComment',
videoDetail: '/videoDetail', // 视频页面接口
interactDetail: '/interactDetail',
newsDetail: '/newsDetail'
}
}
}

View File

@@ -0,0 +1,77 @@
import axios from "axios";
import utils from "../utils"
import { Toast } from 'vant';
class Axios {
constructor() {
// 测试请求基地址 http://115.159.153.142:9010/h5
// 正式请求基地址 http://115.159.153.142:9020/h5
console.log(utils.getApiurl())
this.instance = axios.create({
baseURL: utils.getApiurl(),
timeout: 3000
});
this.interceptorsRequest();
this.interceptorsResponse();
}
/**
*
* @param params
* {
* url: '',
* data: {}
* }
* @returns {Promise<void>}
*/
async get(params) {
return await this.instance.get(params.url, {
params: params.data
})
}
async post(params) {
return await this.instance.post(params.url, params.data)
}
// 添加请求拦截器
interceptorsRequest() {
this.instance.interceptors.request.use(function (config) {
// 在发送请求之前做些什么
Toast.loading({
message: '正在加载...',
forbidClick: true,
});
return config;
}, function (error) {
// 对请求错误做些什么
return Promise.reject(error);
});
}
// 添加响应拦截器
interceptorsResponse() {
this.instance.interceptors.response.use(function (response) {
// 对响应数据做点什么
Toast.clear();
switch (response.data.resultCode) {
case '000':
return response.data.data;
break;
case '500':
Toast(response.data.message);
break;
}
}, function (error) {
// 对响应错误做点什么
return Promise.reject(error);
});
}
}
export default new Axios();

View File

@@ -0,0 +1,10 @@
import http from "../";
import config from "../../config";
export default class BaseService {
constructor() {
this.config = config;
this.http = http
}
}

View File

@@ -0,0 +1,59 @@
import BaseService from "./BaseService"
export default class IndexService extends BaseService {
async getTvList(params) {
return await this.http.get({
url: this.config.apiUrl.list.channelList,
data: params
})
}
async radio(params) {
return await this.http.get({
url: this.config.apiUrl.list.radio,
data: params
})
}
async liveList(params) {
return await this.http.get({
url: this.config.apiUrl.list.liveList,
data: params
})
}
async liveDetail(params) {
return await this.http.get({
url: this.config.apiUrl.list.liveDetail,
data: params
})
}
async liveComment(params) {
return await this.http.get({
url: this.config.apiUrl.list.liveComment,
data: params
})
}
async videoDetail(params) {
return await this.http.get({
url: this.config.apiUrl.list.videoDetail,
data: params
})
}
async interactDetail(params) {
return await this.http.get({
url: this.config.apiUrl.list.interactDetail,
data: params
})
}
async newsDetail(params) {
return await this.http.get({
url: this.config.apiUrl.list.newsDetail,
data: params
})
}
}

View File

@@ -0,0 +1,12 @@
import BaseService from "./BaseService"
export default class InfoService extends BaseService {
async getInfoList(params) {
return await http.get({
url: config.apiUrl.list.channelList,
data: params
})
}
}

View File

@@ -0,0 +1,7 @@
import InfoService from "./InfoService";
import IndexService from "./IndexService";
export default {
InfoService: new InfoService(),
IndexService: new IndexService(),
}

View File

@@ -0,0 +1,29 @@
import Vue from 'vue';
import App from './App.vue';
import router from './router';
import 'amfe-flexible/index.js'
import VueVideoPlayer from 'vue-video-player'
import 'video.js/dist/video-js.css'
import hls from "videojs-contrib-hls"
Vue.use(VueVideoPlayer)
Vue.use(hls)
import Vant from 'vant';
import index from "./http/service"
import 'vant/lib/index.css';
Vue.use(Vant);
Vue.prototype.$http = index;
Vue.config.productionTip = false;
new Vue({
router,
render: (h) => h(App),
}).$mount('#app');

View File

@@ -0,0 +1,44 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '../views/Home.vue';
Vue.use(VueRouter);
const routes = [
{
path: '/',
name: 'Home',
component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue'),
},
{
path: '/info',
name: 'info',
component: () => import(/* webpackChunkName: "PlayLive" */ '../views/PlayLive.vue'),
},
{
path: '/shareVideo',
name: 'shareVideo',
component: () => import(/* webpackChunkName: "PlayLive" */ '../views/ShareVideo.vue'),
},
{
path: '/newInfo',
name: 'newInfo',
component: () => import(/* webpackChunkName: "PlayLive" */ '../views/newInfo.vue'),
},
{
path: '/Newsdetail',
name: 'Newsdetail',
component: () => import(/* webpackChunkName: "PlayLive" */ '../views/Newsdetail'),
}
];
const router = new VueRouter({
routes,
});
const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
};
export default router;

View File

@@ -0,0 +1,15 @@
import config from "../config"
class Utils {
getApiurl () {
if (process.env.NODE_ENV === 'production') {
return config.apiUrl.prodUrl
} else {
return config.apiUrl.devUrl
}
}
}
export default new Utils();

View File

@@ -0,0 +1,55 @@
<template lang="pug">
.home
van-tabs(v-model='active' @click="changeContent")
van-tab( v-for="(item,index) in TabsTitle" :key="index" :title='item.text')
div(:is="component")
</template>
<script>
// @ is an alias to /src
// import HelloWorld from '@/components/Lower.vue';
import Radio from '@/views/Radio.vue';
import Tv from '@/views/Tv.vue';
import Live from '@/views/Live.vue';
export default {
name: 'Home',
components: {
Radio,
Tv,
Live
},
data() {
return {
active: 0,
component: Radio,
TabsTitle: [
{ id: 0, text: '包河Radio', components: Radio },
{ id: 1, text: '包河TV', components: Tv },
{ id: 2, text: '融媒直播', components: Live },
]
}
},
created() {
this.active = parseInt(this.$route.query.id)
this.component = this.TabsTitle[this.active].components
},
methods: {
changeContent(index) {
this.active = index
this.$router.push({
path: '/',
query: {
id: index
}
})
this.component = this.TabsTitle[this.active].components
}
}
};
</script>
<style scoped lang="stylus">
@import "~@styl/home.styl"
</style>

View File

@@ -0,0 +1,37 @@
<template lang="pug">
.live.content
.live_item(v-for="(i,index) in liveList")
router-link(:to="{ name: 'info', query: { id: i.id } }")
.item_content
img(:src="i.coverimage")
.view(v-if="i.status == 3") 直播时间{{i.start_time}}
.status(:class="i.status == 10 ? 'orrgan' : i.status == 3 ? 'green' : i.status == 1 || i.status == 2 ? 'fs': ''") {{ i.status == 10 ? '正在直播' : i.status == 3 ? '直播预告' : i.status == 1 || i.status == 2 ? '回放': '' }}
.nums {{ i.status == 10 ? `${i.number}人看过` : i.status == 3 ? `${i.appointment_count}人预约` : i.status == 1 || i.status == 2 ? `${i.number}人看过`: '' }}
.text {{i.title}}
</template>
<script>
export default {
name: "Live",
data() {
return {
liveList: ""
}
},
created() {
this.getLiveList()
},
methods: {
async getLiveList() {
let res = await this.$http.IndexService.liveList({})
this.liveList = res.list
console.log("this.liveList: ", this.liveList)
}
}
}
</script>
<style scoped lang="stylus">
*@import "~@styl/live.styl"
</style>

View File

@@ -0,0 +1,71 @@
<template lang="pug">
.Newsdetail
headerComponents
.content
.newtitle
h2 暴降17度合肥天气明起大反转还有暴雨来袭
.newtitleb
span 2019-10-07
span 08:00
span 浏览量238.0
.list
h2 {{titel.title}}}
span {{create.create_time}}}
commentComponents
OpenCommentomponents
</template>
<script>
import headerComponents from "@/components/header.vue"
import commentComponents from "@/components/comment.vue"
import OpenCommentomponents from "@/components/OpenComment.vue"
import VideoComponents from "@/components/videPlayer.vue"
export default {
comments: {
headerComponents,
commentComponents,
OpenCommentomponents,
VideoComponents,
},
data() {
return {
id: this.$route.query.id,
titel: {},
create: {}
}
},
created() {
this.getnew()
},
methods: {
async getnew() {
let res = await this.$http.IndexService.newsDetail({
Newsdetail: this.id
});
this.titel = res.detail;
this.create = res.create_time
}
}
}
</script>
<style scoped lang="stylus">
.newtitle
width: 9.36rem;
height: 1.227rem;
line-height: 0.72rem;
letter-spacing: 0.013rem;
margin: 0.32rem 0.33rem 0.507rem 0.307rem
h2
font-size: 0.533rem;
color: #333333;
.newtitleb
width: 5.333rem;
height: 0.307rem;
font-size: 0.32rem;
color: #999999;
display flex
margin-left 0.293rem
justify-content space-between
</style>

View File

@@ -0,0 +1,113 @@
<template lang="pug">
.play_live
headerComponents
.content
VideoComponents(:videoUrl="playVideo")
.video_message
h2 {{liveList.title}}
.yy {{liveList.collection_count}}人预约
.item
.left
img(src="/img/icon/give_thumbs-up.png")
span {{liveList.like_count}}
.right(@click="showContent")
span 简介
img(v-if="!isShow" src="/img/icon/open-close.png")
img(v-else src="/img/icon/open-just.png")
.jianjie(v-show="isShow") 测试次卧和减肥贝加尔我逼疯就和我不放假好玩吧放假回
commentComponents(:commentList="CommentList")
OpenCommentomponents
</template>
<script>
import headerComponents from "@/components/header.vue"
import commentComponents from "@/components/comment.vue"
import OpenCommentomponents from "@/components/OpenComment.vue"
import VideoComponents from "@/components/videPlayer.vue"
export default {
components: {
headerComponents,
commentComponents,
OpenCommentomponents,
VideoComponents
},
data() {
return {
id: this.$route.query.id,
CommentList: [], // 保存直播的评论数据
liveList: {},
playVideo: {},
isShow: false
}
},
created() {
this.getInfo()
this.liveComment();
console.log(this.id)
},
methods: {
showContent() {
this.isShow = !this.isShow
},
async liveComment() {
let res = await this.$http.IndexService.liveComment({
object_id: this.id
})
this.CommentList = res.list
},
async getInfo() {
let res = await this.$http.IndexService.liveDetail({
live_id: this.id
});
this.liveList = res.live;
this.playVideo = {
type: "application/x-mpegURL",
src: this.liveList.hls_play_url
}
console.log("详情:",this.liveList)
}
}
}
</script>
<style scoped lang="stylus">
.video_message
padding 0.653rem 0.32rem 0 0.37rem
box-sizing border-box
h2
font-size: 0.48rem;
color: #333333;
margin-bottom 0.24rem
.yy
font-family: PingFangSC-Medium;
font-size: 0.307rem;
color: #999999;
.jianjie
margin-top 0.547rem
margin-bottom 0.52rem
font-size: 0.373rem;
line-height: 0.627rem;
color: #999999;
.item
display flex
justify-content space-between
span
font-size: 0.32rem;
color: #999999;
.left
img
width: 0.347rem;
height: 0.36rem;
vertical-align: middle;
margin-right 0.133rem
.right
img
width: 0.227rem;
height: 0.133rem;
margin-left 0.147rem
vertical-align: middle;
</style>

View File

@@ -0,0 +1,57 @@
<template lang="pug">
.radio.content
.radio_info
h2 {{RadioInfo.title}}
img(class="back" :src="RadioInfo.logo")
img.gif(:src="showPlay ? one : two")
.radio_action
img.refresh(src="/img/icon/live_broadcast_icon.png")
img.start(@click="StartPlay" :src="showPlay ? start : pause")
img.list(src="/img/icon/program_list_icon.png")
VideoPlayComponents(ref="video" :videoUrl="playUrl" :isHidden="true")
</template>
<script>
import VideoPlayComponents from "@/components/videPlayer.vue"
export default {
components: {
VideoPlayComponents
},
data() {
return {
RadioInfo: {},
showPlay: true, // 控制图片的切换 true radio_up false radio_stop
start: '/img/radio_up.png',
pause: '/img/radio_stop.png',
one: '/img/sound_spectrum.png',
two: '/img/sound_spectrum.gif',
playUrl: {}
}
},
created() {
this.getRadioList()
},
methods: {
async getRadioList() {
this.RadioInfo = await this.$http.IndexService.radio({});
this.playUrl = {
type: "application/x-mpegURL",
src: this.RadioInfo.play_url
}
},
StartPlay() {
if (this.showPlay) {
this.$refs.video.play()
} else {
this.$refs.video.pause()
}
this.showPlay = !this.showPlay
}
}
}
</script>
<style scoped lang="stylus">
@import "~@styl/radio.styl"
</style>

View File

@@ -0,0 +1,56 @@
<template lang="pug">
.ShareVideo
headerComponents
.content
VideoComponents(:videoUrl="videoObj")
RecommendComponents(:theme="1" :recommendList="recommend")
commentComponents
OpenCommentomponents
</template>
<script>
import headerComponents from "@/components/header.vue"
import VideoComponents from "@/components/videPlayer.vue"
import RecommendComponents from "@/components/Recommend.vue"
import commentComponents from "@/components/comment.vue"
import OpenCommentomponents from "@/components/OpenComment.vue"
export default {
components: {
VideoComponents,
headerComponents,
commentComponents,
RecommendComponents,
OpenCommentomponents
},
data() {
return {
id: this.$route.query.id,
comment: [],
detail: [],
recommend: [],
videoObj: {}
}
},
created() {
this.getVideInfo()
},
methods: {
async getVideInfo() {
let res = await this.$http.IndexService.videoDetail({
id: this.id
});
this.comment = res.comment
this.detail = res.detail
this.videoObj = {
type: "video/mp4",
src: this.detail.play_url
}
this.recommend = res.recommend
}
}
}
</script>
<style scoped lang="stylus">
</style>

View File

@@ -0,0 +1,33 @@
<template lang="pug">
.tv
.item(v-for="(item,index) in TvList" :key="index")
span {{item.title}}
img(src="/img/icon_gb.png")
</template>
<script>
export default {
data() {
return {
TvList: []
}
},
created() {
this.getTvList()
},
methods: {
async getTvList() {
// let res = await this.$http.get({
// url: '/channelList',
// data: { page: 1, count: 15 }
// });
this.TvList = await this.$http.IndexService.getTvList({ page: 1, count: 15 });
}
}
}
</script>
<style scoped lang="stylus">
@import "~@styl/tv.styl"
</style>

View File

@@ -0,0 +1,22 @@
<template lang="pug">
.tv ceshi
</template>
<script>
export default {
data() {
},
created() {
},
methods: {
async getTvList() {
}
}
}
</script>
<style scoped lang="stylus">
@import "~@styl/test.styl"
</style>

View File

@@ -0,0 +1,49 @@
<template lang="pug">
.newInfo
van-swipe(v-if=" Object.keys(interactDetail).length != 0 " @change='onChange')
van-swipe-item(v-for="(item,index) in interactDetail.image" :key="index")
img(:src="item")
template(#indicator)
.custom-indicator {{ currentIndex + 1 }}/{{interactDetail.image.length}}
</template>
<script>
export default {
data() {
return {
id: this.$route.query.id,
interactDetail: {},
currentIndex: 0
}
},
created() {
this.getTzInfo()
},
methods: {
onChange(index) {
this.currentIndex = index;
},
async getTzInfo() {
let res = await this.$http.IndexService.interactDetail({
id: this.id
});
this.interactDetail = res.detail
console.log("帖子详情:", this.interactDetail)
}
}
}
</script>
<style scoped lang="stylus">
.custom-indicator {
position: absolute;
right: 5px;
bottom: 5px;
padding: 2px 5px;
font-size: 12px;
background: rgba(0, 0, 0, 0.1);
}
</style>

View File

@@ -0,0 +1,40 @@
const path = require("path");
module.exports = {
lintOnSave: false,
publicPath: './',
chainWebpack: config => {
config.module.rule('pug')
.test(/\.pug$/)
.use('pug-html-loader')
.loader('pug-html-loader')
.end();
config.resolve.alias
.set('@c',resolve('src/components'))
.set('@img',resolve('src/assets/img'))
.set('@styl',resolve('src/assets/stylus/page'));
const types = ['vue-modules', 'vue', 'normal-modules', 'normal']
types.forEach(type => addStyleResource(config.module.rule('stylus').oneOf(type)))
}
}
function addStyleResource (rule) {
rule.use('style-resource')
.loader('style-resources-loader')
.options({
patterns: [
path.resolve(__dirname, './src/assets/stylus/index.styl'),
],
})
}
function resolve(dir) {
return path.join(__dirname, dir);
}