|
@@ -9,11 +9,11 @@ var $ = require('yoho-jquery'), |
|
@@ -9,11 +9,11 @@ var $ = require('yoho-jquery'), |
9
|
activityID = $('#activityID').html(),
|
9
|
activityID = $('#activityID').html(),
|
10
|
pageInfo = $('#pageInfo').html(),
|
10
|
pageInfo = $('#pageInfo').html(),
|
11
|
_weChatInterface = 'http://www.yohoshow.com/api/wechat/getSignPackage',
|
11
|
_weChatInterface = 'http://www.yohoshow.com/api/wechat/getSignPackage',
|
12
|
- shareTitle = pageInfo.shareTitle,
|
|
|
13
|
- shareImg = pageInfo.shareImg,
|
|
|
14
|
- shareDesc = pageInfo.shareDesc,
|
|
|
15
|
- shareLink = pageInfo.shareUrl;
|
|
|
16
|
-var wx = window.wx;
|
12
|
+ shareTitle = $('#shareTitle').val(),
|
|
|
13
|
+ shareImg = $('#shareImg').val(),
|
|
|
14
|
+ shareDesc = $('#shareDesc').val(),
|
|
|
15
|
+ shareLink = $('#shareLink').val(),
|
|
|
16
|
+ wx = window.wx;
|
17
|
|
17
|
|
18
|
$('#phone').bind('input propertychange', function() {
|
18
|
$('#phone').bind('input propertychange', function() {
|
19
|
if ($(this).val().length === 11) {
|
19
|
if ($(this).val().length === 11) {
|
|
@@ -52,15 +52,13 @@ if (!$('#newUser').html()) { |
|
@@ -52,15 +52,13 @@ if (!$('#newUser').html()) { |
52
|
/**
|
52
|
/**
|
53
|
* 微信分享
|
53
|
* 微信分享
|
54
|
*/
|
54
|
*/
|
55
|
-(function() {
|
|
|
56
|
- if (typeof(wx) === 'undefined') {
|
|
|
57
|
- return;
|
|
|
58
|
- }
|
|
|
59
|
-
|
55
|
+if (typeof wx !== 'undefined') {
|
60
|
$.getJSON(_weChatInterface + '?pageurl=' +
|
56
|
$.getJSON(_weChatInterface + '?pageurl=' +
|
61
|
- encodeURIComponent(location.href.split('#')[0]) + '&callback=?', function(json) {
|
57
|
+ encodeURIComponent(location.href.split('#')[0]) + '&callback=?',
|
|
|
58
|
+ function(json) {
|
62
|
var _appId, _timestamp, _nonceStr, _signature;
|
59
|
var _appId, _timestamp, _nonceStr, _signature;
|
63
|
- if (json !== undefined && json !== '') {
|
60
|
+
|
|
|
61
|
+ if (json) {
|
64
|
_appId = json.appId.toString();
|
62
|
_appId = json.appId.toString();
|
65
|
_timestamp = json.timestamp;
|
63
|
_timestamp = json.timestamp;
|
66
|
_nonceStr = json.nonceStr.toString();
|
64
|
_nonceStr = json.nonceStr.toString();
|
|
@@ -111,20 +109,28 @@ if (!$('#newUser').html()) { |
|
@@ -111,20 +109,28 @@ if (!$('#newUser').html()) { |
111
|
});
|
109
|
});
|
112
|
}
|
110
|
}
|
113
|
});
|
111
|
});
|
114
|
- wx.ready(function() {
|
|
|
115
|
|
112
|
|
|
|
113
|
+ wx.ready(function() {
|
116
|
var shareData = {
|
114
|
var shareData = {
|
117
|
title: shareTitle,
|
115
|
title: shareTitle,
|
118
|
desc: shareDesc,
|
116
|
desc: shareDesc,
|
119
|
imgUrl: shareImg,
|
117
|
imgUrl: shareImg,
|
120
|
link: shareLink
|
118
|
link: shareLink
|
121
|
};
|
119
|
};
|
|
|
120
|
+
|
|
|
121
|
+ // 分享给朋友
|
122
|
wx.onMenuShareAppMessage(shareData);
|
122
|
wx.onMenuShareAppMessage(shareData);
|
|
|
123
|
+
|
|
|
124
|
+ // 分享到朋友圈
|
123
|
wx.onMenuShareTimeline(shareData);
|
125
|
wx.onMenuShareTimeline(shareData);
|
|
|
126
|
+
|
|
|
127
|
+ // 分享到QQ
|
124
|
wx.onMenuShareQQ(shareData);
|
128
|
wx.onMenuShareQQ(shareData);
|
|
|
129
|
+
|
|
|
130
|
+ // 分享到微博
|
125
|
wx.onMenuShareWeibo(shareData);
|
131
|
wx.onMenuShareWeibo(shareData);
|
126
|
});
|
132
|
});
|
127
|
-}());
|
133
|
+}
|
128
|
|
134
|
|
129
|
$('.input-content div').on('click', function() {
|
135
|
$('.input-content div').on('click', function() {
|
130
|
phone = $(this).siblings('input').val();
|
136
|
phone = $(this).siblings('input').val();
|