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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 记录用户行为日志
|
||||
*/
|
||||
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="cardNearbyBox" id="nearDistricts">
|
||||
</div>
|
||||
<div class="content-block-title recommend" id="todayNews">今日推荐</div>
|
||||
<div class="content-block-title recommend dn" id="todayNews">今日推荐</div>
|
||||
<div id="newsList">
|
||||
|
||||
</div>
|
||||
@@ -1221,6 +1221,7 @@ var lat = 0;
|
||||
var lng = 0;
|
||||
var address = "";
|
||||
var cat;
|
||||
var todayDeployFlag = true;
|
||||
var timestamp1 = new Date().getTime();
|
||||
document.addEventListener('plusready', onPlusReady, false);
|
||||
//扩展API加载完毕,现在可以正常调用扩展API
|
||||
@@ -1228,7 +1229,6 @@ function onPlusReady(){
|
||||
getPosition();
|
||||
versionUpdate();
|
||||
}
|
||||
|
||||
// 获取当前用户位置
|
||||
function getPosition(){
|
||||
plus.geolocation.getCurrentPosition(function(p){
|
||||
@@ -1257,7 +1257,7 @@ function getPosition(){
|
||||
$("#input_city").text(city);
|
||||
}
|
||||
localStorage.setItem("init_city", city);
|
||||
addLocation(lat,lng);
|
||||
//addLocation(lat,lng);
|
||||
$(".nowCity").text(city);
|
||||
/*city="北京";
|
||||
region="";
|
||||
@@ -1281,7 +1281,7 @@ function getPosition(){
|
||||
$("#input_city").text(city);
|
||||
initRegionSelect(city);
|
||||
localStorage.setItem("init_city", city);
|
||||
addLocation(lat,lng);
|
||||
//addLocation(lat,lng);
|
||||
initBaseInfo(city,"","",0,0);
|
||||
$("#ShangHaiDiv").show();
|
||||
$("#otherCityDiv").hide();
|
||||
@@ -1556,12 +1556,18 @@ function initNews(page){
|
||||
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
||||
$.detachInfiniteScroll($('.infinite-scroll'));
|
||||
}
|
||||
|
||||
if(page==1 && response.data.data.list.length == 0){
|
||||
$("#todayNews").hide();
|
||||
}else{
|
||||
$("#todayNews").show();
|
||||
}
|
||||
|
||||
for(var i in response.data.data.list){
|
||||
if(dataObj[i].todayDeploy && todayDeployFlag){
|
||||
todayDeployFlag = false;
|
||||
$("#todayNews").show();
|
||||
}
|
||||
dataObj.push(response.data.data.list[i])
|
||||
}
|
||||
lastIndex = $('.cardInfo').length;
|
||||
|
||||
Reference in New Issue
Block a user