Commit 9ebd710b795132a137986ba7b7b644cab6a3107a
Merge branch 'master' of http://39.98.150.180/wangming/DeYangHighTechApp
Showing
7 changed files
with
895 additions
and
187 deletions
components/qj-fuzzy-search/index2.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <cover-view class="index"> | ||
| 3 | + <cover-view class="search" v-if="show"> | ||
| 4 | + <cover-view v-for="item in list" :key="item[valueName]" class="item" :style="[setItemStyle]" | ||
| 5 | + hover-class="item-hover" hover-start-time="0" hover-stay-time="100" @click="click(item)"> | ||
| 6 | + <cover-view class="item" style="padding-left: 10rpx;" | ||
| 7 | + @click="click(item)">{{ item[labelName] }}</cover-view> | ||
| 8 | + </cover-view> | ||
| 9 | + <!-- <cover-view class="empty" v-else>{{ noData }}</cover-view> --> | ||
| 10 | + </cover-view> | ||
| 11 | + </cover-view> | ||
| 12 | +</template> | ||
| 13 | + | ||
| 14 | +<script> | ||
| 15 | + export default { | ||
| 16 | + props: { | ||
| 17 | + /** 展示整体组件 */ | ||
| 18 | + show: { | ||
| 19 | + type: Boolean, | ||
| 20 | + default: false | ||
| 21 | + }, | ||
| 22 | + /** 需要展示的列表 */ | ||
| 23 | + list: { | ||
| 24 | + type: Array, | ||
| 25 | + default: () => [] | ||
| 26 | + }, | ||
| 27 | + /** 自定义label */ | ||
| 28 | + labelName: { | ||
| 29 | + type: String, | ||
| 30 | + default: 'label' | ||
| 31 | + }, | ||
| 32 | + /** 自定义value */ | ||
| 33 | + valueName: { | ||
| 34 | + type: String, | ||
| 35 | + default: 'value' | ||
| 36 | + }, | ||
| 37 | + /** 无内容时显示的内容 */ | ||
| 38 | + noData: { | ||
| 39 | + type: String, | ||
| 40 | + default: '暂无匹配企业...' | ||
| 41 | + }, | ||
| 42 | + /** item的对齐样式 */ | ||
| 43 | + align: { | ||
| 44 | + type: String, | ||
| 45 | + default: 'left', | ||
| 46 | + validator: value => { | ||
| 47 | + return ['left', 'center', 'right'].includes(value); | ||
| 48 | + } | ||
| 49 | + }, | ||
| 50 | + /** 自定义item展示样式 */ | ||
| 51 | + customStyle: { | ||
| 52 | + type: Object, | ||
| 53 | + default: () => ({}) | ||
| 54 | + } | ||
| 55 | + }, | ||
| 56 | + computed: { | ||
| 57 | + /** 设置item的样式 */ | ||
| 58 | + setItemStyle() { | ||
| 59 | + const { | ||
| 60 | + align, | ||
| 61 | + customStyle | ||
| 62 | + } = this; | ||
| 63 | + return { | ||
| 64 | + textAlign: align, | ||
| 65 | + ...customStyle | ||
| 66 | + }; | ||
| 67 | + } | ||
| 68 | + }, | ||
| 69 | + methods: { | ||
| 70 | + /** item点击事件 */ | ||
| 71 | + click(item) { | ||
| 72 | + this.$emit('select', { | ||
| 73 | + ...item | ||
| 74 | + }); | ||
| 75 | + }, | ||
| 76 | + /** 触底加载下一页 */ | ||
| 77 | + scrolltolower() { | ||
| 78 | + this.$emit('scrolltolower'); | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + }; | ||
| 82 | +</script> | ||
| 83 | + | ||
| 84 | +<style lang="scss" scoped> | ||
| 85 | + .index { | ||
| 86 | + width: 99%; | ||
| 87 | + position: absolute; | ||
| 88 | + z-index: 9; | ||
| 89 | + | ||
| 90 | + | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + .search { | ||
| 94 | + height: 500rpx; | ||
| 95 | + | ||
| 96 | + overflow-x: hidden; | ||
| 97 | + | ||
| 98 | + .item { | ||
| 99 | + font-size: 26rpx; | ||
| 100 | + height: 60rpx; | ||
| 101 | + line-height: 60rpx; | ||
| 102 | + background-color: #fff; | ||
| 103 | + | ||
| 104 | + &-hover { | ||
| 105 | + background-color: #f5f5f5; | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | +</style> | ||
| 0 | \ No newline at end of file | 110 | \ No newline at end of file |
node_modules/.package_versions.json
0 → 100644
pages.json
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | "^ncc-(.*)": "@/components/ncc/ncc-$1/index.vue" | 4 | "^ncc-(.*)": "@/components/ncc/ncc-$1/index.vue" |
| 5 | }, | 5 | }, |
| 6 | "pages": [ | 6 | "pages": [ |
| 7 | - | 7 | + |
| 8 | { | 8 | { |
| 9 | "path": "pages/home/home", | 9 | "path": "pages/home/home", |
| 10 | "style": { | 10 | "style": { |
| @@ -34,33 +34,33 @@ | @@ -34,33 +34,33 @@ | ||
| 34 | "navigationBarTitleText": "需求详情", | 34 | "navigationBarTitleText": "需求详情", |
| 35 | "navigationBarBackgroundColor": "#FFFFFF" | 35 | "navigationBarBackgroundColor": "#FFFFFF" |
| 36 | } | 36 | } |
| 37 | - }, | 37 | + }, |
| 38 | { | 38 | { |
| 39 | "path": "pages/supply/supply", | 39 | "path": "pages/supply/supply", |
| 40 | "style": { | 40 | "style": { |
| 41 | "navigationBarTitleText": "供应中心", | 41 | "navigationBarTitleText": "供应中心", |
| 42 | "navigationBarBackgroundColor": "#FFFFFF" | 42 | "navigationBarBackgroundColor": "#FFFFFF" |
| 43 | } | 43 | } |
| 44 | - }, | 44 | + }, |
| 45 | { | 45 | { |
| 46 | "path": "pages/datain/datain", | 46 | "path": "pages/datain/datain", |
| 47 | "style": { | 47 | "style": { |
| 48 | "navigationBarTitleText": "数据填报", | 48 | "navigationBarTitleText": "数据填报", |
| 49 | "navigationBarBackgroundColor": "#FFFFFF" | 49 | "navigationBarBackgroundColor": "#FFFFFF" |
| 50 | } | 50 | } |
| 51 | - },{ | 51 | + }, { |
| 52 | "path": "pages/policy/policy", | 52 | "path": "pages/policy/policy", |
| 53 | "style": { | 53 | "style": { |
| 54 | "navigationBarTitleText": "政策法规", | 54 | "navigationBarTitleText": "政策法规", |
| 55 | "navigationBarBackgroundColor": "#FFFFFF" | 55 | "navigationBarBackgroundColor": "#FFFFFF" |
| 56 | } | 56 | } |
| 57 | - },{ | 57 | + }, { |
| 58 | "path": "pages/notice/notice", | 58 | "path": "pages/notice/notice", |
| 59 | "style": { | 59 | "style": { |
| 60 | "navigationBarTitleText": "公示公告", | 60 | "navigationBarTitleText": "公示公告", |
| 61 | "navigationBarBackgroundColor": "#FFFFFF" | 61 | "navigationBarBackgroundColor": "#FFFFFF" |
| 62 | } | 62 | } |
| 63 | - },{ | 63 | + }, { |
| 64 | "path": "pages/construct/construct", | 64 | "path": "pages/construct/construct", |
| 65 | "style": { | 65 | "style": { |
| 66 | "navigationBarTitleText": "党的建设", | 66 | "navigationBarTitleText": "党的建设", |
| @@ -73,49 +73,49 @@ | @@ -73,49 +73,49 @@ | ||
| 73 | "navigationBarTitleText": "", | 73 | "navigationBarTitleText": "", |
| 74 | "navigationBarBackgroundColor": "#FFFFFF" | 74 | "navigationBarBackgroundColor": "#FFFFFF" |
| 75 | } | 75 | } |
| 76 | - },{ | 76 | + }, { |
| 77 | "path": "pages/data/data", | 77 | "path": "pages/data/data", |
| 78 | "style": { | 78 | "style": { |
| 79 | "navigationBarTitleText": "数据填报", | 79 | "navigationBarTitleText": "数据填报", |
| 80 | "navigationBarBackgroundColor": "#FFFFFF" | 80 | "navigationBarBackgroundColor": "#FFFFFF" |
| 81 | } | 81 | } |
| 82 | - },{ | 82 | + }, { |
| 83 | "path": "pages/Feedback/Feedback", | 83 | "path": "pages/Feedback/Feedback", |
| 84 | "style": { | 84 | "style": { |
| 85 | "navigationBarTitleText": "我要办事", | 85 | "navigationBarTitleText": "我要办事", |
| 86 | "navigationBarBackgroundColor": "#FFFFFF" | 86 | "navigationBarBackgroundColor": "#FFFFFF" |
| 87 | } | 87 | } |
| 88 | - },{ | 88 | + }, { |
| 89 | "path": "pages/map/map", | 89 | "path": "pages/map/map", |
| 90 | "style": { | 90 | "style": { |
| 91 | "navigationBarTitleText": "企业地图", | 91 | "navigationBarTitleText": "企业地图", |
| 92 | "navigationBarBackgroundColor": "#FFFFFF" | 92 | "navigationBarBackgroundColor": "#FFFFFF" |
| 93 | } | 93 | } |
| 94 | - },{ | 94 | + }, { |
| 95 | "path": "pages/demand/demand", | 95 | "path": "pages/demand/demand", |
| 96 | "style": { | 96 | "style": { |
| 97 | "navigationBarTitleText": "需求中心", | 97 | "navigationBarTitleText": "需求中心", |
| 98 | "navigationBarBackgroundColor": "#FFFFFF" | 98 | "navigationBarBackgroundColor": "#FFFFFF" |
| 99 | } | 99 | } |
| 100 | - },{ | 100 | + }, { |
| 101 | "path": "pages/official/official", | 101 | "path": "pages/official/official", |
| 102 | "style": { | 102 | "style": { |
| 103 | "navigationBarTitleText": "公文办理", | 103 | "navigationBarTitleText": "公文办理", |
| 104 | "navigationBarBackgroundColor": "#FFFFFF" | 104 | "navigationBarBackgroundColor": "#FFFFFF" |
| 105 | } | 105 | } |
| 106 | - },{ | 106 | + }, { |
| 107 | "path": "pages/neighbor/neighbor", | 107 | "path": "pages/neighbor/neighbor", |
| 108 | "style": { | 108 | "style": { |
| 109 | "navigationBarTitleText": "邻居计划", | 109 | "navigationBarTitleText": "邻居计划", |
| 110 | "navigationBarBackgroundColor": "#FFFFFF" | 110 | "navigationBarBackgroundColor": "#FFFFFF" |
| 111 | } | 111 | } |
| 112 | - },{ | 112 | + }, { |
| 113 | "path": "pages/talent/talent", | 113 | "path": "pages/talent/talent", |
| 114 | "style": { | 114 | "style": { |
| 115 | "navigationBarTitleText": "人才服务", | 115 | "navigationBarTitleText": "人才服务", |
| 116 | "navigationBarBackgroundColor": "#FFFFFF" | 116 | "navigationBarBackgroundColor": "#FFFFFF" |
| 117 | } | 117 | } |
| 118 | - },{ | 118 | + }, { |
| 119 | "path": "pages/equip/equip", | 119 | "path": "pages/equip/equip", |
| 120 | "style": { | 120 | "style": { |
| 121 | "navigationBarTitleText": "机构", | 121 | "navigationBarTitleText": "机构", |
| @@ -239,155 +239,136 @@ | @@ -239,155 +239,136 @@ | ||
| 239 | "path": "pages/form/index" | 239 | "path": "pages/form/index" |
| 240 | }, | 240 | }, |
| 241 | { | 241 | { |
| 242 | - "path" : "pages/policyDetail/policyDetail", | ||
| 243 | - "style" : | ||
| 244 | - { | ||
| 245 | - "navigationBarTitleText" : "政策详情", | ||
| 246 | - "enablePullDownRefresh" : false | 242 | + "path": "pages/policyDetail/policyDetail", |
| 243 | + "style": { | ||
| 244 | + "navigationBarTitleText": "政策详情", | ||
| 245 | + "enablePullDownRefresh": false | ||
| 247 | } | 246 | } |
| 248 | }, | 247 | }, |
| 249 | { | 248 | { |
| 250 | - "path" : "pages/newsDetail/newsDetail", | ||
| 251 | - "style" : | ||
| 252 | - { | ||
| 253 | - "navigationBarTitleText" : "新闻详情", | ||
| 254 | - "enablePullDownRefresh" : false | 249 | + "path": "pages/newsDetail/newsDetail", |
| 250 | + "style": { | ||
| 251 | + "navigationBarTitleText": "新闻详情", | ||
| 252 | + "enablePullDownRefresh": false | ||
| 255 | } | 253 | } |
| 256 | }, | 254 | }, |
| 257 | { | 255 | { |
| 258 | - "path" : "pages/talentDetail/talentDetail", | ||
| 259 | - "style" : | ||
| 260 | - { | ||
| 261 | - "navigationBarTitleText" : "职位详情", | ||
| 262 | - "enablePullDownRefresh" : false | 256 | + "path": "pages/talentDetail/talentDetail", |
| 257 | + "style": { | ||
| 258 | + "navigationBarTitleText": "职位详情", | ||
| 259 | + "enablePullDownRefresh": false | ||
| 263 | } | 260 | } |
| 264 | }, | 261 | }, |
| 265 | { | 262 | { |
| 266 | - "path" : "pages/allCompany/allCompany", | ||
| 267 | - "style" : | ||
| 268 | - { | ||
| 269 | - "navigationBarTitleText" : "企业", | ||
| 270 | - "enablePullDownRefresh" : false | 263 | + "path": "pages/allCompany/allCompany", |
| 264 | + "style": { | ||
| 265 | + "navigationBarTitleText": "企业", | ||
| 266 | + "enablePullDownRefresh": false | ||
| 271 | } | 267 | } |
| 272 | }, | 268 | }, |
| 273 | { | 269 | { |
| 274 | - "path" : "pages/companyDetail/companyDetail", | ||
| 275 | - "style" : | ||
| 276 | - { | ||
| 277 | - "navigationBarTitleText" : "企业详情", | ||
| 278 | - "enablePullDownRefresh" : false | 270 | + "path": "pages/companyDetail/companyDetail", |
| 271 | + "style": { | ||
| 272 | + "navigationBarTitleText": "企业详情", | ||
| 273 | + "enablePullDownRefresh": false | ||
| 279 | } | 274 | } |
| 280 | }, | 275 | }, |
| 281 | { | 276 | { |
| 282 | - "path" : "pages/postTalent/postTalent", | ||
| 283 | - "style" : | ||
| 284 | - { | ||
| 285 | - "navigationBarTitleText" : "人才招聘发布", | ||
| 286 | - "enablePullDownRefresh" : false | 277 | + "path": "pages/postTalent/postTalent", |
| 278 | + "style": { | ||
| 279 | + "navigationBarTitleText": "人才招聘发布", | ||
| 280 | + "enablePullDownRefresh": false | ||
| 287 | } | 281 | } |
| 288 | }, | 282 | }, |
| 289 | { | 283 | { |
| 290 | - "path" : "pages/fileLook/fileLook", | ||
| 291 | - "style" : | ||
| 292 | - { | ||
| 293 | - "navigationBarTitleText" : "信息回执", | ||
| 294 | - "enablePullDownRefresh" : false | 284 | + "path": "pages/fileLook/fileLook", |
| 285 | + "style": { | ||
| 286 | + "navigationBarTitleText": "信息回执", | ||
| 287 | + "enablePullDownRefresh": false | ||
| 295 | } | 288 | } |
| 296 | }, | 289 | }, |
| 297 | { | 290 | { |
| 298 | - "path" : "pages/postProduct/postProduct", | ||
| 299 | - "style" : | ||
| 300 | - { | ||
| 301 | - "navigationBarTitleText" : "发布产品", | ||
| 302 | - "enablePullDownRefresh" : false | 291 | + "path": "pages/postProduct/postProduct", |
| 292 | + "style": { | ||
| 293 | + "navigationBarTitleText": "发布产品", | ||
| 294 | + "enablePullDownRefresh": false | ||
| 303 | } | 295 | } |
| 304 | }, | 296 | }, |
| 305 | { | 297 | { |
| 306 | - "path" : "pages/postDemand/postDemand", | ||
| 307 | - "style" : | ||
| 308 | - { | ||
| 309 | - "navigationBarTitleText" : "发布需求", | ||
| 310 | - "enablePullDownRefresh" : false | 298 | + "path": "pages/postDemand/postDemand", |
| 299 | + "style": { | ||
| 300 | + "navigationBarTitleText": "发布需求", | ||
| 301 | + "enablePullDownRefresh": false | ||
| 311 | } | 302 | } |
| 312 | }, | 303 | }, |
| 313 | { | 304 | { |
| 314 | - "path" : "pages/postCon/postCon", | ||
| 315 | - "style" : | ||
| 316 | - { | ||
| 317 | - "navigationBarTitleText" : "党的建设发布", | ||
| 318 | - "enablePullDownRefresh" : false | 305 | + "path": "pages/postCon/postCon", |
| 306 | + "style": { | ||
| 307 | + "navigationBarTitleText": "党的建设发布", | ||
| 308 | + "enablePullDownRefresh": false | ||
| 319 | } | 309 | } |
| 320 | }, | 310 | }, |
| 321 | { | 311 | { |
| 322 | - "path" : "pages/my/myPro/myPro", | ||
| 323 | - "style" : | ||
| 324 | - { | ||
| 325 | - "navigationBarTitleText" : "发布产品列表", | ||
| 326 | - "enablePullDownRefresh" : false | 312 | + "path": "pages/my/myPro/myPro", |
| 313 | + "style": { | ||
| 314 | + "navigationBarTitleText": "发布产品列表", | ||
| 315 | + "enablePullDownRefresh": false | ||
| 327 | } | 316 | } |
| 328 | }, | 317 | }, |
| 329 | { | 318 | { |
| 330 | - "path" : "pages/my/myDemand/myDemand", | ||
| 331 | - "style" : | ||
| 332 | - { | ||
| 333 | - "navigationBarTitleText" : "发布需求列表", | ||
| 334 | - "enablePullDownRefresh" : false | 319 | + "path": "pages/my/myDemand/myDemand", |
| 320 | + "style": { | ||
| 321 | + "navigationBarTitleText": "发布需求列表", | ||
| 322 | + "enablePullDownRefresh": false | ||
| 335 | } | 323 | } |
| 336 | }, | 324 | }, |
| 337 | { | 325 | { |
| 338 | - "path" : "pages/my/myZhao/myZhao", | ||
| 339 | - "style" : | ||
| 340 | - { | ||
| 341 | - "navigationBarTitleText" : "发布招聘列表", | ||
| 342 | - "enablePullDownRefresh" : false | 326 | + "path": "pages/my/myZhao/myZhao", |
| 327 | + "style": { | ||
| 328 | + "navigationBarTitleText": "发布招聘列表", | ||
| 329 | + "enablePullDownRefresh": false | ||
| 343 | } | 330 | } |
| 344 | }, | 331 | }, |
| 345 | { | 332 | { |
| 346 | - "path" : "pages/postNotice/postNotice", | ||
| 347 | - "style" : | ||
| 348 | - { | ||
| 349 | - "navigationBarTitleText" : "公式公告发布", | ||
| 350 | - "enablePullDownRefresh" : false | 333 | + "path": "pages/postNotice/postNotice", |
| 334 | + "style": { | ||
| 335 | + "navigationBarTitleText": "公式公告发布", | ||
| 336 | + "enablePullDownRefresh": false | ||
| 351 | } | 337 | } |
| 352 | }, | 338 | }, |
| 353 | { | 339 | { |
| 354 | - "path" : "pages/postNews/postNews", | ||
| 355 | - "style" : | ||
| 356 | - { | ||
| 357 | - "navigationBarTitleText" : "新闻发布", | ||
| 358 | - "enablePullDownRefresh" : false | 340 | + "path": "pages/postNews/postNews", |
| 341 | + "style": { | ||
| 342 | + "navigationBarTitleText": "新闻发布", | ||
| 343 | + "enablePullDownRefresh": false | ||
| 359 | } | 344 | } |
| 360 | }, | 345 | }, |
| 361 | { | 346 | { |
| 362 | - "path" : "pages/postPolicy/postPolicy", | ||
| 363 | - "style" : | ||
| 364 | - { | ||
| 365 | - "navigationBarTitleText" : "政策发布", | ||
| 366 | - "enablePullDownRefresh" : false | 347 | + "path": "pages/postPolicy/postPolicy", |
| 348 | + "style": { | ||
| 349 | + "navigationBarTitleText": "政策发布", | ||
| 350 | + "enablePullDownRefresh": false | ||
| 367 | } | 351 | } |
| 368 | }, | 352 | }, |
| 369 | { | 353 | { |
| 370 | - "path" : "pages/recommend/recommend", | ||
| 371 | - "style" : | ||
| 372 | - { | ||
| 373 | - "navigationBarTitleText" : "人才推介", | ||
| 374 | - "enablePullDownRefresh" : false | 354 | + "path": "pages/recommend/recommend", |
| 355 | + "style": { | ||
| 356 | + "navigationBarTitleText": "人才推介", | ||
| 357 | + "enablePullDownRefresh": false | ||
| 375 | } | 358 | } |
| 376 | }, | 359 | }, |
| 377 | { | 360 | { |
| 378 | - "path" : "pages/recommend/postRecommend/postRecommend", | ||
| 379 | - "style" : | ||
| 380 | - { | ||
| 381 | - "navigationBarTitleText" : "人才推介发布", | ||
| 382 | - "enablePullDownRefresh" : false | 361 | + "path": "pages/recommend/postRecommend/postRecommend", |
| 362 | + "style": { | ||
| 363 | + "navigationBarTitleText": "人才推介发布", | ||
| 364 | + "enablePullDownRefresh": false | ||
| 383 | } | 365 | } |
| 384 | }, | 366 | }, |
| 385 | { | 367 | { |
| 386 | - "path" : "pages/recommend/recommendInfo/recommendInfo", | ||
| 387 | - "style" : | ||
| 388 | - { | ||
| 389 | - "navigationBarTitleText" : "人才信息", | ||
| 390 | - "enablePullDownRefresh" : false | 368 | + "path": "pages/recommend/recommendInfo/recommendInfo", |
| 369 | + "style": { | ||
| 370 | + "navigationBarTitleText": "人才信息", | ||
| 371 | + "enablePullDownRefresh": false | ||
| 391 | } | 372 | } |
| 392 | }, | 373 | }, |
| 393 | { | 374 | { |
| @@ -414,7 +395,7 @@ | @@ -414,7 +395,7 @@ | ||
| 414 | "enablePullDownRefresh" : false | 395 | "enablePullDownRefresh" : false |
| 415 | } | 396 | } |
| 416 | } | 397 | } |
| 417 | - | 398 | + |
| 418 | // { | 399 | // { |
| 419 | // "path" : "apis/supply/supply", | 400 | // "path" : "apis/supply/supply", |
| 420 | // "style" : | 401 | // "style" : |
| @@ -608,14 +589,12 @@ | @@ -608,14 +589,12 @@ | ||
| 608 | "ly-tree-node": "/components/ly-tree/ly-tree-node" | 589 | "ly-tree-node": "/components/ly-tree/ly-tree-node" |
| 609 | } | 590 | } |
| 610 | }, | 591 | }, |
| 611 | - "condition" : { //模式配置,仅开发期间生效 | 592 | + "condition": { //模式配置,仅开发期间生效 |
| 612 | "current": 0, //当前激活的模式(list 的索引项) | 593 | "current": 0, //当前激活的模式(list 的索引项) |
| 613 | - "list": [ | ||
| 614 | - { | ||
| 615 | - "name": "", //模式名称 | ||
| 616 | - "path": "", //启动页面,必选 | ||
| 617 | - "query": "" //启动参数,在页面的onLoad函数里面得到 | ||
| 618 | - } | ||
| 619 | - ] | 594 | + "list": [{ |
| 595 | + "name": "", //模式名称 | ||
| 596 | + "path": "", //启动页面,必选 | ||
| 597 | + "query": "" //启动参数,在页面的onLoad函数里面得到 | ||
| 598 | + }] | ||
| 620 | } | 599 | } |
| 621 | -} | 600 | -} |
| 601 | +} | ||
| 622 | \ No newline at end of file | 602 | \ No newline at end of file |
pages/map/map copy.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="page"> | ||
| 3 | + <view class="content"> | ||
| 4 | + <cover-view></cover-view> | ||
| 5 | + <view class="bg"> | ||
| 6 | + <!-- <web-view src="../../static/html/map.html" style="width: 100%;height: 100%; position: absolute; z-index: 0;"></web-view> --> | ||
| 7 | + <map style="width: 100%;height: 70%;position: relative;top: 190rpx;" :latitude="latitude" | ||
| 8 | + :longitude="longitude" :markers="covers" :show-location="true"></map> | ||
| 9 | + </view> | ||
| 10 | + <view class="map-content" style="position: relative;z-index: 1000;"> | ||
| 11 | + <!-- 搜索 --> | ||
| 12 | + <view class="search-head"> | ||
| 13 | + <view class="search"> | ||
| 14 | + <image src="../../static/fdj1.png"></image> | ||
| 15 | + <text></text> | ||
| 16 | + <input type="text" v-model="selectName" placeholder="搜索关键词" @input="getCompanyList" /> | ||
| 17 | + </view> | ||
| 18 | + <!-- 显示公司选项 --> | ||
| 19 | + <view class="btn" @click="getCompanyDetail"> | ||
| 20 | + <text>搜索</text> | ||
| 21 | + </view> | ||
| 22 | + </view> | ||
| 23 | + <mo-hu-search :show="selectShow" :list="comList" @select="select" label-name="name" | ||
| 24 | + value-name="id"></mo-hu-search> | ||
| 25 | + </view> | ||
| 26 | + | ||
| 27 | + <view class="bottom"> | ||
| 28 | + <view class="invitation-data"> | ||
| 29 | + <view class="invitation-show"> | ||
| 30 | + <view class="icon" v-show="show"> | ||
| 31 | + <image :src=" baseUrl + logo.url"></image> | ||
| 32 | + </view> | ||
| 33 | + <view class="item"> | ||
| 34 | + <view class="title-btn"> | ||
| 35 | + <view class="title"> | ||
| 36 | + <text class="bt">{{this.companyName}}</text> | ||
| 37 | + </view> | ||
| 38 | + </view> | ||
| 39 | + <view class="describe"> | ||
| 40 | + <text>{{this.dizhi}}</text> | ||
| 41 | + </view> | ||
| 42 | + <view class="describe"> | ||
| 43 | + <text>电话:{{getData.fuzerendianhua}}</text> | ||
| 44 | + <image src="../../static/map1.png"></image> | ||
| 45 | + </view> | ||
| 46 | + <view class="describe"> | ||
| 47 | + <text>营业时间:10:00-20:00</text> | ||
| 48 | + </view> | ||
| 49 | + </view> | ||
| 50 | + <view class="right"> | ||
| 51 | + <view class="red-btn" @click.stop="handleNavigation"> | ||
| 52 | + <image src="../../static/dh.png"></image> | ||
| 53 | + <text>导航</text> | ||
| 54 | + </view> | ||
| 55 | + </view> | ||
| 56 | + </view> | ||
| 57 | + </view> | ||
| 58 | + </view> | ||
| 59 | + </view> | ||
| 60 | + </view> | ||
| 61 | +</template> | ||
| 62 | + | ||
| 63 | +<script> | ||
| 64 | + import request from '@/utils/request.js' | ||
| 65 | + // import moHuSearch from '../../components/qj-fuzzy-search/index.vue' | ||
| 66 | + import moHuSearch from '../../components/qj-fuzzy-search/index.vue' | ||
| 67 | + export default { | ||
| 68 | + components: { | ||
| 69 | + moHuSearch | ||
| 70 | + }, | ||
| 71 | + data() { | ||
| 72 | + return { | ||
| 73 | + keyword: '', | ||
| 74 | + id: 0, // 使用 marker点击事件 需要填写id | ||
| 75 | + title: 'map', | ||
| 76 | + // latitude: 30.602494, | ||
| 77 | + // longitude: 104.073004, | ||
| 78 | + latitude: 30.926786, | ||
| 79 | + longitude: 104.294514, | ||
| 80 | + covers: [{ | ||
| 81 | + latitude: 30.926786, | ||
| 82 | + longitude: 104.294514, | ||
| 83 | + iconPath: '../../static/map_red.png', | ||
| 84 | + // width:20, | ||
| 85 | + // height:26, | ||
| 86 | + }, | ||
| 87 | + // { | ||
| 88 | + // latitude: 39.90, | ||
| 89 | + // longitude: 116.39, | ||
| 90 | + // iconPath: '../../../static/wuganda.png' | ||
| 91 | + // }, | ||
| 92 | + ], | ||
| 93 | + getData: {}, | ||
| 94 | + show: false, | ||
| 95 | + selectShow: false, | ||
| 96 | + selectName: '', | ||
| 97 | + selectId: '', | ||
| 98 | + logo: {}, | ||
| 99 | + baseUrl: 'http://deyanggaoxin.fengshiyun.com', | ||
| 100 | + comList: [], | ||
| 101 | + companyName: '德阳高新区管委会', | ||
| 102 | + dizhi: '广汉市聆湖西路一段一号', | ||
| 103 | + // 我自己的位置经纬度(百度地图需要传入自己的经纬度进行导航) | ||
| 104 | + selfLocation: { | ||
| 105 | + latitude: '', | ||
| 106 | + longitude: '' | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + }, | ||
| 110 | + onLoad() { | ||
| 111 | + // this.getCompanyDetail() | ||
| 112 | + }, | ||
| 113 | + methods: { | ||
| 114 | + // 获取公司列表 | ||
| 115 | + getCompanyList() { | ||
| 116 | + this.selectShow = true | ||
| 117 | + // this.$refs.sou.open() | ||
| 118 | + request({ | ||
| 119 | + url: '/api/permission/organize/GetSelectList', | ||
| 120 | + method: 'get', | ||
| 121 | + data: { | ||
| 122 | + keyword: this.selectName | ||
| 123 | + } | ||
| 124 | + }).then(res => { | ||
| 125 | + if (res.code === 200) { | ||
| 126 | + // console.log(res) | ||
| 127 | + this.comList = res.data.list.map(it => { | ||
| 128 | + return { | ||
| 129 | + id: it.id, | ||
| 130 | + name: it.fullName | ||
| 131 | + } | ||
| 132 | + }) | ||
| 133 | + // console.log(this.comList) | ||
| 134 | + this.comList = JSON.parse(JSON.stringify(this.comList)) | ||
| 135 | + } | ||
| 136 | + }) | ||
| 137 | + }, | ||
| 138 | + select(item) { | ||
| 139 | + this.selectShow = false; | ||
| 140 | + this.selectName = item.name; | ||
| 141 | + this.selectId = item.id | ||
| 142 | + }, | ||
| 143 | + // 查询公司 | ||
| 144 | + getCompanyDetail() { | ||
| 145 | + request({ | ||
| 146 | + url: `/api/permission/organize/${this.selectId}`, | ||
| 147 | + method: 'get', | ||
| 148 | + data: {} | ||
| 149 | + }).then(res => { | ||
| 150 | + if (res.code === 200) { | ||
| 151 | + console.log(res) | ||
| 152 | + // console.log(res.data.list) | ||
| 153 | + if (res.data.latlong !== null) { | ||
| 154 | + let position = res.data.latlong.split(',') | ||
| 155 | + this.latitude = position[1] | ||
| 156 | + this.longitude = position[0] | ||
| 157 | + this.covers[0].latitude = position[1] | ||
| 158 | + this.covers[0].longitude = position[0] | ||
| 159 | + console.log(position) | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + this.getData = res.data | ||
| 163 | + this.companyName = this.getData.fullName | ||
| 164 | + this.dizhi = this.getData.dizhi | ||
| 165 | + // console.log(this.getData.F_Logo.length) | ||
| 166 | + if (this.getData.logo.length > 0) { | ||
| 167 | + this.show = true | ||
| 168 | + this.logo = this.getData.logo[0] | ||
| 169 | + console.log(this.logo) | ||
| 170 | + | ||
| 171 | + } | ||
| 172 | + } | ||
| 173 | + }) | ||
| 174 | + }, | ||
| 175 | + | ||
| 176 | + // 点击跳转到本机地图软件 | ||
| 177 | + handleNavigation() { | ||
| 178 | + // console.log('导航') | ||
| 179 | + const _this = this | ||
| 180 | + if (!this.latitude || !this.longitude || !this.companyName) return | ||
| 181 | + uni.getLocation({ | ||
| 182 | + type: 'wgs84', | ||
| 183 | + success: function(res) { | ||
| 184 | + console.log('当前位置的经度:' + res.longitude); | ||
| 185 | + console.log('当前位置的纬度:' + res.latitude); | ||
| 186 | + this.selfLocation.longitude = res.longitude | ||
| 187 | + this.selfLocation.latitude = res.latitude | ||
| 188 | + } | ||
| 189 | + }); | ||
| 190 | + // 微信 | ||
| 191 | + // #ifdef MP-WEIXIN | ||
| 192 | + let _obj = { | ||
| 193 | + latitude: parseFloat(this.latitude), | ||
| 194 | + longitude: parseFloat(this.longitude), | ||
| 195 | + name: this.companyName, | ||
| 196 | + } | ||
| 197 | + if (this.dizhi) { | ||
| 198 | + _obj['dizhi'] = this.dizhi | ||
| 199 | + } | ||
| 200 | + uni.openLocation({ | ||
| 201 | + ..._obj, | ||
| 202 | + success: function(res) { | ||
| 203 | + console.log('打开系统位置地图成功') | ||
| 204 | + }, | ||
| 205 | + fail: function(error) { | ||
| 206 | + console.log(error) | ||
| 207 | + } | ||
| 208 | + }) | ||
| 209 | + // #endif | ||
| 210 | + | ||
| 211 | + // #ifdef APP-PLUS | ||
| 212 | + // 判断系统安装的地图应用有哪些, 并生成菜单按钮 | ||
| 213 | + let _mapName = [{ | ||
| 214 | + title: '高德地图', | ||
| 215 | + name: 'amap', | ||
| 216 | + androidName: 'com.autonavi.minimap', | ||
| 217 | + iosName: 'iosamap://' | ||
| 218 | + }, | ||
| 219 | + { | ||
| 220 | + title: '百度地图', | ||
| 221 | + name: 'baidumap', | ||
| 222 | + androidName: 'com.baidu.BaiduMap', | ||
| 223 | + iosName: 'baidumap://' | ||
| 224 | + }, | ||
| 225 | + { | ||
| 226 | + title: '腾讯地图', | ||
| 227 | + name: 'qqmap', | ||
| 228 | + androidName: 'com.tencent.map', | ||
| 229 | + iosName: 'qqmap://' | ||
| 230 | + }, | ||
| 231 | + ] | ||
| 232 | + // 根据真机有的地图软件 生成的 操作菜单 | ||
| 233 | + let buttons = [] | ||
| 234 | + let platform = uni.getSystemInfoSync().platform | ||
| 235 | + platform === 'android' && _mapName.forEach(item => { | ||
| 236 | + if (plus.runtime.isApplicationExist({ | ||
| 237 | + pname: item.androidName | ||
| 238 | + })) { | ||
| 239 | + buttons.push(item) | ||
| 240 | + } | ||
| 241 | + }) | ||
| 242 | + platform === 'ios' && _mapName.forEach(item => { | ||
| 243 | + console.log(item.iosName) | ||
| 244 | + if (plus.runtime.isApplicationExist({ | ||
| 245 | + action: item.iosName | ||
| 246 | + })) { | ||
| 247 | + buttons.push(item) | ||
| 248 | + } | ||
| 249 | + }) | ||
| 250 | + if (buttons.length) { | ||
| 251 | + plus.nativeUI.actionSheet({ //选择菜单 | ||
| 252 | + title: "选择地图应用", | ||
| 253 | + cancel: "取消", | ||
| 254 | + buttons: buttons | ||
| 255 | + }, function(e) { | ||
| 256 | + let _map = buttons[e.index - 1] | ||
| 257 | + _this.openURL(_map, platform) | ||
| 258 | + }) | ||
| 259 | + } else { | ||
| 260 | + uni.showToast({ | ||
| 261 | + title: '请安装地图软件', | ||
| 262 | + icon: 'none' | ||
| 263 | + }) | ||
| 264 | + return | ||
| 265 | + } | ||
| 266 | + // #endif | ||
| 267 | + }, | ||
| 268 | + | ||
| 269 | + // 打开第三方程序实际应用 | ||
| 270 | + openURL(map, platform) { | ||
| 271 | + let _defaultUrl = { | ||
| 272 | + android: { | ||
| 273 | + "amap": `amapuri://route/plan/?sid=&did=&dlat=${this.latitude}&dlon=${this.longitude}&dname=${this.companyName}&dev=0&t=0`, | ||
| 274 | + 'qqmap': `qqmap://map/routeplan?type=drive&to=${this.companyName}&tocoord=${this.latitude},${this.longitude}&referer=fuxishan_uni_client`, | ||
| 275 | + 'baidumap': `baidumap://map/direction?origin=${this.selfLocation.latitude},${this.selfLocation.longitude}&destination=name:${this.companyName}|latlng:${this.latitude},${this.longitude}&coord_type=wgs84&mode=driving&src=andr.baidu.openAPIdemo"` | ||
| 276 | + }, | ||
| 277 | + ios: { | ||
| 278 | + "amap": `iosamap://path?sourceApplication=fuxishan_uni_client&dlat=${this.latitude}&dlon=${this.longitude}&dname=${this.companyName}&dev=0&t=0`, | ||
| 279 | + 'qqmap': `qqmap://map/routeplan?type=drive&to=${this.companyName}&tocoord=${this.latitude},${this.longitude}&referer=fuxishan_uni_client`, | ||
| 280 | + 'baidumap': `baidumap://map/direction?origin=${this.selfLocation.latitude},${this.selfLocation.longitude}&destination=name:${this.companyName}|latlng:${this.latitude},${this.longitude}&mode=driving&src=ios.baidu.openAPIdemo` | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + let newurl = encodeURI(_defaultUrl[platform][map.name]); | ||
| 284 | + console.log(newurl) | ||
| 285 | + plus.runtime.openURL(newurl, function(res) { | ||
| 286 | + console.log(res) | ||
| 287 | + uni.showModal({ | ||
| 288 | + content: res.message | ||
| 289 | + }) | ||
| 290 | + }, map.androidName ? map.androidName : ''); | ||
| 291 | + } | ||
| 292 | + | ||
| 293 | + } | ||
| 294 | + } | ||
| 295 | +</script> | ||
| 296 | + | ||
| 297 | +<style scoped lang="scss"> | ||
| 298 | + @import 'map.scss'; | ||
| 299 | +</style> | ||
| 0 | \ No newline at end of file | 300 | \ No newline at end of file |
pages/map/map.nvue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="page"> | ||
| 3 | + <view class="content"> | ||
| 4 | + <cover-view></cover-view> | ||
| 5 | + <view class="bg"> | ||
| 6 | + <!-- <web-view src="../../static/html/map.html" style="width: 100%;height: 100%; position: absolute; z-index: 0;"></web-view> --> | ||
| 7 | + <map style="width: 100%;height: 70%;position: relative;top: 190rpx;" :latitude="latitude" | ||
| 8 | + :longitude="longitude" :markers="covers" :show-location="true"></map> | ||
| 9 | + </view> | ||
| 10 | + <view class="map-content" style="position: relative;z-index: 1000;"> | ||
| 11 | + <!-- 搜索 --> | ||
| 12 | + <view class="search-head"> | ||
| 13 | + <view class="search"> | ||
| 14 | + <image src="../../static/fdj1.png"></image> | ||
| 15 | + <text></text> | ||
| 16 | + <input type="text" v-model="selectName" placeholder="搜索关键词" @input="getCompanyList" /> | ||
| 17 | + </view> | ||
| 18 | + <!-- 显示公司选项 --> | ||
| 19 | + <view class="btn" @click="getCompanyDetail"> | ||
| 20 | + <text>搜索11</text> | ||
| 21 | + </view> | ||
| 22 | + </view> | ||
| 23 | + <mo-hu-search :show="selectShow" :list="comList" @select="select" label-name="name" | ||
| 24 | + value-name="id"></mo-hu-search> | ||
| 25 | + </view> | ||
| 26 | + | ||
| 27 | + <view class="bottom"> | ||
| 28 | + <view class="invitation-data"> | ||
| 29 | + <view class="invitation-show"> | ||
| 30 | + <view class="icon" v-show="show"> | ||
| 31 | + <image :src=" baseUrl + logo.url"></image> | ||
| 32 | + </view> | ||
| 33 | + <view class="item"> | ||
| 34 | + <view class="title-btn"> | ||
| 35 | + <view class="title"> | ||
| 36 | + <text class="bt">{{this.companyName}}</text> | ||
| 37 | + </view> | ||
| 38 | + </view> | ||
| 39 | + <view class="describe"> | ||
| 40 | + <text>{{this.dizhi}}</text> | ||
| 41 | + </view> | ||
| 42 | + <view class="describe"> | ||
| 43 | + <text>电话:{{getData.fuzerendianhua}}</text> | ||
| 44 | + <image src="../../static/map1.png"></image> | ||
| 45 | + </view> | ||
| 46 | + <view class="describe"> | ||
| 47 | + <text>营业时间:10:00-20:00</text> | ||
| 48 | + </view> | ||
| 49 | + </view> | ||
| 50 | + <view class="right"> | ||
| 51 | + <view class="red-btn" @click.stop="handleNavigation"> | ||
| 52 | + <image src="../../static/dh.png"></image> | ||
| 53 | + <text>导航</text> | ||
| 54 | + </view> | ||
| 55 | + </view> | ||
| 56 | + </view> | ||
| 57 | + </view> | ||
| 58 | + </view> | ||
| 59 | + </view> | ||
| 60 | + </view> | ||
| 61 | +</template> | ||
| 62 | + | ||
| 63 | +<script> | ||
| 64 | + import request from '@/utils/request.js' | ||
| 65 | + // import moHuSearch from '../../components/qj-fuzzy-search/index.vue' | ||
| 66 | + import moHuSearch from '../../components/qj-fuzzy-search/index.vue' | ||
| 67 | + export default { | ||
| 68 | + components: { | ||
| 69 | + moHuSearch | ||
| 70 | + }, | ||
| 71 | + data() { | ||
| 72 | + return { | ||
| 73 | + keyword: '', | ||
| 74 | + id: 0, // 使用 marker点击事件 需要填写id | ||
| 75 | + title: 'map', | ||
| 76 | + // latitude: 30.602494, | ||
| 77 | + // longitude: 104.073004, | ||
| 78 | + latitude: 30.926786, | ||
| 79 | + longitude: 104.294514, | ||
| 80 | + covers: [{ | ||
| 81 | + latitude: 30.926786, | ||
| 82 | + longitude: 104.294514, | ||
| 83 | + iconPath: '../../static/map_red.png', | ||
| 84 | + // width:20, | ||
| 85 | + // height:26, | ||
| 86 | + }, | ||
| 87 | + // { | ||
| 88 | + // latitude: 39.90, | ||
| 89 | + // longitude: 116.39, | ||
| 90 | + // iconPath: '../../../static/wuganda.png' | ||
| 91 | + // }, | ||
| 92 | + ], | ||
| 93 | + getData: {}, | ||
| 94 | + show: false, | ||
| 95 | + selectShow: false, | ||
| 96 | + selectName: '', | ||
| 97 | + selectId: '', | ||
| 98 | + logo: {}, | ||
| 99 | + baseUrl: 'http://deyanggaoxin.fengshiyun.com', | ||
| 100 | + comList: [], | ||
| 101 | + companyName: '德阳高新区管委会', | ||
| 102 | + dizhi: '广汉市聆湖西路一段一号', | ||
| 103 | + // 我自己的位置经纬度(百度地图需要传入自己的经纬度进行导航) | ||
| 104 | + selfLocation: { | ||
| 105 | + latitude: '', | ||
| 106 | + longitude: '' | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + }, | ||
| 110 | + onLoad() { | ||
| 111 | + // this.getCompanyDetail() | ||
| 112 | + }, | ||
| 113 | + methods: { | ||
| 114 | + // 获取公司列表 | ||
| 115 | + getCompanyList() { | ||
| 116 | + this.selectShow = true | ||
| 117 | + // this.$refs.sou.open() | ||
| 118 | + request({ | ||
| 119 | + url: '/api/permission/organize/GetSelectList', | ||
| 120 | + method: 'get', | ||
| 121 | + data: { | ||
| 122 | + keyword: this.selectName | ||
| 123 | + } | ||
| 124 | + }).then(res => { | ||
| 125 | + if (res.code === 200) { | ||
| 126 | + // console.log(res) | ||
| 127 | + this.comList = res.data.list.map(it => { | ||
| 128 | + return { | ||
| 129 | + id: it.id, | ||
| 130 | + name: it.fullName | ||
| 131 | + } | ||
| 132 | + }) | ||
| 133 | + // console.log(this.comList) | ||
| 134 | + this.comList = JSON.parse(JSON.stringify(this.comList)) | ||
| 135 | + } | ||
| 136 | + }) | ||
| 137 | + }, | ||
| 138 | + select(item) { | ||
| 139 | + this.selectShow = false; | ||
| 140 | + this.selectName = item.name; | ||
| 141 | + this.selectId = item.id | ||
| 142 | + }, | ||
| 143 | + // 查询公司 | ||
| 144 | + getCompanyDetail() { | ||
| 145 | + request({ | ||
| 146 | + url: `/api/permission/organize/${this.selectId}`, | ||
| 147 | + method: 'get', | ||
| 148 | + data: {} | ||
| 149 | + }).then(res => { | ||
| 150 | + if (res.code === 200) { | ||
| 151 | + console.log(res) | ||
| 152 | + // console.log(res.data.list) | ||
| 153 | + if (res.data.latlong !== null) { | ||
| 154 | + let position = res.data.latlong.split(',') | ||
| 155 | + this.latitude = position[1] | ||
| 156 | + this.longitude = position[0] | ||
| 157 | + this.covers[0].latitude = position[1] | ||
| 158 | + this.covers[0].longitude = position[0] | ||
| 159 | + console.log(position) | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + this.getData = res.data | ||
| 163 | + this.companyName = this.getData.fullName | ||
| 164 | + this.dizhi = this.getData.dizhi | ||
| 165 | + // console.log(this.getData.F_Logo.length) | ||
| 166 | + if (this.getData.logo.length > 0) { | ||
| 167 | + this.show = true | ||
| 168 | + this.logo = this.getData.logo[0] | ||
| 169 | + console.log(this.logo) | ||
| 170 | + | ||
| 171 | + } | ||
| 172 | + } | ||
| 173 | + }) | ||
| 174 | + }, | ||
| 175 | + | ||
| 176 | + // 点击跳转到本机地图软件 | ||
| 177 | + handleNavigation() { | ||
| 178 | + // console.log('导航') | ||
| 179 | + const _this = this | ||
| 180 | + if (!this.latitude || !this.longitude || !this.companyName) return | ||
| 181 | + uni.getLocation({ | ||
| 182 | + type: 'wgs84', | ||
| 183 | + success: function(res) { | ||
| 184 | + console.log('当前位置的经度:' + res.longitude); | ||
| 185 | + console.log('当前位置的纬度:' + res.latitude); | ||
| 186 | + this.selfLocation.longitude = res.longitude | ||
| 187 | + this.selfLocation.latitude = res.latitude | ||
| 188 | + } | ||
| 189 | + }); | ||
| 190 | + // 微信 | ||
| 191 | + // #ifdef MP-WEIXIN | ||
| 192 | + let _obj = { | ||
| 193 | + latitude: parseFloat(this.latitude), | ||
| 194 | + longitude: parseFloat(this.longitude), | ||
| 195 | + name: this.companyName, | ||
| 196 | + } | ||
| 197 | + if (this.dizhi) { | ||
| 198 | + _obj['dizhi'] = this.dizhi | ||
| 199 | + } | ||
| 200 | + uni.openLocation({ | ||
| 201 | + ..._obj, | ||
| 202 | + success: function(res) { | ||
| 203 | + console.log('打开系统位置地图成功') | ||
| 204 | + }, | ||
| 205 | + fail: function(error) { | ||
| 206 | + console.log(error) | ||
| 207 | + } | ||
| 208 | + }) | ||
| 209 | + // #endif | ||
| 210 | + | ||
| 211 | + // #ifdef APP-PLUS | ||
| 212 | + // 判断系统安装的地图应用有哪些, 并生成菜单按钮 | ||
| 213 | + let _mapName = [{ | ||
| 214 | + title: '高德地图', | ||
| 215 | + name: 'amap', | ||
| 216 | + androidName: 'com.autonavi.minimap', | ||
| 217 | + iosName: 'iosamap://' | ||
| 218 | + }, | ||
| 219 | + { | ||
| 220 | + title: '百度地图', | ||
| 221 | + name: 'baidumap', | ||
| 222 | + androidName: 'com.baidu.BaiduMap', | ||
| 223 | + iosName: 'baidumap://' | ||
| 224 | + }, | ||
| 225 | + { | ||
| 226 | + title: '腾讯地图', | ||
| 227 | + name: 'qqmap', | ||
| 228 | + androidName: 'com.tencent.map', | ||
| 229 | + iosName: 'qqmap://' | ||
| 230 | + }, | ||
| 231 | + ] | ||
| 232 | + // 根据真机有的地图软件 生成的 操作菜单 | ||
| 233 | + let buttons = [] | ||
| 234 | + let platform = uni.getSystemInfoSync().platform | ||
| 235 | + platform === 'android' && _mapName.forEach(item => { | ||
| 236 | + if (plus.runtime.isApplicationExist({ | ||
| 237 | + pname: item.androidName | ||
| 238 | + })) { | ||
| 239 | + buttons.push(item) | ||
| 240 | + } | ||
| 241 | + }) | ||
| 242 | + platform === 'ios' && _mapName.forEach(item => { | ||
| 243 | + console.log(item.iosName) | ||
| 244 | + if (plus.runtime.isApplicationExist({ | ||
| 245 | + action: item.iosName | ||
| 246 | + })) { | ||
| 247 | + buttons.push(item) | ||
| 248 | + } | ||
| 249 | + }) | ||
| 250 | + if (buttons.length) { | ||
| 251 | + plus.nativeUI.actionSheet({ //选择菜单 | ||
| 252 | + title: "选择地图应用", | ||
| 253 | + cancel: "取消", | ||
| 254 | + buttons: buttons | ||
| 255 | + }, function(e) { | ||
| 256 | + let _map = buttons[e.index - 1] | ||
| 257 | + _this.openURL(_map, platform) | ||
| 258 | + }) | ||
| 259 | + } else { | ||
| 260 | + uni.showToast({ | ||
| 261 | + title: '请安装地图软件', | ||
| 262 | + icon: 'none' | ||
| 263 | + }) | ||
| 264 | + return | ||
| 265 | + } | ||
| 266 | + // #endif | ||
| 267 | + }, | ||
| 268 | + | ||
| 269 | + // 打开第三方程序实际应用 | ||
| 270 | + openURL(map, platform) { | ||
| 271 | + let _defaultUrl = { | ||
| 272 | + android: { | ||
| 273 | + "amap": `amapuri://route/plan/?sid=&did=&dlat=${this.latitude}&dlon=${this.longitude}&dname=${this.companyName}&dev=0&t=0`, | ||
| 274 | + 'qqmap': `qqmap://map/routeplan?type=drive&to=${this.companyName}&tocoord=${this.latitude},${this.longitude}&referer=fuxishan_uni_client`, | ||
| 275 | + 'baidumap': `baidumap://map/direction?origin=${this.selfLocation.latitude},${this.selfLocation.longitude}&destination=name:${this.companyName}|latlng:${this.latitude},${this.longitude}&coord_type=wgs84&mode=driving&src=andr.baidu.openAPIdemo"` | ||
| 276 | + }, | ||
| 277 | + ios: { | ||
| 278 | + "amap": `iosamap://path?sourceApplication=fuxishan_uni_client&dlat=${this.latitude}&dlon=${this.longitude}&dname=${this.companyName}&dev=0&t=0`, | ||
| 279 | + 'qqmap': `qqmap://map/routeplan?type=drive&to=${this.companyName}&tocoord=${this.latitude},${this.longitude}&referer=fuxishan_uni_client`, | ||
| 280 | + 'baidumap': `baidumap://map/direction?origin=${this.selfLocation.latitude},${this.selfLocation.longitude}&destination=name:${this.companyName}|latlng:${this.latitude},${this.longitude}&mode=driving&src=ios.baidu.openAPIdemo` | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + let newurl = encodeURI(_defaultUrl[platform][map.name]); | ||
| 284 | + console.log(newurl) | ||
| 285 | + plus.runtime.openURL(newurl, function(res) { | ||
| 286 | + console.log(res) | ||
| 287 | + uni.showModal({ | ||
| 288 | + content: res.message | ||
| 289 | + }) | ||
| 290 | + }, map.androidName ? map.androidName : ''); | ||
| 291 | + } | ||
| 292 | + | ||
| 293 | + } | ||
| 294 | + } | ||
| 295 | +</script> | ||
| 296 | + | ||
| 297 | +<style scoped lang="scss"> | ||
| 298 | + @import 'map.scss'; | ||
| 299 | +</style> | ||
| 0 | \ No newline at end of file | 300 | \ No newline at end of file |
pages/map/map.scss
| @@ -9,21 +9,22 @@ | @@ -9,21 +9,22 @@ | ||
| 9 | display: flex; | 9 | display: flex; |
| 10 | justify-content: center; | 10 | justify-content: center; |
| 11 | align-items: center; | 11 | align-items: center; |
| 12 | - width: 90%; | 12 | + width: 100%; |
| 13 | + height: 84rpx; | ||
| 13 | margin: 0 auto; | 14 | margin: 0 auto; |
| 14 | // #ifdef APP-PLUS */ | 15 | // #ifdef APP-PLUS */ |
| 15 | // height: calc(120rpx + var(--status-bar-height)); | 16 | // height: calc(120rpx + var(--status-bar-height)); |
| 16 | // /* #endif | 17 | // /* #endif |
| 17 | // padding: 20rpx; | 18 | // padding: 20rpx; |
| 18 | - box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); | ||
| 19 | - margin-top:8rpx; | ||
| 20 | - border-radius: 100rpx; | 19 | + //box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); |
| 20 | + border: 6rpx solid #efefef; | ||
| 21 | + margin-top:20rpx; | ||
| 21 | background-color: #FFFFFF; | 22 | background-color: #FFFFFF; |
| 22 | .search { | 23 | .search { |
| 23 | display: flex; | 24 | display: flex; |
| 24 | align-items: center; | 25 | align-items: center; |
| 25 | width: 100%; | 26 | width: 100%; |
| 26 | - height: 80rpx; | 27 | + height: 78rpx; |
| 27 | // background: rgba(255, 255, 255, 1); | 28 | // background: rgba(255, 255, 255, 1); |
| 28 | border: 0; | 29 | border: 0; |
| 29 | margin-left: 30rpx; | 30 | margin-left: 30rpx; |
| @@ -55,10 +56,11 @@ | @@ -55,10 +56,11 @@ | ||
| 55 | align-items: center; | 56 | align-items: center; |
| 56 | justify-content: center; | 57 | justify-content: center; |
| 57 | position: absolute; | 58 | position: absolute; |
| 58 | - right: 60rpx; | 59 | + right: 20rpx; |
| 59 | background-color: #D32D25; | 60 | background-color: #D32D25; |
| 60 | - border-radius: 100rpx; | ||
| 61 | - padding: 12rpx 25rpx; | 61 | + border-radius: 10rpx; |
| 62 | + width: 120rpx;; | ||
| 63 | + padding: 12rpx; | ||
| 62 | text { | 64 | text { |
| 63 | font-size: 28rpx; | 65 | font-size: 28rpx; |
| 64 | color: #fff; | 66 | color: #fff; |
| @@ -128,16 +130,20 @@ | @@ -128,16 +130,20 @@ | ||
| 128 | margin: 0; | 130 | margin: 0; |
| 129 | } | 131 | } |
| 130 | } | 132 | } |
| 131 | -.invitation-data{ | 133 | + |
| 132 | .invitation-show{ | 134 | .invitation-show{ |
| 135 | + position: absolute; | ||
| 136 | + bottom: 60px; | ||
| 133 | display: flex; | 137 | display: flex; |
| 134 | align-items: center; | 138 | align-items: center; |
| 135 | - width: 100%; | ||
| 136 | - margin: 20rpx auto; | 139 | + width: 95%; |
| 137 | background-color: #FFFFFF; | 140 | background-color: #FFFFFF; |
| 138 | box-shadow: 0 0 10rpx rgba(0,0,0,0.1); | 141 | box-shadow: 0 0 10rpx rgba(0,0,0,0.1); |
| 139 | border-radius: 20rpx; | 142 | border-radius: 20rpx; |
| 143 | + left: 50%; | ||
| 144 | + transform: translateX(-50%); | ||
| 140 | padding: 20rpx; | 145 | padding: 20rpx; |
| 146 | + height: 230rpx; | ||
| 141 | .icon{ | 147 | .icon{ |
| 142 | display: flex; | 148 | display: flex; |
| 143 | justify-content: center; | 149 | justify-content: center; |
| @@ -149,7 +155,7 @@ | @@ -149,7 +155,7 @@ | ||
| 149 | } | 155 | } |
| 150 | } | 156 | } |
| 151 | .item{ | 157 | .item{ |
| 152 | - width: 60%; | 158 | + width: 70%; |
| 153 | height: 80%; | 159 | height: 80%; |
| 154 | padding-left: 20rpx; | 160 | padding-left: 20rpx; |
| 155 | padding-right: 20rpx; | 161 | padding-right: 20rpx; |
| @@ -170,7 +176,8 @@ | @@ -170,7 +176,8 @@ | ||
| 170 | .describe{ | 176 | .describe{ |
| 171 | display: flex; | 177 | display: flex; |
| 172 | align-items: center; | 178 | align-items: center; |
| 173 | - margin-bottom: 6rpx; | 179 | + height: 46rpx; |
| 180 | + line-height: 46rpx; | ||
| 174 | text{ | 181 | text{ |
| 175 | font-size: 24rpx; | 182 | font-size: 24rpx; |
| 176 | color: #959595; | 183 | color: #959595; |
| @@ -183,7 +190,7 @@ | @@ -183,7 +190,7 @@ | ||
| 183 | } | 190 | } |
| 184 | } | 191 | } |
| 185 | } | 192 | } |
| 186 | -} | 193 | + |
| 187 | // .amap-marker{ | 194 | // .amap-marker{ |
| 188 | // margin-top: -5px !important; | 195 | // margin-top: -5px !important; |
| 189 | // } | 196 | // } |
| @@ -197,7 +204,7 @@ | @@ -197,7 +204,7 @@ | ||
| 197 | } | 204 | } |
| 198 | } | 205 | } |
| 199 | .right { | 206 | .right { |
| 200 | - width: 20%; | 207 | + width: 30%; |
| 201 | text-align: right; | 208 | text-align: right; |
| 202 | color: #878787; | 209 | color: #878787; |
| 203 | } | 210 | } |
| @@ -207,10 +214,12 @@ | @@ -207,10 +214,12 @@ | ||
| 207 | justify-content: center; | 214 | justify-content: center; |
| 208 | width: 160rpx; | 215 | width: 160rpx; |
| 209 | height: 50rpx; | 216 | height: 50rpx; |
| 210 | - background: linear-gradient(to bottom,#E60012,#E60012); | 217 | + background: #D32D25 !important; |
| 211 | border-radius: 60rpx; | 218 | border-radius: 60rpx; |
| 212 | float: right; | 219 | float: right; |
| 213 | - margin-top: 90rpx; | 220 | + margin-top: 126rpx; |
| 221 | + margin-right: 10rpx; | ||
| 222 | + z-index: 999; | ||
| 214 | image { | 223 | image { |
| 215 | width: 24rpx; | 224 | width: 24rpx; |
| 216 | height: 24rpx; | 225 | height: 24rpx; |
pages/map/map.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="page"> | 2 | <view class="page"> |
| 3 | + <view class="map-content" style="position: relative;z-index: 1000;"> | ||
| 4 | + <!-- 搜索 --> | ||
| 5 | + <view class="search-head"> | ||
| 6 | + <view class="search"> | ||
| 7 | + <image src="../../static/fdj1.png"></image> | ||
| 8 | + <text></text> | ||
| 9 | + <input type="text" v-model="selectName" placeholder="搜索关键词" @input="getCompanyList" /> | ||
| 10 | + </view> | ||
| 11 | + <!-- 显示公司选项 --> | ||
| 12 | + <view class="btn" @click="getCompanyDetail"> | ||
| 13 | + <text>搜索</text> | ||
| 14 | + </view> | ||
| 15 | + </view> | ||
| 16 | + <mo-hu-search :show="selectShow" :list="comList" @select="select" label-name="name" | ||
| 17 | + value-name="id"></mo-hu-search> | ||
| 18 | + </view> | ||
| 3 | <view class="content"> | 19 | <view class="content"> |
| 4 | - <cover-view></cover-view> | ||
| 5 | - <view class="bg"> | 20 | + <view class="bg" style="z-index: 9;"> |
| 6 | <!-- <web-view src="../../static/html/map.html" style="width: 100%;height: 100%; position: absolute; z-index: 0;"></web-view> --> | 21 | <!-- <web-view src="../../static/html/map.html" style="width: 100%;height: 100%; position: absolute; z-index: 0;"></web-view> --> |
| 7 | - <map style="width: 100%;height: 70%;position: relative;top: 190rpx;" :latitude="latitude" | ||
| 8 | - :longitude="longitude" :markers="covers" :show-location="true"></map> | 22 | + <map style="width: 100%;height: 100%" :latitude="latitude" :longitude="longitude" :markers="covers" |
| 23 | + :show-location="true"> | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + <cover-view class="invitation-show"> | ||
| 27 | + <cover-view class="icon" v-show="show"> | ||
| 28 | + <cover-image :src=" baseUrl + logo.url"></cover-image> | ||
| 29 | + </cover-view> | ||
| 30 | + <cover-view class="item"> | ||
| 31 | + <cover-view class="title-btn"> | ||
| 32 | + <cover-view class="title"> | ||
| 33 | + <cover-view class="bt">{{this.companyName}}</cover-view> | ||
| 34 | + </cover-view> | ||
| 35 | + </cover-view> | ||
| 36 | + <cover-view class="describe"> | ||
| 37 | + {{this.dizhi}} | ||
| 38 | + </cover-view> | ||
| 39 | + <cover-view class="describe"> | ||
| 40 | + <cover-view>电话:{{getData.fuzerendianhua}}</cover-view> | ||
| 41 | + <cover-image style="width: 30rpx;height: 30rpx;;" src="../../static/map1.png" | ||
| 42 | + @click.stop="callPhone(getData.fuzerendianhua)"></cover-image> | ||
| 43 | + </cover-view> | ||
| 44 | + <cover-view class="describe"> | ||
| 45 | + 营业时间:10:00-20:00 | ||
| 46 | + </cover-view> | ||
| 47 | + </cover-view> | ||
| 48 | + <cover-view class="right"> | ||
| 49 | + <cover-view class="red-btn" @click.stop="handleNavigation"> | ||
| 50 | + <cover-image style="width: 24rpx;height: 24rpx;" src="../../static/dh.png" | ||
| 51 | + @click.stop="handleNavigation"></cover-image> | ||
| 52 | + <cover-view style="color: #fff;" @click.stop="handleNavigation">导航</cover-view> | ||
| 53 | + </cover-view> | ||
| 54 | + </cover-view> | ||
| 55 | + </cover-view> | ||
| 56 | + | ||
| 57 | + </map> | ||
| 9 | </view> | 58 | </view> |
| 10 | <view class="map-content" style="position: relative;z-index: 1000;"> | 59 | <view class="map-content" style="position: relative;z-index: 1000;"> |
| 11 | <!-- 搜索 --> | 60 | <!-- 搜索 --> |
| 12 | - <view class="search-head"> | ||
| 13 | - <view class="search"> | ||
| 14 | - <image src="../../static/fdj1.png"></image> | ||
| 15 | - <text></text> | ||
| 16 | - <input type="text" v-model="selectName" placeholder="搜索关键词" @input="getCompanyList" /> | ||
| 17 | - </view> | ||
| 18 | - <!-- 显示公司选项 --> | ||
| 19 | - <view class="btn" @click="getCompanyDetail"> | ||
| 20 | - <text>搜索</text> | ||
| 21 | - </view> | ||
| 22 | - </view> | ||
| 23 | - <mo-hu-search :show="selectShow" :list="comList" @select="select" label-name="name" | ||
| 24 | - value-name="id"></mo-hu-search> | ||
| 25 | - </view> | ||
| 26 | 61 | ||
| 27 | - <view class="bottom"> | ||
| 28 | - <view class="invitation-data"> | ||
| 29 | - <view class="invitation-show"> | ||
| 30 | - <view class="icon" v-show="show"> | ||
| 31 | - <image :src=" baseUrl + logo.url"></image> | ||
| 32 | - </view> | ||
| 33 | - <view class="item"> | ||
| 34 | - <view class="title-btn"> | ||
| 35 | - <view class="title"> | ||
| 36 | - <text class="bt">{{this.companyName}}</text> | ||
| 37 | - </view> | ||
| 38 | - </view> | ||
| 39 | - <view class="describe"> | ||
| 40 | - <text>{{this.dizhi}}</text> | ||
| 41 | - </view> | ||
| 42 | - <view class="describe"> | ||
| 43 | - <text>电话:{{getData.fuzerendianhua}}</text> | ||
| 44 | - <image src="../../static/map1.png"></image> | ||
| 45 | - </view> | ||
| 46 | - <view class="describe"> | ||
| 47 | - <text>营业时间:10:00-20:00</text> | ||
| 48 | - </view> | ||
| 49 | - </view> | ||
| 50 | - <view class="right"> | ||
| 51 | - <view class="red-btn" @click.stop="handleNavigation"> | ||
| 52 | - <image src="../../static/dh.png"></image> | ||
| 53 | - <text>导航</text> | ||
| 54 | - </view> | ||
| 55 | - </view> | ||
| 56 | - </view> | ||
| 57 | - </view> | ||
| 58 | </view> | 62 | </view> |
| 63 | + | ||
| 59 | </view> | 64 | </view> |
| 60 | </view> | 65 | </view> |
| 61 | </template> | 66 | </template> |
| @@ -63,7 +68,7 @@ | @@ -63,7 +68,7 @@ | ||
| 63 | <script> | 68 | <script> |
| 64 | import request from '@/utils/request.js' | 69 | import request from '@/utils/request.js' |
| 65 | // import moHuSearch from '../../components/qj-fuzzy-search/index.vue' | 70 | // import moHuSearch from '../../components/qj-fuzzy-search/index.vue' |
| 66 | - import moHuSearch from '../../components/qj-fuzzy-search/index.vue' | 71 | + import moHuSearch from '../../components/qj-fuzzy-search/index2.vue' |
| 67 | export default { | 72 | export default { |
| 68 | components: { | 73 | components: { |
| 69 | moHuSearch | 74 | moHuSearch |
| @@ -111,6 +116,11 @@ | @@ -111,6 +116,11 @@ | ||
| 111 | // this.getCompanyDetail() | 116 | // this.getCompanyDetail() |
| 112 | }, | 117 | }, |
| 113 | methods: { | 118 | methods: { |
| 119 | + callPhone(phoneNum) { | ||
| 120 | + uni.makePhoneCall({ | ||
| 121 | + phoneNumber: phoneNum //仅为示例 | ||
| 122 | + }); | ||
| 123 | + }, | ||
| 114 | // 获取公司列表 | 124 | // 获取公司列表 |
| 115 | getCompanyList() { | 125 | getCompanyList() { |
| 116 | this.selectShow = true | 126 | this.selectShow = true |
| @@ -119,7 +129,9 @@ | @@ -119,7 +129,9 @@ | ||
| 119 | url: '/api/permission/organize/GetSelectList', | 129 | url: '/api/permission/organize/GetSelectList', |
| 120 | method: 'get', | 130 | method: 'get', |
| 121 | data: { | 131 | data: { |
| 122 | - keyword: this.selectName | 132 | + keyword: this.selectName, |
| 133 | + currentPage: 1, | ||
| 134 | + pageSize: 8 | ||
| 123 | } | 135 | } |
| 124 | }).then(res => { | 136 | }).then(res => { |
| 125 | if (res.code === 200) { | 137 | if (res.code === 200) { |