From 05273ace3da665cb10c36ca0dac4413a8284302a Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期三, 17 五月 2023 18:10:36 +0800
Subject: [PATCH] 增加部分限制,增加新功能
---
pages/public-page/mapRoute/mapRoute.vue | 73 +++++++++++++++++++-----------------
1 files changed, 39 insertions(+), 34 deletions(-)
diff --git a/pages/public-page/mapRoute/mapRoute.vue b/pages/public-page/mapRoute/mapRoute.vue
index 24b8544..5671a6b 100644
--- a/pages/public-page/mapRoute/mapRoute.vue
+++ b/pages/public-page/mapRoute/mapRoute.vue
@@ -2,7 +2,16 @@
<view>
<view class="page-body" style="margin-top: 4rpx;">
<view class="page-section page-section-gap">
- <map style="width: 100%; height: 600px;" :latitude="latitude" :longitude="longitude" :markers="markers" :polyline="polyline"></map>
+ <map
+ style="width: 100%; height: 600px;"
+ :latitude="latitude"
+ :longitude="longitude"
+ :markers="markers"
+ :polyline="polyline"
+ @markertap="awaken"
+ @callouttap="awaken"
+ @tap="awaken"
+ ></map>
</view>
</view>
<view class="tip">
@@ -15,7 +24,7 @@
<text>{{ duration || '' }}</text>
</view>
</view>
- <!-- <view class="" @click="awaken"><button type="default">璺宠浆</button></view> -->
+ <view class="open-button" @click="awaken"><u-button type="primary">浣跨敤鎵嬫満鍦板浘</u-button></view>
</view>
</template>
@@ -45,11 +54,11 @@
id: 0,
callout: {
content: '璧风偣', //鏂囨湰
- color: '#000000', //鏂囧瓧棰滆壊
- fontSize: 14, //鏂囨湰澶у皬
- borderRadius: 15, //杈规鍦嗚
+ color: '#ffffff', //鏂囧瓧棰滆壊
+ fontSize: 10, //鏂囨湰澶у皬
+ borderRadius: 12, //杈规鍦嗚
borderWidth: '10',
- bgColor: '#e51860', //鑳屾櫙棰滆壊
+ bgColor: '#08b078', //鑳屾櫙棰滆壊
display: 'ALWAYS' //甯告樉
}
},
@@ -63,10 +72,10 @@
callout: {
content: '缁堢偣', //鏂囨湰
color: '#ffffff', //鏂囧瓧棰滆壊
- fontSize: 14, //鏂囨湰澶у皬
- borderRadius: 15, //杈规鍦嗚
+ fontSize: 10, //鏂囨湰澶у皬
+ borderRadius: 12, //杈规鍦嗚
borderWidth: '10',
- bgColor: '#e51860', //鑳屾櫙棰滆壊
+ bgColor: '#fc645c', //鑳屾櫙棰滆壊
display: 'ALWAYS' //甯告樉
}
}
@@ -162,7 +171,7 @@
_this.polyline = [
{
points: pl,
- color: '#FF0000DD',
+ color: '#04b474',
width: 4,
arrowLine: true
}
@@ -213,27 +222,11 @@
},
// 鍞ら啋
awaken() {
- uni.getSystemInfo({
- success: function(res) {
- if (res.platform == 'android') {
- uni.navigateTo({
- url: `intent://map/routeplan?type=drive&fromcoord=&from=${_this.fromLocation}&tocoord=${_this.toLocation.latitude},${
- _this.toLocation.longitude
- }&to=name&policy=0&referer=myapp#Intent;scheme=qqmap;package=com.tencent.map;end`
- });
- } else if (res.platform == 'ios') {
- uni.navigateTo({
- url: `qqmap://map/routeplan?type=drive&fromcoord=&from=${_this.fromLocation}&tocoord=${_this.toLocation.latitude},${
- _this.toLocation.longitude
- }&to=name&policy=0&referer=myapp`
- });
- } else {
- uni.showToast({
- title: '褰撳墠璁惧涓嶆敮鎸佸湴鍥惧鑸�',
- icon: 'none'
- });
- }
- }
+ uni.openLocation({
+ latitude: this.markers[1].latitude,
+ longitude: this.markers[1].longitude,
+ name: '鐩殑鍦颁綅缃�',
+ address: '鐩殑鍦颁綅缃�'
});
}
},
@@ -254,18 +247,30 @@
<style lang="scss" scoped>
.tip {
- margin-top: 60rpx;
width: 94%;
- height: 40rpx;
font-size: 40rpx;
+ margin: vww(22) auto;
display: flex;
justify-content: space-around;
.first {
- color: #c78a64;
+ color: #515151;
text {
font-size: 45rpx;
color: #f81414;
}
}
}
+.open-button {
+ width: 100%;
+ margin: 40rpx 0;
+ display: flex;
+ justify-content: center;
+ /deep/.u-button {
+ width: 300rpx;
+ border: 1px solid #3b56eb;
+ border-radius: 37rpx 37rpx 37rpx 37rpx;
+ background-color: transparent;
+ color: #3b56eb;
+ }
+}
</style>
--
Gitblit v1.9.1