Skip to content

Commit

Permalink
历史记录查询页面
Browse files Browse the repository at this point in the history
  • Loading branch information
andyliwr committed Nov 8, 2017
1 parent 65e332a commit 7b8a4a2
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 34 deletions.
1 change: 1 addition & 0 deletions public/scripts/datetimepicker.min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions public/scripts/login.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$(document).ready(function () {
$(document).ready(function() {
// 点击注册
$('#doLogin').bind('click', function () {
$('#doLogin').bind('click', function() {
var nameOrEmail = $('#inputEmail').val()
var password = $('#inputPassword').val()
if (nameOrEmail) {
Expand All @@ -16,19 +16,19 @@ $(document).ready(function () {
},
dataType: 'json',
timeout: 10000,
success: function (res) {
success: function(res) {
$('#doLogin').removeClass('loading').removeAttr('disabled')
if (res.ok) {
showAlert('success', '登陆成功!')
var backUrl = getParam('backUrl')
setTimeout(function () {
setTimeout(function() {
window.location.href = backUrl || '/'
}, 800)
} else {
$('.err-tips').html(res.msg)
}
},
error: function (err) {
error: function(err) {
$('.err-tips').html('登陆失败')
$('#doLogin').removeClass('loading').removeAttr('disabled')
}
Expand All @@ -41,10 +41,10 @@ $(document).ready(function () {
}
})

$(document).keypress(function (e) {
$(document).keypress(function(e) {
// 回车键事件
if (e.which == 13) {
jQuery("#doLogin").click()
}
})
})
})
76 changes: 51 additions & 25 deletions public/scripts/personal.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
$(document).ready(function () {
var $timeline_block = $('.content section')
//hide timeline blocks which are outside the viewport
$timeline_block.each(function () {
if ($(this).offset().top > $(window).scrollTop() + $(window).height() * 0.75) {
$(this).addClass('is-hidden')
}
})
//on scolling, show/animate timeline blocks when enter the viewport
$(window).on('scroll', function () {
$timeline_block.each(function () {
if ($(this).offset().top <= $(window).scrollTop() + $(window).height() * 0.75 && $(this).hasClass('is-hidden')) {
$(this).removeClass('is-hidden').addClass('bounce-in')
}
// 时间选择控件中文化
(function($) {
$.fn.datetimepicker.dates['zh-CN'] = {
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
today: "今天",
suffix: [],
meridiem: ["上午", "下午"]
};
}(jQuery));

$(document).ready(function() {
var $timeline_block = $('.content section')
//hide timeline blocks which are outside the viewport
$timeline_block.each(function() {
if ($(this).offset().top > $(window).scrollTop() + $(window).height() * 0.75) {
$(this).addClass('is-hidden')
}
})
//on scolling, show/animate timeline blocks when enter the viewport
$(window).on('scroll', function() {
$timeline_block.each(function() {
if ($(this).offset().top <= $(window).scrollTop() + $(window).height() * 0.75 && $(this).hasClass('is-hidden')) {
$(this).removeClass('is-hidden').addClass('bounce-in')
}
})
})

$('.content article > h3').on('click', function() {
if ($(this).hasClass('hide-more')) {
$(this).removeClass('hide-more')
$(this).parent().find('section').fadeIn()
} else {
$(this).addClass('hide-more')
$(this).parent().find('section').fadeOut()
}
})
})

$('.content article > h3').on('click', function () {
if ($(this).hasClass('hide-more')) {
$(this).removeClass('hide-more')
$(this).parent().find('section').fadeIn()
} else {
$(this).addClass('hide-more')
$(this).parent().find('section').fadeOut()
}
})
})
// 设置时间选择控件
$('.form_date').datetimepicker({
language: 'zh',
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
minView: 2,
forceParse: 0
});
})
9 changes: 9 additions & 0 deletions public/styles/datetimepicker.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 28 additions & 2 deletions views/personal.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extends layout

block link
link(rel='stylesheet', href='/styles/datetimepicker.min.css')
link(rel='stylesheet', href='/styles/personal.css')

block content
Expand Down Expand Up @@ -42,7 +43,32 @@ block content
a(href=history_arr[itemIndex].link, target="_blank")=history_arr[itemIndex].name
|、
div#history.tab-pane.fade(role='tabpanel', aria-labelledby='history-tab')
p
| Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.
form.form-inline(action='', role='form')
fieldset
.form-group
select#search-type.form-control
option(value="0") 以关键字搜索
option(value="0") 以时间搜索
.form-group.start-date-group
label.col-md-1.control-label(for='dtp_input2') 起始日期
.input-group.date.form_date.col-md-3(data-date='', data-date-format='dd MM yyyy', data-link-field='dtp_input2', data-link-format='yyyy-mm-dd')
input.form-control(size='16', type='text', value='', readonly='')
span.input-group-addon
span.glyphicon.glyphicon-calendar
input#dtp_input2(type='hidden', value='')
.form-group.start-date-group
.input-group.date.form_date.col-md-3(data-date='', data-date-format='dd MM yyyy', data-link-field='dtp_input2', data-link-format='yyyy-mm-dd')
input.form-control(size='16', type='text', value='', readonly='')
span.input-group-addon
span.glyphicon.glyphicon-calendar
input#dtp_input2(type='hidden', value='')
.form-group.start-date-group
label.col-md-1.control-label(for='dtp_input2') 关键字
input.form-control(type="text", placeholder="输入关键字")
.form-group.start-date-group
button.btn.btn-primary


block script
script(type="text/javascript" src="/scripts/datetimepicker.min.js" charset="UTF-8")
script(type="text/javascript" src="/scripts/personal.js")

0 comments on commit 7b8a4a2

Please sign in to comment.