├── 3.png
├── src
├── assets
│ └── logo.png
├── main.js
├── lib
│ ├── index.js
│ ├── demo.vue
│ ├── vueCity.vue
│ └── city.js
└── App.vue
├── .babelrc
├── .gitignore
├── .editorconfig
├── README.md
├── package.json
├── webpack.config.js
├── index.html
└── dist
└── index.js
/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catbea/vue-city-select/HEAD/3.png
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catbea/vue-city-select/HEAD/src/assets/logo.png
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", { "modules": false }],
4 | "stage-3"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | npm-debug.log
4 | yarn-error.log
5 |
6 | # Editor directories and files
7 | .idea
8 | *.suo
9 | *.ntvs*
10 | *.njsproj
11 | *.sln
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import 'amfe-flexible'
4 | import vueCity from 'vue-city-select'
5 | vue.use(vueCity);
6 | new Vue({
7 | el: '#app',
8 | render: h => h(App)
9 | })
10 |
--------------------------------------------------------------------------------
/src/lib/index.js:
--------------------------------------------------------------------------------
1 | import vueCity from './vueCity.vue';
2 |
3 | const vueCitySelect= {
4 | install:function(Vue){
5 | Vue.component(vueCity.name,vueCity)
6 | }
7 | }
8 | // global 情况下 自动安装
9 | if (typeof window !== 'undefined' && window.Vue) {
10 | window.Vue.use(vueCitySelect)
11 | }
12 | // 导出模块
13 | export default vueCitySelect
14 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
15 |
16 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## 效果图
2 | 
3 | # vue-city-select
4 |
5 | > A Vue.js project
6 |
7 | ## Build Setup
8 |
9 | ``` bash
10 | # install dependencies
11 | npm install
12 |
13 | # serve with hot reload at localhost:8080
14 | npm run dev
15 |
16 | # build for production with minification
17 | npm run build
18 | ```
19 |
20 | For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
21 |
22 | ### 插件使用方法
23 |
24 | npm i vue-city-select -S
25 |
26 | 在main.js中引入注册
27 | ```
28 | import vueCity from 'vue-city-select'
29 | vue.use(vueCity);
30 | //然后就可以在项目中引用了,热门城市 hotCityList 参数可以根据自己的需求传或者不传
31 |
32 |
33 | ```
34 |
35 | 注意这里的vue-city就是组件vueCity.vue中的name 的名称。否则会报错的。
36 |
--------------------------------------------------------------------------------
/src/lib/demo.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
38 |
41 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-city-select",
3 | "description": "A Vue.js project",
4 | "version": "1.0.3",
5 | "author": "catbea",
6 | "license": "MIT",
7 | "private": false,
8 | "main": "dist/index.js",
9 | "scripts": {
10 | "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
11 | "build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
12 | },
13 | "dependencies": {
14 | "amfe-flexible": "^2.2.1",
15 | "better-scroll": "^1.13.4",
16 | "vue": "^2.5.11",
17 | "vue-city-select": "^1.0.1"
18 | },
19 | "browserslist": [
20 | "> 1%",
21 | "last 2 versions",
22 | "not ie <= 8"
23 | ],
24 | "keywords": [
25 | "vue",
26 | "vue-city"
27 | ],
28 | "repository": {
29 | "type": "git",
30 | "url": "git+https://github.com/catbea/vue-city-select.git"
31 | },
32 | "homepage": "https://github.com/catbea/vue-city-select/blob/master/README.md",
33 | "devDependencies": {
34 | "babel-core": "^6.26.0",
35 | "babel-loader": "^7.1.2",
36 | "babel-preset-env": "^1.6.0",
37 | "babel-preset-stage-3": "^6.24.1",
38 | "cross-env": "^5.0.5",
39 | "css-loader": "^0.28.7",
40 | "file-loader": "^1.1.4",
41 | "node-sass": "^4.5.3",
42 | "sass-loader": "^6.0.6",
43 | "vue-loader": "^13.0.5",
44 | "vue-template-compiler": "^2.4.4",
45 | "webpack": "^3.6.0",
46 | "webpack-dev-server": "^2.9.1"
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var webpack = require('webpack')
3 |
4 | module.exports = {
5 | entry: './src/lib/index.js',
6 | output: {
7 | path: path.resolve(__dirname, './dist'),
8 | publicPath: '/dist/',
9 | filename: 'index.js',
10 | library: 'vueCitySelect',
11 | libraryTarget: 'umd',
12 | umdNamedDefine: true
13 | },
14 | module: {
15 | rules: [
16 | {
17 | test: /\.css$/,
18 | use: [
19 | 'vue-style-loader',
20 | 'css-loader'
21 | ],
22 | },
23 | {
24 | test: /\.scss$/,
25 | use: [
26 | 'vue-style-loader',
27 | 'css-loader',
28 | 'sass-loader'
29 | ],
30 | },
31 | {
32 | test: /\.sass$/,
33 | use: [
34 | 'vue-style-loader',
35 | 'css-loader',
36 | 'sass-loader?indentedSyntax'
37 | ],
38 | },
39 | {
40 | test: /\.vue$/,
41 | loader: 'vue-loader',
42 | options: {
43 | loaders: {
44 | // Since sass-loader (weirdly) has SCSS as its default parse mode, we map
45 | // the "scss" and "sass" values for the lang attribute to the right configs here.
46 | // other preprocessors should work out of the box, no loader config like this necessary.
47 | 'scss': [
48 | 'vue-style-loader',
49 | 'css-loader',
50 | 'sass-loader'
51 | ],
52 | 'sass': [
53 | 'vue-style-loader',
54 | 'css-loader',
55 | 'sass-loader?indentedSyntax'
56 | ]
57 | }
58 | // other vue-loader options go here
59 | }
60 | },
61 | {
62 | test: /\.js$/,
63 | loader: 'babel-loader',
64 | exclude: /node_modules/
65 | },
66 | {
67 | test: /\.(png|jpg|gif|svg)$/,
68 | loader: 'file-loader',
69 | options: {
70 | name: '[name].[ext]?[hash]'
71 | }
72 | }
73 | ]
74 | },
75 | resolve: {
76 | alias: {
77 | 'vue$': 'vue/dist/vue.esm.js'
78 | },
79 | extensions: ['*', '.js', '.vue', '.json']
80 | },
81 | devServer: {
82 | historyApiFallback: true,
83 | noInfo: true,
84 | overlay: true
85 | },
86 | performance: {
87 | hints: false
88 | },
89 | devtool: '#eval-source-map'
90 | }
91 |
92 | if (process.env.NODE_ENV === 'production') {
93 | module.exports.devtool = '#source-map'
94 | // http://vue-loader.vuejs.org/en/workflow/production.html
95 | module.exports.plugins = (module.exports.plugins || []).concat([
96 | new webpack.DefinePlugin({
97 | 'process.env': {
98 | NODE_ENV: '"production"'
99 | }
100 | }),
101 | new webpack.optimize.UglifyJsPlugin({
102 | sourceMap: true,
103 | compress: {
104 | warnings: false
105 | }
106 | }),
107 | new webpack.LoaderOptionsPlugin({
108 | minimize: true
109 | })
110 | ])
111 | }
112 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | vue-city-select
8 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/src/lib/vueCity.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
热门城市
7 |
8 | {{item.cityName}}
9 |
10 |
11 |
12 |
13 |
{{item.w}}
14 |
17 |
18 |
19 |
20 |
21 |
22 | -
23 | {{item.w}}
24 |
25 |
26 |
27 |
28 | {{toast}}
29 |
30 |
31 |
32 |
33 |
132 |
--------------------------------------------------------------------------------
/src/lib/city.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "citys": [
3 | {
4 | "w": "A",
5 | "option": [
6 | {
7 | "p": "辽宁省",
8 | "c": "鞍山市"
9 | },
10 | {
11 | "p": "内蒙古自治区",
12 | "c": "阿拉善盟"
13 | },
14 | {
15 | "p": "安徽省",
16 | "c": "安庆市"
17 | },
18 | {
19 | "p": "河南省",
20 | "c": "安阳市"
21 | },
22 | {
23 | "p": "贵州省",
24 | "c": "安顺市"
25 | },
26 | {
27 | "p": "陕西省",
28 | "c": "安康市"
29 | },
30 | {
31 | "p": "新疆维吾尔自治区",
32 | "c": "阿克苏地区"
33 | },
34 | {
35 | "p": "四川省",
36 | "c": "阿坝藏族羌族自治州"
37 | },
38 | {
39 | "p": "西藏自治区",
40 | "c": "阿里地区"
41 | },
42 | {
43 | "p": "新疆维吾尔自治区",
44 | "c": "阿勒泰地区"
45 | }
46 | ]
47 | },
48 | {
49 | "w": "B",
50 | "option": [
51 | {
52 | "p": "北京",
53 | "c": "北京市"
54 | },
55 | {
56 | "p": "河北省",
57 | "c": "保定市"
58 | },
59 | {
60 | "p": "内蒙古自治区",
61 | "c": "包头市"
62 | },
63 | {
64 | "p": "安徽省",
65 | "c": "蚌埠市"
66 | },
67 | {
68 | "p": "内蒙古自治区",
69 | "c": "巴彦淖尔市"
70 | },
71 | {
72 | "p": "辽宁省",
73 | "c": "本溪市"
74 | },
75 | {
76 | "p": "吉林省",
77 | "c": "白山市"
78 | },
79 | {
80 | "p": "吉林省",
81 | "c": "白城市"
82 | },
83 | {
84 | "p": "安徽省",
85 | "c": "亳州市"
86 | },
87 | {
88 | "p": "山东省",
89 | "c": "滨州市"
90 | },
91 | {
92 | "p": "广西壮族自治区",
93 | "c": "北海市"
94 | },
95 | {
96 | "p": "广西壮族自治区",
97 | "c": "百色市"
98 | },
99 | {
100 | "p": "四川省",
101 | "c": "巴中市"
102 | },
103 | {
104 | "p": "贵州省",
105 | "c": "毕节市"
106 | },
107 | {
108 | "p": "云南省",
109 | "c": "保山市"
110 | },
111 | {
112 | "p": "陕西省",
113 | "c": "宝鸡市"
114 | },
115 | {
116 | "p": "甘肃省",
117 | "c": "白银市"
118 | },
119 | {
120 | "p": "新疆维吾尔自治区",
121 | "c": "博尔塔拉蒙古自治州"
122 | }
123 | ]
124 | },
125 | {
126 | "w": "C",
127 | "option": [
128 | {
129 | "p": "四川省",
130 | "c": "成都市"
131 | },
132 | {
133 | "p": "重庆",
134 | "c": "重庆市"
135 | },
136 | {
137 | "p": "江苏省",
138 | "c": "常州市"
139 | },
140 | {
141 | "p": "湖南省",
142 | "c": "长沙市"
143 | },
144 | {
145 | "p": "吉林省",
146 | "c": "长春市"
147 | },
148 | {
149 | "p": "河北省",
150 | "c": "承德市"
151 | },
152 | {
153 | "p": "河北省",
154 | "c": "沧州市"
155 | },
156 | {
157 | "p": "山西省",
158 | "c": "长治市"
159 | },
160 | {
161 | "p": "内蒙古自治区",
162 | "c": "赤峰市"
163 | },
164 | {
165 | "p": "辽宁省",
166 | "c": "朝阳市"
167 | },
168 | {
169 | "p": "安徽省",
170 | "c": "滁州市"
171 | },
172 | {
173 | "p": "安徽省",
174 | "c": "池州市"
175 | },
176 | {
177 | "p": "湖南省",
178 | "c": "常德市"
179 | },
180 | {
181 | "p": "湖南省",
182 | "c": "郴州市"
183 | },
184 | {
185 | "p": "广东省",
186 | "c": "潮州市"
187 | },
188 | {
189 | "p": "广西壮族自治区",
190 | "c": "崇左市"
191 | },
192 | {
193 | "p": "云南省",
194 | "c": "楚雄彝族自治州"
195 | },
196 | {
197 | "p": "新疆维吾尔自治区",
198 | "c": "昌吉回族自治州"
199 | },
200 | {
201 | "p": "西藏自治区",
202 | "c": "昌都地区"
203 | }
204 | ]
205 | },
206 | {
207 | "w": "D",
208 | "option": [
209 | {
210 | "p": "广东省",
211 | "c": "东莞市"
212 | },
213 | {
214 | "p": "辽宁省",
215 | "c": "大连市"
216 | },
217 | {
218 | "p": "黑龙江省",
219 | "c": "大庆市"
220 | },
221 | {
222 | "p": "山东省",
223 | "c": "东营市"
224 | },
225 | {
226 | "p": "山西省",
227 | "c": "大同市"
228 | },
229 | {
230 | "p": "辽宁省",
231 | "c": "丹东市"
232 | },
233 | {
234 | "p": "山东省",
235 | "c": "德州市"
236 | },
237 | {
238 | "p": "四川省",
239 | "c": "德阳市"
240 | },
241 | {
242 | "p": "四川省",
243 | "c": "达州市"
244 | },
245 | {
246 | "p": "云南省",
247 | "c": "大理白族自治州"
248 | },
249 | {
250 | "p": "甘肃省",
251 | "c": "定西市"
252 | },
253 | {
254 | "p": "黑龙江省",
255 | "c": "大兴安岭地区"
256 | },
257 | {
258 | "p": "云南省",
259 | "c": "德宏傣族景颇族自治州"
260 | },
261 | {
262 | "p": "云南省",
263 | "c": "迪庆藏族自治州"
264 | }
265 | ]
266 | },
267 | {
268 | "w": "E",
269 | "option": [
270 | {
271 | "p": "内蒙古自治区",
272 | "c": "鄂尔多斯市"
273 | },
274 | {
275 | "p": "湖北省",
276 | "c": "鄂州市"
277 | },
278 | {
279 | "p": "湖北省",
280 | "c": "恩施土家族苗族自治州"
281 | }
282 | ]
283 | },
284 | {
285 | "w": "F",
286 | "option": [
287 | {
288 | "p": "福建省",
289 | "c": "福州市"
290 | },
291 | {
292 | "p": "广东省",
293 | "c": "佛山市"
294 | },
295 | {
296 | "p": "安徽省",
297 | "c": "阜阳市"
298 | },
299 | {
300 | "p": "辽宁省",
301 | "c": "抚顺市"
302 | },
303 | {
304 | "p": "辽宁省",
305 | "c": "阜新市"
306 | },
307 | {
308 | "p": "江西省",
309 | "c": "抚州市"
310 | },
311 | {
312 | "p": "广西壮族自治区",
313 | "c": "防城港市"
314 | }
315 | ]
316 | },
317 | {
318 | "w": "G",
319 | "option": [
320 | {
321 | "p": "广东省",
322 | "c": "广州市"
323 | },
324 | {
325 | "p": "贵州省",
326 | "c": "贵阳市"
327 | },
328 | {
329 | "p": "广西壮族自治区",
330 | "c": "桂林市"
331 | },
332 | {
333 | "p": "江西省",
334 | "c": "赣州市"
335 | },
336 | {
337 | "p": "广西壮族自治区",
338 | "c": "贵港市"
339 | },
340 | {
341 | "p": "四川省",
342 | "c": "广元市"
343 | },
344 | {
345 | "p": "四川省",
346 | "c": "广安市"
347 | },
348 | {
349 | "p": "宁夏回族自治区",
350 | "c": "固原市"
351 | },
352 | {
353 | "p": "四川省",
354 | "c": "甘孜藏族自治州"
355 | },
356 | {
357 | "p": "甘肃省",
358 | "c": "甘南藏族自治州"
359 | },
360 | {
361 | "p": "青海省",
362 | "c": "果洛藏族自治州"
363 | }
364 | ]
365 | },
366 | {
367 | "w": "H",
368 | "option": [
369 | {
370 | "p": "浙江省",
371 | "c": "杭州市"
372 | },
373 | {
374 | "p": "黑龙江省",
375 | "c": "哈尔滨市"
376 | },
377 | {
378 | "p": "安徽省",
379 | "c": "合肥市"
380 | },
381 | {
382 | "p": "河北省",
383 | "c": "邯郸市"
384 | },
385 | {
386 | "p": "广东省",
387 | "c": "惠州市"
388 | },
389 | {
390 | "p": "安徽省",
391 | "c": "淮北市"
392 | },
393 | {
394 | "p": "海南省",
395 | "c": "海口市"
396 | },
397 | {
398 | "p": "内蒙古自治区",
399 | "c": "呼和浩特市"
400 | },
401 | {
402 | "p": "湖南省",
403 | "c": "衡阳市"
404 | },
405 | {
406 | "p": "浙江省",
407 | "c": "湖州市"
408 | },
409 | {
410 | "p": "辽宁省",
411 | "c": "葫芦岛市"
412 | },
413 | {
414 | "p": "河北省",
415 | "c": "衡水市"
416 | },
417 | {
418 | "p": "内蒙古自治区",
419 | "c": "呼伦贝尔市"
420 | },
421 | {
422 | "p": "黑龙江省",
423 | "c": "鹤岗市"
424 | },
425 | {
426 | "p": "黑龙江省",
427 | "c": "黑河市"
428 | },
429 | {
430 | "p": "江苏省",
431 | "c": "淮安市"
432 | },
433 | {
434 | "p": "安徽省",
435 | "c": "淮南市"
436 | },
437 | {
438 | "p": "安徽省",
439 | "c": "黄山市"
440 | },
441 | {
442 | "p": "山东省",
443 | "c": "菏泽市"
444 | },
445 | {
446 | "p": "河南省",
447 | "c": "鹤壁市"
448 | },
449 | {
450 | "p": "湖北省",
451 | "c": "黄石市"
452 | },
453 | {
454 | "p": "湖北省",
455 | "c": "黄冈市"
456 | },
457 | {
458 | "p": "湖南省",
459 | "c": "怀化市"
460 | },
461 | {
462 | "p": "广东省",
463 | "c": "河源市"
464 | },
465 | {
466 | "p": "广西壮族自治区",
467 | "c": "贺州市"
468 | },
469 | {
470 | "p": "广西壮族自治区",
471 | "c": "河池市"
472 | },
473 | {
474 | "p": "云南省",
475 | "c": "红河哈尼族彝族自治州"
476 | },
477 | {
478 | "p": "陕西省",
479 | "c": "汉中市"
480 | },
481 | {
482 | "p": "青海省",
483 | "c": "海东地区"
484 | },
485 | {
486 | "p": "新疆维吾尔自治区",
487 | "c": "哈密地区"
488 | },
489 | {
490 | "p": "青海省",
491 | "c": "海北藏族自治州"
492 | },
493 | {
494 | "p": "青海省",
495 | "c": "黄南藏族自治州"
496 | },
497 | {
498 | "p": "青海省",
499 | "c": "海西蒙古族藏族自治州"
500 | },
501 | {
502 | "p": "新疆维吾尔自治区",
503 | "c": "和田地区"
504 | }
505 | ]
506 | },
507 | {
508 | "w": "J",
509 | "option": [
510 | {
511 | "p": "山东省",
512 | "c": "济南市"
513 | },
514 | {
515 | "p": "山东省",
516 | "c": "济宁市"
517 | },
518 | {
519 | "p": "浙江省",
520 | "c": "嘉兴市"
521 | },
522 | {
523 | "p": "浙江省",
524 | "c": "金华市"
525 | },
526 | {
527 | "p": "河南省",
528 | "c": "焦作市"
529 | },
530 | {
531 | "p": "湖北省",
532 | "c": "荆州市"
533 | },
534 | {
535 | "p": "吉林省",
536 | "c": "吉林市"
537 | },
538 | {
539 | "p": "辽宁省",
540 | "c": "锦州市"
541 | },
542 | {
543 | "p": "广东省",
544 | "c": "江门市"
545 | },
546 | {
547 | "p": "江西省",
548 | "c": "九江市"
549 | },
550 | {
551 | "p": "山西省",
552 | "c": "晋城市"
553 | },
554 | {
555 | "p": "山西省",
556 | "c": "晋中市"
557 | },
558 | {
559 | "p": "黑龙江省",
560 | "c": "鸡西市"
561 | },
562 | {
563 | "p": "黑龙江省",
564 | "c": "佳木斯市"
565 | },
566 | {
567 | "p": "江西省",
568 | "c": "景德镇市"
569 | },
570 | {
571 | "p": "江西省",
572 | "c": "吉安市"
573 | },
574 | {
575 | "p": "湖北省",
576 | "c": "荆门市"
577 | },
578 | {
579 | "p": "广东省",
580 | "c": "揭阳市"
581 | },
582 | {
583 | "p": "甘肃省",
584 | "c": "金昌市"
585 | },
586 | {
587 | "p": "甘肃省",
588 | "c": "酒泉市"
589 | },
590 | {
591 | "p": "甘肃省",
592 | "c": "嘉峪关市"
593 | }
594 | ]
595 | },
596 | {
597 | "w": "K",
598 | "option": [
599 | {
600 | "p": "云南省",
601 | "c": "昆明市"
602 | },
603 | {
604 | "p": "河南省",
605 | "c": "开封市"
606 | },
607 | {
608 | "p": "新疆维吾尔自治区",
609 | "c": "克拉玛依市"
610 | },
611 | {
612 | "p": "新疆维吾尔自治区",
613 | "c": "喀什地区"
614 | }
615 | ]
616 | },
617 | {
618 | "w": "L",
619 | "option": [
620 | {
621 | "p": "甘肃省",
622 | "c": "兰州市"
623 | },
624 | {
625 | "p": "山东省",
626 | "c": "临沂市"
627 | },
628 | {
629 | "p": "江苏省",
630 | "c": "连云港市"
631 | },
632 | {
633 | "p": "山东省",
634 | "c": "聊城市"
635 | },
636 | {
637 | "p": "山西省",
638 | "c": "临汾市"
639 | },
640 | {
641 | "p": "广西壮族自治区",
642 | "c": "柳州市"
643 | },
644 | {
645 | "p": "河南省",
646 | "c": "洛阳市"
647 | },
648 | {
649 | "p": "河北省",
650 | "c": "廊坊市"
651 | },
652 | {
653 | "p": "福建省",
654 | "c": "龙岩市"
655 | },
656 | {
657 | "p": "山西省",
658 | "c": "吕梁市"
659 | },
660 | {
661 | "p": "辽宁省",
662 | "c": "辽阳市"
663 | },
664 | {
665 | "p": "吉林省",
666 | "c": "辽源市"
667 | },
668 | {
669 | "p": "浙江省",
670 | "c": "丽水市"
671 | },
672 | {
673 | "p": "安徽省",
674 | "c": "六安市"
675 | },
676 | {
677 | "p": "山东省",
678 | "c": "莱芜市"
679 | },
680 | {
681 | "p": "河南省",
682 | "c": "漯河市"
683 | },
684 | {
685 | "p": "湖南省",
686 | "c": "娄底市"
687 | },
688 | {
689 | "p": "广西壮族自治区",
690 | "c": "来宾市"
691 | },
692 | {
693 | "p": "四川省",
694 | "c": "泸州市"
695 | },
696 | {
697 | "p": "四川省",
698 | "c": "乐山市"
699 | },
700 | {
701 | "p": "四川省",
702 | "c": "凉山彝族自治州"
703 | },
704 | {
705 | "p": "贵州省",
706 | "c": "六盘水市"
707 | },
708 | {
709 | "p": "云南省",
710 | "c": "丽江市"
711 | },
712 | {
713 | "p": "吉林省",
714 | "c": "辽源市"
715 | },
716 | {
717 | "p": "云南省",
718 | "c": "临沧市"
719 | },
720 | {
721 | "p": "西藏自治区",
722 | "c": "拉萨市"
723 | },
724 | {
725 | "p": "甘肃省",
726 | "c": "临夏回族自治州"
727 | },
728 | {
729 | "p": "西藏自治区",
730 | "c": "林芝地区"
731 | },
732 | {
733 | "p": "甘肃省",
734 | "c": "陇南市"
735 | }
736 | ]
737 | },
738 | {
739 | "w": "M",
740 | "option": [
741 | {
742 | "p": "安徽省",
743 | "c": "马鞍山市"
744 | },
745 | {
746 | "p": "四川省",
747 | "c": "绵阳市"
748 | },
749 | {
750 | "p": "黑龙江省",
751 | "c": "牡丹江市"
752 | },
753 | {
754 | "p": "广东省",
755 | "c": "茂名市"
756 | },
757 | {
758 | "p": "广东省",
759 | "c": "梅州市"
760 | },
761 | {
762 | "p": "四川省",
763 | "c": "眉山市"
764 | }
765 | ]
766 | },
767 | {
768 | "w": "N",
769 | "option": [
770 | {
771 | "p": "江苏省",
772 | "c": "南京市"
773 | },
774 | {
775 | "p": "浙江省",
776 | "c": "宁波市"
777 | },
778 | {
779 | "p": "江苏省",
780 | "c": "南通市"
781 | },
782 | {
783 | "p": "广西壮族自治区",
784 | "c": "南宁市"
785 | },
786 | {
787 | "p": "江西省",
788 | "c": "南昌市"
789 | },
790 | {
791 | "p": "福建省",
792 | "c": "南平市"
793 | },
794 | {
795 | "p": "福建省",
796 | "c": "宁德市"
797 | },
798 | {
799 | "p": "河南省",
800 | "c": "南阳市"
801 | },
802 | {
803 | "p": "四川省",
804 | "c": "内江市"
805 | },
806 | {
807 | "p": "四川省",
808 | "c": "南充市"
809 | },
810 | {
811 | "p": "云南省",
812 | "c": "怒江傈僳族自治州"
813 | },
814 | {
815 | "p": "西藏自治区",
816 | "c": "那曲地区"
817 | }
818 | ]
819 | },
820 | {
821 | "w": "P",
822 | "option": [
823 | {
824 | "p": "江西省",
825 | "c": "萍乡市"
826 | },
827 | {
828 | "p": "辽宁省",
829 | "c": "盘锦市"
830 | },
831 | {
832 | "p": "福建省",
833 | "c": "莆田市"
834 | },
835 | {
836 | "p": "河南省",
837 | "c": "平顶山市"
838 | },
839 | {
840 | "p": "河南省",
841 | "c": "濮阳市"
842 | },
843 | {
844 | "p": "四川省",
845 | "c": "攀枝花市"
846 | },
847 | {
848 | "p": "云南省",
849 | "c": "普洱市"
850 | },
851 | {
852 | "p": "甘肃省",
853 | "c": "平凉市"
854 | }
855 | ]
856 | },
857 | {
858 | "w": "Q",
859 | "option": [
860 | {
861 | "p": "山东省",
862 | "c": "青岛市"
863 | },
864 | {
865 | "p": "福建省",
866 | "c": "泉州市"
867 | },
868 | {
869 | "p": "河北省",
870 | "c": "秦皇岛市"
871 | },
872 | {
873 | "p": "黑龙江省",
874 | "c": "齐齐哈尔市"
875 | },
876 | {
877 | "p": "黑龙江省",
878 | "c": "七台河市"
879 | },
880 | {
881 | "p": "浙江省",
882 | "c": "衢州市"
883 | },
884 | {
885 | "p": "广东省",
886 | "c": "清远市"
887 | },
888 | {
889 | "p": "贵州省",
890 | "c": "黔西南布依族苗族自治州"
891 | },
892 | {
893 | "p": "贵州省",
894 | "c": "黔东南苗族侗族自治州"
895 | },
896 | {
897 | "p": "贵州省",
898 | "c": "黔南布依族苗族自治州"
899 | },
900 | {
901 | "p": "云南省",
902 | "c": "曲靖市"
903 | },
904 | {
905 | "p": "甘肃省",
906 | "c": "庆阳市"
907 | }
908 | ]
909 | },
910 | {
911 | "w": "R",
912 | "option": [
913 | {
914 | "p": "山东省",
915 | "c": "日照市"
916 | },
917 | {
918 | "p": "西藏自治区",
919 | "c": "日喀则地区"
920 | }
921 | ]
922 | },
923 | {
924 | "w": "S",
925 | "option": [
926 | {
927 | "p": "上海",
928 | "c": "上海市"
929 | },
930 | {
931 | "p": "广东省",
932 | "c": "深圳市"
933 | },
934 | {
935 | "p": "辽宁省",
936 | "c": "沈阳市"
937 | },
938 | {
939 | "p": "江苏省",
940 | "c": "苏州市"
941 | },
942 | {
943 | "p": "河北省",
944 | "c": "石家庄市"
945 | },
946 | {
947 | "p": "浙江省",
948 | "c": "绍兴市"
949 | },
950 | {
951 | "p": "广东省",
952 | "c": "韶关市"
953 | },
954 | {
955 | "p": "海南省",
956 | "c": "三亚市"
957 | },
958 | {
959 | "p": "广东省",
960 | "c": "汕头市"
961 | },
962 | {
963 | "p": "山西省",
964 | "c": "朔州市"
965 | },
966 | {
967 | "p": "吉林省",
968 | "c": "四平市"
969 | },
970 | {
971 | "p": "吉林省",
972 | "c": "松原市"
973 | },
974 | {
975 | "p": "黑龙江省",
976 | "c": "双鸭山市"
977 | },
978 | {
979 | "p": "黑龙江省",
980 | "c": "绥化市"
981 | },
982 | {
983 | "p": "江苏省",
984 | "c": "宿迁市"
985 | },
986 | {
987 | "p": "安徽省",
988 | "c": "宿州市"
989 | },
990 | {
991 | "p": "福建省",
992 | "c": "三明市"
993 | },
994 | {
995 | "p": "江西省",
996 | "c": "上饶市"
997 | },
998 | {
999 | "p": "河南省",
1000 | "c": "三门峡市"
1001 | },
1002 | {
1003 | "p": "河南省",
1004 | "c": "商丘市"
1005 | },
1006 | {
1007 | "p": "湖北省",
1008 | "c": "十堰市"
1009 | },
1010 | {
1011 | "p": "湖北省",
1012 | "c": "随州市"
1013 | },
1014 | {
1015 | "p": "湖南省",
1016 | "c": "邵阳市"
1017 | },
1018 | {
1019 | "p": "广东省",
1020 | "c": "汕尾市"
1021 | },
1022 | {
1023 | "p": "四川省",
1024 | "c": "遂宁市"
1025 | },
1026 | {
1027 | "p": "陕西省",
1028 | "c": "商洛市"
1029 | },
1030 | {
1031 | "p": "宁夏回族自治区",
1032 | "c": "石嘴山市"
1033 | },
1034 | {
1035 | "p": "西藏自治区",
1036 | "c": "山南地区"
1037 | }
1038 | ]
1039 | },
1040 | {
1041 | "w": "T",
1042 | "option": [
1043 | {
1044 | "p": "天津",
1045 | "c": "天津市"
1046 | },
1047 | {
1048 | "p": "山西省",
1049 | "c": "太原市"
1050 | },
1051 | {
1052 | "p": "山东省",
1053 | "c": "泰安市"
1054 | },
1055 | {
1056 | "p": "浙江省",
1057 | "c": "台州市"
1058 | },
1059 | {
1060 | "p": "河北省",
1061 | "c": "唐山市"
1062 | },
1063 | {
1064 | "p": "江苏省",
1065 | "c": "泰州市"
1066 | },
1067 | {
1068 | "p": "内蒙古自治区",
1069 | "c": "通辽市"
1070 | },
1071 | {
1072 | "p": "辽宁省",
1073 | "c": "铁岭市"
1074 | },
1075 | {
1076 | "p": "吉林省",
1077 | "c": "通化市"
1078 | },
1079 | {
1080 | "p": "安徽省",
1081 | "c": "铜陵市"
1082 | },
1083 | {
1084 | "p": "贵州省",
1085 | "c": "铜仁市"
1086 | },
1087 | {
1088 | "p": "陕西省",
1089 | "c": "铜川市"
1090 | },
1091 | {
1092 | "p": "甘肃省",
1093 | "c": "天水市"
1094 | },
1095 | {
1096 | "p": "新疆维吾尔自治区",
1097 | "c": "吐鲁番地区"
1098 | },
1099 | {
1100 | "p": "新疆维吾尔自治区",
1101 | "c": "塔城地区"
1102 | }
1103 | ]
1104 | },
1105 | {
1106 | "w": "W",
1107 | "option": [
1108 | {
1109 | "p": "湖北省",
1110 | "c": "武汉市"
1111 | },
1112 | {
1113 | "p": "江苏省",
1114 | "c": "无锡市"
1115 | },
1116 | {
1117 | "p": "浙江省",
1118 | "c": "温州市"
1119 | },
1120 | {
1121 | "p": "新疆维吾尔自治区",
1122 | "c": "乌鲁木齐市"
1123 | },
1124 | {
1125 | "p": "安徽省",
1126 | "c": "芜湖市"
1127 | },
1128 | {
1129 | "p": "山东省",
1130 | "c": "威海市"
1131 | },
1132 | {
1133 | "p": "山东省",
1134 | "c": "潍坊市"
1135 | },
1136 | {
1137 | "p": "内蒙古自治区",
1138 | "c": "乌海市"
1139 | },
1140 | {
1141 | "p": "内蒙古自治区",
1142 | "c": "乌兰察布市"
1143 | },
1144 | {
1145 | "p": "广西壮族自治区",
1146 | "c": "梧州市"
1147 | },
1148 | {
1149 | "p": "云南省",
1150 | "c": "文山壮族苗族自治州"
1151 | },
1152 | {
1153 | "p": "陕西省",
1154 | "c": "渭南市"
1155 | },
1156 | {
1157 | "p": "甘肃省",
1158 | "c": "武威市"
1159 | },
1160 | {
1161 | "p": "宁夏回族自治区",
1162 | "c": "吴忠市"
1163 | }
1164 | ]
1165 | },
1166 | {
1167 | "w": "X",
1168 | "option": [
1169 | {
1170 | "p": "陕西省",
1171 | "c": "西安市"
1172 | },
1173 | {
1174 | "p": "福建省",
1175 | "c": "厦门市"
1176 | },
1177 | {
1178 | "p": "江苏省",
1179 | "c": "徐州市"
1180 | },
1181 | {
1182 | "p": "湖北省",
1183 | "c": "孝感市"
1184 | },
1185 | {
1186 | "p": "湖北省",
1187 | "c": "襄阳市"
1188 | },
1189 | {
1190 | "p": "青海省",
1191 | "c": "西宁市"
1192 | },
1193 | {
1194 | "p": "河南省",
1195 | "c": "新乡市"
1196 | },
1197 | {
1198 | "p": "河北省",
1199 | "c": "邢台市"
1200 | },
1201 | {
1202 | "p": "山西省",
1203 | "c": "忻州市"
1204 | },
1205 | {
1206 | "p": "内蒙古自治区",
1207 | "c": "兴安盟"
1208 | },
1209 | {
1210 | "p": "内蒙古自治区",
1211 | "c": "锡林郭勒盟"
1212 | },
1213 | {
1214 | "p": "安徽省",
1215 | "c": "宣城市"
1216 | },
1217 | {
1218 | "p": "江西省",
1219 | "c": "新余市"
1220 | },
1221 | {
1222 | "p": "河南省",
1223 | "c": "许昌市"
1224 | },
1225 | {
1226 | "p": "河南省",
1227 | "c": "信阳市"
1228 | },
1229 | {
1230 | "p": "湖北省",
1231 | "c": "咸宁市"
1232 | },
1233 | {
1234 | "p": "湖南省",
1235 | "c": "湘潭市"
1236 | },
1237 | {
1238 | "p": "湖南省",
1239 | "c": "湘西土家族苗族自治州"
1240 | },
1241 | {
1242 | "p": "云南省",
1243 | "c": "西双版纳傣族自治州"
1244 | },
1245 | {
1246 | "p": "陕西省",
1247 | "c": "咸阳市"
1248 | }
1249 | ]
1250 | },
1251 | {
1252 | "w": "Y",
1253 | "option": [
1254 | {
1255 | "p": "江苏省",
1256 | "c": "扬州市"
1257 | },
1258 | {
1259 | "p": "山东省",
1260 | "c": "烟台市"
1261 | },
1262 | {
1263 | "p": "江苏省",
1264 | "c": "盐城市"
1265 | },
1266 | {
1267 | "p": "山西省",
1268 | "c": "运城市"
1269 | },
1270 | {
1271 | "p": "湖南省",
1272 | "c": "岳阳市"
1273 | },
1274 | {
1275 | "p": "湖北省",
1276 | "c": "宜昌市"
1277 | },
1278 | {
1279 | "p": "广西壮族自治区",
1280 | "c": "玉林市"
1281 | },
1282 | {
1283 | "p": "宁夏回族自治区",
1284 | "c": "银川市"
1285 | },
1286 | {
1287 | "p": "山西省",
1288 | "c": "阳泉市"
1289 | },
1290 | {
1291 | "p": "辽宁省",
1292 | "c": "营口市"
1293 | },
1294 | {
1295 | "p": "吉林省",
1296 | "c": "延边朝鲜族自治州"
1297 | },
1298 | {
1299 | "p": "江西省",
1300 | "c": "鹰潭市"
1301 | },
1302 | {
1303 | "p": "江西省",
1304 | "c": "宜春市"
1305 | },
1306 | {
1307 | "p": "湖南省",
1308 | "c": "益阳市"
1309 | },
1310 | {
1311 | "p": "湖南省",
1312 | "c": "永州市"
1313 | },
1314 | {
1315 | "p": "广东省",
1316 | "c": "阳江市"
1317 | },
1318 | {
1319 | "p": "广东省",
1320 | "c": "云浮市"
1321 | },
1322 | {
1323 | "p": "四川省",
1324 | "c": "宜宾市"
1325 | },
1326 | {
1327 | "p": "四川省",
1328 | "c": "雅安市"
1329 | },
1330 | {
1331 | "p": "云南省",
1332 | "c": "玉溪市"
1333 | },
1334 | {
1335 | "p": "陕西省",
1336 | "c": "延安市"
1337 | },
1338 | {
1339 | "p": "陕西省",
1340 | "c": "榆林市"
1341 | },
1342 | {
1343 | "p": "黑龙江省",
1344 | "c": "伊春市"
1345 | },
1346 | {
1347 | "p": "青海省",
1348 | "c": "玉树藏族自治州"
1349 | },
1350 | {
1351 | "p": "新疆维吾尔自治区",
1352 | "c": "伊犁哈萨克自治州"
1353 | }
1354 | ]
1355 | },
1356 | {
1357 | "w": "Z",
1358 | "option": [
1359 | {
1360 | "p": "河南省",
1361 | "c": "郑州市"
1362 | },
1363 | {
1364 | "p": "江苏省",
1365 | "c": "镇江市"
1366 | },
1367 | {
1368 | "p": "广东省",
1369 | "c": "中山市"
1370 | },
1371 | {
1372 | "p": "山东省",
1373 | "c": "淄博市"
1374 | },
1375 | {
1376 | "p": "广东省",
1377 | "c": "珠海市"
1378 | },
1379 | {
1380 | "p": "贵州省",
1381 | "c": "遵义市"
1382 | },
1383 | {
1384 | "p": "湖南省",
1385 | "c": "株洲市"
1386 | },
1387 | {
1388 | "p": "河北省",
1389 | "c": "张家口市"
1390 | },
1391 | {
1392 | "p": "浙江省",
1393 | "c": "舟山市"
1394 | },
1395 | {
1396 | "p": "福建省",
1397 | "c": "漳州市"
1398 | },
1399 | {
1400 | "p": "山东省",
1401 | "c": "枣庄市"
1402 | },
1403 | {
1404 | "p": "河南省",
1405 | "c": "周口市"
1406 | },
1407 | {
1408 | "p": "河南省",
1409 | "c": "驻马店市"
1410 | },
1411 | {
1412 | "p": "湖南省",
1413 | "c": "张家界市"
1414 | },
1415 | {
1416 | "p": "广东省",
1417 | "c": "湛江市"
1418 | },
1419 | {
1420 | "p": "广东省",
1421 | "c": "肇庆市"
1422 | },
1423 | {
1424 | "p": "四川省",
1425 | "c": "自贡市"
1426 | },
1427 | {
1428 | "p": "四川省",
1429 | "c": "资阳市"
1430 | },
1431 | {
1432 | "p": "云南省",
1433 | "c": "昭通市"
1434 | },
1435 | {
1436 | "p": "甘肃省",
1437 | "c": "张掖市"
1438 | },
1439 | {
1440 | "p": "宁夏回族自治区",
1441 | "c": "中卫市"
1442 | }
1443 | ]
1444 | }
1445 | ]
1446 | }
--------------------------------------------------------------------------------
/dist/index.js:
--------------------------------------------------------------------------------
1 | !function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define("vueCitySelect",[],i):"object"==typeof exports?exports.vueCitySelect=i():t.vueCitySelect=i()}("undefined"!=typeof self?self:this,function(){return function(t){function i(o){if(e[o])return e[o].exports;var s=e[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}var e={};return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},i.p="/dist/",i(i.s=1)}([function(t,i,e){"use strict";var o=e(9),s=e(10).citys;i.a={name:"vue-city",props:{hotCityList:{probeType:Array,default:[{cityName:"深圳市"},{cityName:"上海市"},{cityName:"北京市"},{cityName:"广州市"},{cityName:"杭州市"},{cityName:"武汉市"},{cityName:"天津市"},{cityName:"南京市"},{cityName:"成都市"}]}},data:function(){return{isSHowToast:!1,toast:"",cityList:s,LIHeight:0,startY:0,endY:0,touchStratSelected:"",touchMouveSelected:"",saveCharIndex:0,chars:["A","B","C","D","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","W","X","Y","Z"],startY2:0,endY2:0,scroll:null}},created:function(){},mounted:function(){var t=this;this.$nextTick(function(){t.initScroll()})},methods:{initScroll:function(){var t=this;this.$nextTick(function(){t.scroll?t.scroll.refresh():t.scroll=new o.a(t.$refs.vueContainer,{click:!0,probeType:1})})},clickCity:function(t){this.$emit("changeCity",t)},cityTouchstart:function(t){this.isSHowToast=!0,this.LIHeight=t.target.offsetHeight,this.startY=t.changedTouches[0].pageY,this.toast=this.touchStratSelected=t.target.outerText,this.saveCharIndex=this.chars.indexOf(this.touchStratSelected)},cityTouchmove:function(t){var i=this.saveCharIndex;this.endY=t.changedTouches[0].pageY,i+=Math.ceil((this.endY-this.startY)/this.LIHeight),this.toast=this.touchMouveSelected=this.chars[i]},cityTouchend:function(t){console.log(t),this.isSHowToast=!1;var i=this.saveCharIndex;this.endY=t.changedTouches[0].pageY,i+=Math.ceil((this.endY-this.startY)/this.LIHeight),this.touchMouveSelected=this.chars[i],void 0==this.touchMouveSelected&&(this.touchMouveSelected="Z"),console.log(this.touchMouveSelected);var e=this.$refs[this.touchMouveSelected][0];this.scroll.scrollToElement(e)}}}},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var o=e(2),s={install:function(t){t.component(o.a.name,o.a)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(s),i.default=s},function(t,i,e){"use strict";function o(t){e(3)}var s=e(0),n=e(11),r=e(8),h=o,a=r(s.a,n.a,!1,h,"data-v-6f39e90e",null);i.a=a.exports},function(t,i,e){var o=e(4);"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);e(6)("5603077b",o,!0,{})},function(t,i,e){i=t.exports=e(5)(!1),i.push([t.i,".vue-city-container[data-v-6f39e90e]{width:100vw;height:100vh;overflow:hidden;background:#f4f4f4}.vue-city-container .vue-city-content .hot-city-list-box[data-v-6f39e90e]{background:#f8f8f8;border-top:1px solid #e5e5e5}.vue-city-container .vue-city-content .hot-city-list-box .hot-title[data-v-6f39e90e]{font-size:13px;color:#999;padding:9px 0 9px 15px;display:block}.vue-city-container .vue-city-content .hot-city-list-box .hot-city-list[data-v-6f39e90e]{-webkit-column-count:3;column-count:3;padding:0 30px 0 15px;-webkit-column-gap:2px;column-gap:2px}.vue-city-container .vue-city-content .hot-city-list-box .hot-city-list span[data-v-6f39e90e]{width:90%;height:39px;font-size:13px;line-height:39px;color:#333;display:block;border:1px solid #999;border-radius:6px;text-align:center;margin-bottom:10px;background:#fff}.vue-city-container .vue-city-content .city-sort-box[data-v-6f39e90e]{width:100%;border-top:1px solid #e5e5e5}.vue-city-container .vue-city-content .city-sort-box .sort_letter[data-v-6f39e90e]{height:30px;line-height:30px;padding-left:15px;background:#f8f8f8;font-size:13px;color:#999;border-bottom:1px solid #e5e5e5}.vue-city-container .vue-city-content .city-sort-box .sort_item[data-v-6f39e90e]{padding-left:15px;position:relative}.vue-city-container .vue-city-content .city-sort-box .sort_item .sort_name[data-v-6f39e90e]{height:40px;line-height:40px;color:#333;font-size:15px;border-bottom:1px solid #e5e5e5}.vue-city-container .toast[data-v-6f39e90e]{position:fixed;left:50%;top:50%;transform:translate3d(-50%,-50%,0);width:100px;height:100px;border-radius:3px;background:#ccc;color:#333;font-size:20px;text-align:center;line-height:100px;box-shadow:0 3px 3px #ccc}.vue-city-container .slidebar[data-v-6f39e90e]{position:fixed;top:50%;transform:translateY(-50%);right:0;width:30px;text-align:center;font-size:12px;z-index:99;font-size:13px;color:#1c94eb}.vue-city-container .slidebar ul[data-v-6f39e90e]{background:#fff;padding:10px 0;border-radius:10px}.vue-city-container .slidebar ul li[data-v-6f39e90e]{list-style:none;height:3vh}",""])},function(t,i){function e(t,i){var e=t[1]||"",s=t[3];if(!s)return e;if(i&&"function"==typeof btoa){var n=o(s);return[e].concat(s.sources.map(function(t){return"/*# sourceURL="+s.sourceRoot+t+" */"})).concat([n]).join("\n")}return[e].join("\n")}function o(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var i=[];return i.toString=function(){return this.map(function(i){var o=e(i,t);return i[2]?"@media "+i[2]+"{"+o+"}":o}).join("")},i.i=function(t,e){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},s=0;se.parts.length&&(o.parts.length=e.parts.length)}else{for(var r=[],s=0;s1?i-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:"click",o=void 0;"mouseup"===t.type||"mousecancel"===t.type?o=t:"touchend"!==t.type&&"touchcancel"!==t.type||(o=t.changedTouches[0]);var s={};o&&(s.screenX=o.screenX||0,s.screenY=o.screenY||0,s.clientX=o.clientX||0,s.clientY=o.clientY||0);var r=void 0,h=!0,a=!0;if("undefined"!=typeof MouseEvent)try{r=new MouseEvent(e,n({bubbles:h,cancelable:a},s))}catch(t){i()}else i();r.forwardedTouchEvent=!0,r._constructed=!0,t.target.dispatchEvent(r)}function v(t){g(t,"dblclick")}function y(t,i){i.firstChild?x(t,i.firstChild):i.appendChild(t)}function x(t,i){i.parentNode.insertBefore(t,i)}function w(t,i){t.removeChild(i)}function b(t,i,e,o,s,n,r){var h=t-i,a=Math.abs(h)/e,c=r.deceleration,l=r.itemHeight,p=r.swipeBounceTime,u=r.wheel,d=r.swipeTime,f=d,m=u?4:15,g=t+a/c*(h<0?-1:1);return u&&l&&(g=Math.round(g/l)*l),gs&&(g=n?Math.min(s+n/4,s+n/m*a):s,f=p),{destination:Math.round(g),duration:f}}function S(){}function T(t){console.error("[BScroll warn]: "+t)}function _(t,i){if(!t)throw new Error("[BScroll] "+i)}function Y(t){var i=document.createElement("div"),e=document.createElement("div");return i.style.cssText="position:absolute;z-index:9999;pointerEvents:none",e.style.cssText="box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px;",e.className="bscroll-indicator","horizontal"===t?(i.style.cssText+=";height:7px;left:2px;right:2px;bottom:0",e.style.height="100%",i.className="bscroll-horizontal-scrollbar"):(i.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px",e.style.width="100%",i.className="bscroll-vertical-scrollbar"),i.style.cssText+=";overflow:hidden",i.appendChild(e),i}function M(t,i){this.wrapper=i.el,this.wrapperStyle=this.wrapper.style,this.indicator=this.wrapper.children[0],this.indicatorStyle=this.indicator.style,this.scroller=t,this.direction=i.direction,i.fade?(this.visible=0,this.wrapperStyle.opacity="0"):this.visible=1,this.sizeRatioX=1,this.sizeRatioY=1,this.maxPosX=0,this.maxPosY=0,this.x=0,this.y=0,i.interactive&&this._addDOMEvents()}function X(t){if(t&&t.classList)return t.classList.contains("tombstone")}function P(t,i){var e=this;this.options=i,_("function"==typeof this.options.createTombstone,"Infinite scroll need createTombstone Function to create tombstone"),_("function"==typeof this.options.fetch,"Infinite scroll need fetch Function to fetch new data."),_("function"==typeof this.options.render,"Infinite scroll need render Function to render each item."),this.firstAttachedItem=0,this.lastAttachedItem=0,this.anchorScrollTop=0,this.anchorItem={index:0,offset:0},this.tombstoneHeight=0,this.tombstoneWidth=0,this.tombstones=[],this.tombstonesAnimationHandlers=[],this.items=[],this.loadedItems=0,this.requestInProgress=!1,this.hasMore=!0,this.scroller=t,this.wrapperEl=this.scroller.wrapper,this.scrollerEl=this.scroller.scroller,this.scroller.on("scroll",function(){e.onScroll()}),this.scroller.on("resize",function(){e.onResize()}),this.scroller.on("destroy",function(){e.destroy()}),this._onResizeHandler=setTimeout(function(){e.onResize()})}function E(t,i){this.wrapper="string"==typeof t?document.querySelector(t):t,this.wrapper||T("Can not resolve the wrapper DOM."),this.scroller=this.wrapper.children[0],this.scroller||T("The wrapper need at least one child element to be scroller."),this.scrollerStyle=this.scroller.style,this._init(i)}var D=function(){function t(t,i){var e=[],o=!0,s=!1,n=void 0;try{for(var r,h=t[Symbol.iterator]();!(o=(r=h.next()).done)&&(e.push(r.value),!i||e.length!==i);o=!0);}catch(t){s=!0,n=t}finally{try{!o&&h.return&&h.return()}finally{if(s)throw n}}return e}return function(i,e){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return t(i,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),C=function(t){if(Array.isArray(t)){for(var i=0,e=Array(t.length);i0,W=k&&document.createElement("div").style,L=function(){if(!k)return!1;var t={webkit:"webkitTransform",Moz:"MozTransform",O:"OTransform",ms:"msTransform",standard:"transform"};for(var i in t)if(void 0!==W[t[i]])return i;return!1}(),A=L&&"standard"!==L?"-"+L.toLowerCase()+"-":"",O=a("transform"),R=a("transition"),N=k&&a("perspective")in W,U=k&&("ontouchstart"in window||H),F=!1!==O,B=k&&R in W,j={transform:O,transition:R,transitionTimingFunction:a("transitionTimingFunction"),transitionDuration:a("transitionDuration"),transitionDelay:a("transitionDelay"),transformOrigin:a("transformOrigin"),transitionEnd:a("transitionEnd")},q=1,V={touchstart:q,touchmove:q,touchend:q,mousedown:2,mousemove:2,mouseup:2},$={startX:0,startY:0,scrollX:!1,scrollY:!0,freeScroll:!1,directionLockThreshold:5,eventPassthrough:"",click:!1,tap:!1,bounce:!0,bounceTime:800,momentum:!0,momentumLimitTime:300,momentumLimitDistance:15,swipeTime:2500,swipeBounceTime:500,deceleration:.0015,flickLimitTime:200,flickLimitDistance:100,resizePolling:60,probeType:0,preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/},HWCompositing:!0,useTransition:!0,useTransform:!0,bindToWrapper:!1,disableMouse:U,disableTouch:!U,observeDOM:!0,autoBlur:!0,wheel:!1,snap:!1,scrollbar:!1,pullDownRefresh:!1,pullUpLoad:!1,mouseWheel:!1,stopPropagation:!1,zoom:!1,infinity:!1,dblclick:!1},Z={swipe:{style:"cubic-bezier(0.23, 1, 0.32, 1)",fn:function(t){return 1+--t*t*t*t*t}},swipeBounce:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(t){return t*(2-t)}},bounce:{style:"cubic-bezier(0.165, 0.84, 0.44, 1)",fn:function(t){return 1- --t*t*t*t}}},G=function(){return k?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,(t.interval||100/60)/2)}:S}(),J=function(){return k?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||function(t){window.clearTimeout(t)}:S}(),K=1,Q=-1,tt=1,it=-1,et=1,ot=3;M.prototype.handleEvent=function(t){switch(t.type){case"touchstart":case"mousedown":this._start(t);break;case"touchmove":case"mousemove":this._move(t);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this._end(t)}},M.prototype.refresh=function(){this._shouldShow()&&(this.transitionTime(),this._calculate(),this.updatePosition())},M.prototype.fade=function(t,i){var e=this;if(!i||this.visible){var o=t?250:500;t=t?"1":"0",this.wrapperStyle[j.transitionDuration]=o+"ms",clearTimeout(this.fadeTimeout),this.fadeTimeout=setTimeout(function(){e.wrapperStyle.opacity=t,e.visible=+t},0)}},M.prototype.updatePosition=function(){if("vertical"===this.direction){var t=Math.round(this.sizeRatioY*this.scroller.y);if(t<0){this.transitionTime(500);var i=Math.max(this.indicatorHeight+3*t,8);this.indicatorStyle.height=i+"px",t=0}else if(t>this.maxPosY){this.transitionTime(500);var e=Math.max(this.indicatorHeight-3*(t-this.maxPosY),8);this.indicatorStyle.height=e+"px",t=this.maxPosY+this.indicatorHeight-e}else this.indicatorStyle.height=this.indicatorHeight+"px";this.y=t,this.scroller.options.useTransform?this.indicatorStyle[j.transform]="translateY("+t+"px)"+this.scroller.translateZ:this.indicatorStyle.top=t+"px"}else{var o=Math.round(this.sizeRatioX*this.scroller.x);if(o<0){this.transitionTime(500);var s=Math.max(this.indicatorWidth+3*o,8);this.indicatorStyle.width=s+"px",o=0}else if(o>this.maxPosX){this.transitionTime(500);var n=Math.max(this.indicatorWidth-3*(o-this.maxPosX),8);this.indicatorStyle.width=n+"px",o=this.maxPosX+this.indicatorWidth-n}else this.indicatorStyle.width=this.indicatorWidth+"px";this.x=o,this.scroller.options.useTransform?this.indicatorStyle[j.transform]="translateX("+o+"px)"+this.scroller.translateZ:this.indicatorStyle.left=o+"px"}},M.prototype.transitionTime=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.indicatorStyle[j.transitionDuration]=t+"ms"},M.prototype.transitionTimingFunction=function(t){this.indicatorStyle[j.transitionTimingFunction]=t},M.prototype.destroy=function(){this._removeDOMEvents(),this.wrapper.parentNode.removeChild(this.wrapper)},M.prototype._start=function(t){var i=t.touches?t.touches[0]:t;t.preventDefault(),t.stopPropagation(),this.transitionTime(),this.initiated=!0,this.moved=!1,this.lastPointX=i.pageX,this.lastPointY=i.pageY,this.startTime=s(),this._handleMoveEvents(c),this.scroller.trigger("beforeScrollStart")},M.prototype._move=function(t){var i=t.touches?t.touches[0]:t;t.preventDefault(),t.stopPropagation(),this.moved||this.scroller.trigger("scrollStart"),this.moved=!0;var e=i.pageX-this.lastPointX;this.lastPointX=i.pageX;var o=i.pageY-this.lastPointY;this.lastPointY=i.pageY;var s=this.x+e,n=this.y+o;this._pos(s,n)},M.prototype._end=function(t){if(this.initiated){this.initiated=!1,t.preventDefault(),t.stopPropagation(),this._handleMoveEvents(l);var i=this.scroller.options.snap;if(i){var e=i.speed,o=i.easing,s=void 0===o?Z.bounce:o,n=this.scroller._nearestSnap(this.scroller.x,this.scroller.y),r=e||Math.max(Math.max(Math.min(Math.abs(this.scroller.x-n.x),1e3),Math.min(Math.abs(this.scroller.y-n.y),1e3)),300);this.scroller.x===n.x&&this.scroller.y===n.y||(this.scroller.directionX=0,this.scroller.directionY=0,this.scroller.currentPage=n,this.scroller.scrollTo(n.x,n.y,r,s))}this.moved&&this.scroller.trigger("scrollEnd",{x:this.scroller.x,y:this.scroller.y})}},M.prototype._pos=function(t,i){t<0?t=0:t>this.maxPosX&&(t=this.maxPosX),i<0?i=0:i>this.maxPosY&&(i=this.maxPosY),t=Math.round(t/this.sizeRatioX),i=Math.round(i/this.sizeRatioY),this.scroller.scrollTo(t,i),this.scroller.trigger("scroll",{x:this.scroller.x,y:this.scroller.y})},M.prototype._shouldShow=function(){return"vertical"===this.direction&&this.scroller.hasVerticalScroll||"horizontal"===this.direction&&this.scroller.hasHorizontalScroll?(this.wrapper.style.display="",!0):(this.wrapper.style.display="none",!1)},M.prototype._calculate=function(){if("vertical"===this.direction){var t=this.wrapper.clientHeight;this.indicatorHeight=Math.max(Math.round(t*t/(this.scroller.scrollerHeight||t||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px",this.maxPosY=t-this.indicatorHeight,this.sizeRatioY=this.maxPosY/this.scroller.maxScrollY}else{var i=this.wrapper.clientWidth;this.indicatorWidth=Math.max(Math.round(i*i/(this.scroller.scrollerWidth||i||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px",this.maxPosX=i-this.indicatorWidth,this.sizeRatioX=this.maxPosX/this.scroller.maxScrollX}},M.prototype._addDOMEvents=function(){var t=c;this._handleDOMEvents(t)},M.prototype._removeDOMEvents=function(){var t=l;this._handleDOMEvents(t),this._handleMoveEvents(t)},M.prototype._handleMoveEvents=function(t){this.scroller.options.disableTouch||t(window,"touchmove",this),this.scroller.options.disableMouse||t(window,"mousemove",this)},M.prototype._handleDOMEvents=function(t){this.scroller.options.disableTouch||(t(this.indicator,"touchstart",this),t(window,"touchend",this)),this.scroller.options.disableMouse||(t(this.indicator,"mousedown",this),t(window,"mouseup",this))};var st=2e3;P.prototype.destroy=function(){var t=this;clearTimeout(this._onResizeHandler),this.tombstonesAnimationHandlers.forEach(function(t){clearTimeout(t)}),this.tombstonesAnimationHandlers=null,this.items.forEach(function(i){i.node&&(t.scrollerEl.removeChild(i.node),i.node=null)}),this.scroller.infiniteScroller=null,this.scroller=null,this.wrapperEl=null,this.scrollerEl=null,this.items=null,this.tombstones=null},P.prototype.onScroll=function(){var t=-this.scroller.y,i=t-this.anchorScrollTop;this.anchorItem=0===t?{index:0,offset:0}:this._calculateAnchoredItem(this.anchorItem,i),this.anchorScrollTop=t;var e=this._calculateAnchoredItem(this.anchorItem,this.scroller.wrapperHeight),o=this.anchorItem.index,s=e.index;i<0?(o-=30,s+=10):(o-=10,s+=30),this.fill(o,s),this.maybeRequestContent()},P.prototype.onResize=function(){var t=this.options.createTombstone();t.style.position="absolute",this.scrollerEl.appendChild(t),t.style.display="",this.tombstoneHeight=t.offsetHeight,this.tombstoneWidth=t.offsetWidth,this.scrollerEl.removeChild(t);for(var i=0;ithis.firstAttachedItem;)i-=this.items[e-1].height||this.tombstoneHeight,e--;return i},P.prototype._setupAnimations=function(t,i){var e=this;for(var o in t){var s=t[o];this.items[o].node.style[j.transform]="translateY("+(this.anchorScrollTop+s[1])+"px) scale("+this.tombstoneWidth/this.items[o].width+", "+this.tombstoneHeight/this.items[o].height+")",this.items[o].node.offsetTop,s[0].offsetTop,this.items[o].node.style[j.transition]=A+"transform 200ms"}for(var n=this.firstAttachedItem;n0&&this.items[e-1].height;)i+=this.items[e-1].height,e--;o=Math.max(-e,Math.ceil(Math.min(i,0)/this.tombstoneHeight))}else{for(;i>0&&e=this.items.length||!this.items[e].height)&&(o=Math.floor(Math.max(i,0)/this.tombstoneHeight))}return e+=o,i-=o*this.tombstoneHeight,{index:e,offset:i}},function(t){t.prototype._init=function(t){this._handleOptions(t),this._events={},this.x=0,this.y=0,this.directionX=0,this.directionY=0,this.setScale(1),this._addDOMEvents(),this._initExtFeatures(),this._watchTransition(),this.options.observeDOM&&this._initDOMObserver(),this.options.autoBlur&&this._handleAutoBlur(),this.refresh(),this.options.snap||this.scrollTo(this.options.startX,this.options.startY),this.enable()},t.prototype.setScale=function(t){this.lastScale=r(this.scale)?t:this.scale,this.scale=t},t.prototype._handleOptions=function(t){this.options=n({},$,t),this.translateZ=this.options.HWCompositing&&N?" translateZ(0)":"",this.options.useTransition=this.options.useTransition&&B,this.options.useTransform=this.options.useTransform&&F,this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault,this.options.scrollX="horizontal"!==this.options.eventPassthrough&&this.options.scrollX,this.options.scrollY="vertical"!==this.options.eventPassthrough&&this.options.scrollY,this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough,this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold,!0===this.options.tap&&(this.options.tap="tap")},t.prototype._addDOMEvents=function(){var t=c;this._handleDOMEvents(t)},t.prototype._removeDOMEvents=function(){var t=l;this._handleDOMEvents(t)},t.prototype._handleDOMEvents=function(t){var i=this.options.bindToWrapper?this.wrapper:window;t(window,"orientationchange",this),t(window,"resize",this),this.options.click&&t(this.wrapper,"click",this,!0),this.options.disableMouse||(t(this.wrapper,"mousedown",this),t(i,"mousemove",this),t(i,"mousecancel",this),t(i,"mouseup",this)),U&&!this.options.disableTouch&&(t(this.wrapper,"touchstart",this),t(i,"touchmove",this),t(i,"touchcancel",this),t(i,"touchend",this)),t(this.scroller,j.transitionEnd,this)},t.prototype._initExtFeatures=function(){this.options.snap&&this._initSnap(),this.options.scrollbar&&this._initScrollbar(),this.options.pullUpLoad&&this._initPullUp(),this.options.pullDownRefresh&&this._initPullDown(),this.options.wheel&&this._initWheel(),this.options.mouseWheel&&this._initMouseWheel(),this.options.zoom&&this._initZoom(),this.options.infinity&&this._initInfinite()},t.prototype._watchTransition=function(){if("function"==typeof Object.defineProperty){var t=this,i=!1,e=this.options.useTransition?"isInTransition":"isAnimating";Object.defineProperty(this,e,{get:function(){return i},set:function(e){i=e;for(var o=t.scroller.children.length?t.scroller.children:[t.scroller],s=i&&!t.pulling?"none":"auto",n=0;nthis.minScrollX||this.xthis.minScrollY||this.y1&&this._zoomStart(t);break;case"touchmove":case"mousemove":this.options.zoom&&t.touches&&t.touches.length>1?this._zoom(t):this._move(t);break;case"touchend":case"mouseup":case"touchcancel":case"mousecancel":this.scaled?this._zoomEnd(t):this._end(t);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(t);break;case"click":this.enabled&&!t._constructed&&(f(t.target,this.options.preventDefaultException)||(t.preventDefault(),t.stopPropagation()));break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._onMouseWheel(t)}},t.prototype.refresh=function(){var t="static"===window.getComputedStyle(this.wrapper,null).position,i=d(this.wrapper);this.wrapperWidth=i.width,this.wrapperHeight=i.height;var e=d(this.scroller);this.scrollerWidth=Math.round(e.width*this.scale),this.scrollerHeight=Math.round(e.height*this.scale),this.relativeX=e.left,this.relativeY=e.top,t&&(this.relativeX-=i.left,this.relativeY-=i.top),this.minScrollX=0,this.minScrollY=0;var o=this.options.wheel;o?(this.items=this.scroller.children,this.options.itemHeight=this.itemHeight=this.items.length?this.scrollerHeight/this.items.length:0,void 0===this.selectedIndex&&(this.selectedIndex=o.selectedIndex||0),this.options.startY=-this.selectedIndex*this.itemHeight,this.maxScrollX=0,this.maxScrollY=-this.itemHeight*(this.items.length-1)):(this.maxScrollX=this.wrapperWidth-this.scrollerWidth,this.options.infinity||(this.maxScrollY=this.wrapperHeight-this.scrollerHeight),this.maxScrollX<0?(this.maxScrollX-=this.relativeX,this.minScrollX=-this.relativeX):this.scale>1&&(this.maxScrollX=this.maxScrollX/2-this.relativeX,this.minScrollX=this.maxScrollX),this.maxScrollY<0?(this.maxScrollY-=this.relativeY,this.minScrollY=-this.relativeY):this.scale>1&&(this.maxScrollY=this.maxScrollY/2-this.relativeY,this.minScrollY=this.maxScrollY)),this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollXthis.options.momentumLimitTime&&rr+this.options.directionLockThreshold?this.directionLocked="h":r>=n+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"===this.directionLocked){if("vertical"===this.options.eventPassthrough)t.preventDefault();else if("horizontal"===this.options.eventPassthrough)return void(this.initiated=!1);o=0}else if("v"===this.directionLocked){if("horizontal"===this.options.eventPassthrough)t.preventDefault();else if("vertical"===this.options.eventPassthrough)return void(this.initiated=!1);e=0}e=this.hasHorizontalScroll?e:0,o=this.hasVerticalScroll?o:0,this.movingDirectionX=e>0?it:e<0?tt:0,this.movingDirectionY=o>0?Q:o<0?K:0;var a=this.x+e,c=this.y+o,l=!1,p=!1,u=!1,d=!1,f=this.options.bounce;!1!==f&&(l=void 0===f.top||f.top,p=void 0===f.bottom||f.bottom,u=void 0===f.left||f.left,d=void 0===f.right||f.right),(a>this.minScrollX||athis.minScrollX&&u||athis.minScrollX?this.minScrollX:this.maxScrollX),(c>this.minScrollY||cthis.minScrollY&&l||cthis.minScrollY?this.minScrollY:this.maxScrollY),this.moved||(this.moved=!0,this.trigger("scrollStart")),this._translate(a,c),h-this.startTime>this.options.momentumLimitTime&&(this.startTime=h,this.startX=this.x,this.startY=this.y,this.options.probeType===et&&this.trigger("scroll",{x:this.x,y:this.y})),this.options.probeType>et&&this.trigger("scroll",{x:this.x,y:this.y});var m=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,g=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,v=this.pointX-m,y=this.pointY-g;(v>document.documentElement.clientWidth-this.options.momentumLimitDistance||vdocument.documentElement.clientHeight-this.options.momentumLimitDistance)&&this._end(t)}}},t.prototype._end=function(t){if(this.enabled&&!this.destroyed&&V[t.type]===this.initiated){this.initiated=!1,this.options.preventDefault&&!f(t.target,this.options.preventDefaultException)&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.trigger("touchEnd",{x:this.x,y:this.y}),this.isInTransition=!1;var i=Math.round(this.x),e=Math.round(this.y),o=i-this.absStartX,n=e-this.absStartY;if(this.directionX=o>0?it:o<0?tt:0,this.directionY=n>0?Q:n<0?K:0,!this.options.pullDownRefresh||!this._checkPullDown()){if(this._checkClick(t))return void this.trigger("scrollCancel");if(!this.resetPosition(this.options.bounceTime,Z.bounce)){this._translate(i,e),this.endTime=s();var r=this.endTime-this.startTime,h=Math.abs(i-this.startX),a=Math.abs(e-this.startY);if(this._events.flick&&rthis.options.momentumLimitDistance||h>this.options.momentumLimitDistance)){var l=!1,p=!1,u=!1,d=!1,m=this.options.bounce;!1!==m&&(l=void 0===m.top||m.top,p=void 0===m.bottom||m.bottom,u=void 0===m.left||m.left,d=void 0===m.right||m.right);var g=this.directionX===it&&u||this.directionX===tt&&d?this.wrapperWidth:0,v=this.directionY===Q&&l||this.directionY===K&&p?this.wrapperHeight:0,y=this.hasHorizontalScroll?b(this.x,this.startX,r,this.maxScrollX,this.minScrollX,g,this.options):{destination:i,duration:0},x=this.hasVerticalScroll?b(this.y,this.startY,r,this.maxScrollY,this.minScrollY,v,this.options):{destination:e,duration:0};i=y.destination,e=x.destination,c=Math.max(y.duration,x.duration),this.isInTransition=!0}else this.options.wheel&&(e=Math.round(e/this.itemHeight)*this.itemHeight,c=this.options.wheel.adjustTime||400);var w=Z.swipe;if(this.options.snap){var S=this._nearestSnap(i,e);this.currentPage=S,c=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(i-S.x),1e3),Math.min(Math.abs(e-S.y),1e3)),300),i=S.x,e=S.y,this.directionX=0,this.directionY=0,w=this.options.snap.easing||Z.bounce}if(i!==this.x||e!==this.y)return(i>this.minScrollX||ithis.minScrollY||e0&&void 0!==arguments[0]?arguments[0]:0;if(this.scrollerStyle[j.transitionDuration]=t+"ms",this.options.wheel)for(var i=0;i=u)return r.isAnimating=!1,r._translate(t,i,l),r.trigger("scroll",{x:r.x,y:r.y}),void(r.pulling||r.resetPosition(r.options.bounceTime)||r.trigger("scrollEnd",{x:r.x,y:r.y}));d=(d-p)/e;var f=o(d),m=(t-h)*f+h,g=(i-a)*f+a,v=(l-c)*f+c;r._translate(m,g,v),r.isAnimating&&(r.animateTimer=G(n)),r.options.probeType===ot&&r.trigger("scroll",{x:r.x,y:r.y})}var r=this,h=this.x,a=this.y,c=this.lastScale,l=this.scale,p=s(),u=p+e;this.isAnimating=!0,J(this.animateTimer),n()},t.prototype.scrollBy=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Z.bounce;t=this.x+t,i=this.y+i,this.scrollTo(t,i,e,o)},t.prototype.scrollTo=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Z.bounce;(this.x!==t||this.y!==i)&&(this.isInTransition=this.options.useTransition&&e>0&&(t!==this.x||i!==this.y),!e||this.options.useTransition?(this._transitionTimingFunction(o.style),this._transitionTime(e),this._translate(t,i),e&&this.options.probeType===ot&&this._startProbe(),e||(this.trigger("scroll",{x:t,y:i}),this._reflow=document.body.offsetHeight,this.resetPosition(this.options.bounceTime,Z.bounce)||this.trigger("scrollEnd",{x:t,y:i})),this.options.wheel&&(i>this.minScrollY?this.selectedIndex=0:ithis.minScrollX?this.minScrollX:n.leftthis.minScrollY?this.minScrollY:n.top0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Z.bounce,e=this.x,o=Math.round(e);!this.hasHorizontalScroll||o>this.minScrollX?e=this.minScrollX:othis.minScrollY?s=this.minScrollY:n2&&void 0!==arguments[2]?arguments[2]:this;this._events[t]||(this._events[t]=[]),this._events[t].push([i,e])},t.prototype.once=function(t,i){function e(){this.off(t,e),i.apply(o,arguments)}var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;e.fn=i,this.on(t,e)},t.prototype.off=function(t,i){var e=this._events[t];if(e)for(var s=e.length;s--;)(e[s][0]===i||e[s][0]&&e[s][0].fn===i)&&o(e,s)},t.prototype.trigger=function(t){var i=this._events[t];if(i)for(var e=i.length,o=[].concat(C(i)),s=0;s1?(y(e[e.length-1].cloneNode(!0),this.scroller),this.scroller.appendChild(e[1].cloneNode(!0))):i.loop=!1}var o=i.el;"string"==typeof o&&(o=this.scroller.querySelectorAll(o)),this.on("refresh",function(){if(t.pages=[],t.wrapperWidth&&t.wrapperHeight&&t.scrollerWidth&&t.scrollerHeight){var e=i.stepX||t.wrapperWidth,s=i.stepY||t.wrapperHeight,n=0,r=void 0,h=void 0,a=void 0,c=0,l=void 0,p=0,u=void 0,f=void 0;if(o)for(l=o.length,u=-1;ct.maxScrollX&&p++;else for(h=Math.round(e/2),a=Math.round(s/2);n>-t.scrollerWidth;){for(t.pages[c]=[],l=0,r=0;r>-t.scrollerHeight;)t.pages[c][l]={x:Math.max(n,t.maxScrollX),y:Math.max(r,t.maxScrollY),width:e,height:s,cx:n-h,cy:r-a},r-=s,l++;n-=e,c++}t._checkSnapLoop();var m=i._loopX?1:0,g=i._loopY?1:0;t._goToPage(t.currentPage.pageX||m,t.currentPage.pageY||g,0);var v=i.threshold;v%1==0?(t.snapThresholdX=v,t.snapThresholdY=v):(t.snapThresholdX=Math.round(t.pages[t.currentPage.pageX][t.currentPage.pageY].width*v),t.snapThresholdY=Math.round(t.pages[t.currentPage.pageX][t.currentPage.pageY].height*v))}}),this.on("scrollEnd",function(){i.loop&&(i._loopX?(0===t.currentPage.pageX&&t._goToPage(t.pages.length-2,t.currentPage.pageY,0),t.currentPage.pageX===t.pages.length-1&&t._goToPage(1,t.currentPage.pageY,0)):(0===t.currentPage.pageY&&t._goToPage(t.currentPage.pageX,t.pages[0].length-2,0),t.currentPage.pageY===t.pages[0].length-1&&t._goToPage(t.currentPage.pageX,1,0)))}),!1!==i.listenFlick&&this.on("flick",function(){var e=i.speed||Math.max(Math.max(Math.min(Math.abs(t.x-t.startX),1e3),Math.min(Math.abs(t.y-t.startY),1e3)),300);t._goToPage(t.currentPage.pageX+t.directionX,t.currentPage.pageY+t.directionY,e)}),this.on("destroy",function(){if(i.loop){var e=t.scroller.children;e.length>2&&(w(t.scroller,e[e.length-1]),w(t.scroller,e[0]))}})},t.prototype._checkSnapLoop=function(){var t=this.options.snap;t.loop&&this.pages&&this.pages.length&&(this.pages.length>1&&(t._loopX=!0),this.pages[0]&&this.pages[0].length>1&&(t._loopY=!0),t._loopX&&t._loopY&&T("Loop does not support two direction at the same time."))},t.prototype._nearestSnap=function(t,i){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var e=0;if(Math.abs(t-this.absStartX)<=this.snapThresholdX&&Math.abs(i-this.absStartY)<=this.snapThresholdY)return this.currentPage;t>this.minScrollX?t=this.minScrollX:tthis.minScrollY?i=this.minScrollY:i=this.pages[e][0].cx){t=this.pages[e][0].x;break}o=this.pages[e].length;for(var s=0;s=this.pages[0][s].cy){i=this.pages[0][s].y;break}return e===this.currentPage.pageX&&(e+=this.directionX,e<0?e=0:e>=this.pages.length&&(e=this.pages.length-1),t=this.pages[e][0].x),s===this.currentPage.pageY&&(s+=this.directionY,s<0?s=0:s>=this.pages[0].length&&(s=this.pages[0].length-1),i=this.pages[0][s].y),{x:t,y:i,pageX:e,pageY:s}},t.prototype._goToPage=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments[2],o=arguments[3],s=this.options.snap;if(s&&this.pages&&this.pages.length&&(o=o||s.easing||Z.bounce,t>=this.pages.length?t=this.pages.length-1:t<0&&(t=0),this.pages[t])){i>=this.pages[t].length?i=this.pages[t].length-1:i<0&&(i=0);var n=this.pages[t][i].x,r=this.pages[t][i].y;e=void 0===e?s.speed||Math.max(Math.max(Math.min(Math.abs(n-this.x),1e3),Math.min(Math.abs(r-this.y),1e3)),300):e,this.currentPage={x:n,y:r,pageX:t,pageY:i},this.scrollTo(n,r,e,o)}},t.prototype.goToPage=function(t,i,e,o){var s=this.options.snap;if(s&&this.pages&&this.pages.length){if(s.loop){var n=void 0;s._loopX?(n=this.pages.length-2,t>=n?t=n-1:t<0&&(t=0),t+=1):(n=this.pages[0].length-2,i>=n?i=n-1:i<0&&(i=0),i+=1)}this._goToPage(t,i,e,o)}},t.prototype.next=function(t,i){if(this.options.snap){var e=this.currentPage.pageX,o=this.currentPage.pageY;e++,e>=this.pages.length&&this.hasVerticalScroll&&(e=0,o++),this._goToPage(e,o,t,i)}},t.prototype.prev=function(t,i){if(this.options.snap){var e=this.currentPage.pageX,o=this.currentPage.pageY;e--,e<0&&this.hasVerticalScroll&&(e=0,o--),this._goToPage(e,o,t,i)}},t.prototype.getCurrentPage=function(){var t=this.options.snap;return t?t.loop?t._loopX?n({},this.currentPage,{pageX:this.currentPage.pageX-1}):n({},this.currentPage,{pageY:this.currentPage.pageY-1}):this.currentPage:null}}(E),function(t){t.prototype.wheelTo=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.options.wheel&&(this.y=-t*this.itemHeight,this.scrollTo(0,this.y))},t.prototype.getSelectedIndex=function(){return this.options.wheel&&this.selectedIndex},t.prototype._initWheel=function(){var t=this.options.wheel;t.wheelWrapperClass||(t.wheelWrapperClass="wheel-scroll"),t.wheelItemClass||(t.wheelItemClass="wheel-item"),void 0===t.selectedIndex&&(t.selectedIndex=0,T("wheel option selectedIndex is required!"))}}(E),function(t){t.prototype._initScrollbar=function(){var t=this,i=this.options.scrollbar,e=i.fade,o=void 0===e||e,s=i.interactive,n=void 0!==s&&s;this.indicators=[];var r=void 0;this.options.scrollX&&(r={el:Y("horizontal"),direction:"horizontal",fade:o,interactive:n},this._insertScrollBar(r.el),this.indicators.push(new M(this,r))),this.options.scrollY&&(r={el:Y("vertical"),direction:"vertical",fade:o,interactive:n},this._insertScrollBar(r.el),this.indicators.push(new M(this,r))),this.on("refresh",function(){for(var i=0;i0&&void 0!==arguments[0])||arguments[0];this.options.pullDownRefresh=t,this._initPullDown()},t.prototype.closePullDown=function(){this.options.pullDownRefresh=!1},t.prototype.autoPullDownRefresh=function(){var t=this.options.pullDownRefresh,i=t.threshold,e=void 0===i?90:i,o=t.stop,s=void 0===o?40:o;this.pulling||(this.pulling=!0,this.scrollTo(this.x,e),this.trigger("pullingDown"),this.scrollTo(this.x,s,this.options.bounceTime,Z.bounce))}}(E),function(t){t.prototype._initPullUp=function(){this.options.probeType=ot,this.pullupWatching=!1,this._watchPullUp()},t.prototype._watchPullUp=function(){this.pullupWatching||(this.pullupWatching=!0,this.on("scroll",this._checkToEnd))},t.prototype._checkToEnd=function(t){var i=this,e=this.options.pullUpLoad.threshold,o=void 0===e?0:e;this.movingDirectionY===K&&t.y<=this.maxScrollY+o&&(this.once("scrollEnd",function(){i.pullupWatching=!1}),this.trigger("pullingUp"),this.off("scroll",this._checkToEnd))},t.prototype.finishPullUp=function(){var t=this;this.pullupWatching?this.once("scrollEnd",function(){t._watchPullUp()}):this._watchPullUp()},t.prototype.openPullUp=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.options.pullUpLoad=t,this._initPullUp()},t.prototype.closePullUp=function(){this.options.pullUpLoad=!1,this.pullupWatching&&(this.pullupWatching=!1,this.off("scroll",this._checkToEnd))}}(E),function(t){t.prototype._initMouseWheel=function(){var t=this;this._handleMouseWheelEvent(c),this.on("destroy",function(){clearTimeout(t.mouseWheelTimer),clearTimeout(t.mouseWheelEndTimer),t._handleMouseWheelEvent(l)}),this.firstWheelOpreation=!0},t.prototype._handleMouseWheelEvent=function(t){t(this.wrapper,"wheel",this),t(this.wrapper,"mousewheel",this),t(this.wrapper,"DOMMouseScroll",this)},t.prototype._onMouseWheel=function(t){var i=this;if(this.enabled){t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.firstWheelOpreation&&this.trigger("scrollStart"),this.firstWheelOpreation=!1;var e=this.options.mouseWheel,o=e.speed,s=void 0===o?20:o,n=e.invert,r=void 0!==n&&n,h=e.easeTime,a=void 0===h?300:h;clearTimeout(this.mouseWheelTimer),this.mouseWheelTimer=setTimeout(function(){i.options.snap||a||i.trigger("scrollEnd",{x:i.x,y:i.y}),i.firstWheelOpreation=!0},400);var c=void 0,l=void 0;switch(!0){case"deltaX"in t:1===t.deltaMode?(c=-t.deltaX*s,l=-t.deltaY*s):(c=-t.deltaX,l=-t.deltaY);break;case"wheelDeltaX"in t:c=t.wheelDeltaX/120*s,l=t.wheelDeltaY/120*s;break;case"wheelDelta"in t:c=l=t.wheelDelta/120*s;break;case"detail"in t:c=l=-t.detail/3*s;break;default:return}var p=r?-1:1;c*=p,l*=p,this.hasVerticalScroll||(c=l,l=0);var u=void 0,d=void 0;if(this.options.snap)return u=this.currentPage.pageX,d=this.currentPage.pageY,c>0?u--:c<0&&u++,l>0?d--:l<0&&d++,void this._goToPage(u,d);u=this.x+Math.round(this.hasHorizontalScroll?c:0),d=this.y+Math.round(this.hasVerticalScroll?l:0),this.movingDirectionX=this.directionX=c>0?-1:c<0?1:0,this.movingDirectionY=this.directionY=l>0?-1:l<0?1:0,u>this.minScrollX?u=this.minScrollX:uthis.minScrollY?d=this.minScrollY:dthis.minScrollX?n=this.minScrollX:nthis.minScrollY?r=this.minScrollY:ru&&(r=2*u*Math.pow(.5,u/r));var d=r/this.startScale,f=this.startX-(this.originX-this.relativeX)*(d-1),m=this.startY-(this.originY-this.relativeY)*(d-1);this.setScale(r),this.scrollTo(f,m,0)}},t.prototype._zoomEnd=function(t){if(this.enabled&&!this.destroyed&&V[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation(),this.isInTransition=!1,this.isAnimating=!1,this.initiated=0;var i=this.options.zoom,e=i.min,o=void 0===e?1:e,s=i.max,n=void 0===s?4:s,r=this.scale>n?n:this.scale