完善页面

This commit is contained in:
zmj 2023-10-27 19:26:03 +08:00
parent 999a85f35b
commit b0825d0862
9 changed files with 1638 additions and 1602 deletions

View File

@ -2,10 +2,17 @@
import {
userInfoStore
} from '@/store/userInfo'
import {
userInfoAPI
} from "@/api/plant.js"
export default {
onLaunch: function() {
const userInfo = userInfoStore()
userInfo.saveUserInfo(307)
userInfoAPI({
user_id: 307
}).then(res => {
userInfo.saveUserInfo(res.data)
})
uni.setStorageSync("SY_TOKEN", "dfdf4564557445df4df")
},

View File

@ -44,21 +44,25 @@
reactive,
watch
} from "vue";
// import {
// userInfoAPI
// } from "@/api/plant.js"
import {
userInfoAPI
} from "@/api/plant.js"
userInfoStore
} from '@/store/userInfo'
const userInfoStores = userInfoStore()
const userInfo = reactive({})
const objFn = (res, data) => {
for (let key in res) {
data[key] = res[key]
}
}
userInfoAPI({
user_id: 307
}).then(res => {
objFn(res.data, userInfo)
})
// userInfoAPI({
// user_id: 307
// }).then(res => {
// objFn(res.data, userInfo)
// })
objFn(userInfoStores.userInfo, userInfo)
</script>
<style lang="scss" scoped>

View File

@ -19,16 +19,21 @@
reactive
} from 'vue'
import uplodeFn from "@/utils/uplodeImg.js"
// import {
// userInfoAPI
// } from "@/api/plant.js"
import {
userInfoAPI
} from "@/api/plant.js"
userInfoStore
} from '@/store/userInfo'
const userInfoStores = userInfoStore()
const address = ref("")
userInfoAPI({
user_id: 307
}).then(res => {
let userInfo = res.data
// userInfoAPI({
// user_id: 307
// }).then(res => {
// })
let userInfo = userInfoStores.userInfo
address.value = userInfo.area_name + userInfo.street_name + userInfo.village_name + userInfo.brigade_name
})
const props = defineProps({
imgUrl: String,
text: String

View File

@ -45,21 +45,25 @@
reactive,
watch
} from "vue";
// import {
// userInfoAPI
// } from "@/api/plant.js"
import {
userInfoAPI
} from "@/api/plant.js"
userInfoStore
} from '@/store/userInfo'
const userInfoStores = userInfoStore()
const userInfo = reactive({})
const objFn = (res, data) => {
for (let key in res) {
data[key] = res[key]
}
}
userInfoAPI({
user_id: 307
}).then(res => {
objFn(res.data, userInfo)
})
// userInfoAPI({
// user_id: 307
// }).then(res => {
// objFn(res.data, userInfo)
// })
objFn(userInfoStores.userInfo, userInfo)
</script>
<style lang="scss" scoped>

View File

@ -1,8 +1,6 @@
<template>
<view class="content">
<imgCard :imgUrl='landDeatil.pic' text='地址'></imgCard>
<view class="bad-info">
<view class="" style="display: flex;align-items: center;">
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
@ -22,7 +20,7 @@
<landInfo :land_id='landDeatil.land_id'></landInfo>
<!-- 生长记录 -->
<view class="grow-record-tit">
<!-- <view class="grow-record-tit">
<view class="">
生长记录操作
</view>
@ -31,20 +29,25 @@
</view>
</view>
<myTable tit='查看历史记录' :dataList="tableDate" :route='`/pages/records/index?land_id=${landDeatil.land_id}`'>
</myTable>
<!-- <view class="circumstance" v-for="(item,index) in tableDate" :key="index">
</myTable> -->
<!-- dsfdsf
{{tableDate}} -->
<view class="circumstance" v-for="(item,index) in tableDate" :key="index">
<!-- {{index}} -->
<!-- {{tableDate}}
dsfdsf -->
<view class="card-tit">
<view class="">
{{index}}
</view>
<view class="updata-btn" @click="navgo('/pages/growRecord/index')">
<view class="updata-btn" @click="navgo('/pages/growRecord/index?type=1')">
更新{{index.slice(0,-2)}}
</view>
</view>
<myTable :tit='`查看${index.slice(0,-2)}`' :dataList="item.action_record" route='/pages/feedIng/allRecording'>
<myTable :tit='`查看${index.slice(0,-2)}`' :dataList="item.action_record"
:route='`/pages/records/index?land_id=${landDeatil.land_id}`'>
</myTable>
</view> -->
</view>
<view class="data">
<view class="tit">
@ -182,7 +185,7 @@
} from "@dcloudio/uni-app"
const crop_yield = ref("")
const showPop = ref(false)
const tableDate = reactive([])
const tableDate = reactive({})
const landDeatil = reactive({})
const data = reactive([{
tit: "土壤温度",
@ -223,8 +226,11 @@
land_id: options.land_id
})
objFn(res.data, landDeatil)
let res2 = await landCropRecordListAPI({
crop_id: landDeatil.crop_id
// let res2 = await landCropRecordListAPI({
// crop_id: landDeatil.crop_id
// })
let res2 = await actionsAPI({
type: 1
})
objFn(res2.data, tableDate)
let res3 = await landEnvDataCurrAPI({

View File

@ -28,7 +28,6 @@
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
疫苗条形码

View File

@ -40,6 +40,7 @@
import {
userInfoAPI
} from "@/api/plant.js"
import {
reactive,
ref
@ -53,21 +54,19 @@
import planting from "@/components/index/planting.vue"
import fishing from "@/components/index/fishing.vue"
import chick from "@/components/index/chick.vue"
import {
userInfoStore
} from '@/store/userInfo'
const userInfoStores = userInfoStore()
const flag = ref(1)
const scollChangeFn = (index) => {
flag.value = index
}
const list = reactive([])
const userInfo = reactive({
})
const userInfo = reactive({})
const initUserinfoFn = () => {
userInfoAPI({
user_id: 307
}).then(res => {
for (const key in res.data) {
userInfo[key] = (res.data)[key]
for (const key in userInfoStores.userInfo) {
userInfo[key] = (userInfoStores.userInfo)[key]
if (key == 'land_detail') {
list.push({
tit: "土地种植管理",
@ -94,7 +93,11 @@
list.sort(function(a, b) {
return a.id - b.id;
})
})
// userInfoAPI({
// user_id: 307
// }).then(res => {
// })
}
initUserinfoFn()

View File

@ -4,12 +4,12 @@ import {
export const userInfoStore = defineStore('counter', {
state: () => ({
user_id: ""
userInfo: {}
}),
getters: {},
actions: {
saveUserInfo(userInfo) {
this.user_id = userInfo
this.userInfo = userInfo
}
}
})

File diff suppressed because it is too large Load Diff