Browse Source

add js and css

oubo 5 years ago
parent
commit
089b744569
2 changed files with 105 additions and 17 deletions
  1. 92 0
      sapi/web/reportForms/css/jump.css
  2. 13 17
      sapi/web/reportForms/js/CoolInput.js

+ 92 - 0
sapi/web/reportForms/css/jump.css

@@ -0,0 +1,92 @@
+
+.jump-interface {
+    width: 100%;
+    height: 100%;
+    background: #fff;
+    position: fixed;
+    left: 0;
+    right: 0;
+    top: 0;
+    bottom: 0;
+    margin: auto;
+    display: none;
+    transition: all .2s linear;
+    font-size: 16px;
+    /*transform: scale(2);*/
+    /*-webkit-overflow-scroll: touch!important;*/
+}
+
+.jump-box {
+    width: 80%;
+    height: 100%;
+    margin: 10px auto;
+}
+
+.jump-box li {
+    margin-bottom: 10px;
+    height: 30px;
+}
+
+
+.jump-box .tip {
+    font-weight: bold;
+    font-size: 20px;
+}
+
+.jump-box .jumpNumber{
+    width: 100px;
+    height: 30px;
+    font-size: 16px;
+    border: 1px solid #000;
+    border-radius: 5px;
+}
+
+
+.jump-save-box{
+    width: 60%;
+    height: 40px;
+    font-size: 16px;
+    margin-top: 100px;
+    margin-left: 20%;
+    display: flex;
+    display: -webkit-flex;
+    justify-content: space-between;
+    -webkit-justify-content: space-between;
+
+}
+
+.jump-save-box .jump{
+    width: 30%;
+    height: 40px;
+    font-size: 16px;
+    background: #fff;
+    color: #558df3;
+    outline: none;
+    border: 1px solid #F1F1F2;
+}
+.jump-save-box .cancel{
+    width: 30%;
+    height: 40px;
+    font-size: 16px;
+    background: #fff;
+    outline: none;
+    border: 1px solid #F1F1F2;
+}
+
+
+#coolInputPanel {
+    background: #fff !important;
+}
+
+
+
+/*#coolInputPanel {*/
+/*    height: 400px !important;*/
+/*    background: #fff !important;*/
+/*}*/
+/*#coolInputPanel > div {*/
+/*    height: 80px !important;*/
+/*    line-height: 80px !important;*/
+/*    font-size: 40px !important;*/
+/*}*/
+

+ 13 - 17
sapi/web/reportForms/js/CoolInput.js

@@ -4,9 +4,9 @@ function CoolInput(setting) {
     var _this = this;
     _this.cursorPosition = -1;
     _this.cursorX = -1;
+    _this.cursorT=-1;//
     _this.focused = false;
     _this.inputEl = $(setting.slt);
-    _this.myScale = setting.myScale;
     var modelVar = _this.inputEl.attr('v-model');
     _this.inputEl.attr('readonly', 'readonly');
     if (_this.inputEl.length === 0) throw (slt + ' not exist');
@@ -14,6 +14,7 @@ function CoolInput(setting) {
 
     if (!CoolInput.arrInputEl) CoolInput.arrInputEl = [];
     CoolInput.arrInputEl.push(input);
+
     function IsPC() {
         var userAgentInfo = navigator.userAgent;
         var Agents = ["Android", "iPhone",  "Windows Phone", "iPad", "iPod"];
@@ -52,7 +53,6 @@ function CoolInput(setting) {
             tmpDiv = window.coolInputTmpDiv = $('<div style="position:fixed;display:block;z-index:99999;top:300px;left:100px;visibility:hidden;"><div>');
             $(document.body).append(tmpDiv);
 
-
             // tmpDiv.css('top', _this.inputEl.offset().top - 30 + 'px');
             //tmpDiv.css('left', _this.inputEl.offset().left + 'px');
         }
@@ -226,23 +226,19 @@ border-width:1px;border-style:solid;border-color:#cacaca;border-top-style:none;b
             //var ht=sz.height+2;
         }
 
-        var pad = 0;
-        var pad2 = 0;
-        var cx = _this.inputEl.offset().left + (_this.cursorX+10)*_this.myScale;
-        var cy = _this.inputEl.offset().top;
-        var ht = _this.inputEl.height();
-        if (_this.myScale==1)
-        {
-            pad = 8;
-            pad2=ht-7*2;
-        }else {
-            pad2=(ht-6*2)*_this.myScale;
-            pad = 20;
+
+        var cx = _this.inputEl.offset().left + _this.cursorX+5;
+        var cy =_this.cursorT+3;
+        var ht = _this.inputEl.height()-4;
+        // var cy = _this.inputEl.offset().top+3;
+        if (navigator.userAgent.indexOf("iPhone") > 0) {
+            cx = _this.inputEl.offset().left + _this.cursorX+10;
+            cy =_this.cursorT+5;
         }
-        _this.divCursor.height(pad2);
-        _this.divCursor.css('left', cx + 'px');
-        _this.divCursor.css('top', cy+pad + 'px');
 
+        _this.divCursor.height(ht);
+        _this.divCursor.css('left', cx + 'px');
+        _this.divCursor.css('top',  cy + 'px');
 
         if (bShow) {
             _this.divCursor.show();