index.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. const App = getApp();
  2. Component({
  3. options: {
  4. addGlobalClass: true,
  5. },
  6. /**
  7. * 组件的对外属性,是属性名到属性设置的映射表
  8. */
  9. properties: {
  10. activePos: String,
  11. },
  12. /**
  13. * 组件的内部数据,和 properties 一同用于组件的模板渲染
  14. */
  15. data: {
  16. isClose: true
  17. },
  18. // 组件数据字段监听器,用于监听 properties 和 data 的变化
  19. observers: {
  20. },
  21. lifetimes: {
  22. attached: function () {
  23. this.setData({
  24. })
  25. },
  26. detached: function () {
  27. // 在组件实例被从页面节点树移除时执行
  28. },
  29. },
  30. /**
  31. * 组件的方法列表
  32. */
  33. methods: {
  34. //回退
  35. open(){
  36. this.setData({
  37. isClose: false
  38. })
  39. },
  40. close(){
  41. this.setData({
  42. isClose: true
  43. })
  44. },
  45. navBack: function () {
  46. wx.navigateBack({
  47. delta: 1
  48. })
  49. },
  50. //回主页
  51. toIndex: function () {
  52. wx.navigateTo({
  53. url: '/pages/admin/home/index/index'
  54. })
  55. },
  56. }
  57. })