demo.html
2.11 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
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
<div id="fcheck_page" class="page out" data-title="check框">
	<div class="page-content" id="fcheck_content">
		<div id="fcheck-header"></div>
		<div id="fcheck-form"></div>
		<div id="fcheck1"></div>
		<div id="fcheck2"></div>
		<div id="fcheck-fbutton"></div>
	</div>
</div>
<script>
require(["NavHeader", "Form", "FCheck", "FButton", "mUtil"], function(NavHeader, Form, FCheck, FButton, mUtil) {
	var _u = require("mUtil");
	var hasClsPicker = typeof clsPicker !== "undefined";
	if(!hasClsPicker) {
		new NavHeader({
			el: "fcheck-header",
			option: {
				title: "表单-Check框",
				smallTitle: "fcheck"
			}
		}).render();
	}
	
	new Form({
		el: "fcheck-form",
		option: {
			submit : {
				action : "/mobilemode/mobile/demo/plugin/Form/formAction.jsp",//提交地址
				validate : function(){
					//表单提交前验证脚本
				}
			}
		}
	}).render();
	
	new FCheck({
		el: "fcheck1",
		option: {
			form : "fcheck-form",//所属表单id
			field : {
				label : "可编辑",
				name : "check1"
			}
		}
	}).render().then(function () {
		if (!hasClsPicker) return;
		_u.vetically("#fcheck1");
		clsPicker.golalSetting({
			container: ".wev-comp-FCheck",
			type: "FCheck"
		});
		new clsPicker({
			selector: ".wev-toggle",
			text: ".wev-toggle",
			lineYSkew: 20
		});
		new clsPicker({
			selector: ".wev-toggle-handle",
			text: ".wev-toggle-handle",
			lineYSkew: 20,
			position: "top right"
		});
	});
	
	if(!hasClsPicker) {
		new FCheck({
			el: "fcheck2",
			option: {
				form : "fcheck-form",//所属表单id
				field : {
					label : "只读", //必填
					name : "check2",//必填  字段NAME
					value : 1
				},
				readonly:true
			}
		}).render();
		
		
		new FButton({
			el: "fcheck-fbutton",
			container: "#fcheck_page",
			option: {
				form : "fcheck-form",
				btns : [
					{
						text : "重置",
						action : "reset"
					},
					{
						text : "提交",
						action : "submit",
						callback : function(billid) {
							console.log(billid);
						},
						remindMsg : "操作成功"
					}
				],
				fixed : true
			}
		}).render();
	}
	mUtil.trigger('load');//页面渲染完成回调
});
</script>