Compare commits

...

2 Commits

Author SHA1 Message Date
sdaduanbilei
c1cb08d660 关联合同合同 2025-11-06 17:28:12 +08:00
sdaduanbilei
6adee1c52c 关联合同合同 2025-11-06 17:27:03 +08:00
16 changed files with 301 additions and 6 deletions

View File

@ -9,7 +9,13 @@
"pages/index/edit",
"pages/about/index",
"pages/today/index",
<<<<<<< HEAD
"pages/garden/index",
"pages/community/index",
"pages/log/index"
=======
"pages/preview/index"
>>>>>>> 79b1af6bb6953ca3f3001c51e08e8b42220a57bb
],
"window": {
"navigationBarTextStyle": "black",
@ -26,14 +32,35 @@
"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": "花园"
},
{
"iconPath": "static/img/home.png",
"selectedIconPath": "static/img/home1.png",
"pagePath": "pages/community/index",
"iconSize": 48,
"text": "社区"
},
{
"iconPath": "static/img/home.png",
"selectedIconPath": "static/img/home1.png",
"pagePath": "pages/log/index",
"iconSize": 48,
"text": "日志"
},
{
"iconPath": "static/img/clock.png",
"selectedIconPath": "static/img/clock1.png",
"pagePath": "pages/today/index",
"iconSize": 48,
"text": "今日农事"
"text": "我的"
}
]
},

View File

@ -6,6 +6,7 @@ Page({
* 页面的初始数据
*/
data: {
key:'',
timer:null,
list:[],
hotList:[
@ -40,9 +41,10 @@ Page({
const key = e.detail.value
this.data.timer = setTimeout(() => {
if (key.length === 0){
this.setData({list:[]})
this.setData({list:[],key:''})
return
}
this.setData({key:key})
this.fetchList(key)
}, 500)
@ -59,6 +61,51 @@ Page({
})
},
addPlant(){
var data = {
"aliases": "",
"farms": [
{
"cycleDays": 0,
"desc": "",
"name": ""
}
],
"flowerDiameter": 0,
"floweringColor": "",
"floweringPeriod": "",
"floweringShape": "",
"foliageColor": "",
"foliageShape": "",
"foliageType": "",
"genus": "",
"GrowthHabit": "",
"hardyTempMax": 0,
"hardyTempMin": 0,
"height": 0,
"latinName": "",
"lifeCycle": "",
"lightIntensity": "",
"lightType": "",
"name": "",
"optimalTempMax": 0,
"optimalTempMin": 0,
"ossIds": [
"9b8efb93-af19-11f0-997e-bc2411e64a23"
],
"pestsDiseases": "",
"tag": ""
}
data.name = this.data.key
api('/plant/plant','POST',data,'json').then(res => {
if(res.code === 200){
console.log(res.data);
}else {
wx.showModal({
content: res.msg})
}
})
},
goInfo(e){
const id = e.currentTarget.dataset.id

View File

@ -3,7 +3,7 @@
<view class="padding">
<t-search placeholder="请输入植物名称..." shape="round" bind:change="search" />
</view>
<view wx:if="{{list.length === 0}}">
<view wx:if="{{list.length === 0 && key.length === 0}}">
<view class="font-14 bold padding">热门植物</view>
<view>
<view class="grid">
@ -18,7 +18,7 @@
</view>
<!-- 搜索列表 -->
<view>
<scroll-view scroll-y="{{true}}">
<scroll-view scroll-y="{{true}}" wx:if="{{list.length > 0}}">
<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" mode="aspectFill" src="{{item.oss.url}}"></image>
@ -29,5 +29,10 @@
</view>
</view>
</scroll-view>
<view wx:if="{{list.length === 0 && key.length > 0}}">
<view class="full-width flex flex-center" style="margin-top: 96rpx;">
<t-button theme="primary" shape="round" style="width: 60%;" variant="outline" bind:tap="addPlant" >通过 植趣AI 搜索</t-button>
</view>
</view>
</view>
</view>

66
pages/community/index.js Normal file
View File

@ -0,0 +1,66 @@
// pages/community/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,2 @@
<!--pages/community/index.wxml-->
<text>pages/community/index.wxml</text>

View File

@ -0,0 +1 @@
/* pages/community/index.wxss */

66
pages/garden/index.js Normal file
View File

@ -0,0 +1,66 @@
// pages/garden/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

3
pages/garden/index.json Normal file
View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

2
pages/garden/index.wxml Normal file
View File

@ -0,0 +1,2 @@
<!--pages/garden/index.wxml-->
<text>pages/garden/index.wxml</text>

1
pages/garden/index.wxss Normal file
View File

@ -0,0 +1 @@
/* pages/garden/index.wxss */

View File

@ -16,7 +16,7 @@ page {
.bg {
width: 100%;
height: 100%;
background-color: rebeccapurple;
border-radius: 16rpx;
z-index: 1;
display: block; /* 必须加,否则 image 不会撑满父容器 */

66
pages/log/index.js Normal file
View File

@ -0,0 +1,66 @@
// pages/log/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

3
pages/log/index.json Normal file
View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

2
pages/log/index.wxml Normal file
View File

@ -0,0 +1,2 @@
<!--pages/log/index.wxml-->
<text>pages/log/index.wxml</text>

1
pages/log/index.wxss Normal file
View File

@ -0,0 +1 @@
/* pages/log/index.wxss */