xiuli.gao 6 years ago
parent
commit
1127576f98
2 changed files with 11 additions and 8 deletions
  1. 2 2
      share/index.html
  2. 9 6
      share/js/invitation.js

+ 2 - 2
share/index.html

99
 </body>
99
 </body>
100
 </html>
100
 </html>
101
 <script type="text/javascript" src="public/jquery-2.1.0.js"></script>
101
 <script type="text/javascript" src="public/jquery-2.1.0.js"></script>
102
-<script type="text/javascript" src="js/index.js?v=1"></script>
103
-<script type="text/javascript" src="js/invitation.js?v=2"></script>
102
+<script type="text/javascript" src="js/index.js?v=3"></script>
103
+<script type="text/javascript" src="js/invitation.js?v=3"></script>

+ 9 - 6
share/js/invitation.js

1
-var userId = null;
1
+var userId = 0;
2
 var str=location.href;  //取得整个地址栏
2
 var str=location.href;  //取得整个地址栏
3
 var num=str.indexOf("?"); 
3
 var num=str.indexOf("?"); 
4
 str=str.substr(num+1); //str得到?之后的字符串
4
 str=str.substr(num+1); //str得到?之后的字符串
22
 var jsons = {
22
 var jsons = {
23
 			title:'@你,快来瓜分10000个红包!',
23
 			title:'@你,快来瓜分10000个红包!',
24
 			desc:'福利放送!淘宝无门槛购物红包天天领!来看看你的手气~',
24
 			desc:'福利放送!淘宝无门槛购物红包天天领!来看看你的手气~',
25
-			url: BASEURL + '/share/index.html?userId=' + userId
25
+			url: BASEURL + '/share/index.html?userId=0'
26
 };
26
 };
27
 jsons = JSON.stringify(jsons);
27
 jsons = JSON.stringify(jsons);
28
 function shareWeixin () {
28
 function shareWeixin () {
48
 }
48
 }
49
 //点击立即分享
49
 //点击立即分享
50
 $(".shareHongbao").click(function () {
50
 $(".shareHongbao").click(function () {
51
+		shareRedPacket();
51
 		if(navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger"){
52
 		if(navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger"){
52
 			//微信
53
 			//微信
53
 			$(".shareWechat").css('display','block')
54
 			$(".shareWechat").css('display','block')
54
-			shareRedPacket ();
55
 		}else{
55
 		}else{
56
 			//app端
56
 			//app端
57
 			$(".shareMask").css('display','block')
57
 			$(".shareMask").css('display','block')
148
 //分享用户授权
148
 //分享用户授权
149
 function shareRedPacket () {
149
 function shareRedPacket () {
150
 	$.ajax({
150
 	$.ajax({
151
-		type:"post",
151
+		type:"get",
152
 		url:"/api/V2/shareRedPacket",
152
 		url:"/api/V2/shareRedPacket",
153
 		dataType:"json",
153
 		dataType:"json",
154
-		success: function () {
155
-			shareFriend ();
154
+		data:{
155
+			'user_id':userId
156
+		},
157
+		success: function (res) {
158
+			console.log(res)
156
 		}
159
 		}
157
 	})
160
 	})
158
 }
161
 }