myRecharge.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. function MyRecharge(){
  2. Common.call(this)
  3. }
  4. MyRecharge.prototype = new Common()
  5. MyRecharge.prototype.constructor = MyRecharge
  6. MyRecharge.prototype.renderPage = function(obj){
  7. if(obj.type == 1){
  8. // 挑战为空
  9. $('.recharge_null').show()
  10. }else if(obj.type == 2){
  11. $('.recharge_main').show()
  12. }
  13. }
  14. MyRecharge.prototype.init = function(){
  15. var that = this
  16. if(code == 0 ){
  17. this.renderPage({
  18. type: 2
  19. })
  20. }else{
  21. this.renderPage({
  22. type: 1
  23. })
  24. }
  25. this.renderList()
  26. $('.null_btn').click(function(){
  27. try{
  28. window.history.go(-1)
  29. }catch(err){
  30. alert(err)
  31. }
  32. // that.goUrl({
  33. // url: '/php/readchange'
  34. // })
  35. })
  36. }
  37. // 渲染页面
  38. MyRecharge.prototype.renderList = function(){
  39. $('.recharge_common').forEach(function(val){
  40. if($(val).find('.recharge_item').length == 0){
  41. $(val).hide()
  42. }
  43. });
  44. }
  45. var myRechargeObj = new MyRecharge()
  46. myRechargeObj.init()