admin
2025-07-31 5414f8f6e0034f5c897b18457b4ab47be302bea8
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
<!DOCTYPE html>
<html>
 
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
    <style>
        body {
            padding: 10px;
        }
 
        #sure {
            visibility: hidden;
        }
 
        .layui-form-label {
            width: 200px;
        }
 
        .layui-input-block {
            margin-left: 240px;
            max-width: 500px;
        }
 
        .layui-input-block input {
            max-width: 150px;
        }
 
        .small {
            max-width: 75px !important;
        }
 
        .share-ratio {
            display: flex;
            margin-bottom: 10px;
        }
 
        .share-ratio .layui-form-label {
            width: 50px;
            padding-left: 0;
            font-size: 12px;
            text-align: left;
        }
 
        .share-ratio input {
            width: 60px;
            margin-right: 10px;
        }
    </style>
</head>
 
<body>
 
<form class="layui-form" lay-filter="edit">
    <input type="hidden" name="id" />
    <div class="layui-form-item">
        <label class="layui-form-label">手机号:</label>
        <div class="layui-input-inline">
            <input type="text" name="mobile" required lay-verify="required|mobile" placeholder="手机号" autocomplete="off" class="layui-input">
        </div>
    </div>
 
    <div class="layui-form-item">
        <label class="layui-form-label">支付宝账号:</label>
        <div class="layui-input-inline">
            <input type="text" name="alipayAccount" required lay-verify="required" placeholder="支付宝账号" autocomplete="off" class="layui-input">
        </div>
    </div>
 
    <div class="layui-form-item">
        <label class="layui-form-label">支付宝密码:</label>
        <div class="layui-input-inline">
            <input type="text" name="alipayPassword" required lay-verify="" placeholder="无更改无需填写" autocomplete="off" class="layui-input">
        </div>
    </div>
 
    <div class="layui-input-block">
        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="sure" id="sure">确定</button>
    </div>
</form>
<script src="layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/http_api.js"></script>
<script>
    var listener;
 
    function submit(callback) {
 
        //暂存回调方法
        listener = callback;
        //表单提交按钮
        $("#sure").click();
    }
 
    layui.use(['form', 'layedit', 'laydate', 'laytpl'], function() {
        var form = layui.form,
                layer = layui.layer,
                laydate = layui.laydate,
                laytpl = layui.laytpl;
        //自定义验证规则
        form.verify({
            num: [/^\d+$/, "必须为正整数"],
            money: [/^\d+(\.\d{1,2})?$/, "金额最多保留2位小数"]
        });
        var id = http_util.getQueryString("id");
        // 获取值
        $.post("/admin/api/clientinfo/js2/getAdditionalInfo", {
            "id":id
        }, function(response) {
            if (response.code == 0) {
                form.val("edit", response.data);
            } else {
                layer.msg(response.msg);
            }
        }, 'json').fail(function(jqXHR, textStatus, errorThrown) {
            layer.msg("网络请求失败");
        });
        //监听提交
        form.on('submit(sure)', function(data) {
            listener(data.field);
            return false;
        });
    });
</script>
</body>
 
</html>