From 90ea31221fa7ed5e2a4508bba95740dbe6d5c055 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Sat, 08 May 2021 11:35:59 +0800
Subject: [PATCH] 实时时间 加上天气
---
public/weather/wea_img/dayu.png | 0
public/weather/wea_img/xiaoxue.png | 0
src/page/index/top/top-menu.vue | 2
public/weather/wea_img/wu.png | 0
public/xcxh5map/map.html | 118 +++++++++++-----------
public/weather/wea_img/mai.png | 0
public/weather/wea_img/leizhenyubingbao.png | 0
public/weather/wea_img/zhongyu.png | 0
public/weather/wea_img/qiangshachenbao.png | 0
src/page/crumbsL/crumbsL.vue | 42 +++++---
public/weather/wea_img/daxue.png | 0
public/weather/wea_img/天气.jpg | 0
public/weather/wea_img/default.png | 0
public/weather/wea_img/qing.png | 0
public/weather/wea_img/shachenbao.png | 0
public/weather/wea_img/zhenyu.png | 0
public/weather/wea_img/fuchen.png | 0
public/weather/wea_img/xiaoyu.png | 0
public/weather/wea_img/dabaoyu.png | 0
public/weather/wea_img/duoyun.png | 0
src/views/dataL/homeL.vue | 2
public/weather/wea_img/zhenxue.png | 0
public/weather/wea_img/yin.png | 0
public/weather/wea_img/tedabaoyu.png | 0
public/weather/wea_img/leizhenyu.png | 0
public/weather/index.html | 87 +++++++++++++++++
public/weather/wea_img/baoxue.png | 0
public/weather/wea_img/yangsha.png | 0
public/weather/wea_img/zhongxue.png | 0
public/weather/wea_img/baoyu.png | 0
public/weather/wea_img/dongyu.png | 0
31 files changed, 175 insertions(+), 76 deletions(-)
diff --git a/public/weather/index.html b/public/weather/index.html
new file mode 100644
index 0000000..50b5b6d
--- /dev/null
+++ b/public/weather/index.html
@@ -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}}日 {{nowTime.hour}}:{{nowTime.minute}}:{{nowTime.second}}
+ </span>
+ <span class="weathers">
+ {{weathers.nowWeather}} {{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>
\ No newline at end of file
diff --git a/public/weather/wea_img/baoxue.png b/public/weather/wea_img/baoxue.png
new file mode 100644
index 0000000..7fd7647
--- /dev/null
+++ b/public/weather/wea_img/baoxue.png
Binary files differ
diff --git a/public/weather/wea_img/baoyu.png b/public/weather/wea_img/baoyu.png
new file mode 100644
index 0000000..3f308c6
--- /dev/null
+++ b/public/weather/wea_img/baoyu.png
Binary files differ
diff --git a/public/weather/wea_img/dabaoyu.png b/public/weather/wea_img/dabaoyu.png
new file mode 100644
index 0000000..9626522
--- /dev/null
+++ b/public/weather/wea_img/dabaoyu.png
Binary files differ
diff --git a/public/weather/wea_img/daxue.png b/public/weather/wea_img/daxue.png
new file mode 100644
index 0000000..f391d45
--- /dev/null
+++ b/public/weather/wea_img/daxue.png
Binary files differ
diff --git a/public/weather/wea_img/dayu.png b/public/weather/wea_img/dayu.png
new file mode 100644
index 0000000..761ff5f
--- /dev/null
+++ b/public/weather/wea_img/dayu.png
Binary files differ
diff --git a/public/weather/wea_img/default.png b/public/weather/wea_img/default.png
new file mode 100644
index 0000000..44fde76
--- /dev/null
+++ b/public/weather/wea_img/default.png
Binary files differ
diff --git a/public/weather/wea_img/dongyu.png b/public/weather/wea_img/dongyu.png
new file mode 100644
index 0000000..334c6f8
--- /dev/null
+++ b/public/weather/wea_img/dongyu.png
Binary files differ
diff --git a/public/weather/wea_img/duoyun.png b/public/weather/wea_img/duoyun.png
new file mode 100644
index 0000000..45d0ccf
--- /dev/null
+++ b/public/weather/wea_img/duoyun.png
Binary files differ
diff --git a/public/weather/wea_img/fuchen.png b/public/weather/wea_img/fuchen.png
new file mode 100644
index 0000000..be3f0f9
--- /dev/null
+++ b/public/weather/wea_img/fuchen.png
Binary files differ
diff --git a/public/weather/wea_img/leizhenyu.png b/public/weather/wea_img/leizhenyu.png
new file mode 100644
index 0000000..2a30100
--- /dev/null
+++ b/public/weather/wea_img/leizhenyu.png
Binary files differ
diff --git a/public/weather/wea_img/leizhenyubingbao.png b/public/weather/wea_img/leizhenyubingbao.png
new file mode 100644
index 0000000..ec72b52
--- /dev/null
+++ b/public/weather/wea_img/leizhenyubingbao.png
Binary files differ
diff --git a/public/weather/wea_img/mai.png b/public/weather/wea_img/mai.png
new file mode 100644
index 0000000..0e51215
--- /dev/null
+++ b/public/weather/wea_img/mai.png
Binary files differ
diff --git a/public/weather/wea_img/qiangshachenbao.png b/public/weather/wea_img/qiangshachenbao.png
new file mode 100644
index 0000000..f008208
--- /dev/null
+++ b/public/weather/wea_img/qiangshachenbao.png
Binary files differ
diff --git a/public/weather/wea_img/qing.png b/public/weather/wea_img/qing.png
new file mode 100644
index 0000000..68b47a4
--- /dev/null
+++ b/public/weather/wea_img/qing.png
Binary files differ
diff --git a/public/weather/wea_img/shachenbao.png b/public/weather/wea_img/shachenbao.png
new file mode 100644
index 0000000..23f0b38
--- /dev/null
+++ b/public/weather/wea_img/shachenbao.png
Binary files differ
diff --git a/public/weather/wea_img/tedabaoyu.png b/public/weather/wea_img/tedabaoyu.png
new file mode 100644
index 0000000..2ec5be5
--- /dev/null
+++ b/public/weather/wea_img/tedabaoyu.png
Binary files differ
diff --git a/public/weather/wea_img/wu.png b/public/weather/wea_img/wu.png
new file mode 100644
index 0000000..31063c7
--- /dev/null
+++ b/public/weather/wea_img/wu.png
Binary files differ
diff --git a/public/weather/wea_img/xiaoxue.png b/public/weather/wea_img/xiaoxue.png
new file mode 100644
index 0000000..5fa1769
--- /dev/null
+++ b/public/weather/wea_img/xiaoxue.png
Binary files differ
diff --git a/public/weather/wea_img/xiaoyu.png b/public/weather/wea_img/xiaoyu.png
new file mode 100644
index 0000000..d29d04b
--- /dev/null
+++ b/public/weather/wea_img/xiaoyu.png
Binary files differ
diff --git a/public/weather/wea_img/yangsha.png b/public/weather/wea_img/yangsha.png
new file mode 100644
index 0000000..c352308
--- /dev/null
+++ b/public/weather/wea_img/yangsha.png
Binary files differ
diff --git a/public/weather/wea_img/yin.png b/public/weather/wea_img/yin.png
new file mode 100644
index 0000000..0b52dcd
--- /dev/null
+++ b/public/weather/wea_img/yin.png
Binary files differ
diff --git a/public/weather/wea_img/zhenxue.png b/public/weather/wea_img/zhenxue.png
new file mode 100644
index 0000000..6d4326f
--- /dev/null
+++ b/public/weather/wea_img/zhenxue.png
Binary files differ
diff --git a/public/weather/wea_img/zhenyu.png b/public/weather/wea_img/zhenyu.png
new file mode 100644
index 0000000..02caffe
--- /dev/null
+++ b/public/weather/wea_img/zhenyu.png
Binary files differ
diff --git a/public/weather/wea_img/zhongxue.png b/public/weather/wea_img/zhongxue.png
new file mode 100644
index 0000000..28bae7b
--- /dev/null
+++ b/public/weather/wea_img/zhongxue.png
Binary files differ
diff --git a/public/weather/wea_img/zhongyu.png b/public/weather/wea_img/zhongyu.png
new file mode 100644
index 0000000..2843e57
--- /dev/null
+++ b/public/weather/wea_img/zhongyu.png
Binary files differ
diff --git "a/public/weather/wea_img/\345\244\251\346\260\224.jpg" "b/public/weather/wea_img/\345\244\251\346\260\224.jpg"
new file mode 100644
index 0000000..7682fd9
--- /dev/null
+++ "b/public/weather/wea_img/\345\244\251\346\260\224.jpg"
Binary files differ
diff --git a/public/xcxh5map/map.html b/public/xcxh5map/map.html
index d0cfbc6..671da15 100644
--- a/public/xcxh5map/map.html
+++ b/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>
diff --git a/src/page/crumbsL/crumbsL.vue b/src/page/crumbsL/crumbsL.vue
index f87703b..86d172a 100644
--- a/src/page/crumbsL/crumbsL.vue
+++ b/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>
\ No newline at end of file
diff --git a/src/page/index/top/top-menu.vue b/src/page/index/top/top-menu.vue
index 373413e..30cd4a6 100644
--- a/src/page/index/top/top-menu.vue
+++ b/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: "数据模式",
diff --git a/src/views/dataL/homeL.vue b/src/views/dataL/homeL.vue
index 02cec46..614b7df 100644
--- a/src/views/dataL/homeL.vue
+++ b/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" });
--
Gitblit v1.9.3