Browse Source

pageOne云标签适配

master
xuhuajiao 7 months ago
parent
commit
df74b4f16a
  1. 1
      src/utils/request.js
  2. 25
      src/views/pageOne/index.vue
  3. 5
      src/views/pageThree/index.vue

1
src/utils/request.js

@ -1,6 +1,5 @@
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

25
src/views/pageOne/index.vue

@ -302,10 +302,10 @@ export default {
// lastMonthVisitBaseCheck // lastMonthVisitBaseCheck
const baseTotal = this.pageOneVisitBase // const baseTotal = this.pageOneVisitBase //
console.log('假设本年到馆人数', baseTotal)
// console.log('', baseTotal)
// /12 = // /12 =
const monthBase = Math.floor(baseTotal / 12) // const monthBase = Math.floor(baseTotal / 12) //
console.log('月基数', monthBase)
// console.log('', monthBase)
// -100200 // -100200
const randomMonth = Math.floor(Math.random() * (200 - (-100) + 1)) + (-100) const randomMonth = Math.floor(Math.random() * (200 - (-100) + 1)) + (-100)
@ -313,10 +313,10 @@ export default {
const year = now.getFullYear() // const year = now.getFullYear() //
const month = now.getMonth() + 1 // const month = now.getMonth() + 1 //
const daysInMonth = new Date(year, month, 0).getDate() // const daysInMonth = new Date(year, month, 0).getDate() //
console.log('当月天数', daysInMonth)
// console.log('', daysInMonth)
// /28293031= // /28293031=
const dayBase = Math.floor(monthBase / daysInMonth) // const dayBase = Math.floor(monthBase / daysInMonth) //
console.log('日基数', dayBase)
// console.log('', dayBase)
// =*+-100200 // =*+-100200
let nowYearCount let nowYearCount
if (result.visitBaseCheck === '1') { if (result.visitBaseCheck === '1') {
@ -324,7 +324,7 @@ export default {
} else { } else {
nowYearCount = Math.floor(monthBase * month + randomMonth) // nowYearCount = Math.floor(monthBase * month + randomMonth) //
} }
console.log('本年累计', nowYearCount)
// console.log('', nowYearCount)
// =+-2050 // =+-2050
let yesterdayCount = 0 let yesterdayCount = 0
if (result.yesterdayVisitBaseCheck === '1') { if (result.yesterdayVisitBaseCheck === '1') {
@ -333,7 +333,7 @@ export default {
const randomDay = Math.floor(Math.random() * (50 - (-20) + 1)) + (-20) // -2050 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 //
} }
console.log('昨日到馆', yesterdayCount)
// console.log('', yesterdayCount)
// =+-100200 // =+-100200
let lastMonthCount = 0 let lastMonthCount = 0
if (result.lastMonthVisitBaseCheck === '1') { if (result.lastMonthVisitBaseCheck === '1') {
@ -341,11 +341,11 @@ export default {
} else { } else {
lastMonthCount = localStorage.getItem('lastMonthCountCache') ? localStorage.getItem('lastMonthCountCache') : monthBase + randomMonth lastMonthCount = localStorage.getItem('lastMonthCountCache') ? localStorage.getItem('lastMonthCountCache') : monthBase + randomMonth
} }
console.log('上月到馆', lastMonthCount)
// console.log('', lastMonthCount)
// /10= // /10=
const hourBase = Math.floor(dayBase / 10) // const hourBase = Math.floor(dayBase / 10) //
console.log('小时基数', hourBase)
// console.log('', hourBase)
// 8:00-18:0010 // 8:00-18:0010
// 8:00-9:00 19:00-10:002 // 8:00-9:00 19:00-10:002
const openTime = 8 // const openTime = 8 //
@ -362,12 +362,12 @@ export default {
todayCount = 0 todayCount = 0
} else { } else {
const N = currentHour - openTime const N = currentHour - openTime
console.log('第N个小时', N)
// console.log('N', N)
const randomHour = Math.floor(Math.random() * (10 - (-5) + 1)) + (-5) // -510 const randomHour = Math.floor(Math.random() * (10 - (-5) + 1)) + (-5) // -510
todayCount = Math.floor(hourBase * N + randomHour) // todayCount = Math.floor(hourBase * N + randomHour) //
} }
} }
console.log('今日到馆', todayCount)
// console.log('', todayCount)
// = * dd/+ -100200 // = * dd/+ -100200
let nowMonthCount = 0 let nowMonthCount = 0
if (result.thisMonthVisitBaseCheck === '1') { if (result.thisMonthVisitBaseCheck === '1') {
@ -375,7 +375,7 @@ export default {
} else { } else {
nowMonthCount = Math.floor(monthBase * (now.getDate() / daysInMonth) + randomMonth) // nowMonthCount = Math.floor(monthBase * (now.getDate() / daysInMonth) + randomMonth) //
} }
console.log('本月到馆', nowMonthCount)
// console.log('', nowMonthCount)
this.progressData.push( this.progressData.push(
{ {
@ -471,7 +471,7 @@ export default {
// this.$parent.timedRefresh(this.middleData, 'middle') // this.$parent.timedRefresh(this.middleData, 'middle')
// }, 8000) // }, 8000)
}).catch(error => { }).catch(error => {
console.error('Error fetching data:', error)
console.error('Error:', error)
}) })
}, },
// //
@ -641,6 +641,7 @@ export default {
phi = Math.random() * (Math.PI) phi = Math.random() * (Math.PI)
theta = Math.random() * (2 * Math.PI) theta = Math.random() * (2 * Math.PI)
} }
this.radius = this.oList.offsetWidth / 2 - 40
// //
this.mcList[i - 1].cx = this.radius * Math.cos(theta) * Math.sin(phi) this.mcList[i - 1].cx = this.radius * Math.cos(theta) * Math.sin(phi)
this.mcList[i - 1].cy = this.radius * Math.sin(theta) * Math.sin(phi) this.mcList[i - 1].cy = this.radius * Math.sin(theta) * Math.sin(phi)

5
src/views/pageThree/index.vue

@ -229,9 +229,6 @@ export default {
this.$parent.timedRefresh(this.todayTotal, 'todayTotal') this.$parent.timedRefresh(this.todayTotal, 'todayTotal')
this.$parent.timedRefresh(this.yearTotal, 'yearTotal') this.$parent.timedRefresh(this.yearTotal, 'yearTotal')
console.log('this.todayTotal', this.todayTotal)
console.log('this.yearTotal', this.yearTotal)
} else { } else {
this.todayTotal = [] this.todayTotal = []
this.yearTotal = [] this.yearTotal = []
@ -383,8 +380,6 @@ export default {
this.chartWeeklyData.inchartWeeklyData = completeData.map(item => item.hccDayTotal) this.chartWeeklyData.inchartWeeklyData = completeData.map(item => item.hccDayTotal)
// // out // // out
this.chartWeeklyData.outchartWeeklyData = completeData.map(item => item.jccDayTotal) this.chartWeeklyData.outchartWeeklyData = completeData.map(item => item.jccDayTotal)
console.log(this.chartWeeklyData.date)
} else { } else {
this.chartWeeklyData = { this.chartWeeklyData = {
date: [], date: [],

Loading…
Cancel
Save