Swanky 2 years ago
parent 659e593315
commit 8360161723
  1. 7
      manifest.json
  2. 21
      pages/index/index.vue
  3. 85
      pages/sjsb/sjsb.vue
  4. 10
      pages/workbench/workbench.vue

@ -51,8 +51,11 @@
/* ios */ /* ios */
"sdkConfigs" : { "sdkConfigs" : {
"geolocation" : { "geolocation" : {
"system" : { "amap" : {
"__platform__" : [ "ios", "android" ] "name" : "amap_15882397084BqtLneFOK",
"__platform__" : [ "android" ],
"appkey_ios" : "",
"appkey_android" : "1b552fec0195ad646852a1eac91ba7ae"
} }
}, },
"ad" : {} "ad" : {}

@ -299,7 +299,7 @@
}, },
location() { location() {
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'gcj02',
success: (res) => { success: (res) => {
console.log('当前位置的经度:' + res.longitude); console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude); console.log('当前位置的纬度:' + res.latitude);
@ -565,23 +565,24 @@
var tdt = new TileLayer({ var tdt = new TileLayer({
source: new XYZ({ source: new XYZ({
maxZoom: 18, maxZoom: 18,
url: 'http://t{0-5}.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=cef191b507ff5cb698811cd8a9b11ca0', url: "https://webst0{1-4}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
// url: 'http://t{0-5}.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=cef191b507ff5cb698811cd8a9b11ca0',
projection: 'EPSG:3857', projection: 'EPSG:3857',
crossOrigin: '*', crossOrigin: '*',
}), }),
}) })
// //
var tdtLabel = new TileLayer({ // var tdtLabel = new TileLayer({
source: new XYZ({ // source: new XYZ({
maxZoom: 18, // maxZoom: 18,
url: 'http://t{0-5}.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cef191b507ff5cb698811cd8a9b11ca0', // url: 'http://t{0-5}.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cef191b507ff5cb698811cd8a9b11ca0',
projection: 'EPSG:3857', // projection: 'EPSG:3857',
}), // }),
}) // })
map = new Map({ map = new Map({
controls: [], controls: [],
target: 'map', target: 'map',
layers: [tdt, tdtLabel], layers: [tdt],
view: new View({ view: new View({
projection: 'EPSG:4326', projection: 'EPSG:4326',
center: [102.45438, 32.53223], center: [102.45438, 32.53223],

@ -86,47 +86,52 @@
success: (res) => { success: (res) => {
console.log(res.networkType); console.log(res.networkType);
this.networkType = res.networkType; this.networkType = res.networkType;
uni.getStorage({
key: 'token',
success: (token) => {
this.token = token.data;
if (!e.id) {
this.locationLoading = true
if (res.networkType !== 'none') {
uni.getLocation({
type: 'gcj02',
success: (res) => {
this.jd = res.longitude;
this.wd = res.latitude;
this.locationLoading = false
},
fail: (error) => {
this.locationLoading = false
uni.showModal({
content: JSON.stringify(error),
title: '定位失败'
})
}
});
} else {
plus.geolocation.getCurrentPosition((res) => {
this.jd = res.coords.longitude;
this.wd = res.coords.latitude;
this.locationLoading = false
}, (error) => {
this.locationLoading = false
uni.showModal({
content: JSON.stringify(error),
title: '定位失败'
})
});
}
} else {
this.id = e.id
this.requestItem(e.id);
}
},
fail(err) {},
complete: () => {}
})
} }
}); });
uni.getStorage({
key: 'token',
success: (token) => {
this.token = token.data;
if (!e.id) {
// uni.getLocation({
// type: 'wgs84',
// success: (res) => {
// this.jd = res.longitude;
// this.wd = res.latitude;
// }
// });
this.locationLoading = true
plus.geolocation.getCurrentPosition((res) => {
this.jd = res.coords.longitude;
this.wd = res.coords.latitude;
this.locationLoading = false
// resolve({
// lat: res.coords.latitude,
// lng: res.coords.longitude
// });
}, (error) => {
this.locationLoading = false
// uni.showToast({
// title: error.message,
// duration: 3000,
// icon: 'icon'
// });
// reject();
});
} else {
this.id = e.id
this.requestItem(e.id);
}
},
fail(err) {},
complete: () => {}
})
}, },
methods: { methods: {
delImg(index) { delImg(index) {
@ -153,7 +158,7 @@
const str = item.geom?.replace('POINT (', '').replace(')', ''); const str = item.geom?.replace('POINT (', '').replace(')', '');
console.log(str) console.log(str)
const strs = str.split(' '); const strs = str.split(' ');
this.jd = parseFloat(strs[0]); this.jd = parseFloat(strs[0]);
this.wd = parseFloat(strs[1]); this.wd = parseFloat(strs[1]);
this.reason = item.reason; this.reason = item.reason;
this.imgStrs = item.img?.split(','); this.imgStrs = item.img?.split(',');

@ -13,7 +13,7 @@
<view class="action"> <view class="action">
<view class="title2">草原核查数据</view> <view class="title2">草原核查数据</view>
<view class="flex" style="margin-top: 24px;"> <view class="flex" style="margin-top: 24px;">
<view class="action-btn fill flex" style="margin-right: 12px;" @click="toSjsb"> <view class="action-btn fill flex" style="margin-right: 12px;justify-content: flex-start;" @click="toSjsb">
<image src="/static/sjsb.png" class="action-img"></image> <image src="/static/sjsb.png" class="action-img"></image>
<text class="action-text">数据上报</text> <text class="action-text">数据上报</text>
<image src="/static/jr.png" class="action-arrow"></image> <image src="/static/jr.png" class="action-arrow"></image>
@ -24,8 +24,8 @@
<image src="/static/jr.png" class="action-arrow"></image> <image src="/static/jr.png" class="action-arrow"></image>
</view> </view>
</view> </view>
<view class="flex"> <view class="flex" style="margin-top: 12px;">
<view class="action-btn fill flex" style="align-items: center;justify-content: flex-start;margin-left: 4px;" @click="toLssjgl"> <view class="action-btn fill flex" style="align-items: center;justify-content: flex-start;" @click="toLssjgl">
<image src="/static/sjgl.png" class="action-img"></image> <image src="/static/sjgl.png" class="action-img"></image>
<text class="action-text">临时数据管理</text> <text class="action-text">临时数据管理</text>
<image src="/static/jr.png" class="action-arrow"></image> <image src="/static/jr.png" class="action-arrow"></image>
@ -74,8 +74,8 @@
} }
.action-img { .action-img {
width: 64px; width: 48px;
height: 64px; height: 48px;
margin-bottom: -14px; margin-bottom: -14px;
} }

Loading…
Cancel
Save