页面修改
12
App.vue
|
@ -1,8 +1,20 @@
|
|||
<script>
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
// uni.connectSocket({
|
||||
// url: 'ws://60.204.152.17:8765'
|
||||
// });
|
||||
// uni.onSocketOpen(function(res) {
|
||||
// console.log('WebSocket连接已打开!');
|
||||
|
||||
// uni.sendSocketMessage({
|
||||
// data: "你好,靓仔2"
|
||||
// });
|
||||
|
||||
// });
|
||||
// uni.onSocketError(function(res) {
|
||||
// console.log('WebSocket连接打开失败,请检查!');
|
||||
// });
|
||||
|
||||
},
|
||||
onShow: function() {
|
||||
|
|
|
@ -33,18 +33,19 @@
|
|||
{{info.master_phone}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-li" v-if="isDetail" style="background-image: url('/static/main/index/pin_pai.png');">
|
||||
种植种类
|
||||
<view class="info-value">
|
||||
{{info.breed}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-li" v-if="isDetail" style="background-image: url('/static/main/index/dqzz.png');">
|
||||
种植品种
|
||||
<view class="info-value">
|
||||
{{info.kind}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-li" v-if="isDetail" style="background-image: url('/static/main/index/pin_pai.png');">
|
||||
种植品牌
|
||||
<view class="info-value">
|
||||
{{info.breed}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
let BASE_URL
|
||||
import store from "@/store/index.js"
|
||||
// 环境
|
||||
let env = "dev"
|
||||
// let env = "prod"
|
||||
// let env = "dev"
|
||||
let env = "prod"
|
||||
|
||||
|
||||
let HTTP_REQUEST_URL
|
||||
let HEADER
|
||||
if (env == 'dev') {
|
||||
BASE_URL = 'http://192.168.1.15:8082/'
|
||||
BASE_URL = 'http://ceshi-suyuan.lihaink.cn/'
|
||||
} else if (env = 'prod') {
|
||||
BASE_URL = 'https://suyuan.lihaink.cn/'
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
<script>
|
||||
console.log(mqtt)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
60
pages.json
|
@ -14,8 +14,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "地块",
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
}, {
|
||||
|
@ -40,8 +40,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "种植详情",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -49,8 +49,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "添加收获信息",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -58,8 +58,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "添加虫害防治信息",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -67,8 +67,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "添加灌溉信息",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -76,8 +76,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "添加除草信息",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -85,8 +85,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "添加施肥信息",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -94,8 +94,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "添加种植信息",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -104,8 +104,8 @@
|
|||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "苗情监测",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -114,8 +114,8 @@
|
|||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "苗情监测",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -123,8 +123,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "添加土地信息",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -132,8 +132,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "选择位置",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -150,16 +150,16 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "溯源结果",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/husbandryForm/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "操作详情",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -167,8 +167,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "密码修改",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#F4F4F4",
|
||||
"navigationBarTextStyle": "black"
|
||||
"navigationBarBackgroundColor": "#35D190",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
placeholder="请输入验证码" border="surround" v-model="formData.code"></u-input>
|
||||
|
||||
|
||||
<view class="get-code" :style="{color: countDown?'grey':''}" @click="getCode"><text
|
||||
<view class="get-code" :style="{color: countDown?'#ADADAD':''}" @click="getCode"><text
|
||||
class="lineY"></text>
|
||||
获取验证码 <text v-if='countDown'>{{countDown}}s</text> </view>
|
||||
</view>
|
||||
|
@ -196,10 +196,12 @@
|
|||
}
|
||||
|
||||
.input-card {
|
||||
width: 700rpx;
|
||||
width: 680rpx;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0.5rpx 0.5rpx 200rpx 0.5rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.card-head {
|
||||
background-color: #fff;
|
||||
|
@ -409,7 +411,7 @@
|
|||
account: "",
|
||||
password: "",
|
||||
code: '',
|
||||
scene: "1",
|
||||
scene: "2",
|
||||
terminal: ''
|
||||
|
||||
})
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
placeholder="请输入验证码" border="surround" v-model="formData.verify_code"></u-input>
|
||||
|
||||
|
||||
<view class="get-code" :style="{color: countDown?'grey':''}" @click="getCode"><text
|
||||
<view class="get-code" :style="{color: countDown?'#ADADAD':''}" @click="getCode"><text
|
||||
class="lineY"></text>
|
||||
获取验证码 <text v-if='countDown'>{{countDown}}s</text> </view>
|
||||
</view>
|
||||
|
|
|
@ -43,11 +43,15 @@
|
|||
suffix-icon-style="color: #b6b6b6;" border="none" v-model="county_name" readonly
|
||||
style="pointer-events: none;"></up-input>
|
||||
</up-form-item>
|
||||
<up-form-item label="土地详细地址" prop="town_code" style="position: relative;" borderBottom required>
|
||||
<up-input input-align="right" placeholder="请输入土地详细地址" suffixIcon="map"
|
||||
suffix-icon-style="color: #b6b6b6;" border="none" v-model="data.formData.address">
|
||||
<up-form-item label="土地详细地址" prop="town_code" style="position: relative;width: 93%;" borderBottom
|
||||
required>
|
||||
<up-input input-align="right" placeholder="请输入土地详细地址" style="width: 80%;" border="none"
|
||||
v-model="data.formData.address">
|
||||
</up-input>
|
||||
<view style="position: absolute;right: 0;width: 50rpx; height: 100%; " @click="location">
|
||||
<view style="position: absolute;right: -50rpx;width: 50rpx; height: 100%;" @click="location">
|
||||
<u--image src='/static/main/index/dw.png'
|
||||
style="position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);"
|
||||
width="25.06rpx" height="32rpx"></u--image>
|
||||
</view>
|
||||
</up-form-item>
|
||||
</view>
|
||||
|
@ -59,7 +63,7 @@
|
|||
<view class="code-img1">
|
||||
<view class="" v-if="pic.length>0"
|
||||
style="display: flex;flex-direction: row;flex-wrap: wrap;margin-bottom: 30rpx;">
|
||||
<view class="" v-for="(item,i) in pic" style="margin-right: 30rpx;">
|
||||
<view class="" v-for="(item,i) in pic" style="margin-right: 30rpx;" :key="i">
|
||||
<view class="">
|
||||
<u-icon name="close" size="15" style="margin-left:120.85rpx;"
|
||||
@click="delimg(i)"></u-icon>
|
||||
|
@ -72,8 +76,8 @@
|
|||
<view class="code-img">
|
||||
<view class="" @click="updateImgFn">
|
||||
<view class="carime-icon">
|
||||
<u-image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u-image>
|
||||
<view class="">
|
||||
<u-image src="/static/main/index/upload.png" width="82rpx" height="68rpx"></u-image>
|
||||
<view class="" style="font-weight: 500;margin-top: 20rpx;">
|
||||
点击上传图片
|
||||
</view>
|
||||
</view>
|
||||
|
@ -566,8 +570,10 @@
|
|||
|
||||
.code-img {
|
||||
background-color: #F4F4F4;
|
||||
height: 350.47rpx;
|
||||
height: 340.47rpx;
|
||||
position: relative;
|
||||
width: 680rpx;
|
||||
margin: 0 auto;
|
||||
|
||||
.carime-icon {
|
||||
position: absolute;
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
<view class="code-img" v-if="mode=='add'">
|
||||
<view class="" @click="updateImgFn">
|
||||
<view class="carime-icon">
|
||||
<u-image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u-image>
|
||||
<view class="">
|
||||
<u-image src="/static/main/index/upload.png" width="82rpx" height="68rpx"></u-image>
|
||||
<view class="" style="font-weight: 500;margin-top: 20rpx;">
|
||||
点击上传图片
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -72,8 +72,8 @@
|
|||
<view class="code-img" v-if="mode=='add'">
|
||||
<view class="" @click="updateImgFn">
|
||||
<view class="carime-icon">
|
||||
<u-image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u-image>
|
||||
<view class="">
|
||||
<u-image src="/static/main/index/upload.png" width="82rpx" height="68rpx"></u-image>
|
||||
<view class="" style="font-weight: 500;margin-top: 20rpx;">
|
||||
点击上传图片
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
<view class="code-img" v-if="mode=='add'">
|
||||
<view class="" @click="updateImgFn">
|
||||
<view class="carime-icon">
|
||||
<u-image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u-image>
|
||||
<view class="">
|
||||
<u-image src="/static/main/index/upload.png" width="82rpx" height="68rpx"></u-image>
|
||||
<view class="" style="font-weight: 500;margin-top: 20rpx;">
|
||||
点击上传图片
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -65,8 +65,8 @@
|
|||
<view class="code-img" v-if="mode=='add'">
|
||||
<view class="" @click="updateImgFn">
|
||||
<view class="carime-icon">
|
||||
<u-image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u-image>
|
||||
<view class="">
|
||||
<u-image src="/static/main/index/upload.png" width="82rpx" height="68rpx"></u-image>
|
||||
<view class="" style="font-weight: 500;margin-top: 20rpx;">
|
||||
点击上传图片
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
<view class="code-img">
|
||||
<view class="" @click="updateImgFn">
|
||||
<view class="carime-icon">
|
||||
<u-image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u-image>
|
||||
<view class="">
|
||||
<u-image src="/static/main/index/upload.png" width="82rpx" height="68rpx"></u-image>
|
||||
<view class="" style="font-weight: 500;margin-top: 20rpx;">
|
||||
点击上传图片
|
||||
</view>
|
||||
</view>
|
||||
|
@ -75,7 +75,7 @@
|
|||
@confirm="dateConfirmfn" :formatter="formatter" @cancel="show=false"></u-datetime-picker>
|
||||
</view>
|
||||
|
||||
<u-button class="btn" v-if="mode=='add'" @click="addFn">完成添加</u-button>
|
||||
<u-button class="btn" v-if="mode=='add'" style="font-size: 32rpx;" @click="addFn">添加</u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
|
@ -73,8 +73,8 @@
|
|||
<view class="code-img" v-if="mode=='add'">
|
||||
<view class="" @click="updateImgFn">
|
||||
<view class="carime-icon">
|
||||
<u-image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u-image>
|
||||
<view class="">
|
||||
<u-image src="/static/main/index/upload.png" width="82rpx" height="68rpx"></u-image>
|
||||
<view class="" style="font-weight: 500;margin-top: 20rpx;">
|
||||
点击上传图片
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -90,7 +90,8 @@
|
|||
苗情检测视频
|
||||
</view>
|
||||
<view class="" style="font-size: 20rpx;color: #ACACAC;display: flex;align-items: center;">
|
||||
<u-icon name="clock" style="margin-right: 5rpx;" color="#ACACAC"></u-icon>
|
||||
<!-- <u-icon name="clock" style="margin-right: 5rpx;" color="#ACACAC"></u-icon> -->
|
||||
<u--image :src="u('sj')" width='18rpx' height="18rpx" style="margin-right:5rpx"></u--image>
|
||||
刷新时间:{{getNowTimeFn()}}
|
||||
</view>
|
||||
|
||||
|
@ -122,7 +123,7 @@
|
|||
{{item.name}}
|
||||
</view>
|
||||
<view class="" :style=" {color: item.status==0?'#73DFB2':'red'}"
|
||||
style="font-size: 28rpx;margin-top: 10rpx;">
|
||||
style="font-size: 28rpx;margin-top: 10rpx;font-weight: bold;">
|
||||
{{ item.num?item.num+item.unit:'--' }}
|
||||
</view>
|
||||
<view class="" style="display: flex;color:red" v-if="item.status>0">
|
||||
|
@ -150,7 +151,7 @@
|
|||
{{item.name}}
|
||||
</view>
|
||||
<view class="" :style=" {color: item.status==0?'#73DFB2':'red'}"
|
||||
style="font-size: 28rpx;margin-top: 10rpx;">
|
||||
style="font-size: 28rpx;margin-top: 10rpx;font-weight: bold;">
|
||||
<text v-if="item.num==0">{{item.num+item.unit}}</text>
|
||||
<text v-else>{{ item.num?item.num+item.unit:'--' }}</text>
|
||||
</view>
|
||||
|
@ -289,7 +290,8 @@
|
|||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onHide
|
||||
onHide,
|
||||
onPullDownRefresh
|
||||
|
||||
} from "@dcloudio/uni-app"
|
||||
import Myindex from '@/components/return/index.vue';
|
||||
|
@ -392,7 +394,7 @@
|
|||
}
|
||||
})
|
||||
|
||||
|
||||
const userInfo = ref("")
|
||||
const dataobj = reactive({})
|
||||
const tdId = ref('')
|
||||
const palntId = ref('')
|
||||
|
@ -416,7 +418,7 @@
|
|||
}
|
||||
const goLive = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/live/live?url=' + video_url.value
|
||||
url: `/pages/live/live?url=${video_url.value }&user=${userInfo.value.master_phone}&device=${userInfo.value.device_id} `
|
||||
})
|
||||
}
|
||||
const show = ref(false)
|
||||
|
@ -454,14 +456,14 @@
|
|||
|
||||
}, {
|
||||
icon: "WD1",
|
||||
name: "温度",
|
||||
name: "环境温度",
|
||||
num: 0,
|
||||
unit: "℃",
|
||||
status: 0,
|
||||
|
||||
}, {
|
||||
icon: "SD",
|
||||
name: "湿度",
|
||||
name: "环境湿度",
|
||||
num: 0,
|
||||
unit: "%RH",
|
||||
status: 0,
|
||||
|
@ -506,6 +508,7 @@
|
|||
return `/static/main/index/${icon}.png`
|
||||
}
|
||||
const video_url = ref()
|
||||
let scoketData = ""
|
||||
//列表获取
|
||||
const getlist = () => {
|
||||
lindexist({
|
||||
|
@ -513,18 +516,12 @@
|
|||
}).then((res) => {
|
||||
|
||||
if (res.code == 1) {
|
||||
|
||||
|
||||
|
||||
|
||||
userInfo.value = res.data
|
||||
scoketData = {
|
||||
username: userInfo.value.master_phone,
|
||||
device: 'lihai_lot_walnutpi_dev_' + userInfo.value.device_id
|
||||
}
|
||||
video_url.value = res.data.video_url
|
||||
|
||||
// if (res.data.user_id == 23) {
|
||||
// video_url.value =
|
||||
// 'http://rtsp.lihaink.cn/live/lihai_lot_walnutpi_dev_4.live.mp4?secret=YwDtp2llj80HA19JhMXL4Po99nsMAyNT'
|
||||
// }
|
||||
// video_url=res.data.
|
||||
|
||||
threshold = res.data?.monitor?.threshold || ""
|
||||
if (Object.keys(res.data).length > 0) {
|
||||
getlist3(res.data.id)
|
||||
|
@ -594,6 +591,11 @@
|
|||
}).then((res) => {
|
||||
if (res.code == 1) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
tdId.value = res.data[0]?.id || ''
|
||||
getlist()
|
||||
if (res.data.length > 0) {
|
||||
|
@ -655,9 +657,6 @@
|
|||
showModal.value = false
|
||||
equipmentId.value = ''
|
||||
}
|
||||
|
||||
|
||||
|
||||
//绑定产品
|
||||
const biproduct = () => {
|
||||
if (equipmentId.value) {
|
||||
|
@ -737,6 +736,35 @@
|
|||
const u = (name) => {
|
||||
return `/static/main/index/${name}.png`
|
||||
}
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
uni.connectSocket({
|
||||
url: 'ws://60.204.152.17:8765'
|
||||
});
|
||||
uni.onSocketOpen(function(res) {
|
||||
console.log(scoketData);
|
||||
|
||||
uni.sendSocketMessage({
|
||||
data: JSON.stringify(scoketData)
|
||||
});
|
||||
|
||||
});
|
||||
uni.onSocketError(function(res) {
|
||||
console.log('WebSocket连接打开失败,请检查!');
|
||||
});
|
||||
uni.onSocketClose(function(res) {
|
||||
console.log('WebSocket 已关闭!');
|
||||
});
|
||||
|
||||
}, 5000)
|
||||
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
getlist1()
|
||||
getlist2()
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page {
|
||||
|
|
|
@ -27,8 +27,9 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="card" style="border-radius: 10rpx;">
|
||||
<view class="content" style="position: relative;">
|
||||
<view class="card"
|
||||
style="border-radius: 10rpx;position: absolute;left:50%;transform: translateX(-50%);top: -100rpx;">
|
||||
<view class="card-li" v-for="(item,index) in cardLiList" :key="index" @click="navto(item.nav)">
|
||||
<view class="" style="display: flex;align-items: center;">
|
||||
<view class="" style="margin-right: 20rpx;">
|
||||
|
@ -43,12 +44,10 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="out-btn">
|
||||
<up-button @click="loginOutFn" type="primary" customStyle="border:none;height:90rpx;border-radius: 500rpx;"
|
||||
color="#EC6857" text="退出登录" v-if="Object.keys(userinfo).length>0"></up-button>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="out-btn">
|
||||
<up-button @click="loginOutFn" type="primary" customStyle="border:none;height:90rpx;border-radius: 500rpx;"
|
||||
color="#EC6857" text="退出登录" v-if="Object.keys(userinfo).length>0"></up-button>
|
||||
</view>
|
||||
<MyTabbar></MyTabbar>
|
||||
</template>
|
||||
|
@ -136,19 +135,18 @@
|
|||
|
||||
.head {
|
||||
height: 25vh;
|
||||
background-color: $theme-main-color;
|
||||
color: white;
|
||||
padding-top: 30rpx;
|
||||
position: relative;
|
||||
border-radius: 0 0 50rpx 50rpx;
|
||||
// background-color: red;
|
||||
position: relative;
|
||||
background-image: url('/static/main/index/wo.png');
|
||||
background-size: 100% 100%;
|
||||
|
||||
.head-con {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
bottom: 100rpx // margin-top: 150rpx;
|
||||
bottom: 120rpx // margin-top: 150rpx;
|
||||
}
|
||||
|
||||
.head-li {
|
||||
|
@ -189,17 +187,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
.out-btn {
|
||||
width: 693.93rpx;
|
||||
|
||||
}
|
||||
|
||||
position: absolute;
|
||||
bottom: 100rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
// border-radius: 500rpx;
|
||||
// background-color: red;
|
||||
// margin: auto;
|
||||
}
|
||||
.out-btn {
|
||||
width: 693.93rpx;
|
||||
position: absolute;
|
||||
bottom: 140rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
</style>
|
|
@ -13,8 +13,7 @@
|
|||
</view>
|
||||
<view class="video" style="position: relative;">
|
||||
<u--image src="https://ceshi-worker-task.lihaink.cn/uploads/images/20231223/20231223092144475437017.png"
|
||||
width="100%" height="300rpx" @click="goLive" v-if="videoUrl"></u--image>
|
||||
<!-- <u--image src="/static/main/index/k.png" width="100%" height="510rpx" v-else></u--image> -->
|
||||
width="100%" height="500rpx" @click="goLive" v-if="videoUrl"></u--image>
|
||||
<u--image :src="u('K')" v-else width="100%" height="510rpx"></u--image>
|
||||
<view class=""
|
||||
style="width: 100%;height: 100%;background-color: rgba(0, 0, 0, .5);position: absolute;top: 1px;"
|
||||
|
@ -59,8 +58,8 @@
|
|||
width="200rpx" height="200rpx"></u--image>
|
||||
</view>
|
||||
|
||||
<u--image src="/static/main/index/xyj.png" class="next" width="38rpx"
|
||||
height="38rpx"></u--image>
|
||||
<u--image @click="navtoForm(item,i)" src="/static/main/index/xyj.png" class="next"
|
||||
width="38rpx" height="38rpx"></u--image>
|
||||
|
||||
<view class="right" style="color: #7B7B7B;" @click="navtoForm(item,i)">
|
||||
<view class="">
|
||||
|
@ -96,13 +95,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view class="coneng-detail" v-else>
|
||||
<view class="">
|
||||
<image src="@/static/img/zw.png" mode="aspectFit"></image>
|
||||
|
@ -111,12 +104,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
@ -125,6 +113,9 @@
|
|||
|
||||
<script setup>
|
||||
import landInfo from "@/components/plant/landInfo.vue"
|
||||
import {
|
||||
lindexist,
|
||||
} from '@/api/api.js'
|
||||
import {
|
||||
ref,
|
||||
reactive
|
||||
|
@ -143,7 +134,7 @@
|
|||
|
||||
const goLive = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/live/live?url=' + videoUrl.value
|
||||
url: `/pages/live/live?url=${videoUrl.value }&user=${userInfo.value.master_phone}&device=${userInfo.value.device_id} `
|
||||
})
|
||||
}
|
||||
const list = reactive([{
|
||||
|
@ -199,12 +190,25 @@
|
|||
route: "/pages/husbandryForm/harvest"
|
||||
}]
|
||||
]);
|
||||
|
||||
const userInfo = ref("")
|
||||
onLoad((option) => {
|
||||
typeID.value = option.id;
|
||||
lindexist({
|
||||
land_id: option.id
|
||||
}).then(res => {
|
||||
userInfo.value = res.data
|
||||
videoUrl.value = res.data.video_url
|
||||
console.log(videoUrl.value, 25545)
|
||||
// console.log(userInfo.value)
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
|
||||
// const goLive = () => {
|
||||
|
||||
// }
|
||||
|
||||
onShow(() => {
|
||||
|
||||
getlist();
|
||||
|
|
|
@ -1,19 +1,25 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<view :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;z-inde:-1;'">
|
||||
<view class="root">
|
||||
<video ref="videoPlayer"
|
||||
src="http://rtsp.lihaink.cn/live/lihai_lot_walnutpi_dev_2.live.flv?secret=ywdtp2llj80ha19jhmxl4po99nsmaynt"
|
||||
:object-fit="object_fit" :autoplay="true"
|
||||
:style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'" id="video"></video>
|
||||
|
||||
<u-loading-page :loading="loading" loading-text="视频加载中,请稍后..."></u-loading-page>
|
||||
|
||||
<view class="" :style="{opacity:loading?'0':'1'}">
|
||||
<view :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;z-inde:-1;'">
|
||||
<view class="root">
|
||||
<video ref="videoPlayer" @fullscreenchange='fullscreenchange' :src="url" :object-fit="object_fit"
|
||||
:autoplay="true" @play='playVedio'
|
||||
:style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'" id="video"></video>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
rtmpSources: [],
|
||||
currentIndex: 0,
|
||||
room: {},
|
||||
|
@ -24,7 +30,9 @@
|
|||
},
|
||||
object_fit: 'contain', //视频样式默认包含🌟
|
||||
windowWidth: '',
|
||||
url: ""
|
||||
url: "",
|
||||
flag: 0,
|
||||
option: ""
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -34,29 +42,24 @@
|
|||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
uni.$emit('push', {
|
||||
msg: '页面更新'
|
||||
})
|
||||
|
||||
this.option = option
|
||||
console.log(option)
|
||||
uni.request({
|
||||
url: 'http://192.168.1.27:8001/video/13433212473/lihai_lot_walnutpi_dev_3', //仅为示例,并非真实接口地址。
|
||||
url: `https://iot.lihaink.cn/start/video/${option.user}/lihai_lot_walnutpi_dev_${option.device}`, //仅为示例,并非真实接口地址。
|
||||
headers: {
|
||||
'Referrer-Policy': 'unsafe-url'
|
||||
},
|
||||
|
||||
success: (res) => {
|
||||
console.log(54545);
|
||||
// console.log(
|
||||
// `https://iot.lihaink.cn/video/${option.user}/lihai_lot_walnutpi_dev_${option.device}`
|
||||
// );
|
||||
console.log('res为:');
|
||||
console.log(res)
|
||||
// this.text = 'request success';
|
||||
}
|
||||
});
|
||||
// uni.request({
|
||||
// url: 'https://iot.lihaink.cn/push_stream',
|
||||
// data: {
|
||||
// text: 'uni.request'
|
||||
// },
|
||||
|
||||
// success: (res) => {
|
||||
// console.log(res.data);
|
||||
// this.text = 'request success';
|
||||
// }
|
||||
// });
|
||||
|
||||
this.url = option.url
|
||||
this.platform = uni.getSystemInfoSync().platform
|
||||
|
@ -68,27 +71,19 @@
|
|||
},
|
||||
onUnload() {
|
||||
|
||||
console.log("页面关闭")
|
||||
uni.request({
|
||||
url: `https://iot.lihaink.cn/stop/video/${this.option.user}/lihai_lot_walnutpi_dev_${this.option.device}`, //仅为示例,并非真实接口地址。
|
||||
success: (res) => {
|
||||
// console.log(
|
||||
// `https://iot.lihaink.cn/stop/video/${this.option.user}/lihai_lot_walnutpi_dev_${this.option.device}`
|
||||
// )
|
||||
console.log('res为:');
|
||||
console.log(res)
|
||||
// this.text = 'request success';
|
||||
}
|
||||
});
|
||||
|
||||
uni.$emit('close', {
|
||||
msg: '页面更新'
|
||||
})
|
||||
setTimeout(() => {
|
||||
// uni.request({
|
||||
// url: 'https://iot.lihaink.cn/close_stream', //仅为示例,并非真实接口地址。
|
||||
// data: {
|
||||
// text: 'uni.request'
|
||||
// },
|
||||
// success() {
|
||||
|
||||
// },
|
||||
// fail: (res) => {
|
||||
// console.log(res.data);
|
||||
// }
|
||||
|
||||
// });
|
||||
|
||||
}, )
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
@ -99,10 +94,17 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
|
||||
fullscreenchange() {
|
||||
this.flag += 1
|
||||
if (this.flag == 2) {
|
||||
uni.navigateBack()
|
||||
}
|
||||
console.log("推出")
|
||||
},
|
||||
playVedio() {
|
||||
uni.createVideoContext('video', this).requestFullScreen();
|
||||
screen.orientation.lock('landscape');
|
||||
loading = false
|
||||
},
|
||||
playCurrent() {
|
||||
console.log(this.$refs.videoPlayer)
|
||||
|
@ -142,5 +144,7 @@
|
|||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
// div{
|
||||
// opacity: ;
|
||||
// }
|
||||
</style>
|
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 454 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 151 KiB |
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 753 B |
Before Width: | Height: | Size: 892 B |
Before Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 618 B |
Before Width: | Height: | Size: 645 B |
Before Width: | Height: | Size: 779 B |
Before Width: | Height: | Size: 911 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 864 B |