Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fb322372
authored
Jan 09, 2020
by
梁建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
js
parent
bb123002
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
18 deletions
src/views/common/wxShare.vue
view/13.js
view/14.js
view/15.js
src/views/common/wxShare.vue
View file @
fb322372
...
@@ -5,8 +5,6 @@
...
@@ -5,8 +5,6 @@
import
{
mapState
}
from
'vuex'
import
{
mapState
}
from
'vuex'
import
util
from
"../../util/index"
import
util
from
"../../util/index"
//let wxjs = require('weixin-js-sdk');
export
default
{
export
default
{
name
:
'wxShare'
,
name
:
'wxShare'
,
props
:
{
props
:
{
...
@@ -84,15 +82,12 @@
...
@@ -84,15 +82,12 @@
share
()
{
share
()
{
var
self
=
this
;
var
self
=
this
;
try
{
try
{
setShareInfo
({
setShareInfo
({
title
:
'父爱,在你看不到的地方'
,
// 分享标题
title
:
self
.
shareObj
.
title
,
// 分享标题
summary
:
'父爱如山,感觉不到只因身在此山中'
,
// 分享内容
summary
:
self
.
shareObj
.
title
,
// 分享内容
pic
:
'http://qzonestyle.gtimg.cn/aoi/sola/20150617094556_OvfOpoRKRB.png'
,
// 分享图片
pic
:
self
.
shareObj
.
imgUrl
,
// 分享图片
url
:
'https://szm.ichunt.com/h5/view/#/'
,
// 分享链接
url
:
self
.
shareObj
.
link
,
// 分享链接
// 微信权限验证配置信息,若不在微信传播,可忽略
WXconfig
:
{
WXconfig
:
{
swapTitleInWX
:
true
,
// 是否标题内容互换(仅朋友圈,因朋友圈内只显示标题)
swapTitleInWX
:
true
,
// 是否标题内容互换(仅朋友圈,因朋友圈内只显示标题)
appId
:
self
.
wxShareInfo
.
appId
,
// 公众号的唯一标识
appId
:
self
.
wxShareInfo
.
appId
,
// 公众号的唯一标识
...
@@ -101,24 +96,22 @@
...
@@ -101,24 +96,22 @@
signature
:
self
.
wxShareInfo
.
signature
// 签名
signature
:
self
.
wxShareInfo
.
signature
// 签名
}
}
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
alert
(
e
)
}
}
wx
.
config
({
wx
.
config
({
debug
:
tru
e
,
debug
:
fals
e
,
appId
:
self
.
wxShareInfo
.
appId
,
appId
:
self
.
wxShareInfo
.
appId
,
timestamp
:
self
.
wxShareInfo
.
timestamp
,
timestamp
:
self
.
wxShareInfo
.
timestamp
,
nonceStr
:
self
.
wxShareInfo
.
nonceStr
,
nonceStr
:
self
.
wxShareInfo
.
nonceStr
,
signature
:
self
.
wxShareInfo
.
signature
,
signature
:
self
.
wxShareInfo
.
signature
,
jsApiList
:
[
'onMenuShareTimeline'
,
'onMenuShareAppMessage'
,
'onMenuShareQQ'
,
'onMenuShareWeibo'
,
'onMenuShareQZone'
,
'updateAppMessageShareData'
,
'updateTimelineShareData'
]
jsApiList
:
[
'onMenuShareTimeline'
,
'onMenuShareAppMessage'
,
'onMenuShareQQ'
,
'onMenuShareWeibo'
,
'onMenuShareQZone'
,
'updateAppMessageShareData'
,
'updateTimelineShareData'
]
});
});
wx
.
ready
(
function
()
{
wx
.
ready
(
function
()
{
wx
.
checkJsApi
({
wx
.
checkJsApi
({
jsApiList
:
[
'onMenuShareTimeline'
,
'onMenuShareAppMessage'
,
'onMenuShareQQ'
,
'onMenuShareWeibo'
,
'onMenuShareQZone'
,
'updateAppMessageShareData'
,
'updateTimelineShareData'
],
//需要检测的JS接口列表,所有JS接口列表见附录2,
jsApiList
:
[
'onMenuShareTimeline'
,
'onMenuShareAppMessage'
,
'onMenuShareQQ'
,
'onMenuShareWeibo'
,
'onMenuShareQZone'
,
'updateAppMessageShareData'
,
'updateTimelineShareData'
],
//需要检测的JS接口列表,所有JS接口列表见附录2,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
console
.
log
(
res
);
console
.
log
(
res
);
}
}
...
@@ -139,9 +132,9 @@
...
@@ -139,9 +132,9 @@
//获取“分享到QQ”按钮点击状态及自定义分享内容接口
//获取“分享到QQ”按钮点击状态及自定义分享内容接口
if
(
wx
.
onMenuShareQQ
)
{
if
(
wx
.
onMenuShareQQ
)
{
wx
.
onMenuShareQQ
(
self
.
shareObj
);
wx
.
onMenuShareQQ
(
self
.
shareObj
);
}
else
{
}
else
{
wx
.
updateAppMessageShareData
(
self
.
shareObj
);
wx
.
updateAppMessageShareData
(
self
.
shareObj
);
}
}
...
...
view/13.js
View file @
fb322372
This diff is collapsed.
Click to expand it.
view/14.js
View file @
fb322372
This diff is collapsed.
Click to expand it.
view/15.js
View file @
fb322372
This diff is collapsed.
Click to expand it.
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