Authored by htoooth

Merge branch 'develop' of http://git.yoho.cn/fe/yoho-blk into passport

No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Wed Jul 13 10:51:38 2016
Created by FontForge 20120731 at Wed Jul 13 11:11:58 2016
By admin
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Wed Jul 13 10:51:38 2016
bbox="0 -224 1303 896.303"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E63F"
unicode-range="U+0078-E642"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -207,5 +207,28 @@ t-8 -38q-7 -66 45.5 -112t137.5 -46q83 0 145 35.5t121 106.5q94 -45 320 -143zM298
d="M647 284q29 54 52 113t31 91l8 32h-12h-104h-109v85h267v37h-267v127h-121v-127h-242v-37h242v-85h-206v-36h418q0 -6 -6 -12q0 -43 -54 -152q-45 18 -86.5 31t-74 21t-63 12t-52.5 5t-43.5 -1t-34.5 -4t-27 -7t-20 -7.5t-14.5 -7.5t-9.5 -5q-42 -30 -65 -64t-26.5 -65
t3 -61t22 -54t32 -42t31.5 -27.5t21 -8.5q272 -60 455 158q6 -6 18 -6q30 -16 127 -63t179 -86l82 -39v182q-7 0 -19.5 2t-30 6.5t-34 8.5t-41.5 12t-42.5 13.5t-47.5 15t-45.5 15t-47.5 16.5zM489 229q-43 -54 -93.5 -87t-91 -43t-82 -8.5t-61.5 6.5t-36 11
q-26 7 -43.5 32.5t-21 55.5t11.5 60.5t47 45.5q54 17 108.5 19t105 -10.5t87.5 -27t81 -35.5zM489 229z" />
<glyph glyph-name="uniE640" unicode="&#xe640;"
d="M-57 853zM743 324q-16 4 -21 10.5t-2 11.5l3 6q2 1 3 3.5t4 9.5t5 14t3 17.5t-0.5 20t-6.5 20.5t-14 20q-16 15 -40.5 19.5t-49.5 0.5t-47 -10t-36 -11l-15 -7q-11 -3 -18 -4t-11 0.5t-6 3t-1.5 7.5t1 10.5t2.5 14t3 15.5q0 13 -1.5 24.5t-7 26t-16 23t-26.5 14
t-41.5 3.5t-57.5 -13q-38 -13 -78 -39t-69 -54.5t-53.5 -54.5t-37.5 -43l-12 -18q-36 -47 -54 -94.5t-17 -71.5v-23q7 -53 33 -95t62 -68t84.5 -44.5t93 -26.5t94.5 -11q81 -7 169 12.5t163.5 66.5t106.5 114q19 38 19.5 72.5t-12 56t-31.5 38t-36 24t-31 9.5zM407 -19
q-119 -5 -202.5 46.5t-83.5 131.5q0 78 83 135t203 62.5t203 -40t83 -123.5q0 -79 -84.5 -142.5t-201.5 -69.5zM375 287q-32 -3 -57.5 -15t-40 -26.5t-24.5 -32t-13.5 -34t-4.5 -30t-1 -21.5l1 -9v-4q0 -3 2 -13t6 -18.5t12.5 -18.5t21.5 -16q72 -36 135 -22t102 64
q15 18 20 46t-2 56t-24.5 51t-52.5 35.5t-80 7.5zM335 78q-7 -1 -13 -0.5t-11 2.5t-9.5 4t-8 6t-6.5 7.5t-4.5 9t-1.5 10.5q0 12 6.5 23.5t18 20t26.5 9.5q10 1 19.5 -0.5t16 -5.5t11.5 -9t7 -11.5t2 -14.5q0 -12 -7 -23t-19.5 -18.5t-26.5 -9.5zM429 158q-8 -6 -16 -5.5
t-12 7.5l-2 4q-1 3 -1 5v4q0 4 1 6l2 4q1 2 4 3l3 5q9 7 17 5.5t12 -8.5q3 -5 2.5 -10.5t-3.5 -10.5t-7 -9zM821 388q6 0 11.5 3.5t9 8.5t4.5 10q1 2 1 4q13 126 -88 143q-30 6 -55 1q-8 0 -13.5 -3.5t-9.5 -10t-4 -12.5q0 -11 8 -19t19 -8q86 20 92 -55q2 -19 -2 -35
q0 -11 8 -19t19 -8zM802 700q-49 11 -130 -5q-1 0 -3 -1l-1 -2l-1 -1q-12 -4 -19.5 -14.5t-7.5 -22.5q0 -16 11 -27t26 -11h3q2 0 5.5 1t8 1.5t9.5 2t9 3.5t15 2t27 -2t35 -8.5t38.5 -16.5t39 -27.5t33.5 -40.5q29 -65 11 -126q0 -1 -0.5 -2t-1.5 -5.5t-2 -8.5l-3 -10
q-1 -6 -1 -10q0 -10 5.5 -17t14 -9.5t19.5 -2.5q31 0 36 37q14 43 15.5 82.5t-5.5 69t-21.5 55.5t-33.5 44.5t-42 33t-44.5 23.5t-44.5 15z" />
<glyph glyph-name="uniE641" unicode="&#xe641;"
d="M971 143l-2 18l-3 17l-3 9l-2 9l-3 9l-4 10l-3 10l-4 9l-8 16l-6 14l-7 13l-5 11l-7 11l-5 9l-10 15l-12 19l-3 5l-1 2v1l2 7l3 6l2 11l2 6v6v5v5v6l-1 4l-2 10l-2 9l-3 8l-3 8l-4 7l-3 7l-3 6l-6 9l-2 3v2l-3 18l-1 11l-2 14l-3 15l-4 17l-3 9l-2 8l-3 9l-3 10l-3 9
l-4 10l-8 19l-5 9l-6 10l-5 9l-6 10l-7 10l-7 8l-8 10l-8 8l-8 8l-9 9l-5 3l-5 4l-11 7l-12 8l-12 7l-13 7l-13 6l-13 6l-14 4l-15 4l-13 4l-15 3l-13 4l-15 1l-14 2l-15 2h-15h-14h-14l-14 -1l-14 -2l-14 -2l-13 -2l-14 -3l-13 -3l-13 -4l-12 -4l-12 -4l-12 -6l-12 -5
l-10 -6l-10 -6l-10 -7l-10 -8l-8 -7l-12 -12l-10 -10l-10 -11l-9 -11l-9 -11l-7 -10l-7 -11l-4 -5l-3 -6l-7 -10l-5 -10l-5 -10l-4 -10l-4 -9l-3 -9l-3 -9l-4 -8l-4 -16l-3 -15l-1 -12l-2 -11v-8v-7v-6l-3 -3l-3 -4l-2 -4l-2 -4l-2 -9l-3 -9v-7l-1 -6v-6l-6 -8l-4 -9l-3 -8
l-2 -7l-2 -7l-2 -6v-6v-6v-5l1 -4l2 -7l1 -6l-3 -3l-9 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-7l4 -5l4 -7l5 -7l4 -5l3 -2l2 -3l2 -1l3 -2l4 -2l3 -1h2h2l2 1l4 1l3 2l3 2l3 3l3 4l2 3l3 5l2 3l2 6l2 4l3 11
l2 12l2 14l1 8v6v7v9z" />
<glyph glyph-name="uniE642" unicode="&#xe642;" horiz-adv-x="1220"
d="M1068 -101l33 -111l-119 67q-86 -22 -129 -22q-101 0 -185.5 43t-133 117.5t-48.5 162t48.5 162t133 117.5t185.5 43q96 0 180.5 -43t135 -118t50.5 -162q0 -71 -40.5 -136.5t-110.5 -119.5zM734 300q-16 0 -29.5 -14t-13.5 -30.5t13.5 -30.5t29.5 -14q23 0 38.5 13.5
t15.5 31t-15.5 31t-38.5 13.5zM971 300q-16 0 -29.5 -14t-13.5 -30.5t13.5 -30.5t29.5 -14q24 0 39 13.5t15 31t-15 31t-39 13.5zM459 150q0 -46 13 -93q-22 -2 -40 -2q-16 0 -30.5 1t-32 4t-27 4.5t-32 6.5t-30.5 6l-150 -78l43 134q-173 125 -173 301q0 104 58 191
t157.5 137t216.5 50q159 0 283 -89t152 -223q-23 2 -42 2q-100 0 -184.5 -47t-133 -128t-48.5 -177zM291 623q-25 0 -45 -16t-20 -40t20 -39.5t45 -15.5t39.5 15t14.5 40t-14.5 40.5t-39.5 15.5zM593 623q-25 0 -44.5 -16t-19.5 -40t19.5 -39.5t44.5 -15.5t39.5 15t14.5 40
t-14.5 40.5t-39.5 15.5z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -34,6 +34,10 @@
dist: '320102' // 区县
});
或者
address.setAddress("320102");
重置地址:
address.reset();
... ...
... ... @@ -191,6 +191,27 @@ function fetchInitialData(evt, config, level) {
});
}
// 设置地址: 省,市,区县
function renderDistrict(distIds, currentLevels, config) {
// 标识需要渲染几级
var distLen = distIds.sort().length,
cursor = distLen, // 游标
areaId, // 请求areaId
defaultId, // 设置areaId
$el = $(config.el);
// 最后一个level是0
while (distLen > 1) {
// 请求从array[0], 判断值从array[1]
areaId = distIds[cursor - distLen];
defaultId = distIds[cursor - distLen + 1];
config.url = setRequestUrl(config, areaId);
$el.trigger('ca.setAddr', [config, currentLevels - 1, defaultId]);
distLen--;
currentLevels--;
}
}
// 设置地址
function setAddress(evt, config, level, areaId) {
var ajaxSettings = $.extend({}, config.ajaxSettings, {
... ... @@ -405,13 +426,8 @@ CascadingAddress.prototype.getAreaIds = function() {
CascadingAddress.prototype.setAddress = function(targetAddr) {
var key,
distIds = ['0'], // 省份请求areaId=0
distLen,
cursor, // 游标
currentLevels = $('.items-indicator>li').length, // 目前存在几级
areaId, // 请求areaId
defaultId, // 设置areaId
config = this.config,
$el = $(config.el);
config = this.config;
if (typeof targetAddr === 'object') {
for (key in targetAddr) {
... ... @@ -419,23 +435,12 @@ CascadingAddress.prototype.setAddress = function(targetAddr) {
distIds.push(targetAddr[key]);
}
}
// 标识需要渲染几级
distLen = distIds.sort().length;
cursor = distLen;
// 最后一个level是0
while (distLen > 1) {
// 请求从array[0], 判断值从array[1]
areaId = distIds[cursor - distLen];
defaultId = distIds[cursor - distLen + 1];
config.url = setRequestUrl(config, areaId);
$el.trigger('ca.setAddr', [config, currentLevels - 1, defaultId]);
distLen--;
currentLevels--;
}
renderDistrict(distIds, currentLevels, config);
} else if (typeof targetAddr === 'string' && targetAddr.length === 6) {
distIds = [0, targetAddr.substr(0, 2), targetAddr.substr(0, 4), targetAddr.substr(0, 6)];
renderDistrict(distIds, currentLevels, config);
} else {
console.error('target address must be a json object');
console.error('target address must be a json object or areaId string');
}
};
... ...