|
@@ -6,12 +6,16 @@
|
|
<u-cell-group :border="false" >
|
|
<u-cell-group :border="false" >
|
|
<u-cell
|
|
<u-cell
|
|
@click="showPopup('popupLane')"
|
|
@click="showPopup('popupLane')"
|
|
- :title="currentLane.name"
|
|
|
|
value="切换"
|
|
value="切换"
|
|
center
|
|
center
|
|
:isLink="true"
|
|
:isLink="true"
|
|
arrowDirection="down"
|
|
arrowDirection="down"
|
|
- ></u-cell>
|
|
|
|
|
|
+ >
|
|
|
|
+ <span slot="title" class="lane-line">
|
|
|
|
+ {{currentLane.name}}
|
|
|
|
+ <span :class="isConnect?'status_1':'status_0'"></span>
|
|
|
|
+ </span>
|
|
|
|
+ </u-cell>
|
|
</u-cell-group>
|
|
</u-cell-group>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -100,6 +104,7 @@
|
|
name:'',
|
|
name:'',
|
|
id:''
|
|
id:''
|
|
},
|
|
},
|
|
|
|
+ isConnect:false,
|
|
laneOption:[],
|
|
laneOption:[],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -124,6 +129,7 @@
|
|
//连接车道ws
|
|
//连接车道ws
|
|
connectSocket(){
|
|
connectSocket(){
|
|
console.log(this.wsUrl);
|
|
console.log(this.wsUrl);
|
|
|
|
+ this.isConnect = false
|
|
if(!this.wsUrl) return
|
|
if(!this.wsUrl) return
|
|
if(this.ws){
|
|
if(this.ws){
|
|
this.ws.close(); // 组件销毁前关闭连接
|
|
this.ws.close(); // 组件销毁前关闭连接
|
|
@@ -133,6 +139,7 @@
|
|
|
|
|
|
// 监听连接成功
|
|
// 监听连接成功
|
|
this.ws.onopen = () => {
|
|
this.ws.onopen = () => {
|
|
|
|
+ this.isConnect = true
|
|
console.log('WebSocket 连接已建立');
|
|
console.log('WebSocket 连接已建立');
|
|
};
|
|
};
|
|
|
|
|
|
@@ -198,7 +205,6 @@
|
|
//车道确定
|
|
//车道确定
|
|
onConfirm(value) {
|
|
onConfirm(value) {
|
|
console.log(value);
|
|
console.log(value);
|
|
-
|
|
|
|
if (value.value && value.value !== this.currentLane.id) {
|
|
if (value.value && value.value !== this.currentLane.id) {
|
|
this.currentLane.name = value.text
|
|
this.currentLane.name = value.text
|
|
this.currentLane.id = value.value
|
|
this.currentLane.id = value.value
|
|
@@ -343,4 +349,21 @@
|
|
color: #409eff;
|
|
color: #409eff;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
|
|
+.lane-line{
|
|
|
|
+ display: flex;
|
|
|
|
+ gap: 20rpx;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+.status_1{
|
|
|
|
+ width: 32rpx;
|
|
|
|
+ height: 32rpx;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background: #19be6b;
|
|
|
|
+}
|
|
|
|
+.status_0{
|
|
|
|
+ width: 32rpx;
|
|
|
|
+ height: 32rpx;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background: #fa3534;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|