Authored by 张丽霞

分享领券模板

@@ -12,6 +12,7 @@ const getPageInfo = (pageInfo) => { @@ -12,6 +12,7 @@ const getPageInfo = (pageInfo) => {
12 var dest = {}; 12 var dest = {};
13 13
14 dest.code = pageInfo.code; 14 dest.code = pageInfo.code;
  15 + dest.activityID = pageInfo.id;
15 dest.title = pageInfo.data.h5Title; 16 dest.title = pageInfo.data.h5Title;
16 dest.activityDesc = pageInfo.data.activityDesc; 17 dest.activityDesc = pageInfo.data.activityDesc;
17 dest.couponPic = pageInfo.data.couponPic; 18 dest.couponPic = pageInfo.data.couponPic;
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 <p class="hidden" id="activityEnded">{{ended}}</p> 9 <p class="hidden" id="activityEnded">{{ended}}</p>
10 <p class="hidden" id="newUser">{{newUser}}</p> 10 <p class="hidden" id="newUser">{{newUser}}</p>
11 <p class="hidden" id="tipMessage">{{message}}</p> 11 <p class="hidden" id="tipMessage">{{message}}</p>
  12 + <p class="hidden" id="activityID">{{activityID}}</p>
12 <div class="page"> 13 <div class="page">
13 <div class="gain-coupon-centent hidden"> 14 <div class="gain-coupon-centent hidden">
14 <div class="coupon"> 15 <div class="coupon">
@@ -5,7 +5,8 @@ var $ = require('yoho-jquery'), @@ -5,7 +5,8 @@ var $ = require('yoho-jquery'),
5 orderCode = $('#orderCode').html(), 5 orderCode = $('#orderCode').html(),
6 oldUserCouponPic = $('#oldUserCouponPic').html(), 6 oldUserCouponPic = $('#oldUserCouponPic').html(),
7 newUserCouponPic = $('#newUserCouponPic').html(), 7 newUserCouponPic = $('#newUserCouponPic').html(),
8 - tipMessage = $('#tipMessage').html(); 8 + tipMessage = $('#tipMessage').html(),
  9 + activityID = $('#activityID').html();
9 10
10 $('#phone').bind('input propertychange', function() { 11 $('#phone').bind('input propertychange', function() {
11 if ($(this).val().length === 11) { 12 if ($(this).val().length === 11) {
@@ -47,11 +48,11 @@ $('.input-content').on('click', '.verification-code', function() { @@ -47,11 +48,11 @@ $('.input-content').on('click', '.verification-code', function() {
47 reg = /[0-9]{11}/; 48 reg = /[0-9]{11}/;
48 if (!reg.test(phone)) { 49 if (!reg.test(phone)) {
49 $('#dialog').removeClass('hidden'); 50 $('#dialog').removeClass('hidden');
50 - $('.keep-out').removeClass('hidden'); 51 + $('.mask').removeClass('hidden');
51 $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>'); 52 $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>');
52 setTimeout(function() { 53 setTimeout(function() {
53 $('.messages').addClass('hidden'); 54 $('.messages').addClass('hidden');
54 - $('.keep-out').addClass('hidden'); 55 + $('.mask').addClass('hidden');
55 $('#dialog .content').html(' '); 56 $('#dialog .content').html(' ');
56 }, 1400); 57 }, 1400);
57 return; 58 return;
@@ -65,6 +66,12 @@ $('.input-content').on('click', '.verification-code', function() { @@ -65,6 +66,12 @@ $('.input-content').on('click', '.verification-code', function() {
65 dataType: 'json', 66 dataType: 'json',
66 success: function(data) { 67 success: function(data) {
67 if (data.result.code === 200) { 68 if (data.result.code === 200) {
  69 + if (window._yas) {
  70 + window._yas.sendCustomInfo({
  71 + activityID: activityID,
  72 + returnCode: data.result.returnCode
  73 + }, false);
  74 + }
68 if (!data.result.newUser) { 75 if (!data.result.newUser) {
69 $('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic); 76 $('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic);
70 } else { 77 } else {
@@ -76,48 +83,48 @@ $('.input-content').on('click', '.verification-code', function() { @@ -76,48 +83,48 @@ $('.input-content').on('click', '.verification-code', function() {
76 } else if (data.result.geted) { 83 } else if (data.result.geted) {
77 $('.page .gain-coupon-centent').removeClass('hidden'); 84 $('.page .gain-coupon-centent').removeClass('hidden');
78 $('.page .coupon-centent').addClass('hidden'); 85 $('.page .coupon-centent').addClass('hidden');
79 - $('#mobile').html('优惠券已发放至账户' + data.result.mobile); 86 + $('#mobile').html('优惠券已放至' + data.result.mobile);
80 } else if (data.result.newUser) { 87 } else if (data.result.newUser) {
81 $('.coupon-centent .phone-input-content').addClass('hidden'); 88 $('.coupon-centent .phone-input-content').addClass('hidden');
82 $('.coupon-centent .vertify-input-content').removeClass('hidden'); 89 $('.coupon-centent .vertify-input-content').removeClass('hidden');
83 } else if (data.result.wrongNumb) { 90 } else if (data.result.wrongNumb) {
84 $('#dialog').removeClass('hidden'); 91 $('#dialog').removeClass('hidden');
85 - $('.keep-out').removeClass('hidden'); 92 + $('.mask').removeClass('hidden');
86 $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>'); 93 $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>');
87 setTimeout(function() { 94 setTimeout(function() {
88 $('.messages').addClass('hidden'); 95 $('.messages').addClass('hidden');
89 - $('.keep-out').addClass('hidden'); 96 + $('.mask').addClass('hidden');
90 $('#dialog .content').html(' '); 97 $('#dialog .content').html(' ');
91 }, 1400); 98 }, 1400);
92 return; 99 return;
93 } else if (data.result.oldUserAskCouponOnceMore) { 100 } else if (data.result.oldUserAskCouponOnceMore) {
94 $('#dialog').removeClass('hidden'); 101 $('#dialog').removeClass('hidden');
95 - $('.keep-out').removeClass('hidden'); 102 + $('.mask').removeClass('hidden');
96 $('#dialog .content').html('<p class="phone-error">您今天已经领过咯,速度去有货购潮流!<p>'); 103 $('#dialog .content').html('<p class="phone-error">您今天已经领过咯,速度去有货购潮流!<p>');
97 setTimeout(function() { 104 setTimeout(function() {
98 $('.messages').addClass('hidden'); 105 $('.messages').addClass('hidden');
99 - $('.keep-out').addClass('hidden'); 106 + $('.mask').addClass('hidden');
100 $('#dialog .content').html(' '); 107 $('#dialog .content').html(' ');
101 $('.page .gain-coupon-centent').removeClass('hidden'); 108 $('.page .gain-coupon-centent').removeClass('hidden');
102 $('.page .coupon-centent').addClass('hidden'); 109 $('.page .coupon-centent').addClass('hidden');
103 - $('#mobile').html('优惠券已发放至账户' + data.result.mobile); 110 + $('#mobile').html('优惠券已放至' + data.result.mobile);
104 }, 2500); 111 }, 2500);
105 return; 112 return;
106 } 113 }
107 } else { 114 } else {
108 $('#dialog').removeClass('hidden'); 115 $('#dialog').removeClass('hidden');
109 - $('.keep-out').removeClass('hidden'); 116 + $('.mask').removeClass('hidden');
110 $('#dialog .content').html('<p class="phone-error">网络错误<p>'); 117 $('#dialog .content').html('<p class="phone-error">网络错误<p>');
111 setTimeout(function() { 118 setTimeout(function() {
112 $('.messages').addClass('hidden'); 119 $('.messages').addClass('hidden');
113 - $('.keep-out').addClass('hidden'); 120 + $('.mask').addClass('hidden');
114 $('#dialog .content').html(' '); 121 $('#dialog .content').html(' ');
115 }, 1400); 122 }, 1400);
116 } 123 }
117 }, 124 },
118 error: function(data) { 125 error: function(data) {
119 $('#dialog').removeClass('hidden'); 126 $('#dialog').removeClass('hidden');
120 - $('.keep-out').removeClass('hidden'); 127 + $('.mask').removeClass('hidden');
121 $('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>'); 128 $('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>');
122 console.log(data); 129 console.log(data);
123 } 130 }
@@ -136,6 +143,12 @@ $('.input-content').on('click', '.get', function() { @@ -136,6 +143,12 @@ $('.input-content').on('click', '.get', function() {
136 dataType: 'json', 143 dataType: 'json',
137 success: function(data) { 144 success: function(data) {
138 if (data.result.code === 200) { 145 if (data.result.code === 200) {
  146 + if (window._yas) {
  147 + window._yas.sendCustomInfo({
  148 + activityID: activityID,
  149 + returnCode: data.result.returnCode
  150 + }, false);
  151 + }
139 if (!data.result.newUser) { 152 if (!data.result.newUser) {
140 $('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic); 153 $('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic);
141 } else { 154 } else {
@@ -153,31 +166,31 @@ $('.input-content').on('click', '.get', function() { @@ -153,31 +166,31 @@ $('.input-content').on('click', '.get', function() {
153 $('.coupon-centent .vertify-input-content').removeClass('hidden'); 166 $('.coupon-centent .vertify-input-content').removeClass('hidden');
154 } else if (data.result.wrongNumb) { 167 } else if (data.result.wrongNumb) {
155 $('#dialog').removeClass('hidden'); 168 $('#dialog').removeClass('hidden');
156 - $('.keep-out').removeClass('hidden'); 169 + $('.mask').removeClass('hidden');
157 $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>'); 170 $('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>');
158 setTimeout(function() { 171 setTimeout(function() {
159 $('.messages').addClass('hidden'); 172 $('.messages').addClass('hidden');
160 - $('.keep-out').addClass('hidden'); 173 + $('.mask').addClass('hidden');
161 $('#dialog .content').html(' '); 174 $('#dialog .content').html(' ');
162 }, 1400); 175 }, 1400);
163 return; 176 return;
164 } else if (data.result.vertifyWrong) { 177 } else if (data.result.vertifyWrong) {
165 $('#dialog').removeClass('hidden'); 178 $('#dialog').removeClass('hidden');
166 - $('.keep-out').removeClass('hidden'); 179 + $('.mask').removeClass('hidden');
167 $('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>'); 180 $('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>');
168 setTimeout(function() { 181 setTimeout(function() {
169 $('.messages').addClass('hidden'); 182 $('.messages').addClass('hidden');
170 - $('.keep-out').addClass('hidden'); 183 + $('.mask').addClass('hidden');
171 $('#dialog .content').html(' '); 184 $('#dialog .content').html(' ');
172 }, 1400); 185 }, 1400);
173 return; 186 return;
174 } else if (data.result.oldUserAskCouponOnceMore) { 187 } else if (data.result.oldUserAskCouponOnceMore) {
175 $('#dialog').removeClass('hidden'); 188 $('#dialog').removeClass('hidden');
176 - $('.keep-out').removeClass('hidden'); 189 + $('.mask').removeClass('hidden');
177 $('#dialog .content').html('<p class="phone-error">您今天已经领过咯,速度去有货购潮流!<p>'); 190 $('#dialog .content').html('<p class="phone-error">您今天已经领过咯,速度去有货购潮流!<p>');
178 setTimeout(function() { 191 setTimeout(function() {
179 $('.messages').addClass('hidden'); 192 $('.messages').addClass('hidden');
180 - $('.keep-out').addClass('hidden'); 193 + $('.mask').addClass('hidden');
181 $('#dialog .content').html(' '); 194 $('#dialog .content').html(' ');
182 $('.page .gain-coupon-centent').removeClass('hidden'); 195 $('.page .gain-coupon-centent').removeClass('hidden');
183 $('.page .coupon-centent').addClass('hidden'); 196 $('.page .coupon-centent').addClass('hidden');
@@ -189,51 +202,51 @@ $('.input-content').on('click', '.get', function() { @@ -189,51 +202,51 @@ $('.input-content').on('click', '.get', function() {
189 // oldUserAskCouponOnceMore 202 // oldUserAskCouponOnceMore
190 } else { 203 } else {
191 $('#dialog').removeClass('hidden'); 204 $('#dialog').removeClass('hidden');
192 - $('.keep-out').removeClass('hidden'); 205 + $('.mask').removeClass('hidden');
193 $('#dialog .content').html('<p class="phone-error">' + data.result.message + '<p>'); 206 $('#dialog .content').html('<p class="phone-error">' + data.result.message + '<p>');
194 setTimeout(function() { 207 setTimeout(function() {
195 $('.messages').addClass('hidden'); 208 $('.messages').addClass('hidden');
196 - $('.keep-out').addClass('hidden'); 209 + $('.mask').addClass('hidden');
197 $('#dialog .content').html(' '); 210 $('#dialog .content').html(' ');
198 }, 1400); 211 }, 1400);
199 } 212 }
200 }, 213 },
201 error: function(data) { 214 error: function(data) {
202 $('#dialog').removeClass('hidden'); 215 $('#dialog').removeClass('hidden');
203 - $('.keep-out').removeClass('hidden'); 216 + $('.mask').removeClass('hidden');
204 $('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>'); 217 $('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>');
205 console.log(data); 218 console.log(data);
206 } 219 }
207 }); 220 });
208 } else { 221 } else {
209 $('#dialog').removeClass('hidden'); 222 $('#dialog').removeClass('hidden');
210 - $('.keep-out').removeClass('hidden'); 223 + $('.mask').removeClass('hidden');
211 $('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>'); 224 $('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>');
212 setTimeout(function() { 225 setTimeout(function() {
213 $('.messages').addClass('hidden'); 226 $('.messages').addClass('hidden');
214 - $('.keep-out').addClass('hidden'); 227 + $('.mask').addClass('hidden');
215 $('#dialog .content').html(' '); 228 $('#dialog .content').html(' ');
216 }, 1400); 229 }, 1400);
217 } 230 }
218 }); 231 });
219 $('.close').on('click', function() { 232 $('.close').on('click', function() {
220 $('.dialog').addClass('hidden'); 233 $('.dialog').addClass('hidden');
221 - $('.keep-out').addClass('hidden'); 234 + $('.mask').addClass('hidden');
222 $('#dialog .content').html(' '); 235 $('#dialog .content').html(' ');
223 }); 236 });
224 $('.coupon-description span').on('click', function() { 237 $('.coupon-description span').on('click', function() {
225 $('#message').removeClass('hidden'); 238 $('#message').removeClass('hidden');
226 - $('.keep-out').removeClass('hidden'); 239 + $('.mask').removeClass('hidden');
227 }); 240 });
228 $('.description').on('click', function() { 241 $('.description').on('click', function() {
229 $('#message').removeClass('hidden'); 242 $('#message').removeClass('hidden');
230 - $('.keep-out').removeClass('hidden'); 243 + $('.mask').removeClass('hidden');
231 }); 244 });
232 245
233 $('.input-content').on('click', '.get', function() { 246 $('.input-content').on('click', '.get', function() {
234 if (window._yas) { 247 if (window._yas) {
235 window._yas.sendCustomInfo({ 248 window._yas.sendCustomInfo({
236 - receiveCoupon: 'Y' 249 + activityID: activityID
237 }, true); 250 }, true);
238 } 251 }
239 }); 252 });
@@ -101,9 +101,9 @@ @@ -101,9 +101,9 @@
101 .clear-input { 101 .clear-input {
102 position: absolute; 102 position: absolute;
103 padding: 10px; 103 padding: 10px;
104 - top: 25px; 104 + top: 0.4rem;
105 right: 50px; 105 right: 50px;
106 - font-size: 18px; 106 + font-size: 28px;
107 color: #666; 107 color: #666;
108 z-index: 1; 108 z-index: 1;
109 } 109 }
@@ -160,7 +160,6 @@ @@ -160,7 +160,6 @@
160 background: #444; 160 background: #444;
161 color: #fff; 161 color: #fff;
162 text-align: center; 162 text-align: center;
163 - font-size: 28px;  
164 border-radius: 4px; 163 border-radius: 4px;
165 } 164 }
166 165
@@ -178,6 +177,7 @@ @@ -178,6 +177,7 @@
178 177
179 a { 178 a {
180 color: #fff; 179 color: #fff;
  180 + font-size: 28px;
181 } 181 }
182 } 182 }
183 183
@@ -188,8 +188,7 @@ @@ -188,8 +188,7 @@
188 background: #fff; 188 background: #fff;
189 border-radius: 0.6rem; 189 border-radius: 0.6rem;
190 left: 8%; 190 left: 8%;
191 - top: 45%;  
192 - margin-top: -7rem; 191 + top: 235px;
193 z-index: 2; 192 z-index: 2;
194 } 193 }
195 194
@@ -270,6 +269,7 @@ @@ -270,6 +269,7 @@
270 269
271 .messages p { 270 .messages p {
272 line-height: 4rem; 271 line-height: 4rem;
  272 + font-size: 24px;
273 } 273 }
274 274
275 .tip-wrap { 275 .tip-wrap {