diff --git a/src/main/resources/static/route/web/leader.html b/src/main/resources/static/route/web/leader.html index 04b2c20..95b7c0b 100644 --- a/src/main/resources/static/route/web/leader.html +++ b/src/main/resources/static/route/web/leader.html @@ -6,82 +6,61 @@ 乡镇街道综合办公平台 +
-
-
@@ -153,7 +132,8 @@ totalPage: 1, departmentId: '' }, - isLoading: false + isLoading: false, + weatherInfo: {} }, methods: { getLeader: function () { @@ -177,11 +157,36 @@ this.page.page = page this.getLeader() } - } + }, + // 获取天气 + getWeahther: function () { + var self = this + top.restAjax.get(top.restAjax.path('api/weather/get-weather-now', []), {}, null, function(code, data) { + self.weatherInfo = data + }, function(code, data) { + layer.msg(data.msg); + }, function() { + // loadLayerIndex = layer.load(0, {shade: false}); + }, function() { + // layer.close(loadLayerIndex); + }); + }, + // 获取日期 + getDate: function () { + var myDate = new Date; + var year = myDate.getFullYear(); //获取当前年 + var mon = myDate.getMonth() + 1; //获取当前月 + var date = myDate.getDate(); //获取当前日 + var week = myDate.getDay(); + var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]; + this.today = year + "年" + mon + "月" + date + "日 " + weeks[week] + }, }, mounted: function () { this.page.departmentId = restAjax.params(window.location.href).departmentId this.getLeader() + this.getWeahther() + this.getDate() } })