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,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -0,0 +1,19 @@
# zaibaohe
## 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": "zaibaohe",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"amfe-flexible": "^2.2.1",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"vant": "^2.12.3",
"videojs-contrib-hls": "^5.15.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vue-video-player": "^5.0.2",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"postcss-pxtorem": "^5.1.1",
"pug": "^3.0.0",
"pug-html-loader": "^1.1.5",
"pug-plain-loader": "^1.1.0",
"vue-template-compiler": "^2.6.11"
}
}

View File

@@ -0,0 +1,12 @@
module.exports = {
plugins: {
'autoprefixer': {
browsers: ['Android >= 4.0', 'iOS >= 7']
},
'postcss-pxtorem': {
rootValue: 37.5,
//这是基准值,在375px的屏幕变大rem的值会变大,小于这个大小元素的rem值会变小
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: 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="">
<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,10 @@
<template lang="pug">
#app
keep-alive
router-view(v-if='$route.meta.keepAlive' :key="$route.fullPath")
router-view(v-if='!$route.meta.keepAlive' :key="$route.fullPath")
</template>
<style lang="less">
@import "~@common/_.less";
</style>

View File

@@ -0,0 +1,4 @@
@import "normalize.less";
@import "base.less";
@import "colors.less";
@import "mixins.less";

View File

@@ -0,0 +1,30 @@
@import "./normalize.less";
body,ul,li,p,h1,h2,h3,h4,h5,h6 {
margin: 0;
padding: 0;
list-style: none;
}
a {
text-decoration: none;
}
input {
outline: none;
}
.home .van-tabs__wrap {
border-bottom: 1px solid #e5e5e5;
position: fixed !important;
width: 100%;
left: 0;
top: 0;
}
.tv-info .van-tab__pane {
height: calc(100vh - 1.333rem - 211px - 44px);
overflow-y: scroll;
}
.navbar-content {
padding-top: 1.333rem;
}

View File

@@ -0,0 +1,20 @@
.ellipsis() {
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
word-wrap: break-word;
}
.no-scrollbar() {
&::-webkit-scrollbar {
display: none !important;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
opacity: 0 !important;
}
}
.line() {
border-bottom: 1px solid #e5e5e5;
}

View File

@@ -0,0 +1,419 @@
/*! 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.
*/
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,10 @@
@import "../common/_.less";
.home {
h2 {
color: @themeColor;
font-size: 37.5px;
}
.content {
padding-top: 45px;
}
}

View File

@@ -0,0 +1,24 @@
.radio {
text-align: center;
.title {
margin-top: 1.347rem;
font-size: 0.48rem;
color: #000000;
margin-bottom: 0.84rem;
}
.banner {
width: 7.467rem;
height: 7.467rem;
margin-bottom: 0.667rem;
}
.progress {
display: block;
height: 1.2rem;
margin: 0 auto;
}
.play {
margin-top: 0.733rem;
width: 1.6rem;
height: 1.6rem;
}
}

View File

@@ -0,0 +1,59 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

View File

@@ -0,0 +1,66 @@
<template lang="pug">
.navbar
.left
img(src="/img/icon/gw_img_logo.png")
img(src="/img/icon/logo_text_icon.png")
.right 打开
</template>
<script>
export default {
data() {
return {
}
},
created() {
},
methods: {
},
components: {
}
}
</script>
<style lang="less" scoped>
.navbar {
width: 100%;
position: fixed;
height: 1.333rem;
background-color: #000000;
z-index: 999;
opacity: 0.7;
left: 0;
top: 0;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 0.32rem;
box-sizing: border-box;
.left {
display: flex;
align-items: center;
img {
&:first-child {
width: 0.867rem;
height: 0.867rem;
margin-right: 0.253rem;
}
&:last-child {
width: 1.76rem;
height: 0.613rem;
}
}
}
.right {
width: 1.92rem;
height: 0.693rem;
background-color: #d0302c;
border-radius: 0.107rem;
color: #ffff;
text-align: center;
line-height:0.693rem;
font-size: 0.32rem;
}
}
</style>

View File

@@ -0,0 +1,114 @@
<template lang="pug">
.recommend
.title 相关推荐
//- 竖排新闻列表
.theme1_content(v-if="theme == 'theme1'")
router-link.item(tag="div" v-for="v,i in list" :to="{ name: 'news', query: { id: v.id } }")
.item-left
p {{ v.title }}
span {{ v.size }}
img.item-right(:src="v.cover")
//- 视频列表
.theme2_content(v-else)
router-link.item(tag="div" v-for="v,i in list" :to="{ name: 'videoinfo', query: { id: v.id } }")
.item-top
img(:src="v.cover")
span {{ v.size }}
p.item-bottom {{ v.title }}
</template>
<script>
export default {
props: {
theme: {
default: "theme1",
type: String,
},
list: {
default: () => [],
type: Array,
}
},
data() {
return {};
},
created() {},
methods: {},
components: {},
};
</script>
<style lang="less" scoped>
.recommend {
.title {
height: 1.347rem;
background-color: #ffffff;
padding-left: 0.32rem;
line-height: 1.347rem;
font-size: 0.427rem;
color: #333333;
}
.theme1_content {
padding-left: 0.307rem;
padding-right: 0.32rem;
.item {
display: flex;
border-bottom: 1px solid #e5e5e5;
padding-bottom: 0.613rem;
padding-top: 0.427rem;
.item-left {
margin-right: 0.413rem;
p {
font-size: 0.427rem;
color: #333333;
margin-bottom: 0.333rem;
}
span {
font-size: 0.32rem;
color: #999999;
}
}
.item-right {
width: 3.013rem;
height: 2.267rem;
}
}
}
.theme2_content {
display: flex;
overflow-x: scroll;
padding-left: 0.307rem;
padding-right: 0.32rem;
.item {
width: 3.653rem;
flex-shrink: 0;
margin-right: 0.147rem;
.item-top {
width: 100%;
height: 2.08rem;
position: relative;
img {
width: 100%;
height: 100%;
}
span {
position: absolute;
right: 0.187rem;
bottom: 0.173rem;
width: 0.76rem;
font-size: 0.293rem;
color: #ffffff;
}
}
.item-bottom {
margin-top: 0.32rem;
font-size: 0.373rem;
color: #333333;
}
.active {
color: #d0302c;
}
}
}
}
</style>

View File

@@ -0,0 +1,54 @@
<template lang="pug">
.tv-list
ul.list
router-link(tag="li" :to="{ name: 'TvInfo', query: { id: v.id, url: v.play_url } }" v-for="v,i in listData" :key="i")
span(:class="v.id == currentId ? 'active' : '' ") {{ v.title }}
img(v-if="v.id == currentId" src="/img/act-list.gif")
</template>
<script>
export default {
props: {
listData: {
type: Array,
default: () => [],
}
},
data() {
return {
currentId: this.$route.query.id
};
},
created() {
},
methods: {},
components: {},
};
</script>
<style lang="less" scoped>
.tv-list {
.list {
li {
height: 1.6rem;
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 0.56rem;
border-bottom: 1px solid #e5e5e5;
span {
font-size: 0.427rem;
color: #333333;
}
.active {
color: #d0302c;
}
img {
width: 0.36rem;
height: 0.4rem;
}
}
}
}
</style>

View File

@@ -0,0 +1,72 @@
<template lang="pug">
.video
videoPlayer(class="video-player-box"
ref="videoPlayer"
:options="playerOptions")
</template>
<script>
import "video.js/dist/video-js.css";
import { videoPlayer } from "vue-video-player";
import "videojs-contrib-hls";
export default {
props: {
videoUrl: {
type: Array,
default: ''
}
},
data() {
return {
playerOptions: {
playbackRates: [0.5, 1.0, 1.5, 2.0],
autoplay: false,
muted: false,
loop: false,
preload: 'none',
language: 'zh-CN',
aspectRatio: '16:9',
fluid: false,
sources: this.videoUrl,
poster: '',
notSupportedMessage: '此视频暂无法播放,请稍后再试',
controlBar: {
// 当前时间和总时间的 分隔符
timeDivider: true,
//当前播放时间
currentTimeDisplay: true,
// 总时间
durationDisplay: true,
/**
* 区分 currentTimeDisplay,timeDivider,durationDisplay
* remainingTimeDisplay显示默认样式,只显示当前播放时间,一般
* 为false
*/
remainingTimeDisplay: false,
fullscreenToggle: true
}
},
};
},
created() {
},
mounted() {
},
methods: {
play () {
this.$refs.videoPlayer.player.play()
},
stop() {
this.$refs.videoPlayer.player.pause()
}
},
components: {
videoPlayer,
},
};
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,32 @@
import Vant from 'vant'
import 'vant/lib/index.css'
import service from '../service/_'
import Videos from '../components/Video';
export default {
DevUrl: 'https://zbhapi.ahtv.cn/h5',
ProdUrl: 'http://115.159.153.142:9020/h5',
check: function () {
if (process.env.NODE_ENV == "development") {
return this.DevUrl
} else {
return this.ProdUrl
}
},
ApiUrl: {
radio: '/radio',
channelList: '/channelList',
channelComment: '/channelComment',
newsDetail: '/newsDetail',
videoDetail: '/videoDetail'
},
VuePlug: [ Vant ],
CustomPlug: [
{ n: '$api', v: service }
],
components: [
{ n: 'v-video', v: Videos }
],
}

View File

@@ -0,0 +1,68 @@
import axios from 'axios'
import config from '@config'
import { Toast } from 'vant'
class Http {
constructor() {
this.intercept();
}
intercept() {
// 添加请求拦截器
axios.interceptors.request.use(function (config) {
Toast.loading({
message: '加载中...',
forbidClick: true,
});
// 在发送请求之前做些什么
return config;
}, function (error) {
// 对请求错误做些什么
return Promise.reject(error);
});
// 添加响应拦截器
axios.interceptors.response.use(function (response) {
Toast.clear();
switch (response.data.resultCode) {
case '000':
return response.data.data
break;
case '500':
Toast({
message: response.data.message,
position: 'bottom',
});
throw new Error(`请求错误:${response.data.message}`)
break;
}
}, function (error) {
// 对响应错误做点什么
return Promise.reject(error);
});
}
async get(url, params = {}, header = {}) {
this.SetBaseUrl()
return await axios.get(url, {
params: params,
headers: header
})
}
async post(url, params = {}, header = {}) {
this.SetBaseUrl()
return await axios.post(url, params, {
headers: header
})
}
SetBaseUrl() {
if (axios.defaults.baseURL == null) {
axios.defaults.baseURL = config.check();
}
}
}
export default new Http()

View File

@@ -0,0 +1,20 @@
import 'amfe-flexible'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import config from './config';
// 配置vue插件
config.VuePlug.forEach((v)=> Vue.use(v));
config.CustomPlug.forEach((v) => Vue.prototype[v.n] = v.v);
config.components.forEach(v => Vue.component(v.n, v.v));
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

View File

@@ -0,0 +1,37 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'Home',
component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue'),
meta: {
keepAlive: true,
}
},
{
path: '/tvInfo',
name: 'TvInfo',
component: () => import(/* webpackChunkName: "home" */ '../views/TvInfo.vue'),
meta: {
keepAlive: false,
}
},
{
path: '/videoinfo',
name: 'videoinfo',
component: () => import(/* webpackChunkName: "home" */ '../views/VideoInfo.vue'),
meta: {
keepAlive: false,
}
}
]
const router = new VueRouter({
routes
})
export default router

View File

@@ -0,0 +1,46 @@
import http from '@http'
import config from '@config'
class HomeService {
async radios (params = {}) {
return await http.get(
config.ApiUrl.radio,
params,
{}
)
}
async channelList (params = {}) {
return await http.get(
config.ApiUrl.channelList,
params,
{}
)
}
async channelComment (params = {}) {
return await http.get(
config.ApiUrl.channelComment,
params,
{}
)
}
async newsDetail (params = {}) {
return await http.get(
config.ApiUrl.newsDetail,
params,
{}
)
}
async videoDetail (params = {}) {
return await http.get(
config.ApiUrl.videoDetail,
params,
{}
)
}
}
export default new HomeService()

View File

@@ -0,0 +1,5 @@
import HomeService from './HomeService';
export default {
home: HomeService
}

View File

@@ -0,0 +1,15 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
},
mutations: {
},
actions: {
},
modules: {
}
})

View File

@@ -0,0 +1,5 @@
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>

View File

@@ -0,0 +1,48 @@
<template lang="pug">
.home
van-tabs(v-model='active' fixed)
van-tab(title="包河radio")
.content
RadioComponents
van-tab(title="包河TV")
.content
TvComponents
van-tab(title="融媒直播")
.content
LiveComponents
</template>
<script>
import RadioComponents from './Radio'
import TvComponents from './Tv'
import LiveComponents from './Live'
export default {
name: 'Home',
data() {
return {
active: 0
}
},
created() {
// this.GetIndexData();
},
methods: {
// async GetIndexData () {
// var a = await this.$api.home.index({
// id: 1
// })
// console.log(a.data.result.newest)
// this.newest = a.data.result.newest
// }
},
components: {
RadioComponents,
TvComponents,
LiveComponents
}
}
</script>
<style scoped lang="less">
@import "~@views/Home.less";
</style>

View File

@@ -0,0 +1,23 @@
<template lang="pug">
.live live
</template>
<script>
export default {
data() {
return {
}
},
created() {
},
methods: {
},
components: {
}
}
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,55 @@
<template lang="pug">
.radio
.title {{radioData.title}}
v-video(hidden ref="radioVideo" v-if="viderUrl.length != 0" :video-url="viderUrl")
img(class="banner" :src="radioData.frontcover")
img(class="progress" :src="progressImg")
img(class="play" :src="PlayImg" @click="playVideo")
</template>
<script>
// "http://10454-haitun.liveplay.myqcloud.com/live/10454_zbh_2001021036394.m3u8?txSecret=a068e2d05c23d3f035831afe590b9402&txTime=5FEFDC49"
export default {
data() {
return {
radioData: {},
viderUrl: [],
PlayImg: '/img/radio_up.png',
progressImg: '/img/sound_spectrum.png'
}
},
created() {
this.GetRadio();
},
methods: {
async GetRadio() {
let res = await this.$api.home.radios();
res.play_url = "https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8";
this.viderUrl = [
{
type: 'application/x-mpegURL',
src: res.play_url,
}
]
this.radioData = res;
},
playVideo() {
if (this.PlayImg.indexOf("radio_up") != -1) {
this.$refs.radioVideo.play();
this.PlayImg = "/img/radio_stop.png"
this.progressImg = "/img/sound_spectrum.gif"
} else {
this.$refs.radioVideo.stop();
this.PlayImg = "/img/radio_up.png"
this.progressImg = "/img/sound_spectrum.png"
}
}
},
components: {
}
}
</script>
<style lang="less" scoped>
@import "~@views/Radio.less";
</style>

View File

@@ -0,0 +1,38 @@
<template lang="pug">
.tv
TvList(:list-data="list")
</template>
<script>
import TvList from '@com/TvList.vue';
export default {
data() {
return {
page: 1,
list: []
}
},
created() {
this.GetChannelList()
},
methods: {
async GetChannelList() {
let res = await this.$api.home.channelList({
page: this.page,
count: 100
});
console.log(res);
this.list = res;
}
},
components: {
TvList
}
}
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,63 @@
<template lang="pug">
.tv-info
NavbarComponents
.navbar-content
v-video(:video-url="videoUrl" v-if="videoUrl.length != 0")
van-tabs(v-model='active')
van-tab(title='频道')
TvList(:list-data="list")
van-tab(title='评论') 内容 2
</template>
<script>
import NavbarComponents from '@com/Navbar'
import TvList from '@com/TvList.vue';
export default {
data() {
return {
radioData: {},
videoUrl: [],
list: [],
commentList: [],
active: 0,
}
},
created() {
this.GetChannelList();
this.GetChannelComment();
},
methods: {
// 获取评论
async GetChannelComment() {
let res = await this.$api.home.channelComment({
object_id: this.$route.query.id
});
this.commentList = res.list;
console.log(res);
},
async GetChannelList() {
let res = await this.$api.home.channelList({
page: this.page,
count: 100
});
this.videoUrl = [{
type: 'video/x-flv',
src: this.$route.query.url,
}]
console.log(this.videoUrl);
this.list = res;
}
},
components: {
NavbarComponents,
TvList
}
}
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,36 @@
<template lang="pug">
.videoinfo
RecommendComponents(theme="theme1" :list="info.recommend")
</template>
<script>
//import RecommendComponents from '@com/Recommend'
export default {
data() {
return {
id: this.$route.query.id,
info: {}
}
},
created() {
this.GetVideoDetail()
},
methods: {
async GetVideoDetail() {
this.info = await this.$api.home.videoDetail({
id: this.id
});
console.log(this.info);
}
},
components: {
RecommendComponents
}
}
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,28 @@
const path = require('path');
function resolve(dir){
return path.join(__dirname,dir)
}
module.exports = {
publicPath: './',
chainWebpack: (config) => {
// 配置别名
config.resolve.alias
.set('@',resolve('./src'))
.set('@config',resolve('./src/config'))
.set('@service',resolve('./src/service'))
.set('@view',resolve('./src/view'))
.set('@http',resolve('./src/http'))
.set('@com',resolve('./src/components'))
.set('@views',resolve('./src/assets/less/views'))
.set('@common',resolve('./src/assets/less/common'))
config.module.rule('pug')
.test(/\.pug$/)
.use('pug-html-loader')
.loader('pug-html-loader')
.end()
}
}