|
@@ -4,7 +4,7 @@
|
|
|
<view class="dboxtitle"><image class="portimg" src="/static/images/new/start/port.png"/>
|
|
<view class="dboxtitle"><image class="portimg" src="/static/images/new/start/port.png"/>
|
|
|
<view class="dboxtitle-text"> {{ i18('设备端口') }}</view>
|
|
<view class="dboxtitle-text"> {{ i18('设备端口') }}</view>
|
|
|
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="dportitems">
|
|
<view class="dportitems">
|
|
@@ -53,19 +53,19 @@
|
|
|
|
|
|
|
|
<view class="dboxs dport" style="height: 100px" @click="planCharge">
|
|
<view class="dboxs dport" style="height: 100px" @click="planCharge">
|
|
|
<view class="dboxtitle"><image class="portimg" src="/static/images/new/start/clock.png"/>
|
|
<view class="dboxtitle"><image class="portimg" src="/static/images/new/start/clock.png"/>
|
|
|
- <view class="dboxtitle-text">{{ i18('预约充电') }}</view>
|
|
|
|
|
|
|
+ <view class="dboxtitle-text">{{ i18('预约充电') }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="port-text" v-if="planInfo != null" style="left:40px;top:48px;font-size: 14px">
|
|
<view class="port-text" v-if="planInfo != null" style="left:40px;top:48px;font-size: 14px">
|
|
|
- {{ i18('已预约') }} <view class="port-text" style="top:30px;">
|
|
|
|
|
|
|
+ {{ i18('已预约') }} <view class="port-text" style="top:30px;">
|
|
|
<text style="font-size: 10px">{{ planInfo.runTime }}</text>
|
|
<text style="font-size: 10px">{{ planInfo.runTime }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="port-text" style="left:40px;top:55px;font-size: 14px" v-else>
|
|
<view class="port-text" style="left:40px;top:55px;font-size: 14px" v-else>
|
|
|
- {{ i18('点击预约充电') }}
|
|
|
|
|
|
|
+ {{ i18('点击预约充电') }}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="port-num" style="left:40px;top:70px;font-size: 12px" v-if="portDetail.portStatus == 6">
|
|
<view class="port-num" style="left:40px;top:70px;font-size: 12px" v-if="portDetail.portStatus == 6">
|
|
|
- {{ i18('可点击取消预约') }}
|
|
|
|
|
|
|
+ {{ i18('可点击取消预约') }}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="port-icon" v-if="portDetail.portStatus !=6" style="width: 50px;height: 50px;right:10px;top:28%">
|
|
<view class="port-icon" v-if="portDetail.portStatus !=6" style="width: 50px;height: 50px;right:10px;top:28%">
|
|
|
<image class="btn-image" src="/static/images/new/start/clock.png" >
|
|
<image class="btn-image" src="/static/images/new/start/clock.png" >
|
|
@@ -117,13 +117,13 @@
|
|
|
<view>{{ i18('重置设备') }}</view>
|
|
<view>{{ i18('重置设备') }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
-<!-- <view class="control-btn">-->
|
|
|
|
|
-<!-- <image class="btn-image" :src="imgUrl+'/control/record.png'" >-->
|
|
|
|
|
-<!-- </image>-->
|
|
|
|
|
-<!-- <view>使用记录</view>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
|
|
+ <!-- <view class="control-btn">-->
|
|
|
|
|
+ <!-- <image class="btn-image" :src="imgUrl+'/control/record.png'" >-->
|
|
|
|
|
+ <!-- </image>-->
|
|
|
|
|
+ <!-- <view>使用记录</view>-->
|
|
|
|
|
+ <!-- </view>-->
|
|
|
</view>
|
|
</view>
|
|
|
- <u-picker @cancel="cancelPicker" @confirm="confirm" :show="showPlan" :columns="planCols" @change="changeHandler"></u-picker>
|
|
|
|
|
|
|
+ <u-picker ref="uPicker" @cancel="cancelPicker" @confirm="confirm" :show="showPlan" :columns="planCols" @change="changeHandler"></u-picker>
|
|
|
<u-modal :show="showPwd" :confirmText="i18('确认')" @confirm="inputPwd" @cancel="cancel" :showCancelButton="true" title="修改密码" >
|
|
<u-modal :show="showPwd" :confirmText="i18('确认')" @confirm="inputPwd" @cancel="cancel" :showCancelButton="true" title="修改密码" >
|
|
|
<view class="slot-content">
|
|
<view class="slot-content">
|
|
|
<view>
|
|
<view>
|
|
@@ -166,45 +166,45 @@ let isCheckRevHex = false
|
|
|
let isCheckSendHex = false
|
|
let isCheckSendHex = false
|
|
|
let sendData = ''
|
|
let sendData = ''
|
|
|
export default {
|
|
export default {
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- oldPwd:"",
|
|
|
|
|
- pwd:"",
|
|
|
|
|
- showPwd:false,
|
|
|
|
|
- planCols:[ ],
|
|
|
|
|
- columnData:[],
|
|
|
|
|
- showPlan:false,
|
|
|
|
|
- deviceInfo:{},
|
|
|
|
|
- visitTime:"",
|
|
|
|
|
- timer:null,
|
|
|
|
|
- showPort:false,
|
|
|
|
|
- portDetail:{portStatus:0,POWER:0,voltage:0},
|
|
|
|
|
- statusTimer:"",
|
|
|
|
|
- connected:false,
|
|
|
|
|
- scriptTask:null,
|
|
|
|
|
- choosePort:1,
|
|
|
|
|
- portList:[[{port:1,text:"端口一"}]],
|
|
|
|
|
- planInfo:null,
|
|
|
|
|
- days:["","周一","周二","周三","周四","周五","周六","周日"],
|
|
|
|
|
- textRevData: '',
|
|
|
|
|
- picker:null,
|
|
|
|
|
- firstInit:false,
|
|
|
|
|
- hasRight:false,
|
|
|
|
|
- startAutoCharge:true,
|
|
|
|
|
- curPort:[]
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- computed: {
|
|
|
|
|
- imgUrl() {
|
|
|
|
|
- return getApp().globalData.config.imgUrl;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- onLoad(opt) {
|
|
|
|
|
- this.deviceInfo.deviceId = opt.id;
|
|
|
|
|
- this.deviceInfo.ccid = opt.ccid;
|
|
|
|
|
- this.deviceInfo.qrcode = opt.qrcode;
|
|
|
|
|
- this.checkPassword();
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ oldPwd:"",
|
|
|
|
|
+ pwd:"",
|
|
|
|
|
+ showPwd:false,
|
|
|
|
|
+ planCols:[ ],
|
|
|
|
|
+ columnData:[],
|
|
|
|
|
+ showPlan:false,
|
|
|
|
|
+ deviceInfo:{},
|
|
|
|
|
+ visitTime:"",
|
|
|
|
|
+ timer:null,
|
|
|
|
|
+ showPort:false,
|
|
|
|
|
+ portDetail:{portStatus:0,POWER:0,voltage:0},
|
|
|
|
|
+ statusTimer:"",
|
|
|
|
|
+ connected:false,
|
|
|
|
|
+ scriptTask:null,
|
|
|
|
|
+ choosePort:1,
|
|
|
|
|
+ portList:[[{port:1,text:"端口一"}]],
|
|
|
|
|
+ planInfo:null,
|
|
|
|
|
+ days:["","周一","周二","周三","周四","周五","周六","周日"],
|
|
|
|
|
+ textRevData: '',
|
|
|
|
|
+ picker:null,
|
|
|
|
|
+ firstInit:false,
|
|
|
|
|
+ hasRight:false,
|
|
|
|
|
+ startAutoCharge:true,
|
|
|
|
|
+ curPort:[]
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ imgUrl() {
|
|
|
|
|
+ return getApp().globalData.config.imgUrl;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoad(opt) {
|
|
|
|
|
+ this.deviceInfo.deviceId = opt.id;
|
|
|
|
|
+ this.deviceInfo.ccid = opt.ccid;
|
|
|
|
|
+ this.deviceInfo.qrcode = opt.qrcode;
|
|
|
|
|
+ this.checkPassword();
|
|
|
|
|
+ },
|
|
|
onShow(){
|
|
onShow(){
|
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
|
title: this.$t('page.control')
|
|
title: this.$t('page.control')
|
|
@@ -213,7 +213,7 @@ export default {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
onUnload (){
|
|
onUnload (){
|
|
|
- this.closeSocket();
|
|
|
|
|
|
|
+ this.closeSocket();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
restart(){
|
|
restart(){
|
|
@@ -224,23 +224,23 @@ export default {
|
|
|
self.getInfo();
|
|
self.getInfo();
|
|
|
},5000)
|
|
},5000)
|
|
|
})
|
|
})
|
|
|
- setTimeout(function (){
|
|
|
|
|
- self.$modal.loading("正在重置,请稍等...");
|
|
|
|
|
- },1000);
|
|
|
|
|
|
|
+ setTimeout(function (){
|
|
|
|
|
+ self.$modal.loading("正在重置,请稍等...");
|
|
|
|
|
+ },1000);
|
|
|
},
|
|
},
|
|
|
i18(text){
|
|
i18(text){
|
|
|
return i18(text)
|
|
return i18(text)
|
|
|
},
|
|
},
|
|
|
- selectPort(id){
|
|
|
|
|
- this.choosePort = id;
|
|
|
|
|
- console.log(this.choosePort)
|
|
|
|
|
- this.getInfo()
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ selectPort(id){
|
|
|
|
|
+ this.choosePort = id;
|
|
|
|
|
+ console.log(this.choosePort)
|
|
|
|
|
+ this.getInfo();
|
|
|
|
|
+ },
|
|
|
cancel(){
|
|
cancel(){
|
|
|
this.showPwd = false;
|
|
this.showPwd = false;
|
|
|
},
|
|
},
|
|
|
modifyPwd(){
|
|
modifyPwd(){
|
|
|
- this.showPwd = true;
|
|
|
|
|
|
|
+ this.showPwd = true;
|
|
|
},
|
|
},
|
|
|
inputPwd(){
|
|
inputPwd(){
|
|
|
let rightPwd = uni.getStorageSync("pwd");
|
|
let rightPwd = uni.getStorageSync("pwd");
|
|
@@ -252,16 +252,20 @@ export default {
|
|
|
this.$modal.showToast("原密码不对");
|
|
this.$modal.showToast("原密码不对");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(!this.pwd){
|
|
|
|
|
- this.$modal.showToast("密码不能为空");
|
|
|
|
|
- }else {
|
|
|
|
|
- setPwd(this.pwd);
|
|
|
|
|
- this.$modal.showToast("密码修改成功");
|
|
|
|
|
- this.goBack();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if(!this.pwd){
|
|
|
|
|
+ this.$modal.showToast("密码不能为空");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ setPwd(this.pwd);
|
|
|
|
|
+ this.$modal.showToast("密码修改成功");
|
|
|
|
|
+ this.goBack();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
confirm(e) {
|
|
confirm(e) {
|
|
|
|
|
+ if(this.portDetail.portStatus == 7){
|
|
|
|
|
+ this.$modal.showToast("当前无法预约。请再次插枪后操作");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
let value = e.value;
|
|
let value = e.value;
|
|
|
console.log('confirm', value)
|
|
console.log('confirm', value)
|
|
|
let day = value[0];
|
|
let day = value[0];
|
|
@@ -461,10 +465,10 @@ export default {
|
|
|
if(data != null){
|
|
if(data != null){
|
|
|
let planType = data.planType;
|
|
let planType = data.planType;
|
|
|
if(planType == 1){//单次预约
|
|
if(planType == 1){//单次预约
|
|
|
- let planInfo = {};
|
|
|
|
|
- planInfo.runTime = data.runTime;
|
|
|
|
|
- this.planInfo = planInfo;
|
|
|
|
|
- this.planInfo.id = data.id;
|
|
|
|
|
|
|
+ let planInfo = {};
|
|
|
|
|
+ planInfo.runTime = data.runTime;
|
|
|
|
|
+ this.planInfo = planInfo;
|
|
|
|
|
+ this.planInfo.id = data.id;
|
|
|
}else{
|
|
}else{
|
|
|
let planInfo = {};
|
|
let planInfo = {};
|
|
|
planInfo.runTime = data.runTime;
|
|
planInfo.runTime = data.runTime;
|
|
@@ -472,10 +476,10 @@ export default {
|
|
|
let days = repeatDays.split(",")
|
|
let days = repeatDays.split(",")
|
|
|
let strs = "";
|
|
let strs = "";
|
|
|
for (let i = 0; i < days.length; i++) {
|
|
for (let i = 0; i < days.length; i++) {
|
|
|
- if(strs.length>0){
|
|
|
|
|
- strs+=",";
|
|
|
|
|
- }
|
|
|
|
|
- strs +=this.days[days[i]];
|
|
|
|
|
|
|
+ if(strs.length>0){
|
|
|
|
|
+ strs+=",";
|
|
|
|
|
+ }
|
|
|
|
|
+ strs +=this.days[days[i]];
|
|
|
}
|
|
}
|
|
|
this.planInfo = planInfo;
|
|
this.planInfo = planInfo;
|
|
|
this.planInfo.runTime = strs+" "+data.repeatTime;
|
|
this.planInfo.runTime = strs+" "+data.repeatTime;
|
|
@@ -527,7 +531,7 @@ export default {
|
|
|
let portStatus = this.portDetail.portStatus;
|
|
let portStatus = this.portDetail.portStatus;
|
|
|
if(portStatus == 2){//需要停止充电
|
|
if(portStatus == 2){//需要停止充电
|
|
|
this.$modal.confirm("需要停止充电么?").then(res=>{
|
|
this.$modal.confirm("需要停止充电么?").then(res=>{
|
|
|
- this.stopCharge();
|
|
|
|
|
|
|
+ this.stopCharge();
|
|
|
})
|
|
})
|
|
|
}else{
|
|
}else{
|
|
|
if(portStatus == 1){
|
|
if(portStatus == 1){
|
|
@@ -543,27 +547,27 @@ export default {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- getInfo(flag) {
|
|
|
|
|
|
|
+ getInfo(flag) {
|
|
|
|
|
|
|
|
// let str = "AA 67 0D 01 00 00 00 00 00 00 00 00 00 25 E2 00 80";
|
|
// let str = "AA 67 0D 01 00 00 00 00 00 00 00 00 00 25 E2 00 80";
|
|
|
// let data = parseDataObj(str);
|
|
// let data = parseDataObj(str);
|
|
|
// this.messageCallback(data);
|
|
// this.messageCallback(data);
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- this.$modal.loading("正在获取状态,请稍等...");
|
|
|
|
|
- if(flag){
|
|
|
|
|
|
|
+ //
|
|
|
|
|
+ //
|
|
|
|
|
+ this.$modal.loading("正在获取状态,请稍等...");
|
|
|
|
|
+ if(flag){
|
|
|
setTimeout(function (){
|
|
setTimeout(function (){
|
|
|
sendPortDetailCmd().then(res => {
|
|
sendPortDetailCmd().then(res => {
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
},500)
|
|
},500)
|
|
|
- }else{
|
|
|
|
|
- sendPortDetailCmd().then(res => {
|
|
|
|
|
|
|
+ }else{
|
|
|
|
|
+ sendPortDetailCmd().then(res => {
|
|
|
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ },
|
|
|
stopCharge(){
|
|
stopCharge(){
|
|
|
let self = this;
|
|
let self = this;
|
|
|
this.deviceInfo.port = this.choosePort;
|
|
this.deviceInfo.port = this.choosePort;
|
|
@@ -588,17 +592,17 @@ export default {
|
|
|
this.startPortDetailTimer();
|
|
this.startPortDetailTimer();
|
|
|
},
|
|
},
|
|
|
startPortDetailTimer(){
|
|
startPortDetailTimer(){
|
|
|
- let self = this;
|
|
|
|
|
|
|
+ let self = this;
|
|
|
this.timer = setTimeout(function (){
|
|
this.timer = setTimeout(function (){
|
|
|
getPortDetail(self.deviceInfo,self.visitTime).then(res=>{
|
|
getPortDetail(self.deviceInfo,self.visitTime).then(res=>{
|
|
|
- let data = res.data;
|
|
|
|
|
- if(data != null){
|
|
|
|
|
- self.portDetail = data;
|
|
|
|
|
- self.checkStatusCheck();
|
|
|
|
|
- self.$modal.closeLoading();
|
|
|
|
|
- }else{
|
|
|
|
|
- self.startPortDetailTimer();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ let data = res.data;
|
|
|
|
|
+ if(data != null){
|
|
|
|
|
+ self.portDetail = data;
|
|
|
|
|
+ self.checkStatusCheck();
|
|
|
|
|
+ self.$modal.closeLoading();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ self.startPortDetailTimer();
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
},1000);
|
|
},1000);
|
|
|
},
|
|
},
|
|
@@ -625,9 +629,9 @@ export default {
|
|
|
statusChangeTimer(){
|
|
statusChangeTimer(){
|
|
|
let self = this;
|
|
let self = this;
|
|
|
this.statusTimer = setTimeout(function(){
|
|
this.statusTimer = setTimeout(function(){
|
|
|
- if(!this.checkOnPage()){
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if(!this.checkOnPage()){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
checkStatusChange(self.deviceInfo,self.visitTime).then(res=>{
|
|
checkStatusChange(self.deviceInfo,self.visitTime).then(res=>{
|
|
|
let data = res.data;
|
|
let data = res.data;
|
|
|
if(data != null){
|
|
if(data != null){
|
|
@@ -820,7 +824,7 @@ export default {
|
|
|
width: 90%;
|
|
width: 90%;
|
|
|
}
|
|
}
|
|
|
.body-bottom{
|
|
.body-bottom{
|
|
|
-padding:0 22px;
|
|
|
|
|
|
|
+ padding:0 22px;
|
|
|
}
|
|
}
|
|
|
.body-bottom .info-content{
|
|
.body-bottom .info-content{
|
|
|
width: 30%;
|
|
width: 30%;
|