From 1dd62e3e4b91433126cf2adeb6d72c118fdd94d2 Mon Sep 17 00:00:00 2001 From: sdaduanbilei Date: Tue, 18 Nov 2025 17:06:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E6=89=80=E5=B1=9E=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 16 ++-- pages/badge/index.js | 96 +++++++++++++++++++ pages/badge/index.json | 7 ++ pages/badge/index.wxml | 67 ++++++++++++++ pages/badge/index.wxss | 42 +++++++++ pages/community/add.js | 66 +++++++++++++ pages/community/add.json | 7 ++ pages/community/add.wxml | 43 +++++++++ pages/community/add.wxss | 4 + pages/community/index.js | 17 +++- pages/community/index.json | 6 +- pages/community/index.wxml | 49 +++++++++- pages/community/index.wxss | 20 +++- pages/{index => garden}/edit.js | 0 pages/{index => garden}/edit.json | 0 pages/{index => garden}/edit.wxml | 0 pages/{index => garden}/edit.wxss | 0 pages/garden/index.js | 86 +++++++---------- pages/garden/index.json | 5 +- pages/garden/index.wxml | 98 +++++++++++++++++++- pages/garden/index.wxss | 24 ++++- pages/{index => garden}/info.js | 0 pages/{index => garden}/info.json | 0 pages/{index => garden}/info.wxml | 0 pages/{index => garden}/info.wxss | 0 pages/index/index.js | 149 +++++++++++++++++++++++++----- pages/index/index.json | 3 + pages/index/index.wxml | 103 ++++++++++++++------- pages/index/index.wxss | 53 +++++++++-- pages/log/index.js | 9 +- pages/log/index.json | 1 + pages/log/index.wxml | 28 +++++- pages/log/index.wxss | 8 +- pages/user/index.js | 14 ++- pages/user/index.wxml | 70 +++++++++++--- pages/user/index.wxss | 9 +- project.private.config.json | 14 ++- 37 files changed, 963 insertions(+), 151 deletions(-) create mode 100644 pages/badge/index.js create mode 100644 pages/badge/index.json create mode 100644 pages/badge/index.wxml create mode 100644 pages/badge/index.wxss create mode 100644 pages/community/add.js create mode 100644 pages/community/add.json create mode 100644 pages/community/add.wxml create mode 100644 pages/community/add.wxss rename pages/{index => garden}/edit.js (100%) rename pages/{index => garden}/edit.json (100%) rename pages/{index => garden}/edit.wxml (100%) rename pages/{index => garden}/edit.wxss (100%) rename pages/{index => garden}/info.js (100%) rename pages/{index => garden}/info.json (100%) rename pages/{index => garden}/info.wxml (100%) rename pages/{index => garden}/info.wxss (100%) diff --git a/app.json b/app.json index b3755d4..fc5d089 100644 --- a/app.json +++ b/app.json @@ -2,8 +2,8 @@ "pages": [ "pages/index/index", "pages/login/index", - "pages/index/info", - "pages/index/edit", + "pages/garden/info", + "pages/garden/edit", "pages/about/index", "pages/today/index", "pages/garden/index", @@ -11,7 +11,9 @@ "pages/log/index", "pages/preview/index", "pages/user/index", - "pages/add/index" + "pages/add/index", + "pages/community/add", + "pages/badge/index" ], "window": { "navigationBarTextStyle": "black", @@ -28,14 +30,14 @@ "selectedIconPath": "static/img/home1.png", "pagePath": "pages/index/index", "iconSize": 48, - "text": "首页" + "text": "花园" }, { "iconPath": "static/img/home.png", "selectedIconPath": "static/img/home1.png", "pagePath": "pages/garden/index", "iconSize": 48, - "text": "花园" + "text": "任务" }, { "iconPath": "static/img/home.png", @@ -47,9 +49,9 @@ { "iconPath": "static/img/home.png", "selectedIconPath": "static/img/home1.png", - "pagePath": "pages/log/index", + "pagePath": "pages/badge/index", "iconSize": 48, - "text": "日志" + "text": "成就" }, { "iconPath": "static/img/clock.png", diff --git a/pages/badge/index.js b/pages/badge/index.js new file mode 100644 index 0000000..015f4bb --- /dev/null +++ b/pages/badge/index.js @@ -0,0 +1,96 @@ +// pages/badge/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + pics: [ + 'https://tdesign.gtimg.com/mobile/demos/avatar1.png', + 'https://tdesign.gtimg.com/mobile/demos/avatar2.png', + 'https://tdesign.gtimg.com/mobile/demos/avatar3.png', + 'https://tdesign.gtimg.com/mobile/demos/avatar4.png', + 'https://tdesign.gtimg.com/mobile/demos/avatar5.png', + 'https://tdesign.gtimg.com/mobile/demos/avatar1.png', + ], + + list:[ + { + title:'养护徽章', + badge:'勤劳小园丁', + tips:'累计浇水 10 次' + }, + { + title:'成长徽章', + badge:'花开有时', + tips:'第一次开花' + }, + { + title:'收藏徽章', + badge:'花园掌柜', + tips:'添加 20 株' + }, + { + title:'挑战徽章', + badge:'人气花匠', + tips:'帖子获得 10 个赞' + } + ] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/badge/index.json b/pages/badge/index.json new file mode 100644 index 0000000..d5ce318 --- /dev/null +++ b/pages/badge/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "成就徽章", + "usingComponents": { + "t-avatar": "tdesign-miniprogram/avatar/avatar", + "t-avatar-group": "tdesign-miniprogram/avatar-group/avatar-group" + } +} \ No newline at end of file diff --git a/pages/badge/index.wxml b/pages/badge/index.wxml new file mode 100644 index 0000000..373d51a --- /dev/null +++ b/pages/badge/index.wxml @@ -0,0 +1,67 @@ + + + + + + + + Nov + + + 1 + + + + + + + + + + 已有100名参与月度挑战 + + + + + + + + 多肉收割者挑战赛 + + + + + + 我的徽章 + + + + + + {{item.title}} + + + + + + {{item.badge}} + + + {{item.tips}} + + + + + + + + + 查看更多 + + + + + + + + \ No newline at end of file diff --git a/pages/badge/index.wxss b/pages/badge/index.wxss new file mode 100644 index 0000000..025e744 --- /dev/null +++ b/pages/badge/index.wxss @@ -0,0 +1,42 @@ +/* pages/badge/index.wxss */ +.bg { + height: 380rpx; + width: 100%; + border-radius: 16rpx; + background-image: url("https://res.catter.cn/pub/2025/11/18/20251118170102998.jpeg"); + background-repeat: no-repeat; + + background-position: center center; + /* 背景图不平铺 */ + /* 让背景图基于容器大小伸缩 */ + background-size: cover; + backdrop-filter: blur(10rpx); +} + +.card { + width: 100rpx; + height: 100rpx; + background-color: white; + border-radius: 16rpx; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1); +} + +.month { + width: 100%; + background-color: red; + border-top-left-radius: 16rpx; + border-top-right-radius: 16rpx; +} + +.badge { + width: 100rpx; + height: 100rpx; + border-radius: 100rpx; +} + +.grid { + display: grid; + grid-template-columns: 50% 50%; + grid-row-gap: 16px; + grid-column-gap: 16px; +} \ No newline at end of file diff --git a/pages/community/add.js b/pages/community/add.js new file mode 100644 index 0000000..5c2388e --- /dev/null +++ b/pages/community/add.js @@ -0,0 +1,66 @@ +// pages/community/add.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/community/add.json b/pages/community/add.json new file mode 100644 index 0000000..ca9404d --- /dev/null +++ b/pages/community/add.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "发布帖子", + "usingComponents": { + "t-textarea": "tdesign-miniprogram/textarea/textarea", + "t-upload": "tdesign-miniprogram/upload/upload" + } +} \ No newline at end of file diff --git a/pages/community/add.wxml b/pages/community/add.wxml new file mode 100644 index 0000000..0ebd922 --- /dev/null +++ b/pages/community/add.wxml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + 位置 + + + + 昆明市 五华区 + + + + + + + + + 参与话题 + + + + #植物园的秋天 + + + + + 发布 + + + \ No newline at end of file diff --git a/pages/community/add.wxss b/pages/community/add.wxss new file mode 100644 index 0000000..8aebd12 --- /dev/null +++ b/pages/community/add.wxss @@ -0,0 +1,4 @@ +/* pages/community/add.wxss */ +page { + background-color: white; +} \ No newline at end of file diff --git a/pages/community/index.js b/pages/community/index.js index 5cc5f38..39d67af 100644 --- a/pages/community/index.js +++ b/pages/community/index.js @@ -5,7 +5,16 @@ Page({ * 页面的初始数据 */ data: { - + list:[ + { + content:'植物园的枫叶🍁', + imgList:["https://pic1.zhimg.com/v2-e58efabf7a05544e04b6004b9b63e645_720w.jpg?source=172ae18b"] + }, + { + content:"下周就要冷了! 是不是今天就是今年最后一个适合看花看景的秋日了....", + imgList:["https://res.catter.cn/pub/2025/11/18/20251118170136790.png","https://res.catter.cn/pub/2025/11/18/20251118170155441.png"] + } + ] }, /** @@ -15,6 +24,12 @@ Page({ }, + handleClick(){ + wx.navigateTo({ + url: '../community/add', + }) + }, + /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/community/index.json b/pages/community/index.json index 8835af0..30c6c4a 100644 --- a/pages/community/index.json +++ b/pages/community/index.json @@ -1,3 +1,7 @@ { - "usingComponents": {} + "navigationBarTitleText": "植趣社区", + "usingComponents": { + "t-tabs": "tdesign-miniprogram/tabs/tabs", + "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel" + } } \ No newline at end of file diff --git a/pages/community/index.wxml b/pages/community/index.wxml index 07eab56..0415a52 100644 --- a/pages/community/index.wxml +++ b/pages/community/index.wxml @@ -1,2 +1,49 @@ -pages/community/index.wxml \ No newline at end of file + + + + + + + + + + + + + 第五季 + 23 小时前 + + + + {{item.content}} + + + + + + + + + + + + + + + + + + + 10 + + + + 4 + + + + + + + \ No newline at end of file diff --git a/pages/community/index.wxss b/pages/community/index.wxss index 1ed1d29..e818c73 100644 --- a/pages/community/index.wxss +++ b/pages/community/index.wxss @@ -1 +1,19 @@ -/* pages/community/index.wxss */ \ No newline at end of file +/* pages/community/index.wxss */ +.avatar { + height: 80rpx; + width: 80rpx; + border: white 2rpx solid; + border-radius: 60rpx; +} + +.grid { + display: grid; + grid-template-columns: 30% 30% 30%; + grid-row-gap: 8px; + grid-column-gap: 8px; +} + +.item { + background-color: #f1f1f1; + width: 100%; +} \ No newline at end of file diff --git a/pages/index/edit.js b/pages/garden/edit.js similarity index 100% rename from pages/index/edit.js rename to pages/garden/edit.js diff --git a/pages/index/edit.json b/pages/garden/edit.json similarity index 100% rename from pages/index/edit.json rename to pages/garden/edit.json diff --git a/pages/index/edit.wxml b/pages/garden/edit.wxml similarity index 100% rename from pages/index/edit.wxml rename to pages/garden/edit.wxml diff --git a/pages/index/edit.wxss b/pages/garden/edit.wxss similarity index 100% rename from pages/index/edit.wxss rename to pages/garden/edit.wxss diff --git a/pages/garden/index.js b/pages/garden/index.js index 80c987b..cbf1d3c 100644 --- a/pages/garden/index.js +++ b/pages/garden/index.js @@ -1,66 +1,50 @@ -// pages/garden/index.js +const { api } = require("../../utils/api") + +// index.js Page({ - - /** - * 页面的初始数据 - */ data: { - + list:[] }, - - /** - * 生命周期函数--监听页面加载 - */ onLoad(options) { - + }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - + onShow(){ + this.fetchList() }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - + goInfo(e){ + const id = e.currentTarget.dataset.id + wx.navigateTo({ + url: '../garden/info?id=' + id, + }) }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - + fetchList(){ + const user = wx.getStorageSync('user') + const data = {userId: user.id,current:1,pageSize:20} + api('/plant/todayCare','GET',data,'json').then(res => { + if (res.code === 200){ + if (res.data === null){ + this.setData({list:[]}) + return + } + const tmps = res.data.map(e => { + if (e.imgList.length >0){ + e.pic = e.imgList[0].url + } + return e + }) + this.setData({list:tmps}) + } + }) }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - + goAdd(){ + wx.navigateTo({ + url: '../add/index', + }) }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - /** * 用户点击右上角分享 */ onShareAppMessage() { } -}) \ No newline at end of file +}) diff --git a/pages/garden/index.json b/pages/garden/index.json index 8835af0..9598de5 100644 --- a/pages/garden/index.json +++ b/pages/garden/index.json @@ -1,3 +1,6 @@ { - "usingComponents": {} + "navigationBarTitleText": "今日任务", + "usingComponents": { + "t-progress": "tdesign-miniprogram/progress/progress" + } } \ No newline at end of file diff --git a/pages/garden/index.wxml b/pages/garden/index.wxml index c542b3c..4a53195 100644 --- a/pages/garden/index.wxml +++ b/pages/garden/index.wxml @@ -1,2 +1,96 @@ - -pages/garden/index.wxml \ No newline at end of file + + + + + + + 📅 今日养护(4个任务) + + + 已经完成 4 / 5 + + + + + + + + + + + 暂无任务 + + + 添加一颗新的植物 + + + + + + + 必做任务 (2) + + + + + + + {{item.name}} + 立即完成 + + + 需要养护: + + + + + + + + + + 已逾期 (2) + + + + + + + {{item.name}} + 立即完成 + + + + 需要养护: + + + + + + + + + + + 今日已完成 (2) + + + + + + + {{item.name}} + + + + 需要养护: + + + + + + + + + + \ No newline at end of file diff --git a/pages/garden/index.wxss b/pages/garden/index.wxss index fd9e485..dc21d0e 100644 --- a/pages/garden/index.wxss +++ b/pages/garden/index.wxss @@ -1 +1,23 @@ -/* pages/garden/index.wxss */ \ No newline at end of file +/**index.wxss**/ + +.empty { + width: 140rpx; + height: 140rpx; + background-color:#F6F6F6 ; + border-radius: 140rpx; + background-image: url("https://res.catter.cn/pub/2025/09/30/20250930143142508.png"); + background-size: cover; +} + +.bottom{ + position: fixed; + bottom: 68rpx; +} + +.pic{ + width: 120rpx; + min-width: 120rpx; + height: 120rpx; + border-radius: 16rpx; +} + diff --git a/pages/index/info.js b/pages/garden/info.js similarity index 100% rename from pages/index/info.js rename to pages/garden/info.js diff --git a/pages/index/info.json b/pages/garden/info.json similarity index 100% rename from pages/index/info.json rename to pages/garden/info.json diff --git a/pages/index/info.wxml b/pages/garden/info.wxml similarity index 100% rename from pages/index/info.wxml rename to pages/garden/info.wxml diff --git a/pages/index/info.wxss b/pages/garden/info.wxss similarity index 100% rename from pages/index/info.wxss rename to pages/garden/info.wxss diff --git a/pages/index/index.js b/pages/index/index.js index ab90cd5..7e3136f 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,49 +1,152 @@ -const { api } = require("../../utils/api") +const { + api +} = require("../../utils/api") -// index.js +// pages/garden/index.js Page({ + + /** + * 页面的初始数据 + */ data: { - list:[] + list: [], + timer: null, + name: '', + leftList: [], + rightList: [], + leftHeight: 0, + rightHeight: 0, }, + + /** + * 生命周期函数--监听页面加载 + */ onLoad(options) { - wx.setNavigationBarTitle({ - title: '我的花园', - }) + }, - onShow(){ + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + this.setData({leftList:[],rightList:[]}) this.fetchList() }, + fetchList() { + api('/plant/page', 'POST', { + current: 0, + pageSize: 999, + name: this.data.name + }, 'json').then(res => { + if (res.code == 200) { + if (res.data === null) { + return + } + const tmps = res.data.list.map(e => { + e.pic = e.imgList[0].url + return e + }) + + this.addItems(tmps) + + // this.setData({ + // list: tmps + // }) + } + }) + }, + + addItems(newItems) { + newItems.forEach(item => { + // 动态获取图片尺寸 + wx.getImageInfo({ + src: item.pic, + success: res => { + const scale = res.width / res.height; + const imgHeight = 345 / scale; // 假设宽度是 345rpx + if (this.data.leftHeight <= this.data.rightHeight) { + this.data.leftList.push(item); + this.data.leftHeight += imgHeight; + } else { + this.data.rightList.push(item); + this.data.rightHeight += imgHeight; + } + + this.setData({ + leftList: this.data.leftList, + rightList: this.data.rightList, + }); + + } + }); + }); + }, + goInfo(e){ const id = e.currentTarget.dataset.id wx.navigateTo({ url: '../index/info?id=' + id, }) }, - fetchList(){ - const user = wx.getStorageSync('user') - const data = {userId: user.id,current:1,pageSize:20} - api('/plant/todayCare','GET',data,'json').then(res => { - if (res.code === 200){ - const tmps = res.data.map(e => { - if (e.imgList.length >0){ - e.pic = e.imgList[0].url - } - return e - }) - this.setData({list:tmps}) - } - }) + onchange(e) { + const value = e.detail.value + if (this.data.timer != null) { + clearTimeout(this.data.timer) + } + this.data.timer = setTimeout(() => { + this.setData({ + name: value + }) + this.fetchList() + }, 500) }, - goAdd(){ + + + goAdd() { wx.navigateTo({ url: '../add/index', }) }, + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + /** * 用户点击右上角分享 */ onShareAppMessage() { } -}) +}) \ No newline at end of file diff --git a/pages/index/index.json b/pages/index/index.json index b55b5a2..d4982a3 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -1,4 +1,7 @@ { + "navigationBarTitleText": "花园", + "navigationStyle": "custom", "usingComponents": { + "t-search": "tdesign-miniprogram/search/search" } } \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index df99f04..3c59de5 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,45 +1,80 @@ - - - + + + + + + 天气晴朗 + + + + 20 ℃ + + + 花园健康度 83 分, 今日需养护 2 株植物 + 龟背竹长期未更新照片 + + + + + + + + + + + + {{item.name}} + 今日无需养护 + 上次养护:2 天前 + 健康指数:83% + + + + + + + + + + + {{item.name}} + 今日无需养护 + 上次养护:2 天前 + 健康指数:83% + + + + + + + + - 暂无植物 - 您还没有添加任何植物 + 欢迎来到你的秘密花园 🌿~ + 从添加第一盆植物开始你的养花之旅吧 - - 添加您的第一颗植物 + + 添加我的第一盆植物 - - - - - - - - - - - - {{item.name}} - 今日 - 已逾期{{item.expiredDays}}天 - - 种植于:{{item.plantTimeStr}} - - 需要养护: - - - + + 您还可以从以下热门植物中,免费领取 + + + + + + 绿萝 + 超好养 + 日照充足、超级好养 - - - 您添加的植物将全部显示在这里 - - - + + + + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss index ae258f9..ea34169 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -1,4 +1,8 @@ -/**index.wxss**/ +/* pages/garden/index.wxss */ +.top { + padding-bottom: 32rpx; + +} .empty { width: 140rpx; @@ -8,16 +12,47 @@ background-image: url("https://res.catter.cn/pub/2025/09/30/20250930143142508.png"); background-size: cover; } - -.bottom{ - position: fixed; - bottom: 68rpx; +.waterfall { + display: flex; + justify-content: space-between; + padding: 32rpx; } -.pic{ - width: 150rpx; - min-width: 150rpx; - height: 150rpx; +.column { + width: 48%; +} + +.card { + box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.06); + background-color: white; + border-radius: 12rpx; + +} + +.img { + width: 100%; + border-top-left-radius: 16rpx; + border-top-right-radius: 16rpx; + margin-bottom: 16rpx; + +} + +.item { + background-color: white; border-radius: 16rpx; } +.pic { + border-top-right-radius: 16rpx; + border-top-left-radius: 16rpx; + width: 100%; + +} + +.grid { + display: grid; + grid-template-columns: 50% 50%; + grid-row-gap: 16px; + grid-column-gap: 12px; + border-radius: 12rpx; +} \ No newline at end of file diff --git a/pages/log/index.js b/pages/log/index.js index 5069daa..b4fa94e 100644 --- a/pages/log/index.js +++ b/pages/log/index.js @@ -5,7 +5,14 @@ Page({ * 页面的初始数据 */ data: { - + list:[ + { + date:17, + }, + { + date:16, + } + ] }, /** diff --git a/pages/log/index.json b/pages/log/index.json index 8835af0..e22ea4e 100644 --- a/pages/log/index.json +++ b/pages/log/index.json @@ -1,3 +1,4 @@ { + "navigationBarTitleText": "养花之路", "usingComponents": {} } \ No newline at end of file diff --git a/pages/log/index.wxml b/pages/log/index.wxml index afd514f..a695502 100644 --- a/pages/log/index.wxml +++ b/pages/log/index.wxml @@ -1,2 +1,28 @@ -pages/log/index.wxml \ No newline at end of file + + + + + 今天 + 16 + + 11月17日 + + + + + + + + 玉露多肉 + + + + 换盘 + + + + + + + \ No newline at end of file diff --git a/pages/log/index.wxss b/pages/log/index.wxss index 4c9622a..01558e3 100644 --- a/pages/log/index.wxss +++ b/pages/log/index.wxss @@ -1 +1,7 @@ -/* pages/log/index.wxss */ \ No newline at end of file +/* pages/log/index.wxss */ +.avatar { + height: 60rpx; + width: 60rpx; + border: white 2rpx solid; + border-radius: 60rpx; +} \ No newline at end of file diff --git a/pages/user/index.js b/pages/user/index.js index 594abbf..f311850 100644 --- a/pages/user/index.js +++ b/pages/user/index.js @@ -1,3 +1,5 @@ +const { api } = require("../../utils/api") + // pages/user/index.js Page({ @@ -5,7 +7,8 @@ Page({ * 页面的初始数据 */ data: { - user:null + user:null, + info:null }, /** @@ -29,7 +32,14 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - + this.fetchInfo() + }, + fetchInfo(){ + api('/personal/personal','GET').then(res => { + if (res.code === 200){ + this.setData({info:res.data}) + } + }) }, /** diff --git a/pages/user/index.wxml b/pages/user/index.wxml index c959b47..c68e042 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -1,8 +1,8 @@ - + - + @@ -10,29 +10,77 @@ {{user.name}} - 已经加入 128天 + 已经加入 {{info.joinDays}} 天 + 我的徽章 已解锁 23 个 + + 🎖️🎖️🎖️🎖️🎖️🎖️🎖️ + + + + + + - + - 8 - 我的植物 + {{info.plantCount}} + 我的植物 - 8 - 养护次数 + {{info.careCount}} + 养护次数 - 8 - 成就徽章 + {{info.badgeCount}} + 成就徽章 - + + + + + + + + 我的植物 + + + + + + + 养护日志 + + + + + + + 我的成就 + + + + + + + 我的互动 + + + + + + + + + + + \ No newline at end of file diff --git a/pages/user/index.wxss b/pages/user/index.wxss index ada4e2d..75945a1 100644 --- a/pages/user/index.wxss +++ b/pages/user/index.wxss @@ -1,8 +1,6 @@ /* pages/user/index.wxss */ .bg { background-color: #4FAB5F; - border-bottom-left-radius: 32rpx; - border-bottom-right-radius: 32rpx; padding: 32rpx; } @@ -11,4 +9,11 @@ width: 120rpx; border: white 2rpx solid; border-radius: 60rpx; +} + +.camera{ + background-color: #4fab5e3d; + width: 100rpx; + height: 100rpx; + border-radius: 50rpx; } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 0c9a4af..5e67f92 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -20,5 +20,17 @@ "bigPackageSizeSupport": false }, "libVersion": "3.10.1", - "condition": {} + "condition": { + "miniprogram": { + "list": [ + { + "name": "pages/community/add", + "pathName": "pages/community/add", + "query": "", + "scene": null, + "launchMode": "default" + } + ] + } + } } \ No newline at end of file