Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
h5_activity
Project
Overview
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
谭新宇
h5_activity
Commits
2257b5c0
Commit
2257b5c0
authored
Jul 11, 2019
by
txy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'微信鉴权'
parent
84438024
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
96 deletions
+99
-96
index.html
showPhotos/index.html
+1
-12
index.js
showPhotos/js/page/index.js
+2
-48
share.js
showPhotos/js/page/share.js
+69
-0
signup.js
showPhotos/js/page/signup.js
+1
-1
user.js
showPhotos/js/page/user.js
+20
-7
signup.html
showPhotos/signup.html
+5
-16
user.html
showPhotos/user.html
+1
-12
No files found.
showPhotos/index.html
View file @
2257b5c0
...
@@ -26,22 +26,11 @@
...
@@ -26,22 +26,11 @@
var user = JSON.parse([[${user}]]);
var user = JSON.parse([[${user}]]);
var jsSdk = JSON.parse([[${jsSdk}]]);
var jsSdk = JSON.parse([[${jsSdk}]]);
</script> -->
</script> -->
<script
type=
"text/javascript"
>
wx
.
config
({
debug
:
false
,
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId
:
'${appId!}'
,
// 必填,公众号的唯一标识
timestamp
:
'${timestamp!}'
,
// 必填,生成签名的时间戳
nonceStr
:
'${noncestr!}'
,
// 必填,生成签名的随机串
signature
:
'${signature!}'
,
// 必填,签名,见附录1
jsApiList
:
[
'onMenuShareTimeline'
,
'onMenuShareAppMessage'
,
'startRecord'
,
'stopRecord'
,
'onVoiceRecordEnd'
,
'playVoice'
,
'pauseVoice'
,
'stopVoice'
,
'onVoicePlayEnd'
,
'uploadVoice'
,
'downloadVoice'
,
'chooseImage'
,
'previewImage'
,
'uploadImage'
,
'downloadImage'
,
'translateVoice'
,
'openLocation'
,
'getLocation'
,
'hideOptionMenu'
,
'showOptionMenu'
,
'hideMenuItems'
,
'showMenuItems'
,
'scanQRCode'
,
'chooseWXPay'
,
'addCard'
,
'chooseCard'
,
'openCard'
]
// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
</script>
</head>
</head>
<!-- th:text="${page}" -->
<!-- th:text="${page}" -->
<body>
<body>
</body>
</body>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/common.js"
></script>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/common.js"
></script>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/share.js"
></script>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/index.js"
></script>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/index.js"
></script>
</html>
</html>
showPhotos/js/page/index.js
View file @
2257b5c0
// 微信鉴权
wxpermission
();
// 加载html结构
// 加载html结构
loadHtmlJson
();
loadHtmlJson
();
...
@@ -24,51 +22,6 @@ $(function(){
...
@@ -24,51 +22,6 @@ $(function(){
}
}
});
});
// 微信鉴权
function
wxpermission
()
{
var
_r
=
rules
;
var
settings
=
_r
.
settings
;
wx
.
ready
(
function
(){
var
shareData
=
{
title
:
settings
.
szText
.
shareTitile
,
imgUrl
:
settings
.
szText
.
shareIcon
,
desc
:
settings
.
szText
.
shareSubtitle
,
link
:
window
.
location
.
href
}
/**
*分享给朋友
*/
wx
.
onMenuShareAppMessage
({
title
:
shareData
.
title
,
// 分享标题
desc
:
shareData
.
desc
,
// 分享描述
link
:
shareData
.
link
,
// 分享链接
imgUrl
:
shareData
.
imgUrl
,
// 分享图标
type
:
'link'
,
// 分享类型,music、video或link,不填默认为link
dataUrl
:
''
,
// 如果type是music或video,则要提供数据链接,默认为空
success
:
function
()
{
// 用户确认分享后执行的回调函数
},
cancel
:
function
()
{
// 用户取消分享后执行的回调函数
}
});
/**
*分享到朋友圈
*/
wx
.
onMenuShareTimeline
({
title
:
shareData
.
title
,
// 分享标题
desc
:
shareData
.
desc
,
// 分享描述
link
:
shareData
.
link
,
// 分享链接
imgUrl
:
shareData
.
imgUrl
,
// 分享图标
success
:
function
()
{
},
cancel
:
function
()
{
// 用户取消分享后执行的回调函数
}
});
});
}
// 元素点击事件绑定
// 元素点击事件绑定
function
btnBindClick
()
{
function
btnBindClick
()
{
// 参数选手
// 参数选手
...
@@ -385,9 +338,10 @@ function voteClickFn(){
...
@@ -385,9 +338,10 @@ function voteClickFn(){
}
}
},
},
error
:
function
(
data
){
error
:
function
(
data
){
// 异常处理
// 异常处理
$
.
dialog
({
$
.
dialog
({
contentHtml
:
'<p style="text-align:center;">'
+
data
.
message
+
'</p>'
contentHtml
:
'<p style="text-align:center;">'
+
data
.
responseJSON
.
message
+
'</p>'
});
});
}
}
})
})
...
...
showPhotos/js/page/share.js
0 → 100644
View file @
2257b5c0
var
_r
=
rules
;
var
settings
=
_r
.
settings
;
wx
.
config
({
debug
:
false
,
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId
:
'${appId!}'
,
// 必填,公众号的唯一标识
timestamp
:
'${timestamp!}'
,
// 必填,生成签名的时间戳
nonceStr
:
'${noncestr!}'
,
// 必填,生成签名的随机串
signature
:
'${signature!}'
,
// 必填,签名,见附录1
jsApiList
:
[
'onMenuShareTimeline'
,
'onMenuShareAppMessage'
,
'startRecord'
,
'stopRecord'
,
'onVoiceRecordEnd'
,
'playVoice'
,
'pauseVoice'
,
'stopVoice'
,
'onVoicePlayEnd'
,
'uploadVoice'
,
'downloadVoice'
,
'chooseImage'
,
'previewImage'
,
'uploadImage'
,
'downloadImage'
,
'translateVoice'
,
'openLocation'
,
'getLocation'
,
'hideOptionMenu'
,
'showOptionMenu'
,
'hideMenuItems'
,
'showMenuItems'
,
'scanQRCode'
,
'chooseWXPay'
,
'addCard'
,
'chooseCard'
,
'openCard'
]
// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx
.
ready
(
function
(){
var
shareData
=
{
title
:
settings
.
szText
.
shareTitile
,
imgUrl
:
settings
.
szText
.
shareIcon
,
desc
:
settings
.
szText
.
shareSubtitle
,
link
:
""
}
// 已报名
if
(
user
.
status
)
{
shareData
.
title
=
settings
.
szText
.
pullTitile
;
shareData
.
desc
=
settings
.
szText
.
pullSubtitle
.
replace
(
"{{姓名}}"
,
user
.
name
);
shareData
.
link
=
"/ACTIVITY/view/"
+
activityCode
+
"/3?UserId="
+
user
.
id
;
}
else
{
// 分享首页
shareData
.
title
=
settings
.
szText
.
shareTitile
;
shareData
.
desc
=
settings
.
szText
.
shareSubtitle
;
shareData
.
link
=
"/ACTIVITY/view/"
+
activityCode
+
"/1"
;
}
/**
*分享给朋友
*/
wx
.
onMenuShareAppMessage
({
title
:
shareData
.
title
,
// 分享标题
desc
:
shareData
.
desc
,
// 分享描述
link
:
shareData
.
link
,
// 分享链接
imgUrl
:
shareData
.
imgUrl
,
// 分享图标
type
:
'link'
,
// 分享类型,music、video或link,不填默认为link
dataUrl
:
''
,
// 如果type是music或video,则要提供数据链接,默认为空
success
:
function
()
{
// 用户确认分享后执行的回调函数
},
cancel
:
function
()
{
// 用户取消分享后执行的回调函数
}
});
/**
*分享到朋友圈
*/
wx
.
onMenuShareTimeline
({
title
:
shareData
.
title
,
// 分享标题
desc
:
shareData
.
desc
,
// 分享描述
link
:
shareData
.
link
,
// 分享链接
imgUrl
:
shareData
.
imgUrl
,
// 分享图标
success
:
function
()
{
},
cancel
:
function
()
{
// 用户取消分享后执行的回调函数
}
});
});
\ No newline at end of file
showPhotos/js/page/signup.js
View file @
2257b5c0
...
@@ -275,7 +275,7 @@ function btnBindClick() {
...
@@ -275,7 +275,7 @@ function btnBindClick() {
error
:
function
(
data
){
error
:
function
(
data
){
// 异常处理
// 异常处理
$
.
dialog
({
$
.
dialog
({
contentHtml
:
'<p style="text-align:center;">'
+
data
.
message
+
'</p>'
contentHtml
:
'<p style="text-align:center;">'
+
data
.
responseJSON
.
message
+
'</p>'
});
});
}
}
})
})
...
...
showPhotos/js/page/user.js
View file @
2257b5c0
var
gb_vote_loaded
=
false
var
gb_vote_loaded
=
false
// 微信鉴权
wxpermission
();
// 加载html结构
// 加载html结构
loadHtmlJson
();
loadHtmlJson
();
...
@@ -14,14 +12,28 @@ $(function(){
...
@@ -14,14 +12,28 @@ $(function(){
});
});
// 微信鉴权
// 微信鉴权
function
wxpermission
()
{
function
wxpermission
(
userId
,
userName
)
{
wx
.
ready
(
function
(){
wx
.
ready
(
function
(){
var
shareData
=
{
var
shareData
=
{
title
:
""
,
title
:
settings
.
szText
.
shareTitile
,
imgUrl
:
""
,
imgUrl
:
settings
.
szText
.
shareIcon
,
desc
:
""
,
desc
:
settings
.
szText
.
shareSubtitle
,
link
:
""
link
:
""
}
}
// 已报名
if
(
user
.
status
)
{
shareData
.
title
=
settings
.
szText
.
pullTitile
;
shareData
.
desc
=
settings
.
szText
.
pullSubtitle
.
replace
(
"{{姓名}}"
,
userName
);
shareData
.
link
=
"/ACTIVITY/view/"
+
activityCode
+
"/3?UserId="
+
userId
;
}
else
{
// 分享首页
shareData
.
title
=
settings
.
szText
.
shareTitile
;
shareData
.
desc
=
settings
.
szText
.
shareSubtitle
;
shareData
.
link
=
"/ACTIVITY/view/"
+
activityCode
+
"/1"
;
}
/**
/**
*分享给朋友
*分享给朋友
*/
*/
...
@@ -166,6 +178,7 @@ function userTabInfo() {
...
@@ -166,6 +178,7 @@ function userTabInfo() {
$
(
'#act3932189955 .userState'
).
attr
(
'readOnly'
,
'readOnly'
)
$
(
'#act3932189955 .userState'
).
attr
(
'readOnly'
,
'readOnly'
)
$
(
'#act3932189955 .show-pic'
).
attr
(
'src'
,
userInfoObj
.
imageUrl
);
$
(
'#act3932189955 .show-pic'
).
attr
(
'src'
,
userInfoObj
.
imageUrl
);
}
}
wxpermission
(
id
,
userInfoObj
.
name
);
},
},
error
:
function
()
{
error
:
function
()
{
$
.
dialog
({
$
.
dialog
({
...
@@ -220,7 +233,7 @@ function voteClickFn(){
...
@@ -220,7 +233,7 @@ function voteClickFn(){
gb_vote_loaded
=
false
gb_vote_loaded
=
false
// 异常处理
// 异常处理
$
.
dialog
({
$
.
dialog
({
contentHtml
:
'<p style="text-align:center;">'
+
data
.
message
+
'</p>'
contentHtml
:
'<p style="text-align:center;">'
+
data
.
responseJSON
.
message
+
'</p>'
});
});
}
}
})
})
...
...
showPhotos/signup.html
View file @
2257b5c0
...
@@ -25,25 +25,14 @@
...
@@ -25,25 +25,14 @@
var user = JSON.parse([[${user}]]);
var user = JSON.parse([[${user}]]);
var jsSdk = JSON.parse([[${jsSdk}]]);
var jsSdk = JSON.parse([[${jsSdk}]]);
</script> -->
</script> -->
<script
type=
"text/javascript"
>
wx
.
config
({
debug
:
false
,
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId
:
'${appId!}'
,
// 必填,公众号的唯一标识
timestamp
:
'${timestamp!}'
,
// 必填,生成签名的时间戳
nonceStr
:
'${noncestr!}'
,
// 必填,生成签名的随机串
signature
:
'${signature!}'
,
// 必填,签名,见附录1
jsApiList
:
[
'onMenuShareTimeline'
,
'onMenuShareAppMessage'
,
'startRecord'
,
'stopRecord'
,
'onVoiceRecordEnd'
,
'playVoice'
,
'pauseVoice'
,
'stopVoice'
,
'onVoicePlayEnd'
,
'uploadVoice'
,
'downloadVoice'
,
'chooseImage'
,
'previewImage'
,
'uploadImage'
,
'downloadImage'
,
'translateVoice'
,
'openLocation'
,
'getLocation'
,
'hideOptionMenu'
,
'showOptionMenu'
,
'hideMenuItems'
,
'showMenuItems'
,
'scanQRCode'
,
'chooseWXPay'
,
'addCard'
,
'chooseCard'
,
'openCard'
]
// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
</script>
</head>
</head>
<body>
<body>
</body>
</body>
<!-- <script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/common.js"></script>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/common.js"
></script>
<script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/signup.js"></script> -->
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/share.js"
></script>
<script
type=
"text/javascript"
src=
"js/page/common.js"
></script>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/signup.js"
></script>
<script
type=
"text/javascript"
src=
"js/page/signup.js"
></script>
<!-- <script type="text/javascript" src="js/page/common.js"></script>
<script type="text/javascript" src="js/page/signup.js"></script> -->
</html>
</html>
showPhotos/user.html
View file @
2257b5c0
...
@@ -22,23 +22,12 @@
...
@@ -22,23 +22,12 @@
var user = JSON.parse([[${user}]]);
var user = JSON.parse([[${user}]]);
var jsSdk = JSON.parse([[${jsSdk}]]);
var jsSdk = JSON.parse([[${jsSdk}]]);
</script> -->
</script> -->
<script
type=
"text/javascript"
>
wx
.
config
({
debug
:
false
,
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId
:
'${appId!}'
,
// 必填,公众号的唯一标识
timestamp
:
'${timestamp!}'
,
// 必填,生成签名的时间戳
nonceStr
:
'${noncestr!}'
,
// 必填,生成签名的随机串
signature
:
'${signature!}'
,
// 必填,签名,见附录1
jsApiList
:
[
'onMenuShareTimeline'
,
'onMenuShareAppMessage'
,
'startRecord'
,
'stopRecord'
,
'onVoiceRecordEnd'
,
'playVoice'
,
'pauseVoice'
,
'stopVoice'
,
'onVoicePlayEnd'
,
'uploadVoice'
,
'downloadVoice'
,
'chooseImage'
,
'previewImage'
,
'uploadImage'
,
'downloadImage'
,
'translateVoice'
,
'openLocation'
,
'getLocation'
,
'hideOptionMenu'
,
'showOptionMenu'
,
'hideMenuItems'
,
'showMenuItems'
,
'scanQRCode'
,
'chooseWXPay'
,
'addCard'
,
'chooseCard'
,
'openCard'
]
// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
</script>
</head>
</head>
<body>
<body>
</body>
</body>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/common.js"
></script>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/common.js"
></script>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/share.js"
></script>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/user.js"
></script>
<script
type=
"text/javascript"
src=
"https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/user.js"
></script>
<!-- <script type="text/javascript" src="js/page/user.js"></script> -->
<!-- <script type="text/javascript" src="js/page/user.js"></script> -->
</html>
</html>
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