|
|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑 7 u, S( X+ v8 B
7 h1 C3 N! j7 R1 C
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。1 G' G1 l" e! @9 p
- // looping fetch3 c/ c8 s. w1 m {, Y
- var once = function(){* p$ Y, _ X O* n# Y9 V
- // original author: https://v2ex.com/t/228164( r4 t; s% K/ z- {$ C; M+ G% f
- (function(window, document) {
. @8 u, S. [6 x) b0 B+ s - var interval = 800;( o, U+ h) H0 y' F: C8 D% P/ T
- var closeDelay = 200;9 D* N; J" M- b1 f7 Y X
- var index = 0;: g' B( e- T* p4 Q
- var couponLinks;$ w4 o8 E- g- ?" L. P. _
- var getCoupon = function() {' a8 |% [& x4 V) t
- if (index >= couponLinks.length) {- a8 t+ ^( }$ @5 |6 [ {/ @
- console.log("领取完毕");
# P- P* p1 s) b+ [/ q7 K1 C - window.once();6 J0 Z, Q1 H7 Z- j
- return;
# W0 r1 J5 U+ o5 @! n- I9 I - }
/ {% m# D! O) z - var coponLink = couponLinks[index];8 }3 k j4 c& i: v7 V8 g
- coponLink.click(); index++;
# Y t' q3 M' S2 Q- P1 } - console.log("领取 第" + index + " 张");
# K& b+ X2 u/ \4 h" @1 i - setTimeout(getCoupon, interval);1 G; S: M: |$ K3 @3 c0 {* y
- setTimeout(function() {
7 B% t! W0 _: n- \) P# _& a( n" } - var close = document.querySelector('.mui-dialog-close');5 Z" d3 i1 O$ M" g" A2 p* Q
- if (close != null) close.click();
+ J, q2 B) z: v7 `' H& b7 `1 l - }, closeDelay);
& c6 p; L5 r o! [4 c5 r J - }# X" i- E- _: R7 x- h4 _; Q
- var _scrollTop = 0;8 V1 T/ G( g4 i
- var _scrollStep = document.documentElement.clientHeight;/ v6 n) b( [. [5 l/ V
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;& T. b$ K+ V) ? L. A# t
- var autoScrollDown = setInterval(function() {& g5 d! @6 E4 M
- _scrollTop += _scrollStep;/ O, ~/ R' H% p/ p
- if (_scrollTop > _maxScrollTop) {
, H. e8 _9 s& C7 ~$ K. o - clearInterval(autoScrollDown);
6 G0 Q2 y8 g* j' j5 {) s! _ - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');! K5 y+ M9 f1 ]% A. y
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
4 y- ~; W8 X/ q5 |% E: I( d; j - getCoupon();" I4 _8 s& G" L2 T: s% J
- } else {$ Z F* s7 f0 x1 i" y
- document.body.scrollTop = _scrollTop;. R6 y. w$ M9 [6 i* G
- }
; Y2 A ~- o) `8 S - }, 500);& F2 E) v9 C: e' f
- }) (window, document);
' r$ B+ h. U3 ]9 |9 f( C - }
4 r3 b* T O2 {/ Z2 h" s - once();
复制代码 9 t0 o M/ X R: d0 A- F8 R
然后领光所有优惠卷了! 0 b/ t2 X! l) B% G! t( A
重要提示:一定要先登录天猫再撸
6 p2 o% u7 J& V Z4 U |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|