C端小程序
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.

53 regels
829 B

  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. back: {
  17. type: Boolean,
  18. value: false
  19. },
  20. home: {
  21. type: Boolean,
  22. value: false
  23. }
  24. },
  25. data: {
  26. statusBarHeight: app.statusBarHeight + 'px',
  27. navigationBarHeight: (app.statusBarHeight + 44) + 'px'
  28. },
  29. methods: {
  30. backHome: function () {
  31. wx.switchTab({
  32. url: '/index/index',
  33. })
  34. },
  35. back: function () {
  36. wx.navigateBack({
  37. delta: 1
  38. })
  39. }
  40. },
  41. attached: function(){
  42. let pages = getCurrentPages();
  43. if (pages.length <= 1) {
  44. this.setData({
  45. back: false
  46. })
  47. }
  48. }
  49. })