Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

libai / fireflyReg

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • fireflyReg
  • Nesting
  • dew
  • Conversion.html
Find file
BlameHistoryPermalink
  • libai's avatar
    测试 · 8e24e39a
    libai committed a year ago
    8e24e39a
Conversion.html 11.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
<!DOCTYPE html>
<html lang="en">
<head>
    <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">
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/layer.css">
    <link rel="stylesheet" href="css/index.css?v='20180904815'">
    <script src="lib/fsize.js"></script>
    <title>轉讓黃金螢火蟲</title>
    <style>
        .yourclass2{
            border-radius: 0.3rem !important;
            top: 25% !important;
        }
        .layui-layer-close2{
            display: none !important;

        }
    </style>
</head>
<body>
<div class="bg">
    <div style="height: 0.4rem;"></div>
    <div class="con-box">
        <div class="con-box-face">
            <img class="con-box-img" src="images/firefly.png" alt="">
            <p class="con-box-name"></p>
        </div>
        <div class="con-box-id">
            <input style="vertical-align: middle" class="fire-uid-btn" type="number" placeholder="輸入 Firefly ID:">
            <!--<button class="uid-btn">確認</button>-->
        </div>
        <div class="con-box-mun">
            <p><input style="vertical-align: middle" class="fire-num-btn" type="number" placeholder="0"></p>
        </div>
        <p class="con-tips">剩餘黃金螢火蟲 <span class="gold">--</span>, <span class="con-more">全部轉讓</span></p>
        <div class="con-btn-box">
            <button  class="con-btn">確認轉讓</button>
        </div>
    </div>
    <p class="con-p">黃金螢火蟲不夠?<a href="exchange.html"><span class="con-href"> 點擊兌換</span></a></p>
</div>
<div style="display: none" class="confirm-layer">
    <div class="confirm-content">
        <p class="confirm-tips">
          確認轉讓 <span class="layer-num">28</span> 個黃金螢火蟲到以下賬號
        </p>
        <div class="content-box-layer">
            <img class="layer-face" src="images/firefly.png" alt="">
            <p>暱稱:<span class="layer-name">wins品格系</span></p>
            <p> ID:<span class="layer-id">1212123</span></p>
        </div>
        <div class="layer-btn-box">
            <div  style="height: 0.8rem;line-height: 0.8rem">
                <button class="layer-btn layer-btn-yes">確定</button>
            </div>
            <div style="height: 0.8rem;line-height: 0.8rem">
                <button style="margin-top: 0.35rem;" class="layer-btn layer-btn-no">取消</button>
            </div>


        </div>

        <!--<img class="layer-face" src="images/firefly.png" alt="">-->
        <!--確認要為 <span>wins品格系</span> 轉讓 <span>28個</span>黃金螢火蟲么?-->
    </div>
</div>
</body>
<script src="lib/jquery-3.1.1.min.js"></script>
<script src="layer/layer.js"></script>
<script>

//    $ip = "http://ceshi.yabolive.tv/web";
        $ip = "https://webserver.yabolive.net";
    cdn = "https://zhibocdn.yabolive.net/comm"
    if (sessionStorage.bbb == undefined) {
        var bbb = location.href;
        var data = url_get_params(bbb)
        sessionStorage.kkk = data.method; //t
        if (data.method == undefined) {
            sessionStorage.kkk = data.token;
        }
        sessionStorage.bbb = data.uid; //u
    }
    function url_get_params(url_path) {
        var url = url_path;
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(url.indexOf("?") + 1);
            strs = str.split("&");
            for (var i = 0; i < strs.length; i++) {
                theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
            }
        }
        return theRequest;
    }

    ok = false
    $.ajax({
        url: $ip + "/user/getUserInfo.html",
        data: {
            uid: sessionStorage.bbb,
            token: sessionStorage.kkk,
            'cid': "web_gw",
            'os': "WEB",
            'lang': 2,
            'vest': 0,
        },
        dataType: "json",
        type: "post",
        error: function (msg) {
            console.log('请求出错');
        },
        success: function (msg) {
//            var data=JSON.parse(msg);
            console.log(msg)
            $(".gold").text(msg.data.firefly)
            maxFirefly = msg.data.firefly;
        }
    })
    $(".fire-num-btn").on("input", function () {
        if($(".fire-num-btn").val()==0){
            $(".fire-num-btn").val("");
        }
        if (ok == true) {
            if($(".fire-num-btn").val()!=""){
                $(".con-btn-box").css("opacity", "1")
            }else{
                $(".con-btn-box").css("opacity", "0.7")
            }

        }
        if($(".fire-num-btn").val()==0){
            $(".con-btn-box").css("opacity", "0.7")

        }
        if (maxFirefly!=0){
            if ($(".fire-num-btn").val() > maxFirefly) {
                $(".fire-num-btn").val(maxFirefly)
                layer.msg("已經到達最大值")
            }
        }else{
            $(".fire-num-btn").val("");
            layer.msg("暫時沒有黃金螢火蟲噢~")
        }

    })
    $(".con-more").on("click", function () {
        $(".fire-num-btn").val(maxFirefly)
    })
    //控制瀏覽器剛剛進入的行為
    if($(".fire-uid-btn").val().length>4){
        $.ajax({
            url: $ip + "/user/getUser.html",
            data: {
                uid: $(".fire-uid-btn").val(),
                'cid': "web_gw",
                'os': "WEB",
                'lang': 2,
            },
            dataType: "json",
            type: "post",
            error: function (msg) {
                console.log('请求出错');
            },
            success: function (msg) {
                console.log(msg);
                if (msg.code == 1) {
                    $(".con-box-img").attr("src", cdn + msg.data.faceimg + "?x-oss-process=image/resize,w_100")
                    $(".con-box-name").text(msg.data.nickName);
                    luckUid = msg.data.uid;
                    layerImg=msg.data.faceimg;
                    $(".uid-btn").text("修改")
                    $(".uid-btn").css("color", "#00f088")
                    ok = true
                } else {
                    $(".con-box-name").text("請輸入正確的ID");
                    $(".con-box-img").attr("src", "images/firefly.png")
                    ok = false
                }
            }
        })
    }
    if($(".fire-uid-btn").val().length>4&&$(".fire-num-btn").val()!=""&&$(".fire-num-btn").val()!=0){
        $(".con-btn-box").css("opacity",1);
        ok = true;
    }
    $(".fire-uid-btn").focus()
    //
    $(".fire-uid-btn").on("input", function () {
        if($(".fire-uid-btn").val()==0){
            $(".fire-uid-btn").val("");
        }
        if($(".fire-uid-btn").val()==sessionStorage.bbb){
            $(".con-box-name").text("不能轉讓給本人");
            $(".con-box-img").attr("src", "images/firefly.png");
            $(".con-btn-box").css("opacity",'0.7');
            $(".fire-num-btn").val("");
            ok = false
            return
        }
        if ($(".fire-uid-btn").val().length > 4) {
            $.ajax({
                url: $ip + "/user/getUser.html",
                data: {
                    uid: $(".fire-uid-btn").val(),
                    'cid': "web_gw",
                    'os': "WEB",
                    'lang': 2,
                },
                dataType: "json",
                type: "post",
                error: function (msg) {
                    console.log('请求出错');
                },
                success: function (msg) {
                    console.log(msg);
                    if (msg.code == 1) {
                        $(".con-box-img").attr("src", cdn + msg.data.faceimg + "?x-oss-process=image/resize,w_100")
                        $(".con-box-name").text(msg.data.nickName);
                        luckUid = msg.data.uid;
                        layerImg=msg.data.faceimg;
                        $(".uid-btn").text("修改")
                        $(".uid-btn").css("color", "#00f088")
                        ok = true
                    } else {
                        $(".con-box-name").text("請輸入正確的ID");
                        $(".con-box-img").attr("src", "images/firefly.png")
                        ok = false
                    }
                }
            })
        }else{
            $(".con-box-name").text("");
            $(".con-box-img").attr("src", "images/firefly.png");
            $(".con-btn-box").css("opacity",'0.7');
            $(".fire-num-btn").val("");
            ok = false
        }


    })
    $(".con-btn").on("click", function () {
        if($(".fire-num-btn").val()==0){
            return
        }
        if($(".fire-num-btn").val()==""){
            return
        }
        if (ok == false) {
            layer.msg("請輸入需要轉讓的人的ID號");
            return;
        }
        if($(".fire-uid-btn").val()==sessionStorage.uid){
            layer.msg("不能轉贈給自己")
            return;
        }
        if($(".fire-num-btn").val()==0){
            layer.msg("轉讓的黃金螢火蟲數需大於0");
            return;
        }
        setTimeout(function () {
            $(".layer-btn-yes").removeAttr("disabled")
            $(".layer-name").text($(".con-box-name").text());
            $(".layer-num").text($(".fire-num-btn").val())
            $(".layer-face").attr("src",cdn+layerImg+"?x-oss-process=image/resize,w_100")
            $(".layer-id").text($(".fire-uid-btn").val());
            layer.open({
                type: 1,
                title: false,
                skin: 'yourclass2',
                area : ['8rem','6rem'],
                shadeClose: false,
                content:$(".confirm-layer"),
            });
        },300)

    })
$(".layer-btn-yes").on("click", function () {
    $(".layer-btn-yes").attr("disabled",'disabled')
            $.ajax({
            url: $ip + "/user/transfirefly.html",
            data: {
                uid: sessionStorage.bbb,
                touid: luckUid,
                num: $(".fire-num-btn").val(),
                token: sessionStorage.kkk,
                'cid': "web_gw",
                'os': "WEB",
                'lang': 2,
            },
            dataType: "json",
            type: "post",
            error: function (msg) {
                console.log('请求出错');
            },
            success: function (msg) {
                console.log(msg);
                if (msg.code == 1) {
                    layer.msg("轉讓成功!");
                    $(".fire-num-btn").val("");
                    $(".gold").text(msg.firefly);
                    maxFirefly = msg.firefly;
                    setTimeout(function () {
                        layer.closeAll();
                        $(".layer-btn-yes").removeAttr("disabled")
                    },1000)
                    $(".con-btn-box").css("opacity","0.7");
                }else{
                    layer.msg(decodeURI(msg.msg));
                }
            }
        })
})
    $(".layer-btn-no").on("click", function () {
        layer.close(layer.index);
    })
</script>
</html>