pingOrder.js 3.1 KB

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