|
|
@@ -19,8 +19,15 @@
|
|
|
@touchend.prevent="touchend"
|
|
|
@touchcancel.prevent="touchcancel"
|
|
|
>
|
|
|
- <image src="/native/imgs/btn_route.png" class="btn-route" @click="route"></image>
|
|
|
- <div class="btn-where" @click="scanCode">我在哪儿</div>
|
|
|
+ <div class="map-btns" v-if="!showTab">
|
|
|
+ <image src="/native/imgs/map_btns.png" class="img-btns"></image>
|
|
|
+ <div class="btns">
|
|
|
+ <div class="btn" @click="showLandMarkDialog = true"></div>
|
|
|
+ <div class="btn" @click="scanCode"></div>
|
|
|
+ <div class="btn" @click="route"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="tabbar" v-if="showTab">
|
|
|
<div class="tab" @click="switchTab('/pages/home')">
|
|
|
<image src="/native/tabbar/tab_home_active.png" class="tab-icon"></image>
|
|
|
@@ -42,6 +49,7 @@
|
|
|
@click="showTab = !showTab"
|
|
|
></image>
|
|
|
<image v-else src="/native/imgs/icon_tri.png" class="icon-tri" @click="showTab = !showTab"></image>
|
|
|
+
|
|
|
<purchase-dialog
|
|
|
:visible.sync="showPurchaseDialog"
|
|
|
@success="onPurchaseSuccess"
|
|
|
@@ -81,7 +89,7 @@
|
|
|
<div class="body">
|
|
|
<div class="title">提示</div>
|
|
|
<div class="content">
|
|
|
- <span>可以用收拾缩放地图</span>
|
|
|
+ <span>可以用手势缩放地图</span>
|
|
|
<img src="../static/imgs/img_scale.png" />
|
|
|
</div>
|
|
|
<div class="btn" @click="showFirstOpenDialog = false">确定</div>
|
|
|
@@ -91,7 +99,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { mapGetters } from 'vuex';
|
|
|
+import { mapGetters, mapState } from 'vuex';
|
|
|
import NavigationBar from '../components/NavigationBar';
|
|
|
import YrobotTouch from '../YrobotTouch';
|
|
|
import qs from 'qs';
|
|
|
@@ -174,6 +182,25 @@ export default {
|
|
|
multipointStart: function() {},
|
|
|
multipointEnd: function() {},
|
|
|
tap: e => {
|
|
|
+ try {
|
|
|
+ let opened = wx.getStorageSync('opened');
|
|
|
+ if (!opened) {
|
|
|
+ this.showFirstOpenDialog = true;
|
|
|
+ wx.setStorage({
|
|
|
+ key: 'opened',
|
|
|
+ data: 'true'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ this.showFirstOpenDialog = true;
|
|
|
+ wx.setStorage({
|
|
|
+ key: 'opened',
|
|
|
+ data: 'true'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
let p = convertPoint(e.changedTouches[0]);
|
|
|
if (p.x >= 0 && p.y >= 0 && p.x < this.mapWidth && p.y < this.mapHeight) {
|
|
|
let arr = this.scenicSpots
|
|
|
@@ -213,6 +240,26 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
mounted() {
|
|
|
+ let safeAreaBottom = 0;
|
|
|
+
|
|
|
+ wx.getStorage({
|
|
|
+ key: 'showGuide',
|
|
|
+ success(res) {},
|
|
|
+ fail() {
|
|
|
+ wx.previewImage({
|
|
|
+ current: 'https://yimishijie-ma.oss-cn-hangzhou.aliyuncs.com/guide1.jpg',
|
|
|
+ urls: [
|
|
|
+ 'https://yimishijie-ma.oss-cn-hangzhou.aliyuncs.com/guide1.jpg',
|
|
|
+ 'https://yimishijie-ma.oss-cn-hangzhou.aliyuncs.com/guide2.jpg'
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ wx.setStorage({
|
|
|
+ key: 'showGuide',
|
|
|
+ data: 'true'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
wx.showLoading({ title: '加载中' });
|
|
|
this.$http
|
|
|
.get(`/scenic/get/${this.$mp.query.id}`)
|
|
|
@@ -229,7 +276,6 @@ export default {
|
|
|
this.graph = graph;
|
|
|
delete res.mapData;
|
|
|
this.scenicInfo = res;
|
|
|
- this.showLandMarkDialog = true;
|
|
|
return Promise.resolve();
|
|
|
})
|
|
|
.then(() => {
|
|
|
@@ -338,8 +384,9 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['screenWidth', 'statusBarHeight']),
|
|
|
+ ...mapState(['sysInfo']),
|
|
|
hasGuide() {
|
|
|
- if (this.selectedSpot && this.selectedSpot.guides.length > 1) {
|
|
|
+ if (this.selectedSpot && this.selectedSpot.guides.length > 0) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
@@ -602,21 +649,19 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
route() {
|
|
|
- if (!this.start) {
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '请先点击“我在哪儿”进行定位',
|
|
|
- showCancel: false
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
+ wx.previewImage({
|
|
|
+ current: 'https://yimishijie-ma.oss-cn-hangzhou.aliyuncs.com/guide1.jpg',
|
|
|
+ urls: [
|
|
|
+ 'https://yimishijie-ma.oss-cn-hangzhou.aliyuncs.com/guide1.jpg',
|
|
|
+ 'https://yimishijie-ma.oss-cn-hangzhou.aliyuncs.com/guide2.jpg'
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ return;
|
|
|
wx.showLoading({
|
|
|
title: '加载中'
|
|
|
});
|
|
|
this.$http
|
|
|
.get('/scenic/route', {
|
|
|
- x: this.start.x,
|
|
|
- y: this.start.y,
|
|
|
scenicId: this.$mp.query.id
|
|
|
})
|
|
|
.then(result => {
|
|
|
@@ -721,14 +766,14 @@ export default {
|
|
|
},
|
|
|
onDismiss() {
|
|
|
wx.getStorage({
|
|
|
- key: 'firstOpen',
|
|
|
+ key: 'opened',
|
|
|
success(res) {
|
|
|
console.log(res);
|
|
|
},
|
|
|
fail: res => {
|
|
|
this.showFirstOpenDialog = true;
|
|
|
wx.setStorage({
|
|
|
- key: 'firstOpen',
|
|
|
+ key: 'opened',
|
|
|
data: 'false'
|
|
|
});
|
|
|
}
|
|
|
@@ -765,6 +810,33 @@ export default {
|
|
|
font-size: 15px;
|
|
|
color: white;
|
|
|
}
|
|
|
+.map-btns {
|
|
|
+ width: 216px;
|
|
|
+ height: 65px;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 5px;
|
|
|
+ bottom: calc(env(safe-area-inset-bottom) + 5px);
|
|
|
+ margin: 0 auto;
|
|
|
+ .img-btns {
|
|
|
+ width: 216px;
|
|
|
+ height: 65px;
|
|
|
+ }
|
|
|
+ .btns {
|
|
|
+ position: absolute;
|
|
|
+ width: 216px;
|
|
|
+ height: 65px;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ .flex();
|
|
|
+ .btn {
|
|
|
+ flex-grow: 1;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
.tabbar {
|
|
|
position: absolute;
|
|
|
bottom: 0;
|