diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000000000000000000000000000000000000..f26881a07dbefd70942af9c7427e3f7c1d98afe9 --- /dev/null +++ b/project.config.json @@ -0,0 +1,68 @@ +{ + "description": "项目配置文件", + "packOptions": { + "ignore": [] + }, + "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, + "useApiHook": true, + "useApiHostProcess": false, + "showShadowRootInWxmlPanel": true, + "packNpmManually": false, + "enableEngineNative": false, + "packNpmRelationList": [], + "minifyWXSS": true, + "showES6CompileOption": false + }, + "compileType": "miniprogram", + "libVersion": "2.18.0", + "appid": "wx7cc3e303d5902b33", + "projectname": "weather", + "debugOptions": { + "hidedInDevtools": [] + }, + "scripts": {}, + "staticServerOptions": { + "baseURL": "", + "servePath": "" + }, + "isGameTourist": false, + "condition": { + "search": { + "list": [] + }, + "conversation": { + "list": [] + }, + "game": { + "list": [] + }, + "plugin": { + "list": [] + }, + "gamePlugin": { + "list": [] + }, + "miniprogram": { + "list": [] + } + } +} \ No newline at end of file diff --git "a/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.js" "b/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.js" index f970764095a36f1596fda6e7a31d80aec473f0db..457e22239fc484a98ea6ca544f3de1a931b3a4e5 100644 --- "a/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.js" +++ "b/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.js" @@ -17,6 +17,7 @@ Page({ this.getLocationXY() } }, + //获得当前的坐标,通过百度地图API // getLocationXY: function () { @@ -94,7 +95,25 @@ Page({ fail:function(res){}, }) - + //获取生活指数 + wx.request({ + url: 'https://devapi.qweather.com/v7/indices/1d', + data:{ + location:locationY+","+locationX, + type:"3,1", + key: '6c764218c0694a068da82b510b7a5ec8', + }, + success:function(res){ + // console.log('------',res) + var liveO = res.data.daily[0] + var liveT = res.data.daily[1] + that.setData({liveO:liveO,liveT:liveT}); + console.log('指数',that.data.liveT); + }, + fail:function(res){}, + complete:function(res){}, + + }); }, onShow: function () { @@ -106,7 +125,11 @@ Page({ }, onUnload: function () { - + wx.showToast({ + title: '欢迎回来', + icon: 'success', + duration: 2000 + }) }, onPullDownRefresh: function () { @@ -114,7 +137,11 @@ Page({ }, onReachBottom: function () { - + wx.showToast({ + title: '没有内容咯!', + icon:'none', + duration: 2000 + }) }, onShareAppMessage: function () { diff --git "a/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.wxml" "b/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.wxml" index 48ba22d1ce86283e3f3d02c9ade239ae0b573978..145023aa6c6f6122a16f506b57c274157e12597f 100644 --- "a/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.wxml" +++ "b/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.wxml" @@ -30,37 +30,19 @@ ☁ {{item.textDay}} {{item.tempMin}}℃/{{item.tempMax}}℃ - - + + 生活指数 + + + {{liveO.name}} + 类型:{{liveO.category}} + {{liveO.text}} + + + + {{liveT.name}} + 类型:{{liveT.category}} + {{liveT.text}} + \ No newline at end of file diff --git "a/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.wxss" "b/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.wxss" index e288bd584558cc1e7f7ae510d045abe968728c14..7df931205331e25459776d2eaeb2bc323dc5849b 100644 --- "a/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.wxss" +++ "b/\345\272\204\346\230\255\345\261\261/weatherSearch/pages/index/index.wxss" @@ -16,11 +16,13 @@ color: white; font-size: 15px; font-family: 微软雅黑,宋体; + background-image: linear-gradient(to bottom right, rgb(0,44,130), skyblue); } .location{ background-size: 100% 100%; height: auto; /* text-align: center; */ + display: block; } .dq{ font-size: 30px; @@ -54,10 +56,10 @@ color: white; } .future{ - height: 100%; + height: auto; flex-direction: row; justify-content: space-around; - background-image: linear-gradient(to bottom right, rgb(0,44,130), skyblue); + } .img{ width: 60rpx; @@ -89,4 +91,36 @@ display: flex; flex-direction: column; box-sizing: border-box; -} \ No newline at end of file +} +.live_text{ + font-size: 20px; + display: flex; + padding: 50rpx 0rpx 0rpx 20rpx; +} +.live{ + height: 350rpx; + padding: 30rpx 0rpx 0rpx 0rpx; + /* background-color: red; */ + display: flex; + justify-content: space-around; +} +.live_fgx{ + border: 1px solid gray; +} +.first{ + text-align: center; + /* border: 1px solid gray; */ + /* float: left; */ + +} +.second{ + text-align: center; + /* border: 1px solid gray; */ + /* float: left; */ +} +.live_name{ + padding-bottom: 20rpx; +} +.info{ + padding-bottom: 20rpx; +} \ No newline at end of file