mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
enhance performance of ajax sign responce
This commit is contained in:
parent
ef227b1045
commit
cda005d5d6
@ -28,9 +28,10 @@ class UserController extends BaseController
|
||||
{
|
||||
if ($aquired_score = $this->user->sign()) {
|
||||
View::json([
|
||||
'errno' => 0,
|
||||
'msg' => '签到成功,获得了 '.$aquired_score.' 积分~',
|
||||
'score' => $this->user->getScore()
|
||||
'errno' => 0,
|
||||
'msg' => '签到成功,获得了 '.$aquired_score.' 积分~',
|
||||
'score' => $this->user->getScore(),
|
||||
'remaining_time' => $this->user->canSign(true)
|
||||
]);
|
||||
} else {
|
||||
View::json($this->user->canSign(true).' 小时后才能再次签到哦~', 1);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: printempw
|
||||
* @Date: 2016-07-16 10:02:24
|
||||
* @Last Modified by: printempw
|
||||
* @Last Modified time: 2016-07-23 15:23:31
|
||||
* @Last Modified time: 2016-07-24 12:28:52
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@ -497,7 +497,8 @@ function sign() {
|
||||
if (json.errno == 0) {
|
||||
toastr.success(json.msg);
|
||||
$('#score').html(json.score);
|
||||
$('#sign-button').attr('disabled', 'disabled').html('<i class="fa fa-calendar-check-o" aria-hidden="true"></i> 24 小时后可签到');
|
||||
var dom = '<i class="fa fa-calendar-check-o"></i> '+json.remaining_time+' 小时后可签到';
|
||||
$('#sign-button').attr('disabled', 'disabled').html(dom);
|
||||
} else {
|
||||
toastr.warning(json.msg);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user