Authored by biao

增加支付中心点击效果, code review by XWG

@@ -143,6 +143,16 @@ function showPage() { @@ -143,6 +143,16 @@ function showPage() {
143 $pageList.css('visibility', 'visible'); 143 $pageList.css('visibility', 'visible');
144 } 144 }
145 145
  146 +function bindTouchedEvent() {
  147 + var $boxs = $('.box');
  148 +
  149 + $boxs.on('touchstart', function(e) {
  150 + $(this).addClass('bytouch');
  151 + }).on('touchend touchcancel', function() {
  152 + $boxs.removeClass('bytouch');
  153 + });
  154 +}
  155 +
146 if (wxHammer) { 156 if (wxHammer) {
147 wxHammer.on('tap', function() { 157 wxHammer.on('tap', function() {
148 callpay(theOrderCode); 158 callpay(theOrderCode);
@@ -154,9 +164,11 @@ function main() { @@ -154,9 +164,11 @@ function main() {
154 loading.hideLoadingMask(); 164 loading.hideLoadingMask();
155 showPage(); 165 showPage();
156 loadIcon(); 166 loadIcon();
  167 + bindTouchedEvent();
157 } 168 }
158 169
159 loading.showLoadingMask(); 170 loading.showLoadingMask();
160 171
161 $(document).ready(main); 172 $(document).ready(main);
162 173
  174 +
@@ -5,6 +5,10 @@ @@ -5,6 +5,10 @@
5 visibility: hidden; 5 visibility: hidden;
6 } 6 }
7 7
  8 + .box.bytouch {
  9 + background-color:#eee;
  10 + }
  11 +
8 .box { 12 .box {
9 border: 1px solid #eee; 13 border: 1px solid #eee;
10 border-radius: 10rem / $pxConvertRem; 14 border-radius: 10rem / $pxConvertRem;
@@ -23,6 +27,7 @@ @@ -23,6 +27,7 @@
23 @include flexbox((display: flex, align-items: center)); 27 @include flexbox((display: flex, align-items: center));
24 } 28 }
25 29
  30 +
26 .icon { 31 .icon {
27 width: 15%; 32 width: 15%;
28 33
@@ -38,7 +43,7 @@ @@ -38,7 +43,7 @@
38 height: 60rem / $pxConvertRem; 43 height: 60rem / $pxConvertRem;
39 background-image: image-url("layout/pay-icon.png"); 44 background-image: image-url("layout/pay-icon.png");
40 background-size: 90%; 45 background-size: 90%;
41 - background-position-y: 8rem / $pxConvertRem; 46 + background-position-y: 12rem / $pxConvertRem;
42 background-position-x: center; 47 background-position-x: center;
43 background-repeat: no-repeat; 48 background-repeat: no-repeat;
44 } 49 }