xiuli.gao 6 anni fa
parent
commit
364aaa576c
4 ha cambiato i file con 60 aggiunte e 76 eliminazioni
  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,14 +2,15 @@ body,html{font-size: 0.16rem;height: 100vh;}
2 2
 .banner{width: 3.025rem;height: 1.15rem;margin: auto;padding-top: 0.11rem;}
3 3
 .banner img{width: 100%;}
4 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 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 8
 .red_packet .con{font-size:0.14rem;color:#666666;padding-top: 0.2rem;padding-bottom: 0.345rem;text-align: center;}
8 9
 .already{height: 1.8rem;padding-left: 0.16rem;padding-right: 0.15rem;}
9 10
 .already .num{font-size:0.15rem;color:#FB3D38;padding-bottom: 0.175rem;}
10 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 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 15
 .already ul li .ed{padding-right: 0.48rem;}
15 16
 .already ul li .username,.already ul li .ed{font-size: 0.14rem;}
@@ -120,4 +121,3 @@ a, a:visited{text-decoration: none;}
120 121
 
121 122
 
122 123
 #invitation{display: none;}
123
-.copyTkl{display: none;}

+ 13 - 25
share/index.html

@@ -6,7 +6,7 @@
6 6
 	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
7 7
 	<title>分享领红包</title>
8 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 10
 	<script type="text/javascript" src="../api-url.js"></script>
11 11
 	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
12 12
 	<script src="js/weChatShare.js?v=2"></script>
@@ -23,17 +23,16 @@
23 23
 			<img src="images/banner.png"/>
24 24
 		</div>
25 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 28
 		</div>
30
-		<!--<div class="already">
29
+		<div class="already">
31 30
 			<p class="num"></p>
32 31
 			<div class="roll-wrap" id="roll-wrap">
33 32
 			<ul></ul>
34 33
 			</div>
35
-		</div>-->
36
-		<!--<div class="cooperation">
34
+		</div>
35
+		<div class="cooperation">
37 36
 			<img src="images/jinniu.png" alt="" />
38 37
 			<img src="images/taobao.png" alt="" />
39 38
 			<img src="images/liedou.png" alt="" />
@@ -41,27 +40,16 @@
41 40
 		<div class="bottom">
42 41
 			<p>联合送礼</p>
43 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 43
 		</div>
53
-		<div class="btom">在淘宝/天猫购物之前,先来“猎豆优选App”</div>
54 44
 	</div>
55 45
 	
56 46
 	
57 47
 <!--页面2-->
58 48
 	<div id="invitation">
59 49
 		<div class="success">
60
-			<p class="shareSuccess">分享给好友,领取红包</p>
50
+			<p class="shareSuccess">恭喜你,分享成功</p>
61 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 53
 		</div>
66 54
 		<div class="download">
67 55
 			<p class="tit">获取更多大额红包,下载猎豆优选</p>
@@ -72,6 +60,7 @@
72 60
 			</div>
73 61
 		</div>
74 62
 		<div class="btom">在淘宝/天猫购物之前,先来“猎豆优选App”</div>
63
+	</div>
75 64
 		
76 65
 		<div class="shareMask">
77 66
 			<div class="weixin">
@@ -92,17 +81,16 @@
92 81
 		<div class="shareWechat">
93 82
 			<img src="./images/wx_jiantou.png" class="wx_jiantou" />
94 83
 			<div class="shareWechatCon">
95
-				<h3>恭喜你,获得淘宝红包</h3>
96
-				<p>点击右上角,分享给好友</p>
84
+				<h3>分享给朋友/群聊</h3>
85
+				<p>分享后即可领取红包</p>
97 86
 				<img class="cancel" src="./images/close.png"></img>
98 87
 			</div>
99 88
 		</div>
100 89
 		
101 90
 	    <input id="copy_1" type="text" readOnly="true" value=""/>
102 91
 	    <div id="copy_2"></div>
103
-		<text id="taokouling">€1Itabeg9EZP€</text>
92
+		<text id="taokouling">啦啦啦啦啊啦啊</text>
104 93
 
105
-	</div>
106 94
 	
107 95
 	<div class="alert-info" style="display: none;">
108 96
         <!-- tip提示,3s后消失 -->
@@ -112,4 +100,4 @@
112 100
 </html>
113 101
 <script type="text/javascript" src="public/jquery-2.1.0.js"></script>
114 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,40 +1,16 @@
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 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 16
 function Lead() {
@@ -78,7 +54,7 @@ function scrollTxt(){
78 54
     controls.rollWrapUl=controls.rollWrap.children();
79 55
     controls.rollWrapLIs=controls.rollWrapUl.children();
80 56
     values.liNums=controls.rollWrapLIs.length;
81
-    values.liHeight=66.8;
57
+    values.liHeight=controls.rollWrapLIs.eq(0).height();
82 58
     values.ulHeight=controls.rollWrap.height();
83 59
     this.init=function(){
84 60
         autoPlay();

+ 31 - 11
share/js/invitation.js

@@ -6,7 +6,6 @@ var brr=str.split("&");
6 6
 for(var i = 0 ; i<brr.length; i++){
7 7
 	if(brr[i].indexOf('userId') != -1){
8 8
 		userId = brr[i].split('=')[1];//用户id
9
-		localStorage.setItem('userId', userId);
10 9
 	}
11 10
 }
12 11
 
@@ -32,6 +31,9 @@ function shareWeixin () {
32 31
 	}else{
33 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 39
 function sharePengyouquan () {
@@ -40,19 +42,24 @@ function sharePengyouquan () {
40 42
 	}else{
41 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 50
 $(".shareHongbao").click(function () {
46 51
 		if(navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger"){
47 52
 			//微信
48 53
 			$(".shareWechat").css('display','block')
49 54
 			shareFriend ();
50 55
 		}else{
51
-//			//app端
56
+			//app端
52 57
 			$(".shareMask").css('display','block')
53 58
 		}
59
+	collarRed();
54 60
 	share();
55 61
 })
62
+//带你几取消分享
56 63
 $(".cancel").click(function () {
57 64
 	$(".shareMask").css('display','none');
58 65
 	$(".shareWechat").css('display','none')
@@ -88,15 +95,10 @@ function shareFriend () {
88 95
 			if(res && res.code == 0){
89 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 101
 					$(".shareWechat").css('display','none')
97
-					$('.shareCopy').click(function () {
98
-						copyPassword()
99
-					})
100 102
 				},() => {
101 103
 					showMsg("分享失败")
102 104
 				})
@@ -141,4 +143,22 @@ function showMsg(msg) {
141 143
     setTimeout(function() {
142 144
         msgBox.hide();
143 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
 }