Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxh_internal_api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
杨培培
wxh_internal_api
Commits
19e78464
Commit
19e78464
authored
Jul 06, 2019
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提示服务支持异步调用
parent
55ac62b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
ucenter_notice.php
example/ucenter_notice.php
+1
-1
Notice.php
src/ucenter/Notice.php
+42
-0
No files found.
example/ucenter_notice.php
View file @
19e78464
...
...
@@ -11,4 +11,4 @@ use internalApi\ucenter\Notice;
require
__DIR__
.
'/_init.php'
;
Notice
::
setDebug
();
Notice
::
addToast
(
12
,
'test'
);
Notice
::
addToast
Async
(
12
,
'test '
.
date
(
'Y-m-d H:i:s'
)
);
src/ucenter/Notice.php
View file @
19e78464
...
...
@@ -55,4 +55,46 @@ class Notice extends Client
self
::
call
(
'notice.addToast'
,
compact
(
'uid'
,
'text'
,
'timeout'
));
}
/**
* 添加积分提示
*
* @param int $uid
* @param string $action 动作文字,如“发表帖子”
* @param array $credits 变化积分数字,以积分序号对应数字的形式
* @return int|false
*/
public
static
function
addCreditAsync
(
$uid
,
$action
,
$credits
)
{
return
self
::
emit
(
'notice.addCredit'
,
func_get_args
());
}
/**
* 添加勋章提示
*
* @param int $uid
* @param string $icon
* @param string $name
* @param string $description
* @param $url
* @return int|false
*/
public
static
function
addMedalAsync
(
$uid
,
$icon
,
$name
,
$description
,
$url
)
{
return
self
::
emit
(
'notice.addMedal'
,
func_get_args
());
}
/**
* 添加Toast提示
*
* @param int $uid
* @param string $text
* @param null|int $timeout 提示留存时间,毫秒单位,默认为 1500
* @return int|false
*/
public
static
function
addToastAsync
(
$uid
,
$text
,
$timeout
=
null
)
{
return
self
::
emit
(
'notice.addToast'
,
func_get_args
());
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment