家政小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 911B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. const $ = global;
  2. new $.Page({
  3. data: {
  4. comment: ''
  5. },
  6. onLoad(e) {
  7. const id = e.id || '';
  8. this.setData({
  9. id
  10. });
  11. },
  12. inputComment(e) {
  13. this.setData({
  14. comment: e.detail.value
  15. })
  16. },
  17. submit() {
  18. const {
  19. id,
  20. comment
  21. } = this.data;
  22. if (!id) return;
  23. if (!comment) {
  24. return $.wx.showToast({
  25. title: '内容不能为空'
  26. });
  27. }
  28. $.wx.showToast({
  29. title: '加载中'
  30. }, 'loading');
  31. $.request('systemController/feedback', 'POST', {
  32. comment,
  33. id
  34. }).then(res => {
  35. $.wx.showToast({
  36. title: '提交成功'
  37. });
  38. setTimeout(function () {
  39. $.router.back();
  40. }, 2000);
  41. })
  42. }
  43. });