Wang hace 5 años
padre
commit
4e489ceaba

+ 1 - 2
h5v2/yd20191203/css/page.css

@@ -2,7 +2,7 @@
 * @Author: Wang
 * @Date:   2019-12-03 16:53:40
 * @Last Modified by:   Marte
-* @Last Modified time: 2019-12-04 12:07:17
+* @Last Modified time: 2019-12-06 14:17:46
 */
 html, body, ul, li, p, h1, h2, h3, h4, h5, h6, form, img { margin:0; padding:0; }
 img,input,button { border:none; padding:0;margin:0;outline-style:none; }
@@ -298,7 +298,6 @@ body{
     position: absolute;
     top: 364px;
     left: 674px;
-
 }
 
 .phoneNum{

+ 240 - 0
h5v2/yd20191203/html/phone.html

@@ -0,0 +1,240 @@
+<!DOCTYPE html>
+<html lang="en">
+    <head>
+        <meta charset="utf-8">
+        <style type="text/css">
+            html, body, ul, li, p, h1, h2, h3, h4, h5, h6, form, img { margin:0; padding:0; }
+            img,input,button { border:none; padding:0;margin:0;outline-style:none; }
+            ul{ list-style:none; }
+            iframe{display:none;}
+            input { padding-top:0; padding-bottom:0; font-family: "SimSun","Microsoft YaHei";}
+            select, input { vertical-align:middle;}
+            select, input{ font-size:12px; margin:0; }
+            img {border:0; vertical-align:middle; display:block;}
+            body { color:#666;background:#fff;}
+            h1,h2,h3,h4,h5,h6 {text-decoration:none;font-weight:normal;font-size:100%;}
+            s,i,em{font-style:normal;text-decoration:none;}
+            html {
+                width: 1280px;
+                height: 720px;
+                margin: 0 auto;
+            }
+            body{
+                font-size:20px;
+                font-family:'Microsoft Yahei;Arial';
+                color: #f1f1f1;
+                background: url('../img/page_04.png') no-repeat center;
+                background-attachment: fixed;
+                background-size: 100%;
+                overflow: hidden;
+                width:1280px;
+                height:720px;
+                margin: 0 auto;
+            }
+            
+            #myPrize{
+                position: absolute;
+                top: 310px;
+                left: 248px;
+            }
+
+            #keyBoard{
+                width: 340px;
+                height: 110px;
+                position: absolute;
+                top: 364px;
+                left: 674px;
+            }
+            #phone{
+                width: 331px;
+                height: 71px;
+                position: absolute;
+                top: 283px;
+                left: 667px;
+                line-height: 71px;
+                font-size: 26px;
+                text-align: center;
+            }
+
+            .phoneNum{
+                float: left;
+                font-size: 20px;
+                background:#5988eb;
+                width: 46px;
+                height: 46px;
+                text-align: center;
+                line-height: 50px;
+                border:3px solid transparent;
+                margin-right: 2px;
+                margin-bottom: 2px;
+                box-shadow: 0px 0px 5px 5px #4068d3 inset;
+            }
+
+            .phoneNum.current{
+                border:3px solid #d4c020;
+            }
+
+            .confirm,.cancel{
+                width: 227px;
+                height: 91px;
+                background: url('../img/btn_qd_def.png') no-repeat center;
+                position: absolute;
+                top: 590px;
+                left: 390px;
+            }
+            
+            .confirm.current{
+                background: url('../img/btn_qd_sel.png') no-repeat center;
+            }
+            .cancel{
+                left: 650px;
+                background: url('../img/btn_qx_def.png') no-repeat center;
+            }
+
+            .cancel.current{
+                background: url('../img/btn_qx_sel.png') no-repeat center;
+            }
+        </style>
+    </head>
+    <body>
+        <div id="exchangePopup" class="popup">
+            <img id="myPrize" src="" alt="" />
+            <div id="phone"></div>
+            <ul id="keyBoard">
+                <li class="phoneNum">1</li>
+                <li class="phoneNum">2</li>
+                <li class="phoneNum">3</li>
+                <li class="phoneNum">4</li>
+                <li class="phoneNum">5</li>
+                <li class="phoneNum">6</li>
+                <li class="phoneNum">7</li>
+                <li class="phoneNum">8</li>
+                <li class="phoneNum">9</li>
+                <li class="phoneNum">0</li>
+                <li class="phoneNum otherBtn">删除</li>
+                <li class="phoneNum otherBtn">清空</li>
+            </ul>
+            <div class="exchangeBtn confirm"></div>
+            <div class="exchangeBtn cancel"></div>
+        </div>
+        <script src="../js/webview.js" type="text/javascript"></script>
+        <script src="../js/tvSysBtnBind.v2.js" type="text/javascript"></script>
+        <script src="../js/comm.js" type="text/javascript"></script>
+        <script src="../js/api.js" type="text/javascript"></script>
+        <script type="text/javascript">
+            var data = {};
+            data.rules = {
+                exchangeBtn:{
+                    0:[0,["phoneNum",6],1,0],
+                    1:[-1,["phoneNum",8],0,0],
+                    "onEnterPress":exchangePopups,
+                    onPress:cellphoneNum,
+                    onBack:function(){
+                        G("phone").innerHTML = "";
+                        window.location.href =  "../index.html";
+                    },
+                },
+                phoneNum:{
+                    line:6,
+                    down:["exchangeBtn",1],
+                    onEnterPress:function(){
+                        try{
+                            alert('phoneNum'+this.currentIndex+this.className+G("phone").innerHTML.length);
+                            if(this.currentIndex<=9){
+                                if(G("phone").innerHTML.length>10) return;
+                                if(this.currentIndex == 9){
+                                    G("phone").innerHTML += 0;
+                                }else{
+                                    G("phone").innerHTML += this.currentIndex*1+1;   
+                                }  
+                            }else if(this.currentIndex == 10){
+                                if(G("phone").innerHTML.length>0)
+                                G("phone").innerHTML = G("phone").innerHTML.slice(0,-1);
+                            }else if(this.currentIndex == 11){
+                                if(G("phone").innerHTML.length>0)
+                                G("phone").innerHTML = "";
+                            }
+                        }catch(e){
+                            alert(e)
+                        }
+                    },
+                    onPress:cellphoneNum,
+                    onBack:function(){
+                        if(G("phone").innerHTML.length>0){
+                            G("phone").innerHTML = G("phone").innerHTML.slice(0,-1);
+                        }else{
+                            // H("exchangePopup");
+                            G("phone").innerHTML = "";
+                            window.location.href =  "../index.html";
+                            // this.reSetClass(heguiItem);
+                        }
+                    },
+                },
+            }
+
+            function exchangePopups(){
+                try{
+                    if(this.currentIndex==1){
+                        H("exchangePopup");
+                        G("phone").innerHTML = "";
+                        this.reSetClass(heguiItem);
+                    }else if(this.currentIndex==0){
+                        var phone = G("phone").innerText;
+                        var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
+                        if(!myreg.test(phone)){
+                            tips('手机号码格式有误!');
+                        }else{
+                            ajax({
+                                url: webUrl + "index.php?m=Home&c=Activityv2&a=setUserInfo",
+                                data: {
+                                    uid: uid,
+                                    act_id: init.act_id,
+                                    is_vip: init.oursProduct_isVip+init.othersProduct_isVip,
+                                    phone: phone
+                                },
+                                success: function (res) {
+                                    if(res.code == 0){
+                                        H("exchangePopup");
+                                        G("phone").innerHTML = "";
+                                        S("markDownPopup");
+                                        main.reSetClass("markDownBtn");
+                                    }else{
+                                        tips(res.msg);
+                                    }
+                                    
+                                }
+                            })
+                        }
+                    }
+                    
+                }catch(e){
+                    alert(e);
+                }
+            }
+
+             function cellphoneNum(){
+                if(G("phone").innerHTML.length>10) return;
+                var key = this.event.keyCode;
+                try {
+                    // Webview.setInputTypeTextFlag("true");
+                    if (key >= 0 && key <= 9) {
+                        G("phone").innerText += key;
+                    }
+                } catch (e) {
+                    if (key > 47 && key < 58) {
+                        G("phone").innerText += (key - 48);
+                    }
+                }
+            }
+
+
+             var btnConfig = {
+                className: 'phoneNum',
+                currentIndex: 0,
+                rules: data.rules,
+            }
+            window.main = new tvSysBtnBind(btnConfig);
+            main.reLoad();
+        </script>
+    </body>
+</html>

+ 45 - 56
h5v2/yd20191203/index.html

@@ -175,9 +175,9 @@
                     "onEnterPress":openBox,
                     onPress:function(){
                         if((this.event.keyCode == 39 || this.event.keyCode == "RIGHT") && this.prevIndex == 6){
-                            if(init.othersProduct_isVip == 0){
+                            if(init.oursProduct_isVip == 0){
                                 this.reSetClass("order_btn",0);
-                            }else if(init.othersProduct_isVip == 1 && init.oursProduct_isVip == 0){
+                            }else if(init.othersProduct_isVip == 0 && init.oursProduct_isVip == 1){
                                 this.reSetClass("order_btn",1);
                             }
                         }
@@ -274,24 +274,19 @@
                     line:6,
                     down:["exchangeBtn",1],
                     onEnterPress:function(){
-                        try{
-                            alert('phoneNum'+this.currentIndex+this.className+G("phone").innerHTML.length);
-                            if(this.currentIndex<=9){
-                                if(G("phone").innerHTML.length>10) return;
-                                if(this.currentIndex == 9){
-                                    G("phone").innerHTML += 0;
-                                }else{
-                                    G("phone").innerHTML += this.currentIndex*1+1;   
-                                }  
-                            }else if(this.currentIndex == 10){
-                                if(G("phone").innerHTML.length>0)
-                                G("phone").innerHTML = G("phone").innerHTML.slice(0,-1);
-                            }else if(this.currentIndex == 11){
-                                if(G("phone").innerHTML.length>0)
-                                G("phone").innerHTML = "";
-                            }
-                        }catch(e){
-                            alert(e)
+                        if(this.currentIndex<=9){
+                            if(G("phone").innerHTML.length>10) return;
+                            if(this.currentIndex == 9){
+                                G("phone").innerHTML += 0;
+                            }else{
+                                G("phone").innerHTML += this.currentIndex*1+1;   
+                            }  
+                        }else if(this.currentIndex == 10){
+                            if(G("phone").innerHTML.length>0)
+                            G("phone").innerHTML = G("phone").innerHTML.slice(0,-1);
+                        }else if(this.currentIndex == 11){
+                            if(G("phone").innerHTML.length>0)
+                            G("phone").innerHTML = "";
                         }
                     },
                     onPress:cellphoneNum,
@@ -662,43 +657,37 @@
             }
 
             function exchangePopups(){
-                try{
-                    alert('exchangePopups'+this.currentIndex+this.className);
-                    if(this.currentIndex==1){
-                        H("exchangePopup");
-                        G("phone").innerHTML = "";
-                        this.reSetClass(heguiItem);
-                    }else if(this.currentIndex==0){
-                        var phone = G("phone").innerText;
-                        var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
-                        if(!myreg.test(phone)){
-                            tips('手机号码格式有误!');
-                        }else{
-                            ajax({
-                                url: webUrl + "index.php?m=Home&c=Activityv2&a=setUserInfo",
-                                data: {
-                                    uid: uid,
-                                    act_id: init.act_id,
-                                    is_vip: init.oursProduct_isVip+init.othersProduct_isVip,
-                                    phone: phone
-                                },
-                                success: function (res) {
-                                    if(res.code == 0){
-                                        H("exchangePopup");
-                                        G("phone").innerHTML = "";
-                                        S("markDownPopup");
-                                        main.reSetClass("markDownBtn");
-                                    }else{
-                                        tips(res.msg);
-                                    }
-                                    
+                if(this.currentIndex==1){
+                    H("exchangePopup");
+                    G("phone").innerHTML = "";
+                    this.reSetClass(heguiItem);
+                }else if(this.currentIndex==0){
+                    var phone = G("phone").innerText;
+                    var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
+                    if(!myreg.test(phone)){
+                        tips('手机号码格式有误!');
+                    }else{
+                        ajax({
+                            url: webUrl + "index.php?m=Home&c=Activityv2&a=setUserInfo",
+                            data: {
+                                uid: uid,
+                                act_id: init.act_id,
+                                is_vip: init.oursProduct_isVip+init.othersProduct_isVip,
+                                phone: phone
+                            },
+                            success: function (res) {
+                                if(res.code == 0){
+                                    H("exchangePopup");
+                                    G("phone").innerHTML = "";
+                                    S("markDownPopup");
+                                    main.reSetClass("markDownBtn");
+                                }else{
+                                    tips(res.msg);
                                 }
-                            })
-                        }
+                                
+                            }
+                        })
                     }
-                    
-                }catch(e){
-                    alert(e);
                 }
             }
 
@@ -706,7 +695,7 @@
                 if(G("phone").innerHTML.length>10) return;
                 var key = this.event.keyCode;
                 try {
-                    Webview.setInputTypeTextFlag("true");
+                    // Webview.setInputTypeTextFlag("true");
                     if (key >= 0 && key <= 9) {
                         G("phone").innerText += key;
                     }

+ 0 - 2
h5v2/yd20191203/js/tvSysBtnBind.v2.js

@@ -329,7 +329,6 @@ function getBoundingClientRect(ele) {
                 }
                 self.readFn = function() {
                     if ((typeof init.onEnterPress) == "function") {
-                        alert(this.className+'readFn');
                         init.onEnterPress
                     } else {
                         init.onEnterPress = function() {}
@@ -641,7 +640,6 @@ function getBoundingClientRect(ele) {
 
                     
                     if (e.keyCode == btnEnter || e.keyCode == "ENTER") {
-                        alert(_this.className+"ENTER")
                         if (rules["#" + _this.currentId + ">." +_this.className] && (typeof rules["#" + _this.currentId + ">." +_this.className]["onEnterPress"]) == "function") rules["#" + _this.currentId + ">." +_this.className]["onEnterPress"].call(_this);
                         else if (rules[_this.className] && (typeof rules[_this.className]["onEnterPress"]) == "function") rules[_this.className]["onEnterPress"].call(_this);
                         else _this.onEnterPress.call(_this)