切换导航条
此项目
正在载入...
登录
景龙
/
xingqiu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
景龙
6 years ago
提交
3c6caa198197b449cc11d527636b8073aa326498
1 个父辈
8fdf6d3c
1 个管道 的构建
通过
耗费 1 秒
测试微博
变更
8
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
53 行增加
和
16 行删除
app/portal/controller/LoginController.php
public/themes/simpleboot3/portal/region/get_more_video.html
public/themes/simpleboot3/public/assets/js/public.js
public/themes/simpleboot3/public/slide.html
public/themes/simpleboot3_mobile/portal/region/get_more_video.html
public/themes/simpleboot3_mobile/public/assets/js/public.js
public/themes/simpleboot3_mobile/public/slide.html
simplewind/cmf/controller/HomeBaseController.php
app/portal/controller/LoginController.php
查看文件 @
3c6caa1
...
...
@@ -15,6 +15,7 @@ use cmf\lib\Storage;
use
think\Db
;
use
anerg\OAuth2\OAuth
;
use
think\Config
;
use
app\portal\model\PortalPostModel
;
class
LoginController
extends
HomeBaseController
{
...
...
@@ -450,6 +451,7 @@ class LoginController extends HomeBaseController
$token
=
session
(
'token'
);
$title
=
$this
->
request
->
post
(
'title'
);
//分享标题
$share_url
=
$this
->
request
->
post
(
'share_url'
);
//分享url
$article_id
=
$this
->
request
->
post
(
'article_id'
);
//分享文章id
$url
=
'https://api.weibo.com/2/statuses/share.json'
;
$data
=
[
'access_token'
=>
$token
,
...
...
@@ -460,6 +462,8 @@ class LoginController extends HomeBaseController
if
(
isset
(
$json_arr
[
'error_code'
])
&&!
empty
(
$json_arr
[
'error_code'
])){
$this
->
apiResponse
(
0
,
$json_arr
[
'error'
]);
}
$postModel
=
new
PortalPostModel
();
$postModel
->
where
(
'id'
,
$article_id
)
->
setInc
(
'post_share_wb'
,
1
);
$this
->
apiResponse
(
1
,
'分享成功!'
);
}
...
...
public/themes/simpleboot3/portal/region/get_more_video.html
查看文件 @
3c6caa1
...
...
@@ -113,7 +113,7 @@
<input
type=
"hidden"
class=
"collection"
value=
""
>
<input
type=
"hidden"
class=
"like"
value=
""
>
<img
src=
"__TMPL__/public/assets/starImg/aicon_89.png"
alt=
""
>
<img
src=
"__TMPL__/public/assets/starImg/aicon_90.png"
alt=
""
>
<img
src=
"__TMPL__/public/assets/starImg/aicon_90.png"
alt=
""
class=
"wb_share"
>
<img
id=
"collections"
src=
"__TMPL__/public/assets/starImg/bicon_02.png"
alt=
""
>
<img
id=
"likes"
src=
"__TMPL__/public/assets/starImg/bicon_031.png"
alt=
""
>
</div>
...
...
public/themes/simpleboot3/public/assets/js/public.js
查看文件 @
3c6caa1
...
...
@@ -198,7 +198,7 @@ $(function() {
});
//微博分享
$
(
'
#
wb_share'
).
click
(
function
()
{
$
(
'
.
wb_share'
).
click
(
function
()
{
thirdShare
(
'/portal/login/wb_share'
);
});
...
...
@@ -212,10 +212,12 @@ $(function() {
function
thirdShare
(
url
){
var
title
=
$
(
document
).
attr
(
"title"
);
var
share_url
=
window
.
location
.
href
;
var
article_id
=
getUrlParam
(
'id'
);
$
.
ajax
({
type
:
'POST'
,
url
:
url
,
data
:
{
'id'
:
article_id
,
'title'
:
title
,
'share_url'
:
share_url
},
...
...
public/themes/simpleboot3/public/slide.html
查看文件 @
3c6caa1
...
...
@@ -19,11 +19,11 @@
<!-- wx分享 -->
<div
class=
"wx_go weixin"
>
<img
src=
"__TMPL__/public/assets/starImg/bicon_04.png"
alt=
""
>
<p>
168
</p>
<p>
{$share.post_share_wx}
</p>
</div>
<!-- wb分享 -->
<div
class=
"wb_go w
eibo_share"
id=
"w
b_share"
>
<div
class=
"wb_go wb_share"
>
<img
src=
"__TMPL__/public/assets/starImg/bicon_05.png"
alt=
""
>
<p>
168
</p>
<p>
{$share.post_share_wx}
</p>
</div>
</div>
\ No newline at end of file
...
...
public/themes/simpleboot3_mobile/portal/region/get_more_video.html
查看文件 @
3c6caa1
...
...
@@ -138,7 +138,7 @@
<img
src=
"__TMPL__/public/assets/images/cicon_71@2x.png"
alt=
""
/>
</div>
<div
class=
"index_seventh_bottom_img1"
>
<img
src=
"__TMPL__/public/assets/images/cicon_72@2x.png"
alt=
""
/>
<img
src=
"__TMPL__/public/assets/images/cicon_72@2x.png"
alt=
""
class=
"wb_share"
/>
</div>
<div
class=
"index_seventh_bottom_img2"
style=
"margin-left:0.3rem;"
>
<img
id=
"collections"
src=
"__TMPL__/public/assets/images/bicon_02.png"
alt=
""
>
...
...
public/themes/simpleboot3_mobile/public/assets/js/public.js
查看文件 @
3c6caa1
...
...
@@ -231,19 +231,40 @@ $(function() {
}
window
.
open
(
'http://v.t.sina.com.cn/share/share.php?'
+
temp
.
join
(
'&'
));
});
//微博分享
$
(
'.wb_share'
).
click
(
function
()
{
thirdShare
(
'/portal/login/wb_share'
);
});
//微博登录
$
(
'#wb_login'
).
click
(
function
(){
$
(
'#wb_form'
).
submit
();
});
//分享到微信
// $('.weixin').click(function(){
// var target_url = "http://qr.liantu.com/api.php?text="+share_url;
// window.open(target_url, 'weixin', 'height=320, width=320');
// });
});
//第三方分享
function
thirdShare
(
url
){
var
title
=
$
(
document
).
attr
(
"title"
);
var
share_url
=
window
.
location
.
href
;
var
article_id
=
getUrlParam
(
'id'
);
$
.
ajax
({
type
:
'POST'
,
url
:
url
,
data
:
{
'id'
:
article_id
,
'title'
:
title
,
'share_url'
:
share_url
},
dataType
:
'json'
,
async
:
false
,
success
:
function
(
data
)
{
if
(
data
.
code
==
1
)
{
mask
(
data
.
msg
);
}
else
{
mask
(
data
.
msg
);
}
}
});
}
//弹框
function
mask
(
msg
)
{
$
(
'.mask'
).
text
(
msg
);
...
...
public/themes/simpleboot3_mobile/public/slide.html
查看文件 @
3c6caa1
...
...
@@ -4,13 +4,13 @@
<div
class=
"share1_Img weixin"
>
<img
src=
"__TMPL__/public/assets/images/bicon_04.png"
alt=
""
/>
</div>
<p
class=
"share1_Txt"
>
3.6k
</p>
<p
class=
"share1_Txt"
>
{$share.post_share_wx}
</p>
</li>
<li
class=
"share1"
>
<div
class=
"share1_Img w
eibo
"
>
<div
class=
"share1_Img w
b_share
"
>
<img
src=
"__TMPL__/public/assets/images/bicon_05.png"
alt=
""
/>
</div>
<p
class=
"share1_Txt"
>
168
</p>
<p
class=
"share1_Txt"
>
{$share.post_share_wx}
</p>
</li>
<!--收藏-->
<li
class=
"share2"
>
...
...
simplewind/cmf/controller/HomeBaseController.php
查看文件 @
3c6caa1
...
...
@@ -15,6 +15,7 @@ use app\admin\model\ThemeModel;
use
think\View
;
use
app\portal\model\CollectionModel
;
use
app\portal\model\LikeModel
;
use
app\portal\model\PortalPostModel
;
use
think\Session
;
class
HomeBaseController
extends
BaseController
...
...
@@ -34,6 +35,7 @@ class HomeBaseController extends BaseController
$this
->
getComment
();
$this
->
is_collection
();
$this
->
is_like
();
$this
->
getShareCount
();
$keyword
=
$this
->
request
->
param
(
'keyword'
);
$this
->
assign
(
'keyword'
,
$keyword
);
}
...
...
@@ -385,4 +387,12 @@ hello;
}
}
//获取微信微博分享数量
public
function
getShareCount
(){
$article_id
=
$this
->
request
->
param
(
'id'
);
//文章id
$postModel
=
new
PortalPostModel
();
$share
=
$postModel
->
where
([
'id'
=>
$article_id
])
->
field
(
'id,post_share_wx,post_share_wb'
)
->
find
();
$this
->
assign
(
'share'
,
$share
);
}
}
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论