dever 3 anos atrás
pai
commit
1756dfe4d0
2 arquivos alterados com 69 adições e 0 exclusões
  1. 2 0
      database/admin.php
  2. 67 0
      src/Lib/Input.php

+ 2 - 0
database/admin.php

@@ -463,6 +463,8 @@ return array
 			'option' 	=> $group,
 			'update'	=> 'select',
 			//'list'		=> true,
+			# 取代option,从接口里读取选项
+			//'update_search' => 'goods/lib/manage.search_sku',
 		),
 
 		'top'		=> array

+ 67 - 0
src/Lib/Input.php

@@ -1026,6 +1026,73 @@ class Input
         return $html;
     }
 
+    /**
+     * goods
+     *
+     * @return string
+     */
+    public static function _goods($param)
+    {
+        $html = "<style>.number-box {
+    border:#e5e5e5 solid 1px;
+    display:inline-block;
+    overflow:hidden;
+}
+.number-box input[type='text'] {
+    height:30px;
+    border-top:none;
+    border-bottom:none;
+    border-left:#e5e5e5 solid 1px;
+    border-right:#e5e5e5 solid 1px;
+    margin:0;
+    text-align:center;
+    width:40px;
+    outline:none;
+    padding:0 5px;
+    float:left;
+    line-height:30px;
+}
+.number-box input[type='button'] {
+    height:30px;
+    width:40px;
+    float:left;
+    border:none;
+    outline:none;
+    background-color:#f3f3f3;
+    line-height:30px;
+    cursor:pointer;
+    padding:0;
+}
+.number-box input[type='button']:hover {
+    background-color:#f9f9f9;
+}
+.number-box input[type='button']:active {
+    background-color:#f6f6f6;
+}</style>";
+        
+        $html .= '<script>$(document.documentElement).on("click", ".on-number", function() {
+    var $val = $(this).siblings("input[type=\'text\']"),
+        val = parseInt($val.val(), 10) + parseInt($(this).data("v"));
+    $val.val(isNaN(val) ? 0 : val);
+});</script>';
+        $html .= '<input type="text" class="layui-input update_value form-control layui-input" value="" name="update_pwd_prefix" id="update_pwd_prefix_value" autocomplete="new-password" placeholder="搜索商品名称">';
+
+
+        $html .= '<ul>
+
+        <li><div>商品1</div>
+
+            <div class="number-box">
+                <input type="button" class="on-number" value="-" data-v="-1">
+                <input type="text" value="0">
+                <input type="button" class="on-number" value="+" data-v="1">
+            </div>
+        </li>
+
+        <li>商品2</li></ul>';
+        return $html;
+    }
+
     /**
      * radio
      *