diff --git a/README.md b/README.md deleted file mode 100644 index e659935..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# music - diff --git a/app.json b/app.json index c565fb9..40c84ff 100644 --- a/app.json +++ b/app.json @@ -1,12 +1,13 @@ { "pages":[ - "pages/index/index" + "pages/index/index", + "pages/logs/logs" ], "window":{ "backgroundTextStyle":"light", - "navigationBarBackgroundColor": "#fff", - "navigationBarTitleText": "音乐小程序", - "navigationBarTextStyle":"black" + "navigationBarBackgroundColor": "#820", + "navigationBarTitleText": "Weather Report", + "navigationBarTextStyle":"white" }, "style": "v2", "sitemapLocation": "sitemap.json" diff --git a/images/01.png b/images/01.png deleted file mode 100644 index 0939fe6..0000000 Binary files a/images/01.png and /dev/null differ diff --git a/images/02.png b/images/02.png deleted file mode 100644 index ab554db..0000000 Binary files a/images/02.png and /dev/null differ diff --git a/images/02stop.png b/images/02stop.png deleted file mode 100644 index be984cd..0000000 Binary files a/images/02stop.png and /dev/null differ diff --git a/images/03.png b/images/03.png deleted file mode 100644 index 9402bfa..0000000 Binary files a/images/03.png and /dev/null differ diff --git a/images/04.png b/images/04.png deleted file mode 100644 index c446705..0000000 Binary files a/images/04.png and /dev/null differ diff --git a/images/05.png b/images/05.png deleted file mode 100644 index 6dfd030..0000000 Binary files a/images/05.png and /dev/null differ diff --git a/images/06.png b/images/06.png deleted file mode 100644 index 51340c3..0000000 Binary files a/images/06.png and /dev/null differ diff --git a/images/8(53_1S((UY0C`N81)%VKNY.png b/images/8(53_1S((UY0C`N81)%VKNY.png deleted file mode 100644 index 99409d9..0000000 Binary files a/images/8(53_1S((UY0C`N81)%VKNY.png and /dev/null differ diff --git a/images/B0T_QEK~F[G9L$Q`1T{4QI6.png b/images/B0T_QEK~F[G9L$Q`1T{4QI6.png deleted file mode 100644 index ba7012f..0000000 Binary files a/images/B0T_QEK~F[G9L$Q`1T{4QI6.png and /dev/null differ diff --git a/images/M5[0D{]L(M8CRAD`MUOJ$$1.png b/images/M5[0D{]L(M8CRAD`MUOJ$$1.png deleted file mode 100644 index c74f21f..0000000 Binary files a/images/M5[0D{]L(M8CRAD`MUOJ$$1.png and /dev/null differ diff --git a/images/V%GO_J`2P4E(_(`TY2JENIP.png b/images/V%GO_J`2P4E(_(`TY2JENIP.png deleted file mode 100644 index 604cbcb..0000000 Binary files a/images/V%GO_J`2P4E(_(`TY2JENIP.png and /dev/null differ diff --git a/images/]4$N_UNNP)RO6W`KWI`US5Y.png b/images/]4$N_UNNP)RO6W`KWI`US5Y.png deleted file mode 100644 index 89574bc..0000000 Binary files a/images/]4$N_UNNP)RO6W`KWI`US5Y.png and /dev/null differ diff --git a/images/_~S3@H]A){GCA7XWPA6WVB6.png b/images/_~S3@H]A){GCA7XWPA6WVB6.png deleted file mode 100644 index 24bfe97..0000000 Binary files a/images/_~S3@H]A){GCA7XWPA6WVB6.png and /dev/null differ diff --git a/images/banner.jpeg b/images/banner.jpeg deleted file mode 100644 index a38c7bc..0000000 Binary files a/images/banner.jpeg and /dev/null differ diff --git a/images/banner2.jpg b/images/banner2.jpg deleted file mode 100644 index 54b9d8b..0000000 Binary files a/images/banner2.jpg and /dev/null differ diff --git a/images/banner3.png b/images/banner3.png deleted file mode 100644 index 330b730..0000000 Binary files a/images/banner3.png and /dev/null differ diff --git a/images/cover1.jpg b/images/cover1.jpg deleted file mode 100644 index 436c99f..0000000 Binary files a/images/cover1.jpg and /dev/null differ diff --git a/images/cover2.jpg b/images/cover2.jpg deleted file mode 100644 index aa6e41d..0000000 Binary files a/images/cover2.jpg and /dev/null differ diff --git a/images/cover3.jpg b/images/cover3.jpg deleted file mode 100644 index 9c9ce51..0000000 Binary files a/images/cover3.jpg and /dev/null differ diff --git a/images/cover4.jpg b/images/cover4.jpg deleted file mode 100644 index e37384e..0000000 Binary files a/images/cover4.jpg and /dev/null differ diff --git a/images/cover5.jpg b/images/cover5.jpg deleted file mode 100644 index 44dd9bf..0000000 Binary files a/images/cover5.jpg and /dev/null differ diff --git a/images/cover6.jpg b/images/cover6.jpg deleted file mode 100644 index b2bf353..0000000 Binary files a/images/cover6.jpg and /dev/null differ diff --git a/images/~AC$RYY7NB8XEUSPMCRQK%S.png b/images/~AC$RYY7NB8XEUSPMCRQK%S.png deleted file mode 100644 index ae0e339..0000000 Binary files a/images/~AC$RYY7NB8XEUSPMCRQK%S.png and /dev/null differ diff --git a/pages/index/index.js b/pages/index/index.js index 543ad99..f4a2b9f 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,143 +1,47 @@ -Page({ +//index.js +//这里只获取了实况天气信息,没有用预测信息 +//获取应用实例 +const app = getApp() - /** - * 页面的初始数据 - */ +Page({ data: { - item: 0, - tab: 0, - // 播放列表数据 - playlist: [{ - id: 1, - title: '青藏高原', - singer: '韩红', - src: 'http://localhost:3000/1.mp3', - coverImgUrl: '/images/M5[0D{]L(M8CRAD`MUOJ$$1.png' - }, { - id: 2, - title: 'See You Again', - singer: 'Khalifa_Charlie Puth', - src: 'http://localhost:3000/2.mp3', - coverImgUrl: '/images/cover.jpg' - }, { - id: 3, - title: '情字最大', - singer: '平生青崖', - src: 'http://localhost:3000/3.mp3', - coverImgUrl: '/images/cover.jpg' - }, { - id: 4, - title: '半岛铁盒', - singer: '周杰伦', - src: 'http://localhost:3000/4.mp3', - coverImgUrl: '/images/]4$N_UNNP)RO6W`KWI`US5Y.png' - }], - state: 'paused', - playIndex: 0, - play: { - currentTime: '00:00', - duration: '00:00', - percent: 0, - title: '', - singer: '', - coverImgUrl: '/images/cover.jpg', - } - }, - - // 页面切换 - changeItem: function(e) { - this.setData({ - item: e.target.dataset.item, - }) - }, - // tab切换 - changeTab: function(e) { - this.setData({ - tab: e.detail.current - }) - }, - - // 实现播放器播放功能 - audioCtx: null, - onReady: function() { - this.audioCtx = wx.createInnerAudioContext() - // 默认选择第1曲 - this.setMusic(0) - var that = this - // 播放进度检测 - this.audioCtx.onError(function() { - console.log('播放失败:' + that.audioCtx.src) - }) - // 播放完成自动换下一曲 - this.audioCtx.onEnded(function() { - that.next() - }) - // 自动更新播放进度 - this.audioCtx.onPlay(function() {}) - this.audioCtx.onTimeUpdate(function() { - that.setData({ - 'play.duration': formatTime(that.audioCtx.duration), - 'play.currentTime': formatTime(that.audioCtx.currentTime), - 'play.percent': that.audioCtx.currentTime / that.audioCtx.duration * 100 - }) - }) - // 格式化时间 - function formatTime(time) { - var minute = Math.floor(time / 60) % 60; - var second = Math.floor(time) % 60 - return (minute < 10 ? '0' + minute : minute) + ':' + (second < 10 ? '0' + second : second) - } - }, - // 音乐播放 - setMusic: function(index) { - var music = this.data.playlist[index] - this.audioCtx.src = music.src - this.setData({ - playIndex: index, - 'play.title': music.title, - 'play.singer': music.singer, - 'play.coverImgUrl': music.coverImgUrl, - 'play.currentTime': '00:00', - 'play.duration': '00:00', - 'play.percent': 0 + adcode:'', + city:'', + humidity:'', + province:'', + reporttime:'', + temperature:'', + weather:'', + winddirection:'', + windpower:'', + }, + + onLoad:function(){ + var self = this; + wx.request({ + url: 'https://restapi.amap.com/v3/weather/weatherInfo', + data:{ + 'key': 'b51503cf15297125d24c456d04a785bb',//改为自己申请的Key + 'city': '110101', + 'extensions': 'base' + }, + header:{ + 'content-type': 'application/json' + }, + success:function(res){ + console.log(res.data); + self.setData({ + adcode: res.data.lives[0].adcode, + city: res.data.lives[0].city, + humidity: res.data.lives[0].humidity, + province: res.data.lives[0].province, + temperature: res.data.lives[0].temperature, + reporttime: res.data.lives[0].reporttime, + weather: res.data.lives[0].weather, + winddirection: res.data.lives[0].winddirection, + windpower: res.data.lives[0].windpower + }) + } }) - }, - - // 播放按钮 - play: function() { - this.audioCtx.play() - this.setData({ - state: 'running' - }) - }, - - // 暂停按钮 - pause: function() { - this.audioCtx.pause() - this.setData({ - state: 'paused' - }) - }, - - // 下一曲按钮 - next: function() { - var index = this.data.playIndex >= this.data.playlist.length - 1 ? 0 : this.data.playIndex + 1 - this.setMusic(index) - if (this.data.state === 'running') { - this.play() - } - }, - - // 滚动条调节歌曲进度 - sliderChange: function(e) { - var second = e.detail.value * this.audioCtx.duration / 100 - this.audioCtx.seek(second) - }, - - // 播放列表换曲功能 - change: function(e) { - this.setMusic(e.currentTarget.dataset.index) - this.play() } }) - diff --git a/pages/index/index.json b/pages/index/index.json index d8d1a5a..8835af0 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -1,5 +1,3 @@ { - "navigationBarBackgroundColor":"#fff", - "navigationBarTitleText":"音乐", - "navigationBarTextStyle":"black" + "usingComponents": {} } \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index cab304b..7f55593 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,103 +1,12 @@ - - - 音乐推荐 - 播放器 - 播放列表 - - - - - - - - - - - - - - - - - - - - - {{play.title}} - {{play.singer}} - - - - - - - - - - + 城市编码:{{adcode}} + 所在省份:{{province}} + 城市:{{city}} + 天气现象:{{weather}} + 实时气温:{{temperature}}℃ + 风向:{{winddirection}} + 风力:{{windpower}} + 空气湿度:{{humidity}}% + 发布时间:{{reporttime}} diff --git a/pages/index/index.wxss b/pages/index/index.wxss index cda0180..d754fed 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -1,236 +1,4 @@ -page { - display: flex; - flex-direction: column; - background: #17181a; - color: #ccc; - height: 100%; -} - -.tab { - display: flex; -} - -.tab-item { - flex: 1; - font-size: 10pt; - text-align: center; - line-height: 72rpx; - border-bottom: 6rpx solid #eee; -} - -.content { - flex: 1; -} - -.content > swiper { - height: 100%; -} - -.player { - background: #222; - border-top: 1px solid #252525; - height: 112rpx; -} - -.tab-item.active { - color: #c25b5b; - border-bottom-color: #c25b5b; -} - -.content-info { - height: 100%; -} - -::-webkit-scrollbar { - width: 0; - height: 0; - color: transparent; -} - -/* 轮播图 */ - -.content-info-slide { - height: 302rpx; - margin-bottom: 20px; -} - -.content-info-slide image { - width: 100%; - height: 100%; -} - -/* 功能按钮 */ - -.content-info-portal { - display: flex; - margin-bottom: 15px; -} - -.content-info-portal > view { - flex: 1; - font-size: 11pt; - text-align: center; -} - -.content-info-portal image { - width: 120rpx; - height: 120rpx; - display: block; - margin: 20rpx auto; -} - -/* 热门音乐 */ - -.content-info-list { - font-size: 11pt; - margin-bottom: 20rpx; -} - -.content-info-list > .list-title { - margin: 20rpx 35rpx; -} - -.content-info-list > .list-inner { - display: flex; - flex-wrap: wrap; - margin: 0 20rpx; -} - -.content-info-list > .list-inner > .list-item { - flex: 1; -} - -.content-info-list > .list-inner > .list-item > image { - display: block; - width: 200rpx; - height: 200rpx; - margin: 0 auto; - border-radius: 10rpx; - border: 1rpx solid #555; -} - -.content-info-list > .list-inner > .list-item > view { - width: 200rpx; - margin: 10rpx auto; - font-size: 10pt; -} - -/* 播放器 */ - -.content-play { - display: flex; - justify-content: space-around; - flex-direction: column; - height: 100%; - text-align: center; -} - -.content-play-info > view { - color: #888; - font-size: 11pt; -} - -/* 底部播放器 */ - -.player { - display: flex; - align-items: center; - background: #222; - border-top: 1px solid #252525; - height: 112rpx; -} - -.player-cover { - width: 80rpx; - height: 80rpx; - margin-left: 15rpx; - border-radius: 8rpx; - border: 1px solid #333; -} - -.player-info { - flex: 1; - font-size: 10pt; - line-height: 38rpx; - margin-left: 20rpx; - padding-bottom: 8rpx; -} - -.player-info-singer { - color: #888; -} - -.player-controls image { - width: 80rpx; - height: 80rpx; - margin-right: 15rpx; -} - -/* 显示专辑页面样式 */ - -.content-play-cover image { - animation: rotateImage 10s linear infinite; - width: 400rpx; - height: 400rpx; - border-radius: 50%; - border: 1px solid #333; -} - -@keyframes rotateImage { - from { - transform: rotate(0deg); - } - - to { - transform: rotate(360deg); - } -} - -/* 播放进度和时间 */ - -.content-play-progress { - display: flex; - align-items: center; - margin: 0 35rpx; - font-size: 9pt; - text-align: center; -} - -.content-play-progress > view { - flex: 1; -} - -/* 播放列表 */ - -.playlist-item { - display: flex; - align-items: center; - border-bottom: 1rpx solid #333; - height: 112rpx; -} - -.playlist-cover { - width: 80rpx; - height: 80rpx; - margin-left: 15rpx; - border-radius: 8rpx; - border: 1px solid #333; -} - -.playlist-info { - flex: 1; - font-size: 10pt; - line-height: 38rpx; - margin-left: 20rpx; - padding-bottom: 8rpx; -} - -.playlist-info-singer { - color: #888; -} - -.playlist-controls { - font-size: 10pt; - margin-right: 20rpx; - color: #c25b5b; +.content{ + background-color:antiquewhite; +text-align: center; } \ No newline at end of file diff --git a/pages/index/info.wxml b/pages/index/info.wxml deleted file mode 100644 index b791be5..0000000 --- a/pages/index/info.wxml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - 私人FM - - - - 每日歌曲推荐 - - - - 云音乐新歌榜 - - - - - 推荐歌曲 - - - - 汇电音之经典领电音之奥妙 - - - - - 周杰伦]每首歌曲,都是顶级文案 - - - - 伤感情歌|不眠夜里的孤单心事 - - - - 经典]听这些怀旧的歌,体会经典的旋律 - - - - [粤语经典]漫漫人生路、每到离别总是伤 - - - - [流行华语]向我们即将逝去的青春致敬 - - - - \ No newline at end of file diff --git a/pages/index/play.wxml b/pages/index/play.wxml deleted file mode 100644 index b1ead24..0000000 --- a/pages/index/play.wxml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - {{play.title}} - —— {{play.singer}} —— - - - - - - - - {{play.currentTime}} - - - - {{play.duration}} - - \ No newline at end of file diff --git a/pages/index/playlist.wxml b/pages/index/playlist.wxml deleted file mode 100644 index 3ec03f9..0000000 --- a/pages/index/playlist.wxml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - {{item.title}} - {{item.singer}} - - - 正在播放 - - - \ No newline at end of file diff --git a/pages/logs/logs.js b/pages/logs/logs.js new file mode 100644 index 0000000..26e868a --- /dev/null +++ b/pages/logs/logs.js @@ -0,0 +1,66 @@ +// pages/logs/logs.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/logs/logs.wxml b/pages/logs/logs.wxml new file mode 100644 index 0000000..c49f50c --- /dev/null +++ b/pages/logs/logs.wxml @@ -0,0 +1,2 @@ + +pages/logs/logs.wxml diff --git a/project.config.json b/project.config.json index bf54605..66a926a 100644 --- a/project.config.json +++ b/project.config.json @@ -41,8 +41,8 @@ "condition": false }, "compileType": "miniprogram", - "libVersion": "2.25.3", - "appid": "touristappid", + "libVersion": "2.19.4", + "appid": "wx210c631cfbead5be", "projectname": "miniprogram-92", "condition": {}, "editorSetting": { diff --git a/project.private.config.json b/project.private.config.json index c81cff2..791d36e 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,7 +1,8 @@ { "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "miniprogram-13", + "projectname": "weather%20report", "setting": { - "compileHotReLoad": true + "compileHotReLoad": true, + "urlCheck": false } } \ No newline at end of file