微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // pages/bank/bank.js
  2. import * as UTIL from '../../utils/util.js';
  3. import * as API from '../../utils/API.js';
  4. const app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. isIPX: app.globalData.isIPX,
  11. depositList:[],
  12. bankTypeOptions:[],
  13. value:"",
  14. scrollHeight:''
  15. },
  16. goAdd(){
  17. wx.navigateTo({
  18. url: 'add/add',
  19. })
  20. },
  21. back:function(){
  22. wx.navigateBack({
  23. delta: 1
  24. })
  25. },
  26. /**
  27. * 生命周期函数--监听页面加载
  28. */
  29. onLoad(options) {
  30. var _this = this;
  31. let qu = wx.createSelectorQuery()
  32. qu.select("#top_view2").boundingClientRect()
  33. qu.exec(res => {
  34. _this.setData({
  35. scrollHeight:wx.getSystemInfoSync().windowHeight-res[0].top
  36. })
  37. })
  38. },
  39. /**
  40. * 生命周期函数--监听页面初次渲染完成
  41. */
  42. onReady() {
  43. this.onShow();
  44. },
  45. /**
  46. * 生命周期函数--监听页面显示
  47. */
  48. onShow() {
  49. var that = this;
  50. //所属银行
  51. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
  52. success: (res) => {
  53. this.setData({
  54. bankTypeOptions:res.data,
  55. });
  56. let param = {
  57. 'bankDeposit':this.data.value
  58. }
  59. UTIL.httpRequest(API.URL_GET_DEPOSITLIST, param,{
  60. success: (response) => {
  61. if (response.code == API.SUCCESS_CODE) {
  62. for (let i = 0; i < response.rows.length; i++) {
  63. response.rows[i].bankTypeText = UTIL.getTransform(response.rows[i].bankType,res.data);
  64. response.rows[i].payeePaymentLines = response.rows[i].payeePaymentLines.substr(0,4)+'****'
  65. }
  66. that.setData({
  67. depositList:response.rows
  68. })
  69. }
  70. }
  71. })
  72. }
  73. })
  74. },
  75. goSearch(e){
  76. this.setData({'value':e.detail})
  77. this.onShow()
  78. },
  79. delete(e){
  80. var that = this;
  81. UTIL.httpRequest(API.URL_GET_DEPOSITDELETE + e.currentTarget.dataset.id, {method:'GET'},{
  82. success: (res) => {
  83. if (res.code == API.SUCCESS_CODE) {
  84. that.data.depositList.splice(e.currentTarget.dataset.index, 1);
  85. wx.showToast({
  86. title: '删除成功!',
  87. icon: 'success',
  88. duration: 2000
  89. })
  90. that.setData({
  91. depositList : that.data.depositList,
  92. })
  93. }
  94. }
  95. })
  96. },
  97. goUpdate(e){
  98. wx.navigateTo({
  99. url: 'add/add?id='+ e.currentTarget.dataset.id,
  100. })
  101. },
  102. /**
  103. * 生命周期函数--监听页面隐藏
  104. */
  105. onHide() {
  106. },
  107. /**
  108. * 生命周期函数--监听页面卸载
  109. */
  110. onUnload() {
  111. },
  112. /**
  113. * 页面相关事件处理函数--监听用户下拉动作
  114. */
  115. onPullDownRefresh() {
  116. },
  117. /**
  118. * 页面上拉触底事件的处理函数
  119. */
  120. onReachBottom() {
  121. },
  122. /**
  123. * 用户点击右上角分享
  124. */
  125. onShareAppMessage() {
  126. }
  127. })