Authored by biao

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

@@ -35,6 +35,11 @@ @@ -35,6 +35,11 @@
35 .demo-page .sort span { 35 .demo-page .sort span {
36 font-size: 20px; 36 font-size: 20px;
37 } 37 }
  38 +
  39 + .your-div {
  40 + width: 500px;
  41 + height: 200px;
  42 + }
38 </style> 43 </style>
39 <div class="demo-page blk-page"> 44 <div class="demo-page blk-page">
40 {{# content}} 45 {{# content}}
@@ -178,6 +183,27 @@ @@ -178,6 +183,27 @@
178 <p class="title">17. 分享</p> 183 <p class="title">17. 分享</p>
179 {{> share}} 184 {{> share}}
180 185
  186 +
  187 + <p class="title">18. 个性化滚动条</p>
  188 +
  189 + <div class="your-div nano">
  190 + <div class="nano-content">
  191 + <pre>
  192 + // html 添加样式 .nano .nano-content
  193 + &lt;div class="your-div nano">
  194 + &lt;div class="nano-content">
  195 + your content...
  196 + &lt;/div>
  197 + &lt;/div>
  198 +
  199 +
  200 + // js
  201 +
  202 + require('yoho-jquery-nanoscroller');
  203 + $('.nano').nanoScroller();
  204 + </pre>
  205 + </div>
  206 + </div>
181 {{/ content}} 207 {{/ content}}
182 </div> 208 </div>
183 209
@@ -13,9 +13,12 @@ var change = $('#change'); @@ -13,9 +13,12 @@ var change = $('#change');
13 var show = false; 13 var show = false;
14 14
15 require('yoho-jquery-qrcode'); 15 require('yoho-jquery-qrcode');
  16 +require('yoho-jquery-nanoscroller');
16 require('../plugins/tips'); 17 require('../plugins/tips');
17 require('../plugins/check'); 18 require('../plugins/check');
18 19
  20 +$('.nano').nanoScroller();
  21 +
19 $('.alert-btn').click(function() { 22 $('.alert-btn').click(function() {
20 new _alert('购买成功<br>进入 个人中心>我的订单<br>查看门票信息').show(); 23 new _alert('购买成功<br>进入 个人中心>我的订单<br>查看门票信息').show();
21 }); 24 });
@@ -92,7 +95,7 @@ $(function() { @@ -92,7 +95,7 @@ $(function() {
92 // 运行此demo 95 // 运行此demo
93 // 1. 安装 npm i -g json-server 96 // 1. 安装 npm i -g json-server
94 // 2. json-server --watch mock/address.json 97 // 2. json-server --watch mock/address.json
95 - cascadingAddress({ 98 + window.add = cascadingAddress({
96 el: '#address', 99 el: '#address',
97 url: 'http://localhost:3000/areas/0', 100 url: 'http://localhost:3000/areas/0',
98 resource: 'areas' 101 resource: 'areas'
@@ -34,4 +34,8 @@ @@ -34,4 +34,8 @@
34 dist: '320102' // 区县 34 dist: '320102' // 区县
35 }); 35 });
36 36
  37 + 重置地址:
  38 +
  39 + address.reset();
  40 +
37 开发者: 董金虎 41 开发者: 董金虎
@@ -439,6 +439,19 @@ CascadingAddress.prototype.setAddress = function(targetAddr) { @@ -439,6 +439,19 @@ CascadingAddress.prototype.setAddress = function(targetAddr) {
439 } 439 }
440 }; 440 };
441 441
  442 +// 重置地址
  443 +CascadingAddress.prototype.reset = function() {
  444 + var items = $(this.config.el).find('.items-indicator'),
  445 + labels = this.config.indicators;
  446 +
  447 + items.each(function(index, item) {
  448 + $(item).find('span.indicator-name').text(labels[index])
  449 + .next().val('')
  450 + .parent().next()
  451 + .find('span.checked').removeClass('checked').prev().hide();
  452 + });
  453 +};
  454 +
442 module.exports = function(options) { 455 module.exports = function(options) {
443 return new CascadingAddress(options); 456 return new CascadingAddress(options);
444 }; 457 };
@@ -2,6 +2,10 @@ @@ -2,6 +2,10 @@
2 2
3 font-size: 14px; 3 font-size: 14px;
4 4
  5 + .btn {
  6 + cursor: pointer;
  7 + }
  8 +
5 .center-content { 9 .center-content {
6 .left { 10 .left {
7 width: 250px; 11 width: 250px;
@@ -12,6 +16,7 @@ @@ -12,6 +16,7 @@
12 } 16 }
13 .input-radio { 17 .input-radio {
14 padding: 10px 1px; 18 padding: 10px 1px;
  19 + cursor: pointer;
15 20
16 .round-color { 21 .round-color {
17 width: 22px; 22 width: 22px;
@@ -79,6 +84,7 @@ @@ -79,6 +84,7 @@
79 padding: 5px 0; 84 padding: 5px 0;
80 margin: 5px 11px 5px 0; 85 margin: 5px 11px 5px 0;
81 display: inline-block; 86 display: inline-block;
  87 + cursor: pointer;
82 } 88 }
83 89
84 .select { 90 .select {
@@ -88,6 +94,7 @@ @@ -88,6 +94,7 @@
88 .mulit-choose { 94 .mulit-choose {
89 border: 1px solid #1b1b1b; 95 border: 1px solid #1b1b1b;
90 padding: 5px 10px; 96 padding: 5px 10px;
  97 + cursor: pointer;
91 } 98 }
92 } 99 }
93 .brand-btns { 100 .brand-btns {
@@ -188,6 +195,7 @@ @@ -188,6 +195,7 @@
188 float: right; 195 float: right;
189 color: #878787; 196 color: #878787;
190 margin: 22px 20px 0 0; 197 margin: 22px 20px 0 0;
  198 + cursor: pointer;
191 } 199 }
192 200
193 .filter-item { 201 .filter-item {
@@ -197,6 +205,7 @@ @@ -197,6 +205,7 @@
197 border: 1px solid #adacad; 205 border: 1px solid #adacad;
198 background-color: #fff; 206 background-color: #fff;
199 padding: 8px; 207 padding: 8px;
  208 + cursor: pointer;
200 209
201 span { 210 span {
202 font-size: 14px; 211 font-size: 14px;
@@ -241,6 +250,7 @@ @@ -241,6 +250,7 @@
241 margin: 14px 15px; 250 margin: 14px 15px;
242 height: 24px; 251 height: 24px;
243 line-height: 24px; 252 line-height: 24px;
  253 + cursor: pointer;
244 } 254 }
245 255
246 .dest { 256 .dest {
@@ -252,6 +262,7 @@ @@ -252,6 +262,7 @@
252 margin: 14px 15px; 262 margin: 14px 15px;
253 margin-left: -10px; 263 margin-left: -10px;
254 margin-bottom: -10px; 264 margin-bottom: -10px;
  265 + cursor: pointer;
255 266
256 .iconfont { 267 .iconfont {
257 display: block; 268 display: block;
@@ -304,6 +315,7 @@ @@ -304,6 +315,7 @@
304 font-size: 14px; 315 font-size: 14px;
305 text-align: center; 316 text-align: center;
306 margin-right: 8px; 317 margin-right: 8px;
  318 + cursor: pointer;
307 } 319 }
308 320
309 .page.disable { 321 .page.disable {
@@ -324,6 +336,7 @@ @@ -324,6 +336,7 @@
324 display: inline-block; 336 display: inline-block;
325 text-align: center; 337 text-align: center;
326 border: 2px solid #fff; 338 border: 2px solid #fff;
  339 + cursor: pointer;
327 340
328 .goods-brand { 341 .goods-brand {
329 font-weight: 700; 342 font-weight: 700;
@@ -390,6 +403,7 @@ @@ -390,6 +403,7 @@
390 403
391 img { 404 img {
392 margin: 8px 0; 405 margin: 8px 0;
  406 + cursor: pointer;
393 } 407 }
394 } 408 }
395 } 409 }