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