Browse Source

外部文件配置操作

master
xuhuajiao 7 months ago
parent
commit
8d4772b042
  1. 4
      .env.development
  2. 1
      .env.production
  3. 1
      package.json
  4. 1
      public/index.html
  5. 5
      public/static/config.js
  6. 10
      src/api/library.js
  7. 64
      src/assets/styles/index.scss
  8. 6
      src/utils/request.js
  9. 23
      src/views/header/index.vue
  10. 20
      src/views/index.vue
  11. 4
      src/views/pageFour/index.vue
  12. 4
      src/views/pageOne/index.vue

4
.env.development

@ -3,8 +3,8 @@ ENV = 'development'
# 接口地址 # 接口地址
# 许镇-本地服地址 # 许镇-本地服地址
# VUE_APP_BASE_API = 'http://192.168.99.67:8080'
VUE_APP_BASE_API = 'http://27.19.209.92:13244'
VUE_APP_BASE_API = 'http://192.168.99.67:8080'
# VUE_APP_BASE_API = 'http://27.19.209.92:13244'
VUE_APP_LIB_API = 'http://118.253.150.248:8099' VUE_APP_LIB_API = 'http://118.253.150.248:8099'
# 是否启用 babel-plugin-dynamic-import-node插件 # 是否启用 babel-plugin-dynamic-import-node插件

1
.env.production

@ -3,6 +3,7 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
VUE_APP_BASE_API = 'http://192.168.1.80:7070' VUE_APP_BASE_API = 'http://192.168.1.80:7070'
VUE_APP_LIB_API = 'http://118.253.150.248:8099'
# VUE_APP_BASE_API = 'http://127.0.0.1:8080' # VUE_APP_BASE_API = 'http://127.0.0.1:8080'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://192.168.1.80:7071' VUE_APP_WS_API = 'ws://192.168.1.80:7071'

1
package.json

@ -19,7 +19,6 @@
"jquery": "^3.7.1", "jquery": "^3.7.1",
"svg-sprite-loader": "^6.0.11", "svg-sprite-loader": "^6.0.11",
"TagCloud": "^2.5.0", "TagCloud": "^2.5.0",
"video.js": "^8.16.1",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-awesome": "^4.0.2", "vue-awesome": "^4.0.2",
"vue-count-to": "^1.0.13", "vue-count-to": "^1.0.13",

1
public/index.html

@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
<script type="text/javascript" src="/static/config.js"></script>
</head> </head>
<body> <body>
<noscript> <noscript>

5
public/static/config.js

@ -0,0 +1,5 @@
window.g = {
AXIOS_TIMEOUT: 10000,
ApiUrl: 'http://27.16.212.58:11100', // 配置服务器地址,
LibUrl: 'http://118.253.150.248:8099' // 图创地址
}

10
src/api/library.js

@ -1,6 +1,15 @@
import request from '@/utils/request' import request from '@/utils/request'
import qs from 'qs' import qs from 'qs'
// 获取token
export function FetchInitToken(params) {
return request({
url: '/openlib/service/barcode/token' + '?' + qs.stringify(params, { indices: false }),
method: 'get',
urlType: 'interlib'
})
}
// 馆藏量 // 馆藏量
export function FetchLibBookTotal(params) { export function FetchLibBookTotal(params) {
return request({ return request({
@ -146,6 +155,7 @@ export function FetchWeekJH(params) {
} }
export default { export default {
FetchInitToken,
FetchLibBookTotal, FetchLibBookTotal,
FetchUsertotal, FetchUsertotal,
FetchFansCount, FetchFansCount,

64
src/assets/styles/index.scss

@ -35,12 +35,15 @@
z-index: 99999999; z-index: 99999999;
} }
.header-page{ .header-page{
position: fixed;
right: .175rem;
top: .175rem;
// position: fixed;
// right: .175rem;
// top: .175rem;
margin-left: .125rem;
margin-top: -0.125rem;
font-size:.175rem; font-size:.175rem;
background: rgba(82,146,255,0.2); background: rgba(82,146,255,0.2);
border: 1px solid #5292FF; border: 1px solid #5292FF;
height: .3125rem;
padding: 0 .075rem; padding: 0 .075rem;
line-height: .3125rem; line-height: .3125rem;
z-index: 999999; z-index: 999999;
@ -166,9 +169,11 @@
position: absolute; position: absolute;
} }
.header-weather { .header-weather {
top: .175rem;
width: 2.5rem;
right: 0.25rem;
// top: .175rem;
max-width: 2rem;
height: .625rem;
margin-top: .125rem;
// right: 0.25rem;
overflow: hidden; overflow: hidden;
} }
.header-date { .header-date {
@ -178,7 +183,7 @@
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
.time { .time {
width: 130px;
width: 1.625rem;
font-size: .375rem; font-size: .375rem;
font-weight: bold; font-weight: bold;
line-height: .375rem; line-height: .375rem;
@ -375,7 +380,7 @@
} }
&.lendingNum{ &.lendingNum{
top: 3.3rem; top: 3.3rem;
right: 19px;
right: .2375rem;
} }
&.cardNum{ &.cardNum{
top: 1.1625rem; top: 1.1625rem;
@ -439,9 +444,9 @@
.line-box { .line-box {
position: absolute; position: absolute;
top: 0; top: 0;
left: 23px;
width: 410px;
height: 410px;
left: .2875rem;
width: 5.125rem;
height: 5.125rem;
border-radius: 50%; border-radius: 50%;
border: 6px solid #fff; border: 6px solid #fff;
border-top-color: transparent; border-top-color: transparent;
@ -450,8 +455,8 @@
} }
.box { .box {
position: relative; position: relative;
width: 410px;
height: 410px;
width: 5.125rem;
height: 5.125rem;
border-radius: 50%; border-radius: 50%;
transform: rotate(-10deg) scaleY(0.1); transform: rotate(-10deg) scaleY(0.1);
animation: spin 3s infinite linear; animation: spin 3s infinite linear;
@ -460,15 +465,15 @@
.ball { .ball {
display: inline-block; display: inline-block;
background: #a0b8f3; background: #a0b8f3;
width: 30px;
height: 30px;
width: .375rem;
height: .375rem;
background: url('~@/assets/images/pageOne-5.png') no-repeat center center; background: url('~@/assets/images/pageOne-5.png') no-repeat center center;
background-size: cover; background-size: cover;
border-radius: 50%; border-radius: 50%;
position: absolute; position: absolute;
text-align: center; text-align: center;
left: 45px;
top: 45px;
left: .5625rem;
top: .5625rem;
animation: ball-spin 3s infinite linear; animation: ball-spin 3s infinite linear;
} }
.middle-img-bottom{ .middle-img-bottom{
@ -485,8 +490,8 @@
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 60px;
height: 10px;
width: .75rem;
height: .125rem;
background: linear-gradient( background: linear-gradient(
to right, to right,
rgba(0,0,0,0) 0%, rgba(0,0,0,0) 0%,
@ -783,7 +788,7 @@
justify-content: flex-start; justify-content: flex-start;
} }
.flop-figure { .flop-figure {
width: 26px;
width: .325rem;
i { i {
font-size: .3rem; font-size: .3rem;
font-weight: bold; font-weight: bold;
@ -1079,7 +1084,7 @@
align-items: center; align-items: center;
span{ span{
&:last-child{ &:last-child{
width: 226px;
width: 2.825rem;
text-align: right; text-align: right;
} }
} }
@ -1099,7 +1104,7 @@
position: absolute; position: absolute;
// transition: top 1s linear; // transition: top 1s linear;
margin-right: .175rem; margin-right: .175rem;
font-size: 18px;
font-size: .225rem;
line-height: .35rem; line-height: .35rem;
color: #ADC7FF; color: #ADC7FF;
overflow: hidden; overflow: hidden;
@ -1322,7 +1327,7 @@
background-color: #01103D; background-color: #01103D;
} }
.three01,.three02{ .three01,.three02{
height: 5.25rem;
height: 5.5rem;
} }
.three03,.three04{ .three03,.three04{
height: 4.7rem; height: 4.7rem;
@ -1344,14 +1349,15 @@
color: #47A6FF; color: #47A6FF;
} }
.three-lending-left{ .three-lending-left{
width: calc(100% - 5.25rem);
.totalItem{ .totalItem{
.pageLeft-flop-box{ .pageLeft-flop-box{
position: relative; position: relative;
height: 73px;
height: 0.9125rem;
margin: .2875rem 0 .4rem 0; margin: .2875rem 0 .4rem 0;
overflow: hidden; overflow: hidden;
& div:first-child { & div:first-child {
height: 70px;
height: 0.875rem;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
align-items: center; align-items: center;
@ -1360,11 +1366,11 @@
.flop-figure { .flop-figure {
position: relative; position: relative;
display: inline-block; display: inline-block;
width: 56px;
width: 0.7rem;
height: 100%; height: 100%;
line-height: 44px;
letter-spacing: 20px;
padding: 8px 0;
line-height: 0.55rem;
letter-spacing: .25rem;
padding: 0.1rem 0;
overflow: hidden; overflow: hidden;
writing-mode: vertical-lr; writing-mode: vertical-lr;
text-orientation: upright; text-orientation: upright;

6
src/utils/request.js

@ -1,6 +1,6 @@
import axios from 'axios' import axios from 'axios'
// import { Message } from 'element-ui' // import { Message } from 'element-ui'
console.log('window.g.ApiUrl', window.g.ApiUrl)
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
// baseURL: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_API : '/', // api 的 base_url // baseURL: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_API : '/', // api 的 base_url
@ -19,10 +19,10 @@ service.interceptors.request.use(
// } // }
switch (config.urlType) { switch (config.urlType) {
case 'local': case 'local':
config.url = process.env.VUE_APP_BASE_API + config.url
config.url = (process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API) + config.url
break break
case 'interlib': case 'interlib':
config.url = process.env.VUE_APP_LIB_API + config.url
config.url = (process.env.NODE_ENV === 'production' ? window.g.LibUrl : process.env.VUE_APP_LIB_API) + config.url
break break
} }
const token = '' // 登录后生成用于识别用户身份,项目不需要直接去掉 const token = '' // 登录后生成用于识别用户身份,项目不需要直接去掉

23
src/views/header/index.vue

@ -23,10 +23,13 @@
<div class="dot" /> <div class="dot" />
</div> </div>
</div> </div>
<div class="header-text header-weather">
<!-- 天气api: https://www.tianqi.com/plugin -->
<!-- <iframe id="weather" width="400" scrolling="no" height="30" frameborder="0" allowtransparency="true" src="https://i.tianqi.com?c=code&id=34&color=%23FFFFFF&icon=1&py=wuhan&site=18" /> -->
<iframe height="50" frameborder="0" scrolling="no" hspace="0" src="https://i.tianqi.com/?c=code&a=getcode&id=52&icon=1&color=%23FFFFFF&py=qiyang&site=14" />
<div style="display: flex; justify-content: flex-end; align-items: center; position: absolute; right: .175rem; top: .175rem; ">
<div class="header-weather">
<!-- 天气api: https://www.tianqi.com/plugin -->
<!-- <iframe id="weather" width="400" scrolling="no" height="30" frameborder="0" allowtransparency="true" src="https://i.tianqi.com?c=code&id=34&color=%23FFFFFF&icon=1&py=wuhan&site=18" /> -->
<iframe height="50" frameborder="0" scrolling="no" hspace="0" src="https://i.tianqi.com/?c=code&a=getcode&id=52&icon=1&color=%23FFFFFF&py=qiyang&site=14" />
</div>
<div class="header-page">{{ (currentIndex+1) +' / '+ pageData.length }}</div>
</div> </div>
</div> </div>
</template> </template>
@ -41,6 +44,18 @@ export default {
default: function() { default: function() {
return '' return ''
} }
},
currentIndex: {
type: Number,
default: function() {
return 0
}
},
pageData: {
type: Array,
default: function() {
return []
}
} }
}, },
data() { data() {

20
src/views/index.vue

@ -4,8 +4,8 @@
<dv-loading>Loading...</dv-loading> <dv-loading>Loading...</dv-loading>
</div> </div>
<!-- Header --> <!-- Header -->
<Header :header-title="headerTitle" />
<div class="header-page">{{ (currentIndex+1) +' / '+ pageData.length }}</div>
<Header :header-title="headerTitle" :current-index="currentIndex" :page-data="pageData" />
<!-- <div class="header-page">{{ (currentIndex+1) +' / '+ pageData.length }}</div> -->
<!-- 内容部分 --> <!-- 内容部分 -->
<!-- <keep-alive> <!-- <keep-alive>
<PageOne v-if="currentIndex === 0" ref="pageOneRefs" /> <PageOne v-if="currentIndex === 0" ref="pageOneRefs" />
@ -14,10 +14,6 @@
<PageThree v-if="currentIndex=== 2" /> <PageThree v-if="currentIndex=== 2" />
<PageFour v-if="currentIndex === 3" /> --> <PageFour v-if="currentIndex === 3" /> -->
<!-- <keep-alive exclude="PageFour">
<component :is="shouldCacheComponent" />
</keep-alive>
<component :is="currentPageComponent" /> -->
<keep-alive> <keep-alive>
<component :is="currentPage && currentPage.title" /> <component :is="currentPage && currentPage.title" />
</keep-alive> </keep-alive>
@ -41,7 +37,7 @@
</template> </template>
<script> <script>
import { FetchInitSetting } from '@/api/library'
import { FetchInitToken, FetchInitSetting } from '@/api/library'
import Header from '@/views/header/index.vue' import Header from '@/views/header/index.vue'
import PageOne from '@/views/pageOne/index.vue' import PageOne from '@/views/pageOne/index.vue'
import PageTwo from '@/views/map/index.vue' import PageTwo from '@/views/map/index.vue'
@ -133,9 +129,19 @@ export default {
this.yearTimer = null this.yearTimer = null
}, },
mounted() { mounted() {
// this.getToken()
this.showLoading() this.showLoading()
}, },
methods: { methods: {
getToken() {
const params = {
'appid': 'whfeitian',
'secret': '1f4unqcgg9j0pvx54cwvillch5xto9e5'
}
FetchInitToken(params).then(res => {
console.log(res)
})
},
startPageSwitch() { startPageSwitch() {
const delay = parseInt(this.pageData[this.currentIndex].delayed) * 1000 const delay = parseInt(this.pageData[this.currentIndex].delayed) * 1000
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {

4
src/views/pageFour/index.vue

@ -6,7 +6,6 @@
<h4>宣传视频</h4> <h4>宣传视频</h4>
<el-carousel <el-carousel
ref="carousel" ref="carousel"
height="710px"
indicator-position="none" indicator-position="none"
:autoplay="false" :autoplay="false"
:autoplay-hover-pause="true" :autoplay-hover-pause="true"
@ -328,6 +327,9 @@ export default {
.el-carousel{ .el-carousel{
margin-top: 0.475rem; margin-top: 0.475rem;
} }
.el-carousel__container{
height: 8.875rem;
}
video { video {
width: 100%; width: 100%;
height: 100%; height: 100%;

4
src/views/pageOne/index.vue

@ -774,8 +774,8 @@ export default {
@import "~@/assets/styles/index.scss"; @import "~@/assets/styles/index.scss";
@import "~@/assets/styles/font-some.css"; @import "~@/assets/styles/font-some.css";
#tagscloud{ #tagscloud{
width:400px;
height:380px;
width:5rem;
height:4.75rem;
position:relative; position:relative;
margin:0 auto; margin:0 auto;
} }

Loading…
Cancel
Save