|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
<view class="nv-work">
|
|
|
+ <view style="position: fixed;z-index: 99;">
|
|
|
<image class="banner" src="../../static/bg.png"></image>
|
|
|
<picker class="selectTap" mode="selector" :value="pickeIndex" range-key="robotName" :range="robotList"
|
|
|
@change="changePicker">
|
|
@@ -19,32 +20,53 @@
|
|
|
<view :class="[{secHeight:isSelect}]" :style="{height:heiIndex}" class="selcontent">
|
|
|
<view class="vv">
|
|
|
<view class="v1" v-for="(item,index) in robotList" :key="index" @click="changePicker(index)">
|
|
|
- <text class="vt1">{{item.robotName}}</text>
|
|
|
- </view>
|
|
|
+ <text class="vt1">{{item.robotName}}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
</view> -->
|
|
|
+
|
|
|
<view class="nv-header-list">
|
|
|
<view class="h-l-li">
|
|
|
- <text class="icon iconfont icon-zhukongtongxin"
|
|
|
- :style="{color:robotStatus.wifiCom == 1?'#23E274':'#FB4925'}"></text>
|
|
|
- <text class="h-l-li-t">通讯状态</text>
|
|
|
+ <text class="icon iconfont icon-jizhan-copy-copy-copy"
|
|
|
+ :style="{color:robotStatus.wifiCom == 1?'#23E274':'#ffffff'}"></text>
|
|
|
+ <text v-if="robotStatus.wifiCom == 1" class="h-l-li-t">在线</text>
|
|
|
+ <text v-if="robotStatus.wifiCom != 1" class="h-l-li-t">离线</text>
|
|
|
</view>
|
|
|
- <view class="h-l-li">
|
|
|
- <text class="icon iconfont icon-80dianliang"
|
|
|
- :style="{color:robotStatus.cap && robotStatus.cap >50 ?'#23E274':'#FB4925'}"></text>
|
|
|
+ <view class="h-l-li" v-if="robotStatus.wifiCom == 1">
|
|
|
+ <text class="icon iconfont icon-dianchi-gaodianliang"
|
|
|
+ :style="{color:robotStatus.cap && robotStatus.cap >50 ?'#23E274':'#E8A71C'}"></text>
|
|
|
<text class="h-l-li-t">电量{{robotStatus.cap}}%</text>
|
|
|
</view>
|
|
|
- <view class="h-l-li">
|
|
|
- <text class="icon iconfont icon-line-batterychargechongdianzhuangtai-01"
|
|
|
- :style="{color:!robotStatus.chargingtfStatus?'#FB4925':' #23E274'}"></text>
|
|
|
- <text class="h-l-li-t">充电状态</text>
|
|
|
+ <view class="h-l-li" v-if="robotStatus.wifiCom != 1">
|
|
|
+ <text class="icon iconfont icon-dianchi-gaodianliang"
|
|
|
+ style="color:#ffffff"></text>
|
|
|
+ <text class="h-l-li-t">电量未知</text>
|
|
|
+ </view>
|
|
|
+ <view class="h-l-li" v-if="robotStatus.wifiCom == 1">
|
|
|
+ <text class="icon iconfont icon-weichongdian"
|
|
|
+ style="color:#ffffff" v-if="!robotStatus.chargingtfStatus"></text>
|
|
|
+ <text class="icon iconfont icon-dianchi-chongdian"
|
|
|
+ style="color:#23E274" v-if="robotStatus.chargingtfStatus"></text>
|
|
|
+ <text class="h-l-li-t" v-if="robotStatus.chargingtfStatus">正在充电</text>
|
|
|
+ <text class="h-l-li-t" v-if="!robotStatus.chargingtfStatus">未充电</text>
|
|
|
</view>
|
|
|
- <view class="h-l-li">
|
|
|
- <text class="icon iconfont icon-guzhang"
|
|
|
+ <view class="h-l-li" v-if="robotStatus.wifiCom != 1">
|
|
|
+ <text class="icon iconfont icon-dianchi-chongdian"
|
|
|
+ style="color:#ffffff"></text>
|
|
|
+ <text class="h-l-li-t">充电未知</text>
|
|
|
+ </view>
|
|
|
+ <view class="h-l-li" v-if="robotStatus.wifiCom == 1">
|
|
|
+ <text class="icon iconfont icon-luzhang"
|
|
|
:style="{color:robotStatus.openRadarStatus == false?'#23E274':'#FB4925'}"></text>
|
|
|
- <text class="h-l-li-t">有无障碍</text>
|
|
|
+ <text v-if="robotStatus.openRadarStatus" class="h-l-li-t">有障碍</text>
|
|
|
+ <text v-if="!robotStatus.openRadarStatus" class="h-l-li-t">无障碍</text>
|
|
|
</view>
|
|
|
+ <view class="h-l-li" v-if="robotStatus.wifiCom != 1">
|
|
|
+ <text class="icon iconfont icon-luzhang"
|
|
|
+ style="color:#ffffff"></text>
|
|
|
+ <text class="h-l-li-t">障碍未知</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="nv-top" elevation="3px">
|
|
|
<view class="left bg1">
|
|
@@ -68,7 +90,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+ </view>
|
|
|
+ <view class="nv-list-box">
|
|
|
+ <scroll-view class='left' scroll-y @scrolltolower="scroll" style="height: calc(100vh - 360rpx);">
|
|
|
<view class="nv-list" elevation="3px" v-for="(item,index) in taskList" :key="index"
|
|
|
:style="{marginTop:index== 0 ? '80rpx' :'0'}">
|
|
|
|
|
@@ -171,6 +195,14 @@
|
|
|
<view></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ <uni-popup ref="popup" :mask-click="false">
|
|
|
+ <view style="background: #ffffff;">
|
|
|
+ <text style="padding: 40rpx;padding-top: 60rpx;padding-bottom: 60rpx;font-size: 22rpx;color: #666666;display: block;">无数据,请先关注机器人</text>
|
|
|
+ <button type="primary" size="mini" @click="confirmGo" style="color: #ffffff;background: #0581FD;border: none;border-radius: 0;display: block;">去关注</button>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -218,9 +250,15 @@
|
|
|
url:'/pages/webview/homeSelect'
|
|
|
})
|
|
|
},
|
|
|
- onLoad() {
|
|
|
+ onReady(){
|
|
|
this.getRobot()
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ // console.log("______________________________+++++++++++_____________________")
|
|
|
+
|
|
|
+ uni.$off('HpopLog1');
|
|
|
uni.$on('HpopLog1', (data) => {
|
|
|
+
|
|
|
addTask({
|
|
|
robotId: this.robotData.robotId
|
|
|
}).then(res => {
|
|
@@ -233,15 +271,16 @@
|
|
|
}).catch(e => {
|
|
|
console.log(e)
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
- uni.$on("backhome", () => {
|
|
|
+ uni.$off('backhome');
|
|
|
+ uni.$on("backhome", () => {console.log("plan++++++++++++++++++++++++")
|
|
|
this.onOff = false
|
|
|
this.loading = true
|
|
|
this.noData = false
|
|
|
this.getRobot()
|
|
|
})
|
|
|
- },
|
|
|
+ },
|
|
|
async onPullDownRefresh() {
|
|
|
this.onOff = false
|
|
|
this.loading = true
|
|
@@ -267,7 +306,20 @@
|
|
|
]),
|
|
|
},
|
|
|
methods: {
|
|
|
- showSelect() {
|
|
|
+ scroll(){
|
|
|
+ if (this.onOff) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ ++this.pageIndex
|
|
|
+ this.currentTask()
|
|
|
+ },
|
|
|
+ confirmGo(value) {
|
|
|
+ this.$refs.popup.close()
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pages/native/robot'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showSelect() {
|
|
|
let index = this.robotList.length * 70 +60
|
|
|
this.isSelect ? this.heiIndex = `0rpx` :this.heiIndex = `${index}rpx`
|
|
|
this.isSelect = !this.isSelect
|
|
@@ -284,7 +336,7 @@
|
|
|
},
|
|
|
openDialog() {
|
|
|
uni.navigateTo({
|
|
|
- url:'/pages/webview/popupHome',
|
|
|
+ url:'/pages/webview/popupTask',
|
|
|
})
|
|
|
},
|
|
|
async getRobot() {
|
|
@@ -294,15 +346,24 @@
|
|
|
this.robotList = res.filter(item => {
|
|
|
return item.followed == 1
|
|
|
}) || []
|
|
|
- this.robotName = this.robotList[0].robotName
|
|
|
- this.robotData = this.robotList[0]
|
|
|
- this.getRobotStauts()
|
|
|
- this.currentTask()
|
|
|
+ if(this.robotList.length >0){
|
|
|
+ this.robotName = this.robotList[0].robotName
|
|
|
+ this.robotData = this.robotList[0]
|
|
|
+ this.getRobotStauts()
|
|
|
+ this.currentTask()
|
|
|
+ this.$refs.popup.close()
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.robotName = null
|
|
|
+ this.robotData = {}
|
|
|
+ this.robotStatus = {}
|
|
|
+ this.$refs.popup.open()
|
|
|
+ }
|
|
|
},
|
|
|
taskStatus(type) {
|
|
|
switch (type) {
|
|
|
case 0:
|
|
|
- return '待执行'
|
|
|
+ return '等待中'
|
|
|
case 1:
|
|
|
return '正在执行'
|
|
|
case 2:
|
|
@@ -312,18 +373,20 @@
|
|
|
case 4:
|
|
|
return '已超期'
|
|
|
case 5:
|
|
|
- return '已暂停'
|
|
|
+ return '暂停中'
|
|
|
}
|
|
|
},
|
|
|
changeType(item) {
|
|
|
item.show = item.show == undefined ? false : !item.show
|
|
|
},
|
|
|
changePicker(e) {
|
|
|
+ // console.log(e)
|
|
|
this.heiIndex = `0rpx`
|
|
|
- this.isSelect = false
|
|
|
+ this.isSelect = false
|
|
|
let data = this.robotList[e.target.value]
|
|
|
-
|
|
|
- this.loading = true
|
|
|
+ // console.log(data.robotId)
|
|
|
+
|
|
|
+ this.loading = true
|
|
|
this.pickeIndex = e.target.value
|
|
|
this.robotData = data
|
|
|
this.robotName = data.robotName
|
|
@@ -347,22 +410,32 @@
|
|
|
if (res.length < 10) this.onOff = true
|
|
|
if (this.taskList.length == 0) {
|
|
|
this.noData = true, this.onOff = false
|
|
|
+ }else{
|
|
|
+ this.noData = false
|
|
|
+ this.onOff = false
|
|
|
}
|
|
|
this.loading = false
|
|
|
}).catch(e => {
|
|
|
this.loading = false
|
|
|
- this.noData = true
|
|
|
- this.onOff = false
|
|
|
+ if (this.taskList.length == 0) {
|
|
|
+ this.noData = true, this.onOff = false
|
|
|
+ }else{
|
|
|
+ this.noData = false
|
|
|
+ this.onOff = true
|
|
|
+ }
|
|
|
console.log(e)
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
getRobotStauts() {
|
|
|
getRobotStauts({
|
|
|
robotId: this.robotData.robotId
|
|
|
}).then(res => {
|
|
|
+ console.log(res)
|
|
|
this.robotStatus = res
|
|
|
}).catch(e => {
|
|
|
console.log(e)
|
|
|
+ this.robotStatus = {}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -534,30 +607,30 @@
|
|
|
top: 80rpx;
|
|
|
left: 20rpx;
|
|
|
right: 20rpx;
|
|
|
-
|
|
|
- z-index: 9999999999;
|
|
|
+
|
|
|
+ z-index: 9999999999;
|
|
|
display: block;
|
|
|
- overflow: scroll;
|
|
|
+ overflow: scroll;
|
|
|
background-color: #46A0F9;
|
|
|
height: 0;
|
|
|
- border-radius: 15rpx;
|
|
|
+ border-radius: 15rpx;
|
|
|
border-bottom-right-radius: 15rpx;
|
|
|
.vv{
|
|
|
padding: 30rpx 0;
|
|
|
align-items: center;
|
|
|
text-align: center;
|
|
|
-
|
|
|
- width: 100%;
|
|
|
+
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
- .v1 {
|
|
|
- padding: 13rpx;
|
|
|
+ .v1 {
|
|
|
+ padding: 13rpx;
|
|
|
display: block;
|
|
|
.vt1 {
|
|
|
display: block;
|
|
|
color: #fff;
|
|
|
- font-size:30rpx;
|
|
|
+ font-size:30rpx;
|
|
|
}
|
|
|
- .active{
|
|
|
+ .active{
|
|
|
color: #46A0F9;
|
|
|
}
|
|
|
}
|
|
@@ -582,7 +655,14 @@
|
|
|
padding: 0 10rpx 0 5rpx;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ .nv-list-box{
|
|
|
+ position: absolute;
|
|
|
+ width: calc(100% - 4rpx);
|
|
|
+ height: calc(100% - 360rpx);
|
|
|
+ overflow: auto;
|
|
|
+ top: 400rpx;
|
|
|
+ z-index: 1;
|
|
|
+ }
|
|
|
.nv-list {
|
|
|
position: relative;
|
|
|
overflow: hidden;
|