item3.html
2.38 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
<div id="item3" class="page tabpanel out" data-form="show_hide">
<div id="item3-calendar"></div>
<div id="item3-urllist"></div>
</div>
<script type="text/javascript">
require(["Calendar", "UrlList"], function(Calendar, UrlList) {
new Calendar({
el: "item3-calendar",
container : "#item3",
option: {
basic : {
showLunar : true, //显示农历
showNew : true, //显示新建
showBack : true, //是否显示返回
expand : true //收缩开关,默认为true打开
},
action : {
type : "refreshUrlList",//点击日期动作refreshList刷新列表 refreshUrlList刷新url列表 refreshTimelinr刷新时间轴
target : "item3-urllist",//列表插件
dataFilter : {
field : "currdate", //字段设置,刷新列表时作为参数传入
},
dataReload : true
},
remark : "/mobilemode/mobile/demo/plugin/Calendar/data.jsp?action=remark",
//日期标记,支持数组和链接,当为链接时,可接收startDate和endDate两个输入参数,数组格式如下
/* [
{"date" : "2017-06-30"},
{"date" : "2017-07-15"},
{"date" : "2017-08-20"},
{"date" : "2017-10-28"},
{"date" : "2017-10-31"}
], */
callback : {
swipe : function(startDate, endDate){
console.log("滑动日历");
},
click : function(currDate){
console.log("点击日期");
},
add : function(currDate){
console.log(currDate+"新建");
}
}
}
}).render();
var urllist = new UrlList({
el: "item3-urllist",
option: {
url : "/mobilemode/mobile/demo/plugin/Calendar/data.jsp?action=getDatas",
pageSize : 3,
showset : {
titlefield : "{title}",
imgfield : "<img src='{avatar}' style='width:40px;height:40px;border-radius:40px;'/>",
otherfields : [
"内容:{content}",
"分类:{cat}",
"日期:{date}"
]
},
hideSearch : true,//是否隐藏查询
btns : [
{
text : "测试",
click : function(){
alert("点击测试按钮");
}
}
],
readonly : false, //是否只读
callback: {
click : function(data){
var title = encodeURIComponent(data.title);
var cat = encodeURIComponent(data.cat);
var content = encodeURIComponent(data.content);
$u("/mobilemode/mobile/demo/plugin/UrlList/detail.html?id="+data.id+"&title="+title+"&cat="+cat+"&content="+content, true);
}
}
}
});
urllist.render();
});
</script>