+
备注:黄色标记表示该资产,蓝色标记表示本账套已标记的其他资产
@@ -19,6 +21,7 @@
import Cookies from "js-cookie";
import {getQueryLand} from "@/api/homesteadSurvey/zjdzd";
import { getConfigKey } from "@/api/system/config";
+ import {Toast} from "vant";
export default {
data() {
@@ -40,6 +43,20 @@
// 获取村边界的图层名称
this.getVillageBorderLayerName();
},
+ computed: {
+ isAndroid() {
+ return !!window._Native_object;
+ },
+ hasSelectLocationMode() {
+ return this.isAndroid && typeof(window._Native_object.SelectLocationMode) === 'function';
+ },
+ hasGetLocationTimeout() {
+ return this.isAndroid && typeof(window._Native_object.GetLocationTimeout) === 'function';
+ },
+ hasGetLocationMode() {
+ return this.isAndroid && typeof(window._Native_object.GetLocationMode) === 'function';
+ },
+ },
methods: {
// 获取geoserver的地址
getGeoServerUrl() {
@@ -70,34 +87,72 @@
return v.toString(16);
});
},
+ selectLocationMode() {
+ if(this.hasSelectLocationMode)
+ {
+ let res = window._Native_object.SelectLocationMode();
+ console.log('当前选择定位模式: ' + res);
+ }
+ },
+ getLocationMode() {
+ let mode = '';
+ if(this.hasGetLocationMode)
+ {
+ mode = window._Native_object.GetLocationMode();
+ }
+ console.log('当前选择定位模式: ' + mode);
+ return mode;
+ },
+ getLocationTimeout() {
+ let timeout = 10000;
+ if(this.hasGetLocationMode)
+ {
+ let to = window._Native_object.GetLocationTimeout();
+ if(to <= 0)
+ to = 30000;
+ timeout = to;
+ }
+ console.log('当前选择定位超时: ' + timeout);
+ return timeout;
+ },
getCurrentLocation(callback) {
// 1. 首先尝试Android宿主端
- if(window._Native_object) // Android层注入全局对象
+ if(this.isAndroid) // Android层注入全局对象
{
- console.log('使用Native获取定位');
- let coord = window._Native_object.GetLocation(null);
- console.log('Native坐标: ' + coord);
- if(coord)
+ let mode = this.getLocationMode();
+ if(mode !== 'h5')
{
- let arr = coord.split(',');
- let res = {
- code: 200,
- data: {
- lng: arr[0],
- lat: arr[1],
- },
- };
- callback(res);
- return;
+ console.log('使用Native获取定位');
+ let coord = window._Native_object.GetLocation(null);
+ console.log('Native坐标: ' + coord);
+ if(coord)
+ {
+ let arr = coord.split(',');
+ let res = {
+ code: 200,
+ data: {
+ lng: arr[0],
+ lat: arr[1],
+ },
+ };
+ callback(res);
+ return;
+ }
}
}
// 2. 再尝试浏览器
if (navigator.geolocation) {
console.log('使用浏览器获取定位');
+ const loading = Toast.loading({
+ message: '定位中...',
+ duration: 0,
+ });
+ let timeout = this.getLocationTimeout();
navigator.geolocation.getCurrentPosition(
(position) => {
const { latitude, longitude } = position.coords;
+ console.log('浏览器定位结果: 经纬度=' + longitude + ', ' + latitude);
let res = {
code: 200,
data: {
@@ -105,13 +160,15 @@
lat: latitude,
},
};
+ loading.clear();
callback(res);
},
(error) => {
+ loading.clear();
console.log('定位失败: ' + error.message);
getQueryLand().then(callback);
},
- { enableHighAccuracy: true, timeout: 5000 }
+ { enableHighAccuracy: true, timeout: timeout }
);
return;
}
@@ -710,4 +767,10 @@
z-index: 2000;
padding-top: 5%;
}
+ .location-mode-chooser-btn {
+ position: absolute;
+ right: 0;
+ bottom: 0;
+ z-index: 2000;
+ }
diff --git a/src/permission.js b/src/permission.js
index f9cdb611..4f0cb92c 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -39,6 +39,8 @@ const whiteList = [
'/policyPDF',
'/attestationDetail',
'/noticeDetail',
+ '/stopDetail',
+ '/abnormalDetail',
'/homestead/login',
'/applicationForm',
'/applicationList',
diff --git a/src/router/index.js b/src/router/index.js
index 404adf9e..e8e37fb8 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -389,6 +389,24 @@ export const constantRoutes = [
},
component: (resolve) => require(['@/views/notice/noticeDetail'], resolve)
},
+ {
+ path: '/stopDetail',
+ name: 'stopDetail',
+ meta: {
+ title: '公告详情',
+ hidden: true,
+ },
+ component: (resolve) => require(['@/views/notice/stopDetail'], resolve)
+ },
+ {
+ path: '/abnormalDetail',
+ name: 'abnormalDetail',
+ meta: {
+ title: '公告详情',
+ hidden: true,
+ },
+ component: (resolve) => require(['@/views/notice/abnormalDetail'], resolve)
+ },
{
path: '/attestationDetail',
name: 'attestationDetailCJ',
diff --git a/src/views/notice/abnormalDetail.vue b/src/views/notice/abnormalDetail.vue
new file mode 100644
index 00000000..5ab5d3ff
--- /dev/null
+++ b/src/views/notice/abnormalDetail.vue
@@ -0,0 +1,120 @@
+
+
+
+
+
+
项目信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/notice/attestationDetail.vue b/src/views/notice/attestationDetail.vue
index a4172a3e..1813b814 100644
--- a/src/views/notice/attestationDetail.vue
+++ b/src/views/notice/attestationDetail.vue
@@ -28,9 +28,7 @@
转出方信息
-
-
-
+
diff --git a/src/views/notice/index.vue b/src/views/notice/index.vue
index 3998c0fd..a1018849 100644
--- a/src/views/notice/index.vue
+++ b/src/views/notice/index.vue
@@ -13,7 +13,10 @@
>