Merge branch 'YOUFANGAPP1.1.1' of 192.168.0.27:dev0/youfang-app into YOUFANGAPP1.1.1
This commit is contained in:
@@ -39,3 +39,36 @@ function doSavePageLog(data) {
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录用户行为日志
|
||||||
|
*/
|
||||||
|
function saveBehaviorLog(event,dataMap) {
|
||||||
|
var page = document.getElementsByTagName("title")[0].innerHTML;
|
||||||
|
var device = plus.device.uuid;
|
||||||
|
var model = plus.device.model;
|
||||||
|
plus.geolocation.getCurrentPosition(function(p){
|
||||||
|
baidu_city = p.address.city;
|
||||||
|
baidu_lng = p.coords.longitude;
|
||||||
|
baidu_lat = p.coords.latitude;
|
||||||
|
baidu_address = p.address.street;
|
||||||
|
doSaveBehaviorLog({page:page, lng:baidu_lng, lat:baidu_lat, province:baidu_province, city:baidu_city, region:baidu_region, address:baidu_address, device:device, model:model,event:event,businessData:dataMap});
|
||||||
|
}, function(e){
|
||||||
|
doSaveBehaviorLog({page:page, device:device, model:model,event:event,businessData:dataMap});
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provider:'baidu',
|
||||||
|
enableHighAccuracy:true,
|
||||||
|
coordsType:'bd09ll'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function doSaveBehaviorLog(data) {
|
||||||
|
axios.post("/rest/log/saveBehaviorLog", data).then(function (response) {
|
||||||
|
|
||||||
|
}).catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
<div class="content-block-title cardNearbyName" id="nearAddress"><i class="icon icon-address02"></i><span id="nearDistrictSpan"></span><i class="icon arrow-up"></i></div>
|
<div class="content-block-title cardNearbyName" id="nearAddress"><i class="icon icon-address02"></i><span id="nearDistrictSpan"></span><i class="icon arrow-up"></i></div>
|
||||||
<div class="cardNearbyBox" id="nearDistricts">
|
<div class="cardNearbyBox" id="nearDistricts">
|
||||||
</div>
|
</div>
|
||||||
<div class="content-block-title recommend" id="todayNews">今日推荐</div>
|
<div class="content-block-title recommend dn" id="todayNews">今日推荐</div>
|
||||||
<div id="newsList">
|
<div id="newsList">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -1221,6 +1221,7 @@ var lat = 0;
|
|||||||
var lng = 0;
|
var lng = 0;
|
||||||
var address = "";
|
var address = "";
|
||||||
var cat;
|
var cat;
|
||||||
|
var todayDeployFlag = true;
|
||||||
var timestamp1 = new Date().getTime();
|
var timestamp1 = new Date().getTime();
|
||||||
document.addEventListener('plusready', onPlusReady, false);
|
document.addEventListener('plusready', onPlusReady, false);
|
||||||
//扩展API加载完毕,现在可以正常调用扩展API
|
//扩展API加载完毕,现在可以正常调用扩展API
|
||||||
@@ -1228,7 +1229,6 @@ function onPlusReady(){
|
|||||||
getPosition();
|
getPosition();
|
||||||
versionUpdate();
|
versionUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前用户位置
|
// 获取当前用户位置
|
||||||
function getPosition(){
|
function getPosition(){
|
||||||
plus.geolocation.getCurrentPosition(function(p){
|
plus.geolocation.getCurrentPosition(function(p){
|
||||||
@@ -1257,7 +1257,7 @@ function getPosition(){
|
|||||||
$("#input_city").text(city);
|
$("#input_city").text(city);
|
||||||
}
|
}
|
||||||
localStorage.setItem("init_city", city);
|
localStorage.setItem("init_city", city);
|
||||||
addLocation(lat,lng);
|
//addLocation(lat,lng);
|
||||||
$(".nowCity").text(city);
|
$(".nowCity").text(city);
|
||||||
/*city="北京";
|
/*city="北京";
|
||||||
region="";
|
region="";
|
||||||
@@ -1281,7 +1281,7 @@ 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);
|
//addLocation(lat,lng);
|
||||||
initBaseInfo(city,"","",0,0);
|
initBaseInfo(city,"","",0,0);
|
||||||
$("#ShangHaiDiv").show();
|
$("#ShangHaiDiv").show();
|
||||||
$("#otherCityDiv").hide();
|
$("#otherCityDiv").hide();
|
||||||
@@ -1556,12 +1556,18 @@ function initNews(page){
|
|||||||
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
||||||
$.detachInfiniteScroll($('.infinite-scroll'));
|
$.detachInfiniteScroll($('.infinite-scroll'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(page==1 && response.data.data.list.length == 0){
|
if(page==1 && response.data.data.list.length == 0){
|
||||||
$("#todayNews").hide();
|
$("#todayNews").hide();
|
||||||
}else{
|
}else{
|
||||||
$("#todayNews").show();
|
$("#todayNews").show();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var i in response.data.data.list){
|
for(var i in response.data.data.list){
|
||||||
|
if(dataObj[i].todayDeploy && todayDeployFlag){
|
||||||
|
todayDeployFlag = false;
|
||||||
|
$("#todayNews").show();
|
||||||
|
}
|
||||||
dataObj.push(response.data.data.list[i])
|
dataObj.push(response.data.data.list[i])
|
||||||
}
|
}
|
||||||
lastIndex = $('.cardInfo').length;
|
lastIndex = $('.cardInfo').length;
|
||||||
|
|||||||
Reference in New Issue
Block a user