This commit is contained in:
Sliverber 2024-06-03 21:04:26 +08:00
parent 00cb6ab410
commit c4bd835fff
6 changed files with 141 additions and 42 deletions

View File

@ -116,7 +116,7 @@
设备位置
</view>
<view class="info_li_right">
嵛山岛芦竹村三沙路68号
{{info.address}}
</view>
<image src="https://lxnapi.ccttiot.com/bike/img/static/uklW7KIegcLR6E7DTOGO" mode=""></image>
</view>
@ -225,20 +225,20 @@
</view>
<view class="bot_btn">
<view class="btn">
<view class="bot_btn" v-if="info.status!=4">
<view class="btn" @click="btn(0)">
开锁
</view>
<view class="btn">
<view class="btn" @click="btn(1)">
关锁
</view>
<view class="btn">
<view class="btn" @click="btn(2)">
车辆禁用
</view>
<view class="btn">
<view class="btn" @click="btn(3)">
车辆解禁
</view>
<view class="btn">
<view class="btn" @click="btn(4)">
响铃寻车
</view>
<view class="btn" @click="tipshow=true" v-if="info.type==1">
@ -296,7 +296,7 @@
bgc: {
backgroundColor: "#fff",
},
curtitidx:1,
curtitidx:0,
latitude: 0,
longitude: 0,
info:'',
@ -334,6 +334,51 @@
}
},
methods: {
btn(num){
if(num==0){
this.$u.post('/appVerify/admin/unlocking?sn='+this.info.sn).then((res) => {
if (res.code === 200) {
// 线
this.deviceInfo()
}
}).catch(error => {
console.error("Error fetching area data:", error);
});
}else if(num==1){
this.$u.post('/appVerify/admin/lock?sn='+this.info.sn).then((res) => {
if (res.code === 200) {
// 线
this.deviceInfo()
}
}).catch(error => {
console.error("Error fetching area data:", error);
});
}else if(num==2){
this.$u.post('/appVerify/device/offline?sn='+this.info.sn).then((res) => {
if (res.code === 200) {
// 线
this.deviceInfo()
}
}).catch(error => {
console.error("Error fetching area data:", error);
});
}else if(num==3){
this.$u.post('/appVerify/device/online?sn='+this.info.sn).then((res) => {
if (res.code === 200) {
// 线
this.deviceInfo()
}
}).catch(error => {
console.error("Error fetching area data:", error);
});
}else if(num==4){
this.$u.post('/app/device/ring?sn=' + this.info.sn).then((res) => {
if (res.code === 200) {
}
})
}
},
historyList(){
this.$u.get(`/appVerify/admiOrder/historyList?orderNo` + 111).then((res) => {
if (res.code == 200) {
@ -405,8 +450,8 @@
// - /
longitude: this.longitude,
// - /
name: "荆门市",
address: "一夜城"
// name: "",
address: this.info.address
});
},
}

View File

@ -67,8 +67,10 @@
</view>
<view class="card_bot">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uklW7KIegcLR6E7DTOGO" mode=""></image>
{{item.address}}
<view class="stause" v-if="item.status==4" >
<view class="card_bot_txt">
{{item.address}}
</view>
<view class="stause" v-if="item.status==4" style="background-color: #3BBBA1 ;">
已完成
</view>
<view class="stause" v-if="item.status==2&&item.type==2" style="background-color: #F76D6D ;">
@ -184,19 +186,19 @@
<view class="card_bot">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uklW7KIegcLR6E7DTOGO" mode=""></image>
嵛山岛芦竹村三沙路68号
<view class="stause" v-if="item.status==4">
<view class="stause" v-if="item.status==4" style="background-color: #3BBBA1 ;">
已完成
</view>
<view class="stause" v-if="item.status==2&&item.type==2">
<view class="stause" v-if="item.status==2&&item.type==2" style="background-color: #F76D6D ;">
待换电
</view>
<view class="stause" v-if="item.status==2&&item.type==1">
<view class="stause" v-if="item.status==2&&item.type==1" style="background-color: #F76D6D ;">
待维修
</view>
<view class="stause" v-if="item.status==3&&item.type==2">
<view class="stause" v-if="item.status==3&&item.type==2" style="background-color: #4C97E7 ;">
换电中
</view>
<view class="stause" v-if="item.status==3&&item.type==1">
<view class="stause" v-if="item.status==3&&item.type==1" style="background-color: #4C97E7 ;">
维修中
</view>
</view>
@ -242,19 +244,20 @@
<view class="card_bot">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uklW7KIegcLR6E7DTOGO" mode=""></image>
嵛山岛芦竹村三沙路68号
<view class="stause" v-if="item.status==4">
<view class="stause" v-if="item.status==4" style="background-color: #3BBBA1 ;">
已完成
</view>
<view class="stause" v-if="item.status==2&&item.type==2">
<view class="stause" v-if="item.status==2&&item.type==2" style="background-color: #F76D6D ;">
待换电
</view>
<view class="stause" v-if="item.status==2&&item.type==1">
<view class="stause" v-if="item.status==2&&item.type==1" style="background-color: #F76D6D ;">
待维修
</view>
<view class="stause" v-if="item.status==3&&item.type==2">
<view class="stause" v-if="item.status==3&&item.type==2" style="background-color: #4C97E7 ;">
换电中
</view>
<view class="stause" v-if="item.status==3&&item.type==1">
<view class="stause" v-if="item.status==3&&item.type==1" style="background-color: #4C97E7 ;">
维修中
</view>
</view>
@ -527,6 +530,17 @@ page{
width: 41.66rpx;
height: 48rpx;
}
.card_bot_txt{
width: 80%;
white-space: nowrap;
/* 禁止换行 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
font-weight: 400;
font-size: 28rpx;
color: #3D3D3D;
}
font-weight: 400;
font-size: 28rpx;
color: #3D3D3D;

View File

@ -10,9 +10,9 @@
</view>
<view class="ipt">
<input type="text" class="ips" v-model="sn" placeholder="请输入车辆二维码下方编号" placeholder-style='font-weight: 400;font-size: 36rpx;color: #808080;' />
<input type="number" class="ips" v-model="sn" placeholder="请输入车辆二维码下方编号" placeholder-style='font-weight: 400;font-size: 36rpx;color: #808080;' />
</view>
<view class="btn" @click="sub">
<view class="btn" @click="sub" :class="istrue?'act1':''">
确认开锁
</view>
</view>
@ -27,9 +27,16 @@
bgc: {
backgroundColor: "#fff",
},
sn:''
sn:'',
istrue:false
}
},
watch: {
sn(newVal) {
const regex = /^\d{8}$/;
this.istrue = regex.test(newVal);
}
},
methods: {
sub(){
if(this.sn==''){
@ -44,7 +51,7 @@
this.$u.get('/app/device/info?sn=' + this.sn).then((res) => {
if (res.code === 200) {
uni.navigateTo({
url:'/pages/index/index?sn='+this.code
url:'/pages/index/index?sn='+this.sn
})
}else{
@ -72,7 +79,7 @@
that.$u.get('/app/device/info?sn=' + that.sn).then((res) => {
if (res.code === 200) {
uni.navigateTo({
url:'/pages/index/index?sn='+this.code
url:'/pages/index/index?sn='+that.sn
})
}else{
@ -166,6 +173,9 @@ page{
font-size: 36rpx;
color: #FFFFFF;
}
.act1{
background: #02CBAF;
}
}
}

View File

@ -8,8 +8,8 @@
</map>
<view class="my-location">
<view class="img" src="https://course.jchen.art/static/images/icon-location.png"
@click="getMyLocation"></view>
<image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/u0Kyr2HWPvHq7CMHIv5r"
@click="getMyLocation"></image>
</view>
<view class="botmbox2" v-if="showdevice">
<view class="close" @click="close()">
@ -51,7 +51,7 @@
</view>
</view>
<view class="bot">
<view class="left_btn" @click="qrCode()">
<view class="left_btn" @click="qecodelock()">
扫码用车
</view>
<view class="right_btn" @click="Reserve()">
@ -824,9 +824,7 @@
setTimeout(() => {
if (!this.orderinfo.status) {
this.deviceInfo()
this.showdevice = true
this.deviceIndex = 1
this.type = 1
}
}, 1000)
@ -3034,7 +3032,7 @@
background: linear-gradient(180deg, #EEF5FD 20%, rgba(255, 255, 255, 0)30%), #FFFFFF;
border-radius: 30rpx;
padding: 48rpx 36rpx;
z-index: 30;
.close {
position: absolute;
right: 32rpx;

View File

@ -9,7 +9,7 @@
<view class="tit">
电量区间
</view>
<view style="width: 650rpx;">
<view style="width: 650rpx;margin: 0 auto;">
<slider-range :value="rangeValue" :min="rangeMin" :max="rangMax" :step="1" :bar-height="3" :block-size="20"
background-color="#EEEEF6" active-color="#4C97E7" :format="format" :decorationVisible="true"
@change="handleRangeChange"></slider-range>
@ -24,7 +24,7 @@
<view @touchmove.stop.prevent="() => {}">
<view class="btn_box">
<view class="btn1">
<view class="btn1" @click="qecodelock()">
车辆扫码
</view>
<view class="btn2" @click="topage()">
@ -173,6 +173,41 @@
},
},
methods: {
qecodelock() {
uni.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
let sn = null;
let queryParams = res.result.split('?')[1];
if (queryParams) {
let params = queryParams.split('&');
params.forEach(param => {
let [key, value] = param.split('=');
if (key === 'sn') {
sn = value;
}
});
}
this.sn = sn
if (this.sn != '') {
uni.navigateTo({
url:'/pages_admin/order/device_detail?id='+this.sn
})
}
},
fail: err => {
console.error('扫描失败:', err);
uni.showToast({
title: '扫描失败',
icon: 'none'
});
}
});
},
topage(){
uni.navigateTo({
url:'/pages_admin/order/search_device'

View File

@ -230,14 +230,11 @@
console.error("Error fetching area data:", error);
});
}else if(num==4){
this.$u.get('/appVerify/device/ring?sn='+this.sn).then((res) => {
this.$u.post('/app/device/ring?sn=' + this.sn).then((res) => {
if (res.code === 200) {
// 线
this.deviceInfo()
}
}).catch(error => {
console.error("Error fetching area data:", error);
});
})
}
},
status(){