wait-for-do-input.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. var sysT = require('../../../../tool/sys-tool.js')
  2. var businessT = require('../../../../tool/business-tool.js')
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. adapter: {
  9. suffix: ''
  10. },
  11. text: {
  12. placeholder: '',
  13. value: ''
  14. }
  15. },
  16. inputAction: function (sender) {
  17. this.data.text.value = sender.detail.value
  18. },
  19. submitAction: businessT.action(function (sender) {
  20. businessT.debugLog('sub')
  21. if (this.data.text.value == '') {
  22. wx.showToast({
  23. title: '请输入内容',
  24. icon: 'none'
  25. })
  26. return
  27. }
  28. var pages = getCurrentPages()
  29. pages[pages.length - 2].finishUploadMemo(this.data.text.value)
  30. wx.navigateBack({
  31. })
  32. }),
  33. /**
  34. * 生命周期函数--监听页面加载
  35. */
  36. onLoad: function (options) {
  37. wx.setNavigationBarTitle({
  38. title: options.t
  39. })
  40. this.data.text.placeholder = options.t
  41. this.data.adapter = {
  42. suffix: sysT.suffixOfClass(),
  43. }
  44. this.setData({
  45. text: this.data.text,
  46. adapter: this.data.adapter
  47. })
  48. },
  49. /**
  50. * 生命周期函数--监听页面初次渲染完成
  51. */
  52. onReady: function () {
  53. },
  54. /**
  55. * 生命周期函数--监听页面显示
  56. */
  57. onShow: function () {
  58. },
  59. /**
  60. * 生命周期函数--监听页面隐藏
  61. */
  62. onHide: function () {
  63. },
  64. /**
  65. * 生命周期函数--监听页面卸载
  66. */
  67. onUnload: function () {
  68. },
  69. /**
  70. * 页面相关事件处理函数--监听用户下拉动作
  71. */
  72. onPullDownRefresh: function () {
  73. },
  74. /**
  75. * 页面上拉触底事件的处理函数
  76. */
  77. onReachBottom: function () {
  78. },
  79. /**
  80. * 用户点击右上角分享
  81. */
  82. onShareAppMessage: function () {
  83. return {
  84. path: '/page/home/index',
  85. imageUrl: '../../../../icon/public/share_img.png',
  86. title: '自助缴社保公积金,覆盖200多个城市,专业团队操作'
  87. }
  88. }
  89. })