微信小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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