zhaojs
2023-07-18 d9855f9fd12345ed330dc82b431e7e1680ada806
public/html/activity/invite2308.html
@@ -27,7 +27,6 @@
     .top_time
     {
        position: absolute;
        z-index: 99;
        color: #91261E;
        width: 100%;
        height: 20px;
@@ -38,7 +37,6 @@
     .mid_count
     {
        position: absolute;
        z-index: 99;
        color: #91261E;
        width: 100%;
        height: 20px;
@@ -49,7 +47,6 @@
     }
     .top_txt{
        position: absolute;
        z-index: 99;
        color: #91261E;
        width: 100%;
        height: 20px;
@@ -92,22 +89,134 @@
        .tbl div:last-child {
            border-right: 0;
        }
        .gz_txt
        {
            position: absolute;
            font-size: 12px;
            top: 4.3rem;
            width: 73%;
            font-size: 0.2rem;
            font-weight: 500;
        }
        .shadow {
            position: fixed;
            top: 0;
            height: 100vh;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: rgba(0, 0, 255, 0.3)
         }
            .popup {
            margin: 0 auto;
            height: 6rem;
            width: 6rem;
            background: #FFFF;
            border-radius: .3rem;
                overflow: overlay;
         }
            .popupCongratulate {
            text-align: center;
            font-size: .30rem;
            font-weight: bold;
         }
            .popupSon {
                margin: 0 auto;
                font-size: .2rem;
                text-align: center;
                padding: 0.1rem;
                text-align: left;
         }
            .popclose
            {
                width: 5.7rem;
                text-align: right;
                font-size: 12px;
                padding-top: 0.1rem;
                font-size: 0.3rem;
                font-weight: 800;
                position: fixed;
            }
            .gzbtn
            {
                position: absolute;
                font-size: 0.25rem;
                border-radius: 0.2rem;
                top: 0.65rem;
                right: 0.4rem;
                width: 1.3rem;
                text-align: center;
                font-weight: 600;
                background: #664b4ba6;
                color: #fff;
                padding: 0.04rem;
            }
   .btngo
    {
        position: fixed;
        width: 100%;
        bottom: 1px;
        text-align: center;
    }
    .loading{
        display: flex;
        position: fixed;
        width: 100vw;
        height: 100vh;
        background: rgb(0 0 0 / 67%);
        top: 0;
        left: 0;
        z-index: 10;
        justify-content: center;
        align-items: center;
        font-size: .35rem;
        color: #fff;
        }
        .appback-img
{
    position: absolute;
    top: 0.6rem;
    z-index: 999;
    width: 0.6rem;
    left: 0.3rem;
}
.box
        {
            position:absolute;
            width: 100%;
            height: 100%;
            background: url(https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/h5loading.gif) no-repeat fixed top;
            background-size: 70px 70px;
        }
        .list{
            position: relative;
            top: 0;
            width: 100%;
        }
    </style>
</head>
<body style="background: #f5f5f9; margin: 0px;font-size: 0;">
    <div class="box">
        <div class="list">
    <div id="inviteact">
        <div v-if="loading" class="loading">{{loadingTxt}}</div>
        <image v-on:click="topBack()" class="appback-img" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/h5return_backIcon.png"></image>
        <div class="act_po">
            <div class="gzbtn" v-on:click="showgz()">活动规则</div>
            <image class="com_img" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/act_invite_230717_01.png"></image>
            <div class="top_time">
                2023年8月1日9:00-2023年8月31日23:59:59
            </div>
        </div>
        <div class="act_po">
            <div class="top_txt">已邀请的人数</div>
            <div class="top_txt">已邀请的人数{{joinInfo.membercount}}</div>
            <image class="com_img" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/act_invite_230717_02.png"></image>
            <div class="mid_count">
                当前已解锁的红包金额:1000
                当前已解锁的红包金额:{{joinInfo.award}}
            </div>
        </div>
        <div class="act_po">
@@ -120,38 +229,68 @@
                        <div class="cell" style="justify-content:left;">用户id</div>
                        <div class="cell">邀请人数</div>
                    </div>
                    <div class="tbl">
                        <div class="cell" style="justify-content:left;">1</div>
                        <div class="cell" style="justify-content:left;">xxx</div>
                        <div class="cell">500</div>
                    <div class="tbl" v-for="(item,index) in ranklist">
                        <div class="cell" style="justify-content:left;">
                            <image v-if="index==0" style="width: 38%;" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/actno1.png"></image>
                            <image v-else-if="index==1" style="width: 38%;" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/actno2.png"></image>
                            <image v-else-if="index==2" style="width: 38%;" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/actno3.png"></image>
                            <span v-else>{{index+1}}</span>
                        </div>
                        <div class="cell" style="justify-content:left;">
                            <image style="width: 24%; margin-right:0.1rem" :src="item.avatar"></image>
                            {{"**"+item.nickname.substr(item.nickname.length-1)}}
                        </div>
                        <div class="cell">{{item.recruit_count}}</div>
                    </div>
                    <div class="tbl">
                        <div class="cell" style="justify-content:left;">1</div>
                        <div class="cell" style="justify-content:left;">xxx</div>
                        <div class="cell">500</div>
                    </div>
                    <div class="tbl">
                        <div class="cell" style="justify-content:left;">1</div>
                        <div class="cell" style="justify-content:left;">xxx</div>
                        <div class="cell">500</div>
                    </div>
                    <div class="tbl">
                        <div class="cell" style="justify-content:left;">1</div>
                        <div class="cell" style="justify-content:left;">xxx</div>
                        <div class="cell">500</div>
                    </div>
                    <div class="tbl">
                        <div class="cell" style="justify-content:left;">1</div>
                        <div class="cell" style="justify-content:left;">xxx</div>
                        <div class="cell">500</div>
                    </div>
                </div>
                
            </div>
        </div>
        <div>
        <div class="act_po" style="    display: flex;justify-content: center;">
            <image class="com_img" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/act_invite_230717_04.png"></image>
            <div class="gz_txt">
                <p>
                    1、本次活动将在次月1号进行统计结算,结算邀请人数的时间范围为参加活动的时间至活动结束时间
                </p>
                <p>2、活动奖励会在结算后直接发放到用户【我的】-【余额】中</p>
                <p>3、有效粉丝定义:指活动期间,报名该活动后邀请注册并填写您邀请码的用户</p>
            </div>
        </div>
        <div v-if="showType" class="shadow">
            <div class="popup">
                <div class="popclose" v-on:click="closegz()">X</div>
                <div class="popupCongratulate"> 活动规则 </div>
                <div class="popupSon">
                    <p>
                        1、本次活动将在次月1号进行统计结算,结算邀请人数的时间范围为参加活动的时间至活动结束时间
                    </p>
                    <p>2、活动奖励会在结算后直接发放到用户【我的】-【余额】中</p>
                    <p>3、有效粉丝定义:指活动期间,报名该活动后邀请注册并填写您邀请码的用户</p>
                    <p>4、同一设备号、同一手机号、同一淘宝授权号等均视为同一用户</p>
                    <p>5、活动设置反作弊机制,凡参加本次活动,必须遵守活动的相关规则,不得使用任何包括但不限于舞弊、扰乱系统、侵犯第三方合法权益等手段以谋求奖励。一经证实用户在活动中使用任何不正当作弊手段恶意刷取奖励,平台有权删除用户活动的相关记录,取消您参加活动的资格,平台将直接取消本次活动所有权益。同时,平台保留追究其法律责任的权利。平台会在本次邀粉结算前统计分析新粉丝质量,如出现异常数据,平台会要求邀请者出示真实的邀粉凭证才予以结算,异常包括但不限于出现大规模的非常规时间注册用户、同一时间批量注册、连号手机号码注册、新粉丝次日留存率极低等情况,为保护广大邀请者的权益,请各邀请用户保留不低于活动邀粉数*30%的真实的邀粉凭证,能证明真实邀粉的邀粉视频、照片等均可,以防平台进行反作弊筛查。</p>
                    <p>
                    6、本次活动中所称作弊行为,包括但不限于:
                        (1)用户通过第三方平台发布粉丝注册任务、任何形式的付费买粉、机器刷粉、通过开通关联小号进行邀粉;
                        (2)同一用户或者IP地址注册多个账号,利用专业软件或者人工方法违反活动规则以获取更多奖励的行为;
                        (3)同一用户盗用、借用他人已有账号参与活动或者盗用、借用他人信息注册账号参与活动以获取更多奖励的行为;
                        (4)恶意利用活动规则或技术漏洞刷奖的行为;
                        (5)批量注册用户、用机器注册账户、用机器模拟客广端的行为;
                        (6)平台有合理理由认定用户在活动中的其他作弊行为;
                        (7)新粉丝使用虚拟运营商号码、使用同一设备号注册或同一授权淘宝号下单、刷单或下单商品为虚拟商品(充值、代拍、刷好评、电子文档、公益捐款)或下单商品重合度≥30%。
                    </p>
                </div>
            </div>
        </div>
        <div v-if="isShowcj" class="btngo" v-on:click="joinAct()">
            <image style="width: 70%;" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/invite_btn.png"></image>
        </div>
    </div>
    </div>
    </div>
</body>
@@ -179,13 +318,218 @@
          //posturl:'http://dfg.shop.com',
          posturl:'https://appapitest.ushopvip.com',
          //posturl:'http://dfgapp.ushopvip.com',
          activityid:'3432534sdsd',
          loadingTxt:'加载中...',
          loading:true,
          showType:false,
          isShowcj:false,
          joinInfo:{},
          ranklist:[]
        },
        methods:{
            topBack:function()
            {
                uni.postMessage({
                      data: {
                         action: 'back'
                      }
                });
            },
            closegz:function()
            {
                this.showType=false;
            },
            showgz:function()
            {
                this.showType=true;
            },
            getActivity()
            {
                var _this = this;
                $.ajax({
                        headers:{
                            "token":_this.getUrlPar("token")
                        },
                        url:_this.posturl+'/api/Activity/getActInfo',
                        type:"post",
                        dataType:"json",
                        data:{
                            actid:_this.activityid
                        }
                    }).done(function(res){
                       if(res.data.actstatus==1)
                       {//活动正常
                            _this.isShowcj=res.data.joinstatus==0;
                            _this.loading=false;
                            _this.getPaiHang();
                            if(res.data.joinstatus==1)
                            {//活动参加的活动信息
                                _this.getActMember();
                            }
                            else{
                                //未参加过活动
                                _this.isShowcj=true;
                            }
                       }
                       else{
                            switch(res.data.actstatus)
                            {
                                case 0:
                                    _this.loadingTxt='活动不存在';
                                    break;
                                case -1:
                                case -3:
                                    _this.loadingTxt='活动已结束';
                                    break;
                                    case -2:
                                    _this.loadingTxt='活动未开始';
                                    break;
                                default:
                                _this.loadingTxt='活动异常';
                                    break;
                            }
                       }
                    })
            },
            getActMember:function()
            {
                var _this = this;
                $.ajax({
                        headers:{
                            "token":_this.getUrlPar("token")
                        },
                        url:_this.posturl+'/api/Activity/getActRecruitCount',
                        type:"post",
                        dataType:"json",
                        data:{
                            actid:_this.activityid
                        }
                    }).done(function(res){
                        _this.joinInfo=res.data;
                    })
            },
            getUrlPar:function(name)
            {
                var reg=new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                 var r=window.location.search.substr(1).match(reg);
                if(r !=null)return unescape(r[2]);
                 return null;
            },
            //参加活动
            joinAct:function()
            {
                var _this = this;
                _this.loadingTxt="加载中...";
                _this.loading=true;
                $.ajax({
                        headers:{
                            "token":_this.getUrlPar("token")
                        },
                        url:_this.posturl+'/api/Activity/attendAct',
                        type:"post",
                        dataType:"json",
                        data:{
                            actid:_this.activityid
                        }
                    }).done(function(res){
                        _this.loading=false;
                       if(res.code==0)
                       {
                        alert("参加成功!");
                        _this.getActMember();
                       }
                       else
                       {
                        alert("活动参加失败,请联系客服");
                       }
                    })
            },
            getPaiHang:function()
            {//获取排行
                var _this = this;
                $.ajax({
                        headers:{
                            "token":_this.getUrlPar("token")
                        },
                        url:_this.posturl+'/api/Activity/getRankingList',
                        type:"post",
                        dataType:"json",
                        data:{
                            actid:_this.activityid
                        }
                    }).done(function(res){
                       if(res.code==0)
                       {
                        _this.ranklist=res.data;
                       }
                    })
            },
            touch:function()
            {
                const box = document.querySelector('.box')
                const list = document.querySelector('.list');
                // 按下屏幕的位置
                let touchStartPosition = 0
                // touchstart事件
                box.addEventListener('touchstart', function (e) {
                    let touch = e.touches[0]
                    touchStartPosition = touch.pageY
                })
                // touchmove事件
                box.addEventListener('touchmove', function (e) {
                    let touch = e.touches[0]
                    // 列表的top值等于列表相对于box的偏移量+滑动的距离
                    let pySize= list.offsetTop + touch.pageY - touchStartPosition;
                    if(pySize>=110)
                    {
                      return;
                    }
                    if(pySize<0)
                    {
                        return;
                    }
                    var scroll = document.getElementsByClassName('contscore')
                        var srollPos = $('.contscore').scrollTop(); //滚动条距顶部距离(页面超出窗口的高度)
                    if(srollPos>0)
                    {
                        return;
                    }
                    list.style.top =pySize + 'px';
                    // 实现平滑的滑动
                    touchStartPosition = touch.pageY
                })
                // touchend事件
                box.addEventListener('touchend', function (e) {
                    let top = list.offsetTop
                    if (top > 70) {
                        // 在此处调用刷新后的回调
                        console.log('刷新');
                        location.reload();
                    }
                    if(top<0)
                    {
                        list.style.top=0;
                    }
                    if (top > 0) {
                        // 通过定时器平滑的将list的top = 0
                        let timer = setInterval(() => {
                            top=top-5;
                        list.style.top = top + 'px'
                        if (top <= 0) {
                            list.style.top=0;
                            clearInterval(timer)
                        }
                        },1)
                    }
                })
            },
        },
        mounted:function(){
           this.getActivity();
           this.touch();
        }
    })
</script>