关联合同合同
This commit is contained in:
parent
c7aabd0fef
commit
6adee1c52c
30
app.json
30
app.json
@ -8,7 +8,10 @@
|
||||
"pages/index/info",
|
||||
"pages/index/edit",
|
||||
"pages/about/index",
|
||||
"pages/today/index"
|
||||
"pages/today/index",
|
||||
"pages/garden/index",
|
||||
"pages/community/index",
|
||||
"pages/log/index"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
@ -25,14 +28,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": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
66
pages/community/index.js
Normal file
@ -0,0 +1,66 @@
|
||||
// pages/community/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
3
pages/community/index.json
Normal file
3
pages/community/index.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
2
pages/community/index.wxml
Normal file
2
pages/community/index.wxml
Normal file
@ -0,0 +1,2 @@
|
||||
<!--pages/community/index.wxml-->
|
||||
<text>pages/community/index.wxml</text>
|
||||
1
pages/community/index.wxss
Normal file
1
pages/community/index.wxss
Normal file
@ -0,0 +1 @@
|
||||
/* pages/community/index.wxss */
|
||||
66
pages/garden/index.js
Normal file
66
pages/garden/index.js
Normal 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
3
pages/garden/index.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
2
pages/garden/index.wxml
Normal file
2
pages/garden/index.wxml
Normal file
@ -0,0 +1,2 @@
|
||||
<!--pages/garden/index.wxml-->
|
||||
<text>pages/garden/index.wxml</text>
|
||||
1
pages/garden/index.wxss
Normal file
1
pages/garden/index.wxss
Normal file
@ -0,0 +1 @@
|
||||
/* pages/garden/index.wxss */
|
||||
@ -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
66
pages/log/index.js
Normal 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
3
pages/log/index.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
2
pages/log/index.wxml
Normal file
2
pages/log/index.wxml
Normal file
@ -0,0 +1,2 @@
|
||||
<!--pages/log/index.wxml-->
|
||||
<text>pages/log/index.wxml</text>
|
||||
1
pages/log/index.wxss
Normal file
1
pages/log/index.wxss
Normal file
@ -0,0 +1 @@
|
||||
/* pages/log/index.wxss */
|
||||
Loading…
Reference in New Issue
Block a user