mkm
/
yanzhiAPP
Template
2
0
Fork 0
yanzhiAPP/pages/records/index.vue

161 lines
3.1 KiB
Vue

<template>
<view class="content">
<!-- <view class="card">
<view class="tit">
<view class="">
1号土地
</view>
<view class="">
溯源码: 12302
</view>
</view>
<view class="card-li">
<view class="">
当前种植: 土豆
</view>
<view class="">
种植品牌: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
种子品牌: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
预计产量: 20
</view>
<view class="">
已出售: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
播种时间: 2020.12.01
</view>
</view>
</view> -->
<landInfo :land_id='land_id'></landInfo>
<view class="histroy">
<view class="tit" style="margin-bottom: 40rpx;">
历史操作记录
</view>
<myTable :dataList='dataList'></myTable>
</view>
<view class="btn" @click="navgo(`/pages/growRecord/index?land_id=${land_id}&crop_id=${crop_id}&type=1`)">
记录今日操作
</view>
</view>
</template>
<script setup>
import {
actionsListAPI,
actionsDetailAPI,
landCropRecordListAPI,
landCropRecordInfoAPI
} from "@/api/plant.js"
import myTable from "@/components/myTable/index.vue"
import landInfo from "@/components/plant/landInfo.vue"
import {
onLoad
} from "@dcloudio/uni-app"
import {
actionsAPI
} from "@/api/animal.js"
import {
reactive,
ref
} from "vue"
// actionsListAPI({
// type: 1
// }).then(res => {
// console.log(res)
// })
const land_id = ref(0)
const crop_id = ref(0)
const dataList = reactive({})
onLoad((option) => {
land_id.value = option.land_id
crop_id.value = option.crop_id
actionsAPI({
type: 1,
crop_id: crop_id.value
}).then(res => {
// console.log(res.data[option.index].action_record)
for (let key in res.data[option.index].action_record) {
dataList[key] = res.data[option.index].action_record[key]
}
})
// landCropRecordInfoAPI({
// record_id: 41
// })
// landCropRecordListAPI({
// crop_id: 1,
// action_type_id: 1
// }).then(res => {
// for (let key in res.data) {
// dataList[key] = res.data[key]
// }
// console.log(dataList)
// })
})
// actionsDetailAPI({
// action_id: 2
// }).then(res => {
// // console.log(res)
// })
const navgo = (url) => {
uni.navigateTo({
url
})
}
</script>
<style lang="scss" scoped>
.content {
padding: 20rpx;
background-color: #F4F4F4;
min-height: 100vh;
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.table {
height: 500rpx;
background-color: red;
}
.btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
border: 1px solid #00A15E;
text-align: center;
line-height: 66rpx;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
margin: 0 auto;
margin-top: 80rpx;
}
}
</style>