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> <script>
export default { export default {
onLaunch: function() { onLaunch: function() {
uni.hideTabBar()
}, },
onShow: function() { onShow: function() {
@ -17,6 +17,9 @@
<style lang="scss"> <style lang="scss">
@import "uview-plus/index.scss"; @import "uview-plus/index.scss";
page{
background-color: $theme-bg-color;
}
.card { .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,12 +18,6 @@
"navigationBarBackgroundColor": "#feb048", "navigationBarBackgroundColor": "#feb048",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, {
"path": "pages/index/index",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
}, },
// live harvest // live harvest
{ {

View File

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

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="content"> <view class="content">
<view class="card-d"> <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-title">驱虫信息</view>
<view class="c-box"> <view class="c-box">
<u-form-item label="驱虫药名称" borderBottom> <u-form-item label="驱虫药名称" borderBottom>

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="content"> <view class="content">
<view class="card-d"> <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-title">喂食信息</view>
<view class="c-box"> <view class="c-box">
<u-form-item label="饲料种类" borderBottom> <u-form-item label="饲料种类" borderBottom>

View File

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

View File

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

View File

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

View File

@ -234,7 +234,7 @@
</view> </view>
<u-picker keyName="name" :show="showPicker1" @cancel="showPicker1=false" @confirm="confirm1" <u-picker keyName="name" :show="showPicker1" @cancel="showPicker1=false" @confirm="confirm1"
:columns="columns2"></u-picker> :columns="columns2"></u-picker>
<MyTabbar></MyTabbar>
</view> </view>
</template> </template>
@ -244,6 +244,7 @@
ref, ref,
computed computed
} from 'vue'; } from 'vue';
import MyTabbar from "@/components/customTabbar/tabbar.vue"
import { import {
onLoad, onLoad,
onShow onShow
@ -279,6 +280,7 @@
const userInfo = ref({}); const userInfo = ref({});
onLoad(() => { onLoad(() => {
uni.hideTabBar()
// console.log(store.state.userInfo) // console.log(store.state.userInfo)
if (!store.state.userInfo) { if (!store.state.userInfo) {
uni.redirectTo({ 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 { .area-check {
display: flex; display: flex;

View File

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

View File

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

View File

@ -12,7 +12,7 @@
</view> </view>
</view> </view>
<view class="video" @click="navTo('/pages/live/live')"> <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> height="300rpx"></u--image>
</view> </view>
@ -171,8 +171,8 @@
id: typeID.value, id: typeID.value,
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
res.data.pic = JSON.parse(res.data.pic||'[]');
Object.assign(dataobj, res.data); Object.assign(dataobj, res.data);
console.log(dataobj);
} }
}); });
}; };

View File

@ -12,7 +12,7 @@
</view> </view>
</view> </view>
<view class="video" @click="navTo('/pages/live/live')"> <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> height="300rpx"></u--image>
</view> </view>
@ -36,7 +36,7 @@
<view class="thing-card" v-for="(item,index) in dataList" :key="index"> <view class="thing-card" v-for="(item,index) in dataList" :key="index">
<view class="card_body"> <view class="card_body">
<view class="left"> <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> 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> <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> </view>
@ -223,6 +223,7 @@
id: typeID.value, id: typeID.value,
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
res.data.pic = JSON.parse(res.data.pic||'[]')
Object.assign(dataobj, res.data); Object.assign(dataobj, res.data);
} }
}); });
@ -236,10 +237,12 @@
page_size: 3 page_size: 3
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
dataList.splice(0, dataList.length, ...res.data.lists); res.data.lists = res.data.lists.map(item => {
dataList.forEach(item => { item.showCode = false;
item.showCode = false item.pic = JSON.parse(item.pic||'[]');
return item
}) })
dataList.splice(0, dataList.length, ...res.data.lists);
// console.log(dataList) // console.log(dataList)
} }
}); });

View File

@ -6,7 +6,7 @@
<view class="thing-card" v-for="(item,index) in dataList" :key="index"> <view class="thing-card" v-for="(item,index) in dataList" :key="index">
<view class="card_body"> <view class="card_body">
<view class="left"> <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> 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> <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> </view>
@ -118,10 +118,12 @@
page_size: where.value.page_size page_size: where.value.page_size
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
dataList.splice(0, dataList.length, ...res.data.lists); res.data.lists = res.data.lists.map(item => {
dataList.forEach(item => { item.showCode = false;
item.showCode = false item.pic = JSON.parse(item.pic||'[]');
return item
}) })
dataList.splice(0, dataList.length, ...res.data.lists);
// console.log(dataList) // 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" <u--image v-if="item.pic" @click="perviewFn(item.pic[0])" radius='10' :src="item.pic[0]" width="200rpx"
height="200rpx"></u--image> height="200rpx"></u--image>
</view> </view>
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navFeed(item, index)"></u--image> <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, index)"> <view class="right" style="color: #7B7B7B;" @click="navFeed(item, current)">
<view class="r-item"> <view class="r-item">
<view class="item-title">操作类型:</view> <view class="item-title">操作类型:</view>
<view v-if="current==0">{{'喂食'}}</view> <view v-if="current==0">{{'喂食'}}</view>
@ -93,12 +93,37 @@
url url
}) })
} }
const navFeed = (e) => { const navFeed = (item, index) => {
if (e.type_name == '喂食') navTo(`/pages/feedDetail/feedDetail?id=1`) if(index==0) uni.navigateTo({
if (e.type_name == '喂水') navTo(`/pages/feedDetail/waterDetail?id=1`) url: `/pages/feedDetail/feedDetail`,
if (e.type_name == '消毒') navTo(`/pages/feedDetail/sterilizeDetail?id=1`) success: (res) => {
if (e.type_name == '疫苗') navTo(`/pages/feedDetail/vaccineDetail?id=1`) res.eventChannel.emit('setDatasItem', item);
if (e.type_name == '驱虫') navTo(`/pages/feedDetail/expellingDetail?id=1`) }
})
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 { import {
createStore createStore
} from 'vuex' } from 'vuex'
const store = createStore({ const store = createStore({
state: { state: {
userInfo:uni.getStorageSync("SY_USER")||null, userInfo: uni.getStorageSync("SY_USER") || null,
farm: JSON.parse(uni.getStorageSync("farm")||"{}"), farm: JSON.parse(uni.getStorageSync("farm") || "{}"),
house: JSON.parse(uni.getStorageSync("house")||"{}"), house: JSON.parse(uni.getStorageSync("house") || "{}"),
}, tabbrIndex: 0,
},
mutations: { mutations: {
saveUserInfo(state, info) { saveUserInfo(state, info) {
state.userInfo = info state.userInfo = info
uni.setStorageSync("SY_USER", info) uni.setStorageSync("SY_USER", info)
}, },
setFarm(state, data){ setFarm(state, data) {
state.farm = data; state.farm = data;
uni.setStorageSync('farm', JSON.stringify(data)); uni.setStorageSync('farm', JSON.stringify(data));
}, },
setHouse(state, data){ setHouse(state, data) {
state.house = data; state.house = data;
uni.setStorageSync('house', JSON.stringify(data)); uni.setStorageSync('house', JSON.stringify(data));
} },
}, changeTabbar(state, index) {
actions: { state.tabbrIndex = +index
saveUserInfo({commit}, info) { },
commit('saveUserInfo', info); },
}, actions: {
setFarm({commit}, info){ saveUserInfo({ commit }, info) {
commit('saveUserInfo', info);
},
setFarm({ commit }, info) {
commit('setFarm', info) commit('setFarm', info)
}, },
setHouse({commit}, info){ setHouse({ commit }, info) {
commit('setHouse', info) commit('setHouse', info)
} },
} changeTabbar({ commit }, info) {
commit('changeTabbar', info)
},
}
}) })
export default store export default store