|
@@ -3,7 +3,7 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
|
|
|
var myDate = new Date();
|
|
|
var year = myDate.getFullYear();
|
|
|
var month = myDate.getMonth();
|
|
|
-
|
|
|
+ var BalancsView=false;
|
|
|
function back (event) {
|
|
|
event.preventDefault();
|
|
|
$(document).trigger('spa:navigate', {
|
|
@@ -59,6 +59,7 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
|
|
|
var type = $('.control-item.active').data('order-type');
|
|
|
var startTime = $('.year-span').text()+'-'+$('.month-span').text()+'-01';
|
|
|
var endTime = $('.year-span').text()+'-'+$('.month-span').text()+'-30';
|
|
|
+
|
|
|
$('.type-container', view).hide();
|
|
|
switch (type) {
|
|
|
case 1:
|
|
@@ -69,9 +70,16 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
|
|
|
end_time:endTime
|
|
|
},function(res){
|
|
|
var balanceLog = res.message;
|
|
|
+ for(var i=0;balanceLog.length;i++){
|
|
|
+ if(balanceLog[i].amount>0 && balanceLog[i].memo!=="微信下订单" && balanceLog[i].memo!=="下订单"){
|
|
|
+ BalancsView=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(BalancsView);
|
|
|
if (!cachePageData.massage) {
|
|
|
var tpl = template('balanceLog/productDescScroll', {
|
|
|
- balanceLog: balanceLog
|
|
|
+ balanceLog: balanceLog,
|
|
|
+ BalancsView:BalancsView,
|
|
|
});
|
|
|
$('.pad-b-1', view).html(tpl);
|
|
|
setTimeout(function () {
|
|
@@ -88,9 +96,17 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
|
|
|
end_time:endTime
|
|
|
},function(res){
|
|
|
var balanceLog = res.message;
|
|
|
+ console.log(balanceLog);
|
|
|
+ for(var i=0;i<balanceLog.length;i++){
|
|
|
+ if(balanceLog[i].memo=="微信下订单" || balanceLog[i].memo=="下订单" || balanceLog[i].amount<0 ){
|
|
|
+ BalancsView=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(BalancsView);
|
|
|
if (!cachePageData.massage) {
|
|
|
var tpl = template('balanceLog/orderContainer', {
|
|
|
- balanceLog: balanceLog
|
|
|
+ balanceLog: balanceLog,
|
|
|
+ BalancsView:BalancsView,
|
|
|
});
|
|
|
$('.list-content', view).html(tpl);
|
|
|
setTimeout(function () {
|
|
@@ -228,10 +244,20 @@ define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'addr
|
|
|
}, function (res) {
|
|
|
if (res.success) {
|
|
|
var balanceLog = res.message;
|
|
|
+ console.log(balanceLog);
|
|
|
+ for(var i=0;balanceLog.length;i++){
|
|
|
+
|
|
|
+ //console.log(balanceLog[i].amount);
|
|
|
+ // if(balanceLog[i].amount>0 && balanceLog[i].memo!=="微信下订单" && balanceLog[i].memo!=="下订单"){
|
|
|
+ // BalancsView=true;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+
|
|
|
if (!cachePageData.massage) {
|
|
|
var tpl = template('balanceLog/index', {
|
|
|
balanceLog: balanceLog,
|
|
|
year: year,
|
|
|
+ BalancsView:BalancsView,
|
|
|
month: month,
|
|
|
title:'余额明细',
|
|
|
userBalance: user.balance,
|