diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..e69de29 diff --git a/app.js b/app.js new file mode 100644 index 0000000..e69de29 diff --git a/app.json b/app.json new file mode 100644 index 0000000..2a4fb10 --- /dev/null +++ b/app.json @@ -0,0 +1,5 @@ +{ + "pages": [ + "pages/weather/weather" + ] +} \ No newline at end of file diff --git a/pages/weather/weather.js b/pages/weather/weather.js new file mode 100644 index 0000000..8f4950f --- /dev/null +++ b/pages/weather/weather.js @@ -0,0 +1,40 @@ +// pages/index/weather.js +//定义城市、天气、温度、风级、图片、日期参数 +const app = getApp() +Page({ + + data: { + adcode:'', + city:'', + humidity:'', + province:'', + reporttime:'', + temperature:'', + weather:'', + winddirection:'', + windpower:'', + }, + + //动态获取input输入值 城市名称 + onLoad:function(){ + var self = this + wx.request({ + url: 'https://restapi.amap.com/v3/weather/weatherInfo', + data:{ + 'key':'57c5604fb2700562654f29fd995ddb4a', + 'city':'511302' + }, + success: function(res) { + console.log(res.data); + self.setData({ + city: res.data.lives[0].city, + weather:res.data.lives[0].weather, + temp:res.data.lives[0].temperature, + winddirection:res.data.lives[0].winddirection, + windpower:res.data.lives[0].windpower, + date:res.data.lives[0].reporttime + }) + } + }) + } +}) \ No newline at end of file diff --git a/pages/weather/weather.json b/pages/weather/weather.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/weather/weather.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/weather/weather.wxml b/pages/weather/weather.wxml new file mode 100644 index 0000000..b50ad9a --- /dev/null +++ b/pages/weather/weather.wxml @@ -0,0 +1,17 @@ + + + + + + + 地区:{{city}} + 时间:{{date}} + + + 天气:{{weather}} + + 温度:{{temp}} + 风向:{{winddirection}} + 风力(单位:级):{{windpower}} + + \ No newline at end of file diff --git a/pages/weather/weather.wxss b/pages/weather/weather.wxss new file mode 100644 index 0000000..238f379 --- /dev/null +++ b/pages/weather/weather.wxss @@ -0,0 +1 @@ +/* pages/index/weather.wxss */ \ No newline at end of file diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..d44485d --- /dev/null +++ b/project.config.json @@ -0,0 +1,50 @@ +{ + "description": "项目配置文件", + "setting": { + "bundle": false, + "userConfirmedBundleSwitch": false, + "urlCheck": true, + "scopeDataCheck": false, + "coverView": true, + "es6": true, + "postcss": true, + "compileHotReLoad": false, + "lazyloadPlaceholderEnable": false, + "preloadBackgroundData": false, + "minified": true, + "autoAudits": false, + "newFeature": false, + "uglifyFileName": false, + "uploadWithSourceMap": true, + "useIsolateContext": true, + "nodeModules": false, + "enhance": true, + "useMultiFrameRuntime": true, + "showShadowRootInWxmlPanel": true, + "packNpmManually": false, + "enableEngineNative": false, + "packNpmRelationList": [], + "minifyWXSS": true, + "showES6CompileOption": false, + "minifyWXML": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "condition": false, + "ignoreUploadUnusedFiles": true + }, + "compileType": "miniprogram", + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + }, + "libVersion": "2.19.4", + "packOptions": { + "ignore": [], + "include": [] + }, + "appid": "wx5df977e384485ad6" +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..ed26d14 --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,8 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "%E5%A4%A9%E6%B0%94%E9%A2%84%E6%8A%A5", + "setting": { + "compileHotReLoad": true, + "urlCheck": false + } +} \ No newline at end of file diff --git a/sitemap.json b/sitemap.json new file mode 100644 index 0000000..e69de29