fix
This commit is contained in:
parent
5ee3e89e0a
commit
bc3b4d57c4
4
app.json
4
app.json
@ -28,8 +28,8 @@
|
||||
"text": "我的花园"
|
||||
},
|
||||
{
|
||||
"iconPath": "static/img/home.png",
|
||||
"selectedIconPath": "static/img/home1.png",
|
||||
"iconPath": "static/img/clock.png",
|
||||
"selectedIconPath": "static/img/clock1.png",
|
||||
"pagePath": "pages/today/index",
|
||||
"iconSize": 48,
|
||||
"text": "今日农事"
|
||||
|
||||
2
app.wxss
2
app.wxss
@ -3,7 +3,7 @@ page {
|
||||
--td-brand-color: #4FAB5F;
|
||||
--td-brand-color-active: #4FAB5F;
|
||||
color: #373737;
|
||||
background: white;
|
||||
background: #F6F6F6;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -57,6 +57,7 @@ Component({
|
||||
},
|
||||
confirm(e) {
|
||||
const value = e.detail.value[0]
|
||||
console.log(e);
|
||||
this.setData({
|
||||
result: value,
|
||||
visible:false
|
||||
|
||||
@ -20,6 +20,12 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
goHome(){
|
||||
wx.switchTab({
|
||||
url: '../index/index',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "农事提醒",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@ -4,13 +4,17 @@
|
||||
<view>
|
||||
<view class="flex flex-center flex-justify-start">
|
||||
<image src="https://res.catter.cn/pub/2025/09/30/20250930143142508.png" style="width: 100rpx;height: 100rpx;" />
|
||||
<view class="ml-16">养花小技巧-植趣</view>
|
||||
<view class="ml-16">植趣 ZeeQ</view>
|
||||
</view>
|
||||
<view class="flex flex-center flex-col">
|
||||
<image src="https://res.catter.cn/pub/2025/10/09/20251009151641528.png" style="width: 90vw; height: 90vw;" show-menu-by-longpress/>
|
||||
<view>关注公众号,接收浇水、施肥等日程提醒</view>
|
||||
<image src="https://res.catter.cn/pub/2025/10/14/20251014110325332.jpg" style="width: 90vw; height: 90vw;" show-menu-by-longpress/>
|
||||
<view>关注公众号,接收浇水、施肥等农事提醒</view>
|
||||
<view class="mt-32 font-12 grey text-center">系统会根据您添加的花卉,自动生成浇水、施肥、修剪等提醒,您需要通过长按上面的二维码识别并关注我们的公众号,确保能接收消息提醒。</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="full-width flex flex-center mt-32">
|
||||
<t-button theme="primary" shape="round" style="width: 80%;" bind:tap="goHome">返回我的花园</t-button>
|
||||
</view>
|
||||
</view>
|
||||
@ -19,7 +19,17 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.fetchHotList()
|
||||
},
|
||||
|
||||
fetchHotList(){
|
||||
const data ={ current:1,pageSize:20,isHot:1}
|
||||
api('/library/list','POST',data,'json').then(res => {
|
||||
if (res.code === 200){
|
||||
const list = res.data.list
|
||||
this.setData({hotList:list})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
search(e){
|
||||
|
||||
@ -7,9 +7,9 @@
|
||||
<view class="font-14 bold padding">热门植物</view>
|
||||
<view>
|
||||
<view class="grid">
|
||||
<view wx:for="{{hotList}}" wx:key="url" style="background-color: #F6F8FE; border-radius: 16rpx;">
|
||||
<view class="item" bind:tap="goInfo">
|
||||
<image class="pic" src="{{item.url}}" mode="aspectFill"></image>
|
||||
<view wx:for="{{hotList}}" style="background-color: #F6F8FE; border-radius: 16rpx;">
|
||||
<view class="item" data-id="{{item.id}}" bind:tap="goInfo">
|
||||
<image class="pic" src="{{item.oss.url}}" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view style="padding: 16rpx 16rpx 16rpx 10rpx;" class="font-12 bold">{{item.name}}</view>
|
||||
</view>
|
||||
@ -21,7 +21,7 @@
|
||||
<scroll-view scroll-y="{{true}}">
|
||||
<view wx:for="{{list}}">
|
||||
<view class=" flex flex-center flex-justify-start" style="padding: 16rpx 32rpx;" data-id="{{item.id}}" bind:tap="goInfo">
|
||||
<image class="pic1" src="https://res.catter.cn/pub/2025/09/30/20250930143920286.png"></image>
|
||||
<image class="pic1" mode="aspectFill" src="{{item.oss.url}}"></image>
|
||||
<view style="padding-left: 16rpx;">
|
||||
<view class="font-14 bold">{{item.name}}</view>
|
||||
<view class="font-14 grey">{{item.aliases}}</view>
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
/* pages/add/index.wxss */
|
||||
page{
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.card {
|
||||
margin: 16rpx;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<view wx:if="{{info}}">
|
||||
<!-- top -->
|
||||
<view class="top" style="position: relative; z-index: 2;">
|
||||
<image src="https://res.catter.cn/pub/2025/09/30/20250930150006852.png" style="width: 100vw; height: 680rpx;" mode="aspectFill"></image>
|
||||
<image src="{{info.oss.url}}" style="width: 100vw; height: 680rpx;" mode="aspectFill"></image>
|
||||
</view>
|
||||
|
||||
|
||||
@ -35,61 +35,17 @@
|
||||
|
||||
<view class="padding" style="padding-bottom: 240rpx;">
|
||||
<view>
|
||||
<view class="row padding ">
|
||||
<view>浇水</view>
|
||||
<view class="flex flex-justify-start flex-justify-start mt-16">
|
||||
<view class="row padding mb-32" wx:for="{{info.careSchedules[season].items}}">
|
||||
<view>{{item.name}}</view>
|
||||
<view class="flex flex-justify-start flex-center mt-16">
|
||||
<t-avatar shape="round" icon="color-invert" />
|
||||
<view class="font-14 bold ml-16">每{{info.careSchedules[season].wateringCycle}}天一次</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="row padding mt-32">
|
||||
<view>施肥</view>
|
||||
<view class="flex flex-justify-start flex-justify-start mt-16">
|
||||
<t-avatar shape="round" icon="color-invert" />
|
||||
<view>
|
||||
<view class="bold ml-16">每{{info.careSchedules[season].liquidFertilizerCycle}}天一次</view>
|
||||
<view class="ml-16 grey">液体肥料</view>
|
||||
<view class="ml-16">
|
||||
<view class="font-14 bold ">每{{item.cycleDays}}天一次</view>
|
||||
<view class="font-12 grey">
|
||||
{{item.desc}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex flex-justify-start flex-justify-start mt-32">
|
||||
<t-avatar shape="round" icon="color-invert" />
|
||||
<view>
|
||||
<view class="bold ml-16">每{{info.careSchedules[season].slowReleaseFertilizerCycle}}天一次</view>
|
||||
<view class="ml-16 grey">缓释肥</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-32">推荐肥料</view>
|
||||
|
||||
<view class="mt-16">
|
||||
<t-tag theme="primary" >
|
||||
{{info.careSchedules[season].suitableFertilizer}}
|
||||
</t-tag>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="row padding mt-32">
|
||||
<view>修剪</view>
|
||||
<view class="flex flex-justify-start flex-center mt-16">
|
||||
<t-avatar shape="round" icon="color-invert" />
|
||||
<view class="ml-16">
|
||||
<view class="font-14 bold ">每{{info.careSchedules[season].pruningCycle}}天一次</view>
|
||||
<view class="font-12 grey">抵御病虫害、生长茂盛</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="row padding mt-32">
|
||||
<view>旋转</view>
|
||||
<view class="flex flex-justify-start flex-center mt-16">
|
||||
<t-avatar shape="round" icon="color-invert" />
|
||||
<view class="ml-16">
|
||||
<view class="font-14 bold ">每{{info.careSchedules[season].rotationCycle}}天一次</view>
|
||||
<view class="font-12 grey">株形匀称</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -102,7 +58,24 @@
|
||||
<view class="font-12 grey">最佳光照</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="row padding mt-32">
|
||||
<view>温度</view>
|
||||
<view class="mt-16">
|
||||
<view class="font-14 grey">适应温度</view>
|
||||
<view class="flex flex-center flex-justify-start mt-5">
|
||||
<view>{{info.hardyTempMin}} ℃</view>
|
||||
<view class="ml-16 mr-16"> ~ </view>
|
||||
<view>{{info.hardyTempMax}} ℃</view>
|
||||
</view>
|
||||
<view class="font-14 grey mt-16">最佳温度</view>
|
||||
<view class="flex flex-center flex-justify-start mt-5">
|
||||
<view>{{info.optimalTempMin}} ℃</view>
|
||||
<view class="ml-16 mr-16"> ~ </view>
|
||||
<view>{{info.optimalTempMax}} ℃</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="row padding mt-32">
|
||||
@ -172,7 +145,6 @@
|
||||
<view class="bottom">
|
||||
<view class="flex flex-center flex-col">
|
||||
<t-button shape="round" theme="primary" style="width: 80%;" bind:tap="add">获取养护日程</t-button>
|
||||
<t-button shape="round" theme="text" style="width: 80%; margin-top: 16rpx;">立即拥有</t-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -26,7 +26,7 @@ Page({
|
||||
api('/plant/detail','GET',{id: this.data.id}).then(res => {
|
||||
if (res.code === 200){
|
||||
const tmp = res.data
|
||||
tmp.farms.suitableFertilizer = tmp.farms.suitableFertilizer.split(',')
|
||||
tmp.farms.suitableFertilizer = tmp.pestsDiseases.split(',')
|
||||
if (tmp.ossList.length >0 ){
|
||||
tmp.pic = tmp.ossList[0].url
|
||||
}
|
||||
@ -47,10 +47,7 @@ Page({
|
||||
},
|
||||
updateFarms(e){
|
||||
const value = e.detail.value
|
||||
console.log(value);
|
||||
const user = wx.getStorageSync('user')
|
||||
var data = {id: this.data.info.farms.id,plantId: this.data.info.farms.plantId,userId:user.id}
|
||||
data[value.prop] = value.value
|
||||
var data = {id: value.prop,cycleDays: value.value}
|
||||
api('/plant/updateFarm','POST',data,'json').then(res => {
|
||||
if (res.code === 200){
|
||||
wx.showToast({
|
||||
@ -83,14 +80,14 @@ Page({
|
||||
success: res => {
|
||||
var data = JSON.parse(res.data);
|
||||
if (data.code === 200) {
|
||||
const params = {ossIds:[data.data.file.id],plantId: _this.data.info.farms.plantId}
|
||||
const params = {ossIds:[data.data.file.id],plantId: _this.data.info.id}
|
||||
api('/plant/uploadImg','POST',params,'json').then(res => {
|
||||
if (res.code === 200){
|
||||
wx.showToast({
|
||||
icon:'success',
|
||||
title: res.msg,
|
||||
})
|
||||
this.fetchInfo()
|
||||
_this.fetchInfo()
|
||||
}else {
|
||||
wx.showModal({
|
||||
content: res.msg
|
||||
|
||||
@ -32,11 +32,7 @@
|
||||
|
||||
<view class="white-bg mt-32 " style="border-radius: 16rpx;">
|
||||
<view style=" padding-top: 16rpx; padding-bottom: 16rpx;">
|
||||
<picker title="浇水" value="{{info.farms.wateringCycle}}" prop="wateringCycle" bind:ok="updateFarms"></picker>
|
||||
<picker title="施肥" value="{{info.farms.slowReleaseFertilizerCycle}}" prop="slowReleaseFertilizerCycle" bind:ok="updateFarms"></picker>
|
||||
<t-cell title="施肥类型" bordered="{{false}}" hover arrow note="水溶肥" />
|
||||
<picker title="旋转" value="{{info.farms.rotationCycle}}" prop="rotationCycle" bind:ok="updateFarms"></picker>
|
||||
<picker title="修剪" value="{{info.farms.pruningCycle}}" prop="pruningCycle" bind:ok="updateFarms"></picker>
|
||||
<picker wx:for="{{info.farms}}" title="{{item.name}}" value="{{item.cycleDays}}" prop="{{item.id}}" bind:ok="updateFarms"></picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@ -19,13 +19,16 @@
|
||||
<view class="flex flex-center flex-justify-start">
|
||||
<image class="pic" mode="aspectFill" wx:if="{{item.pic}}" src="{{item.pic}}"></image>
|
||||
<image class="pic" mode="aspectFill" wx:else src="https://res.catter.cn/pub/2025/09/30/20250930143920286.png"></image>
|
||||
<view style="margin-left:16rpx">
|
||||
<view class="font-16 bold">{{item.name}}</view>
|
||||
<view class="font-14 grey">{{item.latinName}}</view>
|
||||
<view style="margin-left:16rpx;" class="full-width">
|
||||
<view class="flex flex-center flex-justify-between full-width">
|
||||
<view class="font-16 bold">{{item.name}}</view>
|
||||
<t-tag shape="round" theme="primary" size="small">健康</t-tag>
|
||||
</view>
|
||||
<view class="font-14 grey mt-5">已养护2天</view>
|
||||
<view class="flex flex-center flex-justify-start mt-16 ">
|
||||
<t-avatar size="56rpx" icon="color-invert" />
|
||||
<t-avatar size="56rpx" image="https://res.catter.cn/pub/2025/10/14/20251014103658702.svg" />
|
||||
<view class="ml-32">
|
||||
<t-avatar size="56rpx" icon="color-invert" />
|
||||
<t-avatar size="56rpx" image="https://res.catter.cn/pub/2025/10/14/20251014104232616.svg" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -16,10 +16,8 @@
|
||||
|
||||
.pic{
|
||||
width: 150rpx;
|
||||
min-width: 150rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.row {
|
||||
background-color: #F6F8FE;
|
||||
}
|
||||
@ -16,7 +16,6 @@ Page({
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({id:options.id})
|
||||
this.fetchInfo()
|
||||
},
|
||||
|
||||
fetchInfo(){
|
||||
@ -24,7 +23,7 @@ Page({
|
||||
api('/plant/detail','GET',data).then(res => {
|
||||
if (res.code === 200){
|
||||
const tmp = res.data
|
||||
tmp.farms.suitableFertilizer = tmp.farms.suitableFertilizer.split(',')
|
||||
tmp.farms.suitableFertilizer = tmp.pestsDiseases.split(',')
|
||||
if (tmp.ossList.length >0 ){
|
||||
tmp.pic = tmp.ossList[0].url
|
||||
tmp.picList = tmp.ossList.map(sub => sub.url)
|
||||
@ -42,7 +41,7 @@ Page({
|
||||
|
||||
addFarmLog(e){
|
||||
const item = e.currentTarget.dataset.item
|
||||
const data = {id:item.id,plantId:item.plantId, title:item.title,remark:'测试',status:2}
|
||||
const data = {id:item.id,plantId:item.plantId, name:item.name,remark:'测试',status:2}
|
||||
api('/plant/addRecord','POST',data,'json').then(res => {
|
||||
if (res.code === 200){
|
||||
wx.showToast({
|
||||
@ -74,7 +73,7 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
this.fetchInfo()
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -43,18 +43,19 @@
|
||||
<view>
|
||||
<view class="row padding mt-32">
|
||||
<view>今日任务</view>
|
||||
<view class="flex flex-center flex-justify-between mt-16" wx:for="{{farms}}">
|
||||
<view class="flex flex-center flex-justify-between mt-16" wx:for="{{info.todayFarms}}">
|
||||
<view class="flex flex-justify-start flex-aligin-center mt-16">
|
||||
<t-avatar icon="color-invert" />
|
||||
<view class="ml-16">
|
||||
<view class="font-14 bold">{{item.title}}</view>
|
||||
<view class="font-12 grey">每{{info.farms.wateringCycle}}天一次</view>
|
||||
<view class="font-14 bold">{{item.name}}</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<t-button wx:if="{{item.status == 1}}" theme="danger" variant="outline" shape="round" size="small" data-item="{{item}}" bind:tap="addFarmLog">未完成</t-button>
|
||||
<t-button wx:if="{{item.status == 2}}" theme="primary" shape="round" size="small" data-item="{{item}}" bind:tap="addFarmLog">完成</t-button>
|
||||
<t-button wx:if="{{item.status == 3}}" theme="primary" shape="round" size="small" data-item="{{item}}" bind:tap="addFarmLog">逾期</t-button>
|
||||
<t-button wx:if="{{item.status == 4}}" disabled shape="round" size="small" >已跳过</t-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -77,7 +78,7 @@
|
||||
<view>养护提示</view>
|
||||
<view class="flex flex-center flex-justify-between mt-16">
|
||||
<view class="flex flex-justify-start flex-aligin-center mt-16">
|
||||
<view class="font-14 bold ml-16">{{info.farms.desc}}</view>
|
||||
<view class="font-14 bold ml-16">{{info.growthHabit}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-16">
|
||||
|
||||
@ -56,10 +56,28 @@ Page({
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
goInfo(e){
|
||||
const id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({
|
||||
url: '../index/info?id=' + id,
|
||||
})
|
||||
},
|
||||
skip(e){
|
||||
const item = e.currentTarget.dataset.item
|
||||
const data = {id:item.id,plantId:item.plantId, name:item.name,remark:'测试',status:4}
|
||||
api('/plant/addRecord','POST',data,'json').then(res => {
|
||||
if (res.code === 200){
|
||||
wx.showToast({
|
||||
icon:'success',
|
||||
title: res.msg,
|
||||
})
|
||||
this.fetchInfo()
|
||||
}
|
||||
})
|
||||
},
|
||||
addFarmLog(e){
|
||||
const item = e.currentTarget.dataset.item
|
||||
const data = {id:item.id,plantId:item.plantId, title:item.title,remark:'测试',status:2}
|
||||
const data = {id:item.id,plantId:item.plantId, name:item.name,remark:'测试',status:2}
|
||||
api('/plant/addRecord','POST',data,'json').then(res => {
|
||||
if (res.code === 200){
|
||||
wx.showToast({
|
||||
|
||||
@ -10,25 +10,23 @@
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="padding">
|
||||
<view>
|
||||
今日任务
|
||||
</view>
|
||||
<view class="mt-32">
|
||||
<view class="mb-32">
|
||||
<view wx:for="{{list}}">
|
||||
<view class="">
|
||||
<view wx:for="{{item.FarmRecord}}" wx:for-item="sub" class=" row padding mt-32">
|
||||
<view wx:for="{{item.todayFarm}}" wx:for-item="sub" class=" row padding mb-32" data-id="{{item.id}}" bind:tap="goInfo">
|
||||
<view>
|
||||
<view class="action font-16 bold">{{sub.title}}</view>
|
||||
<view class="action font-16 bold">{{sub.name}}</view>
|
||||
<view class="flex flex-center flex-justify-between">
|
||||
<view class="flex flex-center flex-justify-start mt-16">
|
||||
<image src="{{item.pic}}" class="pic"></image>
|
||||
<view class="ml-16">{{item.name}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<t-avatar wx:if="{{sub.status != 2}}" size="56rpx" image="https://res.catter.cn/pub/2025/10/14/20251014105954456.svg" data-item="{{sub}}" bind:tap="skip" class="mr-16"/>
|
||||
<t-button wx:if="{{sub.status == 1}}" theme="danger" variant="outline" shape="round" size="small" data-item="{{sub}}" bind:tap="addFarmLog">未完成</t-button>
|
||||
<t-button wx:if="{{sub.status == 2}}" theme="primary" shape="round" size="small" data-item="{{sub}}" bind:tap="addFarmLog">完成</t-button>
|
||||
<t-button wx:if="{{sub.status == 3}}" theme="primary" shape="round" size="small" data-item="{{sub}}" bind:tap="addFarmLog">逾期</t-button>
|
||||
|
||||
<t-button wx:if="{{sub.status == 4}}" disabled shape="round" size="small" >已跳过</t-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
BIN
static/.DS_Store
vendored
Normal file
BIN
static/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
static/img/clock.png
Normal file
BIN
static/img/clock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
BIN
static/img/clock1.png
Normal file
BIN
static/img/clock1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Loading…
Reference in New Issue
Block a user