123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>活动-每日领取红包-创业帮</title>
- <meta name="keywords" content="活动-每日领取红包-创业帮">
- <meta name="description" content="活动-每日领取红包-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="活动-每日领取红包-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- <style>
- .raffle .task-btn .receive,
- .raffle .task-btn .unreceive{
- width:1.56rem;
- }
- @keyframes popMove {0%{left:100%}100%{left:-80%}}
- .popMove{animation:popMove 6s linear}
- .popups .warp{left:100%;}
- .van-sticky--fixed .mt1{ margin-top:.1067rem;background-color:transparent !important;}
- .noup{top:-100%!important;}
- .raffle {background-image:linear-gradient(to bottom, #89275d 10%, #f63d45 20%) !important;}
- .raffle .iphonetitle {
- background-image: radial-gradient(center bottom, ellipse cover, #b94468, #89275d) !important;
- background-image: -o-radial-gradient(center bottom, ellipse cover, #b94468, #89275d) !important;
- background-image: -ms-radial-gradient(center bottom, ellipse cover, #b94468, #89275d) !important;
- background-image: -moz-radial-gradient(center bottom, ellipse cover, #b94468, #89275d) !important;
- background-image: -webkit-radial-gradient(center bottom, ellipse cover, #b94468, #89275d) !important;
- }
- .raffle .task-container{margin-top:.4267rem}
- .rank-container .van-sticky--fixed{width:94%;margin:0 auto;padding:0 .32rem;box-sizing: border-box;}
- .raffle .rank-container .rankmain{ height:.9rem !important;}
- .raffle .rank-container .rank1,
- .raffle .rank-container .rank2,
- .raffle .rank-container .rank3 {margin-top:.213333rem;height:1.04rem !important;}
- .raffle .rank-container .rank3 {margin-bottom:.213333rem;}
- </style>
- </head>
- <body class="pb0 ovh raffle">
- <div class="iphonetitle"></div>
- <div class="ovh-x" id="app" v-cloak ref="wrapper1">
- <div class="top-image df rel"><img class="abs icon-logo" src="./static/images/active/raffle/raffle-active-logo.png" alt="">
- <van-sticky class="top-panel abs" :offset-top="topheight">
- <div>
- <div class="abs top-icon icon-right mt1" @click="refresh"><img src="./static/images/active/raffle/raffle-active-refresh.png" alt=""></div>
- <div class="abs top-icon icon-left mt1" @click="backbtn"><img src="./static/images/active/raffle/raffle-active-back.png" alt=""></div><img class="abs top-font mt12" src="./static/images/active/raffle/raffle-title.png" alt="">
- </div>
- </van-sticky>
- <div class="abs top-icon icon-left icon-sec" @click="rules"><img src="./static/images/active/raffle/raffle-active-rules.png" alt=""></div>
- <div class="abs top-icon icon-right icon-sec" @click="record"><img src="./static/images/active/raffle/raffle-active-record.png" alt=""></div>
- <div class="popups abs" ref="contaner">
- <div class="df abs warp" v-for="pop,index in scrollQuene" :key="pop.id" :ref="'pop' + pop.id" :class="'class' + pop.id">
- <div class="linnerBox-right"> <img src="./static/images/active/raffle/redpokect.png" alt="alt" width="80%"></div>
- <div class="popItem cfff f10">{{pop.text}}</div>
- <div class="linnerBox-left"> </div>
- </div>
- </div><img class="bg raffle-bg" src="./static/images/active/raffle/raffle-top-background-image.png" alt="">
- <div class="cfff f14 abs datetitle">第{{nowactive}}期 | 每晚22:00开奖</div>
- <div class="couponcode abs"><img class="outleft1" src="./static/images/active/raffle/raffle-code.png" alt=""><img class="outleft2" src="./static/images/active/raffle/raffle-code.png" alt=""><img class="outright1" src="./static/images/active/raffle/raffle-code.png" alt=""><img class="outright2" src="./static/images/active/raffle/raffle-code.png" alt=""><img class="outcenter1" src="./static/images/active/raffle/raffle-code.png" alt=""><img class="outcenter2" src="./static/images/active/raffle/raffle-code.png" alt=""></div><img class="hand abs rotatehand" src="./static/images/active/raffle/raffle-hand-code.png" alt="">
- <div class="raffle-container abs"><img class="bg" src="./static/images/active/raffle/raffle-Jackpot.png" alt="">
- <div class="abs rafflecount opcm aic">
- <div class="cfff df">
- <div class="f24 b">888.88</div>
- <div class="f14 df aife mb2 ml4">元</div>
- </div>
- <div class="f10 cfff tc rules">300个红包限量抢</div>
- </div>
- </div><img class="cloud-left abs cloud1" src="./static/images/active/raffle/raffle-cloud-left.png" alt=""><img class="cloud-right abs cloud2" src="./static/images/active/raffle/raffle-cloud-right.png" alt="">
- <div class="award-container abs df">
- <div class="award award-code rel" @click="showFilter = true"><img class="bg" src="./static/images/active/raffle/raffle-award-code.png" alt="">
- <div class="abs opcm aic tc">
- <div class="df">
- <div class="f14 df aife mb2 ml4" v-if="creatorinfo.StaStatus">已达标</div>
- <div class="f14 df aife mb2 ml4" v-else>未达标</div>
- </div>
- <div class="f10">本期任务</div>
- </div>
- </div>
- <div class="award award-code-notin rel" @click="record"><img class="bg" src="./static/images/active/raffle/raffle-award-code-notin.png" alt="">
- <div class="abs opcm aic">
- <div class="df">
- <div class="f14 df aife mb2">{{creatorinfo.PreStatus ? '上期已参与':'上期未参与'}}</div>
- </div>
- <div class="f10">参与记录</div>
- </div>
- </div>
- </div>
- </div>
- <div class="radial-gradient"></div>
- <div class="task-container df bbox jcsb">
- <div class="df mr8"><img class="task-icon mr8" src="./static/images/active/raffle/raffle-task-icon.png" alt="">
- <div class="task-main">
- <div class="c333 b f14">做任务 抢红包</div>
- <div class="c333 mb f12 mt12 mb6 spc">激活抢红包</div>
- <div class="c999 mb f10">当日00:00-21:59 激活机具即可达标,300个红包抢完即止,每期限领1次</div>
- </div>
- </div>
- <div class="task-btn df aic">
- <div class="tc">
- <div class="c999 f8"> <span class="spcolor">{{time}}</span></div>
- <button class="f10 receive" v-if="creatorinfo.GetStatus === 1" @click="receivefn">领取</button>
- <button class="f10 unreceive" v-if="creatorinfo.GetStatus === 2">已领取</button>
- <button class="f10 unreceive" v-if="creatorinfo.GetStatus === 3">未开始</button>
- <button class="f10 unreceive" v-if="creatorinfo.GetStatus === 4">抢光啦</button>
- <button class="f10 unreceive" v-if="creatorinfo.GetStatus === 0">未达标</button>
- </div>
- </div>
- </div>
- <div class="rank-container bgcfff bbox">
- <van-sticky :offset-top="topheight + 50" style="left:0;right:0;">
- <div class="bgcfff pt8 pb8">
- <div class="f18 c333 tc b">奖金排行榜</div>
- <div class="title f14 df mt20">
- <div @click="rank = 1" :class="rank === 1? 'chosebtn':''">累计奖金榜</div>
- <div class="c999">|</div>
- <div @click="rank = 2" :class="rank === 2? 'chosebtn':''">中奖次数榜</div>
- </div>
- <div class="ranktitle f12 c999 df mt16">
- <div class="tc" style="flex:1">排名</div>
- <div class="tc" style="flex:1">创客</div>
- <div class="tc" style="flex:1.3">创客推荐码</div>
- <div class="tc" style="flex:1.3" v-if="rank === 2">累计中奖次数</div>
- <div class="tc" style="flex:1.3" v-else>累计中奖金额</div>
- </div>
- </div>
- </van-sticky>
- <div class="ranktitle rankmain f12 c999 df mt8 aic" v-if="rank === 1">
- <div class="tc f12 c333" style="flex:1">{{Number(creatorinfo.MyTopInfo1.Num) < 101 && Number(creatorinfo.MyTopInfo1.Num) > 0 ? creatorinfo.MyTopInfo1.Num : '未上榜'}}</div>
- <div class="tc f12 c333" style="flex:1">{{creatorinfo.MyTopInfo1.RealName}}</div>
- <div class="tc f12 c333" style="flex:1.5">{{creatorinfo.MyTopInfo1.MakerCode}}<span class="ml6 f10" style="width:18px; height:100%;background-color:#FFC4C1;border-radius:3px;color:#DD4941;display:inline-block;">我</span></div>
- <div class="tc f12 c333" style="flex:1.3"><span class="f16 c333 b">{{creatorinfo.MyTopInfo1.Data}}</span><span>元</span></div>
- </div>
- <div class="ranktitle rankmain f12 c999 df mt8 aic" v-if="rank === 2">
- <div class="tc f12 c333" style="flex:1">{{Number(creatorinfo.MyTopInfo2.Num) < 101 && Number(creatorinfo.MyTopInfo2.Num) > 0 ? creatorinfo.MyTopInfo2.Num : '未上榜'}}</div>
- <div class="tc f12 c333" style="flex:1">{{creatorinfo.MyTopInfo2.RealName}}</div>
- <div class="tc f12 c333" style="flex:1.5">{{creatorinfo.MyTopInfo2.MakerCode}}<span class="ml6 f10" style="width:18px; height:100%;background-color:#FFC4C1;border-radius:3px;color:#DD4941;display:inline-block;">我</span></div>
- <div class="tc f12 c333" style="flex:1.3"><span class="f16 c333 b">{{creatorinfo.MyTopInfo2.Data}}</span><span>次</span></div>
- </div>
- <div class="ranktitle rankmain f12 c999 df aic" v-for="item,index in ranklist" :key="index" :class="rankfn(index)">
- <div class="tc f12 c999 b" style="flex:1" :class="rankontfn(index)">{{item.Num}}</div>
- <div class="tc f12 c333" style="flex:1">{{item.UserInfo.RealName}}</div>
- <div class="tc f12 c333" style="flex:1.3">{{item.UserInfo.MakerCode}}</div>
- <div class="tc f12 c333" style="flex:1.3"><span class="f16 c333 b">{{item.Data}}</span><span v-if="rank === 2">次</span><span v-else>元</span></div>
- </div>
- </div>
- <van-popup class="receivedialog tc" v-model="receivedialog" :close-on-click-overlay="false">
- <canvas class="canvas abs pagcanvas" id="pag" style="z-index:99;" :class="!PreInfo.MakerCode ? 'noup' : ''"></canvas>
- <van-icon class="abs closebtn" name="./static/images/close-level.png" color="#666" @click="receivedialog = false"> </van-icon><img class="scalc100 title" src="./static/images/active/raffle/raffle-receive-untitle.png" alt="" v-if="!this.count"><img class="scalc100 title" src="./static/images/active/raffle/raffle-receive-title.png" alt="" v-if="this.count">
- <div class="f18 cfff mt16" v-if="this.count">- 抽中奖金 -</div>
- <div class="comtainer rel mt8 width0-100 ovh" v-if="this.count"><img class="w100 vouch" src="./static/images/active/raffle/raffle-card-voucher1.png" alt="">
- <div class="abs opcm c333 f14 w100 opac0-1" style="white-space:nowrap;">恭喜您抽中<span class="f16 spc">{{count}}元</span><span>奖金,已发放至您的创客余额</span></div>
- </div>
- <div class="f18 cfff mt16" v-if="!this.count">- 抢完啦 -</div>
- <div class="comtainer rel mt8 width0-100 ovh" v-if="!this.count"><img class="w100 vouch" src="./static/images/active/raffle/raffle-card-voucher3.png" alt="">
- <div class="abs opcm c333 f14 w100 opac0-1" style="white-space:nowrap;">很抱歉,本期红包已抢完</div>
- </div>
- <div class="f18 cfff mt32" v-if="PreInfo.MakerCode">- 上期最高奖 -</div>
- <div class="comtainer rel mt8 width0-100 ovh" v-if="PreInfo.MakerCode"><img class="w100 vouch" src="./static/images/active/raffle/raffle-card-voucher2.png" alt="">
- <div class="abs c333 f14 w100 opcm opac0-1"><span class="c333 mr12">{{PreInfo.MakerCode}} </span><span class="c333 mr12">{{PreInfo.RealName}}</span><span class="c333 mr12">中得</span><span class="f18 spc">{{PreInfo.PrizeAmt}}</span><span class="spc">元</span></div>
- </div>
- </van-popup>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script src="./static/js/libpag.js"></script>
- <script>
- class Danmaku {
- constructor(option){
- this.id = option.id
- this.text = `创客 ${option.name} 抽中红包 ¥${option.packte}` //内容
- //- this.top = this.getStrack(option.position) //轨道 弹幕吸顶,居中,触底
- this.time = option.time || 5 //运行时间 默认5s
- this.color = option.color //文字颜色
- this.class = '.class' + option.id //文字颜色
- this.struck = { //轨道,轨道位置。是否可加入
- isOK:true,
- top:this.getStrack(option.position)
- }
- }
- getStrack(position = '',poa){
- let struck = null
- if(position == ''){
- let top = Math.floor(Math.random() * 10)
- if(poa === 0 && top>=0 && top<2){ top = 3 };
- if(poa === 20 && top>=2 && top<4){ top = 5 };
- if(poa === 40 && top>=4 && top<6){ top = 7 };
- if(poa === 60 && top>=6 && top<8){ top = 9 };
- if(poa === 80 && top>=8 && top<10){ top = 0 };
- if(top>=0 && top<2) return struck = 0;
- if(top>=2 && top<4) return struck = 20;
- if(top>=4 && top<6) return struck = 40;
- if(top>=6 && top<8) return struck = 60;
- if(top>=8 && top<10) return struck = 80;
- }
- if(position == 'top'){
- return struck = 0;
- }
- if(position == 'center'){
- return struck = 50;
- }
- if(position == 'bottom'){
- return struck = 100;
- }
-
- }
- //- getPosition(weizhi){
- //- if(weizhi == 'top'){
- //- this.top = 0
- //- }
- //- if(weizhi == 'center'){
- //- this.top = 50
- //- }
- //- if(weizhi == 'bottom'){
- //- this.top = 100
- //- }
- //- }
- }
- </script>
- <script>
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- showFilter:false,
- show:false,
- //- 状态栏高度
- topheight:0,
- nowactive:'',
- creatorinfo:{
- GetStatus:3,
- StaStatus:0,
- PreStatus:0,
- MyTopInfo1:{
- MakerCode:'',
- RealName:'',
- Num:11,
- Data:0,
- }
- },
- receive:0,
- count:'',
- rank:1,
- receivedialog:false,
- time:'',
- popList:[
- {
- name:'方**',
- packte:88.88,
- id:1,
- },
- {
- name:'向*',
- packte:55.55,
- id:2,
- },
- {
- name:'刘**',
- packte:28.88,
- id:3,
- },
- {
- name:'谢*',
- packte:8.88,
- id:4,
- },
- {
- name:'刘*',
- packte:4.32,
- id:5,
- },
- {
- name:'魏**',
- packte:4.28,
- id:6,
- },
- {
- name:'潘**',
- packte:62.46,
- id:7,
- },
- {
- name:'桂*',
- packte:23.55,
- id:8,
- },
- {
- name:'张**',
- packte:2.68,
- id:9,
- },
- {
- name:'张**',
- packte:78.66,
- id:10,
- },
- {
- name:'王*',
- packte:54.51,
- id:11,
- },
- {
- name:'吴*',
- packte:1.88,
- id:12,
- },
- {
- name:'胡*',
- packte:42.66,
- id:13,
- },
- {
- name:'向*',
- packte:25.55,
- id:14,
- },
- {
- name:'雷**',
- packte:34.68,
- id:15,
- },
- {
- name:'郭*',
- packte:16.26,
- id:16,
- },
- {
- name:'范**',
- packte:3.55,
- id:17,
- },
- {
- name:'贾*',
- packte:39.08,
- id:18,
- },
- {
- name:'陈*',
- packte:46.26,
- id:19,
- },
- {
- name:'李**',
- packte:65.55,
- id:20,
- },
- ],
- scrollQuene:[],
- ranklist:[
- ],
- PreInfo:{
- },
- isbegin:false,
- lastDanmu:0,
- list2:[],
- }
- },
- created() {
- this.topheightfn();
- this.nowactive = formatDate(new Date().getFullYear(),new Date().getMonth()+1,new Date().getDate());
- //- this.countdown();
- this.getcreatorinfo();
- this.getrank();
- //- this.initPop(this.popList)
- },
- beforeUpdate() {
- this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - this.topheight}px`;
- //- window.requestAnimationFrame(this.createPop())
- },
- computed:{
- },
- watch:{
- rank(){
- this.getrank();
- },
-
- },
- methods: {
- aaa(){
- this.popList.forEach(item=>{
- item.id++;
- });
- },
- //弹幕
- initPop(arr){
- let num = 0;
- arr.forEach((item,index)=>{
- let danmu = new Danmaku(item)
- let warp = this.$refs.contaner;
- setTimeout(()=>{
- num++;
- //- if(this.lastDanmu === danmu.struck.top ){
- //- danmu.struck.top = danmu.getStrack()
- //- console.log('重叠了!',this.lastDanmu,'上一个',danmu.struck.top,'现在');
- //- }
- //- do{
- //- danmu.struck.top = danmu.getStrack();
- //- console.log(this.lastDanmu,danmu.struck.top,60000)
- //- }while (this.lastDanmu === danmu.struck.top);
- if(this.lastDanmu === danmu.struck.top){
- console.log(this.lastDanmu,danmu.struck.top,1);
- danmu.struck.top = danmu.getStrack(danmu.struck.top);
- };
- if(this.lastDanmu === danmu.struck.top){
- console.log(this.lastDanmu,danmu.struck.top,2);
- };
- this.lastDanmu = danmu.struck.top;
- if(num === arr.length){
- this.testaa(danmu,index,true);
- }else{
- this.testaa(danmu,index);
- };
- },Math.random()* arr.length * 1000);
- })
- },
- testaa(danmu,index,islast = false){
- this.scrollQuene.push(danmu)
- setTimeout(()=>{
- this.setPopStyle(danmu)
- this.popMove(danmu,index,islast)
- },100);
- },
- popMove(danmu,index,islast){
- //- let warp = this.$refs.contaner;
- //- let node = document.querySelector(danmu.class);
- let node = this.$refs['pop' + `${danmu.id}`][0];
- node.classList.add('popMove')
- setTimeout(()=>{
- //- node.classList.remove('popMove')
- //- console.log(this.scrollQuene)
- //- this.scrollQuene = this.scrollQuene.splice(0,1);
- //- this.scrollQuene.shift();
- //- console.log(this.scrollQuene);
- //- node.remove();
- //- setTimeout(()=>{this.aaa();this.initPop(this.popList)},1000)
- //- setTimeout(()=>{node.classList.add('popMove')},100)
- },6000)
- if(islast){
- this.initPop(this.popList);
- this.scrollQuene.splice(0,this.scrollQuene.length - 5);
- };
- },
- setPopStyle(danmu){
- let node = this.$refs['pop' + `${danmu.id}`][0];
- node.style = {}
- //- node.style.opacity = '0'
- //- node.style.transition = `transform ${danmu.time}s linear` //运行时间
- //- node.style.transition = `transform 0s linear`
- node.style.color = `${danmu.color}` //内容颜色
- node.style.top = ` ${danmu.struck.top}%` //弹幕垂直方向位置
- //- node.style.transform = `0px`;
- },
- pageffect(url = '') {
- const that = this;
- window.libpag.PAGInit().then(async (PAG) => {
- axios({url,responseType: "blob"}).then(async (response) =>{return response.request.response}).then(async (blob) => {
- let file = new window.File([blob], url.replace(/(.*\/)*([^.]+)/i, '$2'));
- const pagFile = await PAG.PAGFile.load(file);
- document.getElementById('pag').width = document.documentElement.clientWidth;
- document.getElementById('pag').height = document.documentElement.clientWidth;
- const pagView = await PAG.PAGView.init(pagFile, '#pag',{ useCanvas2D: true,useScale: true,firstFrame:true });
- pagView.setRepeatCount(0);
- await pagView.play();
- this.pagView = pagView;
- });
- });
- },
- //- 高度适配函数
- topheightfn(){
- const type = browsertype.versions.ios ? 'ios' : 'android';
- if(type === 'ios'){
- if(isFringe()){
- this.topheight = 48;
- }else{
- this.topheight = 20;
- };
- }else{
- this.topheight = PublicLib.getStatusBarHeight();
- };
- },
- //- 倒计时函数
- countdown(){
- const target = new Date().getFullYear() + '/' + fillzero(new Date().getMonth()+1) + '/' + fillzero(new Date().getDate()) + ' 17:26:00';
- let istimeout = new Date().getTime() > new Date(target).getTime()
- if(istimeout){
- this.time = '';
- this.isbegin = true;
- this.getcreatorinfo();
- }else{
- this.time = this.getundate(target);
- this.isbegin = false;
- };
- const timer = setInterval(()=>{
- istimeout = new Date().getTime() > new Date(target).getTime()
- this.time = this.getundate(target);
- if(istimeout){
- this.time = '';
- clearInterval(timer);
- };
- },1000);
- },
- //- 倒计时处理函数
- getundate(time){
- var nowTime = +new Date(); // 返回的是当前时间总的毫秒数
- var inputTime = +new Date(time); // 返回的是用户输入时间总的毫秒数
- var times = (inputTime - nowTime) / 1000; // times是剩余时间总的秒数
- var h = parseInt(times / 60 / 60 % 24); //时
- h = h < 10 ? '0' + h : h;
- var m = parseInt(times / 60 % 60); //分
- m = m < 10 ? '0' + m : m;
- var s = parseInt(times % 60); // 秒
- s = s < 10 ? '0' + s : s;
- return h + ':' + m + ':' + s; //返回函数计算出的值
- },
- //- 获取创客获奖信息
- async getcreatorinfo(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/activityredpackagejoins/detail?t='+Math.random(6),JSON.stringify({UserId}));
- if(res.status !== '1') return tips(res.info);
- this.creatorinfo = res.data;
-
- },
- //- 获取定时器最后一次创客获奖信息
- async getlastcreatorinfo(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/activityredpackagejoins/detail?t='+Math.random(6),JSON.stringify({UserId}));
- if(res.status !== '1') return tips(res.info);
- this.creatorinfo = res.data;
- this.isbegin = true;
- },
- //- 获取排行榜
- async getrank(){
- const res = await getRequest('api/v1/activityredpackagetop10/list?t='+Math.random(6),JSON.stringify({Kind:this.rank,PageNum:1,PageSize:100}));
- if(res.status !== '1') return tips(res.info);
- this.ranklist = res.data;
- res.data.forEach(item=>{
- if(item.UserInfo.RealName && item.UserInfo.RealName.length === 3){
- item.UserInfo.RealName = item.UserInfo.RealName[0] + '**';
- }else if(item.UserInfo.RealName && item.UserInfo.RealName.length != 3){
- item.UserInfo.RealName = item.UserInfo.RealName[0] + '*';
- }
- })
- if(res.data.length === 0) {
- this.getrank();
- };
- },
- //- 刷新
- refresh:undebounce(async function(){
- await this.getrank();
- await this.getcreatorinfo();
- tips('刷新成功');
- },500),
- //- 领取
- receivefn:undebounce(async function(){
- const that = this;
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await postRequest('api/v1/activityredpackagejoins/getprize?t='+Math.random(6),JSON.stringify({UserId}));
- if(res.status === '-1'){
- return tips(res.info);
- };
- that.receive = 1;
- that.receivedialog = true;
- if(res.status === '2'){
- that.count = null;
- that.PreInfo.PrizeAmt = null;
- }else{
- that.count = res.data.PrizeAmt;
- that.PreInfo = res.data.PreInfo ? res.data.PreInfo : '';
- setTimeout(()=>{
- that.pageffect('./static/pag/active-raffle.pag');
- },300);
- };
- that.getcreatorinfo();
- },500),
- record(){
- PublicLib.Goto({Url:'active-raffle-record'});
- },
- backbtn(){
- PublicLib.GoBack({Level:1});
- },
- //- 排名背景
- rankfn(index){
- if(index === 0) return 'rank1';
- if(index === 1) return 'rank2';
- if(index === 2) return 'rank3';
- },
- rankontfn(index){
- if(index === 0) return 'rankfont1';
- if(index === 1) return 'rankfont2';
- if(index === 2) return 'rankfont3';
- },
- rules(){
- PublicLib.Goto({Url:'active-raffle-rules'});
- },
-
- },
- });
- </script>
- </body>
- </html>
|