feat: 后端全量更新 - 含所有本次需求
- Contract.php: 返回合约账户余额(balance_contract) - My.php: 地址管理增加BTC/ETH - AppContract.php: 一键平仓(closeall) - AppProxy.php: 代理专属注册链接 + 分级权限(L1/L2) - site.php: 手续费减半(0.018→0.009) - agent_permission_setup.sql: 代理权限SQL - crypto_news_crawler.py: 新闻自动采集脚本
This commit is contained in:
+4062
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,544 @@
|
||||
/*!
|
||||
* CityPicker v@VERSION
|
||||
* https://github.com/tshi0912/citypicker
|
||||
*
|
||||
* Copyright (c) 2015-@YEAR Tao Shi
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: @DATE
|
||||
*
|
||||
* changed by warlee;
|
||||
* arrayPicker
|
||||
*/
|
||||
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as anonymous module.
|
||||
define(['jquery', 'ChineseDistricts'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node / CommonJS
|
||||
factory(require('jquery'), require('ChineseDistricts'));
|
||||
} else {
|
||||
// Browser globals.
|
||||
factory(jQuery, ChineseDistricts);
|
||||
}
|
||||
})(function ($, ChineseDistricts) {
|
||||
'use strict';
|
||||
if (typeof ChineseDistricts === 'undefined') {
|
||||
throw new Error('The file "city-picker.data.js" must be included first!');
|
||||
}
|
||||
var NAMESPACE = 'citypicker';
|
||||
var EVENT_CHANGE = 'change.' + NAMESPACE;
|
||||
var PROVINCE = 'province';
|
||||
var CITY = 'city';
|
||||
var DISTRICT = 'district';
|
||||
|
||||
function CityPicker(element, options) {
|
||||
this.$element = $(element);
|
||||
this.$dropdown = null;
|
||||
this.options = $.extend({}, CityPicker.DEFAULTS, $.isPlainObject(options) && options);
|
||||
this.active = false;
|
||||
this.dems = [];
|
||||
this.needBlur = false;
|
||||
this.init();
|
||||
}
|
||||
$.fn.extend({
|
||||
offsetWindow:function(){
|
||||
var info = $(this).get(0).getBoundingClientRect();
|
||||
return {
|
||||
top:info.top,
|
||||
left:info.left,
|
||||
bottom:$(window).height() - info.top - $(this).outerHeight(),
|
||||
right: $(window).width() - info.left - $(this).outerWidth(),
|
||||
}
|
||||
}
|
||||
});
|
||||
CityPicker.prototype = {
|
||||
constructor: CityPicker,
|
||||
init: function () {
|
||||
this.defineDems();
|
||||
this.render();
|
||||
this.bind();
|
||||
this.active = true;
|
||||
},
|
||||
render: function () {
|
||||
var p = this.getPosition(),
|
||||
placeholder = this.$element.attr('placeholder') || this.options.placeholder,
|
||||
textspan = '<span class="city-picker-span" style="height:' +
|
||||
p.height+'px;line-height:' + (p.height - 1) + 'px;">' +
|
||||
(placeholder ? '<span class="placeholder">' + placeholder + '</span>' : '') +
|
||||
'<span class="title"></span><div class="arrow"></div></span>',
|
||||
dropdown = '<div class="city-picker-dropdown" style="left:0px;top:100%;">' +
|
||||
'<div class="city-select-wrap">' +
|
||||
'<div class="city-select-tab">' +
|
||||
'<a class="active" data-count="province">省份</a>' +
|
||||
(this.includeDem('city') ? '<a data-count="city">城市</a>' : '') +
|
||||
(this.includeDem('district') ? '<a data-count="district">区县</a>' : '') + '</div>' +
|
||||
'<div class="city-select-content">' +
|
||||
'<div class="city-select province" data-count="province"></div>' +
|
||||
(this.includeDem('city') ? '<div class="city-select city" data-count="city"></div>' : '') +
|
||||
(this.includeDem('district') ? '<div class="city-select district" data-count="district"></div>' : '') +
|
||||
'</div></div>';
|
||||
|
||||
this.$element.addClass('city-picker-input');
|
||||
this.$textspan = $(textspan).insertAfter(this.$element);
|
||||
// this.$dropdown = $(dropdown).insertAfter(this.$textspan);
|
||||
this.$dropdown = $(dropdown).appendTo('body');
|
||||
var $select = this.$dropdown.find('.city-select');
|
||||
|
||||
var padding = parseInt(this.$textspan.css("padding-left"))+ parseInt(this.$textspan.css("padding-right"));
|
||||
this.$textspan.css({'min-width':p.width-padding});
|
||||
|
||||
// setup this.$province, this.$city and/or this.$district object
|
||||
$.each(this.dems, $.proxy(function (i, type) {
|
||||
this['$' + type] = $select.filter('.' + type + '');
|
||||
}, this));
|
||||
this.refresh();
|
||||
},
|
||||
refresh: function (force) {
|
||||
var $select = this.$dropdown.find('.city-select');
|
||||
$select.data('item', null);
|
||||
var val = this.$element.val() || '';
|
||||
val = val.split('/');
|
||||
$.each(this.dems, $.proxy(function (i, type) {
|
||||
if (val[i] && i < val.length) {
|
||||
this.options[type] = val[i];
|
||||
} else if (force) {
|
||||
this.options[type] = '';
|
||||
}
|
||||
this.output(type);
|
||||
}, this));
|
||||
this.tab(PROVINCE);
|
||||
this.feedText();
|
||||
this.feedVal();
|
||||
},
|
||||
defineDems: function () {
|
||||
var stop = false;
|
||||
$.each([PROVINCE, CITY, DISTRICT], $.proxy(function (i, type) {
|
||||
if (!stop) {
|
||||
this.dems.push(type);
|
||||
}
|
||||
if (type === this.options.level) {
|
||||
stop = true;
|
||||
}
|
||||
}, this));
|
||||
},
|
||||
includeDem: function (type) {
|
||||
return $.inArray(type, this.dems) !== -1;
|
||||
},
|
||||
getPosition: function () {
|
||||
var p, h, w, s, pw;
|
||||
p = this.$element.position();
|
||||
s = this.getSize(this.$element);
|
||||
h = s.height;
|
||||
w = s.width;
|
||||
return {
|
||||
top: p.top || 0,
|
||||
left: p.left || 0,
|
||||
height: h,
|
||||
width: w
|
||||
};
|
||||
},
|
||||
getSize: function ($dom) {
|
||||
var $wrap, $clone, sizes;
|
||||
if (!$dom.is(':visible')) {
|
||||
$wrap = $("<div />").appendTo($("body"));
|
||||
$wrap.css({
|
||||
"position": "absolute !important",
|
||||
"visibility": "hidden !important",
|
||||
"display": "block !important"
|
||||
});
|
||||
$clone = $dom.clone().appendTo($wrap);
|
||||
sizes = {
|
||||
width: $clone.outerWidth(),
|
||||
height: $clone.outerHeight()
|
||||
};
|
||||
$wrap.remove();
|
||||
} else {
|
||||
sizes = {
|
||||
width: $dom.outerWidth(),
|
||||
height: $dom.outerHeight()
|
||||
};
|
||||
}
|
||||
return sizes;
|
||||
},
|
||||
bind: function () {
|
||||
var $this = this;
|
||||
$(document).on('click', (this._mouteclick = function (e) {
|
||||
var $target = $(e.target);
|
||||
var $dropdown, $span, $input;
|
||||
if ($target.is('.city-picker-span')) {
|
||||
$span = $target;
|
||||
} else if ($target.is('.city-picker-span *')) {
|
||||
$span = $target.parents('.city-picker-span');
|
||||
}
|
||||
if ($target.is('.city-picker-input')) {
|
||||
$input = $target;
|
||||
}
|
||||
if ($target.is('.city-picker-dropdown')) {
|
||||
$dropdown = $target;
|
||||
} else if ($target.is('.city-picker-dropdown *')) {
|
||||
$dropdown = $target.parents('.city-picker-dropdown');
|
||||
}
|
||||
if ((!$input && !$span && !$dropdown) ||
|
||||
($span && $span.get(0) !== $this.$textspan.get(0)) ||
|
||||
($input && $input.get(0) !== $this.$element.get(0)) ||
|
||||
($dropdown && $dropdown.get(0) !== $this.$dropdown.get(0))) {
|
||||
$this.close(true);
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
this.$element.on('change', (this._changeElement = $.proxy(function () {
|
||||
this.close(true);
|
||||
this.refresh(true);
|
||||
}, this))).on('focus', (this._focusElement = $.proxy(function () {
|
||||
this.needBlur = true;
|
||||
this.open();
|
||||
}, this))).on('blur', (this._blurElement = $.proxy(function () {
|
||||
if (this.needBlur) {
|
||||
this.needBlur = false;
|
||||
this.close(true);
|
||||
}
|
||||
}, this)));
|
||||
|
||||
this.$textspan.on('click', function (e) {
|
||||
var $target = $(e.target), type;
|
||||
$this.needBlur = false;
|
||||
if ($target.is('.select-item')) {
|
||||
type = $target.data('count');
|
||||
$this.open(type);
|
||||
} else {
|
||||
if ($this.$dropdown.is(':visible')) {
|
||||
$this.close();
|
||||
} else {
|
||||
$this.open();
|
||||
}
|
||||
}
|
||||
}).on('mousedown', function () {
|
||||
$this.needBlur = false;
|
||||
});
|
||||
|
||||
this.$dropdown.on('click', '.city-select a', function () {
|
||||
var $select = $(this).parents('.city-select');
|
||||
var $active = $select.find('a.active');
|
||||
var last = $select.next().length === 0;
|
||||
$active.removeClass('active');
|
||||
$(this).addClass('active');
|
||||
if ($active.data('code') !== $(this).data('code')) {
|
||||
$select.data('item', {
|
||||
address: $(this).data('title'),
|
||||
code: $(this).data('code')
|
||||
});
|
||||
$(this).trigger(EVENT_CHANGE);
|
||||
$this.feedText();
|
||||
$this.feedVal(true);
|
||||
if (last) {
|
||||
$this.close();
|
||||
}
|
||||
}
|
||||
}).on('click', '.city-select-tab a', function () {
|
||||
if (!$(this).hasClass('active')) {
|
||||
var type = $(this).data('count');
|
||||
$this.tab(type);
|
||||
}
|
||||
}).on('mousedown', function () {
|
||||
$this.needBlur = false;
|
||||
});
|
||||
|
||||
if (this.$province) {
|
||||
this.$province.on(EVENT_CHANGE, (this._changeProvince = $.proxy(function () {
|
||||
this.output(CITY);
|
||||
this.output(DISTRICT);
|
||||
this.tab(CITY);
|
||||
}, this)));
|
||||
}
|
||||
if (this.$city) {
|
||||
this.$city.on(EVENT_CHANGE, (this._changeCity = $.proxy(function () {
|
||||
this.output(DISTRICT);
|
||||
this.tab(DISTRICT);
|
||||
}, this)));
|
||||
}
|
||||
},
|
||||
resetPosition:function(){
|
||||
var pose = this.$textspan.offsetWindow();
|
||||
var margin = 3;
|
||||
var top = this.$textspan.offset().top + this.$textspan.outerHeight() + margin;
|
||||
this.$dropdown.removeClass("position-top");
|
||||
if(pose.bottom <= 300 && pose.top>300){
|
||||
top = this.$textspan.offset().top - this.$dropdown.outerHeight() - margin;
|
||||
this.$dropdown.addClass("position-top");
|
||||
}
|
||||
|
||||
this.$dropdown.css({
|
||||
left:this.$textspan.offset().left,
|
||||
top:top
|
||||
});
|
||||
},
|
||||
open: function (type) {
|
||||
type = type || PROVINCE;
|
||||
this.$dropdown.show();
|
||||
this.$textspan.addClass('open').addClass('focus');
|
||||
this.tab(type);
|
||||
},
|
||||
close: function (blur) {
|
||||
this.$dropdown.hide();
|
||||
this.$textspan.removeClass('open');
|
||||
if (blur) {
|
||||
this.$textspan.removeClass('focus');
|
||||
}
|
||||
},
|
||||
unbind: function () {
|
||||
$(document).off('click', this._mouteclick);
|
||||
this.$element.off('change', this._changeElement);
|
||||
this.$element.off('focus', this._focusElement);
|
||||
this.$element.off('blur', this._blurElement);
|
||||
|
||||
this.$textspan.off('click');
|
||||
this.$textspan.off('mousedown');
|
||||
|
||||
this.$dropdown.off('click');
|
||||
this.$dropdown.off('mousedown');
|
||||
if (this.$province) {
|
||||
this.$province.off(EVENT_CHANGE, this._changeProvince);
|
||||
}
|
||||
if (this.$city) {
|
||||
this.$city.off(EVENT_CHANGE, this._changeCity);
|
||||
}
|
||||
},
|
||||
getText: function () {
|
||||
var text = '';
|
||||
this.$dropdown.find('.city-select')
|
||||
.each(function () {
|
||||
var item = $(this).data('item'),
|
||||
type = $(this).data('count');
|
||||
if (item) {
|
||||
text += ($(this).hasClass('province') ? '' : '/') + '<span class="select-item" data-count="' +
|
||||
type + '" data-code="' + item.code + '">' + item.address + '</span>';
|
||||
}
|
||||
});
|
||||
return text;
|
||||
},
|
||||
getPlaceHolder: function () {
|
||||
return this.$element.attr('placeholder') || this.options.placeholder;
|
||||
},
|
||||
feedText: function () {
|
||||
var text = this.getText();
|
||||
if (text) {
|
||||
this.$textspan.find('>.placeholder').hide();
|
||||
this.$textspan.find('>.title').html(this.getText()).show();
|
||||
} else {
|
||||
this.$textspan.find('>.placeholder').text(this.getPlaceHolder()).show();
|
||||
this.$textspan.find('>.title').html('').hide();
|
||||
}
|
||||
},
|
||||
getCode: function (count) {
|
||||
var obj = {}, arr = [];
|
||||
this.$textspan.find('.select-item')
|
||||
.each(function () {
|
||||
var code = $(this).data('code');
|
||||
var count = $(this).data('count');
|
||||
obj[count] = code;
|
||||
arr.push(code);
|
||||
});
|
||||
return count ? obj[count] : arr.join('/');
|
||||
},
|
||||
getVal: function () {
|
||||
var text = '';
|
||||
this.$dropdown.find('.city-select')
|
||||
.each(function () {
|
||||
var item = $(this).data('item');
|
||||
if (item) {
|
||||
text += ($(this).hasClass('province') ? '' : '/') + item.address;
|
||||
}
|
||||
});
|
||||
return text;
|
||||
},
|
||||
feedVal: function (trigger) {
|
||||
this.$element.val(this.getVal());
|
||||
if(trigger) {
|
||||
this.$element.trigger('cp:updated');
|
||||
}
|
||||
},
|
||||
output: function (type) {
|
||||
var options = this.options;
|
||||
var $select = this['$' + type];
|
||||
var data = type === PROVINCE ? {} : [];
|
||||
var item;
|
||||
var districts;
|
||||
var code;
|
||||
var matched = null;
|
||||
var value;
|
||||
if (!$select || !$select.length) {
|
||||
return;
|
||||
}
|
||||
item = $select.data('item');
|
||||
value = (item ? item.address : null) || options[type];
|
||||
|
||||
code = (
|
||||
type === PROVINCE ? 86 :
|
||||
type === CITY ? this.$province && this.$province.find('.active').data('code') :
|
||||
type === DISTRICT ? this.$city && this.$city.find('.active').data('code') : code
|
||||
);
|
||||
|
||||
districts = $.isNumeric(code) ? ChineseDistricts[code] : null;
|
||||
|
||||
if ($.isPlainObject(districts)) {
|
||||
$.each(districts, function (code, address) {
|
||||
var provs;
|
||||
if (type === PROVINCE) {
|
||||
provs = [];
|
||||
for (var i = 0; i < address.length; i++) {
|
||||
if (address[i].address === value) {
|
||||
matched = {
|
||||
code: address[i].code,
|
||||
address: address[i].address
|
||||
};
|
||||
}
|
||||
provs.push({
|
||||
code: address[i].code,
|
||||
address: address[i].address,
|
||||
selected: address[i].address === value
|
||||
});
|
||||
}
|
||||
data[code] = provs;
|
||||
} else {
|
||||
if (address === value) {
|
||||
matched = {
|
||||
code: code,
|
||||
address: address
|
||||
};
|
||||
}
|
||||
data.push({
|
||||
code: code,
|
||||
address: address,
|
||||
selected: address === value
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$select.html(type === PROVINCE ? this.getProvinceList(data):this.getList(data, type));
|
||||
$select.data('item', matched);
|
||||
},
|
||||
getProvinceList: function (data) {
|
||||
var list = [],
|
||||
$this = this,
|
||||
simple = this.options.simple;
|
||||
|
||||
$.each(data, function (i, n) {
|
||||
list.push('<dl class="clearfix">');
|
||||
list.push('<dt>' + i + '</dt><dd>');
|
||||
$.each(n, function (j, m) {
|
||||
list.push(
|
||||
'<a' +
|
||||
' data-title="' + (m.address || '') + '"' +
|
||||
' data-code="' + (m.code || '') + '"' +
|
||||
' class="' +
|
||||
(m.selected ? ' active' : '') +
|
||||
'">' +
|
||||
( simple ? $this.simplize(m.address, PROVINCE) : m.address) +
|
||||
'</a>');
|
||||
});
|
||||
list.push('</dd></dl>');
|
||||
});
|
||||
|
||||
return list.join('');
|
||||
},
|
||||
getList: function (data, type) {
|
||||
var list = [],
|
||||
$this = this,
|
||||
simple = this.options.simple;
|
||||
list.push('<dl class="clearfix"><dd>');
|
||||
|
||||
$.each(data, function (i, n) {
|
||||
list.push(
|
||||
'<a' +
|
||||
' data-title="' + (n.address || '') + '"' +
|
||||
' data-code="' + (n.code || '') + '"' +
|
||||
' class="' +
|
||||
(n.selected ? ' active' : '') +
|
||||
'">' +
|
||||
( simple ? $this.simplize(n.address, type) : n.address) +
|
||||
'</a>');
|
||||
});
|
||||
list.push('</dd></dl>');
|
||||
|
||||
return list.join('');
|
||||
},
|
||||
simplize:function (address, type) {
|
||||
address = address || '';
|
||||
if (type === PROVINCE) {
|
||||
return address.replace(/[省,市,自治区,壮族,回族,维吾尔]/g, '');
|
||||
} else if (type === CITY) {
|
||||
return address.replace(/[市,地区,回族,蒙古,苗族,白族,傣族,景颇族,藏族,彝族,壮族,傈僳族,布依族,侗族]/g, '')
|
||||
.replace('哈萨克', '').replace('自治州', '').replace(/自治县/, '');
|
||||
} else if (type === DISTRICT) {
|
||||
return address.length > 2 ? address.replace(/[市,区,县,旗]/g, '') : address;
|
||||
}
|
||||
},
|
||||
tab: function (type) {
|
||||
var $selects = this.$dropdown.find('.city-select');
|
||||
var $tabs = this.$dropdown.find('.city-select-tab > a');
|
||||
var $select = this['$' + type];
|
||||
var $tab = this.$dropdown.find('.city-select-tab > a[data-count="' + type + '"]');
|
||||
if ($select) {
|
||||
$selects.hide();
|
||||
$select.show();
|
||||
$tabs.removeClass('active');
|
||||
$tab.addClass('active');
|
||||
}
|
||||
this.resetPosition();
|
||||
},
|
||||
reset: function () {
|
||||
this.$element.val(null).trigger('change');
|
||||
},
|
||||
destroy: function () {
|
||||
this.unbind();
|
||||
this.$element.removeData(NAMESPACE).removeClass('city-picker-input');
|
||||
this.$textspan.remove();
|
||||
this.$dropdown.remove();
|
||||
}
|
||||
};
|
||||
|
||||
CityPicker.DEFAULTS = {
|
||||
simple: false,
|
||||
level: 'district',
|
||||
province: '',
|
||||
city: '',
|
||||
district: ''
|
||||
};
|
||||
CityPicker.setDefaults = function (options) {
|
||||
$.extend(CityPicker.DEFAULTS, options);
|
||||
};
|
||||
CityPicker.other = $.fn.citypicker;
|
||||
$.fn.citypicker = function (option) {
|
||||
var args = [].slice.call(arguments, 1);
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var data = $this.data(NAMESPACE);
|
||||
var options;
|
||||
var fn;
|
||||
|
||||
if (!data) {
|
||||
if (/destroy/.test(option)) {
|
||||
return;
|
||||
}
|
||||
options = $.extend({}, $this.data(), $.isPlainObject(option) && option);
|
||||
$this.data(NAMESPACE, (data = new CityPicker(this, options)));
|
||||
}
|
||||
if (typeof option === 'string' && $.isFunction(fn = data[option])) {
|
||||
fn.apply(data, args);
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.citypicker.Constructor = CityPicker;
|
||||
$.fn.citypicker.setDefaults = CityPicker.setDefaults;
|
||||
$.fn.citypicker.noConflict = function () {
|
||||
$.fn.citypicker = CityPicker.other;
|
||||
return this;
|
||||
};
|
||||
$(function () {
|
||||
$('[data-toggle="city-picker"]').citypicker();
|
||||
});
|
||||
});
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
.city-picker-input, .city-picker-input[readonly] {
|
||||
background: #fff;
|
||||
color: rgba(0,0,0,0.001);
|
||||
border-radius: 0px;
|
||||
box-shadow: none;
|
||||
|
||||
display: none !important;
|
||||
}
|
||||
.city-picker-span {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
background: #fdfdfd;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #ddd;
|
||||
outline: 0;
|
||||
padding: 0 8px;
|
||||
min-width: 150px;
|
||||
color: #ccc;
|
||||
cursor: pointer;
|
||||
|
||||
width:auto;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.city-picker-dropdown{background:#fff;}
|
||||
.city-picker-dropdown.position-top{
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
.city-picker-dropdown.position-top .city-select-tab {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
padding: 0px 15px 9px 15px;
|
||||
border-top: 1px solid #dfe2e5;
|
||||
border-bottom: none;
|
||||
}
|
||||
.city-picker-dropdown.position-top .city-select-tab > a{
|
||||
margin-top: -1px;margin-bottom:0;
|
||||
}
|
||||
.city-picker-dropdown.position-top .city-select-tab > a.active {
|
||||
border-radius: 0;
|
||||
border-bottom-left-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
border-top: 1px solid #fff;
|
||||
}
|
||||
|
||||
|
||||
.city-picker-span > .placeholder {
|
||||
color: #aaa;
|
||||
}
|
||||
.city-picker-span > .arrow {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 8px;
|
||||
width: 10px;
|
||||
margin-top: -3px;
|
||||
height: 5px;
|
||||
}
|
||||
.city-picker-span.focus,
|
||||
.city-picker-span.open {
|
||||
/* border-color: #46A4FF;
|
||||
box-shadow: 1px 1px 5px rgba(70,165,255,0.2); */
|
||||
box-shadow: 0px -1px 5px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
|
||||
.city-picker-span.open > .arrow {
|
||||
background-position: -10px -10px;
|
||||
}
|
||||
span.city-picker-span:hover {
|
||||
border-color: #46A4FF;
|
||||
}
|
||||
|
||||
.city-picker-span > .title > span {
|
||||
color: #333;
|
||||
padding: 2px 4px;
|
||||
margin: 0 2px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.city-picker-span > .title > span:hover {
|
||||
background-color:#def;
|
||||
color:#46A4FF;
|
||||
}
|
||||
.city-picker-dropdown {
|
||||
position: absolute;
|
||||
width: 420px;
|
||||
left: -9999px;
|
||||
top: -9999px;
|
||||
outline: 0;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
z-index: 999999;
|
||||
display: none;
|
||||
min-width: 330px;
|
||||
border: 1px solid #d6d7d7;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 3px 12px rgba(0,0,0,.2);
|
||||
overflow: hidden;
|
||||
}
|
||||
.city-select-wrap {
|
||||
}
|
||||
.city-select-tab {
|
||||
border-bottom: 1px solid #dfe2e5;
|
||||
background: #f5f5f5;
|
||||
font-size: 13px;
|
||||
padding: 8px 15px 0 15px;
|
||||
}
|
||||
.city-select-tab > a {
|
||||
display: inline-block;
|
||||
padding: 4px 20px;
|
||||
border: 1px solid transparent;
|
||||
color: #777;
|
||||
text-align: center;
|
||||
outline: 0;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
.city-select-tab > a:hover{
|
||||
color: #46A4FF;
|
||||
}
|
||||
|
||||
.city-select-tab > a.active {
|
||||
background: #fff;
|
||||
color: #46A4FF;
|
||||
border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
|
||||
.city-select-content {
|
||||
width: 100%;
|
||||
min-height: 10px;
|
||||
background-color: #fff;
|
||||
padding: 10px 15px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.city-select {
|
||||
font-size: 13px;
|
||||
}
|
||||
.city-select dl {
|
||||
line-height: 2;
|
||||
clear: both;
|
||||
padding: 3px 0;
|
||||
margin: 0;
|
||||
border-bottom: 1px dotted #eee;
|
||||
}
|
||||
.city-select dl:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.city-select dt {
|
||||
position: absolute;
|
||||
width: 2.5em;
|
||||
font-weight: 500;
|
||||
text-align: right;
|
||||
line-height: 2;
|
||||
}
|
||||
.city-select dd {
|
||||
margin-left: 0;
|
||||
line-height: 2;
|
||||
}
|
||||
.city-select.province dd {
|
||||
margin-left: 3em;
|
||||
}
|
||||
.city-select a {
|
||||
display: inline-block;
|
||||
padding: 0 10px;
|
||||
outline: 0;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
margin-right: 2px;margin-bottom: 1px;
|
||||
text-decoration: none;
|
||||
color: #666;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.city-select a:hover,
|
||||
.city-select a:focus {
|
||||
background-color: #def;
|
||||
border-radius: 2px;
|
||||
color: #46A4FF;
|
||||
}
|
||||
.city-select a.active {
|
||||
background-color: #46A4FF;
|
||||
color: #fff;
|
||||
border-radius: 2px;
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="A simple jQuery plugin for picking provinces, cities and districts of China.">
|
||||
<meta name="author" content="Tao Shi">
|
||||
<title>city-picker</title>
|
||||
<link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.css" rel="stylesheet">
|
||||
<link href="./css/city-picker.css" rel="stylesheet">
|
||||
</head>
|
||||
<style>
|
||||
body{
|
||||
font-family: "Helvetica Neue", Helvetica, "Microsoft Yahei", 微软雅黑, "Lantinghei SC", STXihei;
|
||||
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
|
||||
<!-- header -->
|
||||
<header class="navbar navbar-static-top docs-header" id="top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button class="navbar-toggle" data-target="#navbar-collapse-1" data-toggle="collapse" type="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
<nav class="collapse navbar-collapse" id="navbar-collapse-1" role="navigation">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="http://tshi0912.github.io/city-picker/" target="_blank">Docs</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
<!-- Content -->
|
||||
<div class="container" style="margin-bottom:300px;">
|
||||
<h1 class="page-header" id="getting-started">使用说明</h1>
|
||||
<pre class="prettyprint">
|
||||
<script src="/path/to/city-picker.data.js"></script>
|
||||
<script src="/path/to/city-picker.js"></script>
|
||||
|
||||
<input readonly id="city-picker1" type="text" placeholder="请选择省/市" data-level="[province|city|district]" data-simple="true" >
|
||||
|
||||
$('#city-picker1').citypicker();
|
||||
</pre>
|
||||
|
||||
<h3>自定义初始数据</h3>
|
||||
<pre class="prettyprint"><div style="position: relative;"><!-- container -->
|
||||
<input readonly type="text" data-toggle="city-picker" value="北京市/北京市/海淀区">
|
||||
</div></pre>
|
||||
<h5>Demo:</h5>
|
||||
<form class="form-inline">
|
||||
<div style="position: relative;">
|
||||
<input class="form-control" readonly type="text" data-toggle="city-picker" value="北京市/北京市/海淀区">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<h3>定义选择到层级</h3>
|
||||
<pre class="prettyprint"><div style="position: relative;"><!-- container -->
|
||||
<input readonly type="text" data-toggle="city-picker" placeholder="请选择省/市" data-level="province" >
|
||||
</div></pre>
|
||||
<h5>Demo:</h5>
|
||||
<form class="form-inline">
|
||||
<div style="position: relative;">
|
||||
<input class="form-control" readonly type="text" data-toggle="city-picker" data-level="province"
|
||||
placeholder="请选择省份">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<h3>精简版地址</h3>
|
||||
<pre class="prettyprint"><div style="position: relative;"><!-- container -->
|
||||
<input readonly type="text" data-toggle="city-picker" data-simple="true" >
|
||||
</div></pre>
|
||||
<h5>Demo:</h5>
|
||||
<form class="form-inline">
|
||||
<div style="position: relative;">
|
||||
<input class="form-control" readonly type="text" data-toggle="city-picker" data-simple="true" placeholder="请选择省份">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.js"></script>
|
||||
<script src="http://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.js"></script>
|
||||
<script src="./city-picker.data.js"></script>
|
||||
<script src="./city-picker.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#city-picker1').citypicker();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user