<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <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 name="wap-font-scale" content="no">
    <title></title>
    <link rel="stylesheet" href="https://app.ixiulive.com/static/css/reset.css">
    <link rel="stylesheet" href="https://app.ixiulive.com/static/css/layui.min.css">
    <link rel="stylesheet" href="../../layer-v3.1.0/layer/theme/default/layer.css">
    <link rel="stylesheet" href="css/method.css?v=202406121801" />
    <script type="text/javascript" src="../../lib/fsize.js"></script>
    <style type="text/css">
        .mask1Title p,
        .maskTitle {
            width: 90%;
            margin: 0 auto;
        }
    </style>
</head>

<body>
    <div class="main">
        <div class="mBox">
            <div class="bindMethodsBox">

            </div>
            <div class="addMethodBtn"></div>
        </div>

        <div class="multiPanel">
            <div class="panelFloor">
                <div class="pn1" onclick="goDetail()">查看</div>
                <div class="pn2" onclick="setDefault()">設為默認</div>
                <div class="pn3 colorRed" onclick="confirmCancel()">解綁</div>
            </div>
            <div class="panelFloor">
                <div class="colorBlue p4" onclick="cancelPop()">取消</div>
            </div>
        </div>

        <div class="popMask">
            <p class="popTitle">解綁提現方式 </p>
            <div class="popContent">
                <p class="popMethod">提現方式:銀行卡(中國大陸)</p>
                <p class="popAccount">賬號:6226****2266</p>
                <p class="p6">是否確定解綁該提現方式</p>
            </div>
            <div class="popBtns">
                <span class="p5">取消</span>
                <span class="p7">確定</span>
            </div>
        </div>
    </div>


</body>
<script src="../../lib/jquery-3.1.1.min.js"></script>
<script src="../../layer-v3.1.0/layer/layer.js"></script>
<script type="text/javascript" src="https://app.ixiulive.com/static/js/webAppComm.js?v=202406121801"></script>
<script type="text/javascript" src="https://app.ixiulive.com/static/js/layui.min.js?v=202406121801"></script>
<script src="../../lib/langchange.js?v=202406221814"></script>
<script>

    $('title').html(langList[langType].draw24);

    $('.pn1').html(langList[langType].newDraw6);
    $('.pn2').html(langList[langType].newDraw7);
    $('.pn3').html(langList[langType].newDraw8);
    $('.p4,.p5').html(langList[langType].dewExchangeTitle17);
    $('.popTitle').html(langList[langType].newDraw9)
    $('.p6').html(langList[langType].newDraw12);
    $('.p7').html(langList[langType].income24);
    // $('.methodCapacity').html(langList[langType].newDraw29)

    // 7400后
    if ($firefly.urlData.appversion >= 7400) {
        tellCliIcon();
        $firefly.changeTitle2();
        function tellCliIcon() {
            let mInfos = [ //第一级 右上角展示的Icon
                {
                    "imgUrl": 'https://app.ixiulive.com/static/app/img/fusi/kf.png',
                    "explain": '客服',
                    "webFunc": "$firefly.goCustomerService()",
                },
                {
                    //第二级 更多中的内容
                    "imgUrl": 'https://app.ixiulive.com/static/app/img/more2.png?v=202304191549',    // ...的icon
                    "explain": "更多",// ...的cid
                    "webFunc": "openExtra()"
                }
            ]
            $firefly.showIcons(mInfos);
        }


        function openExtra() {
            let infos = [
                [{
                    "fontStyle": {
                        "highLight": false // 是否高亮
                    },
                    "explain": $firefly.langList[$firefly.langType].lang2,
                    "webFunc": "$firefly.refreshWeb()",
                }],
                [{
                    "fontStyle": {
                        "highLight": false // 是否高亮
                    },
                    "explain": $firefly.langList[$firefly.langType].lang3,
                    "webFunc": "$firefly.goCustomerService()",
                },
                {
                    "fontStyle": {
                        "highLight": false // 是否高亮
                    },
                    "explain": $firefly.langList[$firefly.langType].lang6,
                    "webFunc": "$firefly.closeWebView()",
                }]
            ]
            $firefly.openExtra(infos);
        }
    }

    let flag1 = true;
    let flag2 = true;
    let nowType;
    let nowClick;

    let data = getRequest()
    if (sessionStorage.bbb == undefined || sessionStorage.bbb == "undefined") {
        sessionStorage.bbb = data.uid;
        sessionStorage.lang = data.lang;
        sessionStorage.kkk = data.token
    }

    getUserBindInfo();
    function getUserBindInfo() {
        $.ajax({
            url: $ip + '/withdraw/v1/queryUserWithdrawlList',
            type: 'POST',
            dataType: 'json',
            data: {
                uid: sessionStorage.bbb,
                token: sessionStorage.kkk,
                lang: sessionStorage.lang,
                cid: 'h5_gw',
                os: 'h5'
            },
            success: function (res) {
                console.log(res);
                if (res.code == 1) {
                    let bindMethods = res.withdrawInfoList;
                    $('.bindMethodsBox').html('');
                    for (let i = 0; i < bindMethods.length; i++) {
                        let temp = ''
                        let now = bindMethods[i];
                        let capacity = now.rateMap.monthCapacity ? `<p class="methodCapacity">${langList[langType].newDraw36}:¥${now.rateMap.monthCapacity}</p>` : '';
                        temp = $(` <div class="mDetail" data-type="${now.paytype}">
                    <div class="detailCon1">
                        <p class="methodName">
                            <img src="./img/paytype${now.paytype}.png" alt="">
                        </p>
                        ${capacity}
                        <div class="detailBtn"></div>
                    </div>
                    <div class="detailCon2">
                        <p class="methodAccount">${langList[langType].newDraw11}${now.cardaddr} </p>
                        <div class="selectedBtn ${now.selectedStatus ? 'selected' : ''}"></div>
                    </div>
                </div>`)
                        temp.data('mData', now);
                        $('.bindMethodsBox').append(temp);
                    }
                    if (bindMethods.length == 5) {
                        $('.addMethodBtn').hide()
                    } else {
                        $('.addMethodBtn').show()
                    }
                    $('.mDetail').on('click', function () {
                        nowType = $(this).attr('data-type');
                        nowClick = $(this).data('mData');
                        layer.open({
                            type: 1,
                            offset: 'b',
                            title: '',
                            scrollbar: false,
                            closeBtn: false,
                            anim: 'slideUp', // 从下往上
                            area: ['10rem', '5.2rem'],
                            shade: 0.1,
                            shadeClose: true,
                            content: $(".multiPanel"),
                            success: function () {

                            },
                            end: function () {

                            }
                        });

                        $(".addMethodBtn").on('click', function () {
                            window.location.href = './methodBind.html' + location.search;
                        })
                    })
                }
            },
            error: function () {

            }
        })
    }

    $('.addMethodBtn').on('click', function () {
        window.location.href = './methodBind.html' + location.search;
    })

    function goDetail() {
        if (!nowType) {
            return
        }
        window.location.href = './methodDetail.html' + location.search + '&methodType=' + nowType;
    }

    function setDefault() {
        $.ajax({
            url: $ip + '/withdraw/v1/optUserWithdrawlInfo',
            type: 'POST',
            dataType: 'json',
            data: {
                uid: sessionStorage.bbb,
                token: sessionStorage.kkk,
                lang: sessionStorage.lang,
                cid: 'h5_gw',
                os: 'h5',
                optType: 2,
                payType: nowType
            },
            success: function (res) {
                if (res.code == 1) {
                    layer.close(layer.index);
                    layer.msg(langList[langType].newDraw31)
                    getUserBindInfo();
                } else {
                    layer.msg(res.msg);
                }
            }
        })
    }

    function confirmCancel() {
        layer.close(layer.index);
        let typeArr = []
        if (langType == 0) {
            typeArr = ['', '微信提現', '銀行卡(中國大陸)', 'Paypal', '支付寶', 'Payoneer', '銀行卡(國際)'];
        } else {
            typeArr = ['', 'wechat', 'Bank Card(Mainland)', 'Paypal', 'Alipay', 'Payoneer', 'Bank Card (International)'];
        }

        $('.popMethod').html(langList[langType].newDraw10 + ':' + typeArr[nowClick.paytype]);
        $('.popAccount').html(langList[langType].newDraw11 + nowClick.cardaddr);
        layer.open({
            type: 1,
            title: false,
            shadeClose: true,
            shade: .4,
            anim: 2,
            area: ['7.307rem', ''],
            closeBtn: 0,
            content: $('.popMask'),
            end: function () {
                flag1 = true;
            }
        })
    }

    function cancelPop() {
        layer.close(layer.index);
    }

    $('.popBtns span:eq(0)').on('click', function () {
        layer.closeAll();
    })

    $('.popBtns span:eq(1)').on('click', function () {
        layer.closeAll();
        cancelBind();
    })

    function cancelBind() {
        $.ajax({
            url: $ip + '/withdraw/v1/optUserWithdrawlInfo',
            type: 'POST',
            dataType: 'json',
            data: {
                uid: sessionStorage.bbb,
                token: sessionStorage.kkk,
                lang: sessionStorage.lang,
                cid: 'h5_gw',
                os: 'h5',
                optType: 1,
                payType: nowType
            },
            success: function (res) {
                if (res.code == 1) {
                    if (langType == 0) {
                        layer.msg('已解除綁定!')
                    } else {
                        layer.msg('unbonded');
                    }
                    getUserBindInfo();
                } else {
                    layer.msg(res.msg);
                }
            }
        })
    }

</script>

</html>