diff --git "a/1614080902213/1614080902213-\345\256\236\351\252\2141-#1.html" "b/1614080902213/1614080902213-\345\256\236\351\252\2141-#1.html" index c65484ba9..3e1bc43c6 100644 --- "a/1614080902213/1614080902213-\345\256\236\351\252\2141-#1.html" +++ "b/1614080902213/1614080902213-\345\256\236\351\252\2141-#1.html" @@ -3,9 +3,9 @@ - Soft1614080902213马宏杰 + Soft1614080902213 -Soft1614080902213马宏杰 +Soft1614080902213 diff --git a/1614080902213/resume-weui.html b/1614080902213/resume-weui.html new file mode 100644 index 000000000..5fca6fcd3 --- /dev/null +++ b/1614080902213/resume-weui.html @@ -0,0 +1,179 @@ + + + + Title + + + +
+ + +
+
+
姓名:
+
+
+

哈利波特

+
+
Harry Potter
+
+
性别:
+
+
+

+
+
Male
+
+
年龄:
+
+
+

18 岁

+
+
+
毕业学校:
+
+
+

霍格沃茨魔法学校

+
+
Hogwarts School of Witchcraft and Wizardry
+
+
专业:
+
+
+

魔法学

+
+
Witchcraft
+
+
求职意向:
+
+
+

魔法教师

+
+
Witchcraft teacher
+
+
目标薪水:
+
+
+

7k~10k

+
+
+ +
联系方式:
+
+
+

手机号码:

+
+
1380123456
+
+
+
+

Email

+
+
Harry@Hogwarts.edu
+
+ +
+
+

住址

+
+
霍格沃茨,格兰芬多学院
+
+ +
其他个人信息:
+
+
+

国籍:

+
+
英国
+
+ +
+
+

籍贯:

+
+
戈德里克山谷
+
+ +
+
+

所在地:

+
+
英国
+
+ +
求职意向:
+
+
+

魔法教师

+
+
Witchcraft teacher
+
+
+
如有疑问可留言
+
+
+
+

 
+
0/200
+ 提交 + 换色 +
+
+
+ + + + + + + + + +
\ No newline at end of file diff --git a/1614080902213/weather/app.js b/1614080902213/weather/app.js new file mode 100644 index 000000000..0b9b17ada --- /dev/null +++ b/1614080902213/weather/app.js @@ -0,0 +1,30 @@ +//app.js +App({ + onLaunch: function () { + //调用API从本地缓存中获取数据 + var logs = wx.getStorageSync('logs') || [] + logs.unshift(Date.now()) + wx.setStorageSync('logs', logs) + }, + getUserInfo:function(cb){ + var that = this + if(this.globalData.userInfo){ + typeof cb == "function" && cb(this.globalData.userInfo) + }else{ + //调用登录接口 + wx.login({ + success: function () { + wx.getUserInfo({ + success: function (res) { + that.globalData.userInfo = res.userInfo + typeof cb == "function" && cb(that.globalData.userInfo) + } + }) + } + }) + } + }, + globalData:{ + userInfo:null + } +}) \ No newline at end of file diff --git a/1614080902213/weather/app.json b/1614080902213/weather/app.json new file mode 100644 index 000000000..d793a8e51 --- /dev/null +++ b/1614080902213/weather/app.json @@ -0,0 +1,13 @@ +{ + "pages": [ + "pages/air_quality/air_quality", + "pages/result/result", + "pages/detail/detal" + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#000000", + "navigationBarTitleText": "空气质量查询", + "navigationBarTextStyle": "white" + } +} \ No newline at end of file diff --git a/1614080902213/weather/app.wxss b/1614080902213/weather/app.wxss new file mode 100644 index 000000000..7b1e981d8 --- /dev/null +++ b/1614080902213/weather/app.wxss @@ -0,0 +1,50 @@ +/**app.wxss**/ +page { + background-color: #f8f8f9; + height: 100%; +} +/**容器 flex-direction: column 表示元素垂直排列*/ +.container { + min-height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; + padding: 200rpx 0rpx; +} + + /**page 用于页面根标签 overflow超出范围的裁剪**/ +.page { + min-height: 100%; + flex: 1; + background-color: #FBF9FE; + font-size: 32rpx; + font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif; + overflow: hidden; +} + /**页面中的input的组件**/ +.page input{ + padding: 20rpx 30rpx; + background-color: #fff; +} + +/**段落*/ +.section{ + margin-bottom: 80rpx; +} +/**段落标题*/ +.section__title{ + margin-bottom: 16rpx; + padding-left: 30rpx; + padding-right: 30rpx; +} + +/**button范围*/ +.btn-area{ + padding: 0 30rpx; +} +/**button*/ +.btn-area button{ + margin-top: 20rpx; + margin-bottom: 20rpx; +} + diff --git a/1614080902213/weather/pages/air_quality/air_quality.js b/1614080902213/weather/pages/air_quality/air_quality.js new file mode 100644 index 000000000..92902c852 --- /dev/null +++ b/1614080902213/weather/pages/air_quality/air_quality.js @@ -0,0 +1,126 @@ +const Constant = require('../../common/constant.js'); +Page({ + data: { + loading: false, + disabled: true, + modalHidden: true, + modalErrorText: "请求失败,请检测网络", + city: "", + district:"" + }, + onLoad: function(options) { + this.loadInfo(); + }, + loadInfo: function() { + var page = this; + wx.getLocation({ + type: 'wgs84', + success(res) { + const latitude = res.latitude + const longitude = res.longitude + page.loadCity(longitude,latitude); + const speed = res.speed + const accuracy = res.accuracy + }, + fail: function() { + // fail + console.log("false") + }, + complete: function() { + // complete + } + }) + }, + loadCity: function(longitude, latitude) { + var page = this + wx.request({ + url: Constant.Location_URL + longitude + ',' + latitude, + data: {}, + header: { + 'Content-Type': 'application/json; charset=utf-8', + "Authorization": Constant.LocationAppCode + }, + success: function(res) { + // success + console.log(res); + var city = res.data.regeocode.addressComponent.city; + var district = res.data.regeocode.addressComponent.district + res.data.regeocode.addressComponent.township + page.setData({ + city: city, + district: district, + disabled: false + }); + }, + fail: function () { + page.setData({ + modalHidden: false, + modalErrorText: "定位失败,请手动输入" + }) + }, + complete: function () { + page.setData({ + loading: false, + disabled: false + }) + } + }) + }, + + bindKeyInput: function(e) { + let value = e.detail.value; + if (value !=this.city){ + this.setData({ district: ""}) + } + this.setData({ + city: value, + disabled: !value.length > 0, + + }); + }, + search: function(e) { + this.setData({ + loading: true, + disabled: true + }); + let that = this; + + wx.request({ + url: Constant.AIR_QUALITY_URL + this.data.city, + header: { + "Content-Type": "application/json; charset=utf-8", + "Authorization": Constant.AppCode + }, + success: function(res) { + if (res.data.showapi_res_body.ret_code !== -1) { + wx.navigateTo({ + url: "../result/result?pm=" + JSON.stringify(res.data.showapi_res_body.pm) + "&siteList=" + JSON.stringify(res.data.showapi_res_body.siteList) +"&district="+that.data.district + }); + } else { + that.setData({ + modalErrorText: res.data.showapi_res_body.error_info, + modalHidden: false, + }); + } + + }, + fail: function() { + that.setData({ + modalHidden: false, + modalErrorText: "请求失败,请检测网络" + }) + }, + complete: function() { + that.setData({ + loading: false, + disabled: false + }) + } + }); + }, + modalChange: function() { + this.setData({ + modalHidden: true + }) + } + +}); \ No newline at end of file diff --git a/1614080902213/weather/pages/air_quality/air_quality.json b/1614080902213/weather/pages/air_quality/air_quality.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/1614080902213/weather/pages/air_quality/air_quality.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/1614080902213/weather/pages/air_quality/air_quality.wxml b/1614080902213/weather/pages/air_quality/air_quality.wxml new file mode 100644 index 000000000..12fa610e8 --- /dev/null +++ b/1614080902213/weather/pages/air_quality/air_quality.wxml @@ -0,0 +1,19 @@ + + + + + + + 你要查询的城市:{{city}} + + + + + + + + + \ No newline at end of file diff --git a/1614080902213/weather/pages/air_quality/air_quality.wxss b/1614080902213/weather/pages/air_quality/air_quality.wxss new file mode 100644 index 000000000..d4d5ee637 --- /dev/null +++ b/1614080902213/weather/pages/air_quality/air_quality.wxss @@ -0,0 +1,3 @@ +.siteList{ + border: 1px solid red +} \ No newline at end of file diff --git a/1614080902213/weather/pages/detail/detal.js b/1614080902213/weather/pages/detail/detal.js new file mode 100644 index 000000000..328649d40 --- /dev/null +++ b/1614080902213/weather/pages/detail/detal.js @@ -0,0 +1,121 @@ +// pages/detail/detal.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + district: "" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + var siteList = JSON.parse(options.siteList) + for (var i = 0; i < siteList.length; i++) { + var site = siteList[i]; + site.siteStatus = this.cal(site); + } + this.setData({ + siteList + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + color(percent) { + var status + if (percent < 20) + status = "good"; + else if (percent < 40) + status = "normal"; + else if (percent < 60) + status = "medium" + else + status = "wrong" + return status + }, + + onReady: function () { + }, + chargeBg(status) { + var bg + if (status === "good") + bg = "#66CC00" + else if (status === "normal") + bg = "#2db7f5" + else if (status === "medium") + bg = "#ff9900" + else + bg = "#ed3f14" + return bg + }, + cal(item) { + var status = new Map(); + status.pm2_5_percent = (item.pm2_5 / 250.0 * 100).toFixed(2); + status.pm2_5_status = this.color(status.pm2_5_percent) + status.pm10_percent = (item.pm10 / 500.0 * 100).toFixed(2); + status.pm10_status = this.color(status.pm10_percent) + status.co_percent = (item.co / 90.0 * 100).toFixed(2); + status.co_status = this.color(status.co_percent) + status.o3_percent = (item.o3 / 800.0 * 100).toFixed(2); + status.o3_status = this.color(status.o3_percent) + status.no2_percent = (item.no2 / 2500.0 * 100).toFixed(2); + status.no2_status = this.color(status.no2_percent) + status.so2_percent = (item.so2 / 800.0 * 100).toFixed(2); + status.so2_status = this.color(status.so2_percent) + status.aqi_percent = (item.aqi / 300.0 * 100).toFixed(2); + status.aqi_status = this.color(status.aqi_percent) + status.bg = this.chargeBg(status.aqi_status) + return status + } +}) \ No newline at end of file diff --git a/1614080902213/weather/pages/detail/detal.json b/1614080902213/weather/pages/detail/detal.json new file mode 100644 index 000000000..722898a45 --- /dev/null +++ b/1614080902213/weather/pages/detail/detal.json @@ -0,0 +1,16 @@ +{ + "usingComponents": { + "i-grid": "../../dist/grid/index", + "i-grid-item": "../../dist/grid-item/index", + "i-grid-icon": "../../dist/grid-icon/index", + "i-grid-label": "../../dist/grid-label/index", + "i-icon": "../../dist/icon/index", + "i-row": "../../dist/row/index", + "i-col": "../../dist/col/index", + "i-progress": "../../dist/progress/index", + "i-cell-group": "../../dist/cell-group/index", + "i-cell": "../../dist/cell/index", + "i-panel": "../../dist/panel/index", + "i-switch": "../../dist/switch/index" + } +} \ No newline at end of file diff --git a/1614080902213/weather/pages/detail/detal.wxml b/1614080902213/weather/pages/detail/detal.wxml new file mode 100644 index 000000000..40f433766 --- /dev/null +++ b/1614080902213/weather/pages/detail/detal.wxml @@ -0,0 +1,103 @@ + + + + + 监测站点: + {{site.site_name}} + + + + + {{site.aqi}} + 站点失联中 + + {{site.quality}} + + + + + + + 主要污染物: + {{item.primary_pollutant}} + + + + + + + {{site.pm2_5}} + μg/m³ + + + + + + + PM 2.5 + + + + {{site.pm10}} + μg/m³ + + + + + + + + PM 10 + + + + {{site.co}} + mg/m³ + + + + + + + CO + + + + + + {{site.o3}} + μg/m³ + + + + + + + O3 + + + + {{site.no2}} + μg/m³ + + + + + + + NO2 + + + {{site.so2}} + μg/m³ + + + + + + + SO2 + + + + \ No newline at end of file diff --git a/1614080902213/weather/pages/detail/detal.wxss b/1614080902213/weather/pages/detail/detal.wxss new file mode 100644 index 000000000..a72efc5f2 --- /dev/null +++ b/1614080902213/weather/pages/detail/detal.wxss @@ -0,0 +1,74 @@ +.row-class { + background: #fff; + background: transparent; +} + +.col-class { + height: 25px; + line-height: 32px; + color: #ffffff; + opacity: 0.8; + background: transparent; + font-size: 15px; + text-align: center; +} + +.col-class.light { + background:transparent; +} + +.progress-item { + padding: 20px; + size: 15px; +} + +.right { + display: flex; + flex-direction: column-reverse; + justify-content: right; +} + +.progress_box { + position: relative; + width: 220px; + height: 220px; + display: flex; + align-items: center; + justify-content: center; +} + +.progress_bg { + position: absolute; + width: 220px; + height: 220px; +} + +.progress_canvas { + width: 220px; + height: 220px; +} + +.progress_text { + position: absolute; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.progress_info { + font-size: 150rpx; + padding-left: 16rpx; + letter-spacing: 2rpx; +} +.aqiBox{ + display: flex; + background-color: transparent; + margin:20px,30px; + padding: 16rpx; + color: #ffffff; + opacity: 0.9 +} +.cell-panel-demo{ + margin:30px,30px; +} diff --git a/1614080902213/weather/pages/result/result.js b/1614080902213/weather/pages/result/result.js new file mode 100644 index 000000000..3b01e8598 --- /dev/null +++ b/1614080902213/weather/pages/result/result.js @@ -0,0 +1,149 @@ +Page({ + data: { + //主要污染物有可能没有,默认值无 + progress_txt: '', + count: 0, // 设置 计数器 初始为0 + countTimer: null, // 设置 定时器 初始为null + aqi_percent: 1, + district: "" + }, + onLoad: function(options) { + if (options.pm) { + var item = JSON.parse(options.pm) + var siteList = JSON.parse(options.siteList) + var district = options.district + item.status = this.cal(item) + console.log(item.status+"test") + + for (var i = 0; i < siteList.length; i++) { + var site = siteList[i]; + site.siteStatus = this.cal(site); + } + this.setData({ + item, + siteList, + district + }) + + } + }, + onReady: function() { + // 页面渲染完成 + }, + onShow: function() { + // 页面显示 + }, + onHide: function() { + // 页面隐藏 + }, + onUnload: function() { + // 页面关闭 + }, + + color(percent) { + var status + if (percent < 20) + status = "good"; + else if (percent < 40) + status = "normal"; + else if (percent < 60) + status = "medium" + else + status = "wrong" + return status + }, + + + drawProgressbg: function() { + // 使用 wx.createContext 获取绘图上下文 context + var ctx = wx.createCanvasContext('canvasProgressbg') + ctx.setLineWidth(10); // 设置圆环的宽度 + ctx.setStrokeStyle('#d3d3d3'); // 设置圆环的颜色 + ctx.setLineCap('round') // 设置圆环端点的形状 + ctx.beginPath(); //开始一个新的路径 + ctx.arc(110, 110, 100, 0, 2 * Math.PI, false); + //设置一个原点(110,110),半径为100的圆的路径到当前路径 + ctx.stroke(); //对当前路径进行描边 + ctx.draw(); + }, + + drawCircle: function(step) { + var context = wx.createCanvasContext('canvasProgress'); + // 设置渐变 + var gradient = context.createLinearGradient(200, 100, 100, 200); + gradient.addColorStop("0", "#ffffff"); + gradient.addColorStop("0.5", "#ffffff"); + gradient.addColorStop("1.0", "#ffffff"); + + context.setLineWidth(10); + context.setStrokeStyle(gradient); + context.setLineCap('round') + context.beginPath(); + // 参数step 为绘制的圆环周长,从0到2为一周 。 -Math.PI / 2 将起始角设在12点钟位置 ,结束角 通过改变 step 的值确定 + context.arc(110, 110, 100, -Math.PI / 2, step * Math.PI - Math.PI / 2, false); + context.stroke(); + context.draw() + }, + + countInterval: function() { + // 设置倒计时 定时器 每100毫秒执行一次,计数器count+1 ,耗时6秒绘一圈 + this.countTimer = setInterval(() => { + if (this.data.count <= 60 * this.data.item.status.aqi_percent / 100) { + /* 绘制彩色圆环进度条 + 注意此处 传参 step 取值范围是0到2, + 所以 计数器 最大值 60 对应 2 做处理,计数器count=60的时候step=2 + */ + this.drawCircle(this.data.count / (60 / 2)) + this.data.count++; + } else { + this.setData({}); + clearInterval(this.countTimer); + } + }, 100) + }, + onReady: function() { + this.drawProgressbg(); + // this.drawCircle(2) + this.countInterval() + }, + chargeBg(status) { + var bg + if (status === "good") + bg = "#66CC00" + else if (status === "normal") + bg = "#2db7f5" + else if (status === "medium") + bg = "#ff9900" + else + bg = "#ed3f14" + return bg + }, + cal(item) { + var status = new Map(); + status.pm2_5_percent = (item.pm2_5 / 250.0 * 100).toFixed(2); + status.pm2_5_status = this.color(status.pm2_5_percent) + status.pm10_percent = (item.pm10 / 500.0 * 100).toFixed(2); + status.pm10_status = this.color(status.pm10_percent) + status.co_percent = (item.co / 90.0 * 100).toFixed(2); + status.co_status = this.color(status.co_percent) + status.o3_percent = (item.o3 / 800.0 * 100).toFixed(2); + status.o3_status = this.color(status.o3_percent) + status.no2_percent = (item.no2 / 2500.0 * 100).toFixed(2); + status.no2_status = this.color(status.no2_percent) + status.so2_percent = (item.so2 / 800.0 * 100).toFixed(2); + status.so2_status = this.color(status.so2_percent) + status.aqi_percent = (item.aqi / 300.0 * 100).toFixed(2); + status.aqi_status = this.color(status.aqi_percent) + console.log(status.aqi_status+"test") + status.bg = this.chargeBg(status.aqi_status) + + console.log(status.bg + "test2") + return status + }, + detail() { + wx.navigateTo({ + url: "../detail/detal?siteList=" + JSON.stringify(this.data.siteList) + }); + } + +}) \ No newline at end of file diff --git a/1614080902213/weather/pages/result/result.json b/1614080902213/weather/pages/result/result.json new file mode 100644 index 000000000..722898a45 --- /dev/null +++ b/1614080902213/weather/pages/result/result.json @@ -0,0 +1,16 @@ +{ + "usingComponents": { + "i-grid": "../../dist/grid/index", + "i-grid-item": "../../dist/grid-item/index", + "i-grid-icon": "../../dist/grid-icon/index", + "i-grid-label": "../../dist/grid-label/index", + "i-icon": "../../dist/icon/index", + "i-row": "../../dist/row/index", + "i-col": "../../dist/col/index", + "i-progress": "../../dist/progress/index", + "i-cell-group": "../../dist/cell-group/index", + "i-cell": "../../dist/cell/index", + "i-panel": "../../dist/panel/index", + "i-switch": "../../dist/switch/index" + } +} \ No newline at end of file diff --git a/1614080902213/weather/pages/result/result.wxml b/1614080902213/weather/pages/result/result.wxml new file mode 100644 index 000000000..af4973884 --- /dev/null +++ b/1614080902213/weather/pages/result/result.wxml @@ -0,0 +1,67 @@ + + + + + + + {{item.area}} + + + 查询时间 + + + + + {{district}} + + + {{item.ct}} + + + + + + + + + + {{item.aqi}} + + + {{item.quality}} + + + + + {{item.primary_pollutant}} + + 主要污染物: + 排名: {{item.num}} + + + + + + PM2.5: {{item.pm2_5}} μg/m³ + + PM10: {{item.pm10}} μg/m³ + + CO: {{item.co}} mg/m³ + + O3: {{item.o3}} μg/m³ + + NO2: {{item.no2}} μg/m³ + + SO2: {{item.so2}} μg/m³ + + + + + + + + + + + + \ No newline at end of file diff --git a/1614080902213/weather/pages/result/result.wxss b/1614080902213/weather/pages/result/result.wxss new file mode 100644 index 000000000..52322438b --- /dev/null +++ b/1614080902213/weather/pages/result/result.wxss @@ -0,0 +1,74 @@ +.row-class { + background: #fff; + background: transparent; +} + +.col-class { + height: 25px; + line-height: 32px; + color: #ffffff; + opacity: 0.8; + background: transparent; + font-size: 15px; + text-align: center; +} + +.col-class.light { + background:transparent; +} + +.progress-item { + padding: 20px; + size: 15px; +} + +.right { + display: flex; + flex-direction: column-reverse; + justify-content: right; +} + +.progress_box { + position: relative; + width: 220px; + height: 220px; + display: flex; + align-items: center; + justify-content: center; +} + +.progress_bg { + position: absolute; + width: 220px; + height: 220px; +} + +.progress_canvas { + width: 220px; + height: 220px; +} + +.progress_text { + position: absolute; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.progress_info { + font-size: 150rpx; + padding-left: 16rpx; + letter-spacing: 2rpx; +} +.aqiBox{ + display: flex; + background-color: transparent; + margin:20px,30px; + padding: 16rpx; + color: #ffffff; + opacity: 0.9 +} +.cell-panel-demo{ + margin:30px,30px; +} diff --git a/1614080902213/weather/project.config.json b/1614080902213/weather/project.config.json new file mode 100644 index 000000000..4d8727b86 --- /dev/null +++ b/1614080902213/weather/project.config.json @@ -0,0 +1,40 @@ +{ + "description": "项目配置文件", + "packOptions": { + "ignore": [] + }, + "setting": { + "urlCheck": false, + "es6": true, + "postcss": true, + "minified": true, + "newFeature": true, + "autoAudits": false + }, + "compileType": "miniprogram", + "libVersion": "2.4.1", + "appid": "wx52bd0082f6e47ea9", + "projectname": "weather", + "debugOptions": { + "hidedInDevtools": [] + }, + "isGameTourist": false, + "condition": { + "search": { + "current": -1, + "list": [] + }, + "conversation": { + "current": -1, + "list": [] + }, + "game": { + "currentL": -1, + "list": [] + }, + "miniprogram": { + "current": -1, + "list": [] + } + } +} \ No newline at end of file