微信小程序
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 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. },
  15. goAdd(){
  16. wx.navigateTo({
  17. url: 'add/add',
  18. })
  19. },
  20. back:function(){
  21. wx.navigateBack({
  22. delta: 1
  23. })
  24. },
  25. /**
  26. * 生命周期函数--监听页面加载
  27. */
  28. onLoad(options) {
  29. },
  30. /**
  31. * 生命周期函数--监听页面初次渲染完成
  32. */
  33. onReady() {
  34. this.onShow();
  35. },
  36. /**
  37. * 生命周期函数--监听页面显示
  38. */
  39. onShow() {
  40. var that = this;
  41. //所属银行
  42. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
  43. success: (res) => {
  44. this.setData({
  45. bankTypeOptions:res.data,
  46. });
  47. let param = {
  48. 'bankDeposit':this.data.value
  49. }
  50. console.log(2);
  51. UTIL.httpRequest(API.URL_GET_DEPOSITLIST, param,{
  52. success: (response) => {
  53. if (response.code == API.SUCCESS_CODE) {
  54. for (let i = 0; i < response.rows.length; i++) {
  55. response.rows[i].bankTypeText = UTIL.getTransform(response.rows[i].bankType,res.data);
  56. response.rows[i].payeePaymentLines = response.rows[i].payeePaymentLines.substr(0,4)+'****'
  57. if(i == response.rows.length-1){
  58. that.setData({
  59. depositList:response.rows
  60. })
  61. }
  62. }
  63. }
  64. }
  65. })
  66. }
  67. })
  68. },
  69. goSearch(e){
  70. this.setData({'value':e.detail})
  71. this.onShow()
  72. },
  73. delete(e){
  74. var that = this;
  75. UTIL.httpRequest(API.URL_GET_DEPOSITDELETE + e.currentTarget.dataset.id, {method:'GET'},{
  76. success: (res) => {
  77. if (res.code == API.SUCCESS_CODE) {
  78. that.data.depositList.splice(e.currentTarget.dataset.index, 1);
  79. wx.showToast({
  80. title: '删除成功!',
  81. icon: 'success',
  82. duration: 2000
  83. })
  84. that.setData({
  85. depositList : that.data.depositList,
  86. })
  87. }
  88. }
  89. })
  90. },
  91. goUpdate(e){
  92. wx.navigateTo({
  93. url: 'add/add?id='+ e.currentTarget.dataset.id,
  94. })
  95. },
  96. /**
  97. * 生命周期函数--监听页面隐藏
  98. */
  99. onHide() {
  100. },
  101. /**
  102. * 生命周期函数--监听页面卸载
  103. */
  104. onUnload() {
  105. },
  106. /**
  107. * 页面相关事件处理函数--监听用户下拉动作
  108. */
  109. onPullDownRefresh() {
  110. },
  111. /**
  112. * 页面上拉触底事件的处理函数
  113. */
  114. onReachBottom() {
  115. },
  116. /**
  117. * 用户点击右上角分享
  118. */
  119. onShareAppMessage() {
  120. }
  121. })