Authored by 毕凯

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

@@ -12,30 +12,35 @@ var $dialogWrapper, @@ -12,30 +12,35 @@ var $dialogWrapper,
12 dialogTpl, 12 dialogTpl,
13 dialogTemplate; 13 dialogTemplate;
14 14
15 -  
16 -dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +  
17 - '<div class="dialog-box">' +  
18 - '{{# hasHeader}}' +  
19 - '{{/ hasHeader}}' +  
20 - '<div class="dialog-content">{{dialogText}}</div>' +  
21 - '{{# hasFooter}}' +  
22 - '<div class="dialog-footer">' +  
23 - '{{# leftBtnText}}' +  
24 - '<span class="dialog-left-btn">{{.}}</span>' +  
25 - '{{/ leftBtnText}}' +  
26 - '{{# rightBtnText}}' +  
27 - '<span class="dialog-right-btn">{{.}}</span>' +  
28 - '{{/ rightBtnText}}' +  
29 - '</div>' +  
30 - '{{/ hasFooter}}' +  
31 - '</div>' + 15 +function getInstance() {
  16 + if (dialogTpl === undefined) {
  17 + dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
  18 + '<div class="dialog-box">' +
  19 + '{{# hasHeader}}' +
  20 + '{{/ hasHeader}}' +
  21 + '<div class="dialog-content">{{dialogText}}</div>' +
  22 + '{{# hasFooter}}' +
  23 + '<div class="dialog-footer">' +
  24 + '{{# leftBtnText}}' +
  25 + '<span class="dialog-left-btn">{{.}}</span>' +
  26 + '{{/ leftBtnText}}' +
  27 + '{{# rightBtnText}}' +
  28 + '<span class="dialog-right-btn">{{.}}</span>' +
  29 + '{{/ rightBtnText}}' +
  30 + '</div>' +
  31 + '{{/ hasFooter}}' +
  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 {