xiuli.gao 6 vuotta sitten
vanhempi
commit
364aaa576c
4 muutettua tiedostoa jossa 60 lisäystä ja 76 poistoa
  1. 4 4
      share/index.css
  2. 13 25
      share/index.html
  3. 12 36
      share/js/index.js
  4. 31 11
      share/js/invitation.js

+ 4 - 4
share/index.css

2
 .banner{width: 3.025rem;height: 1.15rem;margin: auto;padding-top: 0.11rem;}
2
 .banner{width: 3.025rem;height: 1.15rem;margin: auto;padding-top: 0.11rem;}
3
 .banner img{width: 100%;}
3
 .banner img{width: 100%;}
4
 .red_packet{margin: auto;}
4
 .red_packet{margin: auto;}
5
+.red_packet p:nth-of-type(1){text-align: center;color: #666666;margin-top:0.1rem;line-height: 0.3rem;}
5
 .red_packet .click{font-size:0.18rem;color:#FB3D38;text-align: center;padding-top: 0.2rem;padding-bottom: 0.2rem;}
6
 .red_packet .click{font-size:0.18rem;color:#FB3D38;text-align: center;padding-top: 0.2rem;padding-bottom: 0.2rem;}
6
-.red_packet .copy{width: 1.5rem;height: 0.4rem;margin:auto;margin-top:0.4rem;margin-bottom:0.4rem;color:#FFF;font-size:0.18rem;line-height: 0.4rem;text-align:center;background:#FB3D38;border-radius:0.075rem;box-shadow:0.02rem 0.045rem 0.05rem rgba(143,141,141,0.22);}
7
+.red_packet .copy{width: 1.5rem;height: 0.4rem;margin:auto;margin-top:0.2rem;margin-bottom:0.4rem;color:#FFF;font-size:0.18rem;line-height: 0.4rem;text-align:center;background:#FB3D38;border-radius:0.075rem;box-shadow:0.02rem 0.045rem 0.05rem rgba(143,141,141,0.22);}
7
 .red_packet .con{font-size:0.14rem;color:#666666;padding-top: 0.2rem;padding-bottom: 0.345rem;text-align: center;}
8
 .red_packet .con{font-size:0.14rem;color:#666666;padding-top: 0.2rem;padding-bottom: 0.345rem;text-align: center;}
8
 .already{height: 1.8rem;padding-left: 0.16rem;padding-right: 0.15rem;}
9
 .already{height: 1.8rem;padding-left: 0.16rem;padding-right: 0.15rem;}
9
 .already .num{font-size:0.15rem;color:#FB3D38;padding-bottom: 0.175rem;}
10
 .already .num{font-size:0.15rem;color:#FB3D38;padding-bottom: 0.175rem;}
10
 .already ul{}
11
 .already ul{}
11
-.already ul li{float: left;padding-bottom: 0.08rem;color: #666666;line-height: 0.355rem;}
12
-.already ul li img{float: left;display: block;width: 0.355rem;height: 0.355rem;border:0;}
12
+.already ul li{float: left;color: #666666;line-height: 0.355rem;}
13
+.already ul li img{float: left;display: block;width: 0.355rem;height: 0.355rem;border:0;padding-bottom: 0.08rem;}
13
 .already ul li .username{ display: inline-block; float: left;padding-left: 0.075rem;width: 1.1rem;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
14
 .already ul li .username{ display: inline-block; float: left;padding-left: 0.075rem;width: 1.1rem;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
14
 .already ul li .ed{padding-right: 0.48rem;}
15
 .already ul li .ed{padding-right: 0.48rem;}
15
 .already ul li .username,.already ul li .ed{font-size: 0.14rem;}
16
 .already ul li .username,.already ul li .ed{font-size: 0.14rem;}
120
 
121
 
121
 
122
 
122
 #invitation{display: none;}
123
 #invitation{display: none;}
123
-.copyTkl{display: none;}

+ 13 - 25
share/index.html

6
 	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
6
 	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
7
 	<title>分享领红包</title>
7
 	<title>分享领红包</title>
8
 	<link rel="stylesheet" type="text/css" href="public/public_css.css"/>
8
 	<link rel="stylesheet" type="text/css" href="public/public_css.css"/>
9
-	<link rel="stylesheet" type="text/css" href="./index.css?v=1"/>
9
+	<link rel="stylesheet" type="text/css" href="./index.css?v=3"/>
10
 	<script type="text/javascript" src="../api-url.js"></script>
10
 	<script type="text/javascript" src="../api-url.js"></script>
11
 	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
11
 	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
12
 	<script src="js/weChatShare.js?v=2"></script>
12
 	<script src="js/weChatShare.js?v=2"></script>
23
 			<img src="images/banner.png"/>
23
 			<img src="images/banner.png"/>
24
 		</div>
24
 		</div>
25
 		<div class="red_packet">
25
 		<div class="red_packet">
26
-			<!--<p class="click">点我领红包</p>-->
27
-			<p class="copy" onclick="collarRed()">领取红包</p>
28
-			<!--<p class="con">自动生成淘口令,打开手机淘宝领取红包</p>-->
26
+			<p>分享给好友后即可领取红包</p>
27
+			<p class="copy shareHongbao">立即分享</p>
29
 		</div>
28
 		</div>
30
-		<!--<div class="already">
29
+		<div class="already">
31
 			<p class="num"></p>
30
 			<p class="num"></p>
32
 			<div class="roll-wrap" id="roll-wrap">
31
 			<div class="roll-wrap" id="roll-wrap">
33
 			<ul></ul>
32
 			<ul></ul>
34
 			</div>
33
 			</div>
35
-		</div>-->
36
-		<!--<div class="cooperation">
34
+		</div>
35
+		<div class="cooperation">
37
 			<img src="images/jinniu.png" alt="" />
36
 			<img src="images/jinniu.png" alt="" />
38
 			<img src="images/taobao.png" alt="" />
37
 			<img src="images/taobao.png" alt="" />
39
 			<img src="images/liedou.png" alt="" />
38
 			<img src="images/liedou.png" alt="" />
41
 		<div class="bottom">
40
 		<div class="bottom">
42
 			<p>联合送礼</p>
41
 			<p>联合送礼</p>
43
 			<p>下载猎豆优选,大额红包拿到手软</p>
42
 			<p>下载猎豆优选,大额红包拿到手软</p>
44
-		</div>-->
45
-		<div class="download" style="border-top: 0.005rem solid #707070;">
46
-			<p class="tit">获取更多大额红包,下载猎豆优选</p>
47
-			<div class="leidou">
48
-				<img src="images/liedou.png" class="liedouImg"/>
49
-				<p class="introduce"><img src="images/logo.png" alt="" /><span>购物先领券,下单赚佣金</span></p>
50
-				<a class="down" href="http://a.app.qq.com/o/simple.jsp?pkgname=com.kuxuan.coupon_liedou">下载APP</a>
51
-			</div>
52
 		</div>
43
 		</div>
53
-		<div class="btom">在淘宝/天猫购物之前,先来“猎豆优选App”</div>
54
 	</div>
44
 	</div>
55
 	
45
 	
56
 	
46
 	
57
 <!--页面2-->
47
 <!--页面2-->
58
 	<div id="invitation">
48
 	<div id="invitation">
59
 		<div class="success">
49
 		<div class="success">
60
-			<p class="shareSuccess">分享给好友,领取红包</p>
50
+			<p class="shareSuccess">恭喜你,分享成功</p>
61
 			<p class="copyTkl">点击下方复制淘口令,打开手机淘宝领取红包</p>
51
 			<p class="copyTkl">点击下方复制淘口令,打开手机淘宝领取红包</p>
62
-			<button class="share shareHongbao">分享</button>
63
-			<button class="share shareCopy" style="display: none;">一键复制</button>
64
-			<p class="shareTitle">分享给朋友,一起拿红包</p>
52
+			<button class="share shareCopy" style="margin-bottom:0.4rem">一键复制</button>
65
 		</div>
53
 		</div>
66
 		<div class="download">
54
 		<div class="download">
67
 			<p class="tit">获取更多大额红包,下载猎豆优选</p>
55
 			<p class="tit">获取更多大额红包,下载猎豆优选</p>
72
 			</div>
60
 			</div>
73
 		</div>
61
 		</div>
74
 		<div class="btom">在淘宝/天猫购物之前,先来“猎豆优选App”</div>
62
 		<div class="btom">在淘宝/天猫购物之前,先来“猎豆优选App”</div>
63
+	</div>
75
 		
64
 		
76
 		<div class="shareMask">
65
 		<div class="shareMask">
77
 			<div class="weixin">
66
 			<div class="weixin">
92
 		<div class="shareWechat">
81
 		<div class="shareWechat">
93
 			<img src="./images/wx_jiantou.png" class="wx_jiantou" />
82
 			<img src="./images/wx_jiantou.png" class="wx_jiantou" />
94
 			<div class="shareWechatCon">
83
 			<div class="shareWechatCon">
95
-				<h3>恭喜你,获得淘宝红包</h3>
96
-				<p>点击右上角,分享给好友</p>
84
+				<h3>分享给朋友/群聊</h3>
85
+				<p>分享后即可领取红包</p>
97
 				<img class="cancel" src="./images/close.png"></img>
86
 				<img class="cancel" src="./images/close.png"></img>
98
 			</div>
87
 			</div>
99
 		</div>
88
 		</div>
100
 		
89
 		
101
 	    <input id="copy_1" type="text" readOnly="true" value=""/>
90
 	    <input id="copy_1" type="text" readOnly="true" value=""/>
102
 	    <div id="copy_2"></div>
91
 	    <div id="copy_2"></div>
103
-		<text id="taokouling">€1Itabeg9EZP€</text>
92
+		<text id="taokouling">啦啦啦啦啊啦啊</text>
104
 
93
 
105
-	</div>
106
 	
94
 	
107
 	<div class="alert-info" style="display: none;">
95
 	<div class="alert-info" style="display: none;">
108
         <!-- tip提示,3s后消失 -->
96
         <!-- tip提示,3s后消失 -->
112
 </html>
100
 </html>
113
 <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>
114
 <script type="text/javascript" src="js/index.js?v=1"></script>
102
 <script type="text/javascript" src="js/index.js?v=1"></script>
115
-<script type="text/javascript" src="js/invitation.js?v=1"></script>
103
+<script type="text/javascript" src="js/invitation.js?v=2"></script>

+ 12 - 36
share/js/index.js

1
-//var userId = null;
2
-//var str=location.href;  //取得整个地址栏
3
-//var num=str.indexOf("?"); 
4
-//str=str.substr(num+1); //str得到?之后的字符串
5
-//var brr=str.split("&");
6
-//for(var i = 0 ; i<brr.length; i++){
7
-//	if(brr[i].indexOf('userId') != -1){
8
-//		userId = brr[i].split('=')[1];//用户id
9
-//	}
10
-//}
1
+var userId = null;
2
+var str=location.href;  //取得整个地址栏
3
+var num=str.indexOf("?"); 
4
+str=str.substr(num+1); //str得到?之后的字符串
5
+var brr=str.split("&");
6
+for(var i = 0 ; i<brr.length; i++){
7
+	if(brr[i].indexOf('userId') != -1){
8
+		userId = brr[i].split('=')[1];//用户id
9
+	}
10
+}
11
 	//页面加载,显示数据
11
 	//页面加载,显示数据
12
 window.onload = function () {
12
 window.onload = function () {
13
-//	Lead() ;
14
-}
15
-//领红包
16
-function collarRed() {
17
-	$("#index").css("display","none");
18
-	$("#invitation").css("display","block")
19
-//		$.ajax({
20
-//			type:"post",
21
-//			url:"/api/V2/receiveRedPacket",
22
-//			data:{
23
-//				user_id:userId
24
-//			},
25
-//			success: function (res) {
26
-//				var data =JSON.parse(res)
27
-//				console.log(data)
28
-//				if(data.code == 0){
29
-//					copyPassword();
30
-//				}else if(data.code == 4003){
31
-//					showMsg("领取失败")
32
-//				}else if(data.code == 4002){
33
-////					showMsg(data.message)
34
-//					copyPassword();//不限制新老用户
35
-//				}
36
-//			}
37
-//		})
13
+	Lead() ;
38
 }
14
 }
39
 //已领红包
15
 //已领红包
40
 function Lead() {
16
 function Lead() {
78
     controls.rollWrapUl=controls.rollWrap.children();
54
     controls.rollWrapUl=controls.rollWrap.children();
79
     controls.rollWrapLIs=controls.rollWrapUl.children();
55
     controls.rollWrapLIs=controls.rollWrapUl.children();
80
     values.liNums=controls.rollWrapLIs.length;
56
     values.liNums=controls.rollWrapLIs.length;
81
-    values.liHeight=66.8;
57
+    values.liHeight=controls.rollWrapLIs.eq(0).height();
82
     values.ulHeight=controls.rollWrap.height();
58
     values.ulHeight=controls.rollWrap.height();
83
     this.init=function(){
59
     this.init=function(){
84
         autoPlay();
60
         autoPlay();

+ 31 - 11
share/js/invitation.js

6
 for(var i = 0 ; i<brr.length; i++){
6
 for(var i = 0 ; i<brr.length; i++){
7
 	if(brr[i].indexOf('userId') != -1){
7
 	if(brr[i].indexOf('userId') != -1){
8
 		userId = brr[i].split('=')[1];//用户id
8
 		userId = brr[i].split('=')[1];//用户id
9
-		localStorage.setItem('userId', userId);
10
 	}
9
 	}
11
 }
10
 }
12
 
11
 
32
 	}else{
31
 	}else{
33
 		window.webkit.messageHandlers.shareWithWechatSession.postMessage(jsons)
32
 		window.webkit.messageHandlers.shareWithWechatSession.postMessage(jsons)
34
 	}
33
 	}
34
+	$("#index").css("display","none");
35
+	$("#invitation").css("display","block");
36
+	$(".shareMask").css('display','none')
35
 }
37
 }
36
 
38
 
37
 function sharePengyouquan () {
39
 function sharePengyouquan () {
40
 	}else{
42
 	}else{
41
 		window.webkit.messageHandlers.shareWithWechatTimeline.postMessage(jsons)
43
 		window.webkit.messageHandlers.shareWithWechatTimeline.postMessage(jsons)
42
 	}
44
 	}
45
+	$("#index").css("display","none");
46
+	$("#invitation").css("display","block");
47
+	$(".shareMask").css('display','none')
43
 }
48
 }
44
-
49
+//点击立即分享
45
 $(".shareHongbao").click(function () {
50
 $(".shareHongbao").click(function () {
46
 		if(navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger"){
51
 		if(navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger"){
47
 			//微信
52
 			//微信
48
 			$(".shareWechat").css('display','block')
53
 			$(".shareWechat").css('display','block')
49
 			shareFriend ();
54
 			shareFriend ();
50
 		}else{
55
 		}else{
51
-//			//app端
56
+			//app端
52
 			$(".shareMask").css('display','block')
57
 			$(".shareMask").css('display','block')
53
 		}
58
 		}
59
+	collarRed();
54
 	share();
60
 	share();
55
 })
61
 })
62
+//带你几取消分享
56
 $(".cancel").click(function () {
63
 $(".cancel").click(function () {
57
 	$(".shareMask").css('display','none');
64
 	$(".shareMask").css('display','none');
58
 	$(".shareWechat").css('display','none')
65
 	$(".shareWechat").css('display','none')
88
 			if(res && res.code == 0){
95
 			if(res && res.code == 0){
89
 				wexinPay(res.res.url,res.res,() => {
96
 				wexinPay(res.res.url,res.res,() => {
90
 //					分享成功
97
 //					分享成功
91
-					$(".copyTkl").css("display","block");
92
-					$(".shareSuccess").html('恭喜你,分享成功');
93
-					$(".shareTitle").css("display","none");
94
-					$(".shareHongbao").css("display",'none')
95
-					$(".shareCopy").css({"margin-bottom":"0.4rem","display":"block"})
98
+					$("#index").css("display","none");
99
+					$("#invitation").css("display","block");
100
+					$(".shareMask").css('display','none')
96
 					$(".shareWechat").css('display','none')
101
 					$(".shareWechat").css('display','none')
97
-					$('.shareCopy').click(function () {
98
-						copyPassword()
99
-					})
100
 				},() => {
102
 				},() => {
101
 					showMsg("分享失败")
103
 					showMsg("分享失败")
102
 				})
104
 				})
141
     setTimeout(function() {
143
     setTimeout(function() {
142
         msgBox.hide();
144
         msgBox.hide();
143
     }, 3000);
145
     }, 3000);
146
+}
147
+
148
+$('.shareCopy').click(function () {
149
+	copyPassword()
150
+})
151
+
152
+//记录用户  领红包
153
+function collarRed() {
154
+	$.ajax({
155
+		type:"post",
156
+		url:"/api/V2/receiveRedPacket",
157
+		dataType:"json",
158
+		data:{
159
+			user_id:userId
160
+		},
161
+		success: function (res) {
162
+		}
163
+	})
144
 }
164
 }