Merge branch 'YOUFANGAPP1.1.1' of 192.168.0.27:dev0/youfang-app into YOUFANGAPP1.1.1
This commit is contained in:
@@ -27,60 +27,52 @@ document.addEventListener("plusready", function() {
|
|||||||
if (payload.type == "0") {
|
if (payload.type == "0") {
|
||||||
plus.ui.alert(title+"\n"+content);
|
plus.ui.alert(title+"\n"+content);
|
||||||
} else if (payload.type == "1") {
|
} else if (payload.type == "1") {
|
||||||
plus.ui.alert(title+"\n"+content,function(){
|
plus.ui.alert(title+"\n"+content,function(){
|
||||||
if (payload.url == '/house/index') {
|
if(plus.webview.getWebviewById('H5693FF3D')==null){
|
||||||
plus.webview.show('yfindex.html');
|
plus.webview.show(plus.webview.getWebviewById("HBuilder"));
|
||||||
} else {
|
}else{
|
||||||
plus.webview.show(BASE_PATH + payload.url);
|
plus.webview.show(plus.webview.getWebviewById("H5693FF3D"));
|
||||||
}
|
}
|
||||||
//切换选项卡高亮
|
var targetTab = payload.url+".html";
|
||||||
var defaultTab = document.getElementById("defaultTab");
|
var defaultTab = document.getElementById(targetTab);
|
||||||
var quotations = document.getElementById("quotations");
|
//模拟首页点击
|
||||||
var selfInfo = document.getElementById("selfInfo");
|
mui.trigger(defaultTab, 'tap');
|
||||||
defaultTab.classList.remove("mui-active");
|
//切换选项卡高亮
|
||||||
quotations.classList.remove("mui-active");
|
var current = document.querySelector(".mui-bar-tab>.mui-tab-item.mui-active");
|
||||||
selfInfo.classList.remove("mui-active");
|
if (defaultTab != current) {
|
||||||
if (payload.url == '/quotations/index') {
|
current.classList.remove('mui-active');
|
||||||
quotations.classList.add("mui-active");
|
defaultTab.classList.add('mui-active');
|
||||||
} else if(payload.url == '/selfInfo/index') {
|
|
||||||
selfInfo.classList.add("mui-active");
|
|
||||||
} else {
|
|
||||||
defaultTab.classList.add("mui-active");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (payload.type == "2") {
|
} else if (payload.type == "2") {
|
||||||
plus.ui.alert(title+"\n"+content,function(){
|
plus.ui.alert(title+"\n"+content,function(){
|
||||||
openUrl(BASE_PATH+'/message/openView?url='+payload.url);
|
clicked('views/webview_embed.html', true,false,{},{url:payload.url})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (payload.type == "0") {
|
if (payload.type == "0") {
|
||||||
plus.ui.alert(content);
|
plus.ui.alert(content);
|
||||||
} else if (payload.type == "1") {
|
} else if (payload.type == "1") {
|
||||||
plus.ui.alert(content,function(){
|
plus.ui.alert(title+"\n"+content,function(){
|
||||||
if (payload.url == '/house/index') {
|
if(plus.webview.getWebviewById('H5693FF3D')==null){
|
||||||
plus.webview.show('yfindex.html');
|
plus.webview.show(plus.webview.getWebviewById("HBuilder"));
|
||||||
} else {
|
}else{
|
||||||
plus.webview.show(BASE_PATH + payload.url);
|
plus.webview.show(plus.webview.getWebviewById("H5693FF3D"));
|
||||||
}
|
}
|
||||||
//切换选项卡高亮
|
var targetTab = payload.url+".html";
|
||||||
var defaultTab = document.getElementById("defaultTab");
|
var defaultTab = document.getElementById(targetTab);
|
||||||
var quotations = document.getElementById("quotations");
|
//模拟首页点击
|
||||||
var selfInfo = document.getElementById("selfInfo");
|
mui.trigger(defaultTab, 'tap');
|
||||||
defaultTab.classList.remove("mui-active");
|
//切换选项卡高亮
|
||||||
quotations.classList.remove("mui-active");
|
var current = document.querySelector(".mui-bar-tab>.mui-tab-item.mui-active");
|
||||||
selfInfo.classList.remove("mui-active");
|
if (defaultTab != current) {
|
||||||
if (payload.url == '/quotations/index') {
|
current.classList.remove('mui-active');
|
||||||
quotations.classList.add("mui-active");
|
defaultTab.classList.add('mui-active');
|
||||||
} else if(payload.url == '/selfInfo/index') {
|
|
||||||
selfInfo.classList.add("mui-active");
|
|
||||||
} else {
|
|
||||||
defaultTab.classList.add("mui-active");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (payload.type == "2") {
|
} else if (payload.type == "2") {
|
||||||
plus.ui.alert(content,function(){
|
plus.ui.alert(content,function(){
|
||||||
openUrl(BASE_PATH+'/message/openView?url='+payload.url);
|
clicked('views/webview_embed.html', true,false,{},{url:payload.url})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+67
-37
@@ -1248,48 +1248,60 @@ function getPosition(){
|
|||||||
plus.geolocation.getCurrentPosition(function(p){
|
plus.geolocation.getCurrentPosition(function(p){
|
||||||
if(p.address.city==undefined){
|
if(p.address.city==undefined){
|
||||||
city = "上海";
|
city = "上海";
|
||||||
$("#input_city").text(city);
|
initData();
|
||||||
}else{
|
}else{
|
||||||
address = p.address.street;
|
|
||||||
province = p.address.province;
|
|
||||||
city = p.address.city;
|
city = p.address.city;
|
||||||
region = p.address.district;
|
|
||||||
lng = p.coords.longitude;//获取到当前位置的经度
|
|
||||||
lat = p.coords.latitude;//获取到当前位置的纬度;
|
|
||||||
oriLng = p.coords.longitude;
|
|
||||||
oriLat = p.coords.latitude;
|
|
||||||
//alert("4"+oriLng);
|
|
||||||
|
|
||||||
if(city){
|
if(city){
|
||||||
city = formatBaiduCity(city);
|
city = formatBaiduCity(city);
|
||||||
}
|
}
|
||||||
if(region.endWith("区")){
|
axios.get("/rest/index/isChinaCity", {
|
||||||
region = region.substring(0, region.length-1);
|
params: {
|
||||||
}
|
city: city
|
||||||
oriRegion = region;
|
}
|
||||||
oriCity = city;
|
})
|
||||||
$("#input_city").text(city);
|
.then(function (response) {
|
||||||
}
|
if(response.data.data.status==1){
|
||||||
localStorage.setItem("init_city", city);
|
address = p.address.street;
|
||||||
//addLocation(lat,lng);
|
province = p.address.province;
|
||||||
$(".nowCity").text(city);
|
|
||||||
/*city="北京";
|
region = p.address.district;
|
||||||
region="";
|
lng = p.coords.longitude;//获取到当前位置的经度
|
||||||
$("#input_city").text("北京");
|
lat = p.coords.latitude;//获取到当前位置的纬度;
|
||||||
getDistrictList($("#input_city").text(),0,0,"",6,0,0,"");*/
|
oriLng = p.coords.longitude;
|
||||||
|
oriLat = p.coords.latitude;
|
||||||
|
|
||||||
|
if(region.endWith("区")){
|
||||||
|
region = region.substring(0, region.length-1);
|
||||||
|
}
|
||||||
|
oriRegion = region;
|
||||||
|
oriCity = city;
|
||||||
|
}else{
|
||||||
|
city = "上海";
|
||||||
|
$("#input_city").text(city);
|
||||||
|
initRegionSelect(city);
|
||||||
|
localStorage.setItem("init_city", city);
|
||||||
|
//addLocation(lat,lng);
|
||||||
|
initBaseInfo(city,"","",0,0);
|
||||||
|
$("#ShangHaiDiv").show();
|
||||||
|
$("#otherCityDiv").hide();
|
||||||
|
}
|
||||||
|
initData();
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
setTimeout(function(){
|
||||||
|
mui.init();
|
||||||
|
mui.openWindow({
|
||||||
|
url: 'error.html',
|
||||||
|
id:'error.html',
|
||||||
|
extras:{
|
||||||
|
//扩展参数
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},10000)
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
initBaseInfo(city,region,address,lat,lng);
|
|
||||||
if(city!="上海"){
|
|
||||||
//$(".content").removeClass("pull-to-refresh-content");
|
|
||||||
$.destroyPullToRefresh(".content")
|
|
||||||
initRegionSelect(city);
|
|
||||||
$("#ShangHaiDiv").hide();
|
|
||||||
$("#otherCityDiv").show();
|
|
||||||
}else{
|
|
||||||
$.initPullToRefresh(".content")
|
|
||||||
$("#ShangHaiDiv").show();
|
|
||||||
$("#otherCityDiv").hide();
|
|
||||||
}
|
|
||||||
}, function(e){
|
}, function(e){
|
||||||
city = "上海";
|
city = "上海";
|
||||||
$("#input_city").text(city);
|
$("#input_city").text(city);
|
||||||
@@ -1308,6 +1320,24 @@ function getPosition(){
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initData(){
|
||||||
|
$("#input_city").text(city);
|
||||||
|
localStorage.setItem("init_city", city);
|
||||||
|
//addLocation(lat,lng);
|
||||||
|
$(".nowCity").text(city);
|
||||||
|
|
||||||
|
initBaseInfo(city,region,address,lat,lng);
|
||||||
|
if(city!="上海"){
|
||||||
|
$.destroyPullToRefresh(".content")
|
||||||
|
initRegionSelect(city);
|
||||||
|
$("#ShangHaiDiv").hide();
|
||||||
|
$("#otherCityDiv").show();
|
||||||
|
}else{
|
||||||
|
$.initPullToRefresh(".content")
|
||||||
|
$("#ShangHaiDiv").show();
|
||||||
|
$("#otherCityDiv").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
/* 获取#region字数,截取#region前4字,并添加... */
|
/* 获取#region字数,截取#region前4字,并添加... */
|
||||||
|
|
||||||
var baseInfo = new Vue({
|
var baseInfo = new Vue({
|
||||||
@@ -1326,7 +1356,7 @@ var baseInfo = new Vue({
|
|||||||
|
|
||||||
function initBaseInfo(city,region,address,lat,lng){
|
function initBaseInfo(city,region,address,lat,lng){
|
||||||
//显示附近地址
|
//显示附近地址
|
||||||
if(address!=""){
|
if(address!="" || address!=undefined){
|
||||||
var nearAddressParam = address;
|
var nearAddressParam = address;
|
||||||
var length = address.length;
|
var length = address.length;
|
||||||
var textStr = "";
|
var textStr = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user