From 3b2c00b839a85a3d67b9712db582638b303737fd Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Mon, 30 Oct 2023 19:09:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 5 +- api/plant.js | 2 +- components/animal/farmersCard.vue | 1 - components/aquatic/pondCard.vue | 25 ++- components/index/chick.vue | 45 +--- components/index/cultivation.vue | 6 +- components/myTable/index.vue | 5 +- index.html | 37 ++-- node_modules/.vite/deps/_metadata.json | 6 +- node_modules/.vite/deps/uview-plus.js | 234 ++++++++++---------- node_modules/.vite/deps/uview-plus.js.map | 2 +- pages.json | 8 + pages/aquatic/addPond.vue | 26 ++- pages/aquatic/allRecordTable.vue | 87 ++++++++ pages/aquatic/detail.vue | 76 +++---- pages/detail/plant.vue | 41 ++-- pages/feedIng/allRecordTable.vue | 34 +-- pages/feedIng/feedDetail.vue | 11 +- pages/growRecord/chick.vue | 32 +-- pages/growRecord/feedIng.vue | 25 +-- pages/growRecord/fish.vue | 250 ++++++---------------- pages/growRecord/index.vue | 153 ++++--------- pages/index/index.vue | 7 + pages/poultry/addPoultry.vue | 7 +- pages/poultry/allRecording.vue | 118 +++++----- pages/poultry/feedDetail.vue | 11 +- pages/records/index.vue | 43 ++-- utils/syhttp.js | 1 + 28 files changed, 616 insertions(+), 682 deletions(-) create mode 100644 pages/aquatic/allRecordTable.vue diff --git a/App.vue b/App.vue index 7ebbbf4..8b029a8 100644 --- a/App.vue +++ b/App.vue @@ -9,12 +9,12 @@ onLaunch: function() { const userInfo = userInfoStore() userInfoAPI({ - user_id: 307 + user_id: 307, + user_type: 3 }).then(res => { userInfo.saveUserInfo(res.data) }) uni.setStorageSync("SY_TOKEN", "dfdf4564557445df4df") - }, onShow: function() { console.log('App Show') @@ -23,6 +23,7 @@ console.log('App Hide') } } + // ngrok http 5173 \ No newline at end of file diff --git a/pages/aquatic/detail.vue b/pages/aquatic/detail.vue index e199905..f56b049 100644 --- a/pages/aquatic/detail.vue +++ b/pages/aquatic/detail.vue @@ -1,5 +1,6 @@ diff --git a/pages/detail/plant.vue b/pages/detail/plant.vue index d9c333e..47bdbc1 100644 --- a/pages/detail/plant.vue +++ b/pages/detail/plant.vue @@ -17,20 +17,6 @@ - - - - + :route='`/pages/records/index?land_id=${landDeatil.land_id}&crop_id=${crop_id}&index=${index}`'> @@ -97,7 +84,7 @@ 标记为成熟 - + 标记为全部收获 @@ -244,7 +231,9 @@ // crop_id: landDeatil.crop_id // }) let res2 = await actionsAPI({ - type: 1 + type: 1, + crop_id: landDeatil.crop_id + }) objFn(res2.data, tableDate) let res3 = await landEnvDataCurrAPI({ @@ -296,15 +285,13 @@ const img = (w, h, m) => { return `width:${w}rpx;height:${h};margin:0 ${m}rpx ` } - const navto = () => { - uni.navigateTo({ - url: '/pages/index2/index' - }) - } + const markFn = () => { setLandCropRipeAPI({ crop_id: landDeatil.crop_id, crop_yield: Number(crop_yield.value) + }).then(res => { + showPop.value = false }) } @@ -314,6 +301,14 @@ } } + const allripeFn = () => { + + + return + uni.navigateTo({ + url: '/pages/index/index' + }) + } // actionsAPI({ // type: 1 // }).then(res => { diff --git a/pages/feedIng/allRecordTable.vue b/pages/feedIng/allRecordTable.vue index ca157d5..a07ae98 100644 --- a/pages/feedIng/allRecordTable.vue +++ b/pages/feedIng/allRecordTable.vue @@ -1,17 +1,11 @@ @@ -27,14 +21,20 @@ actionsAPI } from "@/api/animal.js" - const actionList = reactive({}) - actionsAPI({ - type: 3 - }).then(res => { - for (let key in res.data) { - actionList[key] = (res.data)[key] - } + import { + onLoad + } from "@dcloudio/uni-app" + const dataList = reactive({}) + onLoad((option) => { + actionsAPI({ + type: 3 + }).then(res => { + for (let key in res.data[option.index].action_record) { + dataList[key] = res.data[option.index].action_record[key] + } + }) }) + const navgo = (url) => { uni.navigateTo({ url diff --git a/pages/feedIng/feedDetail.vue b/pages/feedIng/feedDetail.vue index 4877b1d..e145737 100644 --- a/pages/feedIng/feedDetail.vue +++ b/pages/feedIng/feedDetail.vue @@ -58,10 +58,17 @@ - - 养殖类型: {{baseData.animal_kind}} + 养殖品种: {{baseData.animal_kind}} + + + 具体种类: {{baseData.animal_breed}} + + + + + 养殖类型: {{baseData.animal_gender==1?'公':"母"}} 体重: --> - + + - + {{index}} @@ -104,7 +105,7 @@ - + 完成今日操作 @@ -214,7 +215,7 @@ + @cancel="showPicker=false"> @@ -226,7 +227,7 @@ ref, reactive } from "vue" - import landInfo from "@/components/plant/landInfo.vue" + import farmersCard from "@/components/poultry/farmersCard.vue" import { actionsListAPI, actionsDetailAPI, @@ -256,17 +257,19 @@ showPicker.value = false formData.select.value = e.value[0] } - const land_id = ref(0) - const pond_id = ref(0) - const crop_id = ref(0) + // const land_id = ref(0) + // const pond_id = ref(0) + // const crop_id = ref(0) const type = ref(0) + const title = ref("") const actionData = reactive({}) const delIndex = ref(0) onLoad((options) => { type.value = options.type - land_id.value = options.land_id - pond_id.value = options.pond_id - crop_id.value = options.crop_id + title.value = options.title + // land_id.value = options.land_id + // pond_id.value = options.pond_id + // crop_id.value = options.crop_id getAcyionListFn(options.type) }) @@ -367,7 +370,7 @@ }) } const editFn = (item) => { - console.log(item) + delIndex.value = item.id showPopFn(item.action_id) formData = deepCopy(item.action_content) @@ -491,6 +494,11 @@ serchList.splice(e, 1); formData.serch.list.splice(e, 1) } + const finshFn = () => { + uni.navigateTo({ + url: "/pages/index/index?index=3" + }) + } \ No newline at end of file diff --git a/pages/poultry/feedDetail.vue b/pages/poultry/feedDetail.vue index 735a356..f117ce1 100644 --- a/pages/poultry/feedDetail.vue +++ b/pages/poultry/feedDetail.vue @@ -59,10 +59,17 @@ - - 养殖类型: {{baseData.kind}} + 养殖品种: {{baseData.kind}} + + + 具体种类: {{baseData.breed}} + + + + + 养殖类型: {{baseData.animal_gender==1?'公':"母"}} 体重: - + 记录今日操作 @@ -60,13 +60,17 @@ import { actionsListAPI, actionsDetailAPI, - landCropRecordListAPI + 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 @@ -77,23 +81,38 @@ // console.log(res) // }) const land_id = ref(0) + const crop_id = ref(0) const dataList = reactive({}) onLoad((option) => { land_id.value = option.land_id - landCropRecordListAPI({ - crop_id: option.crop_id + crop_id.value = option.crop_id + actionsAPI({ + type: 1, + crop_id: crop_id.value }).then(res => { - for (let key in res.data) { - dataList[key] = res.data[key] + // 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] } - console.log(dataList) }) + // 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) - }) + // actionsDetailAPI({ + // action_id: 2 + // }).then(res => { + // // console.log(res) + // }) const navgo = (url) => { uni.navigateTo({ url diff --git a/utils/syhttp.js b/utils/syhttp.js index ede6ae0..4b61a80 100644 --- a/utils/syhttp.js +++ b/utils/syhttp.js @@ -64,6 +64,7 @@ function baseRequest(url, method, data, { } }, fail: (message) => { + console.log(message, '错误') // uni.hideLoading() uni.showToast({ title: '网络错误',