other-bank.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. var sysT = require('../../../tool/sys-tool.js')
  2. var businessT = require('../../../tool/business-tool.js')
  3. var publicData = require('../../../constant/data.js')
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. adapter: {
  10. bgHeight: '',
  11. suffix: ''
  12. },
  13. inputValue: '',
  14. },
  15. inputAction: function (sender) {
  16. this.data.inputValue = sender.detail.value
  17. this.setData({
  18. inputValue: this.data.inputValue
  19. })
  20. },
  21. saveAction: businessT.action(function (sender) {
  22. if (this.data.inputValue.length < publicData.minBankNameLength) {
  23. wx.showToast({
  24. title: '请输入正确的银行名称',
  25. icon: 'none'
  26. })
  27. return
  28. }
  29. var pages = getCurrentPages();
  30. var prevPage = pages[pages.length - 3]; //上上一个页面
  31. prevPage.data.data.bank = this.data.inputValue
  32. prevPage.data.refreshBank = true
  33. wx.navigateBack({
  34. delta: 2
  35. })
  36. }),
  37. /**
  38. * 生命周期函数--监听页面加载
  39. */
  40. onLoad: function (options) {
  41. sysT.adaptor()
  42. businessT.debugLog(sysT.usableHeight(112))
  43. this.data.adapter = {
  44. bgHeight: sysT.usableHeight(112),
  45. suffix: sysT.suffixOfClass(),
  46. }
  47. this.setData({
  48. adapter: this.data.adapter
  49. })
  50. },
  51. /**
  52. * 生命周期函数--监听页面初次渲染完成
  53. */
  54. onReady: function () {
  55. },
  56. /**
  57. * 生命周期函数--监听页面显示
  58. */
  59. onShow: function () {
  60. },
  61. /**
  62. * 生命周期函数--监听页面隐藏
  63. */
  64. onHide: function () {
  65. },
  66. /**
  67. * 生命周期函数--监听页面卸载
  68. */
  69. onUnload: function () {
  70. },
  71. /**
  72. * 页面相关事件处理函数--监听用户下拉动作
  73. */
  74. onPullDownRefresh: function () {
  75. },
  76. /**
  77. * 页面上拉触底事件的处理函数
  78. */
  79. onReachBottom: function () {
  80. },
  81. /**
  82. * 用户点击右上角分享
  83. */
  84. onShareAppMessage: function () {
  85. }
  86. })