Merge branch 'YOUFANGAPP1.1.2' of http://192.168.0.27/dev0/youfang-app into YOUFANGAPP1.1.2
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
<div class="content-block">
|
<div class="content-block">
|
||||||
<p>
|
<p>
|
||||||
<a onclick="plus.runtime.restart()" class="button button-big button-round theme">重启应用</a>
|
<a onclick="plus.runtime.restart()" class="button button-big button-round theme">重启应用</a>
|
||||||
<a onclick="again()" class="button button-big button-round theme">返回刷新</a>
|
<a onclick="again()" class="button button-big button-round theme" id="bakBtn">返回刷新</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,8 +50,11 @@
|
|||||||
document.addEventListener('plusready', onPlusReady, false);
|
document.addEventListener('plusready', onPlusReady, false);
|
||||||
function onPlusReady() {
|
function onPlusReady() {
|
||||||
var self = plus.webview.currentWebview();
|
var self = plus.webview.currentWebview();
|
||||||
flag = self.flag;
|
flag = self.flag;
|
||||||
plus.nativeUI.closeWaiting();
|
if(flag == null) {
|
||||||
|
document.getElementById("bakBtn").setAttribute("style", "display: none;")
|
||||||
|
}
|
||||||
|
plus.nativeUI.closeWaiting();
|
||||||
}
|
}
|
||||||
|
|
||||||
function again(){
|
function again(){
|
||||||
|
|||||||
@@ -50,9 +50,31 @@ document.addEventListener("plusready", function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (payload.type == "2") {
|
} else if (payload.type == "2") {
|
||||||
plus.ui.alert(title+"\n"+content,function(){
|
if (payload.url.startWith("http")) {
|
||||||
clicked('views/webview_embed.html', true,false,{},{url:payload.url})
|
plus.ui.alert(title+"\n"+content,function(){
|
||||||
});
|
clicked('views/webview_embed.html', true,false,{},{url:payload.url})
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 处理打开app中的二级页面,一级页面在type=1中已经处理了,如果有http的地址就是打开外部页面
|
||||||
|
// 否则就是打开app内部页面
|
||||||
|
plus.ui.alert(content,function(){
|
||||||
|
var url = payload.url;
|
||||||
|
var sindex = url.indexOf('?') == -1 ? url.length : url.indexOf('?');
|
||||||
|
var openUrl = url.substring(0, sindex);
|
||||||
|
var paramStr = url.substring(sindex+1);
|
||||||
|
var jsonData = {};
|
||||||
|
var parray = paramStr.split('&')
|
||||||
|
for(var i=0;i<parray.length;i++){
|
||||||
|
var subArray = parray[i].split('=')
|
||||||
|
if(parray[i] != ""){
|
||||||
|
if(subArray.length > 0) {
|
||||||
|
jsonData[subArray[0]] = subArray[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clicked(openUrl,true,false,{},jsonData)
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (payload.type == "0") {
|
if (payload.type == "0") {
|
||||||
|
|||||||
+22
-10
@@ -1255,26 +1255,26 @@ function getPosition(){
|
|||||||
if(city){
|
if(city){
|
||||||
city = formatBaiduCity(city);
|
city = formatBaiduCity(city);
|
||||||
}
|
}
|
||||||
|
region = p.address.district;
|
||||||
|
if(region.endWith("区") || region.endWith("市") ){
|
||||||
|
region = region.substring(0, region.length-1);
|
||||||
|
}
|
||||||
axios.get("/rest/index/isChinaCity", {
|
axios.get("/rest/index/isChinaCity", {
|
||||||
params: {
|
params: {
|
||||||
city: city
|
city: city,
|
||||||
|
region: region
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
if(response.data.data.status==1){
|
if(response.data.data.status==1 && (response.data.data.region!="" || response.data.data.region!=undefined)){
|
||||||
address = p.address.street;
|
address = p.address.street;
|
||||||
province = p.address.province;
|
province = p.address.province;
|
||||||
|
region = response.data.data.region
|
||||||
region = p.address.district;
|
|
||||||
lng = p.coords.longitude;//获取到当前位置的经度
|
lng = p.coords.longitude;//获取到当前位置的经度
|
||||||
lat = p.coords.latitude;//获取到当前位置的纬度;
|
lat = p.coords.latitude;//获取到当前位置的纬度;
|
||||||
oriLng = p.coords.longitude;
|
oriLng = p.coords.longitude;
|
||||||
oriLat = p.coords.latitude;
|
oriLat = p.coords.latitude;
|
||||||
|
|
||||||
|
|
||||||
if(region.endWith("区") || region.endWith("市") ){
|
|
||||||
region = region.substring(0, region.length-1);
|
|
||||||
}
|
|
||||||
oriRegion = region;
|
oriRegion = region;
|
||||||
oriCity = city;
|
oriCity = city;
|
||||||
}else{
|
}else{
|
||||||
@@ -1282,7 +1282,6 @@ function getPosition(){
|
|||||||
$("#input_city").text(city);
|
$("#input_city").text(city);
|
||||||
initRegionSelect(city);
|
initRegionSelect(city);
|
||||||
localStorage.setItem("init_city", city);
|
localStorage.setItem("init_city", city);
|
||||||
//addLocation(lat,lng);
|
|
||||||
initBaseInfo(city,"","",0,0);
|
initBaseInfo(city,"","",0,0);
|
||||||
$("#ShangHaiDiv").show();
|
$("#ShangHaiDiv").show();
|
||||||
$("#otherCityDiv").hide();
|
$("#otherCityDiv").hide();
|
||||||
@@ -1303,7 +1302,18 @@ function getPosition(){
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/*}
|
||||||
|
city = "嘉兴";
|
||||||
|
province = "浙江";
|
||||||
|
region = "秀洲"
|
||||||
|
lng = 120.6845052002997;//获取到当前位置的经度
|
||||||
|
lat = 30.62661481274257;//获取到当前位置的纬度;
|
||||||
|
oriLng = 120.6845052002997;
|
||||||
|
oriLat = 30.62661481274257;
|
||||||
|
|
||||||
|
oriRegion = "秀洲";
|
||||||
|
oriCity = "嘉兴";
|
||||||
|
initData();*/
|
||||||
}, function(e){
|
}, function(e){
|
||||||
city = "上海";
|
city = "上海";
|
||||||
$("#input_city").text(city);
|
$("#input_city").text(city);
|
||||||
@@ -2365,6 +2375,7 @@ function changeCity(cityStr){
|
|||||||
getDistrictList(cityStr,lat,lng,"",sort,0,0,"");
|
getDistrictList(cityStr,lat,lng,"",sort,0,0,"");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(oriCity== cityStr){
|
if(oriCity== cityStr){
|
||||||
if(oriRegion!=""){
|
if(oriRegion!=""){
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
@@ -2373,7 +2384,7 @@ function changeCity(cityStr){
|
|||||||
//changeRegion();
|
//changeRegion();
|
||||||
},1000)
|
},1000)
|
||||||
}
|
}
|
||||||
initBaseInfo(cityStr,oriRegion,"",0,0);
|
initBaseInfo(cityStr,oriRegion,address,lat,lng);
|
||||||
}else{
|
}else{
|
||||||
initBaseInfo(cityStr,"","",0,0);
|
initBaseInfo(cityStr,"","",0,0);
|
||||||
}
|
}
|
||||||
@@ -2693,6 +2704,7 @@ function getCityPriceLevel(cityParam){
|
|||||||
}
|
}
|
||||||
html += '<li class="item-content"><div class="item-inner"><div class="item-title theme" data-id="8"><i class="icon"></i>自定义:<input type="number" placeholder="最小" id="minPrice"> - <input type="number" placeholder="最大" id="maxPrice"> 万<a class="button button-fill theme" onclick="customPriceQuery()">确定</a></div></div></li></ul>';
|
html += '<li class="item-content"><div class="item-inner"><div class="item-title theme" data-id="8"><i class="icon"></i>自定义:<input type="number" placeholder="最小" id="minPrice"> - <input type="number" placeholder="最大" id="maxPrice"> 万<a class="button button-fill theme" onclick="customPriceQuery()">确定</a></div></div></li></ul>';
|
||||||
$("#select_price").html(html);
|
$("#select_price").html(html);
|
||||||
|
getDistrictList(cityParam,lat,lng,"",6,0,0,"");
|
||||||
|
|
||||||
$("#select_price li").on("click", function () {
|
$("#select_price li").on("click", function () {
|
||||||
$(this).parents("#select_price").find(".item-title").removeClass("active");
|
$(this).parents("#select_price").find(".item-title").removeClass("active");
|
||||||
|
|||||||
Reference in New Issue
Block a user