guide.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. },
  40. _update(result: string[]) {
  41. if (result.length) {
  42. this.setData({ result });
  43. this.triggerEvent('next', { component: 'guide', scroll: true });
  44. } else {
  45. setTimeout(() => wx.showToast({ title: `没有更改项`, icon: 'none' }), 300)
  46. }
  47. }
  48. }
  49. })