Merge branch 'YOUFANGAPP1.1' of 192.168.0.27:dev0/youfang-app into xh-youfangApp1.1
# Conflicts: # fangija-zsyf/yfindex.html
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**服务端地址**/
|
||||
var BASE_PATH = "http://192.168.10.128:8084";
|
||||
//var BASE_PATH = "http://192.168.10.53:8084";
|
||||
//var BASE_PATH = "http://192.168.10.128:8084";
|
||||
var BASE_PATH = "http://192.168.10.53:8084";
|
||||
//var BASE_PATH = "http://192.168.10.170:8084";
|
||||
/**是否显示过启动页面**/
|
||||
var lauchFlag = false;
|
||||
@@ -92,7 +92,7 @@ $("body").delegate(".open-about02", "click", function () {
|
||||
$("#notFound").hide();
|
||||
$('.hotList').show();
|
||||
$('.searchList').hide();
|
||||
addHotDistricts($("#input_city").val());
|
||||
addHotDistricts($("#input_city").text());
|
||||
addHistory();
|
||||
$.popup(".popup-about02")
|
||||
$("input").blur()
|
||||
@@ -106,7 +106,6 @@ function addHotDistricts(cityParam){
|
||||
top:6
|
||||
}
|
||||
}).then(function (response) {
|
||||
|
||||
var datas = response.data.data
|
||||
if(datas.length>0){
|
||||
var dists = [];
|
||||
|
||||
@@ -0,0 +1,341 @@
|
||||
/*!
|
||||
* =====================================================
|
||||
* SUI Mobile - http://m.sui.taobao.org/
|
||||
*
|
||||
* =====================================================
|
||||
*/
|
||||
;$.smVersion = "0.6.2";+function ($) {
|
||||
"use strict";
|
||||
|
||||
//全局配置
|
||||
var defaults = {
|
||||
autoInit: false, //自动初始化页面
|
||||
showPageLoadingIndicator: true, //push.js加载页面的时候显示一个加载提示
|
||||
router: true, //默认使用router
|
||||
swipePanel: "left", //滑动打开侧栏
|
||||
swipePanelOnlyClose: true //只允许滑动关闭,不允许滑动打开侧栏
|
||||
};
|
||||
|
||||
$.smConfig = $.extend(defaults, $.config);
|
||||
|
||||
}(Zepto);
|
||||
|
||||
|
||||
|
||||
/*======================================================
|
||||
************ Modals ************
|
||||
======================================================*/
|
||||
/*jshint unused: false*/
|
||||
+function ($) {
|
||||
"use strict";
|
||||
var _modalTemplateTempDiv = document.createElement('div');
|
||||
|
||||
$.modalStack = [];
|
||||
|
||||
$.modalStackClearQueue = function () {
|
||||
if ($.modalStack.length) {
|
||||
($.modalStack.shift())();
|
||||
}
|
||||
};
|
||||
$.modal = function (params) {
|
||||
params = params || {};
|
||||
var modalHTML = '';
|
||||
var buttonsHTML = '';
|
||||
if (params.buttons && params.buttons.length > 0) {
|
||||
for (var i = 0; i < params.buttons.length; i++) {
|
||||
buttonsHTML += '<span class="modal-button' + (params.buttons[i].bold ? ' modal-button-bold' : '') + '">' + params.buttons[i].text + '</span>';
|
||||
}
|
||||
}
|
||||
var extraClass = params.extraClass || '';
|
||||
var titleHTML = params.title ? '<div class="modal-title">' + params.title + '</div>' : '';
|
||||
var textHTML = params.text ? '<div class="modal-text">' + params.text + '</div>' : '';
|
||||
var afterTextHTML = params.afterText ? params.afterText : '';
|
||||
var noButtons = !params.buttons || params.buttons.length === 0 ? 'modal-no-buttons' : '';
|
||||
var verticalButtons = params.verticalButtons ? 'modal-buttons-vertical' : '';
|
||||
modalHTML = '<div class="modal ' + extraClass + ' ' + noButtons + '"><div class="modal-inner">' + (titleHTML + textHTML + afterTextHTML) + '</div><div class="modal-buttons ' + verticalButtons + '">' + buttonsHTML + '</div></div>';
|
||||
|
||||
_modalTemplateTempDiv.innerHTML = modalHTML;
|
||||
|
||||
var modal = $(_modalTemplateTempDiv).children();
|
||||
|
||||
$(defaults.modalContainer).append(modal[0]);
|
||||
|
||||
// Add events on buttons
|
||||
modal.find('.modal-button').each(function (index, el) {
|
||||
$(el).on('click', function (e) {
|
||||
if (params.buttons[index].close !== false) $.closeModal(modal);
|
||||
if (params.buttons[index].onClick) params.buttons[index].onClick(modal, e);
|
||||
if (params.onClick) params.onClick(modal, index);
|
||||
});
|
||||
});
|
||||
$.openModal(modal);
|
||||
return modal[0];
|
||||
};
|
||||
$.openModal = function (modal, cb) {
|
||||
modal = $(modal);
|
||||
var isModal = modal.hasClass('modal'),
|
||||
isNotToast = !modal.hasClass('toast');
|
||||
if ($('.modal.modal-in:not(.modal-out)').length && defaults.modalStack && isModal && isNotToast) {
|
||||
$.modalStack.push(function () {
|
||||
$.openModal(modal, cb);
|
||||
});
|
||||
return;
|
||||
}
|
||||
var isPopup = modal.hasClass('popup');
|
||||
var isLoginScreen = modal.hasClass('login-screen');
|
||||
var isPickerModal = modal.hasClass('picker-modal');
|
||||
var isToast = modal.hasClass('toast');
|
||||
if (isModal) {
|
||||
modal.show();
|
||||
modal.css({
|
||||
marginTop: - Math.round(modal.outerHeight() / 2) + 'px'
|
||||
});
|
||||
}
|
||||
if (isToast) {
|
||||
modal.css({
|
||||
marginLeft: - Math.round(modal.outerWidth() / 2 / 1.185) + 'px' //1.185 是初始化时候的放大效果
|
||||
});
|
||||
}
|
||||
|
||||
var overlay;
|
||||
if (!isLoginScreen && !isPickerModal && !isToast) {
|
||||
if ($('.modal-overlay').length === 0 && !isPopup) {
|
||||
$(defaults.modalContainer).append('<div class="modal-overlay"></div>');
|
||||
}
|
||||
if ($('.popup-overlay').length === 0 && isPopup) {
|
||||
$(defaults.modalContainer).append('<div class="popup-overlay"></div>');
|
||||
}
|
||||
overlay = isPopup ? $('.popup-overlay') : $('.modal-overlay');
|
||||
}
|
||||
|
||||
//Make sure that styles are applied, trigger relayout;
|
||||
var clientLeft = modal[0].clientLeft;
|
||||
|
||||
// Trugger open event
|
||||
modal.trigger('open');
|
||||
|
||||
// Picker modal body class
|
||||
if (isPickerModal) {
|
||||
$(defaults.modalContainer).addClass('with-picker-modal');
|
||||
}
|
||||
|
||||
// Classes for transition in
|
||||
if (!isLoginScreen && !isPickerModal && !isToast) overlay.addClass('modal-overlay-visible');
|
||||
modal.removeClass('modal-out').addClass('modal-in').transitionEnd(function (e) {
|
||||
if (modal.hasClass('modal-out')) modal.trigger('closed');
|
||||
else modal.trigger('opened');
|
||||
});
|
||||
// excute callback
|
||||
if (typeof cb === 'function') {
|
||||
cb.call(this);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
$.closeModal = function (modal) {
|
||||
modal = $(modal || '.modal-in');
|
||||
if (typeof modal !== 'undefined' && modal.length === 0) {
|
||||
return;
|
||||
}
|
||||
var isModal = modal.hasClass('modal'),
|
||||
isPopover = modal.hasClass('popover'),
|
||||
isPopup = modal.hasClass('popup'),
|
||||
isToast = modal.hasClass('toast'),
|
||||
isLoginScreen = modal.hasClass('login-screen'),
|
||||
isPickerModal = modal.hasClass('picker-modal'),
|
||||
removeOnClose = modal.hasClass('remove-on-close'),
|
||||
overlay = isPopup ? $('.popup-overlay') : $('.modal-overlay');
|
||||
if (isPopup){
|
||||
if (modal.length === $('.popup.modal-in').length) {
|
||||
overlay.removeClass('modal-overlay-visible');
|
||||
}
|
||||
}
|
||||
else if (!(isPickerModal || isToast)) {
|
||||
overlay.removeClass('modal-overlay-visible');
|
||||
}
|
||||
|
||||
modal.trigger('close');
|
||||
|
||||
// Picker modal body class
|
||||
if (isPickerModal) {
|
||||
$(defaults.modalContainer).removeClass('with-picker-modal');
|
||||
$(defaults.modalContainer).addClass('picker-modal-closing');
|
||||
}
|
||||
if (!isPopover) {
|
||||
modal.removeClass('modal-in').addClass('modal-out').transitionEnd(function (e) {
|
||||
if (modal.hasClass('modal-out')) modal.trigger('closed');
|
||||
else modal.trigger('opened');
|
||||
|
||||
if (isPickerModal) {
|
||||
$(defaults.modalContainer).removeClass('picker-modal-closing');
|
||||
}
|
||||
if (isPopup || isLoginScreen || isPickerModal) {
|
||||
modal.removeClass('modal-out').hide();
|
||||
if (removeOnClose && modal.length > 0) {
|
||||
modal.remove();
|
||||
}
|
||||
}
|
||||
else {
|
||||
modal.remove();
|
||||
}
|
||||
});
|
||||
if (isModal && defaults.modalStack ) {
|
||||
$.modalStackClearQueue();
|
||||
}
|
||||
}
|
||||
else {
|
||||
modal.removeClass('modal-in modal-out').trigger('closed').hide();
|
||||
if (removeOnClose) {
|
||||
modal.remove();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
};
|
||||
function handleClicks(e) {
|
||||
/*jshint validthis:true */
|
||||
var clicked = $(this);
|
||||
var url = clicked.attr('href');
|
||||
|
||||
|
||||
//Collect Clicked data- attributes
|
||||
var clickedData = clicked.dataset();
|
||||
|
||||
// Popover
|
||||
if (clicked.hasClass('open-popover')) {
|
||||
var popover;
|
||||
if (clickedData.popover) {
|
||||
popover = clickedData.popover;
|
||||
}
|
||||
else popover = '.popover';
|
||||
$.popover(popover, clicked);
|
||||
}
|
||||
if (clicked.hasClass('close-popover')) {
|
||||
$.closeModal('.popover.modal-in');
|
||||
}
|
||||
|
||||
// Popup
|
||||
var popup;
|
||||
if (clicked.hasClass('open-popup')) {
|
||||
if (clickedData.popup) {
|
||||
popup = clickedData.popup;
|
||||
}
|
||||
else popup = '.popup';
|
||||
$.popup(popup);
|
||||
}
|
||||
if (clicked.hasClass('close-popup')) {
|
||||
if (clickedData.popup) {
|
||||
popup = clickedData.popup;
|
||||
}
|
||||
else popup = '.popup.modal-in';
|
||||
$.closeModal(popup);
|
||||
}
|
||||
|
||||
// Close Modal
|
||||
if (clicked.hasClass('modal-overlay')) {
|
||||
if ($('.modal.modal-in').length > 0 && defaults.modalCloseByOutside)
|
||||
$.closeModal('.modal.modal-in');
|
||||
if ($('.actions-modal.modal-in').length > 0 && defaults.actionsCloseByOutside)
|
||||
$.closeModal('.actions-modal.modal-in');
|
||||
|
||||
if ($('.popover.modal-in').length > 0) $.closeModal('.popover.modal-in');
|
||||
}
|
||||
if (clicked.hasClass('popup-overlay')) {
|
||||
if ($('.popup.modal-in').length > 0 && defaults.popupCloseByOutside)
|
||||
$.closeModal('.popup.modal-in');
|
||||
}
|
||||
|
||||
}
|
||||
$(document).on('click', ' .modal-overlay, .popup-overlay, .close-popup, .open-popup, .close-picker', handleClicks);
|
||||
var defaults = $.modal.prototype.defaults = {
|
||||
modalStack: true,
|
||||
modalButtonOk: '确定',
|
||||
modalButtonCancel: '取消',
|
||||
modalPreloaderTitle: '加载中',
|
||||
modalContainer : document.body
|
||||
};
|
||||
}(Zepto);
|
||||
|
||||
|
||||
|
||||
+ function($) {
|
||||
"use strict";
|
||||
|
||||
var today = new Date();
|
||||
var getDays = function(max) {
|
||||
var days = [];
|
||||
for(var i=1; i<= (max||31);i++) {
|
||||
days.push(i < 10 ? "0"+i : i);
|
||||
}
|
||||
return days;
|
||||
};
|
||||
|
||||
var getDaysByMonthAndYear = function(month, year) {
|
||||
var int_d = new Date(year, parseInt(month)+1-1, 1);
|
||||
var d = new Date(int_d - 1);
|
||||
return getDays(d.getDate());
|
||||
};
|
||||
|
||||
var formatNumber = function (n) {
|
||||
return n < 10 ? "0" + n : n;
|
||||
};
|
||||
|
||||
var initMonthes = ('01 02 03 04 05 06 07 08 09 10 11 12').split(' ');
|
||||
|
||||
var initYears = (function () {
|
||||
var arr = [];
|
||||
for (var i = 1950; i <= 2050; i++) { arr.push(i); }
|
||||
return arr;
|
||||
})();
|
||||
|
||||
|
||||
var defaults = {
|
||||
|
||||
rotateEffect: false, //为了性能
|
||||
|
||||
value: [today.getFullYear(), formatNumber(today.getMonth()+1), formatNumber(today.getDate())],
|
||||
|
||||
onChange: function (picker, values, displayValues) {
|
||||
var inputId = picker.params.input.id;
|
||||
var deftime = $("#"+inputId).val();
|
||||
if(deftime == ""){
|
||||
picker.cols[0].setValue(today.getFullYear())
|
||||
}
|
||||
var days = getDaysByMonthAndYear(picker.cols[1].value, picker.cols[0].value);
|
||||
var currentValue = picker.cols[2].value;
|
||||
if(currentValue > days.length) currentValue = days.length;
|
||||
picker.cols[2].setValue(currentValue);
|
||||
},
|
||||
|
||||
formatValue: function (p, values, displayValues) {
|
||||
return displayValues[0] + '-' + values[1] + '-' + values[2];
|
||||
},
|
||||
|
||||
cols: [
|
||||
// Years
|
||||
{
|
||||
values: initYears
|
||||
},
|
||||
// Months
|
||||
{
|
||||
values: initMonthes
|
||||
},
|
||||
// Days
|
||||
{
|
||||
values: getDays()
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
$.fn.datetimePicker = function(params) {
|
||||
return this.each(function() {
|
||||
if(!this) return;
|
||||
var p = $.extend(defaults, params);
|
||||
$(this).picker(p);
|
||||
if (params.value) $(this).val(p.formatValue(p, p.value, p.value));
|
||||
});
|
||||
};
|
||||
|
||||
}(Zepto);
|
||||
|
||||
|
||||
|
||||
@@ -1490,6 +1490,14 @@
|
||||
],
|
||||
"refer": [],
|
||||
"priority": 0
|
||||
},
|
||||
"yfindex.html": {
|
||||
"resources": [
|
||||
"fonts/mui.ttf",
|
||||
"images/icon-clear.png"
|
||||
],
|
||||
"refer": [],
|
||||
"priority": 0
|
||||
}
|
||||
},
|
||||
"idle": {
|
||||
|
||||
@@ -68,7 +68,7 @@ function onPlusReady() {
|
||||
$("#title2").text(data.title)
|
||||
$("#source").text(data.source==null?"":"来源:"+data.source)
|
||||
$("#visit_count").append(data.visitCount)
|
||||
var date = new Date(data.createTime)
|
||||
var date = new Date(data.deployTime)
|
||||
var dateStr = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
|
||||
$("#create_time").text(dateStr)
|
||||
$("#content").html(data.content)
|
||||
|
||||
@@ -1244,8 +1244,7 @@ function getPosition(){
|
||||
}
|
||||
localStorage.setItem("init_city", city);
|
||||
addLocation(lat,lng);
|
||||
/* city="北京"
|
||||
$("#input_city").text(city);*/
|
||||
|
||||
|
||||
initBaseInfo(city,region,address,lat,lng);
|
||||
if(city!="上海"){
|
||||
@@ -1273,18 +1272,7 @@ function getPosition(){
|
||||
}
|
||||
|
||||
/* 获取#region字数,截取#region前4字,并添加... */
|
||||
/*city="北京"
|
||||
$("#input_city").text(city);
|
||||
initBaseInfo(city,"","",0,0);
|
||||
initRegionSelect(city);
|
||||
if(city!="上海"){
|
||||
initRegionSelect(city);
|
||||
$("#ShangHaiDiv").hide();
|
||||
$("#otherCityDiv").show();
|
||||
}else{
|
||||
$("#ShangHaiDiv").show();
|
||||
$("#otherCityDiv").hide();
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1384,9 +1372,11 @@ function initNearDistricts(cityParam,latParam,lngParam,regionParam,order,minPric
|
||||
|
||||
if(cityParam=="上海"){
|
||||
if(response.data.data.dtos.length==0){
|
||||
|
||||
$("#nearAddress").hide();
|
||||
$("#nearDistricts").hide();
|
||||
}else{
|
||||
|
||||
$("#nearAddress").show();
|
||||
$("#nearDistricts").show();
|
||||
}
|
||||
@@ -1526,6 +1516,7 @@ function addItems(number, lastIndex) {
|
||||
if(i>=lastIndex){
|
||||
if((dataObj.length<lastIndex + number) || (i < lastIndex + number)){
|
||||
if(dataObj[i].type=="专题"){
|
||||
|
||||
html += '<div class="card cardInfo cardInfo01" onclick="openNewsView(\''+dataObj[i].id+'\')">'+
|
||||
'<img src='+dataObj[i].coverImg+'>'+
|
||||
'<div class="cardInfoMask"></div>'+
|
||||
@@ -1630,6 +1621,7 @@ function addItems(number, lastIndex) {
|
||||
}
|
||||
//district/details?city=上海®ion=长宁&name=新泾三村
|
||||
html += '<li>'+
|
||||
|
||||
'<a onclick="openUrl(\''+BASE_PATH+'/district/details?city='+dataObj2[i].city+'®ion='+dataObj2[i].region+'&name='+dataObj2[i].districtName+'\')" class="item-link external item-content">'+
|
||||
'<div class="item-inner"><div class="item-title-row"><div class="item-title">'+
|
||||
dataObj2[i].districtName+'</div><div class="item-after">¥'+dataObj2[i].avgPrice+'元/㎡</div></div><div class="item-title-row"><div class="item-title"><small>'+
|
||||
|
||||
Reference in New Issue
Block a user