多张图片显示

This commit is contained in:
jia 2023-12-07 09:34:25 +08:00
parent c3ab1b77cd
commit 6a63cdf094
14 changed files with 335 additions and 172 deletions

View File

@ -5,6 +5,7 @@
{{info.title}}
号土地
</view>
<!-- <view class="" style="display:flex;">
<view class="" style="margin-right: 10rpx;">溯源码: </view>
@ -30,6 +31,14 @@
种植品种: {{info.kind}}
</view>
</view>
<view class="card-li" v-if="info.breed">
<view class="">
种植品牌: {{info.breed}}
</view>
<!-- <view class="">
种子品牌: {{}}
</view> -->
</view>
<view class="card-li">
<view class="">
土地面积: {{info.total_area}}

View File

@ -10,7 +10,7 @@ let HEADER
if (env == 'dev') {
BASE_URL = 'http://ceshi-suyuan.lihaink.cn/'
} else if (env = 'prod') {
BASE_URL = 'http://shi-suyuan.lihaink.cn/'
BASE_URL = 'http://ceshi-suyuan.lihaink.cn/'
}
let config = {
HTTP_REQUEST_URL: BASE_URL,

View File

@ -23,10 +23,9 @@
customStyle="background:#F5F5F5;height:80rpx;;padding-left:40rpx;border:none"
placeholder="请输入密码" border="surround" v-model="formData.password">
<template #suffix>
<u-icon :name="pwdShow?'eye-off':'eye-fill'" size="25"
@click="pwdShow=!pwdShow"></u-icon>
<u-icon :name="pwdShow?'eye-off':'eye-fill'" size="25" @click="pwdShow=!pwdShow"></u-icon>
</template>
</u-input>
</u-input>
</view>
<view class="">
<u-input :password="!pwdShow1" shape='circle'
@ -36,9 +35,9 @@
<u-icon :name="pwdShow1?'eye-off':'eye-fill'" size="25"
@click="pwdShow1=!pwdShow1"></u-icon>
</template>
</u-input>
</u-input>
</view>
<view class="sub-btn">
@ -61,8 +60,8 @@
reactive,
ref
} from 'vue';
const pwdShow = ref(false)
const pwdShow1 = ref(false)
const pwdShow = ref(false)
const pwdShow1 = ref(false)
const formData = reactive({
mobile: "",
password: "",
@ -89,11 +88,11 @@ const pwdShow1 = ref(false)
logregister(formData).then((res) => {
if (res.code == 1) {
uni.navigateBack({
delta: 1
})
uni.$u.toast('注册成功');
uni.$u.toast('注册成功');
}
})

View File

@ -2,7 +2,7 @@
<!-- 播种 -->
<view class="content">
<view class="card">
<u--form labelPosition="top" labelWidth='100' :model="formData" :rules="rules" ref="form">
<u--form labelPosition="top" labelWidth='130' :model="formData" :rules="rules" ref="form">
<u-form-item label="杀虫剂种类" prop="kind" borderBottom ref='item1' required>
<up-input placeholder="请输入杀虫剂种类" :disabled="mode=='detail'" border="surround"
v-model="formData.kind"></up-input>
@ -11,8 +11,8 @@
<up-input placeholder="请输入杀虫剂品牌" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="杀虫剂用量" prop="dosage" borderBottom required>
<up-input placeholder="请输入杀虫剂用量" border="surround" :disabled="mode=='detail'"
<u-form-item label="杀虫剂用量(升)" prop="dosage" borderBottom required>
<up-input placeholder="请输入杀虫剂用量" type='number' border="surround" :disabled="mode=='detail'"
v-model="formData.dosage"></up-input>
</u-form-item>
@ -36,7 +36,7 @@
v-model="formData.end_date" style="pointer-events: none;"></up-input>
</u-form-item>
</view>
<u-form-item label="作业面积" prop="area" borderBottom required>
<u-form-item label="作业面积(亩)" prop="area" borderBottom required>
<up-input placeholder="请输入作业面积" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.area"></up-input>
</u-form-item>
@ -46,6 +46,7 @@
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
<span>*</span>
杀虫图片
</view>
<view class="code-img1">
@ -74,7 +75,7 @@
</view>
</view>
<u-form-item label="备注" prop="remark" borderBottom required>
<u-form-item label="备注" prop="remark" borderBottom >
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
</u-form-item>
@ -208,13 +209,14 @@ const formatter = (type, value) => {
required: true,
message: '请填写参与人',
trigger: ['blur', 'change']
},
'remark': {
type: 'string',
required: true,
message: '请填写备注',
trigger: ['blur', 'change']
},
}
// ,
// 'remark': {
// type: 'string',
// required: true,
// message: '',
// trigger: ['blur', 'change']
// },
})
onReady(() => {
form.value.setRules(rules);
@ -355,6 +357,17 @@ const formatter = (type, value) => {
}
.card-li-tit {
position: relative;
span {
position: absolute;
left: -9px;
color: #f56c6c;
line-height: 20px;
font-size: 20px;
top: 3px;
}
margin-bottom: 20rpx;
}

View File

@ -1,7 +1,5 @@
<template>
<view class="content">
<view class="content-con-a" v-if="datalist.length>0">
<view class="shop_action">
@ -18,6 +16,14 @@
{{item.detail.kind}}
</view>
</view>
<view class="action-detail" v-if="item.detail.breed">
<view class="title">
{{item.type_text.slice(0, -2)}}品牌
</view>
<view class="detail">
{{item.detail.breed}}
</view>
</view>
<view class="action-detail">
<view class="title">
{{item.type_text.slice(0, -2)}}用量
@ -28,7 +34,7 @@
<text v-if='item.type!=4&&item.type!=5'></text>
</view>
</view>
<view class="action-detail">
<view class="title">
{{item.type_text.slice(0, -2)}}
@ -57,14 +63,16 @@
<view class="title">
{{item.type_text.slice(0, -2)}}图片
</view>
<view class="detail-img">
<u-swiper :list="item.detail.pic" width="100%" height="529rpx"></u-swiper>
<view class="detail-img" v-if="item.detail&&item.detail.pic&&item.detail.pic.length>0">
<image @click="perviewFn(item.detail.pic)" :src="item.detail.pic[0]" mode="aspectFit">
</image>
</view>
</view>
</view>
<view class="shop_action-detail" v-if="item.type==3">
<view class="action-detail">
<view class="title">
灌溉面积
@ -73,6 +81,15 @@
{{item.detail.area}}
</view>
</view>
<view class="action-detail">
<view class="title">
灌溉方式
</view>
<view class="detail">
{{item.detail.type==1?"喷灌":item.detail.type==2?"滴灌":"沟灌"}}
</view>
</view>
<view class="action-detail">
<view class="title">
灌溉人
@ -101,14 +118,15 @@
<view class="title">
灌溉图片
</view>
<view class="detail-img">
<u-swiper :list="item.detail.pic" width="100%" height="529rpx"></u-swiper>
<view class="detail-img" v-if="item.detail&&item.detail.pic&&item.detail.pic.length>0">
<image @click="perviewFn(item.detail.pic)" :src="item.detail.pic[0]" mode="aspectFit">
</image>
</view>
</view>
</view>
<view class="shop_action-detail" v-if="item.type==5">
<view class="action-detail">
<view class="title" style="width: 200rpx;">
<view class="title" style="width: 200rpx;">
收获时间
</view>
<view class="detail">
@ -125,11 +143,12 @@
</view>
</view>
<view class="action-detail-img">
<view class="title" >
<view class="title">
收获图片
</view>
<view class="detail-img">
<u-swiper :list="item.detail.pic" width="100%" height="529rpx"></u-swiper>
<view class="detail-img" v-if="item.detail&&item.detail.pic&&item.detail.pic.length>0">
<image @click="perviewFn(item.detail.pic)" :src="item.detail.pic[0]" mode="aspectFit">
</image>
</view>
</view>
</view>
@ -172,7 +191,7 @@
}).then((res) => {
if (res.code == 1) {
datalist.splice(0, datalist.length, ...res.data)
}
});
@ -190,7 +209,7 @@
//
const perviewFn = (url) => {
uni.previewImage({
urls: [url]
urls: url
})
}
</script>
@ -270,6 +289,7 @@
.title {
width: 240rpx;
}
.detail {
width: 450rpx
}
@ -287,6 +307,11 @@
.detail-img {
width: 627rpx;
height: 529rpx;
image {
width: 100%;
height: 100%;
}
}
}
}

View File

@ -11,8 +11,8 @@
<up-input placeholder="请输入肥料品牌" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="肥料用量" prop="dosage" borderBottom required>
<up-input placeholder="请输入肥料用量" border="surround" :disabled="mode=='detail'"
<u-form-item label="肥料用量(斤)" prop="dosage" borderBottom required>
<up-input placeholder="请输入肥料用量" border="surround" type='number' :disabled="mode=='detail'"
v-model="formData.dosage"></up-input>
</u-form-item>
@ -36,7 +36,7 @@
style="pointer-events: none;"></up-input>
</u-form-item>
</view>
<u-form-item label="作业面积" prop="area" borderBottom required>
<u-form-item label="作业面积(亩)" prop="area" borderBottom required>
<up-input placeholder="请输入作业面积" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.area"></up-input>
</u-form-item>
@ -46,6 +46,7 @@
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
<span>*</span>
施肥图片
</view>
<view class="code-img1">
@ -77,7 +78,7 @@
</view>
</view>
<u-form-item label="备注" prop="remark" borderBottom required>
<u-form-item label="备注" prop="remark" borderBottom >
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
</u-form-item>
@ -200,13 +201,14 @@
required: true,
message: '请填写参与人',
trigger: ['blur', 'change']
},
'remark': {
type: 'string',
required: true,
message: '请填写备注',
trigger: ['blur', 'change']
},
}
// ,
// 'remark': {
// type: 'string',
// required: true,
// message: '',
// trigger: ['blur', 'change']
// },
})
onReady(() => {
form.value.setRules(rules);
@ -301,7 +303,7 @@
//
addaction(data1).then((res) => {
console.log(res)
// console.log(res)
if (res.code == 1) {
uni.$u.toast(res.msg)
uni.navigateBack({
@ -369,6 +371,17 @@
}
.card-li-tit {
position: relative;
span {
position: absolute;
left: -9px;
color: #f56c6c;
line-height: 20px;
font-size: 20px;
top: 3px;
}
margin-bottom: 20rpx;
}

View File

@ -18,6 +18,7 @@
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
<span>*</span>
收获图片
</view>
<view class="code-img1">
@ -46,7 +47,7 @@
</view>
</view>
<u-form-item label="备注" prop="remark" borderBottom required>
<u-form-item label="备注" prop="remark" borderBottom >
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
</u-form-item>
@ -102,12 +103,12 @@
message: '请填写参与人',
trigger: ['blur', 'change']
},
'remark': {
type: 'string',
required: true,
message: '请填写备注',
trigger: ['blur', 'change']
},
// 'remark': {
// type: 'string',
// required: true,
// message: '',
// trigger: ['blur', 'change']
// },
}
onReady(() => {
form.value.setRules(rules);
@ -241,6 +242,17 @@
}
.card-li-tit {
position: relative;
span {
position: absolute;
left: -9px;
color: #f56c6c;
line-height: 20px;
font-size: 20px;
top: 3px;
}
margin-bottom: 20rpx;
}

View File

@ -30,7 +30,7 @@
style="pointer-events: none;"></up-input>
</u-form-item>
</view>
<u-form-item label="灌溉面积" prop="area" borderBottom required>
<u-form-item label="灌溉面积(亩)" prop="area" borderBottom required>
<up-input placeholder="请输入作业面积" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.area"></up-input>
</u-form-item>
@ -40,6 +40,7 @@
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
<span>*</span>
灌溉图片
</view>
<view class="code-img1">
@ -69,7 +70,7 @@
</view>
</view>
<u-form-item label="备注" prop="remark" borderBottom required>
<u-form-item label="备注" prop="remark" borderBottom >
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
</u-form-item>
@ -220,13 +221,14 @@
required: true,
message: '请填写参与人',
trigger: ['blur', 'change']
},
'remark': {
type: 'string',
required: true,
message: '请填写备注',
trigger: ['blur', 'change']
},
}
// ,
// 'remark': {
// type: 'string',
// required: true,
// message: '',
// trigger: ['blur', 'change']
// },
}
onReady(() => {
form.value.setRules(rules);
@ -365,6 +367,17 @@
}
.card-li-tit {
position: relative;
span {
position: absolute;
left: -9px;
color: #f56c6c;
line-height: 20px;
font-size: 20px;
top: 3px;
}
margin-bottom: 20rpx;
}

View File

@ -16,8 +16,8 @@
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="种植面积" prop="area" borderBottom required>
<up-input placeholder="请输入种植面积" :disabled="mode=='detail'" type="number" border="surround"
<u-form-item label="种植面积(亩)" prop="area" borderBottom required>
<up-input placeholder="请输入种植面积" :disabled="mode=='detail'" type="number" border="surround"
v-model="data.formData.area"></up-input>
</u-form-item>
<u-form-item label="参与人" prop="user" borderBottom required>
@ -26,6 +26,7 @@
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
<span>*</span>
种植图片
</view>
<view class="code-img1">
@ -301,6 +302,17 @@ const formatter = (type, value) => {
}
.card-li-tit {
position: relative;
span {
position: absolute;
left: -9px;
color: #f56c6c;
line-height: 20px;
font-size: 20px;
top: 3px;
}
margin-bottom: 20rpx;
}

View File

@ -2,7 +2,7 @@
<!-- 播种 -->
<view class="content">
<view class="card">
<u--form labelPosition="top" labelWidth='100' :model="formData" :rules="rules" ref="form">
<u--form labelPosition="top" labelWidth='120' :model="formData" :rules="rules" ref="form">
<u-form-item label="除草剂种类" prop="kind" borderBottom ref='item1' required>
<up-input placeholder="请输入除草剂种类" :disabled="mode=='detail'" border="surround"
v-model="formData.kind"></up-input>
@ -11,32 +11,32 @@
<up-input placeholder="请输入除草剂品牌" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="除草剂用量" prop="dosage" borderBottom required>
<up-input placeholder="请输入除草剂用量" border="surround" :disabled="mode=='detail'"
<u-form-item label="除草剂用量(斤)" prop="dosage" borderBottom required>
<up-input placeholder="请输入除草剂用量" border="surround" type='number' :disabled="mode=='detail'"
v-model="formData.dosage"></up-input>
</u-form-item>
<view class="" v-if="mode=='add'">
<u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.start_date"
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.end_date"
style="pointer-events: none;"></up-input>
</u-form-item>
</view>
<view class="" v-else>
<u-form-item label="开始日期" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.start_date"
style="pointer-events: none;"></up-input>
</u-form-item>
<u-form-item label="结束日期" prop="end_date" borderBottom required>
<up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date" style="pointer-events: none;"></up-input>
<up-input placeholder="请选择日期" readonly border="surround" v-model="formData.end_date"
style="pointer-events: none;"></up-input>
</u-form-item>
</view>
<u-form-item label="作业面积" prop="area" borderBottom required>
<u-form-item label="作业面积(亩)" prop="area" borderBottom required>
<up-input placeholder="请输入作业面积" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.area"></up-input>
</u-form-item>
@ -44,9 +44,11 @@
<up-input placeholder="请输入参与人" :disabled="mode=='detail'" type="txt" border="surround"
v-model="formData.user"></up-input>
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
土地图片
<span>*</span>
除草图片
</view>
<view class="code-img1">
<view class="" v-if="pic.length>0"
@ -75,19 +77,19 @@
</view>
</view>
<u-form-item label="备注" prop="remark" borderBottom required>
<u-form-item label="备注" prop="remark" borderBottom >
<u--textarea v-model="formData.remark" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
</u-form-item>
</u--form>
<view>
<!-- <uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" />
<!-- <uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" />
<uni-calendar ref="calendar1" :showMonth="true" :lunar="true" :insert="false"
@confirm="dateConfirmfn1" /> -->
<u-datetime-picker :show="show1" v-model="value1" mode="datetime" @confirm="dateConfirmfn"
:formatter="formatter" @cancel="show1=false"></u-datetime-picker>
<u-datetime-picker :show="show2" v-model="value1" mode="datetime" @confirm="dateConfirmfn1"
:formatter="formatter" @cancel="show2=false"></u-datetime-picker>
<u-datetime-picker :show="show1" v-model="value1" mode="datetime" @confirm="dateConfirmfn"
:formatter="formatter" @cancel="show1=false"></u-datetime-picker>
<u-datetime-picker :show="show2" v-model="value1" mode="datetime" @confirm="dateConfirmfn1"
:formatter="formatter" @cancel="show2=false"></u-datetime-picker>
</view>
</view>
@ -125,7 +127,7 @@
const calendar1 = ref(null)
const form = ref(null)
const task_id = ref('');
const value1 = ref(Date.now());
const value1 = ref(Date.now());
const show1 = ref(false);
const show2 = ref(false);
const openDate = () => {
@ -137,16 +139,16 @@ const value1 = ref(Date.now());
show2.value = true
}
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;
};
// console.log()
const formData = reactive({
@ -210,13 +212,14 @@ const value1 = ref(Date.now());
required: true,
message: '请填写参与人',
trigger: ['blur', 'change']
},
'remark': {
type: 'string',
required: true,
message: '请填写备注',
trigger: ['blur', 'change']
},
}
// ,
// 'remark': {
// type: 'string',
// required: true,
// message: '',
// trigger: ['blur', 'change']
// },
})
onReady(() => {
form.value.setRules(rules);
@ -258,7 +261,7 @@ const value1 = ref(Date.now());
}
//
const perviewFn = (url) => {
uni.previewImage({
urls: [url]
})
@ -315,8 +318,8 @@ const value1 = ref(Date.now());
// uni.$u.toast('')
}
}).catch((err)=>{
uni.$u.toast(err[0].message)
}).catch((err) => {
uni.$u.toast(err[0].message)
console.log(err)
})
@ -331,7 +334,7 @@ const value1 = ref(Date.now());
let data = options.task ? JSON.parse(decodeURIComponent(options.task)) : null;
// console.log(data, data.detail)
Object.assign(formData, data.detail);
pic.splice(0, pic.length, ...data.detail.pic);
mode.value = 'detail'
@ -360,6 +363,17 @@ const value1 = ref(Date.now());
}
.card-li-tit {
position: relative;
span {
position: absolute;
left: -9px;
color: #f56c6c;
line-height: 20px;
font-size: 20px;
top: 3px;
}
margin-bottom: 20rpx;
}

View File

@ -75,9 +75,9 @@
</view>
</view>
<view class="add-thing" @click="showPicker1=true" v-if="columns2[0]&&columns2[0].length>0">
记农事
</view>
@ -507,11 +507,12 @@
return {
name: step.kind + '-' + step.id,
id: step.id,
status: step.status
};
}));
columns2.push(arr1)
}
})
@ -554,9 +555,15 @@
})
}
const confirm1 = (e) => {
palntId.value = e.value[0].id
showPicker1.value = false
showPicker.value = true
if (e.value[0].status == 2) {
uni.$u.toast('该土地已经收获,不能进行操作');
} else {
showPicker.value = true
}
}
const confirm = (e) => {
// console.log(e)

View File

@ -5,7 +5,7 @@
<view class="video" @click="navto('/pages/live/live')">
<!-- <u--image :src="url" width="100%" height="300rpx"></u--image> -->
<u-swiper :list="dataobj.pic" width="100%" height="300rpx" ></u-swiper>
<u-swiper :list="dataobj.pic" width="100%" height="300rpx"></u-swiper>
</view>
<view class="time">
@ -32,17 +32,18 @@
农事查看
</view>
</view>
<view class="card_body">
<view class="left">
<u--image @click="perviewFn(item.pic[0])" radius='10' :src="item.pic[0]" width="200rpx"
<view class="left" v-if='item.pic.length>0'>
<u--image @click="perviewFn(item.pic)" radius='10' :src="item.pic[0]" width="200rpx"
height="200rpx"></u--image>
</view>
<view class="right">
<view class="">
种植种类:{{item.kind}}
种植种类: {{item.kind}}
</view>
<view class="">
种植品: {{item.breed}}
种植品: {{item.breed}}
</view>
<view class="">
种植面积: {{item.area}}
@ -51,14 +52,16 @@
参与人员: {{item.user}}
</view>
<view class="">
开始日期: {{item.create_time}}
种植日期: {{item.plant_date}}
</view>
<view class="" v-if="item.remark">
备注: {{item.remark}}
</view>
<view class="" style="display:flex;" v-if="item.status==2">
<view class="" style="margin-right: 10rpx;">溯源码: </view>
<u--image @click="perviewFn(item.qr_code)" radius='10' :src="item.qr_code" width="200rpx"
height="200rpx" style="margin-top: 10rpx;"></u--image>
<u--image @click="perviewFn1(item.qr_code)" radius='10' :src="item.qr_code"
width="200rpx" height="200rpx" style="margin-top: 10rpx;"></u--image>
</view>
</view>
</view>
@ -108,7 +111,7 @@
} from "@dcloudio/uni-app"
const list = reactive([{
id: 1,
url: 'https://ceshi-worker-task.lihaink.cn//uploads//images//20231121//202311211336582b7920656.jpg'
},
{
@ -162,11 +165,11 @@
onLoad((option) => {
typeID.value = option.id;
});
onShow(() => {
getlist();
getlist1();
@ -176,7 +179,7 @@
landdetail({
land_id: typeID.value
}).then((res) => {
if (res.code == 1) {
Object.assign(dataobj, res.data);
@ -214,7 +217,7 @@
const navtoForm = (item, type) => {
uni.navigateTo({
url: '/pages/landDetail/tudi?data=' +item.id
url: '/pages/landDetail/tudi?data=' + item.id
})
@ -233,7 +236,13 @@
}
//
const perviewFn = (url) => {
uni.previewImage({
urls: url
})
}
const perviewFn1 = (url) => {
uni.previewImage({
urls: [url]
})

View File

@ -18,22 +18,22 @@
{{dataobj.kind}}
</view>
</view>
<view class="detail">
<view class="detaila">
种植日期
<view class="detail">
<view class="detaila">
种植日期
</view>
<view class="detailb">
{{dataobj.plant_date}}
</view>
</view>
<view class="detailb">
{{dataobj.plant_date}}
<view class="detail">
<view class="detaila">
收获日期
</view>
<view class="detailb">
{{dataobj.harvest_date}}
</view>
</view>
</view>
<view class="detail">
<view class="detaila">
收获日期
</view>
<view class="detailb">
{{dataobj.harvest_date}}
</view>
</view>
<view class="detail">
<view class="detaila">
生长期
@ -63,7 +63,7 @@
{{dataobj.land_address}}
</view>
</view>
</view>
</view>
@ -75,19 +75,27 @@
<view class="shop_action-detail" v-if="item.type!=3&&item.type!=5">
<view class="action-detail">
<view class="title">
{{item.type_text.slice(0, -2)}}名称
{{item.type_text.slice(0, -2)}}品种
</view>
<view class="detail">
{{item.detail.kind}}
</view>
</view>
<view class="action-detail" v-if="item.detail.breed">
<view class="title">
{{item.type_text.slice(0, -2)}}品牌
</view>
<view class="detail">
{{item.detail.breed}}
</view>
</view>
<view class="action-detail">
<view class="title">
{{item.type_text.slice(0, -2)}}用量
</view>
<view class="detail">
{{item.detail.dosage}}<text v-if='item.type==4'></text>
<text v-if='item.type!=4&&item.type!=5'></text>
<text v-if='item.type!=4&&item.type!=5'></text>
</view>
</view>
<view class="action-detail">
@ -102,8 +110,9 @@
<view class="title">
{{item.type_text.slice(0, -2)}}图片
</view>
<view class="detail-img">
<u-swiper :list="item.detail.pic" width="100%" height="529rpx"></u-swiper>
<view class="detail-img" v-if="item.detail&&item.detail.pic&&item.detail.pic.length>0">
<image @click="perviewFn(item.detail.pic)" :src="item.detail.pic[0]" mode="aspectFit">
</image>
</view>
</view>
</view>
@ -137,8 +146,10 @@
<view class="title">
灌溉图片
</view>
<view class="detail-img">
<u-swiper :list="item.detail.pic" width="100%" height="529rpx"></u-swiper>
<view class="detail-img" v-if="item.detail&&item.detail.pic&&item.detail.pic.length>0">
<image @click="perviewFn(item.detail.pic)" :src="item.detail.pic[0]" mode="aspectFit">
</image>
</view>
</view>
</view>
@ -164,8 +175,9 @@
<view class="title">
收获图片
</view>
<view class="detail-img">
<u-swiper :list="item.detail.pic" width="100%" height="529rpx"></u-swiper>
<view class="detail-img" v-if="item.detail&&item.detail.pic&&item.detail.pic.length>0">
<image @click="perviewFn(item.detail.pic)" :src="item.detail.pic[0]" mode="aspectFit">
</image>
</view>
</view>
</view>
@ -173,6 +185,9 @@
</view>
</view>
</view>
</template>
@ -192,6 +207,7 @@
const task_id = ref('');
const dataobj = reactive({})
const daysDiff = ref('');
onLoad((options) => {
task_id.value = options.id
// if (options.task_id) {
@ -203,9 +219,9 @@
//
const getlist1 = (id) => {
suYuan({
plant_id:id
plant_id: id
}).then((res) => {
if (res.code == 1) {
Object.assign(dataobj, res.data);
getday(res.data)
@ -216,7 +232,7 @@
const getday = (data) => {
const start = new Date(data.plant_date);
const end = new Date(data.actions[data.actions.length-1].create_time.split(' ')[0]);
const end = new Date(data.actions[data.actions.length - 1].create_time.split(' ')[0]);
const diffTime = Math.abs(end - start);
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
daysDiff.value = diffDays
@ -224,8 +240,10 @@
}
//
const perviewFn = (url) => {
console.log(url)
uni.previewImage({
urls: [url]
urls: url
})
}
</script>
@ -323,6 +341,11 @@
.detail-img {
width: 627rpx;
height: 529rpx;
image {
width: 100%;
height: 100%;
}
}
}
}

View File

@ -9,9 +9,10 @@
<u-icon name="clock"></u-icon>
<text>刷新时间: {{getNowTimeFn()}} </text>
</view>
<view class="add-thing" @click="showPicker=true">
<view class="add-thing" @click="showPicker=true" v-if="palnttype">
记农事
</view>
<view class="" style="margin-bottom: 30rpx;" v-else></view>
<landInfo :info='dataobj'></landInfo>
@ -32,7 +33,7 @@
<view class="card_body">
<view class="left">
<u--image @click="perviewFn(item.detail.pic[0])" radius='10' :src="item.detail.pic[0]"
<u--image @click="perviewFn(item.detail.pic)" radius='10' :src="item.detail.pic[0]"
width="200rpx" height="200rpx"></u--image>
</view>
<view class="right">
@ -40,20 +41,24 @@
<view class="">
参与人员: {{item.detail.user}}
</view>
<view class="">
备注: {{item.detail.remark}}
</view>
</view>
<view class="" v-else>
<view class="" v-if="!item.detail.type">
<view class="">
{{item.type_text.slice(0, -2)}}种类:{{item.detail.kind}}
{{item.type_text.slice(0, -2)}}种类: {{item.detail.kind}}
</view>
<view class="">
{{item.type_text.slice(0, -2)}}: {{item.detail.breed}}
{{item.type_text.slice(0, -2)}}: {{item.detail.breed}}
</view>
<view class="" v-if='item.detail.dosage'>
{{item.type_text.slice(0, -2)}}用量: {{item.detail.dosage}}
<text v-if='item.type==4'></text>
<text v-if='item.type!=4&&item.type!=5'></text>
</view>
@ -61,19 +66,24 @@
{{item.type_text.slice(0, -2)}}面积: {{item.detail.area}}
</view>
</view>
<view class="" v-if="item.detail.type&&item.detail.type==1">
{{item.type_text.slice(0, -2)}}方式:{{item.detail.type==1?"喷灌":item.detail.type==2?"滴灌":"沟灌"}}
<view class="" v-if="item.type==3">
{{item.type_text.slice(0, -2)}}方式: {{item.detail.type==1?"喷灌":item.detail.type==2?"滴灌":"沟灌"}}
</view>
<view class="">
参与人员: {{item.detail.user}}
</view>
<view class="" v-if="item.detail.start_date">
开始日期: {{item.detail.start_date}}
</view>
<view class="" v-if="item.detail.end_date">
结束日期: {{item.detail.end_date}}
</view>
<view class="" v-if="item.detail.remark">
备注: {{item.detail.remark}}
</view>
</view>
</view>
@ -156,8 +166,8 @@
const dataList1 = reactive([])
const dataobj = reactive({})
const typeID = ref('')
const showPicker = ref(false)
const palnttype = ref(true)
const columns = reactive([
[{
label: '施肥',
@ -182,7 +192,6 @@
// console.log(data); // { name: 'John', age: 25 }
// Object.assign(dataobj, data);
typeID.value = query.data;
// getlist1()
// getlist2();
});
@ -192,7 +201,7 @@
getlist2();
})
const getlist1 = (id, a, b,c) => {
const getlist1 = (id, a, b, c, e) => {
landdetail({
land_id: id
}).then((res) => {
@ -200,7 +209,8 @@
if (res.code == 1) {
res.data.kind = a
res.data.datapic = b
res.data.kindarea= c
res.data.kindarea = c
res.data.breed = e
Object.assign(dataobj, res.data);
@ -212,7 +222,10 @@
plant_id: typeID.value
}).then((res) => {
if (res.code == 1) {
getlist1(res.data.land_id, res.data.kind, res.data.pic,res.data.area)
if(res.data.status==2){
palnttype.value=false
}
getlist1(res.data.land_id, res.data.kind, res.data.pic, res.data.area, res.data.breed)
}
});
};
@ -280,6 +293,7 @@
}
const confirm = (e) => {
showPicker.value = false
uni.navigateTo({
url: e.value[0].route + '?id=' + typeID.value
@ -298,7 +312,7 @@
const perviewFn = (url) => {
uni.previewImage({
urls: [url]
urls: url
})
}
</script>