dab5de01 by 杨炀

隐藏天气插件

1 parent ff1d1919
...@@ -43,16 +43,18 @@ ...@@ -43,16 +43,18 @@
43 <ul class="wlist"> 43 <ul class="wlist">
44 <li v-for="n in weatherObj.forecast.slice(1,6)"> 44 <li v-for="n in weatherObj.forecast.slice(1,6)">
45 <div class="type"> 45 <div class="type">
46 <weather-icon :type="n.type" :width="32"/> 46 <weather-icon :type="n.type||n.wea" :width="32"/>
47 </div> 47 </div>
48 <div class="wd">{{n.low.slice(2,-1)}}/{{n.high.slice(2)}}</div> 48 <div class="wd" v-if="n.low">{{n.low.slice(2,-1)}}/{{n.high.slice(2)}}</div>
49 <div class="wd" v-if="n.tem_night">{{n.tem_night}}/{{n.tem_day}}</div>
49 <div class="week" v-if="language==1"> 50 <div class="week" v-if="language==1">
50 {{n.week=='星期一'?'Mon':n.week=='星期二'?'Tue':n.week=='星期三'?'Wed':n.week=='星期四'?'Thu':n.week=='星期五'?'Fri':n.week=='星期六'?'Sat':n.week=='星期日'?'Sun':''}} 51 {{n.week=='星期一'?'Mon':n.week=='星期二'?'Tue':n.week=='星期三'?'Wed':n.week=='星期四'?'Thu':n.week=='星期五'?'Fri':n.week=='星期六'?'Sat':n.week=='星期日'?'Sun':''}}
51 </div> 52 </div>
52 <div class="week" v-else> 53 <div class="week" v-else>
53 {{n.week}} 54 {{n.week}}
54 </div> 55 </div>
55 <div class="date mt10">{{n.ymd.slice(5,10)}}</div> 56 <div class="date mt10" v-if="n.ymd">{{n.ymd.slice(5,10)}}</div>
57 <div class="date mt10" v-else>{{n.date.slice(5,10)}}</div>
56 </li> 58 </li>
57 </ul> 59 </ul>
58 </div> 60 </div>
...@@ -83,7 +85,7 @@ import {ref} from "vue"; ...@@ -83,7 +85,7 @@ import {ref} from "vue";
83 import {getWeather} from "@/apiPc/webSite"; 85 import {getWeather} from "@/apiPc/webSite";
84 import {getCurrentInstance} from "@vue/runtime-core"; 86 import {getCurrentInstance} from "@vue/runtime-core";
85 const {proxy} = getCurrentInstance() 87 const {proxy} = getCurrentInstance()
86 const showgg = ref(true) 88 const showgg = ref(false)
87 89
88 const language = useStorage('language', 0) 90 const language = useStorage('language', 0)
89 const weatherObj = ref({ 91 const weatherObj = ref({
...@@ -94,9 +96,8 @@ init() ...@@ -94,9 +96,8 @@ init()
94 function init(){ 96 function init(){
95 getWeather().then(res=>{ 97 getWeather().then(res=>{
96 weatherObj.value = JSON.parse(res.data).data 98 weatherObj.value = JSON.parse(res.data).data
97 console.log(weatherObj.value) 99 showgg.value = true
98 }).catch(err=>{ 100 }).catch(err=>{
99 console.log(err)
100 showgg.value = false 101 showgg.value = false
101 }) 102 })
102 } 103 }
......
...@@ -81,11 +81,11 @@ export default defineConfig(({ mode, command }) => { ...@@ -81,11 +81,11 @@ export default defineConfig(({ mode, command }) => {
81 rewrite: (p) => p.replace(/^\/dev-api\/ztx-webSite/, '') 81 rewrite: (p) => p.replace(/^\/dev-api\/ztx-webSite/, '')
82 }, 82 },
83 '/dev-api': { 83 '/dev-api': {
84 target: 'http://192.168.1.118:8081/', 84 // target: 'http://192.168.1.118:8081/',
85 // target: 'http://192.168.1.131:8081/', 85 // target: 'http://192.168.1.131:8081/',
86 // target: 'https://jijin.wtwuxicenter.com/stage-api', 86 // target: 'https://jijin.wtwuxicenter.com/stage-api',
87 // target: 'http://124.70.181.90:1880/stage-api', 87 // target: 'http://124.70.181.90:1880/stage-api',
88 // target: 'https://wdsfwuxicenter.com/stage-api/', 88 target: 'https://wdsfwuxicenter.com/stage-api/',
89 changeOrigin: true, 89 changeOrigin: true,
90 rewrite: (p) => p.replace(/^\/dev-api/, '') 90 rewrite: (p) => p.replace(/^\/dev-api/, '')
91 }, 91 },
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!