...
|
...
|
@@ -9,8 +9,11 @@ var $allEditForms = $('.userinfo-edit form'); |
|
|
|
|
|
var address = require('../common/common-address');
|
|
|
|
|
|
var $brands = $('#brand-box li'),
|
|
|
$province = $('#province').val();
|
|
|
|
|
|
var date = {
|
|
|
init: function(year, month, day) {
|
|
|
init: function() {
|
|
|
var $year = $('#year'),
|
|
|
$month = $('#month'),
|
|
|
$day = $('#day');
|
...
|
...
|
@@ -32,14 +35,14 @@ var date = { |
|
|
},
|
|
|
createDay: function(year, month, day) {
|
|
|
var html = '<select name="day" id="day">',
|
|
|
monthArray = new Array(4, 6, 9, 11),
|
|
|
monthArray = [4, 6, 9, 11],
|
|
|
dayNum = 31;
|
|
|
|
|
|
var select,
|
|
|
i;
|
|
|
|
|
|
year = parseInt(year);
|
|
|
month = parseInt(month);
|
|
|
year = parseInt(year, 10);
|
|
|
month = parseInt(month, 10);
|
|
|
|
|
|
if (year === 0) {
|
|
|
year = 0;
|
...
|
...
|
@@ -59,7 +62,7 @@ var date = { |
|
|
dayNum = 30;
|
|
|
} else if (month === 2) {
|
|
|
dayNum = 28;
|
|
|
if (0 === year % 4 && (year % 100 !== 0 || year % 400 === 0)) {
|
|
|
if (0 === (year % 4) && (year % 100 !== 0 || year % 400 === 0)) {
|
|
|
dayNum = 29;
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -67,7 +70,7 @@ var date = { |
|
|
for (i = 1; i <= dayNum; i++) {
|
|
|
select = '';
|
|
|
|
|
|
if (parseInt(day) === i) {
|
|
|
if (parseInt(day, 10) === i) {
|
|
|
select = 'selected';
|
|
|
}
|
|
|
html += '<option value="' + i + '" ' + select + '>' + i + '</option>';
|
...
|
...
|
@@ -176,7 +179,7 @@ function checkFavoriteForm() { |
|
|
function delBrand(brandId) {
|
|
|
var brand = $('#likebrand').val();
|
|
|
|
|
|
if (parseInt(brandId) === 0) {
|
|
|
if (parseInt(brandId, 10) === 0) {
|
|
|
return false;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -196,7 +199,7 @@ function addBrand(domObj, brandId, brandName) { |
|
|
|
|
|
var $brandBox = $('#brand-box');
|
|
|
|
|
|
if (parseInt(brandId) === 0) {
|
|
|
if (parseInt(brandId, 10) === 0) {
|
|
|
return false;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -220,8 +223,8 @@ function addBrand(domObj, brandId, brandName) { |
|
|
|
|
|
function checkBrand() {
|
|
|
var postData = {
|
|
|
brandName: $('#keywords').val()
|
|
|
};
|
|
|
brandName: $('#keywords').val()
|
|
|
};
|
|
|
|
|
|
$.post('/home/user/isbrandname', postData, function(data) {
|
|
|
if (data.code === 200) {
|
...
|
...
|
@@ -291,7 +294,7 @@ $('#favorite-brand').on('click', function() { |
|
|
alert(data.message);
|
|
|
return false;
|
|
|
},
|
|
|
error: function(err) {
|
|
|
error: function() {
|
|
|
alert('网络异常');
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -309,19 +312,13 @@ $('.user-favorite-info input[type="checkbox"]').on('click', function() { |
|
|
});
|
|
|
|
|
|
(function() {
|
|
|
var $brands = $('#brand-box li');
|
|
|
|
|
|
if ($brands.length > 0) {
|
|
|
$brands.find('a').on('click', function() {
|
|
|
delBrand($(this).closest('li').attr('id').substr(6));
|
|
|
});
|
|
|
}
|
|
|
})();
|
|
|
|
|
|
date.init();
|
|
|
|
|
|
(function() {
|
|
|
if (!$('#province').val()) {
|
|
|
if (!$province) {
|
|
|
address.loadAllData(0, {
|
|
|
provinceDomId: 'province',
|
|
|
cityDomId: 'city',
|
...
|
...
|
@@ -334,4 +331,7 @@ date.init(); |
|
|
areaDomId: 'areaCode'
|
|
|
});
|
|
|
}
|
|
|
})(); |
|
|
}());
|
|
|
|
|
|
date.init();
|
|
|
|
...
|
...
|
|