mkm
/
yanzhiAPP
Template
2
0
Fork 0

溯源操作详情修改

This commit is contained in:
jia 2023-11-29 18:11:21 +08:00
parent b2c5c27e2f
commit 812fc0778d
16 changed files with 283 additions and 174 deletions

View File

@ -3,7 +3,6 @@ import http from "@/utils/http.js";
//登录 //登录
export const login = (data) => syhttp.post('/login/account', data) export const login = (data) => syhttp.post('/login/account', data)
//验证码 //验证码
@ -36,6 +35,9 @@ export const addaction = (data) => syhttp.post('/action/add', data)
//添加操作 //添加操作
export const binddevice = (data) => syhttp.post('/land/bind', data) export const binddevice = (data) => syhttp.post('/land/bind', data)
//操作具体
export const listForType = (data) => syhttp.get('/action/listForType', data)
//首页 //首页
export const lindexist = (data) => syhttp.get('/index/index', data) export const lindexist = (data) => syhttp.get('/index/index', data)
//产品列表 //产品列表

View File

@ -124,6 +124,14 @@
"navigationBarBackgroundColor": "#F4F4F4", "navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
} }
},{
"path": "pages/husbandryForm/detail",
"style": {
"navigationBarTitleText": "操作详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, },
{ {
"path": "pages/updatePassword/updatePassword", "path": "pages/updatePassword/updatePassword",
@ -144,9 +152,7 @@
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
} }, {
, {
"path": "pages/Login/resgier", "path": "pages/Login/resgier",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"

View File

@ -7,34 +7,34 @@
<u-form-item label="简介" prop="intro"><u-input v-model="data.formData.intro" /></u-form-item> --> <u-form-item label="简介" prop="intro"><u-input v-model="data.formData.intro" /></u-form-item> -->
<u-form-item label="土地名称" prop="title" borderBottom ref='item1' required> <u-form-item label="土地名称" prop="title" borderBottom ref='item1' required>
<up-input placeholder="请输入土地名称" border="surround" v-model="data.formData.title"></up-input> <up-input placeholder="请输入土地名称" border="surround" v-model="data.formData.title" ></up-input>
</u-form-item> </u-form-item>
<u-form-item label="土地面积" prop="area" borderBottom required> <u-form-item label="土地面积" prop="area" borderBottom required>
<up-input placeholder="请输入土地面积" border="surround" v-model="data.formData.area"></up-input> <up-input placeholder="请输入土地面积" border="surround" v-model="data.formData.area"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="所在省份" prop="province_code" borderBottom required> <u-form-item label="所在省份" prop="province_code" borderBottom required @click="isshow1">
<up-input placeholder="请选择所在省份" border="surround" v-model="province_name" :disabled="true" <up-input placeholder="请选择所在省份" border="surround" v-model="province_name" readonly
@click="isshow1"></up-input> style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="所在城市" prop="city_code" borderBottom required> <u-form-item label="所在城市" prop="city_code" borderBottom required @click="isshow2">
<up-input placeholder="请选择所在城市" border="surround" v-model="city_name" @click="isshow2" <up-input placeholder="请选择所在城市" border="surround" v-model="city_name"
:disabled="true"></up-input> readonly style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="所在区县" prop="county_code" borderBottom required> <u-form-item label="所在区县" prop="county_code" borderBottom required @click="isshow3">
<up-input placeholder="请选择所在区县" border="surround" v-model="county_name" @click="isshow3" <up-input placeholder="请选择所在区县" border="surround" v-model="county_name"
:disabled="true"></up-input> readonly style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="所在镇街" prop="town_code" borderBottom required> <u-form-item label="所在镇街" prop="town_code" borderBottom required @click="isshow4">
<up-input placeholder="请选择所在镇街" border="surround" v-model="town_name" @click="isshow4" <up-input placeholder="请选择所在镇街" border="surround" v-model="town_name"
:disabled="true"></up-input> readonly style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="所在乡村" prop="village_code" borderBottom required> <u-form-item label="所在乡村" prop="village_code" borderBottom required @click="isshow5">
<up-input placeholder="请选择所在乡村" border="surround" v-model="village_name" @click="isshow5" <up-input placeholder="请选择所在乡村" border="surround" v-model="village_name"
:disabled="true"></up-input> readonly style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="所在小队" prop="group_code" borderBottom required> <u-form-item label="所在小队" prop="group_code" borderBottom required @click="isshow6">
<up-input placeholder="请选择所在小队" border="surround" v-model="group_name" @click="isshow6" <up-input placeholder="请选择所在小队" border="surround" v-model="group_name"
:disabled="true"></up-input> readonly style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="土地负责人" prop="master_name" borderBottom required> <u-form-item label="土地负责人" prop="master_name" borderBottom required>
<up-input placeholder="请输入土地负责人名称" border="surround" v-model="data.formData.master_name"></up-input> <up-input placeholder="请输入土地负责人名称" border="surround" v-model="data.formData.master_name"></up-input>

View File

@ -18,22 +18,22 @@
<view class="" v-if="mode=='add'"> <view class="" v-if="mode=='add'">
<u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required> <u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date"></up-input> v-model="formData.start_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required> <u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date"></up-input> v-model="formData.end_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
</view> </view>
<view class="" v-else> <view class="" v-else>
<u-form-item label="开始日期" prop="start_date" borderBottom required> <u-form-item label="开始日期" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date"></up-input> v-model="formData.start_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="结束日期" prop="end_date" borderBottom required> <u-form-item label="结束日期" prop="end_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date"></up-input> v-model="formData.end_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
</view> </view>
<u-form-item label="作业面积" prop="area" borderBottom required> <u-form-item label="作业面积" prop="area" borderBottom required>

View File

@ -18,22 +18,22 @@
<view class="" v-if="mode=='add'"> <view class="" v-if="mode=='add'">
<u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required> <u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date"></up-input> v-model="formData.start_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required> <u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date"></up-input> v-model="formData.end_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
</view> </view>
<view class="" v-else> <view class="" v-else>
<u-form-item label="开始日期" prop="start_date" borderBottom required> <u-form-item label="开始日期" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date"></up-input> v-model="formData.start_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="结束日期" prop="end_date" borderBottom required> <u-form-item label="结束日期" prop="end_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date"></up-input> v-model="formData.end_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
</view> </view>
<u-form-item label="作业面积" prop="area" borderBottom required> <u-form-item label="作业面积" prop="area" borderBottom required>

View File

@ -6,28 +6,28 @@
<u-form-item label="灌溉方式" prop="type" borderBottom required @click="showggai"> <u-form-item label="灌溉方式" prop="type" borderBottom required @click="showggai">
<!-- <uni-data-select v-model="formData.type" :disabled="mode=='detail'" <!-- <uni-data-select v-model="formData.type" :disabled="mode=='detail'"
:localdata="range"></uni-data-select> --> :localdata="range"></uni-data-select> -->
<up-input placeholder="请选择灌溉方式" :disabled="true" border="surround" <up-input placeholder="请选择灌溉方式" readonly border="surround"
v-model="formDatatype"></up-input> v-model="formDatatype" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<view class="" v-if="mode=='add'"> <view class="" v-if="mode=='add'">
<u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required> <u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date"></up-input> v-model="formData.start_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required> <u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date"></up-input> v-model="formData.end_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
</view> </view>
<view class="" v-else> <view class="" v-else>
<u-form-item label="开始日期" prop="start_date" borderBottom required> <u-form-item label="开始日期" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date"></up-input> v-model="formData.start_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="结束日期" prop="end_date" borderBottom required> <u-form-item label="结束日期" prop="end_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date"></up-input> v-model="formData.end_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
</view> </view>
<u-form-item label="灌溉面积" prop="area" borderBottom required> <u-form-item label="灌溉面积" prop="area" borderBottom required>

View File

@ -11,9 +11,9 @@
<up-input placeholder="请输入品种" :disabled="mode=='detail'" border="surround" <up-input placeholder="请输入品种" :disabled="mode=='detail'" border="surround"
v-model="data.formData.breed"></up-input> v-model="data.formData.breed"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="开始日期" prop="date" borderBottom required> <u-form-item label="开始日期" prop="date" borderBottom required @click="openDate">
<up-input placeholder="请选择日期" @click="openDate" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="data.formData.date"></up-input> v-model="data.formData.date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="种植面积" prop="area" borderBottom required> <u-form-item label="种植面积" prop="area" borderBottom required>

View File

@ -18,22 +18,22 @@
<view class="" v-if="mode=='add'"> <view class="" v-if="mode=='add'">
<u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required> <u-form-item label="开始日期" @click="openDate" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date"></up-input> v-model="formData.start_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required> <u-form-item label="结束日期" prop="end_date" @click="openDate1" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date"></up-input> v-model="formData.end_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
</view> </view>
<view class="" v-else> <view class="" v-else>
<u-form-item label="开始日期" prop="start_date" borderBottom required> <u-form-item label="开始日期" prop="start_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.start_date"></up-input> v-model="formData.start_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="结束日期" prop="end_date" borderBottom required> <u-form-item label="结束日期" prop="end_date" borderBottom required>
<up-input placeholder="请选择日期" :disabled="true" border="surround" <up-input placeholder="请选择日期" readonly border="surround"
v-model="formData.end_date"></up-input> v-model="formData.end_date" style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item>
</view> </view>
<u-form-item label="作业面积" prop="area" borderBottom required> <u-form-item label="作业面积" prop="area" borderBottom required>
@ -303,7 +303,7 @@
onLoad((options) => { onLoad((options) => {
if (options.task) { if (options.task) {
let data = options.task ? JSON.parse(decodeURIComponent(options.task)) : null; let data = options.task ? JSON.parse(decodeURIComponent(options.task)) : null;
console.log(data, data.detail) // console.log(data, data.detail)
Object.assign(formData, data.detail); Object.assign(formData, data.detail);
pic.splice(0, pic.length, ...data.detail.pic); pic.splice(0, pic.length, ...data.detail.pic);

View File

@ -116,21 +116,18 @@
} }
const getlist = () => { const getlist = () => {
landlist(fomData).then((res) => { landlist(fomData).then((res) => {
if (res.code == 1) { if (res.code == 1) {
datalist.splice(0, datalist.length, ...res.data); datalist.splice(0, datalist.length, ...res.data);
fomData.page_no += fomData.page_no fomData.page_no += fomData.page_no
} }
}) })
} }
const search = () => { const search = () => {
getlist() getlist()
} }
@ -184,7 +181,7 @@
.custom-style { .custom-style {
color: #606266; color: #606266;
width: 120rpx; width: 140rpx;
border-radius: 30rpx; border-radius: 30rpx;
margin-top: 10rpx; margin-top: 10rpx;
margin-right: 20rpx; margin-right: 20rpx;

View File

@ -23,6 +23,7 @@
<view class="nav"> <view class="nav">
</view> </view>
</view> </view>
<view class="content" v-if="true"> <view class="content" v-if="true">
<!-- 土地信息 --> <!-- 土地信息 -->
<view class=""> <view class="">
@ -47,7 +48,7 @@
</view> </view>
<view class="card" v-else> <view class="card" v-else>
<view class="" @click="navgo"> <view class="">
<view class=""> <view class="">
暂无信息 暂无信息
</view> </view>
@ -57,6 +58,9 @@
</view> </view>
</view> </view>
<view class="add-thing" @click="showPicker1=true" v-if="columns2.length>0">
记农事
</view>
<!-- 苗情监测 --> <!-- 苗情监测 -->
<view class=""> <view class="">
<view class="live-video soil-monitor"> <view class="live-video soil-monitor">
@ -74,9 +78,11 @@
<!-- <u--image :src="url" width="100%" height="300rpx"></u--image> --> <!-- <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>
</view> </view>
<!-- 土壤监测 --> <!-- 土壤监测 -->
<!-- v-if="dataobj&&dataobj.monitor&&dataobj.monitor.length>0" -->
<view class=""> <view class="">
<view class="soil-monitor"> <view class="soil-monitor">
@ -89,7 +95,8 @@
<text>刷新时间: {{getNowTimeFn()}} </text> <text>刷新时间: {{getNowTimeFn()}} </text>
</view> </view>
</view> </view>
<view class="monitor-content"> <view class="monitor-content"
v-if="dataobj&&dataobj.monitor&&dataobj.soil_monitor_data&&Object.keys(dataobj.soil_monitor_data).length>0">
<view class="monitor-card" v-for="(item,index) in soilList" :key="index"> <view class="monitor-card" v-for="(item,index) in soilList" :key="index">
<view class="name"> <view class="name">
<view class=""> <view class="">
@ -106,6 +113,16 @@
</view> </view>
</view> </view>
</view> </view>
<view class="coneng-detail" v-else>
<view class="">
<image src="@/static/img/zw.png" mode="aspectFit"></image>
<view class="">
暂无数据
</view>
</view>
</view>
</view> </view>
<!-- 环境监测 --> <!-- 环境监测 -->
<view class="soil-monitor"> <view class="soil-monitor">
@ -118,7 +135,8 @@
<text>刷新时间: {{getNowTimeFn()}} </text> <text>刷新时间: {{getNowTimeFn()}} </text>
</view> </view>
</view> </view>
<view class="monitor-content"> <view class="monitor-content"
v-if="dataobj&&dataobj.monitor&&dataobj.monitor.air_monitor_data&&Object.keys(dataobj.monitor.air_monitor_data).length>0">
<view class="monitor-card" v-for="(item,index) in environmentList" :key="index"> <view class="monitor-card" v-for="(item,index) in environmentList" :key="index">
<view class="name"> <view class="name">
<view class=""> <view class="">
@ -135,16 +153,22 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</view>
<!-- <view class="coneng-detail" v-else> <view class="coneng-detail" v-else>
<view class="">
<image src="@/static/img/zw.png" mode="aspectFit"></image> <view class="">
<view class=""> <image src="@/static/img/zw.png" mode="aspectFit"></image>
暂无数据 <view class="">
暂无数据
</view>
</view>
</view> </view>
</view> </view>
</view> -->
</view>
<!-- 组件 --> <!-- 组件 -->
<u-loading-page :loading="showLoading"></u-loading-page> <u-loading-page :loading="showLoading"></u-loading-page>
@ -171,8 +195,8 @@
<u-popup :show="showModal" mode="center" @close="closeModal" :round="10"> <u-popup :show="showModal" mode="center" @close="closeModal" :round="10">
<view class="Modal"> <view class="Modal">
<text> 产品编号:</text> <text> 产品编号:</text>
<uni-data-select v-model="equipmentId" <uni-data-select v-model="equipmentId" style="width: 300rpx;margin-left: 30rpx;"
style="width: 300rpx;margin-left: 30rpx;" :localdata="range"></uni-data-select> :localdata="range"></uni-data-select>
</view> </view>
<view class="Modal-btn"> <view class="Modal-btn">
@ -186,7 +210,11 @@
</u-popup> </u-popup>
</view> </view>
<u-picker keyName="name" :show="showPicker1" @cancel="showPicker1=false" @confirm="confirm1"
:columns="columns2"></u-picker>
<u-picker keyName="label" :show="showPicker" @cancel="showPicker=false" @confirm="confirm2"
:columns="columns1"></u-picker>
</view> </view>
</template> </template>
@ -203,12 +231,33 @@
bindproduct, bindproduct,
lindexist, lindexist,
landlist, landlist,
plantlist,
landproduct landproduct
} from '@/api/api.js' } from '@/api/api.js'
const showPicker = ref(false)
const showPicker1 = ref(false)
const showModal = ref(false) const showModal = ref(false)
const columns1 = reactive([
[{
label: '施肥',
route: "/pages/husbandryForm/fertilize"
}, {
label: '除草',
route: "/pages/husbandryForm/weeding"
}, {
label: '灌溉',
route: "/pages/husbandryForm/irrigate"
}, {
label: '除虫',
route: "/pages/husbandryForm/Pest"
}, {
label: '收获',
route: "/pages/husbandryForm/harvest"
}]
]);
const columns2 = reactive([])
const range = reactive([]) const range = reactive([])
// //
const url = ref('https://ceshi-worker-task.lihaink.cn//uploads//images//20231121//202311211336582b7920656.jpg') const url = ref('https://ceshi-worker-task.lihaink.cn//uploads//images//20231121//202311211336582b7920656.jpg')
@ -259,7 +308,7 @@
]) ])
const dataobj = reactive({}) const dataobj = reactive({})
const tdId = ref('') const tdId = ref('')
const palntId = ref('')
// //
const equipmentId = ref("") const equipmentId = ref("")
const bindFn = () => { const bindFn = () => {
@ -273,7 +322,7 @@
// console.log('' + res.scanType); // console.log('' + res.scanType);
console.log('条码内容:' + res.result.split('=')); console.log('条码内容:' + res.result.split('='));
uni.navigateTo({ uni.navigateTo({
url:'/pages/landDetail/results?id='+res.result.split('=')[1] url: '/pages/landDetail/results?id=' + res.result.split('=')[1]
}) })
} }
}); });
@ -335,9 +384,7 @@
]) ])
onShow(() => { onShow(() => {
getlist() getlist()
getlist1() getlist1()
getlist2() getlist2()
}) })
@ -350,7 +397,7 @@
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
getlist3(res.data.id)
Object.assign(dataobj, res.data); Object.assign(dataobj, res.data);
if (res.data && res.data.monitor && res.data.monitor.soil_monitor_data) { if (res.data && res.data.monitor && res.data.monitor.soil_monitor_data) {
@ -417,7 +464,30 @@
} }
}) })
} }
const getlist3 = (id) => {
plantlist({
land_id: id
}).then((res) => {
if (res.code == 1) {
columns2.splice(0)
let arr1 = []
arr1.splice(0, arr1.length, ...res.data.map((step, index) => {
return {
name: step.kind + '-' + step.id,
id: step.id,
};
}));
columns2.push(arr1)
}
})
}
// //
const closeModal = () => { const closeModal = () => {
showModal.value = false showModal.value = false
@ -440,6 +510,18 @@
console.log(res) console.log(res)
}) })
} }
const confirm2 = (e) => {
showPicker.value = false
uni.navigateTo({
url: e.value[0].route + '?id=' + palntId.value
})
}
const confirm1 = (e) => {
palntId.value = e.value[0].id
showPicker1.value = false
showPicker.value = true
}
const confirm = (e) => { const confirm = (e) => {
// console.log(e) // console.log(e)
tdId.value = e.id tdId.value = e.id
@ -475,7 +557,7 @@
} }
getNowTimeFn() getNowTimeFn()
</script> </script>
<style lang="scss" > <style lang="scss">
page { page {
background-color: $theme-bg-color; background-color: $theme-bg-color;
} }
@ -514,6 +596,17 @@
} }
} }
.add-thing {
width: 266.36rpx;
height: 66.59rpx;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
border: 1px solid $theme-main-color;
margin: 20rpx auto;
line-height: 66rpx;
text-align: center;
color: $theme-main-color;
}
.Modal { .Modal {
padding: 60rpx 40rpx; padding: 60rpx 40rpx;
display: flex; display: flex;

View File

@ -45,7 +45,7 @@
种植品种: {{item.breed}} 种植品种: {{item.breed}}
</view> </view>
<view class=""> <view class="">
种植面积: {{item.area}} 种植面积: {{item.area}}
</view> </view>
<view class=""> <view class="">
参与人员: {{item.user}} 参与人员: {{item.user}}
@ -162,8 +162,7 @@
onLoad((option) => { onLoad((option) => {
typeID.value = option.id; typeID.value = option.id;
getlist();
getlist1();
}); });
onShow(() => { onShow(() => {

View File

@ -59,7 +59,8 @@
{{item.type_text.slice(0, -2)}}用量 {{item.type_text.slice(0, -2)}}用量
</view> </view>
<view class="detail"> <view class="detail">
{{item.detail.dosage}} {{item.detail.dosage}}<text v-if='item.type==4'></text>
<text v-if='item.type!=4&&item.type!=5'></text>
</view> </view>
</view> </view>
<view class="action-detail"> <view class="action-detail">
@ -75,7 +76,7 @@
{{item.type_text.slice(0, -2)}}图片 {{item.type_text.slice(0, -2)}}图片
</view> </view>
<view class="detail-img"> <view class="detail-img">
<u-swiper :list="dataobj.pic" width="100%" height="529rpx"></u-swiper> <u-swiper :list="item.detail.pic" width="100%" height="529rpx"></u-swiper>
</view> </view>
</view> </view>
</view> </view>
@ -94,7 +95,7 @@
灌溉面积 灌溉面积
</view> </view>
<view class="detail"> <view class="detail">
{{item.detail.area}} {{item.detail.area}}
</view> </view>
</view> </view>
<view class="action-detail"> <view class="action-detail">
@ -110,7 +111,7 @@
灌溉图片 灌溉图片
</view> </view>
<view class="detail-img"> <view class="detail-img">
<u-swiper :list="dataobj.pic" width="100%" height="529rpx"></u-swiper> <u-swiper :list="item.detail.pic" width="100%" height="529rpx"></u-swiper>
</view> </view>
</view> </view>
</view> </view>
@ -137,7 +138,7 @@
收获图片 收获图片
</view> </view>
<view class="detail-img"> <view class="detail-img">
<u-swiper :list="dataobj.pic" width="100%" height="529rpx"></u-swiper> <u-swiper :list="item.detail.pic" width="100%" height="529rpx"></u-swiper>
</view> </view>
</view> </view>
</view> </view>
@ -175,7 +176,7 @@
// //
const getlist1 = (id) => { const getlist1 = (id) => {
suYuan({ suYuan({
plant_id: id plant_id: 5
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {

View File

@ -32,8 +32,8 @@
<view class="card_body"> <view class="card_body">
<view class="left"> <view class="left">
<u--image @click="perviewFn(item.detail.pic[0])" radius='10' :src="item.detail.pic[0]" width="200rpx" <u--image @click="perviewFn(item.detail.pic[0])" radius='10' :src="item.detail.pic[0]"
height="200rpx"></u--image> width="200rpx" height="200rpx"></u--image>
</view> </view>
<view class="right"> <view class="right">
<view class="" v-if="item.type==5"> <view class="" v-if="item.type==5">
@ -42,15 +42,23 @@
</view> </view>
</view> </view>
<view class="" v-else> <view class="" v-else>
<view class="" v-if="!item.detail.type"> <view class="" v-if="!item.detail.type">
<view class=""> <view class="">
{{item.type_text.slice(0, -2)}}种类:{{item.detail.kind}} {{item.type_text.slice(0, -2)}}种类:{{item.detail.kind}}
</view> </view>
<view class=""> <view class="">
{{item.type_text.slice(0, -2)}}品种: {{item.detail.breed}} {{item.type_text.slice(0, -2)}}品种: {{item.detail.breed}}
</view> </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>
<view class=""> <view class="">
{{item.type_text.slice(0, -2)}}面积: {{item.detail.area}} {{item.type_text.slice(0, -2)}}面积: {{item.detail.area}}
</view> </view>
</view> </view>
<view class="" v-if="item.detail.type&&item.detail.type==1"> <view class="" v-if="item.detail.type&&item.detail.type==1">
@ -184,14 +192,14 @@
getlist2(); getlist2();
}) })
const getlist1 = (id,a,b) => { const getlist1 = (id, a, b) => {
landdetail({ landdetail({
land_id: id land_id: id
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
res.data.kind = a res.data.kind = a
res.data.datapic=b res.data.datapic = b
Object.assign(dataobj, res.data); Object.assign(dataobj, res.data);
@ -203,7 +211,7 @@
plant_id: typeID.value plant_id: typeID.value
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
getlist1(res.data.id, res.data.kind,res.data.pic) getlist1(res.data.land_id, res.data.kind, res.data.pic)
} }
}); });
}; };
@ -224,45 +232,50 @@
}) })
} }
const navtoForm = (item, type) => { const navtoForm = (item, type) => {
uni.navigateTo({
url: '/pages/husbandryForm/detail?land_id=' + dataobj.id + "&plant_id=" + typeID.value + "&type=" +
type
})
// console.log(item, type) // console.log(item, type)
switch (type) { // switch (type) {
// // //
case 1: // case 1:
uni.navigateTo({ // uni.navigateTo({
url: '/pages/husbandryForm/fertilize?task=' + encodeURIComponent(JSON.stringify(item)) // url: '/pages/husbandryForm/fertilize?task=' + encodeURIComponent(JSON.stringify(item))
}) // })
break; // break;
// // //
case 2: // case 2:
uni.navigateTo({ // uni.navigateTo({
url: '/pages/husbandryForm/weeding?task=' + encodeURIComponent(JSON.stringify(item)) // url: '/pages/husbandryForm/weeding?task=' + encodeURIComponent(JSON.stringify(item))
}) // })
break; // break;
// // //
case 3: // case 3:
uni.navigateTo({ // uni.navigateTo({
url: '/pages/husbandryForm/irrigate?task=' + encodeURIComponent(JSON.stringify(item)) // url: '/pages/husbandryForm/irrigate?task=' + encodeURIComponent(JSON.stringify(item))
}) // })
break; // break;
// // //
case 4: // case 4:
uni.navigateTo({ // uni.navigateTo({
url: '/pages/husbandryForm/Pest?task=' + encodeURIComponent(JSON.stringify(item)) // url: '/pages/husbandryForm/Pest?task=' + encodeURIComponent(JSON.stringify(item))
}) // })
break; // break;
// // //
case 5: // case 5:
uni.navigateTo({ // uni.navigateTo({
url: '/pages/husbandryForm/harvest?task=' + encodeURIComponent(JSON.stringify(item)) // url: '/pages/husbandryForm/harvest?task=' + encodeURIComponent(JSON.stringify(item))
}) // })
break; // break;
} // }
} }
const confirm = (e) => { const confirm = (e) => {
showPicker.value = false showPicker.value = false

View File

@ -3,11 +3,8 @@
<view :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;z-inde:-1;'"> <view :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;z-inde:-1;'">
<view class="root"> <view class="root">
<video ref="videoPlayer" <video ref="videoPlayer" :src="currentSrc" controls :object-fit="object_fit" autoplay="true"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/media/af4b9202306121644508620.mp4" controls :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'"></video>
autoplay="true"
@ended="playNext" :object-fit="object_fit" @loadedmetadata="onVideoLoaded"
:style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;z-inde:-1;'"></video>
</view> </view>
@ -23,7 +20,7 @@
export default { export default {
data() { data() {
return { return {
rtmpSources: ["https://lihai001.oss-cn-chengdu.aliyuncs.com/media/af4b9202306121644508620.mp4"], rtmpSources: [],
currentIndex: 0, currentIndex: 0,
room: {}, room: {},
wHeight: 0, //获取的屏幕高度🌟💗 wHeight: 0, //获取的屏幕高度🌟💗
@ -47,7 +44,7 @@
this.boxStyle.width = this.windowWidth + 'px' //给宽度加px this.boxStyle.width = this.windowWidth + 'px' //给宽度加px
this.wHeight = uni.getSystemInfoSync().screenHeight; //获取屏幕高度 this.wHeight = uni.getSystemInfoSync().screenHeight; //获取屏幕高度
this.boxStyle.height = this.wHeight; //改变视频高度 this.boxStyle.height = this.wHeight; //改变视频高度
this.get()
}, },
mounted() { mounted() {
@ -58,41 +55,36 @@
}, },
methods: { methods: {
onVideoLoaded() { playCurrent() {
console.log(this.$refs.videoPlayer) console.log(this.$refs.videoPlayer)
if (this.$refs.videoPlayer) { if (this.$refs.videoPlayer) {
// this.$refs.videoPlayer.load(); this.$refs.videoPlayer.load();
this.$refs.videoPlayer.play(); this.$refs.videoPlayer.play();
} }
}, },
playNext() { playNext() {
if (this.rtmpSources.length > 0) { this.currentIndex++;
this.currentIndex++; if (this.currentIndex >= this.rtmpSources.length) {
if (this.currentIndex >= this.rtmpSources.length) { this.currentIndex = 0; // 回到第一个源
this.currentIndex = 0; // 回到第一个源
}
this.playCurrent();
} }
this.playCurrent();
}, },
get() { get() {
let that = this let that = this
console.log(this.room) this.rtmpSources = ["https://lihai001.oss-cn-chengdu.aliyuncs.com/media/af4b9202306121644508620.mp4"]
playbackDetail({ // playbackDetail({
app_name: 'shop', // app_name: 'shop',
live_stream_id: this.room.live_stream_id // live_stream_id: this.room.live_stream_id
}).then((res) => { // }).then((res) => {
console.log(res.data, '1111') // console.log(res.data, '1111')
this.rtmpSources = res.data.playback_url; // this.rtmpSources = res.data.playback_url;
}) // })
}, },

View File

@ -14,11 +14,13 @@ function baseRequest(url, method, data, {
onReLogin = false onReLogin = false
}) { }) {
let Url = config.HTTP_REQUEST_URL, let Url = config.HTTP_REQUEST_URL,
header = config.HEADER; header = config.HEADER;
if (store.state.userInfo) { if (store.state.userInfo) {
header.TOKEN = store.state.userInfo.token header.TOKEN = store.state.userInfo.token
}else{
uni.redirectTo({
url:'/pages/Login/login'
})
} }
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
@ -49,7 +51,7 @@ function baseRequest(url, method, data, {
return reject(); return reject();
} }
} else if (res.data.code == 0) { } else if (res.data.code == 0) {
if (res.data.msg != '无登录信息') { if (res.data.msg != '用户信息不存在') {
uni.showToast({ uni.showToast({
title: res.data.msg || '请检查网络', title: res.data.msg || '请检查网络',
icon: 'none', icon: 'none',

View File

@ -14,7 +14,11 @@ function baseRequest(url, method, data, {
header = config.HEADER; header = config.HEADER;
if(store.state.userInfo){ if(store.state.userInfo){
header.TOKEN = store.state.userInfo.token header.TOKEN = store.state.userInfo.token
} }else{
uni.redirectTo({
url:'/pages/Login/login'
})
}
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
@ -43,7 +47,7 @@ function baseRequest(url, method, data, {
return reject(); return reject();
} }
} else if (res.data.code == 0) { } else if (res.data.code == 0) {
if (res.data.msg != '无登录信息') { if (res.data.msg != '用户信息不存在') {
uni.showToast({ uni.showToast({
title: res.data.msg || '请检查网络', title: res.data.msg || '请检查网络',
icon: 'none', icon: 'none',