Merge branch 'main' of http://47.109.71.130:3000/attiya/ebike-ui
This commit is contained in:
commit
310fa81729
@ -116,11 +116,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.divOrderCell {
|
.divOrderCell {
|
||||||
width: 50vw;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divOrderCell2 {
|
.divOrderCell2 {
|
||||||
width: 40vw;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divOrderImg {
|
.divOrderImg {
|
||||||
|
|||||||
@ -183,6 +183,9 @@
|
|||||||
const showBikeInfo = ref(false);
|
const showBikeInfo = ref(false);
|
||||||
const bikeData = ref({});
|
const bikeData = ref({});
|
||||||
|
|
||||||
|
let ismount=false;
|
||||||
|
let arrSiteData=[]
|
||||||
|
|
||||||
//加载数据
|
//加载数据
|
||||||
function getLoalcationData() {
|
function getLoalcationData() {
|
||||||
map.getLoalcation(res => {
|
map.getLoalcation(res => {
|
||||||
@ -223,6 +226,7 @@
|
|||||||
})
|
})
|
||||||
markers.value = arrData;
|
markers.value = arrData;
|
||||||
});
|
});
|
||||||
|
getSiteList(longitude,latitude);
|
||||||
})
|
})
|
||||||
// uni.getLocation({
|
// uni.getLocation({
|
||||||
// type: 'gcj02',
|
// type: 'gcj02',
|
||||||
@ -361,7 +365,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 来停止轮询
|
||||||
}
|
}
|
||||||
@ -617,19 +620,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 {
|
const {
|
||||||
userId
|
userId
|
||||||
} = oUser;
|
} = oUser;
|
||||||
if (userId) {
|
if (userId) {
|
||||||
getOrder();
|
getOrder();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ismount) getLoalcationData();
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
@ -665,6 +670,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);
|
||||||
@ -120,3 +119,14 @@ function saveRide(params, icnt, callback) {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//添加面
|
||||||
|
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