抖音c端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

85 satır
1.6 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. indexFlaig:null,
  35. },
  36. methods: {
  37. backHome: function () {
  38. app.globalData.selected = 0
  39. let tempUrl = '/index/index'
  40. tt.reLaunch({
  41. url: tempUrl,
  42. success(res) {
  43. console.log(`${res}`);
  44. },
  45. fail(err) {
  46. console.log(`navigateTo调用失败`,err,tempUrl);
  47. },
  48. });
  49. },
  50. bindPickerChange: function (e) {
  51. console.log('picker发送选择改变,携带值为', e.detail.value)
  52. this.setData({
  53. index: e.detail.value
  54. })
  55. },
  56. back:function() {
  57. tt.navigateBack({
  58. delta: 1,
  59. success(res) {
  60. console.log(`${res}`);
  61. },
  62. fail(err) {
  63. console.log(`navigateTo调用失败`,err);
  64. },
  65. })
  66. }
  67. },
  68. attached: function(){
  69. this.setData({
  70. indexFlaig:app.globalData.selected
  71. })
  72. console.log(this.properties);
  73. let pages = getCurrentPages();
  74. console.log(pages.length);
  75. if (pages.length <= 1) {
  76. this.setData({
  77. back: false
  78. })
  79. }
  80. }
  81. })