yujian
2020-01-18 f4a0f2acc63d7785eab108419a4e16f5f688cb95
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
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>填写邀请码</title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <style type="text/css">
            body{
                margin: 0;
                font-family: "微软雅黑";
            }
            .page{
                width: 100%;
                background: url(img/yqm.png) no-repeat center;
                background-size: 100% 100%;
                position: relative;
            }
            .cont{
                width: 70%;
                position: absolute;
                left: 15%;
                top: 49%;
            }
            .cont span{
                display: inline-block;
                padding: 10px 20px;
                padding-bottom: 24px;
                line-height: 20px;
                color: #C07F99;
                font-size: 12px;
            }
            .inputCont{
                height: 60px;
                /*background: url(img/y_txt.png) no-repeat center;
                background-size: 100% 100%;*/
            }
            .inputCont input{
                width: 100%;
                height: 100%;
                outline: none;
                text-align: center;
                border-radius: 32px;
                border: none;
                font-size: 18px;
                padding: 0;
            }
            .btn{
                height: 60px;
                background: url(img/y_tj.png) no-repeat center;
                background-size: 100% 100%;
            }
            /*弹框*/
            .pos{
                position: fixed;
                width: 100%;
                height: 100%;
                background: rgba(0,0,0,0.5);
                top: 0;
                left: 0;
                display: none;
            }
            .pos .alert{
                width: 66%;
                height: 22%;
                background: #fff;
                border-radius: 16px;
                position: absolute;
                top: 34%;
                left: 17%;
            }
            .pos .alert:after{
                content: '';
                width: 100%;
                height: 1px;
                background: #ccc;
                position: absolute;
                bottom: 50px;
                left: 0;
            }
            .alert div{
                height: 50px;
                width: 100%;
                line-height: 50px;
                text-align: center;
                font-size: 18px;
                color: #FF3082;
                position: absolute;
                bottom: 0;
                left: 0;
            }
            .alert span{
                display: inline-block;
                text-align: center;
                width: 100%;
                height: 20px;
                font-size: 18px;
                line-height: 20px;
                position: absolute;
                top: 40%;
                left: 0;
                margin-top: -20px;
            }
        </style>
    </head>
    <body>
        <div class="page">
            <div class="cont">
                <div class="inputCont">
                    <input autofocus="autofocus" type="text" name="" id="shareText" value="" />
                </div>
                <span>
                    非必填项,提交成功后你的首次下单好友将会获得现金红包
                </span>
                <div class="btn mysubmit">
                    
                </div>
            </div>
        </div>
        <div class="pos">
            <div class="alert">
                <span id="judge">
                    提交成功!
                </span>
                <div id="sure">
                    确定
                </div>
            </div>
        </div>
    </body>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script type="text/javascript">
        var _h = $(document).height();
        console.log(_h)
        $('.page').height(_h);
//        $('.btn').click(function(){
//            $('.pos').fadeIn();
//            setTimeout(function(){
//                $('.pos').fadeOut();
//            },1000)
//        })
        
        if(667<=_h<736){
            $('.inputCont').height(68);
            $('.btn').height(68);
            $('.inputCont input').css('border-radius','34px');
        }
//        if(_h>=736){
//            $('.inputCont').height(70);
//            $('.btn').height(80);
//            $('.inputCont input').css('border-radius','35px');
//        }
        if(_h<=568){
            $('.inputCont').height(56);
            $('.btn').height(56);
            $('.inputCont input').css('border-radius','28px');
        }
        $(function(){
            $(".mysubmit").bind("click",function(){
                var share = $("#shareText").val();
                $.post("../client/shareSubmit",{"uid":<%=request.getAttribute("uid")%>,"share":share},function(data){
                    if(data.code==0){
                        var state = data.data;        
                        if(state == 0){
                            $('#judge').html('不存在该邀请码!');
                        }else if(state == 1){
                            $('#judge').html('提交成功!');
                        }else if(state == 2){
                            alert("被邀请者不是新用户!");
                            $('#judge').html('被邀请者不是新用户!');
                        }else if(state == 3){
                            $('#judge').html('被邀请者已存在!');
                        }else if(state == -1){
                            $('#judge').html('邀请者与被邀请者不能相同!');
                        }
                    }else{
                        $('#judge').html('请求出错!');
                    }
                    setTimeout(function(){
                        $('.pos').fadeIn();
                    },100)
                },'json');
            });
            $('#sure').click(function(){
                $('.pos').fadeOut();
            })
        });
    </script>
</html>