123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- "use strict";
- var common_vendor = require("../common/vendor.js");
- var api_hospital = require("../api/hospital.js");
- var api_doctor = require("../api/doctor.js");
- require("../common/request.js");
- const _sfc_main = {
- data() {
- return {
- hospitalId: null,
- hospital: null,
- doctors: []
- };
- },
- onLoad(options) {
- this.hospitalId = options.hospitalId;
- this.getHospitalById();
- this.getDoctorList();
- },
- methods: {
- goMap() {
- common_vendor.index.openLocation({
- latitude: parseFloat(this.hospital.lat),
- longitude: parseFloat(this.hospital.lng),
- scale: 18,
- name: this.hospital.hospitalName,
- address: this.hospital.address,
- success: () => {
- console.log("\u5BFC\u822Asuccess");
- }
- });
- },
- getHospitalById() {
- var data = {
- hospitalId: this.hospitalId
- };
- api_hospital.getHospitalById(data).then((res) => {
- if (res.code == 200) {
- this.hospital = res.data;
- } else {
- common_vendor.index.showToast({
- icon: "none",
- title: "\u8BF7\u6C42\u5931\u8D25"
- });
- }
- });
- },
- getDoctorList() {
- var data = {
- hospitalId: this.hospitalId,
- pageNum: 1,
- pageSize: 10
- };
- api_doctor.getDoctorList(data).then((res) => {
- if (res.code == 200) {
- res.data.list.forEach(function(value, index, array) {
- value.prices = JSON.parse(value.priceJson);
- });
- this.doctors = res.data.list;
- } else {
- common_vendor.index.showToast({
- icon: "none",
- title: "\u8BF7\u6C42\u5931\u8D25"
- });
- }
- });
- },
- navTo(url) {
- common_vendor.index.navigateTo({
- url
- });
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $data.hospital.imgUrl,
- b: common_vendor.t($data.hospital.hospitalName),
- c: common_vendor.t($data.hospital.hospitalType),
- d: common_vendor.t($data.hospital.address),
- e: common_vendor.o(($event) => $options.goMap()),
- f: common_vendor.t($data.hospital.descs),
- g: $data.doctors.length > 0
- }, $data.doctors.length > 0 ? {
- h: common_vendor.f($data.doctors, (item, index, i0) => {
- return {
- a: item.avatar,
- b: common_vendor.t(item.doctorName),
- c: common_vendor.t(item.position),
- d: common_vendor.t(item.hospitalName),
- e: common_vendor.t(item.deptName),
- f: common_vendor.t(item.speciality),
- g: common_vendor.t(item.pingStar),
- h: common_vendor.t(item.orderNumber),
- i: common_vendor.f(item.prices, (price, index2, i1) => {
- return common_vendor.e({
- a: common_vendor.t(price.price.toFixed(2)),
- b: index2 == 0
- }, index2 == 0 ? {} : {});
- }),
- j: common_vendor.o(($event) => $options.navTo("/pages/doctor/doctorDetails?doctorId=" + item.doctorId))
- };
- })
- } : {});
- }
- var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-467e4d12"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/hospitalDetails.vue"]]);
- wx.createPage(MiniProgramPage);
|