Browse Source

打包

master
chenkainan 8 months ago
parent
commit
f7eddb2103
  1. 2
      index.html
  2. 2
      manifest.json
  3. 51
      pages/index/index.vue
  4. 2
      unpackage/dist/build/web/index.html
  5. 2
      unpackage/dist/build/web/static/js/index.6ac4c6c0.js
  6. 1
      unpackage/dist/build/web/static/js/pages-index-index.07e77446.js
  7. 1
      unpackage/dist/build/web/static/js/pages-index-index.cf89c900.js

2
index.html

@ -10,6 +10,8 @@
(coverSupport ? ', viewport-fit=cover' : '') + '" />') (coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script> </script>
<title>苏州市导游协会</title> <title>苏州市导游协会</title>
<!-- 引入腾讯地图 SDK -->
<script src="https://map.qq.com/api/js?v=2.exp&key=XCJBZ-XJVL5-JCYID-IYEOP-AM7I2-2CF7E"></script>
<!--preload-links--> <!--preload-links-->
<!--app-context--> <!--app-context-->
</head> </head>

2
manifest.json

@ -99,7 +99,7 @@
"key" : "4QQBZ-35LWQ-7725U-45ZGA-MIB5E-ZXBEA" "key" : "4QQBZ-35LWQ-7725U-45ZGA-MIB5E-ZXBEA"
}, },
"tencent" : { "tencent" : {
"key" : "YVOBZ-MWJ3Z-34IXK-7J2GL-O33US-QLF5X" "key" : "XCJBZ-XJVL5-JCYID-IYEOP-AM7I2-2CF7E"
} }
} }
} }

51
pages/index/index.vue

@ -85,6 +85,13 @@
isChecked: false isChecked: false
}], }],
isAllChecked: false, isAllChecked: false,
//
fenceCenter: {
latitude: 31.266909,
longitude: 120.633401
},
//
fenceRadius: 500
} }
}, },
onLoad() { onLoad() {
@ -100,6 +107,7 @@
if (navigator.geolocation) { if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition( navigator.geolocation.getCurrentPosition(
(position) => { (position) => {
//
const coords = position.coords; const coords = position.coords;
console.log('纬度: ', coords.latitude); console.log('纬度: ', coords.latitude);
console.log('经度: ', coords.longitude); console.log('经度: ', coords.longitude);
@ -108,6 +116,9 @@
console.log('高度精度: ', coords.altitudeAccuracy); console.log('高度精度: ', coords.altitudeAccuracy);
console.log('移动方向: ', coords.heading); console.log('移动方向: ', coords.heading);
console.log('移动速度: ', coords.speed); console.log('移动速度: ', coords.speed);
const [gcj02Lng, gcj02Lat] = this.wgs84ToGcj02(coords.longitude, coords.latitude);
console.log('转换后的 GCJ - 02 经度:', gcj02Lng);
console.log('转换后的 GCJ - 02 纬度:', gcj02Lat);
}, },
(error) => { (error) => {
let locationStatus = '' let locationStatus = ''
@ -141,6 +152,46 @@
}) })
} }
}, },
// WGS84GCJ-02
//
outOfChina(lng, lat) {
return (lng < 72.004 || lng > 137.8347) || (lat < 0.8293 || lat > 55.8271);
},
//
transformLat(x, y) {
let ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * Math.PI) + 20.0 * Math.sin(2.0 * x * Math.PI)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(y * Math.PI) + 40.0 * Math.sin(y / 3.0 * Math.PI)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(y / 12.0 * Math.PI) + 320 * Math.sin(y * Math.PI / 30.0)) * 2.0 / 3.0;
return ret;
},
//
transformLng(x, y) {
let ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * Math.PI) + 20.0 * Math.sin(2.0 * x * Math.PI)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(x * Math.PI) + 40.0 * Math.sin(x / 3.0 * Math.PI)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(x / 12.0 * Math.PI) + 300.0 * Math.sin(x / 30.0 * Math.PI)) * 2.0 / 3.0;
return ret;
},
// WGS84 GCJ02
wgs84ToGcj02(lng, lat) {
const a = 6378245.0; //
const ee = 0.00669342162296594323; //
if (this.outOfChina(lng, lat)) {
return [lng, lat];
}
let dLat = this.transformLat(lng - 105.0, lat - 35.0);
let dLng = this.transformLng(lng - 105.0, lat - 35.0);
const radLat = lat / 180.0 * Math.PI;
let magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
const sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * Math.PI);
dLng = (dLng * 180.0) / (a / sqrtMagic * Math.cos(radLat) * Math.PI);
const mgLat = lat + dLat;
const mgLng = lng + dLng;
return [mgLng, mgLat];
},
goHX() { goHX() {
uni.switchTab({ uni.switchTab({
url: '/pages/verification/index' url: '/pages/verification/index'

2
unpackage/dist/build/web/index.html

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>daoyou</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>daoyou</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.27f6cb6a.js></script><script src=/static/js/index.32e9e603.js></script></body></html> document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.27f6cb6a.js></script><script src=/static/js/index.6ac4c6c0.js></script></body></html>

2
unpackage/dist/build/web/static/js/index.32e9e603.js → unpackage/dist/build/web/static/js/index.6ac4c6c0.js

File diff suppressed because one or more lines are too long

1
unpackage/dist/build/web/static/js/pages-index-index.07e77446.js

File diff suppressed because one or more lines are too long

1
unpackage/dist/build/web/static/js/pages-index-index.cf89c900.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save