input_number.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var app = getApp();
  2. const util = require('../../utils/utils.js')
  3. Page({
  4. data: {
  5. code: '',
  6. arr: [],
  7. inputLen: 11,
  8. isFocus: false,
  9. img:app.globalData.imgUrl
  10. },
  11. onLoad: function(options) {
  12. wx.setNavigationBarTitle({
  13. title: app.globalData.title
  14. })
  15. },
  16. onFocus: function(e) {
  17. var that = this;
  18. that.setData({
  19. isFocus: true
  20. });
  21. },
  22. setValue: function(e) {
  23. var that = this;
  24. that.setData({
  25. code: e.detail.value
  26. });
  27. },
  28. start: util.throttle(function () {
  29. var that = this;
  30. if (that.data.code != '') {
  31. wx.navigateTo({
  32. url: '../sweep_code/sweep_code?code=' + that.data.code,
  33. })
  34. } else {
  35. wx.showToast({
  36. title: '请输入车牌号',
  37. icon: 'none',
  38. duration: 2000
  39. })
  40. }
  41. }, 1500),
  42. onReady: function() {
  43. },
  44. onShow: function() {
  45. },
  46. onHide: function() {
  47. },
  48. onUnload: function() {
  49. },
  50. onPullDownRefresh: function() {
  51. },
  52. onReachBottom: function() {
  53. },
  54. onShareAppMessage: function() {
  55. }
  56. })