Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
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
front-end-dev
techbook
Commits
70bf9557
Commit
70bf9557
authored
Mar 05, 2020
by
zhangyanni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceshi
parent
301e26e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
44 deletions
+108
-44
phone.scss
public/css/phone.scss
+22
-0
shareCmpt.vue
src/components/shareCmpt.vue
+7
-1
detail.vue
src/views/mobile/activityApply/detail.vue
+79
-43
No files found.
public/css/phone.scss
View file @
70bf9557
...
...
@@ -1505,4 +1505,25 @@ i, em {
.noticeError
{
z-index
:
5000
!
important
;
}
.dialogTips
{
position
:
fixed
;
left
:
0
;
top
:
0
;
width
:
100%
;
height
:
100vh
;
background
:
rgba
(
0
,
0
,
0
,
0
.7
);
z-index
:
100
;
img
{
position
:
absolute
;
right
:
.8rem
;
top
:
0
;
width
:
2rem
;
}
p
{
text-align
:
right
;
margin-top
:
2
.5rem
;
padding-right
:
1
.5rem
;
color
:
#fff
;
}
}
}
\ No newline at end of file
src/components/shareCmpt.vue
View file @
70bf9557
...
...
@@ -180,14 +180,20 @@
<
style
scoped
>
#nativeShare
{
font-size
:
13px
;
position
:
absolute
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
background
:
#fff
;
}
.label
{
font-size
:
18px
;
text-align
:
center
;
}
.list-item
{
width
:
3
0
%
;
width
:
3
3.3
%
;
display
:
inline-block
;
text-align
:
center
;
margin
:
10px
0
;
...
...
src/views/mobile/activityApply/detail.vue
View file @
70bf9557
...
...
@@ -52,9 +52,13 @@
<div
v-if=
"vueQrVisible"
>
<qrCmpt
:url=
"url"
@
sendVisible=
"isVueQrVisible"
></qrCmpt>
</div>
<div
class=
"wechatShare"
v-if=
"popupVisible"
>
<div
class=
"wechatShare"
v-if=
"popupVisible"
@
click=
"popupVisible = false"
>
<shareCmpt
:detailInfo=
"detailInfo"
></shareCmpt>
</div>
<div
class=
"dialogTips"
v-if=
"dialogVisible"
@
click=
"dialogVisible = false"
>
<img
src=
"../../../assets/jiantou.gif"
alt=
""
>
<p>
点击右上角
</p>
</div>
</div>
</
template
>
<
script
>
...
...
@@ -85,7 +89,8 @@
userInfo
:
window
.
sessionStorage
.
getItem
(
"userInfo"
)
?
JSON
.
parse
(
this
.
Base64
.
decode
(
window
.
sessionStorage
.
getItem
(
"userInfo"
)))
:
null
,
url
:
""
,
disabledFlag
:
0
,
popupVisible
:
false
popupVisible
:
false
,
dialogVisible
:
false
}
},
...
...
@@ -197,7 +202,15 @@
//分享
handleOpreation
(){
this
.
popupVisible
=
true
;
var
ua
=
navigator
.
userAgent
.
toLowerCase
();
if
(
ua
.
match
(
/MicroMessenger/i
)
==
"micromessenger"
)
{
this
.
shareFunc
();
}
else
{
this
.
dialogVisible
=
false
;
this
.
popupVisible
=
true
;
}
// this.vueQrVisible = true;
// api.selectBasicParams().then(response => {
// if(response.code == 0) {
...
...
@@ -211,74 +224,94 @@
// });
},
//分享给好友
handleShareFriendSquare
(){
var
that
=
this
;
//分享给朋友
shareFunc
(){
let
params
=
{
appUrl
:
window
.
location
.
href
//document.location.href.split("#")[0]+"/?#"+document.location.href.split("#")[1]
};
api
.
getConfigAxios
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
){
this
.
config
=
res
.
result
;
wx
.
config
({
debug
:
true
,
// 是否开启调试模式
appId
:
res
.
result
.
appId
,
//appid
timestamp
:
res
.
result
.
timestamp
,
// 时间戳
nonceStr
:
res
.
result
.
nonceStr
,
// 随机字符串
signature
:
res
.
result
.
signature
,
// 签名
jsApiList
:[
'onMenuShareAppMessage'
,
'onMenuShareTimeline'
]
// 需要使用的JS接口列表
wx
.
onMenuShareAppMessage
({
title
:
'您的好友邀请您参加'
+
that
.
detailInfo
.
channelTitle
,
// 分享标题
});
wx
.
ready
(
function
(){
wx
.
onMenuShareAppMessage
({
desc
:
that
.
detailInfo
.
channelTitle
,
// 分享描述
title
:
'您的好友邀请您参加'
+
that
.
detailInfo
.
channelTitle
,
// 分享标题
link
:
document
.
location
.
href
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
desc
:
that
.
detailInfo
.
channelTitle
,
// 分享描述
imgUrl
:
require
(
"../../../assets/img/bigBusinessLogo@2x.png"
),
// 分享图标
link
:
document
.
location
.
href
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
type
:
''
,
// 分享类型,music、video或link,不填默认为link
imgUrl
:
require
(
"../../../assets/img/bigBusinessLogo@2x.png"
),
// 分享图标
dataUrl
:
''
,
// 如果type是music或video,则要提供数据链接,默认为空
type
:
''
,
// 分享类型,music、video或link,不填默认为link
success
:
function
()
{
dataUrl
:
''
,
// 如果type是music或video,则要提供数据链接,默认为空
// // 用户确认分享后执行的回调函数
//
// _this.$router.push({path:'/me',query:{}})
success
:
function
()
{
},
// // 用户确认分享后执行的回调函数
//
// _this.$router.push({path:'/me',query:{}})
cancel
:
function
()
{
},
// 用户取消分享后执行的回调函数
cancel
:
function
()
{
// alert('cancel')
// 用户取消分享后执行的回调函数
// _this.wxShare() //这是用户撤销后重新执行第一步验证签名的方法名 根据自己的命名写
// alert('cancel')
}
// _this.wxShare() //这是用户撤销后重新执行第一步验证签名的方法名 根据自己的命名写
})
},
}
//分享到朋友圈
handleShareFriend
(){
var
that
=
this
;
//分享到朋友圈
wx
.
onMenuShareTimeline
({
})
title
:
'您的好友邀请您参加'
+
that
.
detailInfo
.
channelTitle
,
// 分享标题
wx
.
onMenuShareTimeline
({
link
:
document
.
location
.
href
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
title
:
'您的好友邀请您参加'
+
that
.
detailInfo
.
channelTitle
,
// 分享标题
imgUrl
:
require
(
"../../../assets/img/bigBusinessLogo@2x.png"
),
// 分享图标
link
:
document
.
location
.
href
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
success
:
function
()
{
imgUrl
:
require
(
"../../../assets/img/bigBusinessLogo@2x.png"
),
// 分享图标
// 用户确认分享后执行的回调函数
success
:
function
()
{
// _this.$router.push({path:'/me',query:{}})
// 用户确认分享后执行的回调函数
},
// _this.$router.push({path:'/me',query:{}})
cancel
:
function
()
{
},
// 用户取消分享后执行的回调函数
cancel
:
function
()
{
// _this.wxShare()
// 用户取消分享后执行的回调函数
}
// _this.wxShare()
}
})
})
this
.
dialogVisible
=
true
;
this
.
popupVisible
=
false
;
}
else
{
this
.
$toast
(
res
.
msg
);
}
}).
catch
((
err
)
=>
{
this
.
$toast
(
err
);
})
},
...
...
@@ -481,7 +514,9 @@
position
:
fixed
;
bottom
:
0
;
width
:
100%
;
height
:
100vh
;
left
:
0
;
background
:
#fff
;
background
:
rgba
(
0
,
0
,
0
,
0
.7
);
z-index
:
100
;
}
</
style
>
\ No newline at end of file
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