切换导航条
此项目
正在载入...
登录
景龙
/
xingqiu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
jinglong
6 years ago
提交
290052c89fe5fe14e05c94b58fcf3ef3f43f5391
1 个父辈
21377485
1 个管道 的构建
通过
耗费 1 秒
调式分享
变更
6
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
62 行增加
和
49 行删除
app/portal/controller/LoginController.php
public/themes/simpleboot3_mobile/portal/login/wx_share.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/share.html
public/themes/simpleboot3_mobile/public/slide.html
app/portal/controller/LoginController.php
查看文件 @
290052c
...
...
@@ -541,8 +541,7 @@ class LoginController extends HomeBaseController
"signature"
=>
$signature
,
"rawString"
=>
$string
];
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
();
$this
->
apiResponse
(
1
,
'分享成功!'
,
$data
);
}
//获取微信分享签名随机字符串
...
...
public/themes/simpleboot3_mobile/portal/login/wx_share.html
查看文件 @
290052c
...
...
@@ -11,47 +11,4 @@
<h1>
分享主题
</h1>
</body>
</html>
<script
src=
"__TMPL__/public/assets/js/jquery-2.1.0.js"
></script>
<script
src=
"http://res.wx.qq.com/open/js/jweixin-1.4.0.js"
></script>
<script>
$
(
function
()
{
wx
.
config
({
debug
:
true
,
appId
:
'{$data.appId}'
,
timestamp
:
'{$data.timestamp}'
,
nonceStr
:
'{$data.nonceStr}'
,
signature
:
'{$data.signature}'
,
jsApiList
:
[
'updateAppMessageShareData'
,
'updateTimelineShareData'
,
]
});
wx
.
ready
(
function
()
{
//需在用户可能点击分享按钮前就先调用
wx
.
updateAppMessageShareData
({
title
:
'分享标题'
,
// 分享标题
desc
:
'分享描述'
,
// 分享描述
link
:
'http://www.starplanet.cn/portal/enjoy/getEnjoyDetail?id=81'
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl
:
''
,
// 分享图标
success
:
function
(
e
)
{
// 设置成功
alert
(
'分享朋友'
);
}
});
wx
.
updateTimelineShareData
({
title
:
'分享朋友圈'
,
// 分享标题
link
:
'http://www.starplanet.cn/portal/enjoy/getEnjoyDetail?id=81'
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl
:
''
,
// 分享图标
success
:
function
()
{
// 设置成功
alert
(
'分享朋友圈 '
);
}
});
});
wx
.
error
(
function
(
res
)
{
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
alert
(
res
);
});
});
</script>
...
...
public/themes/simpleboot3_mobile/portal/region/get_more_video.html
查看文件 @
290052c
...
...
@@ -135,7 +135,7 @@
<div
class=
"index_seventh_bottom_five"
>
<div
class=
"index_seventh_bottom_title"
>
分享:
</div>
<div
class=
"index_seventh_bottom_img1"
>
<img
src=
"__TMPL__/public/assets/images/cicon_71@2x.png"
alt=
""
/>
<img
src=
"__TMPL__/public/assets/images/cicon_71@2x.png"
alt=
""
id=
"wx_share_video"
/>
</div>
<div
class=
"index_seventh_bottom_img1"
>
<img
src=
"__TMPL__/public/assets/images/cicon_72@2x.png"
alt=
""
class=
"wb_share_video"
/>
...
...
@@ -151,7 +151,8 @@
<input
type=
"hidden"
class=
"like"
value=
""
>
</div>
</div>
<!--微信分享-->
<include
file=
"public@share"
/>
<include
file=
"public@footer"
/>
</body>
<script
src=
"__TMPL__/public/assets/js/base.js"
></script>
...
...
public/themes/simpleboot3_mobile/public/assets/js/public.js
查看文件 @
290052c
...
...
@@ -273,7 +273,9 @@ $(function() {
});
//微信分享
$
(
'#wx_share,#wx_share_video'
).
click
(
function
(){
mask
(
'打开微信,点击右上角即可分享网页'
);
});
});
//第三方分享
function
thirdShare
(
url
){
...
...
@@ -306,7 +308,7 @@ function mask(msg) {
setTimeout
(
function
()
{
$
(
'.mask'
).
hide
();
$
(
'.mask'
).
text
(
''
);
},
4
000
);
},
6
000
);
}
//弹框
...
...
public/themes/simpleboot3_mobile/public/share.html
0 → 100644
查看文件 @
290052c
<script
src=
"__TMPL__/public/assets/js/jquery-2.1.0.js"
></script>
<script
src=
"http://res.wx.qq.com/open/js/jweixin-1.4.0.js"
></script>
<script>
$
(
function
()
{
var
url
=
window
.
location
.
href
;
var
title_title
=
$
(
document
).
attr
(
'title'
);
$
.
ajax
({
type
:
'POST'
,
url
:
"/portal/login/wxShare"
,
data
:
{
},
dataType
:
'json'
,
success
:
function
(
data
)
{
wx
.
config
({
debug
:
true
,
appId
:
data
.
appId
,
timestamp
:
data
.
timestamp
,
nonceStr
:
data
.
nonceStr
,
signature
:
data
.
signature
,
jsApiList
:
[
'updateAppMessageShareData'
,
'updateTimelineShareData'
,
]
});
wx
.
ready
(
function
()
{
//需在用户可能点击分享按钮前就先调用
wx
.
updateAppMessageShareData
({
title
:
title_title
,
// 分享标题
desc
:
''
,
// 分享描述
link
:
url
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl
:
''
,
// 分享图标
success
:
function
(
e
)
{
// 设置成功
}
});
wx
.
updateTimelineShareData
({
title
:
title_title
,
// 分享标题
link
:
url
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl
:
''
,
// 分享图标
success
:
function
()
{
// 设置成功
}
});
});
wx
.
error
(
function
(
res
)
{
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
});
}
});
});
</script>
\ No newline at end of file
...
...
public/themes/simpleboot3_mobile/public/slide.html
查看文件 @
290052c
...
...
@@ -34,3 +34,5 @@
</li>
</ul>
</div>
<!--微信分享-->
<include
file=
"public@share"
/>
...
...
请
注册
或
登录
后发表评论