e 8 years ago
parent
commit
f7f70033a9

File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/build/template.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/main.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/page/balanceLog.js


File diff suppressed because it is too large
+ 0 - 1
www/webapp/o2o/js/build/template.js


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

@@ -34,6 +34,34 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
     $(a).text(c)
   }
 
+
+// 刷新样式
+function time(view){
+  year=$('.year-span').text();
+  month=$('.month-span').text();
+  var startTime = year+'-'+month+'-01';
+  var endTime = year+'-'+month+'-30';
+  api.getUserTotalOrder({
+    user_id: user.id,
+    start_time: startTime,
+    end_time: endTime,
+  }, function (res) {
+    if (res.success) {
+      $('.total').text(res.message.total);
+      var tpl = template('myOrder/list', {
+        orders: res.message.result
+      });
+      $('.list-content', view).html(tpl);
+      setTimeout(function () {
+        pageData.scroll = new IScroll('#orderContainer');
+      }, 100);
+    } else {
+      $doc.trigger('spa:openpanel', ['simpleAlert', {
+        message: '暂无订单数据!'
+      }])
+    }
+  })
+}
   var cachePageData = {}; //page内部的数据传递
 
   return {
@@ -55,7 +83,8 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
       });
 
       //tab切换
-      $.newTouch('.control-item', function (event) {
+      $.newTouch('.order-type-control .control-item', function (event) {
+        event.preventDefault();
         var type = $(this).data('order-type');
         $('.type-container', $view).hide();
         switch (type) {
@@ -67,12 +96,7 @@ 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);
+          time($view);
           break;
         }
       }, $view);
@@ -96,11 +120,11 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
       },$view);
       $.newTouch('.btn-year-sub',function(event){
         event.preventDefault();
-        payCharge($('.modal-box-year'),false,'month');
+        payCharge($('.modal-box-year'),false,'year');
       },$view);
       $.newTouch('.btn-month-add',function(event){
         event.preventDefault();
-        payCharge($('.modal-box-month'),true,'year');
+        payCharge($('.modal-box-month'),true,'month');
       },$view);
       $.newTouch('.btn-month-sub',function(event){
         event.preventDefault();
@@ -118,6 +142,7 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
         $('.modal-box').css('display','none')
         $('.year-span').text($('.modal-box-year').text());
         $('.month-span').text($('.modal-box-month').text());
+        time($view);
       },$view);
 
 

+ 9 - 3
www/webapp/o2o/tpl/balanceLog/index.html

@@ -12,8 +12,8 @@
             </div>
           </div>
           <div class="width-percent-33 expenditure">
-            <div>当月支出</div>
-            <div>{{total}}元</div>
+            <div>支出</div>
+            <div><span class="total">{{total}}</span>元</div>
           </div>
           <div class="width-percent-33 remaining">
             <div>余额</div>
@@ -50,7 +50,13 @@
               <div id="orderContainer" class="scroll-container box-flex-1">
                 <div class="scroller">
                   <ul class="table-view list-content">
-                    {{include '../myOrder/list'}}
+                    {{if orders.length==0}}
+                    <div style="text-align:cernter;padding:5px;width:100%;font-size:15px;line-height:25px;">
+                      该月暂无订单数据
+                    </div>
+                    {{else}}
+                      {{include '../myOrder/list'}}
+                    {{/if}}
                   </ul>
                   <div class="btn-more-container box-center hide">
                     <a class="btn btn-block btn-more-review">加载更多</a>

Some files were not shown because too many files changed in this diff