This commit is contained in:
SmileXin 2025-02-07 23:18:05 +08:00
parent 4697f77226
commit 34ef7c42a6
5 changed files with 205 additions and 176 deletions

View File

@ -51,5 +51,9 @@
"post-merge": "post-npm-install", "post-merge": "post-npm-install",
"post-rebase": "post-npm-install" "post-rebase": "post-npm-install"
} }
} },
"name": "bmw",
"version": "1.0.0",
"main": "index.js",
"license": "MIT"
} }

View File

@ -25,7 +25,7 @@ import { RequestConfig } from '@umijs/max';
export const request: RequestConfig = { export const request: RequestConfig = {
requestInterceptors: [ requestInterceptors: [
(url, options) => { (url, options) => {
const token = localStorage.getItem('authToken'); // 从某处获取你的认证token例如localStorage const token = localStorage.getItem('pc-key'); // 从某处获取你的认证token例如localStorage
if (token) { if (token) {
const headers = { const headers = {
Authorization: `${token}`, Authorization: `${token}`,

View File

@ -168,11 +168,10 @@ body {
} }
.hiddenBtn{ .hiddenBtn{
overflow: hidden; overflow: hidden;
position: fixed; position: absolute;
height: 40px; height: 40px;
width: 40px; width: 40px;
top: 220px; margin: 20% 21.4%;
margin: 0 0 0 22%;
background: rgb(255, 255, 255); background: rgb(255, 255, 255);
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2); box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);
border-radius: 10px; border-radius: 10px;
@ -199,7 +198,7 @@ body {
// margin-left: 0; // margin-left: 0;
} }
to { to {
margin: 0 0 0 4%; margin: 20% 5%;
} }
} }
@ -207,12 +206,13 @@ body {
// overflow: hidden; // overflow: hidden;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
position: fixed; position: absolute;
top: 190px; // top: 190px;
width: 270px; width: 16.4%;
// width: 270px;
max-height: 450px; max-height: 450px;
// min-height: 100px; // min-height: 100px;
margin: 2% 4.2%; margin: 20% 5%;
background: rgba(239,240,248,1); background: rgba(239,240,248,1);
// background: rgba(239,240,248,0); // background: rgba(239,240,248,0);
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2); box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);

View File

@ -68,7 +68,7 @@ class LayerData extends React.Component {
} }
return getBasicLayerMenuApi({ adcode: adcode }).then((e) => { return getBasicLayerMenuApi({ adcode: adcode }).then((e) => {
let basicLayeData = e.data; let basicLayeData = e.data;
console.log('basicLayeData', basicLayeData); console.log('basicLayeData', e);
// MenuData // MenuData
let menuDataList = []; let menuDataList = [];
for (var m in basicLayeData) { for (var m in basicLayeData) {

View File

@ -105,6 +105,29 @@ class BaseMap extends React.Component{
this.setState({ this.setState({
map: scene, map: scene,
}); });
// 地图搜索提示功能
// scene.on('loaded', () => {
// // AutoComplete 插件
// window.AMap.plugin(['AMap.Autocomplete'], () => {
// // Autocomplete 实例配置
// const autoOptions = {
// city: '全国', //城市,默认全国
// input: 'tipinput' //使用联想输入的input的id
// };
// // 创建Autocomplete对象
// const autoComplete = new AMap.AutoComplete(autoOptions);
// });
// // scene.map.plugin(['AMap.Autocomplete'], () => {
// // // Autocomplete 实例配置
// // const autoOptions = {
// // city: '全国', //城市,默认全国
// // input: 'tipinput' //使用联想输入的input的id
// // };
// // // 创建Autocomplete对象
// // const autoComplete = new AMap.autoComplete(autoOptions);
// // });
// })
} }
//设置地图省份级别位置 //设置地图省份级别位置
@ -523,6 +546,7 @@ class BaseMap extends React.Component{
//选择市 cityAdcode:市编码 data:市数据 //选择市 cityAdcode:市编码 data:市数据
onCityChange = (cityAdcode, data) => { onCityChange = (cityAdcode, data) => {
var self = this; var self = this;
console.log("cityAdcode", cityAdcode)
if (cityAdcode === undefined || cityAdcode === null || cityAdcode === "" || cityAdcode === 'undefined') { if (cityAdcode === undefined || cityAdcode === null || cityAdcode === "" || cityAdcode === 'undefined') {
this.setState({ this.setState({
cityAdcode: '', cityAdcode: '',
@ -589,6 +613,7 @@ class BaseMap extends React.Component{
} }
self.startLoading(); self.startLoading();
let getLayers = self.state.markerLayerList; let getLayers = self.state.markerLayerList;
console.log("getLayers✈······", getLayers)
for (let i = 0; i < getLayers.length; i++) { for (let i = 0; i < getLayers.length; i++) {
self.state.map.removeMarkerLayer(getLayers[i]); self.state.map.removeMarkerLayer(getLayers[i]);
} }