Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
s_ibanshou
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
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋林
s_ibanshou
Commits
c2deff2a
Commit
c2deff2a
authored
Apr 09, 2018
by
wangjj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
未登录显示
parent
ade3a167
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
0 deletions
+105
-0
credit.php
e/action/credit.php
+40
-0
Credit.php
e/extend/internalApi/ucenter/Credit.php
+23
-0
news.js
skin/default/js/news.js
+42
-0
No files found.
e/action/credit.php
0 → 100644
View file @
c2deff2a
<?php
use
internalApi\ucenter\Credit
;
require
(
__DIR__
.
'/../extend/internalApi/autoload.php'
);
require
(
__DIR__
.
"/../class/connect.php"
);
require
(
__DIR__
.
"/../class/db_sql.php"
);
require
(
__DIR__
.
"/../member/class/user.php"
);
require
(
__DIR__
.
"/../class/q_functions.php"
);
require
__DIR__
.
'/../config/config_ibanshou.php'
;
\internalApi\base\Client
::
config
(
$config
[
'wxh.internal'
][
'client'
]);
$link
=
db_connect
();
$empire
=
new
mysqlquery
();
$mod
=
isset
(
$_GET
[
'mod'
])
?
$_GET
[
'mod'
]
:
''
;
$type
=
isset
(
$_GET
[
'type'
])
?
$_GET
[
'type'
]
:
''
;
$user
=
islogin
();
$typeMap
=
[
'share'
=>
1
,
];
if
(
$mod
==
'credit'
){
$userId
=
$user
[
'ucid'
];
if
(
isset
(
$typeMap
[
$type
]))
{
$creditRuleId
=
$typeMap
[
$type
];
}
else
{
echo
json_encode
([
'status'
=>
false
,
'message'
=>
'type 字段错误'
]);
}
$creditRule
=
Credit
::
addCreditLog
(
$userId
,
$creditRuleId
);
if
(
$creditRule
)
{
$creditInfo
=
array
(
'title'
=>
$creditRule
[
'operation_name'
],
'desc'
=>
$creditRule
[
'operation_details'
],
'number'
=>
$creditRule
[
'number'
]);
esetcookie
(
'creditNotice'
,
json_encode
(
$creditInfo
));
echo
json_encode
([
'status'
=>
true
,
'message'
=>
'ok'
,
'creditRule'
=>
$creditRule
]);
}
else
{
echo
json_encode
([
'status'
=>
false
]);
}
}
\ No newline at end of file
e/extend/internalApi/ucenter/Credit.php
0 → 100644
View file @
c2deff2a
<?php
/**
* Created by PhpStorm.
* User: QQ
* Date: 2018/4/8
* Time: 9:56
*/
namespace
internalApi\ucenter
;
use
internalApi\base\Client
;
class
Credit
extends
Client
{
/**
* 添加积分
* @param $userId
* @param $creditRuleId
* @return mixed
*/
public
static
function
addCreditLog
(
$userId
,
$creditRuleId
)
{
return
self
::
call
(
'credit.addCreditLog'
,
compact
(
'userId'
,
'creditRuleId'
));
}
}
\ No newline at end of file
skin/default/js/news.js
View file @
c2deff2a
...
@@ -154,6 +154,48 @@ function likeComment(plid, islike) {
...
@@ -154,6 +154,48 @@ function likeComment(plid, islike) {
},
'json'
);
},
'json'
);
}
}
function
shareSuccessCallback
(
type
)
{
$
.
ajax
({
type
:
"GET"
,
url
:
"/e/action/credit.php?mod=credit&type="
+
type
,
data
:
''
,
dataType
:
"json"
,
success
:
function
(
response
){
if
(
response
.
status
){
cookieTips
();
}
}
});
}
function
getCookie
(
sName
)
{
var
aCookie
=
document
.
cookie
.
split
(
";"
);
for
(
var
i
=
0
;
i
<
aCookie
.
length
;
i
++
)
{
var
aCrumb
=
aCookie
[
i
].
split
(
"="
);
if
(
sName
==
aCrumb
[
0
])
return
unescape
(
aCrumb
[
1
]);
}
return
null
;
}
function
setCookie
(
cname
,
cvalue
)
{
document
.
cookie
=
cname
+
"="
+
cvalue
+
"; "
;
}
function
cookieTips
()
{
var
obj
=
getCookie
(
'udvqbcreditNotice'
);
if
(
obj
){
obj
=
JSON
.
parse
(
obj
);
var
desc
=
'分享成功金币 +'
+
obj
.
number
;
Banshou
.
creditTip
(
obj
.
title
,
desc
,
2000
);
setCookie
(
'udvqbcreditNotice'
,
''
);
}
}
function
pop
(
msg
,
islogin
)
{
function
pop
(
msg
,
islogin
)
{
if
(
islogin
===
'nologin'
)
{
if
(
islogin
===
'nologin'
)
{
location
.
href
=
"/e/member/login"
;
location
.
href
=
"/e/member/login"
;
...
...
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