drugReportPing.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. var api_drugReport = require("../api/drugReport.js");
  4. require("../common/request.js");
  5. const _sfc_main = {
  6. data() {
  7. return {
  8. report: null,
  9. form: {
  10. reportId: null,
  11. pingStar: 0,
  12. pingContent: ""
  13. }
  14. };
  15. },
  16. onLoad(options) {
  17. this.form.reportId = options.reportId;
  18. this.getDrugReportById();
  19. },
  20. methods: {
  21. getDrugReportById() {
  22. var data = { reportId: this.form.reportId };
  23. api_drugReport.getDrugReportById(data).then((res) => {
  24. if (res.code == 200) {
  25. this.report = res.data;
  26. }
  27. }, (err) => {
  28. });
  29. },
  30. submit() {
  31. common_vendor.index.showLoading({
  32. title: "\u5904\u7406\u4E2D..."
  33. });
  34. api_drugReport.pingReport(this.form).then((res) => {
  35. common_vendor.index.hideLoading();
  36. if (res.code == 200) {
  37. common_vendor.index.showToast({
  38. icon: "success",
  39. title: "\u8BC4\u4EF7\u6210\u529F"
  40. });
  41. common_vendor.index.$emit("refreshDrugReportList");
  42. setTimeout(function() {
  43. common_vendor.index.navigateBack({
  44. delta: 1
  45. });
  46. }, 2e3);
  47. } else {
  48. common_vendor.index.showToast({
  49. icon: "none",
  50. title: res.msg
  51. });
  52. }
  53. }, (rej) => {
  54. });
  55. }
  56. }
  57. };
  58. if (!Array) {
  59. const _easycom_u_rate2 = common_vendor.resolveComponent("u-rate");
  60. _easycom_u_rate2();
  61. }
  62. const _easycom_u_rate = () => "../uni_modules/uview-plus/components/u-rate/u-rate.js";
  63. if (!Math) {
  64. _easycom_u_rate();
  65. }
  66. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  67. return common_vendor.e({
  68. a: $data.report != null
  69. }, $data.report != null ? {
  70. b: $data.report.avatar,
  71. c: common_vendor.t($data.report.doctorName)
  72. } : {}, {
  73. d: common_vendor.o(($event) => $data.form.pingStar = $event),
  74. e: common_vendor.p({
  75. size: "24",
  76. ["active-color"]: "#fcab36",
  77. modelValue: $data.form.pingStar
  78. }),
  79. f: $data.form.pingContent,
  80. g: common_vendor.o(($event) => $data.form.pingContent = $event.detail.value),
  81. h: common_vendor.t($data.form.pingContent.length),
  82. i: common_vendor.o(($event) => $options.submit())
  83. });
  84. }
  85. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-449be131"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_user/drugReportPing.vue"]]);
  86. wx.createPage(MiniProgramPage);