; layui.define(['form','flow','element'], function (e) { var s = layui.$, flow = layui.flow, element = layui.element, form = layui.form; element.on('tab(profit)', function(data){ var account = s(this).attr('lay-id'); s('.profit-list').empty(); flow.load({ elem: '.profit-list' ,done: function(page, next){ var lis = []; s.post('load.html',{page:page,account:account},function(res){ var lis = []; layui.each(res.data, function(index, item){ var li = ['
  • ', '

    ', ''+item['type_text']+'', '发生额:'+item['value']+'', '

    ', '

    ', ''+item['create_time']+'', '余额:'+item['amount']+'', '

    ', '
  • ']; lis.push(li.join('')); }); next(lis.join(''), page < res.pages); }); } }); }); var bill = function(){ if (s('.profit-list').length > 0) { element.tabChange('profit', 'coin') } } e('bill',new bill()) })