父界面:

myChart.on('click', function (params) {
var dataIndex = params.dataIndex;
if(params.name != ""){
var id=0;
var shortname = "";
for(var i=0;i<province_data.length;i++){
if(params.name.indexOf(province_data[i].shortname) != -1){
id = province_data[i].value;
shortname = province_data[i].shortname;
}
if(params.name == province_data[i].name){
id = province_data[i].value;
}
}
if(id != 0){
mui.openWindow({
url:'city.html?pid='+id+'&name='+encodeURI(params.name)+'&shortname='+encodeURI(shortname),
id: 'city_map'
})
}
}
});

子界面:

var pid;
var cityname;
var cityshortname;
var location_url = window.location.href;
var parameter_str = location_url.split('?')[1];
var parameter_arr = parameter_str.split('&');
for(var i = 0, len = parameter_arr.length; i <= len -1; i++){
tmp_arr = parameter_arr[i].split('=');
if(tmp_arr[0]=='pid'){
pid = tmp_arr[1];
}
if(tmp_arr[0]=='name'){
cityname = decodeURI(tmp_arr[1]);
}
if(tmp_arr[0]=='shortname'){
cityshortname = decodeURI(tmp_arr[1]);
}
}

posted on 2019-01-24 11:48  baraka  阅读(1290)  评论(0编辑  收藏  举报