"diff-96fc5f6c195e83b3caf1ebdeb4f9e39d6e24ed91R101">101
                    that.$ctx.lineTo(that.sList[p]["x"],that.sList[p]["y"]);
102
                    //console.log(that.sList[p]["x"],that.sList[p]["y"]);
103
                }
104
105
            }
106
        };
107
108
        this.allDraw =function(c){
109
            if (arguments.length>0){
110
                this.pointDraw(c);
111
                this.lineDraw(c);
112
                that.$ctx.stroke();
113
            }
114
            else {
115
                this.pointDraw();
116
                this.lineDraw();
117
            }
118
119
        };
120
121
122
        this.draw=function(x,y){
123
            that.$ctx.clearRect(0,0,that.options.width,that.options.height);
124
            that.$ctx.beginPath();
125
            //that.initDraw();
126
            that.$ctx.putImageData(this.initImg,0,0);
127
            that.$ctx.lineWidth=4;
128
            that.pointDraw(that.options.lineColor);
129
            that.lineDraw(that.options.lineColor);
130
            that.$ctx.lineTo(x,y);
131
            that.$ctx.stroke();
132
        };
133
134
135
136
        this.pointInList=function(poi,list){
137
            for (var p in list){
138
                if( poi["x"] == list[p]["x"] && poi["y"] == list[p]["y"]){
139
                    return ++p;
140
                }
141
            }
142
            return false;
143
        };
144
145
        this.touched=false;
146
        $(this.id).on ("mousedown touchstart",{that:that},function(e){
147
            e.data.that.touched=true;
148
        });
149
        $(this.id).on ("mouseup touchend",{that:that},function(e){
150
            e.data.that.touched=false;
151
            that.$ctx.clearRect(0,0,that.options.width,that.options.height);
152
            that.$ctx.beginPath();
153
            that.$ctx.putImageData(e.data.that.initImg,0,0);
154
            that.allDraw(that.options.lineColor);
155
            // that.$ctx.stroke();
156
            for(var p in that.sList){
157
                if(e.data.that.pointInList(that.sList[p], e.data.that.pList)){
158
                    e.data.that.result= e.data.that.result+(e.data.that.pointInList(that.sList[p], e.data.that.pList)).toString();
159
                }
160
            }
161
            $(element).trigger("hasPasswd",that.result);
162
        });
163
164
        //
165
        $(this.id).on('touchmove mousemove',{that:that}, function(e) {
166
            if(e.data.that.touched){
167
                var x= e.pageX || e.originalEvent.targetTouches[0].pageX ;
168
                var y = e.pageY || e.originalEvent.targetTouches[0].pageY;
169
                x=x-that.$element.offset().left;
170
                y=y-that.$element.offset().top;
171
                var p = e.data.that.isIn(x, y);
172
                //console.log(x)
173
                if(p != 0 ){
174
                    if ( !e.data.that.pointInList(p,e.data.that.sList)){
175
                        e.data.that.sList.push(p);
176
                    }
177
                }
178
               //console.log( e.data.that.sList);
179
                e.data.that.draw(x, y);
180
            }
181
182
        });
183
184
185
186
        $(this.id).on('passwdWrong',{that:that}, function(e) {
187
            that.$ctx.clearRect(0,0,that.options.width,that.options.height);
188
            that.$ctx.beginPath();
189
            that.$ctx.putImageData(that.initImg,0,0);
190
            that.allDraw("#cc1c21");
191
            that.result="";
192
            that.pList=[];
193
            that.sList=[];
194
195
            setTimeout(function(){
196
                that.$ctx.clearRect(0,0,that.options.width,that.options.height);
197
                that.$ctx.beginPath();
198
                that.initDraw()
199
            },500)
200
201
        });
202
203
204
        $(this.id).on('passwdRight',{that:that}, function(e) {
205
            that.$ctx.clearRect(0,0,that.options.width,that.options.height);
206
            that.$ctx.beginPath();
207
            that.$ctx.putImageData(that.initImg,0,0);
208
            that.allDraw("#00a254");
209
            that.result="";
210
            that.pList=[];
211
            that.sList=[];
212
            setTimeout(function(){
213
                that.$ctx.clearRect(0,0,that.options.width,that.options.height);
214
                that.$ctx.beginPath();
215
                that.initDraw()
216
            },500)
217
        });
218
219
        $(this.id).on('passwdDIY',{that:that}, function(e, color) {
220
            that.$ctx.clearRect(0,0,that.options.width,that.options.height);
221
            that.$ctx.beginPath();
222
            that.$ctx.putImageData(that.initImg,0,0);
223
            that.allDraw(color || that.options.lineColor);
224
            that.result="";
225
            that.pList=[];
226
            that.sList=[];
227
            setTimeout(function(){
228
                that.$ctx.clearRect(0,0,that.options.width,that.options.height);
229
                that.$ctx.beginPath();
230
                that.initDraw()
231
            },500)
232
        });
233
234
235
    };
236
237
238
    GesturePasswd.DEFAULTS = {
239
        zindex :100,
240
        roundRadii:25,
241
        pointRadii:6,
242
        space:30,
243
        width:240,
244
        height:240,
245
        lineColor:"#00aec7",
246
        backgroundColor:"#252736",
247
        color:"#FFFFFF"
248
    };
249
250
251
252
253
254
255
256
257
    function Plugin(option,arg) {
258
        return this.each(function () {
259
            var $this   = $(this);
260
            var options = $.extend({}, GesturePasswd.DEFAULTS, typeof option == 'object' && option);
261
            var data    = $this.data('GesturePasswd');
262
            var action  = typeof option == 'string' ? option : NaN;
263
            if (!data) $this.data('danmu', (data = new GesturePasswd(this, options)));
264
            if (action)	data[action](arg);
265
        })
266
    }
267
268
269
    $.fn.GesturePasswd             = Plugin;
270
    $.fn.GesturePasswd.Constructor = GesturePasswd;
271
272
273
274
});

+ 47 - 0
static-res/bj-skymarketing/gesture-pass.html

@ -0,0 +1,47 @@
1
<!doctype html>
2
<html>
3
<head>
4
    <meta charset="utf-8">
5
    <title>手势密码</title>
6
7
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1, maximum-scale=1"><!-- 宽度自动适配 -->
8
    <meta content="telephone=no" name="format-detection"/>
9
10
    <link rel="stylesheet" type="text/css" href="ipu/ui/css/ipuUI.css">
11
    <link rel="stylesheet" type="text/css" href="ipu/lib/mdi/css/mdi.css">
12
    <link rel="stylesheet" type="text/css" href="biz/css/base.css">
13
14
    <script src="ipu/lib/requirejs/require.min.js"></script>
15
    <script src="biz/js/require-config.js"></script>
16
    <script src="biz/js/gp.js"></script>
17
</head>
18
<body class="pages-gesture-pass">
19
<div class="ipu-flex-row ipu-flex-vertical">
20
    <div class="ipu-flex-col">
21
        <div class="pages-header">
22
            <header class="ipu-toolbar">
23
                <a class="ipu-fn-left link-back" href="javascript:history.back(-1);">
24
                    <i class="ipu-icon mdi mdi-chevron-left"></i>返回
25
                </a>
26
                <h1 class="ipu-toolbar-title">手势密码</h1>
27
            </header>
28
        </div>
29
    </div>
30
    <div class="ipu-flex-col ipu-flex-col-auto">
31
        <div class="gesture-info">
32
            <div class="gesture-msg">请设置手势密码,最少四位数字</div>
33
            <div class="gesture-error-msg">手势密码不正确,剩余尝试次数4次</div>
34
            <div id="gesturepwd"></div>
35
        </div>
36
37
    </div>
38
    <div class="ipu-flex-col">
39
        <div class="pass-footer">
40
            <a href="login.html">
41
                账号密码登录
42
            </a>
43
        </div>
44
    </div>
45
</div>
46
</body>
47
</html>

android-share - Nuosi Git Service

ipu的trunk版的android工程和服务端工程。

chengwb3 446c503804 集群推送第二版修改,调整P端增删改路由关系,M端查询等操作 8 gadi atpakaļ
..
log4j.properties 61ff9d2503 Merge branch 'master' of 9 gadi atpakaļ
memcache.xml 446c503804 集群推送第二版修改,调整P端增删改路由关系,M端查询等操作 8 gadi atpakaļ
server-config.xml 381dc7f09d 集群推送消息第一版提交 8 gadi atpakaļ
server-data.xml 446c503804 集群推送第二版修改,调整P端增删改路由关系,M端查询等操作 8 gadi atpakaļ
server-page.xml 22bd19543c 初始化 10 gadi atpakaļ
spring-config.xml 22bd19543c 初始化 10 gadi atpakaļ
spring-push.xml 381dc7f09d 集群推送消息第一版提交 8 gadi atpakaļ