用户端:增加停车点
This commit is contained in:
parent
506e98ffa3
commit
def880ebc0
@ -116,11 +116,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.divOrderCell {
|
.divOrderCell {
|
||||||
width: 50vw;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divOrderCell2 {
|
.divOrderCell2 {
|
||||||
width: 40vw;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divOrderImg {
|
.divOrderImg {
|
||||||
|
|||||||
@ -184,6 +184,9 @@
|
|||||||
let arrBikeData = [];
|
let arrBikeData = [];
|
||||||
const showBikeInfo = ref(false);
|
const showBikeInfo = ref(false);
|
||||||
const bikeData = ref({});
|
const bikeData = ref({});
|
||||||
|
|
||||||
|
let ismount=false;
|
||||||
|
let arrSiteData=[]
|
||||||
|
|
||||||
//加载数据
|
//加载数据
|
||||||
function getLoalcationData() {
|
function getLoalcationData() {
|
||||||
@ -225,6 +228,7 @@
|
|||||||
})
|
})
|
||||||
markers.value = arrData;
|
markers.value = arrData;
|
||||||
});
|
});
|
||||||
|
getSiteList(longitude,latitude);
|
||||||
})
|
})
|
||||||
// uni.getLocation({
|
// uni.getLocation({
|
||||||
// type: 'gcj02',
|
// type: 'gcj02',
|
||||||
@ -363,7 +367,6 @@
|
|||||||
const intervalId = setInterval(() => {
|
const intervalId = setInterval(() => {
|
||||||
// 更新订单时间
|
// 更新订单时间
|
||||||
order.value.time = timeDifference(createdAt);
|
order.value.time = timeDifference(createdAt);
|
||||||
console.log(order.value.time); // 输出更新时间
|
|
||||||
if (!showOrder.value) { // 如果 showOrder 为 false,停止轮询
|
if (!showOrder.value) { // 如果 showOrder 为 false,停止轮询
|
||||||
clearInterval(intervalId); // 使用 intervalId 来停止轮询
|
clearInterval(intervalId); // 使用 intervalId 来停止轮询
|
||||||
}
|
}
|
||||||
@ -619,19 +622,21 @@
|
|||||||
oMap = uni.createMapContext("mapRef", {
|
oMap = uni.createMapContext("mapRef", {
|
||||||
this: instance.proxy
|
this: instance.proxy
|
||||||
});
|
});
|
||||||
|
ismount=true;
|
||||||
getLoalcationData();
|
getLoalcationData();
|
||||||
})
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
if (uni.getStorageSync("wechat_user")) {
|
if (uni.getStorageSync("wechat_user")) {
|
||||||
oUser = JSON.parse(jkcBaseDecode(uni.getStorageSync("wechat_user")));
|
oUser = JSON.parse(jkcBaseDecode(uni.getStorageSync("wechat_user")));
|
||||||
|
const {
|
||||||
|
userId
|
||||||
|
} = oUser;
|
||||||
|
if (userId) {
|
||||||
|
getOrder();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const {
|
|
||||||
userId
|
if(ismount) getLoalcationData();
|
||||||
} = oUser;
|
|
||||||
if (userId) {
|
|
||||||
getOrder();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
@ -667,6 +672,29 @@
|
|||||||
const diffInDays = Math.floor(diffInHours / 24);
|
const diffInDays = Math.floor(diffInHours / 24);
|
||||||
return `${diffInDays}天 ${diffInHours % 24}小时 ${diffInMinutes % 60}分钟 ${diffInSeconds % 60}秒`;
|
return `${diffInDays}天 ${diffInHours % 24}小时 ${diffInMinutes % 60}分钟 ${diffInSeconds % 60}秒`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSiteList(lng,lat){
|
||||||
|
const params={
|
||||||
|
longitude:lng,
|
||||||
|
latitude:lat
|
||||||
|
}
|
||||||
|
callOrdereApi("userOrders/siteRegionList",params,"post").then(res=>{
|
||||||
|
const{code,data,message}=res;
|
||||||
|
const arrData=[];
|
||||||
|
if(code==200&&data&&data.length>0){
|
||||||
|
data.map(item=>{
|
||||||
|
const{shapeType,points}=item;
|
||||||
|
if(shapeType=="2"){
|
||||||
|
arrData.push(map.addPolygon("#578FD4","#c0daf54d",points));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
polygons.value=arrData;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
console.log("userOrders/siteRegionList",res);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -101,7 +101,6 @@ function saveRide(params, icnt, callback) {
|
|||||||
code,
|
code,
|
||||||
message
|
message
|
||||||
} = res;
|
} = res;
|
||||||
console.log("33333333333333333333333","userOrders/saveRide",res);
|
|
||||||
if (code != 200) {
|
if (code != 200) {
|
||||||
if (icnt <= 3) {
|
if (icnt <= 3) {
|
||||||
saveRide(params, icnt + 1, callback);
|
saveRide(params, icnt + 1, callback);
|
||||||
@ -119,4 +118,15 @@ function saveRide(params, icnt, callback) {
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//添加面
|
||||||
|
export function addPolygon (scolor, fcolor, arrPoints) {
|
||||||
|
return {
|
||||||
|
points: arrPoints,
|
||||||
|
fillColor: fcolor,
|
||||||
|
strokeWidth: 3,
|
||||||
|
strokeColor: scolor,
|
||||||
|
zIndex: 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user