123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- let app = getApp();
- import {
- distanceCalculate
- } from "@/utils/tool.js"
- export default {
- props: {
- DataType: {
- type: Number,
- default: 0
- },
- loading: {
- type: Boolean,
- default: false
- },
- statusBarHeight: {
- type: Number,
- default: 0
- },
- keyWord: {
- type: String,
- default: ''
- },
- showMask: {
- type: Boolean,
- default: false
- },
- addressList: {
- type: Array,
- default: () => []
- },
- classifyList: {
- type: Array,
- default: () => []
- },
- hotClassify: {
- type: Array,
- default: () => []
- },
- classifyTree: {
- type: Array,
- default: () => []
- },
- oneClassifyIndex: {
- type: Number,
- default: 1
- },
- labelType: {
- type: Number,
- default: 0
- },
- twoClassifyIndex: {
- type: Number,
- default: null
- },
- activeClassify: {
- type: Object,
- default: null
- },
- activeDistance: {
- type: Object,
- default: null
- },
- searchType: {
- type: Number,
- default: 3
- },
- },
- data() {
- return {
- TouchHeight: 0,
- scrollMaxHeight: 0,
- };
- },
- beforeCreate() {},
- created() {
- },
- onload() {
- },
- methods: {
- getDistance(num) {
- return distanceCalculate(num)
- },
- backMyLocation() {
- // console.log('scale = ', this.scale)
- this.$refs.mapRef.moveToLocation();
- },
- setTouchHeight(val) {
- // console.log('setScrollHeight = ', val)
- // 实时返回的滑动组件高度
- this.TouchHeight = val;
- },
- setScrollMaxHeight(val) {
- //最大高度
- this.scrollMaxHeight = val;
- },
- getTypeName(item) {
- let val = this.classifyList.find(el => el.id === item.classifyId);
- // console.log('----', val, this.keyWord, this.activeClassify?.name)
- return val?.name || this.keyWord || this.activeClassify?.name || ''
- // return '777'
- },
- onMore() {
- uni.navigateTo({
- url: '/pages/government/map-classify',
- success: res => {
- uni.$emit('onMapNextPage')
- },
- })
- },
- // 查看详情
- onViewDetails(item, e) {
- if (!e || e.target.id !== 'goMap') {
- uni.navigateTo({
- url: '/pages/government/subNVue/mapLocationInfo',
- success: res => {
- uni.$emit('onMapNextPage')
- res.eventChannel.emit('MapInfo', {
- data: {
- val: item,
- classifyList: this.classifyList,
- keyWord: this.keyWord,
- activeClassify: this.activeClassify
- }
- })
- },
- fail: err => {
- console.log('跳转', err)
- },
- })
- }
- },
- toHere(item) {
- uni.openLocation({
- latitude: parseFloat(item.latitude), // 要去的地址经度,浮点数
- longitude: parseFloat(item.longitude), // 要去的地址纬度,浮点数
- name: item.name, // 位置名
- address: item.detailedAddress, // 要去的地址详情说明
- scale: 16, // 地图缩放级别,整形值,范围从1~28。默认为最大
- });
- },
- // // 搜索
- // onSearchFocus() {
- // this.DataType = 5;
- // setTimeout(() => {
- // this.showMask = true;
- // this.searchType = 2;
- // }, 10);
- // },
- // onSearchBlur() {
- // console.log('shiqijiaodian')
- // this.showMask = false;
- // setTimeout(() => {
- // this.DataType = this.oldDataType
- // }, 10);
- // console.log('shiqijiaodian', this.DataType)
- // }
- },
- }
|