diff --git a/manifest.json b/manifest.json
index f30c55f..387a1b7 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name": "种植溯源",
"appid": "__UNI__D087881",
"description": "",
- "versionName": "1.0.3",
- "versionCode": 103,
+ "versionName": "1.0.4",
+ "versionCode": 104,
"transformPx": false,
/* 5+App特有相关 */
"app-plus": {
diff --git a/pages.json b/pages.json
index 16ea29d..2749beb 100644
--- a/pages.json
+++ b/pages.json
@@ -101,7 +101,7 @@
{
"path": "pages/live/live",
"style": {
- "navigationBarTitleText": "苗情檢察",
+ "navigationBarTitleText": "苗情监测",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#35D190",
"navigationBarTextStyle": "white",
diff --git a/pages/index/massif.vue b/pages/index/massif.vue
index 5f7749d..24f6f55 100644
--- a/pages/index/massif.vue
+++ b/pages/index/massif.vue
@@ -461,7 +461,7 @@
video_url.value = res.data.video_url
testUser()
videoCover.value = userInfo.value.video_cover || "/static/main/index/videoCover.png"
- uni.getStorageSync('SY_VIDEO_POSTS') || "/static/main/index/videoCover.png"
+ // uni.getStorageSync('SY_VIDEO_POSTS') || "/static/main/index/videoCover.png"
threshold = res.data?.monitor?.threshold || ""
if (Object.keys(res.data).length > 0) {
getlist3(res.data.id)
diff --git a/pages/landDetail/index.vue b/pages/landDetail/index.vue
index 53e4e16..d129778 100644
--- a/pages/landDetail/index.vue
+++ b/pages/landDetail/index.vue
@@ -12,8 +12,7 @@
-
+
{
typeID.value = option.id;
lindexist({
@@ -198,7 +198,8 @@
}).then(res => {
userInfo.value = res.data
videoUrl.value = res.data.video_url
- console.log(videoUrl.value, 25545)
+ videoCover.value = userInfo.value.video_cover || "/static/main/index/videoCover.png"
+ console.log(userInfo.value, 25545)
// console.log(userInfo.value)
})
diff --git a/pages/live/live.vue b/pages/live/live.vue
index 66d0580..3f3df74 100644
--- a/pages/live/live.vue
+++ b/pages/live/live.vue
@@ -5,8 +5,6 @@
:autoplay="true" :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'" :src="videoUrl"
id="video">
-
-
@@ -32,6 +30,10 @@
windowWidth: '',
deviceId: "",
shwovideo: false,
+ shwovideoTimer: "",
+ initFailTimer: "",
+ flag: true
+
}
},
@@ -39,8 +41,6 @@
this.deviceId = option.device
this.videoUrl = option.url
this.videoUrl = this.replaceLastThreeChars(this.videoUrl, "mp4");
-
- console.log(this.videoUrl)
this.subNvue = uni.getSubNVueById('subNvue'); //获取
this.subNvue.show() // 显示
let data = {
@@ -49,19 +49,44 @@
scene: 'app',
}
this.openScoket(data)
+ this.canplay(option.device)
this.platform = uni.getSystemInfoSync().platform
this.windowWidth = uni.getSystemInfoSync().screenWidth //获取屏幕宽度
this.boxStyle.width = this.windowWidth + 'px' //给宽度加px
this.wHeight = uni.getSystemInfoSync().screenHeight; //获取屏幕高度
this.boxStyle.height = this.wHeight; //改变视频高度
-
- setTimeout(() => {
- this.shwovideo = true
- console.log("showvideo")
- }, 2000)
+ this.initFailTimer = setTimeout(() => {
+ if (this.flag) {
+ uni.$u.toast("初始化失败,请重新进入")
+ setTimeout(() => {
+ uni.navigateBack()
+ }, 1000)
+ }
+ }, 60000)
},
methods: {
+ canplay(id) {
+ let that = this
+ this.shwovideoTimer = setInterval(() => {
+ uni.request({
+ url: `http://rtsp.lihaink.cn/index/api/getMediaInfo?secret=YwDtp2llj80HA19JhMXL4Po99nsMAyNT&schema=rtsp&vhost=__defaultVhost__&app=live&stream=lihai_lot_walnutpi_dev_${id}`, //仅为示例,并非真实接口地址。
+ success: (res) => {
+ console.log("res", res.data.code);
+ if (res.data.code == 0) {
+ that.shwovideo = true
+ clearInterval(this.shwovideoTimer)
+ }
+ },
+ fail: (err) => {
+ console.log(err, "err")
+ }
+ });
+
+ }, 2500)
+
+ },
+
replaceLastThreeChars(str, replacement) {
if (str.length < 3) {
return replacement + str;
@@ -90,9 +115,7 @@
// 接收图片的base64编码
receiveImg(data) {
this.imgSrc = (data.test)
-
console.log(this.imgSrc)
- console.log(this.deviceId)
videoCover({
device_id: this.deviceId,
image: this.imgSrc
@@ -115,19 +138,13 @@
url: 'wss://iot.lihaink.cn/test'
});
uni.onSocketOpen(function(res) {
- console.log("scoket打开")
-
uni.sendSocketMessage({
data: JSON.stringify(scoketData)
});
-
uni.onSocketMessage(function(res) {
console.log(res);
});
-
-
-
});
uni.onSocketError(function(res) {
console.log('WebSocket连接打开失败,请检查!');
@@ -138,8 +155,8 @@
},
playVedio() {
this.subNvue.hide()
+ this.flag = false
uni.createVideoContext('video', this).requestFullScreen();
-
setTimeout(() => {
this.setUrl(this.videoUrl)
}, 2000)
@@ -159,6 +176,8 @@
,
onUnload() {
uni.closeSocket();
+ clearTimeout(this.initFailTimer)
+ clearInterval(this.shwovideoTimer)
},
}
diff --git a/pages/live/live2.vue b/pages/live/live2.vue
new file mode 100644
index 0000000..1106c8c
--- /dev/null
+++ b/pages/live/live2.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ sdfsdf
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/live/loading.nvue b/pages/live/loading.nvue
index efe18ab..648d2a5 100644
--- a/pages/live/loading.nvue
+++ b/pages/live/loading.nvue
@@ -2,7 +2,7 @@
-
+
diff --git a/unpackage/dist/build/.nvue/app.js b/unpackage/dist/build/.nvue/app.js
index e21634e..d9d2ed4 100644
--- a/unpackage/dist/build/.nvue/app.js
+++ b/unpackage/dist/build/.nvue/app.js
@@ -1,7 +1,7 @@
-Promise.resolve("./pages/live/live.js").then((res) => {
+Promise.resolve("./pages/addLand/select_address_n.js").then((res) => {
res.length;
});
-Promise.resolve("./pages/addLand/select_address_n.js").then((res) => {
+Promise.resolve("./pages/live/loading.js").then((res) => {
res.length;
});
Promise.resolve("./app.css.js").then(() => {
diff --git a/unpackage/dist/build/app-plus/__uniappview.html b/unpackage/dist/build/app-plus/__uniappview.html
index 039a684..31fb8e7 100644
--- a/unpackage/dist/build/app-plus/__uniappview.html
+++ b/unpackage/dist/build/app-plus/__uniappview.html
@@ -17,7 +17,7 @@
-
+