Authored by 毕凯

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

@@ -12,8 +12,9 @@ var $dialogWrapper, @@ -12,8 +12,9 @@ var $dialogWrapper,
12 dialogTpl, 12 dialogTpl,
13 dialogTemplate; 13 dialogTemplate;
14 14
15 -  
16 -dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' + 15 +function getInstance() {
  16 + if (dialogTpl === undefined) {
  17 + dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
17 '<div class="dialog-box">' + 18 '<div class="dialog-box">' +
18 '{{# hasHeader}}' + 19 '{{# hasHeader}}' +
19 '{{/ hasHeader}}' + 20 '{{/ hasHeader}}' +
@@ -31,11 +32,15 @@ dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' + @@ -31,11 +32,15 @@ dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
31 '</div>' + 32 '</div>' +
32 '</div>'; 33 '</div>';
33 34
34 -dialogTemplate = Handlebars.compile(dialogTpl); 35 + dialogTemplate = Handlebars.compile(dialogTpl);
  36 + }
  37 + return dialogTemplate;
  38 +}
35 39
36 exports.showDialog = function(data, callback, callbackForLeft) { 40 exports.showDialog = function(data, callback, callbackForLeft) {
37 41
38 - var dialogStr = dialogTemplate(data), 42 + var dialogTemplate = getInstance(),
  43 + dialogStr = dialogTemplate(data),
39 $dialogBox, 44 $dialogBox,
40 defaultHideDuraton, 45 defaultHideDuraton,
41 dialogWrapperHammer; 46 dialogWrapperHammer;
@@ -73,6 +78,11 @@ exports.showDialog = function(data, callback, callbackForLeft) { @@ -73,6 +78,11 @@ exports.showDialog = function(data, callback, callbackForLeft) {
73 }, defaultHideDuraton); 78 }, defaultHideDuraton);
74 } 79 }
75 80
  81 + //禁止在dialog上可以上下滚动
  82 + $dialogWrapper.on('touchmove', function() {
  83 + return false;
  84 + });
  85 +
76 dialogWrapperHammer.on('tap', function(event) { 86 dialogWrapperHammer.on('tap', function(event) {
77 87
78 if ($(event.target).hasClass('dialog-left-btn')) { 88 if ($(event.target).hasClass('dialog-left-btn')) {
@@ -84,6 +94,7 @@ exports.showDialog = function(data, callback, callbackForLeft) { @@ -84,6 +94,7 @@ exports.showDialog = function(data, callback, callbackForLeft) {
84 callback(); 94 callback();
85 } 95 }
86 96
  97 + // 防止出现点透问题
87 event.preventDefault(); 98 event.preventDefault();
88 event.srcEvent.stopPropagation(); 99 event.srcEvent.stopPropagation();
89 }); 100 });
@@ -155,10 +155,10 @@ @@ -155,10 +155,10 @@
155 display: inline-block; 155 display: inline-block;
156 color: #fff; 156 color: #fff;
157 background: #d1021c; 157 background: #d1021c;
158 - border: 1px solid #9d0000;  
159 - @include border-radius(0.5rem);  
160 - padding: 4rem / $pxConvertRem 0.5rem;  
161 - margin-left: 0.2rem; 158 + @include border-radius(16rem / $pxConvertRem);
  159 + padding: 0rem / $pxConvertRem 12rem / $pxConvertRem;
  160 + margin-left: 8rem / $pxConvertRem;
  161 + font-size: 20rem / $pxConvertRem;
162 } 162 }
163 163
164 .la-tag { 164 .la-tag {