123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- "use strict";
- var common_vendor = require("../../common/vendor.js");
- var api_healthTongue = require("../../api/healthTongue.js");
- require("../../common/request.js");
- const _sfc_main = {
- data() {
- return {
- patient: null,
- height: 0,
- url: null,
- flag: true
- };
- },
- onLoad(options) {
- console.log(options);
- this.url = options.url;
- const query = common_vendor.index.createSelectorQuery().in(this);
- query.select("#photo-footer-btn").boundingClientRect((data) => {
- console.log(data.height);
- this.height = common_vendor.index.getSystemInfoSync().screenHeight - data.height;
- }).exec();
- var that = this;
- common_vendor.index.$on("refreshOrderPatient", (res) => {
- console.log(res);
- that.patient = res;
- });
- },
- methods: {
- addPatient() {
- common_vendor.index.navigateTo({
- url: "/pages_user/patient"
- });
- },
- back() {
- common_vendor.index.navigateBack();
- },
- submit() {
- if (!this.flag) {
- return;
- }
- this.flag = false;
- common_vendor.index.showLoading({
- title: "\u5904\u7406\u4E2D..."
- });
- common_vendor.index.uploadFile({
- url: common_vendor.index.getStorageSync("requestPath") + "/app/common/uploadOSS",
- filePath: this.url,
- name: "file",
- formData: {
- "user": "test"
- },
- success: (uploadFileRes) => {
- console.log(JSON.parse(uploadFileRes.data).url);
- if (this.patient != null) {
- var data = {
- patientId: this.patient.patientId,
- sex: this.patient.sex,
- name: this.patient.name,
- age: this.$getAge(this.patient.birthday),
- tongueUrl: JSON.parse(uploadFileRes.data).url
- };
- } else {
- var data = {
- tongueUrl: JSON.parse(uploadFileRes.data).url
- };
- }
- api_healthTongue.add(data).then((res) => {
- if (res.code == 200) {
- common_vendor.index.redirectTo({
- url: "/pages_user/tongue/report?id=" + res.data.id
- });
- } else {
- common_vendor.index.showToast({
- icon: "none",
- title: res.msg
- });
- }
- }, (rej) => {
- });
- }
- });
- },
- next() {
- common_vendor.index.redirectTo({
- url: "/pages_user/tongue/report"
- });
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $data.url != null
- }, $data.url != null ? {
- b: $data.url
- } : {}, {
- c: $data.height + "px",
- d: $data.patient == null
- }, $data.patient == null ? {
- e: common_vendor.o(($event) => $options.addPatient())
- } : {}, {
- f: $data.patient != null
- }, $data.patient != null ? common_vendor.e({
- g: common_vendor.t($data.patient.patientName),
- h: $data.patient.sex == 1
- }, $data.patient.sex == 1 ? {} : {}, {
- i: $data.patient.sex == 2
- }, $data.patient.sex == 2 ? {} : {}, {
- j: common_vendor.t(_ctx.$getAge($data.patient.birthday)),
- k: common_vendor.t(_ctx.$parseIdCard($data.patient.idCard)),
- l: common_vendor.o(($event) => $options.addPatient())
- }) : {}, {
- m: common_vendor.o((...args) => $options.back && $options.back(...args)),
- n: common_vendor.o(($event) => $options.submit())
- });
- }
- var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-25f30f46"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_user/tongue/photoPreview.vue"]]);
- wx.createPage(MiniProgramPage);
|