南昌市物联网技防平台-前端
liuyg
2021-05-08 e24b801217dfc11deac4cc949a092d0189578950
天气
2 files modified
26 ■■■■ changed files
public/weather/index.html 24 ●●●● patch | view | raw | blame | history
src/page/crumbsL/crumbsL.vue 2 ●●● patch | view | raw | blame | history
public/weather/index.html
@@ -11,11 +11,20 @@
    <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>
@@ -26,7 +35,9 @@
            {{nowTime.year}}年{{nowTime.month}}月{{nowTime.day}}日&nbsp;{{nowTime.hour}}:{{nowTime.minute}}:{{nowTime.second}}
        </span>&nbsp;&nbsp;
        <span class="weathers">
            {{weathers.nowWeather}}&nbsp;{{weathers.highTemperature}}-{{weathers.lowTemperature}}
            <!-- {{city}}:{{weathers.nowWeather}}&nbsp;{{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>
@@ -70,6 +81,12 @@
                        that.weathers.lowTemperature = nowDay.low.slice(3);
                        that.begin = true;
                    })
                },
                getCity() {
                    var ctiyName = returnCitySN["cname"];
                    console.log(ctiyName, 4343543);
                    this.city = '南昌'
                    this.getWeather();
                }
            },
            mounted() {
@@ -77,11 +94,12 @@
                setInterval(() => {
                    this.getNewTime();
                }, 1000);
                this.getWeather();
                // this.getWeather();
                this.getCity();
            }
        })
    </script>
</body>
</html>
</html>
src/page/crumbsL/crumbsL.vue
@@ -21,7 +21,7 @@
    <div class="weather">
      <iframe
      class="weatherif"
        width="310"
        width="480"
        height="30"
        :src="urlData"
        scrolling="no"