Commit 9f216986cbd73499d2db15831dcda5c0bd1e49e0

Authored by liuqimichale
1 parent 642c8bff

弹窗

src/utils/formatNum.js
... ... @@ -36,4 +36,13 @@ function formatNumArr(str) {
36 36  
37 37 }
38 38  
  39 +function formatChanging(val) {
  40 + console.log(val)
  41 + let tmpHtml = '';
  42 + for(let i=0;i<val.length;i++){
  43 + tmpHtml += "<li>"+val[i].standard+"</li>"
  44 + }
  45 + return tmpHtml
  46 +}
  47 +
39 48 export default {formatNumArr}
... ...
src/utils/request.js
... ... @@ -6,7 +6,8 @@ const CancelToken = axios.CancelToken;
6 6 //请求拦截器 // 在发送请求之前做些什么
7 7 axios.interceptors.request.use(config => {
8 8 //发起请求时,取消掉当前正在进行的相同请求
9   - config.headers['x-auth-token'] = '18de1300-c3f2-4365-9f51-62f77614f8c5'
  9 + //config.headers['x-auth-token'] = '18de1300-c3f2-4365-9f51-62f77614f8c5'
  10 + config.headers['x-auth-token'] = '6840160c-7c45-42c4-8736-805f13487565' //测试地址
10 11 config.data = {
11 12 ...config.data,
12 13 sysCode: '1001'
... ... @@ -73,7 +74,9 @@ axios.interceptors.response.use(response =&gt; {
73 74 })
74 75 //基础url前缀
75 76 //axios.defaults.baseURL = '/api'
76   -axios.defaults.baseURL = 'http://bcp.service.renniting.cn/';
  77 +
  78 +//axios.defaults.baseURL = 'http://bcp.service.renniting.cn/';
  79 +axios.defaults.baseURL = 'http://test.renniting.cn/bcp/';//测试地址
77 80 //设置默认请求头
78 81 // axios.defaults.withCredentials=true;//让ajax携带cookie
79 82  
... ...
src/views/mapsection.vue
... ... @@ -141,7 +141,6 @@ export default {
141 141  
142 142 },
143 143 baiduMap (data) {
144   - console.log(data)
145 144 if(data.length === 0){
146 145 var map = new BMap.Map('allmap', {enableMapClick: false})
147 146 var point = new BMap.Point(111.742579, 40.878675)
... ... @@ -204,12 +203,22 @@ export default {
204 203 map.addOverlay(marker);
205 204 var myLabel;
206 205  
207   - marker.addEventListener("click", (e)=> {
  206 + marker.addEventListener("mouseover", (e)=> {
208 207 map.removeOverlay(myLabel);
209 208 var that = this;
  209 + let tmpHtml = '';
  210 + console.log(JSON.parse(data[itemthat].plRate))
  211 + console.log(typeof JSON.parse(data[itemthat].plRate))
  212 + for(let i=0;i<JSON.parse(data[itemthat].plRate).length;i++){
  213 + //console.log(data[itemthat].plRate)
  214 + tmpHtml += "<li>"+JSON.parse(data[itemthat].plRate)[i].standard+"</li>"
  215 + }
  216 +
  217 + // label = null
  218 + // map.removeOverlay(myLabel);
210 219 myLabel = new BMap.Label(
211 220 `<div class="dislog-wrap">
212   - <div class="dialog-header" title="${data[itemthat].plAddress}">${data[itemthat].plAddress}</div>
  221 + <div class="dialog-header" title="${data[itemthat].plAddress}">${data[itemthat].plName}</div>
213 222 <div class="dialog-address" title="${data[itemthat].plAddress}">${data[itemthat].plAddress}</div>
214 223 <ul class="dislog-body">
215 224 <li><div>${data[itemthat].freeBrethNum}</div><div>空闲</div></li>
... ... @@ -218,10 +227,7 @@ export default {
218 227 </ul>
219 228 <div class="dislog-footer">收费标准</div>
220 229 <ul class="dislog-footer-main">
221   - <li>收费标准收费标准收费标准收费标准</li>
222   - <li>收费标准收费标准收费标准收费标准</li>
223   - <li>收费标准收费标准收费标准收费标准</li>
224   - <li>收费标准收费标准收费标准收费标准</li>
  230 + ${tmpHtml}
225 231 </ul>
226 232 </div>`,
227 233 {
... ... @@ -242,9 +248,9 @@ export default {
242 248 marker.setTop(true,27000000);
243 249  
244 250 });
245   - // marker.addEventListener("mouseout", function (e) {
246   - // map.removeOverlay(myLabel);
247   - // });
  251 + marker.addEventListener("mouseout", function (e) {
  252 + map.removeOverlay(myLabel);
  253 + });
248 254 i++;
249 255 })(i);
250 256 }
... ...