guide.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. },
  8. data: {
  9. result: [] as string[],
  10. result2: false,
  11. },
  12. methods: {
  13. handleA() {
  14. if (this.data.active){
  15. this.triggerEvent('next', { component: 'questionnaire', scroll: true});
  16. this.triggerEvent('nextType', { MessageType:2 });
  17. }
  18. },
  19. handleB() {
  20. if (this.data.active) wx.navigateTo({
  21. url: '/module/health/pages/status/status',
  22. events: { update: this._update.bind(this) }
  23. });
  24. },
  25. handleC() {
  26. if (this.data.active) wx.navigateTo({
  27. url: '/module/user/pages/user-edit/user-edit',
  28. events: {
  29. update2: () => {
  30. this.setData({ result2: true });
  31. this.triggerEvent('next', { component: 'guide', scroll: true });
  32. }
  33. }
  34. });
  35. },
  36. handleD() {
  37. if (this.data.active) wx.navigateBack();
  38. },
  39. _update(result: string[]) {
  40. if (result.length) {
  41. this.setData({ result });
  42. this.triggerEvent('next', { component: 'guide', scroll: true });
  43. } else {
  44. setTimeout(() => wx.showToast({ title: `没有更改项`, icon: 'none' }), 300)
  45. }
  46. }
  47. }
  48. })