Compare commits

..

No commits in common. "df68891c6027e124234282aa017aabcefb0f9616" and "0f9122a80bfa2eb77f1f8d3af5a105b388a1a85c" have entirely different histories.

4 changed files with 54 additions and 80 deletions

View File

@ -32,7 +32,7 @@
<script> <script>
import MinxinItem from "./mixins" import MinxinItem from "./mixins"
import axios from 'axios' import axios from 'axios'
import {getWather,Weather} from "./api/index.js"; import {getWather} from "./api/index.js";
export default { export default {
name: 'home', name: 'home',
mixins:[MinxinItem], mixins:[MinxinItem],
@ -60,8 +60,9 @@ export default {
handleWather(){ handleWather(){
// axios({url:"http://www.jcznedu.com:5000/weather/prediction/?city=&&limit=3",methods:'GET'}).then(res=>{ // axios({url:"http://www.jcznedu.com:5000/weather/prediction/?city=&&limit=3",methods:'GET'}).then(res=>{
// }) // })
Weather({ getWather({
city:'盐都',
limit:'3'
}).then((res)=>{ }).then((res)=>{
this.weatherArr = res.data.data.daly; this.weatherArr = res.data.data.daly;
this.weatherArr[0].date = '今天'; this.weatherArr[0].date = '今天';

View File

@ -55,15 +55,9 @@ export const getPbtyqk = (params) => {
params params
}) })
}; };
// //查询天气
// export const getWather = (params) => {
// return axios.get('aps/weather/prediction/', {
// params
// })
// };
//查询天气 //查询天气
export const Weather = (params) => { export const getWather = (params) => {
return axios.get('api/Handler/Weather.ashx', { return axios.get('aps/weather/prediction/', {
params params
}) })
}; };

View File

@ -452,32 +452,25 @@ export default {
dataGdzl = res.data.data dataGdzl = res.data.data
this.detailedTwo(dataGdzl); this.detailedTwo(dataGdzl);
}) })
// // //
// getPbtyqk({ getPbtyqk({
// action:"week" action:"week"
// }).then((res)=>{ }).then((res)=>{
// let dataPbty = []; let dataPbty = [];
// dataPbty = res.data.data dataPbty = res.data.data
// console.log(dataPbty,'dataPbty'); this.detailedFive(dataPbty);
// this.detailedFive(dataPbty); let dataPb = [];
// let dataPb = []; let dataCf = [];
// let dataCf = []; let dataCfl = [];
// let dataCfl = []; for (let i = 0; i < dataPbty.length; i++) {
// for (let i = 0; i < dataPbty.length; i++) { dataPb.push(dataPbty[i].pbsl);
// dataPb.push(dataPbty[i].pbsl); dataCf.push(dataPbty[i].cftytc);
// dataCf.push(dataPbty[i].cftytc); dataCfl.push(dataPbty[i].pbcftyl)
// dataCfl.push(dataPbty[i].pbcftyl) }
// } this.topContent[0].count = dataPb.reduce((x, y) => x + y)
// this.topContent[0].count = dataPb.reduce((x, y) => x + y) this.topContent[1].count = dataCf.reduce((x, y) => x + y)
// this.topContent[1].count = dataCf.reduce((x, y) => x + y) this.topContent[2].count = dataCfl.reduce((x, y) => x + y) + '%'
// let pbCount = (this.topContent[1].count/this.topContent[0].count)*100 })
// let pbCountString = pbCount.toString()
// if (pbCountString.indexOf(".") != -1) {
// this.topContent[2].count = pbCountString.substring(0,pbCountString.indexOf(".")+3) + '%'
// }else{
// this.topContent[2].count = pbCountString +'%'
// }
// })
this.handleDate(0); this.handleDate(0);
let that = this; let that = this;
window.addEventListener('message', function (e) { window.addEventListener('message', function (e) {
@ -1469,10 +1462,10 @@ export default {
}, },
handleDate(index){ handleDate(index){
this.currentIndex = index this.currentIndex = index
// if (index == 0) { if (index == 0) {
// //
getPbtyqk({ getPbtyqk({
action: index==0?"week":'month' action:"week"
}).then((res)=>{ }).then((res)=>{
let dataPbty = []; let dataPbty = [];
dataPbty = res.data.data dataPbty = res.data.data
@ -1485,39 +1478,25 @@ export default {
} }
this.topContent[0].count = dataPb.reduce((x, y) => x + y) this.topContent[0].count = dataPb.reduce((x, y) => x + y)
this.topContent[1].count = dataCf.reduce((x, y) => x + y) this.topContent[1].count = dataCf.reduce((x, y) => x + y)
let pbCount = (this.topContent[1].count/this.topContent[0].count)*100
let pbCountString = pbCount.toString()
if (pbCountString.indexOf(".") != -1) {
this.topContent[2].count = pbCountString.substring(0,pbCountString.indexOf(".")+3) + '%'
}else{
this.topContent[2].count = pbCountString +'%'
}
}) })
// }else if (index == 1) { }else if (index == 1) {
// // //
// getPbtyqk({ getPbtyqk({
// action:"month" action:"month"
// }).then((res)=>{ }).then((res)=>{
// let dataPbty = []; let dataPbty = [];
// dataPbty = res.data.data dataPbty = res.data.data
// this.detailedFive(dataPbty); this.detailedFive(dataPbty);
// let dataPb = []; let dataPb = [];
// let dataCf = []; let dataCf = [];
// for (let i = 0; i < dataPbty.length; i++) { for (let i = 0; i < dataPbty.length; i++) {
// dataPb.push(dataPbty[i].pbsl); dataPb.push(dataPbty[i].pbsl);
// dataCf.push(dataPbty[i].cftytc); dataCf.push(dataPbty[i].cftytc);
// } }
// this.topContent[0].count = dataPb.reduce((x, y) => x + y) this.topContent[0].count = dataPb.reduce((x, y) => x + y)
// this.topContent[1].count = dataCf.reduce((x, y) => x + y) this.topContent[1].count = dataCf.reduce((x, y) => x + y)
// let pbCount = (this.topContent[1].count/this.topContent[0].count)*100 })
// let pbCountString = pbCount.toString() }
// if (pbCountString.indexOf(".") != -1) {
// this.topContent[2].count = pbCountString.substring(0,pbCountString.indexOf(".")+3) + '%'
// }else{
// this.topContent[2].count = pbCountString +'%'
// }
// })
// }
}, },
addColor(index){ addColor(index){
if(this.currentIndex == index) { if(this.currentIndex == index) {

View File

@ -23,15 +23,15 @@ module.exports = {
'^/api':'', '^/api':'',
} }
}, },
// '/aps': { //代理的名字 '/aps': { //代理的名字
// target:'http://www.jcznedu.com:5000/', target:'http://www.jcznedu.com:5000/',
// // target: 'http://172.16.1.254:3111/', // target: 'http://172.16.1.254:3111/',
// ws: true, ws: true,
// changeOrigin: true, changeOrigin: true,
// pathRewrite:{ pathRewrite:{
// '^/aps':'', '^/aps':'',
// } }
// } }
} }
} }
} }