fix:修复订单监控总会显示弹窗的bug(采用时间比较形式)
This commit is contained in:
+1
-1
@@ -7049,7 +7049,7 @@ function isConsoleWritable() {
|
||||
function initRuntimeSocketService() {
|
||||
const hosts = "192.168.5.17,127.0.0.1";
|
||||
const port = "8090";
|
||||
const id = "mp-weixin_Pk5qpf";
|
||||
const id = "mp-weixin_7kve6_";
|
||||
const lazy = typeof swan !== "undefined";
|
||||
let restoreError = lazy ? () => {
|
||||
} : initOnError();
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ const request = (option) => {
|
||||
method: option.method,
|
||||
data: option.data,
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
...option.headers,
|
||||
"appid": config_url.appid,
|
||||
"Authorization": "Bearer " + common_vendor.index.getStorageSync("token"),
|
||||
|
||||
@@ -194,6 +194,7 @@ const _sfc_main = {
|
||||
common_vendor.index.showLoading({
|
||||
title: "处理中"
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:428", deviceId.value);
|
||||
const rentResult = await config_user.rentPowerBank(deviceId.value, phoneNumber.value);
|
||||
if (rentResult.code !== 200) {
|
||||
throw new Error(rentResult.msg || "设备租借失败");
|
||||
|
||||
+12
-10
@@ -88,13 +88,14 @@ const _sfc_main = {
|
||||
longitude: location.longitude,
|
||||
latitude: location.latitude
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:260", userLocation.value);
|
||||
try {
|
||||
common_vendor.index.setStorageSync("userLocation", {
|
||||
longitude: location.longitude,
|
||||
latitude: location.latitude
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("warn", "at pages/index/index.vue:267", "缓存基础定位信息失败:", e);
|
||||
common_vendor.index.__f__("warn", "at pages/index/index.vue:268", "缓存基础定位信息失败:", e);
|
||||
}
|
||||
if (!isLocationInitialized.value) {
|
||||
isLocationInitialized.value = true;
|
||||
@@ -115,7 +116,7 @@ const _sfc_main = {
|
||||
district: userLocation.value.district
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("warn", "at pages/index/index.vue:294", "缓存带地址的定位信息失败:", e);
|
||||
common_vendor.index.__f__("warn", "at pages/index/index.vue:295", "缓存带地址的定位信息失败:", e);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -125,7 +126,7 @@ const _sfc_main = {
|
||||
common_vendor.index.hideLoading();
|
||||
}, 800);
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:309", "获取位置失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:310", "获取位置失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "获取位置失败,显示默认地图",
|
||||
icon: "none"
|
||||
@@ -149,15 +150,16 @@ const _sfc_main = {
|
||||
longitude: userLocation.value.longitude
|
||||
}
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:336", res);
|
||||
if (res.statusCode === 200 && res.data.code === 200) {
|
||||
positionList.value = res.data.rows || [];
|
||||
calculateDistances();
|
||||
filteredPositions.value = [...positionList.value];
|
||||
} else {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:341", "获取场地列表失败:", res.data.msg);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:343", "获取场地列表失败:", res.data.msg);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:344", "获取场地列表异常:", error);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:346", "获取场地列表异常:", error);
|
||||
}
|
||||
};
|
||||
const calculateDistances = async (centerPoint = null) => {
|
||||
@@ -178,7 +180,7 @@ const _sfc_main = {
|
||||
item.distance = formatDistance(distanceInMeters);
|
||||
item.distanceInMeters = distanceInMeters;
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:372", "计算距离异常:", error, item);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:374", "计算距离异常:", error, item);
|
||||
item.distance = "999.0km";
|
||||
item.distanceInMeters = 999e3;
|
||||
}
|
||||
@@ -209,12 +211,12 @@ const _sfc_main = {
|
||||
return !item.distanceInMeters || item.distanceInMeters <= maxDistanceInMeters;
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:413", "根据地图中心加载场地失败:", res.data.msg);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:415", "根据地图中心加载场地失败:", res.data.msg);
|
||||
positionList.value = [];
|
||||
filteredPositions.value = [];
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:418", "根据地图中心加载场地异常:", error);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:420", "根据地图中心加载场地异常:", error);
|
||||
}
|
||||
};
|
||||
const handleRelocate = async () => {
|
||||
@@ -337,14 +339,14 @@ const _sfc_main = {
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:581", "获取设备信息异常:", error);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:583", "获取设备信息异常:", error);
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/device/detail?deviceNo=${deviceNo}`
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:588", "扫码处理失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:590", "扫码处理失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "扫码失败",
|
||||
icon: "none"
|
||||
|
||||
+8
-6
@@ -369,13 +369,15 @@ function getUserLocation() {
|
||||
common_vendor.wx$1.getLocation({
|
||||
type: "gcj02",
|
||||
success: (res) => {
|
||||
const longitude = parseFloat(res.longitude.toFixed(5));
|
||||
const latitude = parseFloat(res.latitude.toFixed(5));
|
||||
resolve({
|
||||
longitude: res.longitude,
|
||||
latitude: res.latitude
|
||||
longitude,
|
||||
latitude
|
||||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
common_vendor.index.__f__("error", "at utils/mapUtils.js:423", "获取位置失败:", error);
|
||||
common_vendor.index.__f__("error", "at utils/mapUtils.js:427", "获取位置失败:", error);
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
@@ -410,7 +412,7 @@ function getRegeo(longitude, latitude) {
|
||||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
common_vendor.index.__f__("error", "at utils/mapUtils.js:462", "逆地理编码失败:", error);
|
||||
common_vendor.index.__f__("error", "at utils/mapUtils.js:484", "逆地理编码失败:", error);
|
||||
reject({ success: false, message: error.message || "逆地理编码失败" });
|
||||
}
|
||||
});
|
||||
@@ -428,8 +430,8 @@ function testDistanceCalculation() {
|
||||
const tiananmen = { lat: 39.908823, lng: 116.39747 };
|
||||
const gugong = { lat: 39.916527, lng: 116.397128 };
|
||||
const distance = calculateDistanceSync(tiananmen.lat, tiananmen.lng, gugong.lat, gugong.lng);
|
||||
common_vendor.index.__f__("log", "at utils/mapUtils.js:586", "天安门到故宫的距离:", distance, "米");
|
||||
common_vendor.index.__f__("log", "at utils/mapUtils.js:587", "转换为公里:", (distance / 1e3).toFixed(2), "公里");
|
||||
common_vendor.index.__f__("log", "at utils/mapUtils.js:608", "天安门到故宫的距离:", distance, "米");
|
||||
common_vendor.index.__f__("log", "at utils/mapUtils.js:609", "转换为公里:", (distance / 1e3).toFixed(2), "公里");
|
||||
return distance;
|
||||
}
|
||||
exports.calculateDistanceSync = calculateDistanceSync;
|
||||
|
||||
Reference in New Issue
Block a user