This commit is contained in:
Sliverber 2024-07-05 11:32:36 +08:00
parent fb9dce55c0
commit c94cbeee3d
5 changed files with 286 additions and 56 deletions

View File

@ -19,13 +19,13 @@ const install = (Vue, vm) => {
// },
// });
uni.setStorageSync('deptId', 101);
uni.setStorageSync('deptId', 100);
Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://61.174.243.28:15861',
// baseUrl: 'http://192.168.2.14:8080',
// baseUrl: 'http://124.221.246.124:2289',
baseUrl: 'https://dianche.chuantewulian.cn/prod-api',
// baseUrl: 'https://dche.ccttiot.com/prod-api',
// baseUrl: 'https://dianche.chuantewulian.cn/prod-api',
baseUrl: 'https://dche.ccttiot.com/prod-api',
loadingText: '努力加载中~',
// loadingTime: 2000,
// 设置自定义头部content-type

View File

@ -51,7 +51,7 @@
/* */
"mp-weixin" : {
"libVersion" : "latest",
"appid" : "wx4d178f8c80348214",
"appid" : "wx3428c498d5061192",
"setting" : {
"urlCheck" : false
},

View File

@ -825,8 +825,28 @@
</view>
</view>
</view>
<view class="fixdivce">
<view class="fixdivce" v-if="showdevice&&false">
<view class="scrollable-content">
<view class="divce_li" v-for="(item,index) in nearbyMarkers" :key="index" @click="tapsn(item.sn)">
<view class="left_img">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uEW2Zm3sO8E5eqOf2wwl" mode=""></image>
</view>
<view class="right_cont">
<view class="right_top">
<view class="right_top_left">
<image src=" https://lxnapi.ccttiot.com/bike/img/static/u9pggdTCxcZgUTNsEvXQ" mode=""></image>
{{item.remainingPower}}%
</view>
<view class="right_top_right">
可行驶{{item.remainingMileage}}km
</view>
</view>
<view class="right_bot">
SN:{{item.sn}}
</view>
</view>
</view>
</view>
</view>
</view>
</template>
@ -959,7 +979,9 @@
clickedMarkerIconPath: 'https://lxnapi.ccttiot.com/bike/img/static/uf2TwgtQ2sKJrUY3wTz4',
ispaid: false,
isInParkingArea: null,
specificDeviceMarkerId: null
specificDeviceMarkerId: null,
nearbyMarkers:[]
}
},
watch: {
@ -1289,6 +1311,7 @@
this.freeInfo = {}
this.freeListIndex = 0
this.mappolyline = []
this.lastClickedMarkerId=null
// const {
// latitude,
// longitude
@ -1297,6 +1320,51 @@
// this.close()
//
},
tapsn(sn){
const markerExists = this.listData.some(item => item.sn == sn);
if (markerExists) {
this.sn =sn;
this.deviceInfo(0);
// Revert the last clicked marker to the default image and zIndex
if (this.lastClickedMarkerId !== null) {
this.markers = this.markers.map(marker => {
if (marker.id == this.lastClickedMarkerId) {
return {
...marker,
iconPath: this.defaultMarkerIconPath,
width: 40,
height: 28,
// zIndex: 1 // Reset to default zIndex
};
}
return marker;
});
}
// Update the clicked marker's image and zIndex
this.markers = this.markers.map(marker => {
if (marker.id == sn) {
return {
...marker,
iconPath: this.clickedMarkerIconPath,
width: 50,
height: 35
// zIndex: 999 // Higher zIndex to bring it to the front
};
}
return marker;
});
// Store the ID of the currently clicked marker
this.lastClickedMarkerId = sn;
} else {
console.log('Marker ID does not exist in the list data');
}
},
onMarkerTap(e) {
this.showdevice = false;
this.deviceIndex = 0;
@ -1381,6 +1449,7 @@
}
return false;
});
this.nearbyMarkers=nearbyMarkers
console.log('Nearby markers within 15 meters:', nearbyMarkers);
},
haversineDistance(lat1, lon1, lat2, lon2) {
@ -1423,7 +1492,7 @@
//
if (this.lastClickedMarkerId !== null) {
updatedMarkers = updatedMarkers.map(marker => {
if (marker.id === this.lastClickedMarkerId) {
if (marker.id == this.lastClickedMarkerId) {
return {
...marker,
width: 50,
@ -5001,9 +5070,67 @@
.page {
width: 750rpx;
// .fixdivce{
// }
.fixdivce{
padding: 12rpx 22rpx 12rpx 22rpx;
position: fixed;
left: 0;
top: 25vh;
width: 334rpx;
height: 460rpx;
background: #FFFFFF;
border-radius: 0 40rpx 40rpx 0;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0,0,0,0.3);
.scrollable-content {
height: 100%;
overflow-y: auto;
.divce_li:last-child{
border-bottom: 1rpx solid #fff;
}
.divce_li{
padding: 10rpx 0;
display: flex;
flex-wrap: nowrap;
align-items: center;
border-bottom: 1rpx solid #D8D8D8;
.left_img{
image{
width: 44rpx;
height: 70rpx;
}
}
.right_cont{
margin-left: 20rpx;
display: flex;
flex-wrap: wrap;
font-weight: 400;
font-size: 24rpx;
color: #3D3D3D;
.right_top{
width: 100%;
display: flex;
flex-wrap: nowrap;
align-items: center;
.right_top_left{
display: flex;
flex-wrap: nowrap;
align-items: center;
image{
margin-right: 6rpx;
width: 12rpx;
height: 26rpx;
}
}
.right_top_right{
margin-left: auto;
}
}
.right_bot{
margin-top: 8rpx;
}
}
}
}
}
.maskload {
position: fixed;

View File

@ -16,7 +16,7 @@
</view>
</view>
</view>
<view class="top_box">
<!-- <view class="top_box">
<view class="left_text">
手机号
</view>
@ -24,6 +24,19 @@
<input type="text" v-model="searchKeyword" placeholder="请输入内容" class="input"
placeholder-style="color:#C7CDD3" @input="search()">
</view>
</view> -->
<view class="top_box" style="margin-top: 20rpx;">
<view class="left_text" @click="shows=true">
{{tit}} <view class="iconfont icon-xiangxia1"></view>
</view>
<view class="sear_ipt">
<input type="text"
v-model="searchKeyword"
placeholder="请输入内容"
class="input"
placeholder-style="color:#C7CDD3"
@input="search()">
</view>
</view>
<view class="tap">
<view class="tap_cont " :class="curtitidx==0?'act1':''" @click="changeidx(0)">
@ -73,8 +86,19 @@
<view class="lines"></view>
<view class="order_info">
<!-- <view class="info_li">
</view> -->
<view class="info_li">
租赁用户{{item.phonenumber}}
<view class="half_info_li">
租赁用户{{item.phonenumber}}
</view>
<view class="half_info_li" v-if="item.vehicleNum">
车牌号{{item.vehicleNum}}
</view>
<view class="half_info_li" v-else>
车牌号--
</view>
</view>
<view class="info_li">
<view class="half_info_li">
@ -469,6 +493,7 @@
</view>
</view>
</view>
<u-select v-model="shows" :list="list" title='添加方式' @confirm="searchconfirm"></u-select>
<tab-bar :indexs='2' style=""></tab-bar>
</view>
</template>
@ -511,7 +536,21 @@
initialValues: {
},
areaId:false
areaId:false,
tit:'手机号',
shows:false,
list: [{
value: '1',
label: '手机号'
},
{
value: '2',
label: '车牌号'
},
],
typeidx:'1',
}
},
@ -551,6 +590,15 @@
},
methods: {
searchconfirm(e) {
// console.log(e,'eeeeeeeeee');
this.typeidx = e[0].value
this.tit= e[0].label
// console.log(e);
// this.mode = e[0].label
// this.gettype()
},
computedList(item) {
if(item.status==0||item.status==2){
const createTime = new Date(item.createTime);
@ -738,16 +786,26 @@
this.showfz = true
},
orderList() {
let data = {
phonenumber: this.searchKeyword,
type: '1',
status: '',
startTime: this.firsTime,
endTime: this.lasTime,
areaId:this.areaId
let data = {};
if (this.typeidx == 1) {
data = {
phonenumber: this.searchKeyword,
type: '1',
status: '',
startTime: this.firsTime,
endTime: this.lasTime,
areaId: this.areaId
};
} else if (this.typeidx == 2) { // this.typeidx == 2
data = {
vehicleNum: this.searchKeyword,
type: '1',
status: '',
startTime: this.firsTime,
endTime: this.lasTime,
areaId: this.areaId
};
}
this.loading = false
this.$u.get('/appVerify/order/list?', data).then((res) => {
if (res.code === 200) {
@ -763,13 +821,25 @@
});
},
orderList1() {
let data = {
phonenumber: this.searchKeyword,
type: '1',
statusList: '0,2',
startTime: this.firsTime,
endTime: this.lasTime,
areaId:this.areaId
let data = {};
if (this.typeidx == 1) {
data = {
phonenumber: this.searchKeyword,
type: '1',
status: '',
startTime: this.firsTime,
endTime: this.lasTime,
areaId: this.areaId
};
} else if (this.typeidx == 2) { // this.typeidx == 2
data = {
vehicleNum: this.searchKeyword,
type: '1',
status: '',
startTime: this.firsTime,
endTime: this.lasTime,
areaId: this.areaId
};
}
this.loading = false
this.$u.get('/appVerify/order/list?', data).then((res) => {
@ -785,14 +855,25 @@
});
},
orderList2() {
let data = {
phonenumber: this.searchKeyword,
type: '1',
statusList: '1,3',
startTime: this.firsTime,
endTime: this.lasTime,
areaId:this.areaId
let data = {};
if (this.typeidx == 1) {
data = {
phonenumber: this.searchKeyword,
type: '1',
status: '',
startTime: this.firsTime,
endTime: this.lasTime,
areaId: this.areaId
};
} else if (this.typeidx == 2) { // this.typeidx == 2
data = {
vehicleNum: this.searchKeyword,
type: '1',
status: '',
startTime: this.firsTime,
endTime: this.lasTime,
areaId: this.areaId
};
}
this.loading = false
this.$u.get('/appVerify/order/list?', data).then((res) => {
@ -808,16 +889,25 @@
});
},
orderList3() {
let data = {
phonenumber: this.searchKeyword,
type: '1',
status: '4',
startTime: this.firsTime,
endTime: this.lasTime,
areaId:this.areaId
let data = {};
if (this.typeidx == 1) {
data = {
phonenumber: this.searchKeyword,
type: '1',
status: '',
startTime: this.firsTime,
endTime: this.lasTime,
areaId: this.areaId
};
} else if (this.typeidx == 2) { // this.typeidx == 2
data = {
vehicleNum: this.searchKeyword,
type: '1',
status: '',
startTime: this.firsTime,
endTime: this.lasTime,
areaId: this.areaId
};
}
this.loading = false
this.$u.get('/appVerify/order/list?', data).then((res) => {
@ -844,7 +934,7 @@
this.orderList3()
}
},
swiperchange(e) {
swiperchange(e) {
this.curtitidx = e.detail.current
console.log(e, 'eeeeeeeee');
},
@ -1144,31 +1234,40 @@
}
.top_box {
display: flex;
flex-wrap: nowrap;
align-items: center;
padding: 28rpx 30rpx;
margin: 20rpx auto;
// padding: 20rpx 0;
margin: 0 auto;
width: 672rpx;
height: 100rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 22rpx 0rpx rgba(0, 0, 0, 0.07);
border-radius: 10rpx 10rpx 10rpx 10rpx;
.left_text {
display: flex;
flex-wrap: nowrap;
align-items: center;
width: 25%;
font-weight: 400;
font-size: 32rpx;
color: #3D3D3D;
.icon-xiangxia1{
font-size: 26rpx;
}
}
.timebox {
width: 75%;
display: flex;
flex-wrap: nowrap;
align-items: center;
margin-left: 34rpx;
.left_time {
text-align: center;
margin-right: 6rpx;
@ -1180,7 +1279,7 @@
font-size: 32rpx;
color: #979797;
}
.right_time {
text-align: center;
margin-left: 6rpx;
@ -1194,6 +1293,7 @@
}
}
}
}
</style>

View File

@ -23,9 +23,12 @@
<view class="info_card" style="margin-top: 20rpx;" v-for="(item,index) in searchList" :key="index" @click="todetail(item)">
<view class="info_tit">
<view class="info_tit" v-if="item.vehicleNum">
车牌号{{item.vehicleNum}}
</view>
<view class="info_tit" v-else>
车牌号--
</view>
<view class="lines"></view>
<view class="cont">