| | |
| | | <script type="text/javascript" charset="utf-8" |
| | | src="http://webapi.amap.com/maps?v=1.3&key=xxxxxx&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script> |
| | | <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script> |
| | | <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script> |
| | | <style> |
| | | #weather { |
| | | font-weight: 400; |
| | | opacity: 0.7; |
| | | font-size: 14px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .time { |
| | | position: relative; |
| | | top: -6px; |
| | | } |
| | | </style> |
| | | </head> |
| | |
| | | {{nowTime.year}}年{{nowTime.month}}月{{nowTime.day}}日 {{nowTime.hour}}:{{nowTime.minute}}:{{nowTime.second}} |
| | | </span> |
| | | <span class="weathers"> |
| | | {{weathers.nowWeather}} {{weathers.highTemperature}}-{{weathers.lowTemperature}} |
| | | <!-- {{city}}:{{weathers.nowWeather}} {{weathers.highTemperature}}-{{weathers.lowTemperature}} --> |
| | | <iframe width="235" scrolling="no" height="30" frameborder="0" allowtransparency="true" |
| | | src="https://i.tianqi.com?c=code&id=34&icon=1&site=12"></iframe> |
| | | </span> |
| | | </div> |
| | | <script> |
| | |
| | | that.weathers.lowTemperature = nowDay.low.slice(3); |
| | | that.begin = true; |
| | | }) |
| | | }, |
| | | getCity() { |
| | | var ctiyName = returnCitySN["cname"]; |
| | | console.log(ctiyName, 4343543); |
| | | this.city = '南昌' |
| | | this.getWeather(); |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | setInterval(() => { |
| | | this.getNewTime(); |
| | | }, 1000); |
| | | this.getWeather(); |
| | | // this.getWeather(); |
| | | this.getCity(); |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | </body> |
| | | |
| | | </html> |
| | | </html> |