|
@@ -2,7 +2,10 @@ import {
|
|
|
imgUrl
|
|
|
} from "../api/request"
|
|
|
import{
|
|
|
- getMapDataType
|
|
|
+ getMapDataType,
|
|
|
+ getHandMatterPage,
|
|
|
+ getHandMatterBySearch,
|
|
|
+ getMapDataAll
|
|
|
} from "../api/yxna-api"
|
|
|
var QQMapWX = require('../../libs/qqmap-wx-jssdk.min.js');
|
|
|
const popType = [
|
|
@@ -84,7 +87,31 @@ Page({
|
|
|
showSet: false,
|
|
|
trafficType: 0,
|
|
|
page:0,
|
|
|
- limit:15
|
|
|
+ limit:15,
|
|
|
+ marksInfo: [],
|
|
|
+ marksView: [],
|
|
|
+ marksNum: 0,
|
|
|
+ searchInfo: {
|
|
|
+ navType: 0,
|
|
|
+ isShow: false
|
|
|
+ },
|
|
|
+ itemInfo: {
|
|
|
+ page: 1,
|
|
|
+ limit: 6,
|
|
|
+ navType: 0,
|
|
|
+ deptNow: '',
|
|
|
+ pageNext: true,
|
|
|
+ pagePrev: false,
|
|
|
+ matterStatus: true,
|
|
|
+ matterList: [{
|
|
|
+ itemName: '',
|
|
|
+ matterUrl: ''
|
|
|
+ }],
|
|
|
+ '重庆市南岸区政务服务中心(江南新城中心)': ['重庆市南岸区残联', '重庆市南岸区财政局', '重庆市南岸区文化和旅游发展委员会', '重庆市南岸区档案馆', '重庆市南岸区卫生健康委员会', '重庆市南岸区交通局', '重庆市南岸区规划自然资源局', '重庆市南岸区住房和城乡建设委员会', '重庆市南岸区生态环境局', '重庆市南岸区农业农村委员会', '重庆市南岸区发展和改革委员会', '重庆市南岸区消防救援支队', '重庆市南岸区城市管理局', '重庆市公安局南岸分局'],
|
|
|
+ '重庆市南岸区政务服务中心(南坪中心)': ['重庆市南岸区市场监管局', '重庆市公安局南岸分局', '国家税务总局重庆市南岸区税务局'],
|
|
|
+ },
|
|
|
+ jnxc: ['重庆市南岸区残联', '重庆市南岸区财政局', '重庆市南岸区文化和旅游发展委员会', '重庆市南岸区档案馆', '重庆市南岸区卫生健康委员会', '重庆市南岸区交通局', '重庆市南岸区规划自然资源局', '重庆市南岸区住房和城乡建设委员会', '重庆市南岸区生态环境局', '重庆市南岸区农业农村委员会', '重庆市南岸区发展和改革委员会', '重庆市南岸区消防救援支队', '重庆市南岸区城市管理局', '重庆市公安局南岸分局'],
|
|
|
+ npzx: ['重庆市南岸区市场监管局', '重庆市公安局南岸分局', '国家税务总局重庆市南岸区税务局'],
|
|
|
},
|
|
|
|
|
|
onLoad: function (options) {
|
|
@@ -107,9 +134,24 @@ Page({
|
|
|
},
|
|
|
onReady:function () {
|
|
|
|
|
|
-
|
|
|
+ const that = this
|
|
|
this.loadItem();
|
|
|
- this.setMap();
|
|
|
+ getMapDataAll().then((res) => {
|
|
|
+ let arr = []
|
|
|
+ Array.prototype.push.apply(arr, res.data.xzfwzxs);
|
|
|
+ Array.prototype.push.apply(arr, res.data.ggfwzxs);
|
|
|
+ for (let j = 0; j < arr.length; j++) {
|
|
|
+ if(arr[j].tel && !(arr[j].tel instanceof Array)){
|
|
|
+ arr[j].tel = arr[j].tel.split(";")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.setData({
|
|
|
+ xzfwzxs: res.data.xzfwzxs,
|
|
|
+ marksInfo: arr
|
|
|
+ })
|
|
|
+ this.setMap();
|
|
|
+ });
|
|
|
+ // this.setMap();
|
|
|
|
|
|
},
|
|
|
async setMap(){
|
|
@@ -121,21 +163,23 @@ Page({
|
|
|
wx.getLocation({
|
|
|
type: 'gcj02', //返回可以用于wx.openLocation的经纬度
|
|
|
success(res) {
|
|
|
+ console.log(res)
|
|
|
const latitude = res.latitude
|
|
|
const longitude = res.longitude
|
|
|
+ initMapDataAll(that, latitude, longitude)
|
|
|
that.setData({
|
|
|
latitude: latitude,
|
|
|
longitude: longitude,
|
|
|
trafficStart: "我的位置",
|
|
|
- markers: [{
|
|
|
- latitude: latitude,
|
|
|
- longitude: longitude,
|
|
|
- iconPath: "/location.png",
|
|
|
- width: '30px',
|
|
|
- height: '30px',
|
|
|
- rotate: 0,
|
|
|
- alpha: 1
|
|
|
- }]
|
|
|
+ // markers: [{
|
|
|
+ // latitude: latitude,
|
|
|
+ // longitude: longitude,
|
|
|
+ // iconPath: "/location.png",
|
|
|
+ // width: '30px',
|
|
|
+ // height: '30px',
|
|
|
+ // rotate: 0,
|
|
|
+ // alpha: 1
|
|
|
+ // }]
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -187,7 +231,7 @@ Page({
|
|
|
console.log(res.data[0].tel);
|
|
|
let data = []
|
|
|
res.data.forEach((item) => {
|
|
|
- if(item.tel!=null && item.tel!=""){
|
|
|
+ if(item.tel!=null && item.tel!="" && !(item.tel instanceof Array)){
|
|
|
item.tel = item.tel.split(";")
|
|
|
}
|
|
|
data.push(item)
|
|
@@ -207,6 +251,11 @@ Page({
|
|
|
},
|
|
|
changeInfo(e) {
|
|
|
// console.log(e.currentTarget.dataset.data);
|
|
|
+ let searchInfo = this.data.searchInfo
|
|
|
+ searchInfo.isShow = false
|
|
|
+ this.setData({
|
|
|
+ searchInfo: searchInfo
|
|
|
+ })
|
|
|
let dataitem = e.currentTarget.dataset.data;
|
|
|
console.log(dataitem);
|
|
|
let params ={
|
|
@@ -242,7 +291,7 @@ Page({
|
|
|
}
|
|
|
let renderData = []
|
|
|
data.forEach((item) => {
|
|
|
- if(item.tel!=null && item.tel!=""){
|
|
|
+ if(item.tel!=null && item.tel!="" && !(item.tel instanceof Array)){
|
|
|
item.tel = item.tel.split(";")
|
|
|
}
|
|
|
renderData.push(item)
|
|
@@ -277,10 +326,13 @@ Page({
|
|
|
console.info(e)
|
|
|
let value = e.currentTarget.dataset.value;
|
|
|
if (value === "none") {
|
|
|
+ let searchInfo = that.data.searchInfo
|
|
|
+ searchInfo.isShow = false
|
|
|
that.setData({
|
|
|
isList: false,
|
|
|
showSearch: false,
|
|
|
showSet: false,
|
|
|
+ searchInfo: searchInfo
|
|
|
});
|
|
|
} else {
|
|
|
// 控制公交自驾选中状态
|
|
@@ -313,6 +365,47 @@ Page({
|
|
|
address = item.address;
|
|
|
}
|
|
|
console.log(item.time);
|
|
|
+ let itemInfo = that.data.itemInfo
|
|
|
+ if (itemInfo[item.dep]) {
|
|
|
+ let arr = []
|
|
|
+ for (let i = 0; i < itemInfo[item.dep].length; i++) {
|
|
|
+ arr.push(itemInfo[item.dep][i].replace('重庆市', '').replace('南岸', ''))
|
|
|
+ }
|
|
|
+ itemInfo.deptList = arr
|
|
|
+ itemInfo.oldDeptList = itemInfo[item.dep]
|
|
|
+ }
|
|
|
+ itemInfo.deptShow = itemInfo[item.dep] ? true : false
|
|
|
+ itemInfo.navType = 0
|
|
|
+ itemInfo.page = 1
|
|
|
+ itemInfo.deptNow = ''
|
|
|
+ let params = {
|
|
|
+ page: 1,
|
|
|
+ limit: itemInfo.limit,
|
|
|
+ type: itemInfo.navType,
|
|
|
+ }
|
|
|
+ if (itemInfo.deptShow) {
|
|
|
+ params.matterDept = itemInfo.oldDeptList.join(',')
|
|
|
+ } else {
|
|
|
+ params.matterDept = item.dep.replace('政府', '').replace('便民服务中心', '')
|
|
|
+ }
|
|
|
+ const _this = this
|
|
|
+ getHandMatterPage(params).then((res) => {
|
|
|
+ if (!(res && res.count > 0)) {
|
|
|
+ itemInfo.matterStatus = false
|
|
|
+ _this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ itemInfo.matterStatus = true
|
|
|
+ itemInfo.pagePrev = itemInfo.page == 1
|
|
|
+ itemInfo.pageNext = itemInfo.page * itemInfo.limit >= res.count
|
|
|
+ itemInfo.matterList = res.data
|
|
|
+ _this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
that.setData({
|
|
|
detail_dep: item.dep,
|
|
|
detail_content: item.content,
|
|
@@ -321,7 +414,8 @@ Page({
|
|
|
detail_time: item.time,
|
|
|
detail_tel: item.tel,
|
|
|
detail_index: index,
|
|
|
- trafficEnd: address
|
|
|
+ trafficEnd: address,
|
|
|
+ itemInfo: itemInfo
|
|
|
});
|
|
|
|
|
|
BMap.geocoder({
|
|
@@ -404,7 +498,7 @@ Page({
|
|
|
getMapDataType(params).then((res) => {
|
|
|
let data = []
|
|
|
res.data.forEach((item) => {
|
|
|
- if(item.tel!=null && item.tel!=""){
|
|
|
+ if(item.tel!=null && item.tel!="" && !(item.tel instanceof Array)){
|
|
|
item.tel = item.tel.split(";")
|
|
|
}
|
|
|
data.push(item)
|
|
@@ -427,6 +521,12 @@ Page({
|
|
|
* @param {*} e
|
|
|
*/
|
|
|
searchTap(e) {
|
|
|
+ let searchInfo = this.data.searchInfo
|
|
|
+ searchInfo.isShow = true
|
|
|
+ searchInfo.navType = 0
|
|
|
+ this.setData({
|
|
|
+ searchInfo: searchInfo
|
|
|
+ })
|
|
|
let searchVal = this.data.searchVal;
|
|
|
|
|
|
wx.showToast({
|
|
@@ -444,7 +544,7 @@ Page({
|
|
|
getMapDataType(params).then((res) => {
|
|
|
let data = []
|
|
|
res.data.forEach((item) => {
|
|
|
- if(item.tel!=null && item.tel!=""){
|
|
|
+ if(item.tel!=null && item.tel!="" && !(item.tel instanceof Array)){
|
|
|
item.tel = item.tel.split(";")
|
|
|
}
|
|
|
data.push(item)
|
|
@@ -523,6 +623,11 @@ Page({
|
|
|
|
|
|
backSearch() {
|
|
|
let that =this
|
|
|
+ let searchInfo = that.data.searchInfo
|
|
|
+ searchInfo.isShow = that.data.searchVal ? true : false
|
|
|
+ that.setData({
|
|
|
+ searchInfo: searchInfo
|
|
|
+ })
|
|
|
if (!that.data.isList) {
|
|
|
this.setData({
|
|
|
isList: true,
|
|
@@ -562,6 +667,256 @@ Page({
|
|
|
changeValue = "transit";
|
|
|
},
|
|
|
|
|
|
+ matterTab(e) {
|
|
|
+ let itemInfo = this.data.itemInfo
|
|
|
+ itemInfo.navType = e.currentTarget.dataset?.type
|
|
|
+ let params = {
|
|
|
+ page: 1,
|
|
|
+ limit: itemInfo.limit,
|
|
|
+ type: itemInfo.navType,
|
|
|
+ }
|
|
|
+ if (itemInfo.deptShow) {
|
|
|
+ if (itemInfo.deptList && itemInfo.deptList.indexOf(itemInfo.deptNow) > -1) {
|
|
|
+ params.matterDept = itemInfo.deptNow.replace('政府', '').replace('便民服务中心', '')
|
|
|
+ } else {
|
|
|
+ params.matterDept = itemInfo.oldDeptList.join(',')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ params.matterDept = this.data.detail_dep.replace('政府', '').replace('便民服务中心', '')
|
|
|
+ }
|
|
|
+
|
|
|
+ const _this = this
|
|
|
+ getHandMatterPage(params).then((res) => {
|
|
|
+ if (!(res && res.count > 0)) {
|
|
|
+ itemInfo.matterStatus = false
|
|
|
+ _this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ itemInfo.matterStatus = true
|
|
|
+ itemInfo.page = 1
|
|
|
+ itemInfo.pagePrev = itemInfo.page == 1
|
|
|
+ itemInfo.pageNext = itemInfo.page * itemInfo.limit >= res.count
|
|
|
+ itemInfo.matterList = res.data
|
|
|
+ _this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ clickDept(e) {
|
|
|
+ console.log(e)
|
|
|
+ let itemInfo = this.data.itemInfo
|
|
|
+ itemInfo.deptNow = e.currentTarget.dataset.dept
|
|
|
+ itemInfo.page = 1
|
|
|
+ this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ let params = {
|
|
|
+ page: itemInfo.page,
|
|
|
+ limit: itemInfo.limit,
|
|
|
+ type: itemInfo.navType,
|
|
|
+ }
|
|
|
+ if (itemInfo.deptShow) {
|
|
|
+ if (itemInfo.deptList && itemInfo.deptList.indexOf(itemInfo.deptNow) > -1) {
|
|
|
+ params.matterDept = itemInfo.deptNow
|
|
|
+ } else {
|
|
|
+ params.matterDept = itemInfo.oldDeptList.join(',')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ params.matterDept = this.data.detail_dep
|
|
|
+ }
|
|
|
+ const _this = this
|
|
|
+ getHandMatterPage(params).then((res) => {
|
|
|
+ if (!(res && res.count > 0)) {
|
|
|
+ itemInfo.matterStatus = false
|
|
|
+ _this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ itemInfo.pagePrev = itemInfo.page == 1
|
|
|
+ itemInfo.pageNext = itemInfo.page * itemInfo.limit >= res.count
|
|
|
+ itemInfo.matterList = res.data
|
|
|
+ _this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ clickPageTo(e) {
|
|
|
+ let itemInfo = this.data.itemInfo
|
|
|
+ let page = 1
|
|
|
+ if (e.currentTarget.dataset.type == 0) {
|
|
|
+ // 上一页
|
|
|
+ if (itemInfo.pagePrev) return
|
|
|
+ page = itemInfo.page - 1
|
|
|
+ } else {
|
|
|
+ if (itemInfo.pageNext) return
|
|
|
+ page = itemInfo.page + 1
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ page: page,
|
|
|
+ limit: itemInfo.limit,
|
|
|
+ type: itemInfo.navType,
|
|
|
+ }
|
|
|
+ if (itemInfo.deptShow) {
|
|
|
+ if (itemInfo.deptList && itemInfo.deptList.indexOf(itemInfo.deptNow) > -1) {
|
|
|
+ params.matterDept = itemInfo.deptNow.replace('政府', '').replace('便民服务中心', '')
|
|
|
+ } else {
|
|
|
+ params.matterDept = itemInfo.oldDeptList.join(',')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ params.matterDept = this.data.detail_dep.replace('政府', '').replace('便民服务中心', '')
|
|
|
+ }
|
|
|
+ const _this = this
|
|
|
+ getHandMatterPage(params).then((res) => {
|
|
|
+ if (!(res && res.count > 0)) {
|
|
|
+ itemInfo.matterStatus = false
|
|
|
+ _this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ itemInfo.matterStatus = true
|
|
|
+ itemInfo.page = page
|
|
|
+ itemInfo.pagePrev = itemInfo.page == 1
|
|
|
+ itemInfo.pageNext = itemInfo.page * itemInfo.limit >= res.count
|
|
|
+ itemInfo.matterList = res.data
|
|
|
+ _this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ searchTab(e) {
|
|
|
+ let searchInfo = this.data.searchInfo
|
|
|
+ searchInfo.navType = e.currentTarget.dataset.type
|
|
|
+ this.setData({
|
|
|
+ searchInfo: searchInfo
|
|
|
+ })
|
|
|
+ const _this = this
|
|
|
+ if (searchInfo.navType == 0) {
|
|
|
+ let params ={
|
|
|
+ "title": _this.data.searchVal,
|
|
|
+ };
|
|
|
+ getMapDataType(params).then((res) => {
|
|
|
+ let data = []
|
|
|
+ res.data.forEach((item) => {
|
|
|
+ if(item.tel!=null && item.tel!="" && !(item.tel instanceof Array)){
|
|
|
+ item.tel = item.tel.split(";")
|
|
|
+ }
|
|
|
+ data.push(item)
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ showTraffic: false,
|
|
|
+ popData: data,
|
|
|
+ })
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ searchHandMatter(_this)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ markClick(e) {
|
|
|
+ if(!e.markerId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const arr = this.data.marksInfo
|
|
|
+ const that = this
|
|
|
+ this.setData({
|
|
|
+ popData: arr
|
|
|
+ })
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ if (arr[i].id == e.markerId) {
|
|
|
+
|
|
|
+ let searchInfo = that.data.searchInfo
|
|
|
+ searchInfo.isShow = false
|
|
|
+ that.setData({
|
|
|
+ isList: false,
|
|
|
+ showSearch: false,
|
|
|
+ showSet: false,
|
|
|
+ showTraffic: false,
|
|
|
+ searchInfo: searchInfo
|
|
|
+ });
|
|
|
+ let item = arr[i];
|
|
|
+ console.info(item);
|
|
|
+ if(item.tel && !(item.tel instanceof Array)){
|
|
|
+ item.tel = item.tel.split(";")
|
|
|
+ }
|
|
|
+ let address = item.address
|
|
|
+ console.log(item.time);
|
|
|
+ let itemInfo = that.data.itemInfo
|
|
|
+ if (itemInfo[item.dep]) {
|
|
|
+ let arr = []
|
|
|
+ for (let i = 0; i < itemInfo[item.dep].length; i++) {
|
|
|
+ arr.push(itemInfo[item.dep][i].replace('重庆市', '').replace('南岸', ''))
|
|
|
+ }
|
|
|
+ itemInfo.deptList = arr
|
|
|
+ itemInfo.oldDeptList = itemInfo[item.dep]
|
|
|
+ }
|
|
|
+ itemInfo.deptShow = itemInfo[item.dep] ? true : false
|
|
|
+ itemInfo.navType = 0
|
|
|
+ itemInfo.page = 1
|
|
|
+ itemInfo.deptNow = ''
|
|
|
+ let params = {
|
|
|
+ page: 1,
|
|
|
+ limit: itemInfo.limit,
|
|
|
+ type: itemInfo.navType,
|
|
|
+ }
|
|
|
+ if (itemInfo.deptShow) {
|
|
|
+ params.matterDept = itemInfo.oldDeptList.join(',')
|
|
|
+ } else {
|
|
|
+ params.matterDept = item.dep.replace('政府', '').replace('便民服务中心', '')
|
|
|
+ }
|
|
|
+ console.log(params)
|
|
|
+ const _this = this
|
|
|
+ getHandMatterPage(params).then((res) => {
|
|
|
+ if (!(res && res.count > 0)) {
|
|
|
+ itemInfo.matterStatus = false
|
|
|
+ _this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ itemInfo.matterStatus = true
|
|
|
+ itemInfo.pagePrev = itemInfo.page == 1
|
|
|
+ itemInfo.pageNext = itemInfo.page * itemInfo.limit >= res.count
|
|
|
+ itemInfo.matterList = res.data
|
|
|
+ _this.setData({
|
|
|
+ itemInfo: itemInfo
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
+ that.setData({
|
|
|
+ detail_dep: item.dep,
|
|
|
+ detail_content: item.content,
|
|
|
+ detail_img: item.img,
|
|
|
+ detail_address: item.address,
|
|
|
+ detail_time: item.time,
|
|
|
+ detail_tel: item.tel,
|
|
|
+ detail_index: i,
|
|
|
+ trafficEnd: address,
|
|
|
+ itemInfo: itemInfo
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ aroundEvent(e) {
|
|
|
+ const _this = this
|
|
|
+ this.setData({
|
|
|
+ isList: true,
|
|
|
+ showSearch: false,
|
|
|
+ showSet: false,
|
|
|
+ showTraffic: false,
|
|
|
+ popData: _this.data.marksView
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toDetailWeb(e) {
|
|
|
+ console.log(e.currentTarget.dataset.url)
|
|
|
+ // wx.navigateTo({
|
|
|
+ // url: '/pages/web/web?gzUrl=' + e.currentTarget.dataset.url,
|
|
|
+ // })
|
|
|
+ },
|
|
|
onchange(e) {
|
|
|
let that = this;
|
|
|
if (e.detail.value == 0) {
|
|
@@ -590,4 +945,120 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-let changeValue = "transit";
|
|
|
+let changeValue = "transit";
|
|
|
+
|
|
|
+function searchHandMatter(that) {
|
|
|
+ getHandMatterBySearch(that.data.searchVal).then((res) => {
|
|
|
+ if (res.data && res.data.length) {
|
|
|
+ searchDepVal(that, res.data.join(','), res.data)
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function searchDepVal(that, queryVal, deptArr) {
|
|
|
+ let params = {
|
|
|
+ title: queryVal
|
|
|
+ }
|
|
|
+ wx.showToast({
|
|
|
+ title: '加载中...',
|
|
|
+ icon: 'loading'
|
|
|
+});
|
|
|
+ getMapDataType(params).then((res) => {
|
|
|
+ let data = []
|
|
|
+ let st = true, st2 = true
|
|
|
+ deptArr.forEach((item) => {
|
|
|
+ if (that.data.jnxc.indexOf(item) > -1 && st) {
|
|
|
+ st = false
|
|
|
+ let ite = that.data.xzfwzxs[0]
|
|
|
+ if(ite.tel && !(ite.tel instanceof Array)){
|
|
|
+ ite.tel = ite.tel.split(";")
|
|
|
+ }
|
|
|
+ data.push(ite)
|
|
|
+ }
|
|
|
+ if (that.data.npzx.indexOf(item) > -1 && st2) {
|
|
|
+ st2 = false
|
|
|
+ let ite = that.data.xzfwzxs[1]
|
|
|
+ if(ite.tel && !(ite.tel instanceof Array)){
|
|
|
+ ite.tel = ite.tel.split(";")
|
|
|
+ }
|
|
|
+ data.push(ite)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ res.data.forEach((item) => {
|
|
|
+ if(item.tel!=null && item.tel!="" && !(item.tel instanceof Array)){
|
|
|
+ item.tel = item.tel.split(";")
|
|
|
+ }
|
|
|
+ data.push(item)
|
|
|
+ });
|
|
|
+
|
|
|
+ that.setData({
|
|
|
+ showTraffic: false,
|
|
|
+ popData: data,
|
|
|
+ })
|
|
|
+ wx.hideLoading()
|
|
|
+ });
|
|
|
+ wx.hideLoading()
|
|
|
+}
|
|
|
+
|
|
|
+function initMapDataAll(that, lat, lng) {
|
|
|
+ let arr = that.data.marksInfo
|
|
|
+ let index = 0;
|
|
|
+ let addrArr = []
|
|
|
+ let marksView = []
|
|
|
+ let task = setInterval(function() {
|
|
|
+ if (index >= arr.length) {
|
|
|
+ addrArr.push({
|
|
|
+ latitude: lat,
|
|
|
+ longitude: lng,
|
|
|
+ iconPath: "/location.png",
|
|
|
+ width: '30px',
|
|
|
+ height: '30px',
|
|
|
+ rotate: 0,
|
|
|
+ alpha: 1
|
|
|
+ })
|
|
|
+ console.log(addrArr)
|
|
|
+ that.setData({
|
|
|
+ markers: addrArr,
|
|
|
+ marksView: marksView,
|
|
|
+ marksNum: addrArr.length - 1
|
|
|
+ })
|
|
|
+ clearInterval(task)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const address = arr[index]
|
|
|
+ index++
|
|
|
+ BMap.geocoder({
|
|
|
+ address: address.address,
|
|
|
+ success: (addr) => {
|
|
|
+ BMap.calculateDistance({
|
|
|
+ mode: 'straight',
|
|
|
+ from: {
|
|
|
+ latitude: lat,
|
|
|
+ longitude: lng
|
|
|
+ },
|
|
|
+ to: [{
|
|
|
+ latitude: addr.result.location.lat,
|
|
|
+ longitude: addr.result.location.lng
|
|
|
+ }],
|
|
|
+ success: (json) => {
|
|
|
+ console.log(json)
|
|
|
+ const jl = parseInt(json.result.elements[0].distance)
|
|
|
+ if (jl <= 1000) {
|
|
|
+ marksView.push(address)
|
|
|
+ addrArr.push({
|
|
|
+ id: address.id,
|
|
|
+ latitude: json.result.elements[0].to.lat,
|
|
|
+ longitude: json.result.elements[0].to.lng,
|
|
|
+ iconPath: imgUrl+"/location.png",
|
|
|
+ width: '34px',
|
|
|
+ height: '34px',
|
|
|
+ rotate: 0,
|
|
|
+ alpha: 1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 300);
|
|
|
+}
|