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.

66 line
1.2 KiB

  1. const app = getApp()
  2. Component({
  3. properties: {
  4. background: {
  5. type: String,
  6. value: '#F4F5F9'
  7. },
  8. color: {
  9. type: String,
  10. value: '#000'
  11. },
  12. text: {
  13. type: String,
  14. value: 'Wechat'
  15. },
  16. showLocationIf: {
  17. type: Boolean,
  18. value: false
  19. },
  20. back: {
  21. type: Boolean,
  22. value: false
  23. },
  24. home: {
  25. type: Boolean,
  26. value: false
  27. }
  28. },
  29. data: {
  30. array: ['A广场', 'B广场-北京西单'],
  31. index: 1,
  32. statusBarHeight: app.statusBarHeight + 'px',
  33. navigationBarHeight: (app.statusBarHeight + 44) + 'px',
  34. imgHttps: app.globalData.imgHttps,
  35. },
  36. methods: {
  37. backHome: function () {
  38. wx.switchTab({
  39. url: '/index/index',
  40. })
  41. },
  42. bindPickerChange: function (e) {
  43. console.log('picker发送选择改变,携带值为', e.detail.value)
  44. this.setData({
  45. index: e.detail.value
  46. })
  47. },
  48. back: function () {
  49. wx.navigateBack({
  50. delta: 1
  51. })
  52. }
  53. },
  54. attached: function(){
  55. let pages = getCurrentPages();
  56. if (pages.length <= 1) {
  57. this.setData({
  58. back: false
  59. })
  60. }
  61. }
  62. })