e 8 年之前
父节点
当前提交
8d35443a24

文件差异内容过多而无法显示
+ 0 - 0
www/webapp/o2o/dist/js/main.js


文件差异内容过多而无法显示
+ 0 - 0
www/webapp/o2o/dist/js/page/balanceLog.js


文件差异内容过多而无法显示
+ 3 - 3
www/webapp/o2o/js/build/template.js


+ 21 - 9
www/webapp/o2o/js/page/balanceLog.js

@@ -15,13 +15,21 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
     });
   }
 
-  function payCharge(a,b){
-    console.log($(a));
+  function payCharge(a,b,time){
     var c=parseInt($(a).text());
     if(b){
-      c++;
+      if(time=='month'){
+        if(c<12){
+          c++;
+        }
+      }else {
+        c++;
+      }
+
     }else {
-      c--;
+      if(c>1){
+        c--;
+      }
     }
     $(a).text(c)
   }
@@ -59,6 +67,9 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
           break;
           case 2:
           $('#reviewContainer').show();
+          year=$('.year-span').text();
+          month=$('.month-span').text();
+          console.log(month);
           setTimeout(function () {
             pageData.scroll = new IScroll('#orderContainer');
           }, 100);
@@ -81,19 +92,19 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
       // 加减
       $.newTouch('.btn-year-add',function(event){
         event.preventDefault();
-        payCharge($('.modal-box-year'),true);
+        payCharge($('.modal-box-year'),true,'year');
       },$view);
       $.newTouch('.btn-year-sub',function(event){
         event.preventDefault();
-        payCharge($('.modal-box-year'),false);
+        payCharge($('.modal-box-year'),false,'month');
       },$view);
       $.newTouch('.btn-month-add',function(event){
         event.preventDefault();
-        payCharge($('.modal-box-month'),true);
+        payCharge($('.modal-box-month'),true,'year');
       },$view);
       $.newTouch('.btn-month-sub',function(event){
         event.preventDefault();
-        payCharge($('.modal-box-month'),false);
+        payCharge($('.modal-box-month'),false,'month');
       },$view);
       // 取消
       $.newTouch('.cancel',function(event){
@@ -105,7 +116,8 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
       $.newTouch('.determine',function(event){
         event.preventDefault();
         $('.modal-box').css('display','none')
-        console.log('测试');
+        $('.year-span').text($('.modal-box-year').text());
+        $('.month-span').text($('.modal-box-month').text());
       },$view);
 
 

部分文件因为文件数量过多而无法显示