123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import create from '../../../utils/create'
  2. import signUp from '../../../utils/signup'
  3. const app = getApp();
  4. create({
  5. behaviors: [],
  6. properties: {},
  7. data: {
  8. userInfo: {},
  9. sumData: [],
  10. UserSetList: [{
  11. id: 'main',
  12. value: '个人资料',
  13. icon: '/assets/images/icon16.png',
  14. router: '',
  15. showSum: false
  16. }, {
  17. id: 'activity',
  18. value: '我报名的活动',
  19. icon: '/assets/images/icon17.png',
  20. router: '',
  21. showSum: true
  22. }, {
  23. id: 'appointment',
  24. value: '预约记录',
  25. icon: '/assets/images/icon18.png',
  26. router: '',
  27. showSum: true
  28. }, {
  29. id: 'collectionBuilding',
  30. value: '收藏的楼盘',
  31. icon: '/assets/images/icon19.png',
  32. router: '',
  33. showSum: true
  34. }, {
  35. value: '购房工具',
  36. icon: '/assets/images/icon21.png',
  37. router: '',
  38. showSum: false
  39. }, {
  40. value: '电话咨询',
  41. icon: '/assets/images/icon22.png',
  42. router: '',
  43. showSum: false
  44. }]
  45. },
  46. methods: {
  47. checkUserLogin() {
  48. if (!this.data.userInfo.hasReg) {
  49. wx.showToast({
  50. title: '请先登陆再进行操作',
  51. icon: 'none',
  52. })
  53. return false
  54. }
  55. return true
  56. },
  57. ListTap(e) { // 用户选项点击事件
  58. if (e.target.dataset.type === 0) { // 个人资料
  59. if (!this.checkUserLogin()) {
  60. return
  61. }
  62. wx.navigateTo({
  63. url: '/pages/UserCenter/UserInfo/index'
  64. })
  65. } else if (e.target.dataset.type === 1) { // 我的福利社
  66. if (!this.checkUserLogin()) {
  67. return
  68. }
  69. wx.navigateTo({
  70. url: '/pages/MyWelfare/index'
  71. })
  72. } else if (e.target.dataset.type === 2) { // 预约记录
  73. if (!this.checkUserLogin()) {
  74. return
  75. }
  76. wx.navigateTo({
  77. url: '/pages/AppointmentHistory/index'
  78. })
  79. } else if (e.target.dataset.type === 3) { // 收藏的楼盘
  80. if (!this.checkUserLogin()) {
  81. return
  82. }
  83. wx.navigateTo({
  84. url: '/pages/MyCollectEstateList/index'
  85. })
  86. }
  87. // else if (e.target.dataset.type === 4) { // 楼盘展示
  88. // this.triggerEvent('myevent', {
  89. // index: 1
  90. // })
  91. // }
  92. else if (e.target.dataset.type === 4) { // 购房工具
  93. wx.navigateTo({
  94. url: '/pages/SelfServiceTool/index'
  95. })
  96. } else if (e.target.dataset.type === 5) { // 电话咨询
  97. wx.makePhoneCall({
  98. phoneNumber: '025-86505555'
  99. })
  100. }
  101. },
  102. signup(e) {
  103. signUp(e.detail.userInfo, app).then((dt) => {
  104. wx.showToast({
  105. title: '注册成功',
  106. icon: 'success',
  107. })
  108. })
  109. }
  110. }
  111. })