do dom operations before showing success when checking in

This commit is contained in:
printempw 2017-01-02 11:17:07 +08:00
parent 8a0cd184e3
commit 53d1a6627d

View File

@ -2,7 +2,7 @@
* @Author: printempw * @Author: printempw
* @Date: 2016-07-16 10:02:24 * @Date: 2016-07-16 10:02:24
* @Last Modified by: printempw * @Last Modified by: printempw
* @Last Modified time: 2016-11-13 12:15:16 * @Last Modified time: 2017-01-02 11:15:33
*/ */
'use strict'; 'use strict';
@ -626,13 +626,13 @@ function checkin() {
dataType: "json", dataType: "json",
success: function(json) { success: function(json) {
if (json.errno == 0) { if (json.errno == 0) {
swal({
type: 'success',
html: json.msg
}).then(function() {
$('#score').html(json.score); $('#score').html(json.score);
var dom = '<i class="fa fa-calendar-check-o"></i> &nbsp;' + trans('user.checkinRemainTime', { time: String(json.remaining_time) }); var dom = '<i class="fa fa-calendar-check-o"></i> &nbsp;' + trans('user.checkinRemainTime', { time: String(json.remaining_time) });
$('#checkin-button').attr('disabled', 'disabled').html(dom); $('#checkin-button').attr('disabled', 'disabled').html(dom);
swal({
type: 'success',
html: json.msg
}); });
} else { } else {
toastr.warning(json.msg); toastr.warning(json.msg);