抖音b端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.3 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. tt.switchTab({
  39. url: `/pages/main/main`,
  40. success(res) {
  41. console.log(`${res}`);
  42. },
  43. fail(res) {
  44. console.log(`switchTab调用失败`);
  45. },
  46. });
  47. },
  48. bindPickerChange: function (e) {
  49. console.log('picker发送选择改变,携带值为', e.detail.value)
  50. this.setData({
  51. index: e.detail.value
  52. })
  53. },
  54. back: function () {
  55. tt.navigateBack({
  56. delta: 1
  57. })
  58. }
  59. },
  60. attached: function(){
  61. let pages = getCurrentPages();
  62. if (pages.length <= 1) {
  63. this.setData({
  64. back: false
  65. })
  66. }
  67. }
  68. })