This commit is contained in:
weipengfei 2024-01-31 11:16:49 +08:00
parent 1e157c58bc
commit 3568e261d9
41 changed files with 332 additions and 617 deletions

View File

@ -1,7 +1,7 @@
<script>
export default {
onLaunch: function() {
uni.hideTabBar()
},
onShow: function() {
@ -17,6 +17,9 @@
<style lang="scss">
@import "uview-plus/index.scss";
page{
background-color: $theme-bg-color;
}
.card {

View File

@ -0,0 +1,71 @@
<template>
<u-tabbar :value="value1" :fixed="true" :placeholder="false" :safeAreaInsetBottom="true">
<u-tabbar-item @click="click1">
<template #active-icon>
<image class="u-page__item__slot-icon" src="/static/main/index/sydj.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
<template #inactive-icon>
<image class="u-page__item__slot-icon" src="/static/main/index/sy.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
</u-tabbar-item>
<u-tabbar-item @click="click1">
<template #active-icon>
<image class="u-page__item__slot-icon" src="/static/main/index/dkdj.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
<template #inactive-icon>
<image class="u-page__item__slot-icon" src="/static/main/index/dk.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
</u-tabbar-item>
<u-tabbar-item @click="click1">
<template #active-icon>
<image class="u-page__item__slot-icon" src="/static/main/index/wddj.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
<template #inactive-icon>
<image class="u-page__item__slot-icon" src="/static/main/index/wd.png"
style="width: 60rpx;height: 60rpx;"></image>
</template>
</u-tabbar-item>
</u-tabbar>
</template>
<script setup>
import store from "@/store/index.js"
import {
ref
} from "vue"
const value1 = ref(store.state.tabbrIndex)
const click1 = (e) => {
store.dispatch('changeTabbar', e)
if (e == 0) {
uni.switchTab({
url: '/pages/index/massif'
})
}
if (e == 1) {
uni.switchTab({
url: '/pages/index/manager'
})
}
if (e == 2) {
uni.switchTab({
url: '/pages/index/personal'
})
}
}
</script>
<style>
</style>

View File

@ -18,13 +18,7 @@
"navigationBarBackgroundColor": "#feb048",
"navigationBarTextStyle": "white"
}
}, {
"path": "pages/index/index",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
},
// live harvest
{
"path": "pages/landDetail/index",

View File

@ -155,14 +155,14 @@
}
</script>
<style>
<style lang="scss">
/* page {
background-color: #fff;
} */
.text {
font-size: 28rpx;
white-space: normal;
// white-space: normal;
}
.head_top {

View File

@ -1,7 +1,7 @@
<template>
<view class="content">
<view class="card-d">
<u--form labelWidth='130' :model="formData" :rules="rules" ref="form">
<u--form labelWidth='130' :model="formData" ref="form">
<view class="c-title">驱虫信息</view>
<view class="c-box">
<u-form-item label="驱虫药名称" borderBottom>

View File

@ -1,7 +1,7 @@
<template>
<view class="content">
<view class="card-d">
<u--form labelWidth='130' :model="formData" :rules="rules" ref="form">
<u--form labelWidth='130' :model="formData" ref="form">
<view class="c-title">喂食信息</view>
<view class="c-box">
<u-form-item label="饲料种类" borderBottom>

View File

@ -1,41 +1,41 @@
<template>
<view class="content">
<view class="card-d">
<u--form labelWidth='130' :model="formData" :rules="rules" ref="form">
<u--form labelWidth='130' :model="formData" ref="form">
<view class="c-title">消毒信息</view>
<view class="c-box">
<u-form-item label="消毒剂名称" borderBottom>
<up-input readonly type="txt"
border="none" v-model="formData.user"></up-input>
<up-input readonly
border="none" v-model="formData.disinfectant_name"></up-input>
</u-form-item>
<u-form-item label="消毒剂浓度" borderBottom>
<up-input readonly type="number"
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.concentration"></up-input>
</u-form-item>
<u-form-item label="消毒方法" borderBottom>
<up-input readonly type="number"
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.disinfectant_method"></up-input>
</u-form-item>
<u-form-item label="消毒区域" borderBottom>
<up-input readonly type="number"
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.disinfectant_area"></up-input>
</u-form-item>
<u-form-item label="消毒人员" borderBottom >
<up-input readonly type="number"
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.operator"></up-input>
</u-form-item>
<u-form-item label="消毒时间" borderBottom >
<up-input type="number" readonly
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.create_time"></up-input>
</u-form-item>
<swiper class="swiper" autoplay indicator-dots indicator-active-color="#ffb049" indicator-color="rgba(255,255,255,0.4)">
<swiper-item class="swiper-item" v-for="(item, index) in 2" :key="index">
<image class="img" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg"></image>
<swiper-item class="swiper-item" v-for="(item, index) in formData.pic" :key="index">
<image class="img" :src="item"></image>
</swiper-item>
</swiper>
<u-form-item label="备注" borderBottom >
<view class="">
{{formData.remark}}
</view>
</u-form-item>
</view>
@ -48,19 +48,22 @@
<script setup>
import {
reactive,
ref
ref,
getCurrentInstance
} from "vue";
import {
onLoad,
onReady
} from "@dcloudio/uni-app"
const formData = reactive({
user: "",
remark: "",
pic: [],
start_date: '',
notes: ''
const formData = reactive({})
onLoad(function(options){
const eventChannel = getCurrentInstance().proxy.getOpenerEventChannel();
eventChannel.on('setDatasItem', function(data) {
console.log(data);
Object.assign(formData, data)
})
})
</script>

View File

@ -1,49 +1,49 @@
<template>
<view class="content">
<view class="card-d">
<u--form labelWidth='130' :model="formData" :rules="rules" ref="form">
<u--form labelWidth='130' :model="formData" ref="form">
<view class="c-title">疫苗信息</view>
<view class="c-box">
<u-form-item label="疫苗名称" borderBottom>
<up-input readonly type="txt"
border="none" v-model="formData.user"></up-input>
<up-input readonly
border="none" v-model="formData.vaccine_name"></up-input>
</u-form-item>
<u-form-item label="疫苗厂家" borderBottom>
<up-input readonly type="number"
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.vaccine_manufacturers"></up-input>
</u-form-item>
<u-form-item label="疫苗批次号" borderBottom>
<up-input readonly type="number"
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.vaccine_batch"></up-input>
</u-form-item>
<u-form-item label="接种方式" borderBottom >
<up-input readonly type="number"
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.vaccination_method"></up-input>
</u-form-item>
<u-form-item label="接种部位" borderBottom>
<up-input readonly type="number"
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.vaccination_site"></up-input>
</u-form-item>
<u-form-item label="免疫有限期" borderBottom >
<up-input type="number" readonly
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.immune_validity_period"></up-input>
</u-form-item>
<u-form-item label="注射人员" borderBottom >
<up-input type="number" readonly
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.operator"></up-input>
</u-form-item>
<u-form-item label="接种时间" borderBottom >
<up-input type="number" readonly
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.create_time"></up-input>
</u-form-item>
<swiper class="swiper" autoplay indicator-dots indicator-active-color="#ffb049" indicator-color="rgba(255,255,255,0.4)">
<swiper-item class="swiper-item" v-for="(item, index) in 2" :key="index">
<image class="img" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg"></image>
<swiper-item class="swiper-item" v-for="(item, index) in formData.pic" :key="index">
<image class="img" :src="item"></image>
</swiper-item>
</swiper>
<u-form-item label="备注" borderBottom >
<view class="">
{{formData.remark}}
</view>
</u-form-item>
</view>
@ -56,19 +56,26 @@
<script setup>
import {
reactive,
ref
ref,
getCurrentInstance
} from "vue";
import {
onLoad,
onReady
} from "@dcloudio/uni-app"
const formData = reactive({
user: "",
remark: "",
pic: [],
start_date: '',
notes: ''
const formData = reactive({})
onLoad(function(options){
const eventChannel = getCurrentInstance().proxy.getOpenerEventChannel();
eventChannel.on('setDatasItem', function(data) {
console.log(data);
Object.assign(formData, data);
if(formData.vaccination_method=='1') formData.vaccination_method = '肌肉注射';
if(formData.vaccination_method=='2') formData.vaccination_method = '皮下注射';
if(formData.vaccination_site=='1') formData.vaccination_site = '颈部';
if(formData.vaccination_site=='2') formData.vaccination_site = '大腿';
})
})
</script>

View File

@ -1,29 +1,29 @@
<template>
<view class="content">
<view class="card-d">
<u--form labelWidth='130' :model="formData" :rules="rules" ref="form">
<u--form labelWidth='130' :model="formData" ref="form">
<view class="c-title">喂水信息</view>
<view class="c-box">
<u-form-item label="喂水量(L)" borderBottom>
<up-input readonly type="number"
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.water_consumption"></up-input>
</u-form-item>
<u-form-item label="喂水人员" borderBottom >
<up-input readonly type="number"
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.operator"></up-input>
</u-form-item>
<u-form-item label="喂水时间" borderBottom >
<up-input type="number" readonly
border="none" v-model="formData.breed"></up-input>
<up-input readonly
border="none" v-model="formData.create_time"></up-input>
</u-form-item>
<swiper class="swiper" autoplay indicator-dots indicator-active-color="#ffb049" indicator-color="rgba(255,255,255,0.4)">
<swiper-item class="swiper-item" v-for="(item, index) in 2" :key="index">
<image class="img" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg"></image>
<swiper-item class="swiper-item" v-for="(item, index) in formData.pic" :key="index">
<image class="img" :src="item"></image>
</swiper-item>
</swiper>
<u-form-item label="备注" borderBottom >
<view class="">
{{formData.remark}}
</view>
</u-form-item>
</view>
@ -36,19 +36,22 @@
<script setup>
import {
reactive,
ref
ref,
getCurrentInstance
} from "vue";
import {
onLoad,
onReady
} from "@dcloudio/uni-app"
const formData = reactive({
user: "",
remark: "",
pic: [],
start_date: '',
notes: ''
const formData = reactive({})
onLoad(function(options){
const eventChannel = getCurrentInstance().proxy.getOpenerEventChannel();
eventChannel.on('setDatasItem', function(data) {
console.log(data);
Object.assign(formData, data);
})
})
</script>

View File

@ -1,441 +0,0 @@
<template>
<view class="">
<view class="" style="height: var(--status-bar-height);background-color: #feb048;">
</view>
<view class="header">
<u-icon name="plus-circle" color="white" @click="navto('/pages/addLand/addLand')" :size="28"></u-icon>
<Myindex url='/pages/index/index' />
</view>
<view class="content">
<view class="serch">
<u-search bgColor="white" :show-action="false" placeholder="搜索你的土地信息" v-model="fomData.keyword"
shape="round" :clearabled='false' @change="inputval"></u-search>
<view class="ser-text" @click="search">
搜索
</view>
</view>
<view class="tits">
土地信息
</view>
<view class="card" v-for="(item,index) in datalist" :key="index" @click="navgo(item)">
<view class="plant-status" v-if="item.residual_area!=item.total_area"
:style="{backgroundImage:`url(${bgc('yzz')})`}">
已种植
</view>
<view class="plant-status" v-if="item.residual_area==item.total_area"
:style="{backgroundImage:`url(${bgc('wzz')})`}">
未种植
</view>
<view class="card-content">
<u--image v-if="item.pic" :src="item.pic[0]||''" height="150rpx" width="150rpx"
style="margin-right: 20rpx;border-radius: 10rpx;overflow: hidden;"></u--image>
<view style="color:#7B7B7B ;">
<view class="card-tit">
{{item.title}}
</view>
<view class="">
<text style="color: black;">种植面积</text> : {{item.total_area-item.residual_area}}
</view>
<view class="">
<text style="color: black;">土地面积</text>: {{item.total_area}}
</view>
<view class="card-address">
<text style="color: black;white-space: nowrap;">地址</text>: {{item.address}}
</view>
</view>
</view>
<!-- old -->
<!-- <view class="tit card-li" style="margin-top: 50rpx;">
<view class="">
{{item.title}}
</view>
<view class="" style="color: #00A15E;" v-if="item.residual_area!=item.total_area">
已种植
</view>
<view class="" style="color: #00A15E;" v-if="item.residual_area==item.total_area">
未种植
</view>
</view>
<view class="card-li" v-if="item.residual_area!=item.total_area">
<view class="">
种植面积:{{item.total_area-item.residual_area}}
</view>
<view class="">
土地面积:{{item.total_area}}
</view>
</view>
<view class="card-li" v-if="item.residual_area==item.total_area">
<view class="">
未种植面积:{{item.total_area}}
</view>
</view>
<view class="card-li tit">
<view class="" style="font-weight: normal;">
地址: {{item.address}}
</view>
</view>
-->
</view>
<!-- <view class="land" @click="navgo('/pages/addLand/addLand')">
土地
</view> -->
<view class="coneng-detail" v-if="datalist.length==0">
<view class="">
<image src="@/static/img/zw.png" mode="aspectFit"></image>
<view class="">
暂无数据
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
onLoad,
onShow,
onReachBottom,
onPullDownRefresh
} from "@dcloudio/uni-app"
import {
ref,
reactive,
onMounted
} from "vue"
import Myindex from '@/components/return/index.vue';
import store from "@/store/index.js"
import {
landlist
} from '@/api/api.js'
onLoad(() => {
// console.log(store.state.userInfo)
if (!store.state.userInfo) {
uni.redirectTo({
url: '/pages/Login/login'
})
}
})
onShow(() => {
list()
})
onPullDownRefresh(() => {
list()
uni.stopPullDownRefresh()
})
onReachBottom(() => {
getlist()
})
const datalist = reactive([])
const fomData = reactive({
page_no: 1,
page_size: 15,
keyword: ''
})
//
const getPositionFn = () => {
uni.getLocation({
type: 'gcj02',
geocode: true,
isHighAccuracy: true,
success: function(res) {
uni.request({
url: `https://restapi.amap.com/v3/geocode/regeo?output=JSON&location=${res.longitude},${res.latitude}&key=b0c21bc6b220aa882bad8ffb6bce8829&radius=1000&extensions=all`,
success: (res) => {
console.log(res)
}
})
}
});
}
const list = () => {
datalist.splice(0)
fomData.page_no = 1
getlist()
}
const getlist = () => {
landlist(fomData).then((res) => {
if (res.code == 1) {
datalist.push(...res.data)
fomData.page_no = fomData.page_no + 1
}
})
}
//
const inputval = (e) => {
// console.log(e)
if (e.length == 0) {
list()
}
}
//
const search = () => {
list()
}
const navto = (url) => {
uni.navigateTo({
url
})
}
const navgo = (item) => {
uni.navigateTo({
url: '/pages/landDetail/index?id=' + item.id
})
}
onMounted(() => {
// console.log('22222222')
})
const u = (name) => {
return `/static/main/index/${name}.png`
}
const bgc = (icon) => {
return `/static/main/index/${icon}.png`
}
</script>
<style lang="scss">
page {
// background-color: $theme-bg-color;
background-color: #F5FDFA;
}
.header {
background-color: #feb048;
display: flex;
justify-content: space-between;
padding: 10rpx 0 10rpx 20rpx;
}
.tits {
position: relative;
padding-left: 20rpx;
font-weight: bold;
margin-bottom: 20rpx;
}
.tits::before {
content: "";
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
width: 3px;
/* 左边框的宽度 */
height: 30rpx;
background-color: #FFB049;
}
// old
.content {
position: relative;
padding: 0 20rpx;
// padding-top: 100rpx;
.head-img {
// position: absolute;
// display: flex;
// top: 0;
// right: 10rpx;
// margin-top: 20rpx;
}
.land {
width: 100rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
background-color: #fff;
border-radius: 50%;
position: absolute;
right: 60rpx;
bottom: 130rpx;
position: fixed;
}
.serch {
// padding-bottom: 20rpx;
box-shadow: 1rpx 1rpx 10rpx 1rpx rgba(0, 0, 0, 0.1);
border-radius: 200rpx;
position: relative;
color: #feb048;
font-size: 28rpx;
margin-top: 20rpx;
margin-bottom: 20rpx;
.ser-text {
position: absolute;
padding-left: 20rpx;
top: 50%;
transform: translateY(-50%);
right: 40rpx;
}
.ser-text::before {
content: "";
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
width: 2px;
/* 左边框的宽度 */
height: 20rpx;
background-color: #FFB049;
}
// width: 100%;
// height: 100rpx;
// background-color: #EAF2EF;
// position: absolute;
// position: fixed;
// display: flex;
// top: 0;
// // padding-top: calc(70rpx + var(--status-bar-height) + 20rpx);
// padding-right: 20rpx;
// .custom-style {
// color: #606266;
// width: 140rpx;
// border-radius: 30rpx;
// margin-top: 10rpx;
// margin-right: 20rpx;
// }
// z-index: 8888 !important;
}
.border-bgc {
height: 200rpx;
background-color: #feb048;
border-radius: 0 0 40rpx 40rpx;
position: absolute;
width: 750rpx;
}
.coneng-detail {
width: 478rpx;
height: 341rpx;
background: #FFFFFF;
border-radius: 6px 6px 6px 6px;
opacity: 1;
font-size: 25rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #737373;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin: 300rpx auto;
image {
width: 280rpx;
height: 142rpx;
margin-bottom: 20rpx;
}
}
.card {
position: relative;
margin: auto;
background-color: #FFFFFF;
box-sizing: border-box;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin-bottom: 40rpx;
.plant-status {
position: absolute;
width: 109rpx;
height: 99rpx;
background-image: url('/static/main/index/wzz.png');
background-size: 100% 100%;
top: -10rpx;
right: 50rpx;
color: white;
text-align: center;
padding-top: 20rpx;
font-size: 26rpx;
}
.card-content {
display: flex;
.card-tit {
font-weight: bold;
margin-bottom: 10rpx;
color: black;
}
.card-address {
// width: 60vw;
width: 500rpx;
white-space: nowrap;
/* 文字不换行 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
/* 超出部分显示省略号 */
}
.value {
/* 超出部分显示省略号 */
}
}
// .tit {
// display: flex;
// font-size: 33.29rpx;
// font-weight: bold;
// justify-content: space-between;
// }
}
}
</style>

View File

@ -31,12 +31,19 @@
</view>
</block>
</view>
<MyTabbar></MyTabbar>
</view>
</template>
<script setup lang="ts">
<script setup>
import Myindex from '@/components/return/index.vue';
import MyTabbar from "@/components/customTabbar/tabbar.vue"
import { reactive, ref } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
onLoad(()=>{
uni.hideTabBar()
})
const list = reactive([
{
@ -69,7 +76,7 @@
},
])
const navTo = (url: string)=>{
const navTo = (url)=>{
if(url) uni.navigateTo({
url: url
})

View File

@ -234,7 +234,7 @@
</view>
<u-picker keyName="name" :show="showPicker1" @cancel="showPicker1=false" @confirm="confirm1"
:columns="columns2"></u-picker>
<MyTabbar></MyTabbar>
</view>
</template>
@ -244,6 +244,7 @@
ref,
computed
} from 'vue';
import MyTabbar from "@/components/customTabbar/tabbar.vue"
import {
onLoad,
onShow
@ -279,6 +280,7 @@
const userInfo = ref({});
onLoad(() => {
uni.hideTabBar()
// console.log(store.state.userInfo)
if (!store.state.userInfo) {
uni.redirectTo({
@ -696,13 +698,6 @@
}
.note {
height: 168rpx;
background-image: url('/static/main/index/JNS.png');
background-size: 100% 100%;
margin-bottom: 20rpx;
position: relative;
}
.area-check {
display: flex;

View File

@ -49,24 +49,32 @@
</view>
<MyTabbar></MyTabbar>
</view>
</template>
<script setup lang="ts">
import Myindex from '@/components/return/index.vue';
import MyTabbar from "@/components/customTabbar/tabbar.vue"
import {
reactive,
ref
} from 'vue';
import { logout } from '@/api/api.js'
import { onLoad, onShow } from "@dcloudio/uni-app"
import store from "@/store/index.js"
onLoad(()=>{
uni.hideTabBar()
})
const userinfo = reactive({})
if (store.state.userInfo != null) {
Object.assign(userinfo, store.state.userInfo)
}
const userinfo = reactive({})
onShow(()=>{
if (store.state.userInfo != null) {
Object.assign(userinfo, store.state.userInfo)
}
})
const previewImageFn = () => {
uni.previewImage({
@ -187,7 +195,7 @@
position: absolute;
bottom: 100rpx;
bottom: 160rpx;
left: 50%;
transform: translateX(-50%);
// border-radius: 500rpx;

View File

@ -31,9 +31,9 @@
<up-form-item label="来源" borderBottom>
<up-input input-align="right" border="none" v-model="animal_source" readonly></up-input>
</up-form-item>
<up-form-item label="栏舍" prop="fence_house_name" borderBottom required>
<up-input input-align="right" placeholder="请输入栏舍" border="none"
v-model="data.formData.fence_house_name"></up-input>
<up-form-item label="栏舍" prop="fence_house_name" borderBottom required @click="isshow2">
<up-input input-align="right" placeholder="请选择栏舍" border="none" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" v-model="data.formData.fence_house_name" readonly></up-input>
</up-form-item>
<up-form-item label="现估重(kg)" prop="current_estimation" borderBottom required>
<up-input input-align="right" placeholder="请输入现估重" type="number" border="none"
@ -41,16 +41,16 @@
</up-form-item>
<up-form-item label="入场日期" prop="entry_date" borderBottom required @click="showDate=true">
<up-input input-align="right" placeholder="请选择入场日期" border="none" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" v-model="data.formData.entry_date"></up-input>
suffix-icon-style="color: #b6b6b6;" v-model="data.formData.entry_date"></up-input>
</up-form-item>
</block>
<block v-else>
<up-form-item label="来源" borderBottom>
<up-input input-align="right" border="none" v-model="animal_source" readonly></up-input>
</up-form-item>
<up-form-item label="栏舍" prop="fence_house_name" borderBottom required>
<up-input input-align="right" placeholder="请输入栏舍" border="none"
v-model="data.formData.fence_house_name"></up-input>
<up-form-item label="栏舍" prop="fence_house_name" borderBottom required @click="isshow2">
<up-input input-align="right" placeholder="请选择栏舍" border="none" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" v-model="data.formData.fence_house_name" readonly></up-input>
</up-form-item>
<up-form-item label="代数" prop="algebra" borderBottom required>
<up-input input-align="right" placeholder="请输入代数" type="number" border="none"
@ -64,9 +64,9 @@
<up-input input-align="right" placeholder="请输入出生体重" type="number" border="none"
v-model="data.formData.birth_estimation"></up-input>
</up-form-item>
<up-form-item label="出生日期" borderBottom required @click="showDate=true">
<up-form-item label="出生日期" borderBottom required @click="showDate=true">
<up-input input-align="right" placeholder="请选择出生日期" border="none" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" v-model="data.formData.brith_date"></up-input>
suffix-icon-style="color: #b6b6b6;" v-model="data.formData.brith_date"></up-input>
</up-form-item>
</block>
</view>
@ -104,11 +104,12 @@
</up-form>
<u-action-sheet :show="showSex" keyName="name" closeOnClickOverlay :actions="[{name:'公'}, {name:'母'}]" title="请选择"
@close="showSex = false" @select="selectSex"></u-action-sheet>
<u-datetime-picker :show="showDate" :max-date="Date.now()" mode="date" v-model="changeTime"
@confirm="selectDate" :formatter="formatter" @cancel="showDate=false"></u-datetime-picker>
<u-datetime-picker :show="showDate" :max-date="Date.now()" mode="date" v-model="changeTime" @confirm="selectDate"
:formatter="formatter" @cancel="showDate=false"></u-datetime-picker>
<u-action-sheet :show="show1" keyName="name" :actions="animal_type_lists" title="请选择" @close="show1 = false"
@select="leavaType1">
</u-action-sheet>
@select="leavaType1"> </u-action-sheet>
<u-action-sheet :show="show2" keyName="name" :actions="houses_lists" title="请选择栏舍" @close="show2 = false"
@select="leavaType2"> </u-action-sheet>
<u-button class="btn" @click="submit">提交</u-button>
</view>
</view>
@ -137,12 +138,15 @@
import {
animalInfoAdd
} from "@/api/manage.js"
import {
fenceHouseList
} from "@/api/manage.js"
const form1 = ref(null);
const data = reactive({
formData: {
fence_house_id: '', //id
sn: '',
sn: '',
animal_type: '',
brand: '',
physi_stage: '',
@ -187,14 +191,19 @@
const showSex = ref(false);
const showDate = ref(false);
const changeFlag = ref(false);
const show1 = ref(false)
const isshow1 = () => {
show1.value = true
}
const show2 = ref(false)
const isshow2 = () => {
show2.value = true
}
const animal_type_lists = ref([]);
const initAnimalTypeLists = ()=>{
animalTypeLists().then(res=>{
const initAnimalTypeLists = () => {
animalTypeLists().then(res => {
animal_type_lists.value = res.data;
})
}
@ -204,6 +213,22 @@
animal_type.value = e.name;
data.formData.animal_type = e.value;
}
const houses_lists = ref([]);
const initHousesLists = () => {
fenceHouseList().then(res => {
houses_lists.value = res.data.lists.map(item=>{
return {
value: item.id,
name: item.fence_house_name
}
});
})
}
initHousesLists();
const leavaType2 = (e) => {
data.formData.fence_house_name = e.name;
data.formData.fence_house_id = e.value;
}
//
const delimg = (i) => {
@ -240,37 +265,37 @@
// let res = await Uploads()
// data.formData.pic = res.data.image
}
const gender = ref('');
const selectSex = (e)=>{
if(e.name=='公') data.formData.gender = 1;
const selectSex = (e) => {
if (e.name == '公') data.formData.gender = 1;
else data.formData.gender = 0;
gender.value = e.name;
}
const changeTime = ref(Date.now())
const selectDate = (e)=>{
const selectDate = (e) => {
let date = new Date(e.value);
if(data.formData.type>1) data.formData.brith_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd');
if (data.formData.type > 1) data.formData.brith_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd');
else data.formData.entry_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd');
showDate.value = false;
}
onReady(() => {
form1.value.setRules(data.rules);
});
const formatter = (type, value) => {
if (type === 'year') {
return `${value}`;
}
if (type === 'month') {
return `${value}`;
}
if (type === 'day') {
return `${value}`;
}
return value;
if (type === 'year') {
return `${value}`;
}
if (type === 'month') {
return `${value}`;
}
if (type === 'day') {
return `${value}`;
}
return value;
};
const submit = async () => {
@ -307,8 +332,8 @@
}
}
const animal_source = ref('');//
const animal_source = ref(''); //
onLoad((options) => {
if (options.type > 1) {
data.formData.animal_source = +options.type;
@ -317,9 +342,12 @@
data.formData.animal_source = 1;
animal_source.value = '购买';
}
if(options.id) {
if (options.id) {
data.formData.fence_house_id = options.id;
data.formData.fence_house_name = options.fence_house_name;
changeFlag.value = false;
} else {
changeFlag.value = true;
}
})
</script>

View File

@ -12,7 +12,7 @@
</view>
</view>
<view class="video" @click="navTo('/pages/live/live')">
<u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg" width="100%"
<u--image v-if="dataobj&&dataobj.pic" :src="dataobj.pic[0]" width="100%"
height="300rpx"></u--image>
</view>
@ -171,8 +171,8 @@
id: typeID.value,
}).then((res) => {
if (res.code == 1) {
res.data.pic = JSON.parse(res.data.pic||'[]');
Object.assign(dataobj, res.data);
console.log(dataobj);
}
});
};

View File

@ -12,7 +12,7 @@
</view>
</view>
<view class="video" @click="navTo('/pages/live/live')">
<u--image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg" width="100%"
<u--image v-if="dataobj&&dataobj.pic" :src="dataobj.pic[0]" width="100%"
height="300rpx"></u--image>
</view>
@ -36,7 +36,7 @@
<view class="thing-card" v-for="(item,index) in dataList" :key="index">
<view class="card_body">
<view class="left">
<u--image @click="perviewFn(item.img)" radius='10' :src="item.img" width="250rpx"
<u--image @click="perviewFn(item.pic)" radius='10' :src="item.pic[0]" width="250rpx"
height="250rpx"></u--image>
<u---image class="qr-code" @click="perviewFn(item.qr_code)" src="/static/main/house/su_yuan_ma_btn.png" width="60rpx" height="60rpx"></u---image>
</view>
@ -223,6 +223,7 @@
id: typeID.value,
}).then((res) => {
if (res.code == 1) {
res.data.pic = JSON.parse(res.data.pic||'[]')
Object.assign(dataobj, res.data);
}
});
@ -236,10 +237,12 @@
page_size: 3
}).then((res) => {
if (res.code == 1) {
dataList.splice(0, dataList.length, ...res.data.lists);
dataList.forEach(item => {
item.showCode = false
res.data.lists = res.data.lists.map(item => {
item.showCode = false;
item.pic = JSON.parse(item.pic||'[]');
return item
})
dataList.splice(0, dataList.length, ...res.data.lists);
// console.log(dataList)
}
});

View File

@ -6,7 +6,7 @@
<view class="thing-card" v-for="(item,index) in dataList" :key="index">
<view class="card_body">
<view class="left">
<u--image @click="perviewFn(item.img)" radius='10' :src="item.img" width="250rpx"
<u--image @click="perviewFn(item.pic[0])" radius='10' :src="item.pic[0]" width="250rpx"
height="250rpx"></u--image>
<u---image class="qr-code" @click="perviewFn(item.qr_code)" src="/static/main/house/su_yuan_ma_btn.png" width="60rpx" height="60rpx"></u---image>
</view>
@ -118,10 +118,12 @@
page_size: where.value.page_size
}).then((res) => {
if (res.code == 1) {
dataList.splice(0, dataList.length, ...res.data.lists);
dataList.forEach(item => {
item.showCode = false
res.data.lists = res.data.lists.map(item => {
item.showCode = false;
item.pic = JSON.parse(item.pic||'[]');
return item
})
dataList.splice(0, dataList.length, ...res.data.lists);
// console.log(dataList)
}
});

View File

@ -10,8 +10,8 @@
<u--image v-if="item.pic" @click="perviewFn(item.pic[0])" radius='10' :src="item.pic[0]" width="200rpx"
height="200rpx"></u--image>
</view>
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navFeed(item, index)"></u--image>
<view class="right" style="color: #7B7B7B;" @click="navFeed(item, index)">
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navFeed(item, current)"></u--image>
<view class="right" style="color: #7B7B7B;" @click="navFeed(item, current)">
<view class="r-item">
<view class="item-title">操作类型:</view>
<view v-if="current==0">{{'喂食'}}</view>
@ -93,12 +93,37 @@
url
})
}
const navFeed = (e) => {
if (e.type_name == '喂食') navTo(`/pages/feedDetail/feedDetail?id=1`)
if (e.type_name == '喂水') navTo(`/pages/feedDetail/waterDetail?id=1`)
if (e.type_name == '消毒') navTo(`/pages/feedDetail/sterilizeDetail?id=1`)
if (e.type_name == '疫苗') navTo(`/pages/feedDetail/vaccineDetail?id=1`)
if (e.type_name == '驱虫') navTo(`/pages/feedDetail/expellingDetail?id=1`)
const navFeed = (item, index) => {
if(index==0) uni.navigateTo({
url: `/pages/feedDetail/feedDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==1) uni.navigateTo({
url: `/pages/feedDetail/waterDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==2) uni.navigateTo({
url: `/pages/feedDetail/sterilizeDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==3) uni.navigateTo({
url: `/pages/feedDetail/vaccineDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==4) uni.navigateTo({
url: `/pages/feedDetail/expellingDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 772 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,37 +1,44 @@
import {
createStore
createStore
} from 'vuex'
const store = createStore({
state: {
userInfo:uni.getStorageSync("SY_USER")||null,
farm: JSON.parse(uni.getStorageSync("farm")||"{}"),
house: JSON.parse(uni.getStorageSync("house")||"{}"),
},
state: {
userInfo: uni.getStorageSync("SY_USER") || null,
farm: JSON.parse(uni.getStorageSync("farm") || "{}"),
house: JSON.parse(uni.getStorageSync("house") || "{}"),
tabbrIndex: 0,
},
mutations: {
saveUserInfo(state, info) {
state.userInfo = info
uni.setStorageSync("SY_USER", info)
},
setFarm(state, data){
mutations: {
saveUserInfo(state, info) {
state.userInfo = info
uni.setStorageSync("SY_USER", info)
},
setFarm(state, data) {
state.farm = data;
uni.setStorageSync('farm', JSON.stringify(data));
},
setHouse(state, data){
setHouse(state, data) {
state.house = data;
uni.setStorageSync('house', JSON.stringify(data));
}
},
actions: {
saveUserInfo({commit}, info) {
commit('saveUserInfo', info);
},
setFarm({commit}, info){
},
changeTabbar(state, index) {
state.tabbrIndex = +index
},
},
actions: {
saveUserInfo({ commit }, info) {
commit('saveUserInfo', info);
},
setFarm({ commit }, info) {
commit('setFarm', info)
},
setHouse({commit}, info){
setHouse({ commit }, info) {
commit('setHouse', info)
}
}
},
changeTabbar({ commit }, info) {
commit('changeTabbar', info)
},
}
})
export default store