guide.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // module/chats/components/guide/guide.ts
  2. Component({
  3. lifetimes: {},
  4. properties: {
  5. id: { type: String, value: '' },
  6. active: { type: Boolean, value: false },
  7. analysisCount: { type: Number, value: 0 },
  8. },
  9. data: {
  10. result: [] as string[],
  11. result2: false,
  12. },
  13. methods: {
  14. handleA() {
  15. if (this.data.active){
  16. this.triggerEvent('next', { component: 'questionnaire', scroll: true});
  17. this.triggerEvent('nextType', { MessageType:2 });
  18. }
  19. },
  20. handleB() {
  21. if (this.data.active) wx.navigateTo({
  22. url: '/module/health/pages/status/status',
  23. events: { update: this._update.bind(this) }
  24. });
  25. },
  26. handleC() {
  27. if (this.data.active) wx.navigateTo({
  28. url: '/module/user/pages/user-edit/user-edit',
  29. events: {
  30. update2: () => {
  31. this.setData({ result2: true });
  32. this.triggerEvent('next', { component: 'guide', scroll: true });
  33. }
  34. }
  35. });
  36. },
  37. handleD() {
  38. // if (this.data.active) wx.navigateBack();
  39. if (this.data.active) {
  40. console.log("tiaohzuan1")
  41. wx.redirectTo({url:"/pages/home/home"})
  42. }
  43. },
  44. _update(result: string[]) {
  45. if (result.length) {
  46. this.setData({ result });
  47. this.triggerEvent('next', { component: 'guide', scroll: true });
  48. } else {
  49. setTimeout(() => wx.showToast({ title: `没有更改项`, icon: 'none' }), 300)
  50. }
  51. }
  52. }
  53. })