region.html
6.24 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>城市组件选择</title>
<link rel="stylesheet" type="text/css" href="../css/style/m-pickdate.css">
<link rel="stylesheet" type="text/css" href="../css/style/popup.css">
<link rel="stylesheet" type="text/css" href="../css/style/m-form.css">
<script type="text/javascript" src="http://static.nong12.com/static/newStatic/common/js/base/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="http://static.nong12.com/static/newStatic/common/js/base/sea.js"></script>
<style type="text/css">
label {
float: left;
line-height: 30px;
margin: 0 10px;
}
</style>
</head>
<body>
<ul>
<li>
<h1>城市选择组件</h1>
<h4>使用 : </h4>
<div class="cont">
<p>1、依赖js包 sea / jquery / Alert</p>
<p>2、依赖css包 fancybox / m-public</p>
</div>
<h4>创建 : </h4>
<div class="cont">
</div>
<h4>参数 : </h4>
<div class="cont">
<table>
<thead>
<tr>
<td>参数名称</td>
<td>参数类型</td>
<td>参数等级</td>
<td>参数详情</td>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>string</td>
<td>必填</td>
<td>获取城市地址url</td>
</tr>
<tr>
<td>setUrl</td>
<td>string</td>
<td>选填</td>
<td>设置初始化数据url</td>
</tr>
<tr>
<td>data</td>
<td>Array</td>
<td>选填</td>
<td>[0] 表单提交name<br/>
[1] 父节点id<br/>
[2] 子节点id<br/>
[3] 节点name<br/>
[4] 请求参数key<br/>
[5] 操作显示page<br/>
[6] 是否强制显示至设置层级(布尔值——选填)<br/>
</td>
</tr>
</tbody>
</table>
</div>
<h4>示例 : </h4>
<div class="cont clearfix">
<ul>
<li><label>城市展示:</label><div class="m-region" url="http://user.nong12.com//api/city/getCityJsonpList.do" ></div></li>
<li><label>设置默认地址:</label><div class="m-region" url="http://user.nong12.com//api/city/getCityJsonpList.do" setUrl="http://user.nong12.com/api/city/getParentCityJsonpList.do?cityId=1140304" ></div></li>
<li><label>设置选中层级展示:</label><div class="m-region" url="http://user.nong12.com//api/city/getCityJsonpList.do" data="city,parentId,regionId,regionName,parentId,1" ></div></li>
<li><label>强制层级显示:</label><div class="m-region" url="http://user.nong12.com//api/city/getCityJsonpList.do" data="city,parentId,regionId,regionName,parentId,1,0" ></div></li>
</ul>
<!--<div class="m-region" url="http://user.nong12.com//api/city/getCityJsonpList.do" ></div>-->
<!--<div class="m-region" id="ceshi-1" url="http://user.nong12.com//api/city/getCityJsonpList.do" setUrl="http://user.nong12.com/api/city/getParentCityJsonpList.do?cityId=" ></div>-->
<!--<div class="m-region" url="http://user.nong12.com//api/city/getCityJsonpList.do" ></div>-->
<!--<div class="m-region" url="http://user.nong12.com//api/city/getCityJsonpList.do" ></div>-->
<!--<div class="m-region" url="http://user.nong12.com//api/city/getCityJsonpList.do" ></div>-->
<!--<div class="m-region" url="http://shop.nong12.com/shop/common/jsonpCategory" setUrl="http://shop.nong12.com/shop/common/jsonpGetParentCategories?categoryId=552" data="category,pcid,cid,cname,cid,1,0" ></div>-->
<!--<div class="m-region" url="http://user.nong12.com//api/city/getCityJsonpList.do" data="city,parentId,regionId,regionName,parentId,1" ></div>-->
<!--<div class="click-ceshi">点击测试</div>-->
</div>
</li>
</ul>
</body>
<script type="text/javascript" src="../js/javascript/common/config.js"></script>
<script type="text/javascript" src="http://static.nong12.com/static/newStatic/common/js/ui/regionbox.js"></script>
<script type="text/javascript">
seajs.use(['../js/javascript/region/main.js']);
/*
$(function(){
//var ml = region.aRegion("#ceshi-1");
//setTimeout(function(){
//ml.update();
//}, 3000);
region.start();
var kkk = true;
$(".click-ceshi").click(function(){
if(kkk){
$("#ceshi-1").attr("setUrl", "http://user.nong12.com/api/city/getParentCityJsonpList.do?cityId=1431304")
kkk = false;
}else{
$("#ceshi-1").attr("setUrl", "http://user.nong12.com/api/city/getParentCityJsonpList.do?cityId=1440802")
kkk = true;
};
ml.update();
});
});
*/
</script>
</html>