demo.html
2.9 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
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
<div id="fscores_page" class="page out" data-title="星级评分">
<div class="page-content" id="fscores_content">
<div id="fscores-header"></div>
<div id="fscores-form"></div>
<div id="fscores1"></div>
<div id="fscores2"></div>
<div id="fscores-fbutton"></div>
</div>
</div>
<script>
require(["NavHeader", "Form", "FScores", "FButton", "mUtil"], function(NavHeader, Form, FScores, FButton, mUtil) {
var _u = require("mUtil");
var hasClsPicker = typeof clsPicker !== "undefined";
if(!hasClsPicker) {
new NavHeader({
el: "fscores-header",
option: {
title:"表单-星级评分",
smallTitle:"fscores"
}
}).render();
new Form({
el: "fscores-form",
option: {
submit : {
action : "/mobilemode/mobile/demo/plugin/Form/formAction.jsp",//提交地址
validate : function(){
//表单提交前验证脚本
}
}
}
}).render();
}
new FScores({
el: "fscores1",
option: {
form : "fscores-form",
field : {
label : "服务态度",//显示名称
name : "f1",//对应字段
size : 5,// 评分个数
text : "非常差,差,一般,好,非常好",//评分名称
value : 4//评分
},
required : true,
readonly : false
}
}).render().then(function () {
if (!hasClsPicker) return;
_u.vetically("#fscores1");
clsPicker.golalSetting({
container: ".wev-comp-FScores",
type: "FScores"
});
new clsPicker({
selector: ".wev-field",
text: ".wev-field",
lineYSkew: 20
});
new clsPicker({
selector: ".wev-field>div:nth-child(1)",
text: " ",
lineYSkew: 50,
position: "top right"
});
new clsPicker({
selector: ".wev-comp-score>b",
text: " ",
lineYSkew: 20,
position: "top right"
});
new clsPicker({
selector: ".wev-comp-score label",
text: " ",
lineYSkew: 20,
position: "top right"
});
new clsPicker({
selector: ".wev-field>div:nth-child(2)",
text: " ",
lineYSkew: 50,
position: "top right"
});
});
if(!hasClsPicker) {
new FScores({
el: "fscores2",
option: {
form : "fscores-form",
field : {
label : "满意度",//显示名称
name : "f2",//对应字段
size : 5,// 评分个数
text : "很不满意,不满意,一般,好,非常满意",//评分名称
value : 3//评分
},
required : false,
readonly : false,
icons : {
icon1 : "/mobilemode/mobile/images/demo/smile.png",
icon2 : "/mobilemode/mobile/images/demo/sad.png"
}
}
}).render();
new FButton({
el: "fscores-fbutton",
container: "#fscores_page",
option: {
form : "fscores-form",
btns : [
{
text : "重置",
action : "reset"
},
{
text : "提交",
action : "submit",
callback : function(billid) {
console.log(billid);
},
remindMsg : "操作成功"
}
],
fixed : true
}
}).render();
}
mUtil.trigger('load');//页面渲染完成回调
});
</script>