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

libai / web.yazhai.co

  • 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
  • web.yazhai.co
  • yeaRecharge
  • index.html
Find file
BlameHistoryPermalink
  • libai's avatar
    测试 · 5cdb833e
    libai committed 4 years ago
    5cdb833e
index.html 11.5 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
<!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">
    <title>优惠充值</title>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/layer.css">
    <link rel="stylesheet" href="css/index.css?v='2018022101'">
    <script src="lib/fsize.js"></script>
    <script>
        var ua = navigator.userAgent.toLowerCase();
        var userAgent = navigator.userAgent;
        if (/iphone|ipad|ipod/.test(ua)) {
//            window.location.href="share2.html?agentCode="+sessionStorage.bbb+"&bindType=3"
            //临时用企业key
            if (userAgent.indexOf("Safari") > -1) {
                if (userAgent.indexOf("Chrome") > -1){
                }else{
                    window.location.href='yazhai://'
                }
            }
        }

    </script>
</head>
<body>
<div class="bg">
    <span class="recording">充值记录</span>
    <div style="height: 0.9rem;"></div>
    <div class="top-box">
        <p class="top-text">现有豆钻</p>
        <p class="top-num">--</p>
    </div>
    <ul class="content clearfix">

    </ul>

    <div class="pay-box">
        <p class="pay-tips">选择支付方式</p>
        <ul class="pay-ul clearfix">
            <li >
                <img src="images/weipay.png" alt=""> 微信支付 <i style="display: none">weipay</i>
            </li>
            <li class="pay-click">
                <img src="images/alipay.png" alt=""> 支付宝 <i style="display: none">alipay</i>
            </li>
        </ul>
        <div class="taobao-Pay"><img style="margin-left: 0.1rem;" src="images/diamond.png" alt=""> 更多大额充值<span
                style="float: right;margin-right: 0.2rem;">淘宝官方企业店 <img
                style="height: 0.28rem;vertical-align: middle;margin-top: -0.05rem;" src="images/right.png"
                alt=""></span></div>
    </div>
    <div>
        <button class="pay-btn">支付</button>
    </div>
    <!--<p class="b-tips">温馨提示:关注客服公众号<span style="color: #EEAE3F;">"奶茶直播"</span>也可以购买橙钻,充值问题可点击 <img class="call" src="images/call.png" alt=""></p>-->
</div>
<div style="display: none;" class="alipay"></div>
</body>
<script src="lib/jquery-3.1.1.min.js"></script>
<script>
//    var $ip = "http://test.pay.ishuaji.cn";
    var $ip="https://pay.ishuaji.cn";
    var cdn = "https://zhibocdn.ishuaji.cn/comm";

    payOk = true;
    moneyBl = true;
    payBl = true;
    if (sessionStorage.kkk == undefined) {
        var bbb = location.href;
        var data = url_get_params(bbb)
        sessionStorage.kkk = data.token; //t
        sessionStorage.bbb = data.uid; //u
        sessionStorage.cid = data.cid;
        sessionStorage.pkg = data.pkg;
        sessionStorage.os = data.os;
    }
    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;
    }
    if(sessionStorage.pkg=='undefined')sessionStorage.pkg='yabo'
    if(sessionStorage.os=='undefined')sessionStorage.os='web'
    if(sessionStorage.cid=='undefined')sessionStorage.cid='gf'
    var ua = navigator.userAgent.toLowerCase();
    // if (/android/.test(ua)) {
    //     $(".taobao-Pay").show()
    // }
    if(sessionStorage.pkg =='mdzbxx'){
        $(".taobao-Pay").hide();
        $(".b-tips").hide();

    }
    $(".recording").on("click", function () {
        window.location.href='https://activity.ishuaji.cn/Yabo/expenses/recharge.html?uid='+sessionStorage.bbb+'&token='+sessionStorage.kkk+'&pkg=qingliang';
    })
try{
    if(sessionStorage.bbb!=undefined){
        $.ajax({
            url:"https://zhibo.lvdou66.com/weblive/stat/torecharge",
            type:"get",
            data:{
                'uid': sessionStorage.bbb,
                'driverid': "null",
                'appversion':sessionStorage.appversion,
                'cid':sessionStorage.cid,
                'os':sessionStorage.os
            },
            success: function (data) {

            }
        })
    }

}catch(e){

}
    $.ajax({
        url:$ip+"/user/auth/"+sessionStorage.bbb+'/'+sessionStorage.kkk,
        type:"post",
        success: function (msg) {
            var data=JSON.parse(msg);
            $(".top-num").text(data.diamond)
        }
    })
    $.ajax({
        url: $ip + "/pay/normal/recharge.html",
        dataType: "json",
        type: "get",
        success: function (msg) {
            console.log(msg)
            var html = [];
            for (var i = 0; i < msg.data.third.length; i++) {
                if(msg.data.third[i].diamond==1000)  html += '<li class="li-click">';
                else  html += '<li>';
                if (msg.data.third[i].addnum == 0) {
                    if(msg.data.third[i].coinnum==0)  html += '<p class="diamond-p"><img src="images/diamond.png" alt="">' + msg.data.third[i].diamond + '</p>';
                    else  html += '<p class="diamond-p"><img src="images/diamond.png" alt="">' + msg.data.third[i].diamond + '(送' + msg.data.third[i].coinnum + '银币)</p>';

                } else {
                    html += '<p class="diamond-p"><img src="images/diamond.png" alt="">' + msg.data.third[i].diamond + '<span style="color: #EEAE3F;">(送' + msg.data.third[i].addnum + '豆钻)</span></p>';
                }

                html += '<p class="money-p">¥<span class="pay-money">' + msg.data.third[i].amount + '</span></p>';
                if (msg.data.third[i].sale == 1) {
                    if(i%2==0){
                        html += '<img class="hot" src="images/hot.png" alt="">';
                    }else{
                        html += '<img class="hot" style="left:3.8rem" src="images/hot.png" alt="">';
                    }
                   
                }
                html += '</li>';
            }
//            html+='<li class="rich-god" style="height: 1.7rem;"><p class="diamond-p" style="margin-top: 0.3rem;"><img src="images/diamond.png" alt="">100000<span style="color: #ff6600;">(送10000橙钻)</span></p><p class="money-p">¥<span class="pay-money">10000</span></p></li>'
            $(".content").html(html);
            var k=$(window).height()/$(window).width();
            if(k<1.8){
                $(".diamond-p").css("margin-top",'0.3rem')
                $(".content li").css("height",'1.7rem')
                $(".b-tips").css("margin-top","0.5rem")
                $(".content").css("margin-top","0.7rem")
                $(".hot").css("width","0.7rem")
            }
            amount = 100
            $(".content li").on("click", function () {
                moneyBl = true;
                $(this).addClass("li-click");
                $(this).siblings("li").removeClass("li-click");
                amount = $(this).children("p").children(".pay-money").text()
                console.log(amount);
            })
        }
    })
    sessionStorage.pay = "alipay"
    $(".pay-ul li").on("click", function () {
        payBl = true;
        $(this).addClass("pay-click");
        $(this).siblings("li").removeClass("pay-click")
        sessionStorage.pay = $(this).children("i").text()
    })
    $(".pay-btn").on("click", function () {
        if (moneyBl && payBl) {
            if (sessionStorage.pay == "alipay") {
                if (payOk) {
                    $.ajax({
                        url: $ip + "/order/h5/alipay.html",
                        dataType: "json",
                        type: "get",
                        data: {
                            'uid': sessionStorage.bbb,
                            'amount': amount,
                            'pkg':sessionStorage.pkg,
                            'cid':sessionStorage.cid,
                            'os':sessionStorage.os
                        },
                        success: function (msg) {
                            console.log(msg);
                            var html = [];
                            payOk = true
                            html += msg.html;
                            $(".alipay").html(html);

                        }
                    })
                }

            } else if (sessionStorage.pay == "weipay") {
                if (payOk) {
                    $.ajax({
                        url: $ip+"/order/h5/wechat.html",
                        dataType: "json",
                        type: "post",
                        data: {
                            'uid': sessionStorage.bbb,
                            'amount': amount,
                            'pkg':'h5',
                            'cid':sessionStorage.cid,
                            'os':sessionStorage.os
                        },
                        success: function (msg) {
                            console.log(msg);
                            payOk = true;
                            window.location.href=msg.result.payInfo.url;
                        }
                    })
                }

            }

        }
    })

    $(".taobao-Pay").on("click", function () {
        var ua = navigator.userAgent.toLowerCase();
        if (/android/.test(ua)) {
            window.location.href = "https://t.asczwa.com/taobao?backurl=https://shop405864110.taobao.com/?spm=2013.1.0.0.9cfc97022UcWTe"
        } else if (/iphone|ipad|ipod/.test(ua)) {
            var obj2={
                "cid": 5,
                "reqCode": new Date().getTime(),
                "data": {
                    "url": "https://t.asczwa.com/taobao?backurl=https://shop405864110.taobao.com/?spm=2013.1.0.0.9cfc97022UcWTe",
                }
            }
            var obj = JSON.stringify(obj2);
            appCollaboration(obj)
        }

    })
    $(".call").on("click", function () {

        var obj2 = {
            "cid": 4,
            "reqCode": new Date().getTime(),
            "data": {
                "msg": "请求客服",
            }
        }
        var obj = JSON.stringify(obj2);
        appCollaboration(obj)

    })

    //实现和客户端沟通
    function appCollaboration(msg) {

        var sUserAgent = navigator.userAgent.toLowerCase();
        var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
        var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
        var bIsMidp = sUserAgent.match(/midp/i) == "midp";
        var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
        var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
        var bIsAndroid = sUserAgent.match(/android/i) == "android";
        var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
        var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
        if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
        }
        else if (bIsAndroid) {
            window.yazhai.appCollaboration(msg);
        } else if (bIsIphoneOs || bIsIpad) {
            window.webkit.messageHandlers.appCollaboration.postMessage(msg);
        }

    }
    //客户端回调结果
    function appCallback(msg) {
        console.log(msg);
    }
</script>
</html>