Browse Source

打包

master
chenkainan 1 year ago
parent
commit
812b3d6ba2
  1. 6
      pages.json
  2. 56
      pages/map/map.vue
  3. 54
      subPackages/h5Web/h5Web.vue

6
pages.json

@ -293,6 +293,12 @@
"style": {
"navigationBarTitleText": "选择日期"
}
},
{
"path": "h5Web/h5Web",
"style": {
"navigationBarTitleText": ""
}
}
]
}],

56
pages/map/map.vue

@ -1,6 +1,6 @@
<template>
<view class="content">
<map id="map" class="map" :show-location="true" :latitude="latitude" :longitude="longitude"></map>
<web-view src="https://yandumap.sz-trip.com/"></web-view>
</view>
</template>
@ -8,57 +8,14 @@
export default {
data() {
return {
latitude: 33.338538,
longitude: 120.153567,
}
},
onReady() {
this._mapContext = uni.createMapContext("map", this);
// on.("markerClusterCreate", (e) => {})
this._mapContext.initMarkerCluster({
enableDefaultStyle: false,
zoomOnClick: true,
gridSize: 60,
complete(res) {
console.log('initMarkerCluster', res)
}
});
this._mapContext.on("markerClusterCreate", (e) => {
console.log("markerClusterCreate", e);
});
this.addMarkers();
},
methods: {
addMarkers() {
console.log(111,this._mapContext)
this._mapContext.addGroundOverlay({
id: 1,
src: 'https://static.ticket.sz-trip.com/yandu/images/maps/6/53/25.png',
bounds: {
southwest: {//GPS
longitude: 119.700158,
latitude: 33.112837
},
northeast: {//GPS
longitude: 120.25057,
latitude: 33.458095
}
},
zIndex: 1, //
success: () => {
console.log("显示成功", southwest, northeast)
},
fail: (e) => {
console.log("显示失败", e)
},
complete: res => {
console.log(res)
}
})
}
}
}
</script>
@ -68,9 +25,4 @@
width: 100vw;
height: 100vh;
}
.map {
width: 100vw;
height: 100vh;
}
</style>

54
subPackages/h5Web/h5Web.vue

@ -0,0 +1,54 @@
<template>
<view></view>
</template>
<script>
export default {
data() {
return {
}
},
onShow() {
//
const oTherMiniprogramIsBack = uni.getStorageSync('oTherMiniprogramIsBack')
if(oTherMiniprogramIsBack) {
uni.showModal({
title: '是否返回...',
success: () => {
uni.removeStorageSync('oTherMiniprogramIsBack')
uni.navigateBack();
}
})
}
},
onLoad(option) {
let data = JSON.parse(option.data)
if(data && data.type == 'xcx') {
uni.navigateToMiniProgram({
shortLink: data.url,
success(res) {
uni.setStorageSync('oTherMiniprogramIsBack', 1)
}
})
}else {
uni.openLocation({
longitude: Number(data.lon), //
latitude: Number(data.lat), //
name: data.address || data.title || data.name, //
address: data.address, //
complete: res => {
if(res.errMsg.indexOf("openLocation:ok") != -1) {
uni.switchTab({
url: '/pages/map/map'
})
}
}
})
}
}
}
</script>
<style>
</style>
Loading…
Cancel
Save