Browse Source

需求更改

master
xuhuajiao 3 months ago
parent
commit
11fb1b03a3
  1. 2
      .env.development
  2. 2
      public/static/config.js
  3. 16
      src/assets/styles/index.scss
  4. 2
      src/views/index.vue
  5. 2
      src/views/map/index.vue
  6. 5
      src/views/pageFour/index.vue
  7. 47
      src/views/pageOne/index.vue

2
.env.development

@ -3,7 +3,7 @@ ENV = 'development'
# 接口地址
# 许镇-本地服地址
VUE_APP_BASE_API = 'http://192.168.99.67:8080'
VUE_APP_BASE_API = 'http://192.168.99.67:6066'
# VUE_APP_BASE_API = 'http://27.19.209.92:13244'
VUE_APP_LIB_API = 'http://118.253.150.248:8099'

2
public/static/config.js

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

16
src/assets/styles/index.scss

@ -735,26 +735,26 @@
justify-content: space-between;
align-items: center;
flex-wrap: nowrap;
padding: .625rem .275rem 0 .125rem;
padding: .625rem .125rem 0 0;
.allTotal{
width: 48%;
width: 50%;
height: 1.1rem;
padding-left: 1.125rem;
padding-left: 1.15rem;
background: url('~@/assets/images/database-icon1.png') no-repeat left top;
background-size: 100% 100%;
}
.currentNum,
.lastYearTotal{
width: 48%;
width: 50%;
height: 1.1rem;
padding-left: 1.125rem;
padding-left: 1.1rem;
background: url('~@/assets/images/database-icon2.png') no-repeat left top;
background-size: 100% 100%;
}
.flop-figure {
position: relative;
display: inline-block;
width: .275rem;
width: .28rem;
height: 100%;
line-height: 0.15rem;
overflow: hidden;
@ -826,10 +826,10 @@
display: flex;
justify-content: space-between;
flex-wrap: wrap;
padding: 0 .375rem 0 .5rem;
padding: 0 .25rem 0 .38rem;
li{
position: relative;
width: 2.2rem;
width: 2.38rem;
font-size: .225rem;
padding-left: .1625rem;
margin-top: .7rem;

2
src/views/index.vue

@ -158,7 +158,7 @@ export default {
// selectorder 1 2
// show1
// show2
const linkSrc = process.env.VUE_APP_BASE_API
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
FetchInitSetting().then(res => {
const result = JSON.parse(res.data)
this.wecharQrCodeSrc = linkSrc + '/downloadFile' + result.wecharQrCode

2
src/views/map/index.vue

@ -858,7 +858,7 @@ export default {
},
updatePageWithData() {
this.displayedImages = []
const linkSrc = process.env.VUE_APP_BASE_API
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
const params = {
'branchId': this.libCurrent.id
}

5
src/views/pageFour/index.vue

@ -193,7 +193,8 @@ export default {
},
getInitData() {
// wecharQrCode /downloadFile/+wecharQrCode
const linkSrc = process.env.VUE_APP_BASE_API
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
console.log('linkSrc', linkSrc)
FetchInitSetting().then(res => {
const result = JSON.parse(res.data)
this.wecharQrCodeSrc = linkSrc + '/downloadFile' + result.wecharQrCode
@ -230,7 +231,7 @@ export default {
getVideoResource() {
FetchTotalResource().then(res => {
const result = JSON.parse(res.data)
const linkSrc = process.env.VUE_APP_BASE_API
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
this.slideData = result.map((item, index) => {
if (item.filePath) {
item.cover = linkSrc + '/downloadFile' + item.filePath

47
src/views/pageOne/index.vue

@ -242,6 +242,12 @@ export default {
}
},
async created() {
if (localStorage.getItem('yesterdayCountCache')) {
localStorage.removeItem('yesterdayCountCache')
}
if (localStorage.getItem('lastMonthCountCache')) {
localStorage.removeItem('lastMonthCountCache')
}
// this.getInitData()
this.getMiddleAllData()
this.getHotSearch()
@ -269,7 +275,8 @@ export default {
// visitBase
// wecharQrCode /downloadFile/+wecharQrCode
// iNotice
const linkSrc = process.env.VUE_APP_BASE_API
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
console.log('linkSrc', linkSrc)
FetchInitSetting().then(res => {
const result = JSON.parse(res.data)
this.pageOneVisitBase = result.visitBase
@ -302,10 +309,10 @@ export default {
// lastMonthVisitBaseCheck
const baseTotal = this.pageOneVisitBase //
// console.log('', baseTotal)
console.log('假设本年到馆人数', baseTotal)
// /12 =
const monthBase = Math.floor(baseTotal / 12) //
// console.log('', monthBase)
console.log('月基数', monthBase)
// -100200
const randomMonth = Math.floor(Math.random() * (200 - (-100) + 1)) + (-100)
@ -313,10 +320,10 @@ export default {
const year = now.getFullYear() //
const month = now.getMonth() + 1 //
const daysInMonth = new Date(year, month, 0).getDate() //
// console.log('', daysInMonth)
console.log('当月天数', daysInMonth)
// /28293031=
const dayBase = Math.floor(monthBase / daysInMonth) //
// console.log('', dayBase)
console.log('日基数', dayBase)
// =*+-100200
let nowYearCount
if (result.visitBaseCheck === '1') {
@ -324,28 +331,30 @@ export default {
} else {
nowYearCount = Math.floor(monthBase * month + randomMonth) //
}
// console.log('', nowYearCount)
console.log('本年累计', nowYearCount)
// =+-2050
let yesterdayCount = 0
if (result.yesterdayVisitBaseCheck === '1') {
yesterdayCount = result.yesterdayVisitBase
} else {
const randomDay = Math.floor(Math.random() * (50 - (-20) + 1)) + (-20) // -2050
yesterdayCount = localStorage.getItem('yesterdayCountCache') ? localStorage.getItem('yesterdayCountCache') : dayBase + randomDay //
// yesterdayCount = localStorage.getItem('yesterdayCountCache') ? localStorage.getItem('yesterdayCountCache') : dayBase + randomDay //
yesterdayCount = dayBase + randomDay //
}
// console.log('', yesterdayCount)
console.log('昨日到馆', yesterdayCount)
// =+-100200
let lastMonthCount = 0
if (result.lastMonthVisitBaseCheck === '1') {
lastMonthCount = result.lastMonthVisitBase
} else {
lastMonthCount = localStorage.getItem('lastMonthCountCache') ? localStorage.getItem('lastMonthCountCache') : monthBase + randomMonth
// lastMonthCount = localStorage.getItem('lastMonthCountCache') ? localStorage.getItem('lastMonthCountCache') : monthBase + randomMonth
lastMonthCount = monthBase + randomMonth
}
// console.log('', lastMonthCount)
console.log('上月到馆', lastMonthCount)
// /10=
const hourBase = Math.floor(dayBase / 10) //
// console.log('', hourBase)
console.log('小时基数', hourBase)
// 8:00-18:0010
// 8:00-9:00 19:00-10:002
const openTime = 8 //
@ -367,15 +376,19 @@ export default {
todayCount = Math.floor(hourBase * N + randomHour) //
}
}
// console.log('', todayCount)
console.log('今日到馆', todayCount)
// = * dd/+ -100200
let nowMonthCount = 0
if (result.thisMonthVisitBaseCheck === '1') {
nowMonthCount = result.thisMonthVisitBase
} else {
nowMonthCount = Math.floor(monthBase * (now.getDate() / daysInMonth) + randomMonth) //
if (now.getDate() === 1) {
nowMonthCount = todayCount
} else {
nowMonthCount = Math.floor(monthBase * (now.getDate() / daysInMonth) + randomMonth) //
}
}
// console.log('', nowMonthCount)
console.log('本月到馆', nowMonthCount)
this.progressData.push(
{
@ -416,8 +429,8 @@ export default {
this.$parent.timedRefresh(this.leftData, 'left')
//
localStorage.setItem('yesterdayCountCache', yesterdayCount)
localStorage.setItem('lastMonthCountCache', lastMonthCount)
// localStorage.setItem('yesterdayCountCache', yesterdayCount)
// localStorage.setItem('lastMonthCountCache', lastMonthCount)
},
//
@ -553,7 +566,7 @@ export default {
}
FetchNewBook(params).then(res => {
// http://192.168.99.67:8080/downloadFile/qytsg/ae281b90-b100-4541-9379-3e104854652c.png
const linkSrc = process.env.VUE_APP_BASE_API
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
this.newList = res.data.map(item => {
if (item.nbImgPath) {
item.nbImgPath = linkSrc + '/downloadFile' + item.nbImgPath

Loading…
Cancel
Save