Compare commits
No commits in common. "c1cb08d66065f1aecb6684e520bb5cb8b8e8afd2" and "79b1af6bb6953ca3f3001c51e08e8b42220a57bb" have entirely different histories.
c1cb08d660
...
79b1af6bb6
31
app.json
31
app.json
@ -9,13 +9,7 @@
|
|||||||
"pages/index/edit",
|
"pages/index/edit",
|
||||||
"pages/about/index",
|
"pages/about/index",
|
||||||
"pages/today/index",
|
"pages/today/index",
|
||||||
<<<<<<< HEAD
|
|
||||||
"pages/garden/index",
|
|
||||||
"pages/community/index",
|
|
||||||
"pages/log/index"
|
|
||||||
=======
|
|
||||||
"pages/preview/index"
|
"pages/preview/index"
|
||||||
>>>>>>> 79b1af6bb6953ca3f3001c51e08e8b42220a57bb
|
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
@ -32,35 +26,14 @@
|
|||||||
"selectedIconPath": "static/img/home1.png",
|
"selectedIconPath": "static/img/home1.png",
|
||||||
"pagePath": "pages/index/index",
|
"pagePath": "pages/index/index",
|
||||||
"iconSize": 48,
|
"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",
|
"iconPath": "static/img/clock.png",
|
||||||
"selectedIconPath": "static/img/clock1.png",
|
"selectedIconPath": "static/img/clock1.png",
|
||||||
"pagePath": "pages/today/index",
|
"pagePath": "pages/today/index",
|
||||||
"iconSize": 48,
|
"iconSize": 48,
|
||||||
"text": "我的"
|
"text": "今日农事"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@ -6,7 +6,6 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
key:'',
|
|
||||||
timer:null,
|
timer:null,
|
||||||
list:[],
|
list:[],
|
||||||
hotList:[
|
hotList:[
|
||||||
@ -41,10 +40,9 @@ Page({
|
|||||||
const key = e.detail.value
|
const key = e.detail.value
|
||||||
this.data.timer = setTimeout(() => {
|
this.data.timer = setTimeout(() => {
|
||||||
if (key.length === 0){
|
if (key.length === 0){
|
||||||
this.setData({list:[],key:''})
|
this.setData({list:[]})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.setData({key:key})
|
|
||||||
this.fetchList(key)
|
this.fetchList(key)
|
||||||
|
|
||||||
}, 500)
|
}, 500)
|
||||||
@ -61,51 +59,6 @@ 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){
|
goInfo(e){
|
||||||
const id = e.currentTarget.dataset.id
|
const id = e.currentTarget.dataset.id
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<view class="padding">
|
<view class="padding">
|
||||||
<t-search placeholder="请输入植物名称..." shape="round" bind:change="search" />
|
<t-search placeholder="请输入植物名称..." shape="round" bind:change="search" />
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{list.length === 0 && key.length === 0}}">
|
<view wx:if="{{list.length === 0}}">
|
||||||
<view class="font-14 bold padding">热门植物</view>
|
<view class="font-14 bold padding">热门植物</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="grid">
|
<view class="grid">
|
||||||
@ -18,7 +18,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 搜索列表 -->
|
<!-- 搜索列表 -->
|
||||||
<view>
|
<view>
|
||||||
<scroll-view scroll-y="{{true}}" wx:if="{{list.length > 0}}">
|
<scroll-view scroll-y="{{true}}">
|
||||||
<view wx:for="{{list}}">
|
<view wx:for="{{list}}">
|
||||||
<view class=" flex flex-center flex-justify-start" style="padding: 16rpx 32rpx;" data-id="{{item.id}}" bind:tap="goInfo">
|
<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>
|
<image class="pic1" mode="aspectFill" src="{{item.oss.url}}"></image>
|
||||||
@ -29,10 +29,5 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-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>
|
||||||
</view>
|
</view>
|
||||||
@ -1,66 +0,0 @@
|
|||||||
// pages/community/index.js
|
|
||||||
Page({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad(options) {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage() {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
<!--pages/community/index.wxml-->
|
|
||||||
<text>pages/community/index.wxml</text>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/* pages/community/index.wxss */
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
// pages/garden/index.js
|
|
||||||
Page({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad(options) {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage() {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
<!--pages/garden/index.wxml-->
|
|
||||||
<text>pages/garden/index.wxml</text>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/* pages/garden/index.wxss */
|
|
||||||
@ -16,7 +16,7 @@ page {
|
|||||||
.bg {
|
.bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
background-color: rebeccapurple;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
display: block; /* 必须加,否则 image 不会撑满父容器 */
|
display: block; /* 必须加,否则 image 不会撑满父容器 */
|
||||||
|
|||||||
@ -1,66 +0,0 @@
|
|||||||
// pages/log/index.js
|
|
||||||
Page({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad(options) {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage() {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
<!--pages/log/index.wxml-->
|
|
||||||
<text>pages/log/index.wxml</text>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/* pages/log/index.wxss */
|
|
||||||
Loading…
Reference in New Issue
Block a user