(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/shopping/prescribe"],{"2bf4":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,i=(t._self._c,t.patient.length),n=i>0?t.__map(t.patient,(function(e,i){var n=t.__get_orig(e),s=t.utils.getAge(e.birthday);return{$orig:n,g1:s}})):null,s=t.imgList.length,o=t.imgList.length;t.$mp.data=Object.assign({},{$root:{g0:i,l0:n,g2:s,g3:o}})},s=[]},"36cd":function(t,e,i){},5531:function(t,e,i){"use strict";i.r(e);var n=i("2bf4"),s=i("5a1c");for(var o in s)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(o);i("7d69");var a=i("828b"),r=Object(a["a"])(s["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=r.exports},"5a1c":function(t,e,i){"use strict";i.r(e);var n=i("63b5"),s=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=s.a},"63b5":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("98ea"),s=i("caff"),o=i("1643"),a=i("9c88"),r={data:function(){return{statusBarHeight:t.getStorageSync("menuInfo").statusBarHeight,order:null,temps:[],imgList:[],orderId:null,patient:[],patientId:null,isAllergic:!1,isLiver:!1,isRenal:!1,isLactation:!1,chiefComplaint:null,historyIllness:null}},onLoad:function(e){var i=this;this.orderId=e.orderId,this.getPatientList(),t.$on("refreshPatient",(function(){i.getPatientList()})),this.getWeixinPrescribeTemps(),this.getStoreOrderById()},onShow:function(){this.getPatientList()},methods:{back:function(){t.showToast({icon:"none",title:"请填写资料提交处方，否则将无法发货"})},getStoreOrderById:function(){var t=this,e={orderId:this.orderId};(0,n.getStoreOrderById)(e).then((function(e){200==e.code&&(t.order=e.order)}),(function(t){}))},getWeixinPrescribeTemps:function(){var t=this;(0,s.getWeixinPrescribeTemps)().then((function(e){200==e.code&&(t.temps=e.temp,console.log(t.temps))}),(function(t){}))},chiefComplaintInput:function(t){this.chiefComplaint=t.detail.value},historyIllnessInput:function(t){this.historyIllness=t.detail.value},chooseImage:function(e){var i=this;t.chooseImage({count:4,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(e){t.uploadFile({url:t.getStorageSync("requestPath")+"/app/common/uploadOSS",filePath:e.tempFilePaths[0],name:"file",success:function(t){i.imgList.push(JSON.parse(t.data).url)}})}})},previewImage:function(e){t.previewImage({urls:this.imgList,current:this.imgList[e]})},delImg:function(e){var i=this;t.showModal({title:"提示",content:"确定要删除这张图片吗？",cancelText:"取消",confirmText:"确定",success:function(t){t.confirm&&i.imgList.splice(e,1)}})},submit:function(){var e=this,i=this;if(null!=this.patientId){t.showLoading({title:"正在处理中"});var n={patientId:this.patientId,orderId:this.orderId,isAllergic:this.isAllergic,isLiver:this.isLiver,isRenal:this.isRenal,isLactation:this.isLactation,chiefComplaint:this.chiefComplaint,historyIllness:this.historyIllness,recordPic:this.imgList.toString()};(0,o.doPrescribe)(n).then((function(n){if(200==n.code){t.hideLoading(),t.showToast({icon:"success",title:n.msg});var s=n.order;t.requestSubscribeMessage({tmplIds:e.temps,success:function(e){setTimeout((function(){1!=s.paid?t.redirectTo({url:"./paymentOrder?orderId="+i.order.id}):t.navigateBack({delta:1})}),500)},fail:function(e){setTimeout((function(){1!=s.paid?t.redirectTo({url:"./paymentOrder?orderId="+i.order.id}):t.navigateBack({delta:1})}),500)}})}else t.showToast({icon:"none",title:n.msg})}),(function(t){}))}else t.showToast({icon:"none",title:"请选择患者"})},getPatientList:function(){var e=this;t.showLoading({title:"正在加载中"}),(0,a.getPatientList)().then((function(i){t.hideLoading(),200==i.code?e.patient=i.data:t.showToast({icon:"none",title:"请求失败"})}),(function(t){}))},chosePatient:function(t){this.patientId=t.patientId},addPeople:function(){t.navigateTo({url:"/pages_user/user/patient"})},choseDise:function(t){this.activeDise=t}}};e.default=r}).call(this,i("df3c")["default"])},"7d69":function(t,e,i){"use strict";var n=i("36cd"),s=i.n(n);s.a},eecf:function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("584a");n(i("3240"));var s=n(i("5531"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(s.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])}},[["eecf","common/runtime","common/vendor"]]]);