Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
ybf
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xulili
ybf
Commits
433e696a
Commit
433e696a
authored
Apr 20, 2020
by
leiqingsong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加微信分享
parent
53cd2d41
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
17 deletions
+34
-17
activeDetail.vue
wx_application/src/views/active/activeDetail.vue
+33
-16
index.vue
wx_application/src/views/mainSale/active/main/index.vue
+1
-1
No files found.
wx_application/src/views/active/activeDetail.vue
View file @
433e696a
...
...
@@ -357,30 +357,47 @@ export default {
// 分享
handleShare
()
{
let
url
=
`http://oysales.oywanhao.com:8087/activeDetail?id=
${
this
.
active_id
}
&active_type=
${
this
.
active_type
}
`
;
wx
.
invoke
(
"shareToExternalContact"
,
{
title
:
`
${
this
.
activityName
}
`
,
// 分享标题
desc
:
`
${
this
.
des
}
`
,
// 分享描述
link
:
url
,
// 分享链接
imgUrl
:
""
// 分享封面
},
function
(
res
)
{
if
(
res
.
err_msg
==
"shareToExternalContact:ok"
)
{
console
.
log
(
"分享成功"
);
}
else
{
console
.
log
(
res
.
err_msg
,
"错误信息"
);
}
}
);
let
env
=
window
.
navigator
.
userAgent
.
toLowerCase
();
if
(
env
.
match
(
/MicroMessenger/i
)
==
"micromessenger"
&&
env
.
match
(
/wxwork/i
)
==
"wxwork"
)
{
console
.
log
(
"企业微信客户端"
);
wx
.
invoke
(
"shareToExternalContact"
,
{
title
:
`
${
this
.
activityName
}
`
,
// 分享标题
desc
:
`
${
this
.
des
}
`
,
// 分享描述
link
:
url
,
// 分享链接
imgUrl
:
""
// 分享封面
},
function
(
res
)
{
if
(
res
.
err_msg
==
"shareToExternalContact:ok"
)
{
console
.
log
(
"分享成功"
);
}
else
{
console
.
log
(
res
.
err_msg
,
"错误信息"
);
}
}
);
}
else
if
(
env
.
match
(
/micromessenger/i
)
==
"micromessenger"
)
{
console
.
log
(
"微信客户端"
);
wx
.
ready
(
function
()
{
wx
.
onMenuShareTimeline
({
title
:
`
${
this
.
activityName
}
`
,
// 分享标题
link
:
url
,
// 分享链接,将当前登录用户转为puid,以便于发展下线
imgUrl
:
""
,
// 分享图标
success
:
function
()
{
// 用户确认分享后执行的回调函数
},
cancel
:
function
()
{
// 用户取消分享后执行的回调函数
}
});
wx
.
error
(
function
(
res
)
{
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
alert
(
"errorMSG:"
+
res
);
});
});
}
}
},
...
...
wx_application/src/views/mainSale/active/main/index.vue
View file @
433e696a
...
...
@@ -238,7 +238,7 @@ export default {
this
.
flag
=
sessionStorage
.
getItem
(
"role"
);
}
}
else
{
//
this.zReadyUserId()
this
.
zReadyUserId
()
this
.
zTestGetNowUrlInfo
()
}
this
.
GET_CurrentActive
()
...
...
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