accountManage.js
1.4 KB
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
define(function( require, exports, module ) {
/*
引入包
*/
require( 'fancybox' );
require( 'validate' );
require( 'validate.extend' );
$(function(){
//显示选择图片弹框
$( ".upload-btn" ).fancybox({
padding: 0
});
//选择图片
$( ".li-img" ).live({
click: function(){
$( ".li-img" ).removeClass("on");
$(this).addClass("on");
},
dblclick: function(){
var img = $(this).find( "img" ).attr("src");
console.log(img)
$( ".li-img" ).removeClass("on");
$(this).addClass("on");
$(".file-img").attr( "src", img );
$( ".upload-area" ).css({
background: 'none'
});
$.fancybox.close();
}
});
$( ".s-f-confirm" ).click(function(){
var img = $(this).parent().parent().find( ".on img" ).attr("src");
$(".file-img").attr( "src", img );
$( ".upload-area" ).css({
background: 'none'
});
$.fancybox.close();
});
jQuery.validator.addClassRules({
trytry: {
required: true,
minlength: 2
},
zip: {
required: true,
digits: true,
minlength: 5,
maxlength: 5
}
});
jQuery.validator.addMethod("product-max", function (value, element, param) {
return this.optional( element ) || parseInt( value ) <= parseInt( param );
}, "不能超过商品总金额");
require.async( ['validate.extend'], function(){
$(".k-validate").validate({
});
} );
});
});