liuyg
2021-05-08 90ea31221fa7ed5e2a4508bba95740dbe6d5c055
实时时间  加上天气
4 files modified
27 files added
251 ■■■■■ changed files
public/weather/index.html 87 ●●●●● patch | view | raw | blame | history
public/weather/wea_img/baoxue.png patch | view | raw | blame | history
public/weather/wea_img/baoyu.png patch | view | raw | blame | history
public/weather/wea_img/dabaoyu.png patch | view | raw | blame | history
public/weather/wea_img/daxue.png patch | view | raw | blame | history
public/weather/wea_img/dayu.png patch | view | raw | blame | history
public/weather/wea_img/default.png patch | view | raw | blame | history
public/weather/wea_img/dongyu.png patch | view | raw | blame | history
public/weather/wea_img/duoyun.png patch | view | raw | blame | history
public/weather/wea_img/fuchen.png patch | view | raw | blame | history
public/weather/wea_img/leizhenyu.png patch | view | raw | blame | history
public/weather/wea_img/leizhenyubingbao.png patch | view | raw | blame | history
public/weather/wea_img/mai.png patch | view | raw | blame | history
public/weather/wea_img/qiangshachenbao.png patch | view | raw | blame | history
public/weather/wea_img/qing.png patch | view | raw | blame | history
public/weather/wea_img/shachenbao.png patch | view | raw | blame | history
public/weather/wea_img/tedabaoyu.png patch | view | raw | blame | history
public/weather/wea_img/wu.png patch | view | raw | blame | history
public/weather/wea_img/xiaoxue.png patch | view | raw | blame | history
public/weather/wea_img/xiaoyu.png patch | view | raw | blame | history
public/weather/wea_img/yangsha.png patch | view | raw | blame | history
public/weather/wea_img/yin.png patch | view | raw | blame | history
public/weather/wea_img/zhenxue.png patch | view | raw | blame | history
public/weather/wea_img/zhenyu.png patch | view | raw | blame | history
public/weather/wea_img/zhongxue.png patch | view | raw | blame | history
public/weather/wea_img/zhongyu.png patch | view | raw | blame | history
public/weather/wea_img/天气.jpg patch | view | raw | blame | history
public/xcxh5map/map.html 118 ●●●● patch | view | raw | blame | history
src/page/crumbsL/crumbsL.vue 42 ●●●●● patch | view | raw | blame | history
src/page/index/top/top-menu.vue 2 ●●● patch | view | raw | blame | history
src/views/dataL/homeL.vue 2 ●●● patch | view | raw | blame | history
public/weather/index.html
New file
@@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>天气</title>
    <!-- axios -->
    <script src='../map/lib/axios.js'></script>
    <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>
    <style>
        #weather{
            font-weight: 400;
            opacity: 0.7;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div id="weather" v-if="begin">
        <span class="time">
            {{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}}
        </span>
    </div>
    <script>
        var me = new Vue({
            el: '#weather',
            data: {
                begin: false,
                weathers: {
                    nowWeather: '',
                    highTemperature: '',
                    lowTemperature: '',
                },
                nowTime: {
                    year: '',
                    month: '',
                    day: '',
                    hour: '',
                    minute: '',
                    second: '',
                },
                city: "南昌",
            },
            methods: {
                getNewTime() {
                    this.nowTime.year = (new Date()).getFullYear();
                    this.nowTime.month = (new Date()).getMonth();
                    this.nowTime.day = (new Date()).getDay();
                    this.nowTime.hour = (new Date()).getHours() < 10? '0' + (new Date()).getHours():(new Date()).getHours();
                    this.nowTime.minute = (new Date()).getMinutes() < 10? '0' + (new Date()).getMinutes():(new Date()).getMinutes();
                    this.nowTime.second = (new Date()).getSeconds() < 10? '0' + (new Date()).getSeconds():(new Date()).getSeconds();
                },
                getWeather(){
                    var that = this;
                    var url = `http://wthrcdn.etouch.cn/weather_mini?city=${this.city}`
                    axios.get(url).then((res)=>{
                        var data = res.data.data,
                        nowDay = data.forecast[0];
                        that.weathers.nowWeather = nowDay.type;
                        that.weathers.highTemperature = nowDay.high.slice(3);
                        that.weathers.lowTemperature = nowDay.low.slice(3);
                        that.begin = true;
                    })
                }
            },
            mounted() {
                this.getNewTime();
                setInterval(() => {
                    this.getNewTime();
                }, 1000);
                setTimeout(() => {
                    this.getWeather();
                }, 200);
            }
        })
    </script>
</body>
</html>
public/weather/wea_img/baoxue.png
public/weather/wea_img/baoyu.png
public/weather/wea_img/dabaoyu.png
public/weather/wea_img/daxue.png
public/weather/wea_img/dayu.png
public/weather/wea_img/default.png
public/weather/wea_img/dongyu.png
public/weather/wea_img/duoyun.png
public/weather/wea_img/fuchen.png
public/weather/wea_img/leizhenyu.png
public/weather/wea_img/leizhenyubingbao.png
public/weather/wea_img/mai.png
public/weather/wea_img/qiangshachenbao.png
public/weather/wea_img/qing.png
public/weather/wea_img/shachenbao.png
public/weather/wea_img/tedabaoyu.png
public/weather/wea_img/wu.png
public/weather/wea_img/xiaoxue.png
public/weather/wea_img/xiaoyu.png
public/weather/wea_img/yangsha.png
public/weather/wea_img/yin.png
public/weather/wea_img/zhenxue.png
public/weather/wea_img/zhenyu.png
public/weather/wea_img/zhongxue.png
public/weather/wea_img/zhongyu.png
public/weather/wea_img/天气.jpg
public/xcxh5map/map.html
@@ -32,66 +32,66 @@
    <script type="text/javascript">
        var map = null;
        function beginJuheMap(map) {
                map = L.map('map', { //初始化地图
                    center: [31.87, 120.54],
                    zoom: 12,
                    // crs: L.CRS.EPSG4326, //设置坐标系4326
                    attributionControl: false, //去掉右下角
                    zoomControl: false, //去掉缩放
                });
                L.tileLayer( //添加切片图层
                    "http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}", {
                        subdomains: ["1", "2", "3", "4"],
                        attribution: "高德"
                    }
                ).addTo(map);
                var markers = L.markerClusterGroup();
                var transportIcon = L.Icon.extend({ //图标初始化
                    options: {
                        iconSize: [30, 30], // 图标尺寸
                        // iconAnchor: [30, 30], // 图标偏移量
                        // popupAnchor: [-20, -20] // 弹出框偏移量
                    }
                });
                var carIcon = new transportIcon({ //引入图标
                        iconUrl: './img/gray.png'
                    }),
                    planeIcon = new transportIcon({
                        iconUrl: './img/green.png'
                    }),
                    busIcon = new transportIcon({
                        iconUrl: './img/red.png'
                    });
console.log(datalist,43545343)
                for (var i = 0; i < datalist.length; i++) {
                    var a = datalist[i];
                    var title = a.title;
                    if (a.state == 0) {
                        var marker = L.marker([a.jd, a.wd], {
                            icon: carIcon,
                            title: title
                        });
                    } else if (a.state == 1) {
                        var marker = L.marker([a.jd, a.wd], {
                            icon: planeIcon,
                            title: title
                        });
                    } else if (a.state == 2) {
                        var marker = L.marker([a.jd, a.wd], {
                            icon: busIcon,
                            title: title
                        });
                    }
                    marker.bindPopup(title);
                    markers.addLayer(marker);
                }
                map.addLayer(markers);
                markers.on('click', function(a) {
                    console.log(a.layer, 11111111111);
                });
            map = L.map('map', { //初始化地图
                center: [31.87, 120.54],
                zoom: 12,
                // crs: L.CRS.EPSG4326, //设置坐标系4326
                attributionControl: false, //去掉右下角
                zoomControl: false, //去掉缩放
            });
            L.tileLayer( //添加切片图层
                "http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}", {
                subdomains: ["1", "2", "3", "4"],
                attribution: "高德"
            }
            ).addTo(map);
            var markers = L.markerClusterGroup();
            var transportIcon = L.Icon.extend({ //图标初始化
                options: {
                    iconSize: [30, 30], // 图标尺寸
                    // iconAnchor: [30, 30], // 图标偏移量
                    // popupAnchor: [-20, -20] // 弹出框偏移量
                }
            });
            var carIcon = new transportIcon({ //引入图标
                iconUrl: './img/gray.png'
            }),
                planeIcon = new transportIcon({
                    iconUrl: './img/green.png'
                }),
                busIcon = new transportIcon({
                    iconUrl: './img/red.png'
                });
            console.log(datalist, 43545343)
            for (var i = 0; i < datalist.length; i++) {
                var a = datalist[i];
                var title = a.title;
                if (a.state == 0) {
                    var marker = L.marker([a.jd, a.wd], {
                        icon: carIcon,
                        title: title
                    });
                } else if (a.state == 1) {
                    var marker = L.marker([a.jd, a.wd], {
                        icon: planeIcon,
                        title: title
                    });
                } else if (a.state == 2) {
                    var marker = L.marker([a.jd, a.wd], {
                        icon: busIcon,
                        title: title
                    });
                }
                marker.bindPopup(title);
                markers.addLayer(marker);
            }
            map.addLayer(markers);
            markers.on('click', function (a) {
                console.log(a.layer, 11111111111);
            });
        }
        beginJuheMap(map);
    </script>
src/page/crumbsL/crumbsL.vue
@@ -2,19 +2,6 @@
  <div class="breadEval">
    <div class="breadTitle">
      <div class="titles">您的位置:</div>
      <!-- <button @click="cc">cccc</button> -->
      <!-- <el-breadcrumb-item style="position: relative;top: -3px;left: 5px">您的位置:</el-breadcrumb-item> -->
      <!-- <el-breadcrumb-item v-show="!onceRouter" :to="{ path: '/wel/index' }">首页</el-breadcrumb-item> -->
      <!-- <el-breadcrumb separator="/">
        <el-breadcrumb-item
          :to="item.path"
          v-for="item of breadListLast"
          :key="item.path"
        style="border: hotpink 1px solid"
        >
          {{ item.name }}
        </el-breadcrumb-item>
      </el-breadcrumb> -->
      <div
        class="ourCrumbsl"
        v-for="(item, index) of breadListLast"
@@ -31,10 +18,21 @@
        </div>
      </div>
    </div>
    <div class="weather">
      <IFRAME
      class="weatherif"
        WIDTH="310"
        HEIGHT="30"
        src="./weather/index.html"
        scrolling="no"
      ></IFRAME>
    </div>
    <!-- <router-view></router-view> -->
  </div>
</template>
<script>
import axios from "axios";
export default {
  //面包屑解决方案,此方法只适用于面包屑与路由显示顺序一致,例如path:01/02/03 面包屑也是01/02/03
  data() {
@@ -84,7 +82,10 @@
      if (this.isrf) {
        //刷新读取localStorage
        this.breadListLast = JSON.parse(localStorage.getItem("crumbsl"));
        this.$store.commit("SET_SHOWDATAL", localStorage.getItem("crumbslname"));
        this.$store.commit(
          "SET_SHOWDATAL",
          localStorage.getItem("crumbslname")
        );
      } else {
        //关闭重写
        var path = this.$route.path,
@@ -354,6 +355,9 @@
  font-size: 14px;
  height: 100%;
  background: #f3f7fd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  .breadTitle {
    padding: 20px 30px;
    padding-left: 80px;
@@ -369,11 +373,19 @@
      float: left;
      font-weight: 400;
      position: relative;
      top: -3px;
      top: 11.15px;
      a {
        font-weight: 400;
      }
    }
  }
  .weather {
    position: relative;
    top: 11.15px;
    right: 10px;
    .weatherif{
      border: transparent;
    }
  }
}
</style>
src/page/index/top/top-menu.vue
@@ -84,7 +84,7 @@
      homeItem: {
        name: "首页",
        source: "el-icon-s-home",
        path: "/dataL/homeL",
        path: "/wel/index",
      },
      dataItem: {
        name: "数据模式",
src/views/dataL/homeL.vue
@@ -39,7 +39,7 @@
      this.$router.push({ path: "/healthcode/healthcode" });
    },
    down3() {
      this.$router.push({ path: "/parcel/parcel" });
      this.$router.push({ path: "/parcel/parcelKind" });
    },
    down4() {
      this.$router.push({ path: "/animalHeat/animalHeat" });