coupon.js
923 Bytes
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
define(function( require, exports, module ) {
var _Coverbox = require('coverbox')();
require( 'fancybox' );
require( 'validate' );
require( 'validate.extend' );
jQuery.validator.addMethod("coupon", function(value, element) {
var rs = false;
$.ajax({
type: 'GET',
url:'../cou.json',
async: false,
success: function(data){
for (var i=0,l=data['coupon'].length;i<l;i++){
if (value == data['coupon'][i]){
rs = true;
};
}
},
error: function(data){}
});
return rs;
}, "抱歉该兑换码不存在,请重新输入");
$(".act-exchange").fancybox({
padding: 0,
scrolling: 'visible'
})
//require.async(['validate.extend'], function() {
$(".k-validate").validate({
});
//});
$(".actsub").click(function(){
_Coverbox.tell('兑换成功!');
});
});