(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/shopping/prescribe"],{335:function(t,e,n){"use strict";(function(t,e){var i=n(4);n(26);i(n(25));var r=i(n(336));t.__webpack_require_UNI_MP_PLUGIN__=n,e(r.default)}).call(this,n(1)["default"],n(2)["createPage"])},336:function(t,e,n){"use strict";n.r(e);var i=n(337),r=n(339);for(var s in r)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(s);n(343);var o,a=n(34),c=Object(a["default"])(r["default"],i["render"],i["staticRenderFns"],!1,null,null,null,!1,i["components"],o);c.options.__file="pages/shopping/prescribe.vue",e["default"]=c.exports},337:function(t,e,n){"use strict";n.r(e);var i=n(338);n.d(e,"render",(function(){return i["render"]})),n.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(e,"components",(function(){return i["components"]}))},338:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return r})),n.d(e,"staticRenderFns",(function(){return o})),n.d(e,"recyclableRender",(function(){return s})),n.d(e,"components",(function(){return i}));var r=function(){var t=this,e=t.$createElement,n=(t._self._c,t.patient.length),i=n>0?t.__map(t.patient,(function(e,n){var i=t.__get_orig(e),r=t.utils.getAge(e.birthday);return{$orig:i,g1:r}})):null,r=t.imgList.length,s=t.imgList.length;t.$mp.data=Object.assign({},{$root:{g0:n,l0:i,g2:r,g3:s}})},s=!1,o=[];r._withStripped=!0},339:function(t,e,n){"use strict";n.r(e);var i=n(340),r=n.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);e["default"]=r.a},340:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(273),r=n(197),s=n(341),o=n(342),a={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 n=this;this.orderId=e.orderId,this.getPatientList(),t.$on("refreshPatient",(function(){n.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,i.getStoreOrderById)(e).then((function(e){200==e.code&&(t.order=e.order)}),(function(t){}))},getWeixinPrescribeTemps:function(){var t=this;(0,r.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 n=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){n.imgList.push(JSON.parse(t.data).url)}})}})},previewImage:function(e){t.previewImage({urls:this.imgList,current:this.imgList[e]})},delImg:function(e){var n=this;t.showModal({title:"提示",content:"确定要删除这张图片吗？",cancelText:"取消",confirmText:"确定",success:function(t){t.confirm&&n.imgList.splice(e,1)}})},submit:function(){var e=this,n=this;if(null!=this.patientId){t.showLoading({title:"正在处理中"});var i={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,s.doPrescribe)(i).then((function(i){if(200==i.code){t.hideLoading(),t.showToast({icon:"success",title:i.msg});var r=i.order;t.requestSubscribeMessage({tmplIds:e.temps,success:function(e){setTimeout((function(){1!=r.paid?t.redirectTo({url:"./paymentOrder?orderId="+n.order.id}):t.navigateBack({delta:1})}),500)},fail:function(e){setTimeout((function(){1!=r.paid?t.redirectTo({url:"./paymentOrder?orderId="+n.order.id}):t.navigateBack({delta:1})}),500)}})}else t.showToast({icon:"none",title:i.msg})}),(function(t){}))}else t.showToast({icon:"none",title:"请选择患者"})},getPatientList:function(){var e=this;t.showLoading({title:"正在加载中"}),(0,o.getPatientList)().then((function(n){t.hideLoading(),200==n.code?e.patient=n.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=a}).call(this,n(2)["default"])},343:function(t,e,n){"use strict";n.r(e);var i=n(344),r=n.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);e["default"]=r.a},344:function(t,e,n){}},[[335,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/shopping/prescribe.js.map