C端小程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

65 строки
1.1 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. },
  35. methods: {
  36. backHome: function () {
  37. wx.switchTab({
  38. url: '/index/index',
  39. })
  40. },
  41. bindPickerChange: function (e) {
  42. console.log('picker发送选择改变,携带值为', e.detail.value)
  43. this.setData({
  44. index: e.detail.value
  45. })
  46. },
  47. back: function () {
  48. wx.navigateBack({
  49. delta: 1
  50. })
  51. }
  52. },
  53. attached: function(){
  54. let pages = getCurrentPages();
  55. if (pages.length <= 1) {
  56. this.setData({
  57. back: false
  58. })
  59. }
  60. }
  61. })