friend_give_log.html 10.6 KB

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_0ml90wdq5hzm.css">
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_750594_itt4qc4xfcg.css">
    <link rel="stylesheet" href="__INDEX__/css/base.css">
    <link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
    <script type="text/javascript" src="__INDEX__/js/base.js"></script>
    <title>好友列表</title>
    <style>
        body,html{
            width:100%;
            height:100%;
            background: #fff;
        }
        .fri_list{
            width:7.5rem;
            height:1.2rem;
            padding: 0.2rem 0.32rem;
            display:flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #f5f5f5;
        }
        .friend_img{
            font-size: 0;
            width:0.8rem;
            height:0.8rem;
            border-radius: 50%;
        }
        .friend_img img{
            width:100%;
        }
        .friend_name{
            color:#000000;
            font-size: 0.32rem;
        }
        .sendintegral{
            color:#000000;
            font-size: 0.28rem;
        }
        .search{
            width:4rem;
            height:0.88rem;
            background:#FE0A01;
            border-radius:0.44rem;
            text-align: center;
            line-height: 0.88rem;
            color:#fff;
            font-size: 0.32rem;
            box-shadow:0px 15px 30px 0px rgba(254,10,1,0.24);
            margin: 0 auto;
            margin-top: 1.49rem;

        }

        /*赠送积分弹出层*/
        .sendwrapper{
            width:100%;
            height:100%;
            background-color: rgba(0,0,0,0.5);
            position:fixed;
            left:0;
            right:0;
            z-index: 5;
        }
        .sendpop{
            width:5.2rem;
            height:4.2rem;
            background: #ffffff;
            border-radius: 10px;
            position: absolute;
            z-index: 6;
            /*left:0.4rem;*/
            /*top: 3rem;*/
            top:40%;
            left:50%;
            transform: translate(-50%,-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            overflow: hidden;
            padding-top: 0.36rem;
        }
        .remaininter{
            color:#1A1A1A;
            font-size: 0.28rem;
            margin: 0 auto;
        }
        .give{
            width:4.8rem;
            color:#1A1A1A;
            font-size: 0.28rem;
            font-weight: bold;
            text-align: left;
            margin-top: 0.35rem;
        }
        .enterinter{
            width:4.81rem;
            height:0.7rem;
            border:1px solid rgba(235,235,235,1);
            border-radius:0.05rem;
            font-size: 0;
            margin-top: 0.19rem;
        }
        .pleaseenter{
            width:4.6rem;
            height:0.6rem;
            border-radius:0.05rem;
            font-size: 0.28rem;
            color:#97A0A8;
            border:none;
            outline:none;
            padding-left: 0.23rem;

        }
        .attention{
            color: #97A0A8;
            font-size: 0.24rem;
            height:0.68rem;
            border-bottom: 1px solid #f5f5f5;
            padding: 0.1rem 0.18rem 0.24rem 0.18rem;
            margin-top: 0.1rem;
        }
        .sure{
            color:#FF0000;
            font-size: 0.32rem;
            padding: 0.31rem 1.91rem;
        }

        /*输入密码弹出层*/
        .passwordwrap{
            width:100%;
            height:100%;
            background-color: rgba(0,0,0,0.5);
            position:fixed;
            left:0;
            right:0;
            z-index: 5;
        }
        .passwordpop{
            width:5.2rem;
            height:2.84rem;
            background: #ffffff;
            border-radius: 10px;
            position: absolute;
            z-index: 6;
            /*left:0.4rem;*/
            /*top: 3rem;*/
            top:40%;
            left:50%;
            transform: translate(-50%,-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            overflow: hidden;
            padding-top: 0.16rem;
        }
        .enterpassword{
            display:flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0;
            /*margin-top: 0.48rem;*/
            margin: 0.48rem auto 0;
        }
        .enterpassword li{
            width:0.8rem;
            height:0.8rem;
            list-style: none;
            border:1px solid rgba(153,153,153,1);
            text-align: center;
            border-right:0;
        }
        .enterpassword li:last-child{
            border-right:1px solid rgba(153,153,153,1) ;
        }
        .enterpassword li input{
            width:0.77rem;
            height:0.76rem;
            list-style: none;
            text-align: center;
            border:none;
        }
        .pleaseenterword{
            font-size: 0.32rem;
            color:#1A1A1A;
        }
        .icon-quxiao{
            width:5rem;
            color:#999999;
            font-size: 0.3rem;
            text-align: right;
        }

        #pwd {
            position: absolute;
            left: -22rem;
            bottom:-22rem;
            opacity: 0;
            width: 80%;
            color:#f00;

        }
        .enterword{
            display:flex;
            align-items: center;
        }
    </style>
</head>
<body>
<!--输入支付密码-->
<div class="passwordwrap" style="display:none">
    <div class="passwordpop">
        <p class="iconfont icon-quxiao"></p>
        <p class="pleaseenterword">输入支付密码</p>
        <div class="pwd_box enterword">

            <ul class="password_box enterpassword">
                <li class=""><i></i></li>
                <li><i></i></li>
                <li><i></i></li>
                <li><i></i></li>
                <li><i></i></li>
                <li><i></i></li>
            </ul>
        </div>
    </div>
</div>
<!--好友弹出层-->
<div class="sendwrapper" style="display:none">
    <div class="sendpop">
        <p class="remaininter">您还剩余<span id="BALANCE">{$balance}</span>积分</p>
        <P class="give">赠送好友积分</P>
        <div class="enterinter">
            <input type="text" class="pleaseenter" placeholder="赠送积分为500的倍数"  >
        </div>
        <div class="attention">
            积分赠送属个人操作,赠送错误平台概不负责
        </div>
        <div class="sure">确定赠送</div>
    </div>
</div>
<div class="container">
    <div class="friendlist">
        <volist name="list" id="vo">
        <div class="fri_list" data-id="{$vo.friend_id}">
            <p class="friend_img">
                <img src="{$vo.avatar}" alt="">
            </p>
            <p class="friend_name">
                {$vo.user_nickname}
            </p>
            <P class="sendintegral">
                已赠送{$vo.total}积分
            </P>
        </div>
        </volist>
    </div>
    <div class="search">
        搜索添加好友
    </div>
</div>
<input type="tel" id="pwd" maxlength="6" style="display: block;" pattern="[0-9]*"  onkeyup="this.value = this.value.replace(/[^\d]/g, '')"/>

</body>
<script type="text/javascript" src="__INDEX__/js/jquery.min.js"></script>
<script>

    var friend_id = '';
    $(".fri_list").click(function(){
        friend_id=$(this).attr('data-id');
        $(".sendwrapper").css("display","block");
    })

    //取消弹出层
    $(".sendwrapper").click(function(){
        $(this).css("display","none")
    })

    $(".pleaseenter").click(function(){
        window.event.stopPropagation();
    })

    //确定赠送
    $(".sure").click(function(){
        total = $(".pleaseenter").val();
        if(parseInt(total) > 0) {
            window.event.stopPropagation()
            //判断是否改过密码
            $.ajax({
                url:"{:url('friendship/Friend/checkPwd')}",
                type:"POST",
                dataType:"JSON",

                success: function (data) {
                    if(data.data === false) {
                        alert(data.msg);
                    }
                    $(".sendwrapper").css("display", "none");
                    $(".passwordwrap").css("display", "block")
                }
            })
        }
    })
    $(".icon-quxiao").click(function(){
        window.event.stopPropagation();
        $(".pleaseenter").val("");
        $(".passwordwrap").css("display","none")
    })


    $("#pwd").focus();
    $('.password_box').on('click','li',function(){
        $('#pwd').focus();
        if($('body').hasClass('mui-ios')){
            $('.order_box').css('marginTop','200px')
        }else{
            $('.order_box').css('marginTop','50px')
        }

    })
    $('#pwd').on('input',function(){
        var leng = 0;
        if(/[^\d]/g.test($(this).val())){
            val = $(this).val().replace(/[^\d]/g,'');
        }else{
            leng = $(this).val().length;
            console.log(leng)
            caseItem(leng)
        }
    })

    // 模拟效果
    function caseItem(i){
        $('.password_box li').removeClass('active')
        for(var j = 0; j < i ; j++){
            $('.password_box li').eq(j).addClass('active');
            if(j == 5){
                $('#pwd').blur();
                var str= $('#pwd').val();
                $.ajax({
                    url:"{:url('friendship/Friend/donateIntegral')}",
                    data:{
                        friend_id:friend_id,
                        total:$(".pleaseenter").val(),
                        integral_pwd:str
                    },
                    type:"POST",
                    dataType:"JSON",

                    success: function (data) {
                        if(data.status === true) {
                            window.event.stopPropagation()
                            $(".passwordwrap").css("display","none")
                            $("#BALANCE").html(data.data);
                            $(".pleaseenter").val("");
                            $('#pwd').val("")
                            alert(data.msg);
                            window.location.reload();
                        }else {
                            alert(data.msg);
                        }

                    }
                })
            }
        }
    }



    $(".search").click(function(){
        window.location.href="{:url('friendship/Friend/friendList')}";
    })
</script>
</html>